From 3b28446000d8d063c07ef320314ef493a9e0bffa Mon Sep 17 00:00:00 2001 From: HasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com> Date: Tue, 29 Oct 2024 23:55:41 +0200 Subject: [PATCH 001/227] fix: support watch flag to enable watching other files than the main module on serve subcommand (#26622) Closes #26618 --- cli/args/mod.rs | 4 ++ tests/integration/watcher_tests.rs | 70 ++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/cli/args/mod.rs b/cli/args/mod.rs index 927f43e85a..f5ecc04496 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1672,6 +1672,10 @@ impl CliOptions { if let DenoSubcommand::Run(RunFlags { watch: Some(WatchFlagsWithPaths { paths, .. }), .. + }) + | DenoSubcommand::Serve(ServeFlags { + watch: Some(WatchFlagsWithPaths { paths, .. }), + .. }) = &self.flags.subcommand { full_paths.extend(paths.iter().map(|path| self.initial_cwd.join(path))); diff --git a/tests/integration/watcher_tests.rs b/tests/integration/watcher_tests.rs index 122353bba9..d4705b8d53 100644 --- a/tests/integration/watcher_tests.rs +++ b/tests/integration/watcher_tests.rs @@ -566,6 +566,76 @@ async fn run_watch_no_dynamic() { check_alive_then_kill(child); } +#[flaky_test(tokio)] +async fn serve_watch_all() { + let t = TempDir::new(); + let main_file_to_watch = t.path().join("main_file_to_watch.js"); + main_file_to_watch.write( + "export default { + fetch(_request: Request) { + return new Response(\"aaaaaaqqq!\"); + }, + };", + ); + + let mut child = util::deno_cmd() + .current_dir(t.path()) + .arg("serve") + .arg("--watch=another_file.js") + .arg("-L") + .arg("debug") + .arg(&main_file_to_watch) + .env("NO_COLOR", "1") + .piped_output() + .spawn() + .unwrap(); + let (mut stdout_lines, mut stderr_lines) = child_lines(&mut child); + + wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await; + + // Change content of the file + main_file_to_watch.write( + "export default { + fetch(_request: Request) { + return new Response(\"aaaaaaqqq123!\"); + }, + };", + ); + wait_contains("Restarting", &mut stderr_lines).await; + wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await; + + let another_file = t.path().join("another_file.js"); + another_file.write("export const foo = 0;"); + // Confirm that the added file is watched as well + wait_contains("Restarting", &mut stderr_lines).await; + + main_file_to_watch + .write("import { foo } from './another_file.js'; console.log(foo);"); + wait_contains("Restarting", &mut stderr_lines).await; + wait_contains("0", &mut stdout_lines).await; + + another_file.write("export const foo = 42;"); + wait_contains("Restarting", &mut stderr_lines).await; + wait_contains("42", &mut stdout_lines).await; + + // Confirm that watch continues even with wrong syntax error + another_file.write("syntax error ^^"); + + wait_contains("Restarting", &mut stderr_lines).await; + wait_contains("error:", &mut stderr_lines).await; + + main_file_to_watch.write( + "export default { + fetch(_request: Request) { + return new Response(\"aaaaaaqqq!\"); + }, + };", + ); + wait_contains("Restarting", &mut stderr_lines).await; + wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await; + check_alive_then_kill(child); +} + #[flaky_test(tokio)] async fn run_watch_npm_specifier() { let _g = util::http_server(); From c8d229dbf03177e81f4fd2f43c7daf74a7f2e283 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Wed, 30 Oct 2024 00:35:42 +0100 Subject: [PATCH 002/227] fix(install): percent encodings in interactive progress bar (#26600) Fixes percent encodings showing up when installing scoped packages via `deno add` or `deno install`. The issue is caused by us trying to map back the package name from the resolved http url. This doesn't and has never worked with private registries. The proper solution would be to pass the original specifier into here, but that's a bit of a bigger refactor. So for now the quickest workaround is to replace `%2f` back to `/`. Fixes https://github.com/denoland/deno/issues/26576 --- cli/util/progress_bar/renderer.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cli/util/progress_bar/renderer.rs b/cli/util/progress_bar/renderer.rs index a83ceb3334..6b08dada12 100644 --- a/cli/util/progress_bar/renderer.rs +++ b/cli/util/progress_bar/renderer.rs @@ -193,10 +193,16 @@ impl ProgressBarRenderer for TextOnlyProgressBarRenderer { } }; + // TODO(@marvinhagemeister): We're trying to reconstruct the original + // specifier from the resolved one, but we lack the information about + // private registries URLs and other things here. let message = display_entry .message .replace("https://registry.npmjs.org/", "npm:") - .replace("https://jsr.io/", "jsr:"); + .replace("https://jsr.io/", "jsr:") + .replace("%2f", "/") + .replace("%2F", "/"); + display_str.push_str( &colors::gray(format!(" - {}{}\n", message, bytes_text)).to_string(), ); From a1473d82c5612676c50af00ded0467dbb29bc0a8 Mon Sep 17 00:00:00 2001 From: denobot <33910674+denobot@users.noreply.github.com> Date: Wed, 30 Oct 2024 08:46:31 -0400 Subject: [PATCH 003/227] chore: forward v2.0.4 release commit to main (#26636) This is the release commit being forwarded back to main for 2.0.4 Co-authored-by: bartlomieju --- .github/workflows/ci.generate.ts | 2 +- .github/workflows/ci.yml | 8 ++--- Cargo.lock | 58 ++++++++++++++++---------------- Cargo.toml | 56 +++++++++++++++--------------- Releases.md | 32 ++++++++++++++++++ bench_util/Cargo.toml | 2 +- cli/Cargo.toml | 2 +- ext/broadcast_channel/Cargo.toml | 2 +- ext/cache/Cargo.toml | 2 +- ext/canvas/Cargo.toml | 2 +- ext/console/Cargo.toml | 2 +- ext/cron/Cargo.toml | 2 +- ext/crypto/Cargo.toml | 2 +- ext/fetch/Cargo.toml | 2 +- ext/ffi/Cargo.toml | 2 +- ext/fs/Cargo.toml | 2 +- ext/http/Cargo.toml | 2 +- ext/io/Cargo.toml | 2 +- ext/kv/Cargo.toml | 2 +- ext/napi/Cargo.toml | 2 +- ext/napi/sym/Cargo.toml | 2 +- ext/net/Cargo.toml | 2 +- ext/node/Cargo.toml | 2 +- ext/tls/Cargo.toml | 2 +- ext/url/Cargo.toml | 2 +- ext/web/Cargo.toml | 2 +- ext/webgpu/Cargo.toml | 2 +- ext/webidl/Cargo.toml | 2 +- ext/websocket/Cargo.toml | 2 +- ext/webstorage/Cargo.toml | 2 +- resolvers/deno/Cargo.toml | 2 +- resolvers/node/Cargo.toml | 2 +- runtime/Cargo.toml | 2 +- runtime/permissions/Cargo.toml | 2 +- 34 files changed, 123 insertions(+), 91 deletions(-) diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts index 3e2b079643..d5ee67b654 100755 --- a/.github/workflows/ci.generate.ts +++ b/.github/workflows/ci.generate.ts @@ -5,7 +5,7 @@ import { stringify } from "jsr:@std/yaml@^0.221/stringify"; // Bump this number when you want to purge the cache. // Note: the tools/release/01_bump_crate_versions.ts script will update this version // automatically via regex, so ensure that this line maintains this format. -const cacheVersion = 22; +const cacheVersion = 23; const ubuntuX86Runner = "ubuntu-22.04"; const ubuntuX86XlRunner = "ubuntu-22.04-xl"; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5739537bb0..a6421d9244 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -361,8 +361,8 @@ jobs: path: |- ~/.cargo/registry/index ~/.cargo/registry/cache - key: '22-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}' - restore-keys: '22-cargo-home-${{ matrix.os }}-${{ matrix.arch }}' + key: '23-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}' + restore-keys: '23-cargo-home-${{ matrix.os }}-${{ matrix.arch }}' if: '!(matrix.skip)' - name: Restore cache build output (PR) uses: actions/cache/restore@v4 @@ -375,7 +375,7 @@ jobs: !./target/*/*.zip !./target/*/*.tar.gz key: never_saved - restore-keys: '22-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-' + restore-keys: '23-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-' - name: Apply and update mtime cache if: '!(matrix.skip) && (!startsWith(github.ref, ''refs/tags/''))' uses: ./.github/mtime_cache @@ -685,7 +685,7 @@ jobs: !./target/*/*.zip !./target/*/*.sha256sum !./target/*/*.tar.gz - key: '22-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}' + key: '23-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}' publish-canary: name: publish canary runs-on: ubuntu-22.04 diff --git a/Cargo.lock b/Cargo.lock index 2c8028a1e2..36ba70d9d2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1154,7 +1154,7 @@ dependencies = [ [[package]] name = "deno" -version = "2.0.3" +version = "2.0.4" dependencies = [ "anstream", "async-trait", @@ -1323,7 +1323,7 @@ dependencies = [ [[package]] name = "deno_bench_util" -version = "0.168.0" +version = "0.169.0" dependencies = [ "bencher", "deno_core", @@ -1332,7 +1332,7 @@ dependencies = [ [[package]] name = "deno_broadcast_channel" -version = "0.168.0" +version = "0.169.0" dependencies = [ "async-trait", "deno_core", @@ -1343,7 +1343,7 @@ dependencies = [ [[package]] name = "deno_cache" -version = "0.106.0" +version = "0.107.0" dependencies = [ "async-trait", "deno_core", @@ -1376,7 +1376,7 @@ dependencies = [ [[package]] name = "deno_canvas" -version = "0.43.0" +version = "0.44.0" dependencies = [ "deno_core", "deno_webgpu", @@ -1411,7 +1411,7 @@ dependencies = [ [[package]] name = "deno_console" -version = "0.174.0" +version = "0.175.0" dependencies = [ "deno_core", ] @@ -1456,7 +1456,7 @@ checksum = "a13951ea98c0a4c372f162d669193b4c9d991512de9f2381dd161027f34b26b1" [[package]] name = "deno_cron" -version = "0.54.0" +version = "0.55.0" dependencies = [ "anyhow", "async-trait", @@ -1469,7 +1469,7 @@ dependencies = [ [[package]] name = "deno_crypto" -version = "0.188.0" +version = "0.189.0" dependencies = [ "aes", "aes-gcm", @@ -1531,7 +1531,7 @@ dependencies = [ [[package]] name = "deno_fetch" -version = "0.198.0" +version = "0.199.0" dependencies = [ "base64 0.21.7", "bytes", @@ -1564,7 +1564,7 @@ dependencies = [ [[package]] name = "deno_ffi" -version = "0.161.0" +version = "0.162.0" dependencies = [ "deno_core", "deno_permissions", @@ -1584,7 +1584,7 @@ dependencies = [ [[package]] name = "deno_fs" -version = "0.84.0" +version = "0.85.0" dependencies = [ "async-trait", "base32", @@ -1635,7 +1635,7 @@ dependencies = [ [[package]] name = "deno_http" -version = "0.172.0" +version = "0.173.0" dependencies = [ "async-compression", "async-trait", @@ -1674,7 +1674,7 @@ dependencies = [ [[package]] name = "deno_io" -version = "0.84.0" +version = "0.85.0" dependencies = [ "async-trait", "deno_core", @@ -1695,7 +1695,7 @@ dependencies = [ [[package]] name = "deno_kv" -version = "0.82.0" +version = "0.83.0" dependencies = [ "anyhow", "async-trait", @@ -1767,7 +1767,7 @@ dependencies = [ [[package]] name = "deno_napi" -version = "0.105.0" +version = "0.106.0" dependencies = [ "deno_core", "deno_permissions", @@ -1795,7 +1795,7 @@ dependencies = [ [[package]] name = "deno_net" -version = "0.166.0" +version = "0.167.0" dependencies = [ "deno_core", "deno_permissions", @@ -1812,7 +1812,7 @@ dependencies = [ [[package]] name = "deno_node" -version = "0.111.0" +version = "0.112.0" dependencies = [ "aead-gcm-stream", "aes", @@ -1961,7 +1961,7 @@ dependencies = [ [[package]] name = "deno_permissions" -version = "0.34.0" +version = "0.35.0" dependencies = [ "deno_core", "deno_path_util", @@ -1978,7 +1978,7 @@ dependencies = [ [[package]] name = "deno_resolver" -version = "0.6.0" +version = "0.7.0" dependencies = [ "anyhow", "base32", @@ -1994,7 +1994,7 @@ dependencies = [ [[package]] name = "deno_runtime" -version = "0.183.0" +version = "0.184.0" dependencies = [ "color-print", "deno_ast", @@ -2112,7 +2112,7 @@ dependencies = [ [[package]] name = "deno_tls" -version = "0.161.0" +version = "0.162.0" dependencies = [ "deno_core", "deno_native_certs", @@ -2161,7 +2161,7 @@ dependencies = [ [[package]] name = "deno_url" -version = "0.174.0" +version = "0.175.0" dependencies = [ "deno_bench_util", "deno_console", @@ -2173,7 +2173,7 @@ dependencies = [ [[package]] name = "deno_web" -version = "0.205.0" +version = "0.206.0" dependencies = [ "async-trait", "base64-simd 0.8.0", @@ -2195,7 +2195,7 @@ dependencies = [ [[package]] name = "deno_webgpu" -version = "0.141.0" +version = "0.142.0" dependencies = [ "deno_core", "raw-window-handle", @@ -2208,7 +2208,7 @@ dependencies = [ [[package]] name = "deno_webidl" -version = "0.174.0" +version = "0.175.0" dependencies = [ "deno_bench_util", "deno_core", @@ -2216,7 +2216,7 @@ dependencies = [ [[package]] name = "deno_websocket" -version = "0.179.0" +version = "0.180.0" dependencies = [ "bytes", "deno_core", @@ -2238,7 +2238,7 @@ dependencies = [ [[package]] name = "deno_webstorage" -version = "0.169.0" +version = "0.170.0" dependencies = [ "deno_core", "deno_web", @@ -4483,7 +4483,7 @@ dependencies = [ [[package]] name = "napi_sym" -version = "0.104.0" +version = "0.105.0" dependencies = [ "quote", "serde", @@ -4538,7 +4538,7 @@ dependencies = [ [[package]] name = "node_resolver" -version = "0.13.0" +version = "0.14.0" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index b622cbe443..aab9e149b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,16 +48,16 @@ repository = "https://github.com/denoland/deno" deno_ast = { version = "=0.42.2", features = ["transpiling"] } deno_core = { version = "0.314.2" } -deno_bench_util = { version = "0.168.0", path = "./bench_util" } +deno_bench_util = { version = "0.169.0", path = "./bench_util" } deno_lockfile = "=0.23.1" deno_media_type = { version = "0.1.4", features = ["module_specifier"] } deno_npm = "=0.25.4" deno_path_util = "=0.2.1" -deno_permissions = { version = "0.34.0", path = "./runtime/permissions" } -deno_runtime = { version = "0.183.0", path = "./runtime" } +deno_permissions = { version = "0.35.0", path = "./runtime/permissions" } +deno_runtime = { version = "0.184.0", path = "./runtime" } deno_semver = "=0.5.16" deno_terminal = "0.2.0" -napi_sym = { version = "0.104.0", path = "./ext/napi/sym" } +napi_sym = { version = "0.105.0", path = "./ext/napi/sym" } test_util = { package = "test_server", path = "./tests/util/server" } denokv_proto = "0.8.1" @@ -66,32 +66,32 @@ denokv_remote = "0.8.1" denokv_sqlite = { default-features = false, version = "0.8.2" } # exts -deno_broadcast_channel = { version = "0.168.0", path = "./ext/broadcast_channel" } -deno_cache = { version = "0.106.0", path = "./ext/cache" } -deno_canvas = { version = "0.43.0", path = "./ext/canvas" } -deno_console = { version = "0.174.0", path = "./ext/console" } -deno_cron = { version = "0.54.0", path = "./ext/cron" } -deno_crypto = { version = "0.188.0", path = "./ext/crypto" } -deno_fetch = { version = "0.198.0", path = "./ext/fetch" } -deno_ffi = { version = "0.161.0", path = "./ext/ffi" } -deno_fs = { version = "0.84.0", path = "./ext/fs" } -deno_http = { version = "0.172.0", path = "./ext/http" } -deno_io = { version = "0.84.0", path = "./ext/io" } -deno_kv = { version = "0.82.0", path = "./ext/kv" } -deno_napi = { version = "0.105.0", path = "./ext/napi" } -deno_net = { version = "0.166.0", path = "./ext/net" } -deno_node = { version = "0.111.0", path = "./ext/node" } -deno_tls = { version = "0.161.0", path = "./ext/tls" } -deno_url = { version = "0.174.0", path = "./ext/url" } -deno_web = { version = "0.205.0", path = "./ext/web" } -deno_webgpu = { version = "0.141.0", path = "./ext/webgpu" } -deno_webidl = { version = "0.174.0", path = "./ext/webidl" } -deno_websocket = { version = "0.179.0", path = "./ext/websocket" } -deno_webstorage = { version = "0.169.0", path = "./ext/webstorage" } +deno_broadcast_channel = { version = "0.169.0", path = "./ext/broadcast_channel" } +deno_cache = { version = "0.107.0", path = "./ext/cache" } +deno_canvas = { version = "0.44.0", path = "./ext/canvas" } +deno_console = { version = "0.175.0", path = "./ext/console" } +deno_cron = { version = "0.55.0", path = "./ext/cron" } +deno_crypto = { version = "0.189.0", path = "./ext/crypto" } +deno_fetch = { version = "0.199.0", path = "./ext/fetch" } +deno_ffi = { version = "0.162.0", path = "./ext/ffi" } +deno_fs = { version = "0.85.0", path = "./ext/fs" } +deno_http = { version = "0.173.0", path = "./ext/http" } +deno_io = { version = "0.85.0", path = "./ext/io" } +deno_kv = { version = "0.83.0", path = "./ext/kv" } +deno_napi = { version = "0.106.0", path = "./ext/napi" } +deno_net = { version = "0.167.0", path = "./ext/net" } +deno_node = { version = "0.112.0", path = "./ext/node" } +deno_tls = { version = "0.162.0", path = "./ext/tls" } +deno_url = { version = "0.175.0", path = "./ext/url" } +deno_web = { version = "0.206.0", path = "./ext/web" } +deno_webgpu = { version = "0.142.0", path = "./ext/webgpu" } +deno_webidl = { version = "0.175.0", path = "./ext/webidl" } +deno_websocket = { version = "0.180.0", path = "./ext/websocket" } +deno_webstorage = { version = "0.170.0", path = "./ext/webstorage" } # resolvers -deno_resolver = { version = "0.6.0", path = "./resolvers/deno" } -node_resolver = { version = "0.13.0", path = "./resolvers/node" } +deno_resolver = { version = "0.7.0", path = "./resolvers/deno" } +node_resolver = { version = "0.14.0", path = "./resolvers/node" } aes = "=0.8.3" anyhow = "1.0.57" diff --git a/Releases.md b/Releases.md index 5576d4bd8c..a183e01ecd 100644 --- a/Releases.md +++ b/Releases.md @@ -6,6 +6,38 @@ https://github.com/denoland/deno/releases We also have one-line install commands at: https://github.com/denoland/deno_install +### 2.0.4 / 2024.10.29 + +- Revert "fix(ext/node): fix dns.lookup result ordering (#26264)" (#26621) +- Revert "fix(ext/node): use primordials in `ext/node/polyfills/https.ts` + (#26323)" (#26613) +- feat(lsp): "typescript.preferences.preferTypeOnlyAutoImports" setting (#26546) +- fix(check): expose more globals from @types/node (#26603) +- fix(check): ignore resolving `jsxImportSource` when jsx is not used in graph + (#26548) +- fix(cli): Make --watcher CLEAR_SCREEN clear scrollback buffer as well as + visible screen (#25997) +- fix(compile): regression handling redirects (#26586) +- fix(ext/napi): export dynamic symbols list for {Free,Open}BSD (#26605) +- fix(ext/node): add path to `fs.stat` and `fs.statSync` error (#26037) +- fix(ext/node): compatibility with {Free,Open}BSD (#26604) +- fix(ext/node): use primordials in + ext\node\polyfills\internal\crypto\_randomInt.ts (#26534) +- fix(install): cache json exports of JSR packages (#26552) +- fix(install): regression - do not panic when config file contains \r\n + newlines (#26547) +- fix(lsp): make missing import action fix infallible (#26539) +- fix(npm): match npm bearer token generation (#26544) +- fix(upgrade): stop running `deno lsp` processes on windows before attempting + to replace executable (#26542) +- fix(watch): don't panic on invalid file specifiers (#26577) +- fix: do not panic when failing to write to http cache (#26591) +- fix: provide hints in terminal errors for Node.js globals (#26610) +- fix: report exceptions from nextTick (#26579) +- fix: support watch flag to enable watching other files than the main module on + serve subcommand (#26622) +- perf: pass transpiled module to deno_core as known string (#26555) + ### 2.0.3 / 2024.10.25 - feat(lsp): interactive inlay hints (#26382) diff --git a/bench_util/Cargo.toml b/bench_util/Cargo.toml index eea9c69a3c..31c27b9a9d 100644 --- a/bench_util/Cargo.toml +++ b/bench_util/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_bench_util" -version = "0.168.0" +version = "0.169.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 0065a2cbd0..ef92947d21 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno" -version = "2.0.3" +version = "2.0.4" authors.workspace = true default-run = "deno" edition.workspace = true diff --git a/ext/broadcast_channel/Cargo.toml b/ext/broadcast_channel/Cargo.toml index 845544f0c8..e6eeeed5ec 100644 --- a/ext/broadcast_channel/Cargo.toml +++ b/ext/broadcast_channel/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_broadcast_channel" -version = "0.168.0" +version = "0.169.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/cache/Cargo.toml b/ext/cache/Cargo.toml index a07a8f7207..7cae8d88a2 100644 --- a/ext/cache/Cargo.toml +++ b/ext/cache/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_cache" -version = "0.106.0" +version = "0.107.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/canvas/Cargo.toml b/ext/canvas/Cargo.toml index 4c125ea9b5..5d2c371999 100644 --- a/ext/canvas/Cargo.toml +++ b/ext/canvas/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_canvas" -version = "0.43.0" +version = "0.44.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/console/Cargo.toml b/ext/console/Cargo.toml index b89f67fece..b3543ed85f 100644 --- a/ext/console/Cargo.toml +++ b/ext/console/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_console" -version = "0.174.0" +version = "0.175.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/cron/Cargo.toml b/ext/cron/Cargo.toml index 6c5547c35f..0d52cb6a97 100644 --- a/ext/cron/Cargo.toml +++ b/ext/cron/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_cron" -version = "0.54.0" +version = "0.55.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/crypto/Cargo.toml b/ext/crypto/Cargo.toml index e9761f48f1..95981bba3b 100644 --- a/ext/crypto/Cargo.toml +++ b/ext/crypto/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_crypto" -version = "0.188.0" +version = "0.189.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/fetch/Cargo.toml b/ext/fetch/Cargo.toml index 316a6eea81..93fc88ae64 100644 --- a/ext/fetch/Cargo.toml +++ b/ext/fetch/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_fetch" -version = "0.198.0" +version = "0.199.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/ffi/Cargo.toml b/ext/ffi/Cargo.toml index 405030df29..58144790bf 100644 --- a/ext/ffi/Cargo.toml +++ b/ext/ffi/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_ffi" -version = "0.161.0" +version = "0.162.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/fs/Cargo.toml b/ext/fs/Cargo.toml index 2a1c5bf2c6..0ccde7f7e2 100644 --- a/ext/fs/Cargo.toml +++ b/ext/fs/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_fs" -version = "0.84.0" +version = "0.85.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/http/Cargo.toml b/ext/http/Cargo.toml index 0bae99ef76..a1a4cb20be 100644 --- a/ext/http/Cargo.toml +++ b/ext/http/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_http" -version = "0.172.0" +version = "0.173.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/io/Cargo.toml b/ext/io/Cargo.toml index f7ffe46bc3..7e858d298c 100644 --- a/ext/io/Cargo.toml +++ b/ext/io/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_io" -version = "0.84.0" +version = "0.85.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/kv/Cargo.toml b/ext/kv/Cargo.toml index a4e35193d5..bbd2349011 100644 --- a/ext/kv/Cargo.toml +++ b/ext/kv/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_kv" -version = "0.82.0" +version = "0.83.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/napi/Cargo.toml b/ext/napi/Cargo.toml index 622429f7c8..c31367118e 100644 --- a/ext/napi/Cargo.toml +++ b/ext/napi/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_napi" -version = "0.105.0" +version = "0.106.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/napi/sym/Cargo.toml b/ext/napi/sym/Cargo.toml index 9fe2d839ad..c23054eb40 100644 --- a/ext/napi/sym/Cargo.toml +++ b/ext/napi/sym/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "napi_sym" -version = "0.104.0" +version = "0.105.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/net/Cargo.toml b/ext/net/Cargo.toml index a458dbe9e3..5ffd1b4504 100644 --- a/ext/net/Cargo.toml +++ b/ext/net/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_net" -version = "0.166.0" +version = "0.167.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/node/Cargo.toml b/ext/node/Cargo.toml index 3743e6a85e..ed31dbf17e 100644 --- a/ext/node/Cargo.toml +++ b/ext/node/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_node" -version = "0.111.0" +version = "0.112.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/tls/Cargo.toml b/ext/tls/Cargo.toml index d163fd7eb4..6871faa5b8 100644 --- a/ext/tls/Cargo.toml +++ b/ext/tls/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_tls" -version = "0.161.0" +version = "0.162.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/url/Cargo.toml b/ext/url/Cargo.toml index ef7890e2ae..24d81abf83 100644 --- a/ext/url/Cargo.toml +++ b/ext/url/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_url" -version = "0.174.0" +version = "0.175.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/web/Cargo.toml b/ext/web/Cargo.toml index 0cb08e19c1..a02cff98fc 100644 --- a/ext/web/Cargo.toml +++ b/ext/web/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_web" -version = "0.205.0" +version = "0.206.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/webgpu/Cargo.toml b/ext/webgpu/Cargo.toml index 84ee4a012f..3bb814c25c 100644 --- a/ext/webgpu/Cargo.toml +++ b/ext/webgpu/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webgpu" -version = "0.141.0" +version = "0.142.0" authors = ["the Deno authors"] edition.workspace = true license = "MIT" diff --git a/ext/webidl/Cargo.toml b/ext/webidl/Cargo.toml index a403db2fea..1685bb1fd0 100644 --- a/ext/webidl/Cargo.toml +++ b/ext/webidl/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webidl" -version = "0.174.0" +version = "0.175.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/websocket/Cargo.toml b/ext/websocket/Cargo.toml index b48b39c99f..6a575cb416 100644 --- a/ext/websocket/Cargo.toml +++ b/ext/websocket/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_websocket" -version = "0.179.0" +version = "0.180.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/webstorage/Cargo.toml b/ext/webstorage/Cargo.toml index 911e252414..079ab2e4ee 100644 --- a/ext/webstorage/Cargo.toml +++ b/ext/webstorage/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webstorage" -version = "0.169.0" +version = "0.170.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/resolvers/deno/Cargo.toml b/resolvers/deno/Cargo.toml index 418e1cb522..d8569d7219 100644 --- a/resolvers/deno/Cargo.toml +++ b/resolvers/deno/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_resolver" -version = "0.6.0" +version = "0.7.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/resolvers/node/Cargo.toml b/resolvers/node/Cargo.toml index 9638899209..95f7eabad8 100644 --- a/resolvers/node/Cargo.toml +++ b/resolvers/node/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "node_resolver" -version = "0.13.0" +version = "0.14.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 703bd5a432..c4c0c8ff9b 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_runtime" -version = "0.183.0" +version = "0.184.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/runtime/permissions/Cargo.toml b/runtime/permissions/Cargo.toml index 45266791ae..bfa37b4898 100644 --- a/runtime/permissions/Cargo.toml +++ b/runtime/permissions/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_permissions" -version = "0.34.0" +version = "0.35.0" authors.workspace = true edition.workspace = true license.workspace = true From 1431ffa9f8142e4f76f565c51301f4fb174e449a Mon Sep 17 00:00:00 2001 From: McSneaky Date: Wed, 30 Oct 2024 17:32:04 +0200 Subject: [PATCH 004/227] docs(console): Update docstrings for install and uninstall (#26623) When running `deno -h` then `install` and `uninstall` scripts had description since deno 1 times :) --- cli/args/flags.rs | 4 ++-- tests/integration/flags_tests.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 235dd53a42..1a1213aac2 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -1179,8 +1179,8 @@ static DENO_HELP: &str = cstr!( Dependency management: add Add dependencies deno add jsr:@std/assert | deno add npm:express - install Install script as an executable - uninstall Uninstall a script previously installed with deno install + install Installs dependencies either in the local project or globally to a bin directory + uninstall Uninstalls a dependency or an executable script in the installation root's bin directory remove Remove dependencies from the configuration file Tooling: diff --git a/tests/integration/flags_tests.rs b/tests/integration/flags_tests.rs index 455507b9fa..663da363da 100644 --- a/tests/integration/flags_tests.rs +++ b/tests/integration/flags_tests.rs @@ -18,8 +18,8 @@ fn help_output() { "Start an interactive Read-Eval-Print Loop (REPL) for Deno", "Evaluate a script from the command line", "Add dependencies", - "Install script as an executable", - "Uninstall a script previously installed with deno install", + "Installs dependencies either in the local project or globally to a bin directory", + "Uninstalls a dependency or an executable script in the installation root's bin directory", "Run benchmarks", "Type-check the dependencies", "Compile the script into a self contained executable", From 5f5ac4063142c6c411486581f2f26cf51a32d7e3 Mon Sep 17 00:00:00 2001 From: HasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com> Date: Wed, 30 Oct 2024 19:32:18 +0200 Subject: [PATCH 005/227] fix(serve): support serve hmr (#26078) This PR addresses issue #25600 Changes: Updated `fn has_hmr` to check `serve` subcommand and return its hmr value if found, in order to run the worker in serve mode with hmr_runner. Thus the hmr event can be dispatched upon changes on the file served. --- cli/args/mod.rs | 6 ++++++ cli/tools/serve.rs | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/cli/args/mod.rs b/cli/args/mod.rs index f5ecc04496..754cd38fa9 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1452,6 +1452,12 @@ impl CliOptions { watch: Some(WatchFlagsWithPaths { hmr, .. }), .. }) = &self.flags.subcommand + { + *hmr + } else if let DenoSubcommand::Serve(ServeFlags { + watch: Some(WatchFlagsWithPaths { hmr, .. }), + .. + }) = &self.flags.subcommand { *hmr } else { diff --git a/cli/tools/serve.rs b/cli/tools/serve.rs index 4ce1cad6f2..e3f9e94f8e 100644 --- a/cli/tools/serve.rs +++ b/cli/tools/serve.rs @@ -44,12 +44,15 @@ pub async fn serve( maybe_npm_install(&factory).await?; let worker_factory = factory.create_cli_main_worker_factory().await?; - + let hmr = serve_flags + .watch + .map(|watch_flags| watch_flags.hmr) + .unwrap_or(false); do_serve( worker_factory, main_module.clone(), serve_flags.worker_count, - false, + hmr, ) .await } @@ -109,8 +112,6 @@ async fn do_serve( } } Ok(exit_code) - - // main.await? } async fn run_worker( @@ -119,7 +120,7 @@ async fn run_worker( main_module: ModuleSpecifier, hmr: bool, ) -> Result { - let mut worker = worker_factory + let mut worker: crate::worker::CliMainWorker = worker_factory .create_main_worker( deno_runtime::WorkerExecutionMode::Serve { is_main: false, From a346071dd2bd822a7c2abcb187406efe7d1d1471 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Wed, 30 Oct 2024 13:13:32 -0700 Subject: [PATCH 006/227] fix(ext/node): return `this` from `http.Server.ref/unref()` (#26647) Fixes https://github.com/denoland/deno/issues/26642 --- ext/node/polyfills/http.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts index e8a189f70f..9a920adeee 100644 --- a/ext/node/polyfills/http.ts +++ b/ext/node/polyfills/http.ts @@ -1802,6 +1802,8 @@ export class ServerImpl extends EventEmitter { this.#server.ref(); } this.#unref = false; + + return this; } unref() { @@ -1809,6 +1811,8 @@ export class ServerImpl extends EventEmitter { this.#server.unref(); } this.#unref = true; + + return this; } close(cb?: (err?: Error) => void): this { From a8846eb70f96445753fe5f8f56e6155cb2d0fac6 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 30 Oct 2024 16:43:22 -0400 Subject: [PATCH 007/227] fix: remove permission check in op_require_node_module_paths (#26645) --- ext/node/ops/require.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ext/node/ops/require.rs b/ext/node/ops/require.rs index f4607f4e8a..43867053b0 100644 --- a/ext/node/ops/require.rs +++ b/ext/node/ops/require.rs @@ -131,9 +131,6 @@ where normalize_path(current_dir.join(from)) }; - let from = ensure_read_permission::

(state, &from) - .map_err(RequireError::Permission)?; - if cfg!(windows) { // return root node_modules when path is 'D:\\'. let from_str = from.to_str().unwrap(); @@ -154,7 +151,7 @@ where } let mut paths = Vec::with_capacity(from.components().count()); - let mut current_path = from.as_ref(); + let mut current_path = from.as_path(); let mut maybe_parent = Some(current_path); while let Some(parent) = maybe_parent { if !parent.ends_with("node_modules") { From 8bfd134da6d730cc1d182ab430b1713901d7a5b5 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Thu, 31 Oct 2024 10:10:07 +0530 Subject: [PATCH 008/227] fix: clamp smi in fast calls by default (#26506) Fixes https://github.com/denoland/deno/issues/26480 Ref https://github.com/denoland/deno_core/commit/d2945fb65bca56ebfa7bb80556a4c8f4330d2315 --- Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- ext/node/ops/crypto/mod.rs | 8 ++++---- runtime/inspector_server.rs | 7 +++++++ runtime/worker.rs | 8 +++++++- 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 36ba70d9d2..3fa6203842 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1418,9 +1418,9 @@ dependencies = [ [[package]] name = "deno_core" -version = "0.314.2" +version = "0.316.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83138917579676069b423c3eb9be3c1e579f60dc022d85f6ded4c792456255ff" +checksum = "94f68061c88ced959c6b0417f0f0d0b3dbeaeb18013b55f86c505e9fba705cf8" dependencies = [ "anyhow", "bincode", @@ -1921,9 +1921,9 @@ dependencies = [ [[package]] name = "deno_ops" -version = "0.190.1" +version = "0.192.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f46d4e4f52f26c882b74a9b58810ea75252b807cf0966166ec333077cdfd85" +checksum = "bdb7096887508456349d7e7e09e326d157d4dba46ef1f5849bc544592ea3042a" dependencies = [ "proc-macro-rules", "proc-macro2", @@ -6169,9 +6169,9 @@ dependencies = [ [[package]] name = "serde_v8" -version = "0.223.1" +version = "0.225.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf3d859dda87ee96423c01244f10af864fa6d6a9fcdc2b77e0595078ea0ea11" +checksum = "ce4b71200ef49a9e629edaea3d13fc98c25ede07e1496558df7f09354e37976f" dependencies = [ "num-bigint", "serde", diff --git a/Cargo.toml b/Cargo.toml index aab9e149b0..285c077809 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ repository = "https://github.com/denoland/deno" [workspace.dependencies] deno_ast = { version = "=0.42.2", features = ["transpiling"] } -deno_core = { version = "0.314.2" } +deno_core = { version = "0.316.0" } deno_bench_util = { version = "0.169.0", path = "./bench_util" } deno_lockfile = "=0.23.1" diff --git a/ext/node/ops/crypto/mod.rs b/ext/node/ops/crypto/mod.rs index 600d315587..0cf34511b4 100644 --- a/ext/node/ops/crypto/mod.rs +++ b/ext/node/ops/crypto/mod.rs @@ -519,11 +519,11 @@ pub fn op_node_dh_compute_secret( } #[op2(fast)] -#[smi] +#[number] pub fn op_node_random_int( - #[smi] min: i32, - #[smi] max: i32, -) -> Result { + #[number] min: i64, + #[number] max: i64, +) -> Result { let mut rng = rand::thread_rng(); // Uniform distribution is required to avoid Modulo Bias // https://en.wikipedia.org/wiki/Fisher–Yates_shuffle#Modulo_bias diff --git a/runtime/inspector_server.rs b/runtime/inspector_server.rs index 1f8cd5e714..a789dd3dca 100644 --- a/runtime/inspector_server.rs +++ b/runtime/inspector_server.rs @@ -19,6 +19,8 @@ use deno_core::serde_json::Value; use deno_core::unsync::spawn; use deno_core::url::Url; use deno_core::InspectorMsg; +use deno_core::InspectorSessionKind; +use deno_core::InspectorSessionOptions; use deno_core::InspectorSessionProxy; use deno_core::JsRuntime; use fastwebsockets::Frame; @@ -192,6 +194,11 @@ fn handle_ws_request( let inspector_session_proxy = InspectorSessionProxy { tx: outbound_tx, rx: inbound_rx, + options: InspectorSessionOptions { + kind: InspectorSessionKind::NonBlocking { + wait_for_disconnect: true, + }, + }, }; log::info!("Debugger session started."); diff --git a/runtime/worker.rs b/runtime/worker.rs index 477d3b880c..b780aefc1b 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -20,6 +20,8 @@ use deno_core::CompiledWasmModuleStore; use deno_core::Extension; use deno_core::FeatureChecker; use deno_core::GetErrorClassFn; +use deno_core::InspectorSessionKind; +use deno_core::InspectorSessionOptions; use deno_core::JsRuntime; use deno_core::LocalInspectorSession; use deno_core::ModuleCodeString; @@ -792,7 +794,11 @@ impl MainWorker { /// was not configured to create inspector. pub fn create_inspector_session(&mut self) -> LocalInspectorSession { self.js_runtime.maybe_init_inspector(); - self.js_runtime.inspector().borrow().create_local_session() + self.js_runtime.inspector().borrow().create_local_session( + InspectorSessionOptions { + kind: InspectorSessionKind::Blocking, + }, + ) } pub async fn run_event_loop( From 2f0c25d33fc0c8bb8e6e92826b2549f429d68d42 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Thu, 31 Oct 2024 10:52:43 +0000 Subject: [PATCH 009/227] fix(lsp): include unstable features from editor settings (#26655) --- cli/lsp/config.rs | 12 +++++++++++- cli/lsp/language_server.rs | 10 +++------- cli/lsp/resolver.rs | 4 ++-- tests/integration/lsp_tests.rs | 30 ++++++++++++++---------------- 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs index 3ffc9e657a..cac0637a05 100644 --- a/cli/lsp/config.rs +++ b/cli/lsp/config.rs @@ -41,6 +41,7 @@ use deno_runtime::deno_node::PackageJson; use indexmap::IndexSet; use lsp_types::ClientCapabilities; use std::collections::BTreeMap; +use std::collections::BTreeSet; use std::collections::HashMap; use std::ops::Deref; use std::ops::DerefMut; @@ -1190,6 +1191,7 @@ pub struct ConfigData { pub resolver: Arc, pub sloppy_imports_resolver: Option>, pub import_map_from_settings: Option, + pub unstable: BTreeSet, watched_files: HashMap, } @@ -1587,9 +1589,16 @@ impl ConfigData { .join("\n") ); } + let unstable = member_dir + .workspace + .unstable_features() + .iter() + .chain(settings.unstable.as_deref()) + .cloned() + .collect::>(); let unstable_sloppy_imports = std::env::var("DENO_UNSTABLE_SLOPPY_IMPORTS") .is_ok() - || member_dir.workspace.has_unstable("sloppy-imports"); + || unstable.contains("sloppy-imports"); let sloppy_imports_resolver = unstable_sloppy_imports.then(|| { Arc::new(CliSloppyImportsResolver::new( SloppyImportsCachedFs::new_without_stat_cache(Arc::new( @@ -1630,6 +1639,7 @@ impl ConfigData { lockfile, npmrc, import_map_from_settings, + unstable, watched_files, } } diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 33ae539f85..a592245ce7 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -1384,14 +1384,10 @@ impl Inner { .clone(); fmt_options.use_tabs = Some(!params.options.insert_spaces); fmt_options.indent_width = Some(params.options.tab_size as u8); - let maybe_workspace = self - .config - .tree - .data_for_specifier(&specifier) - .map(|d| &d.member_dir.workspace); + let config_data = self.config.tree.data_for_specifier(&specifier); let unstable_options = UnstableFmtOptions { - component: maybe_workspace - .map(|w| w.has_unstable("fmt-component")) + component: config_data + .map(|d| d.unstable.contains("fmt-component")) .unwrap_or(false), }; let document = document.clone(); diff --git a/cli/lsp/resolver.rs b/cli/lsp/resolver.rs index c89273147a..00587f8f50 100644 --- a/cli/lsp/resolver.rs +++ b/cli/lsp/resolver.rs @@ -555,8 +555,8 @@ fn create_graph_resolver( workspace.to_maybe_jsx_import_source_config().ok().flatten() }), maybe_vendor_dir: config_data.and_then(|d| d.vendor_dir.as_ref()), - bare_node_builtins_enabled: workspace - .is_some_and(|workspace| workspace.has_unstable("bare-node-builtins")), + bare_node_builtins_enabled: config_data + .is_some_and(|d| d.unstable.contains("bare-node-builtins")), sloppy_imports_resolver: config_data .and_then(|d| d.sloppy_imports_resolver.clone()), })) diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 79e6dc5c48..2376aebd90 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -15484,25 +15484,23 @@ fn lsp_sloppy_imports() { fn lsp_sloppy_imports_prefers_dts() { let context = TestContextBuilder::new().use_temp_cwd().build(); let temp_dir = context.temp_dir(); - let temp_dir = temp_dir.path(); - - temp_dir - .join("deno.json") - .write(r#"{ "unstable": ["sloppy-imports"] }"#); - - let mut client: LspClient = context - .new_lsp_command() - .set_root_dir(temp_dir.clone()) - .build(); - client.initialize_default(); - - temp_dir.join("a.js").write("export const foo: number;"); - - let a_dts = source_file(temp_dir.join("a.d.ts"), "export const foo = 3;"); + temp_dir.write("deno.json", json!({}).to_string()); + temp_dir.write("a.js", "export const foo: number;"); + let a_dts = + source_file(temp_dir.path().join("a.d.ts"), "export const foo = 3;"); let file = source_file( - temp_dir.join("file.ts"), + temp_dir.path().join("file.ts"), "import { foo } from './a.js';\nconsole.log(foo);", ); + let mut client: LspClient = context.new_lsp_command().build(); + client.initialize_default(); + client.change_configuration(json!({ + "deno": { + "enable": true, + "unstable": ["sloppy-imports"], + }, + })); + let diagnostics = client.did_open_file(&file); // no other warnings because "a.js" exists assert_eq!( From 56f25af2c7b8b158ae21271c129ea0f0bf3c258f Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Thu, 31 Oct 2024 21:50:58 +0800 Subject: [PATCH 010/227] fix(fmt): fix several HTML and components issues (#26654) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #26245 Close #26324 Fix #26508 Fix #26540 Fix #26562 --------- Co-authored-by: Bartek Iwańczuk --- .dprint.json | 2 +- Cargo.lock | 4 ++-- cli/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.dprint.json b/.dprint.json index 7877f17647..ea99f2aeda 100644 --- a/.dprint.json +++ b/.dprint.json @@ -68,7 +68,7 @@ "third_party" ], "plugins": [ - "https://plugins.dprint.dev/typescript-0.93.0.wasm", + "https://plugins.dprint.dev/typescript-0.93.1.wasm", "https://plugins.dprint.dev/json-0.19.4.wasm", "https://plugins.dprint.dev/markdown-0.17.8.wasm", "https://plugins.dprint.dev/toml-0.6.3.wasm", diff --git a/Cargo.lock b/Cargo.lock index 3fa6203842..e0780b2268 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4311,9 +4311,9 @@ dependencies = [ [[package]] name = "markup_fmt" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f15d7b24ae4ea9b87279bc0696462a4fb6c2168847f2cc162a2da05fe1a0f61" +checksum = "ebae65c91eab3d42231232bf48107f351e5a8d511454927218c53aeb68bbdb6f" dependencies = [ "aho-corasick", "css_dataset", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index ef92947d21..782adfd903 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -129,7 +129,7 @@ libz-sys.workspace = true log = { workspace = true, features = ["serde"] } lsp-types.workspace = true malva = "=0.11.0" -markup_fmt = "=0.14.0" +markup_fmt = "=0.15.0" memmem.workspace = true monch.workspace = true notify.workspace = true From 50ea707b58dff85b479905ebbeef866c95bc3cad Mon Sep 17 00:00:00 2001 From: Taku Amano Date: Thu, 31 Oct 2024 23:20:26 +0900 Subject: [PATCH 011/227] fix(coverage): exclude comment lines from coverage reports (#25939) --- cli/tools/coverage/mod.rs | 19 ++++- tests/testdata/coverage/complex.ts | 13 +++ tests/testdata/coverage/complex_expected.lcov | 82 ++++++++----------- tests/testdata/coverage/complex_expected.out | 31 +++---- 4 files changed, 80 insertions(+), 65 deletions(-) diff --git a/cli/tools/coverage/mod.rs b/cli/tools/coverage/mod.rs index 3b08f2c77a..48922f1449 100644 --- a/cli/tools/coverage/mod.rs +++ b/cli/tools/coverage/mod.rs @@ -327,6 +327,7 @@ fn generate_coverage_report( coverage_report.found_lines = if let Some(source_map) = maybe_source_map.as_ref() { + let script_source_lines = script_source.lines().collect::>(); let mut found_lines = line_counts .iter() .enumerate() @@ -334,7 +335,23 @@ fn generate_coverage_report( // get all the mappings from this destination line to a different src line let mut results = source_map .tokens() - .filter(move |token| token.get_dst_line() as usize == index) + .filter(|token| { + let dst_line = token.get_dst_line() as usize; + dst_line == index && { + let dst_col = token.get_dst_col() as usize; + let content = script_source_lines + .get(dst_line) + .and_then(|line| { + line.get(dst_col..std::cmp::min(dst_col + 2, line.len())) + }) + .unwrap_or(""); + + !content.is_empty() + && content != "/*" + && content != "*/" + && content != "//" + } + }) .map(move |token| (token.get_src_line() as usize, *count)) .collect::>(); // only keep the results that point at different src lines diff --git a/tests/testdata/coverage/complex.ts b/tests/testdata/coverage/complex.ts index d128b54373..316986cd22 100644 --- a/tests/testdata/coverage/complex.ts +++ b/tests/testdata/coverage/complex.ts @@ -1,3 +1,8 @@ +/** + * @module + * Complex module + */ + // This entire interface should be completely ignored by the coverage tool. export interface Complex { // These comments should be ignored. @@ -19,6 +24,7 @@ function dependency( bar: string, baz: string, ): Complex { + // inline comment in tested function return { foo, bar, @@ -34,6 +40,9 @@ export function complex( bar: string, baz: string, ): Complex { + /* + * block comment in tested function + */ return dependency( foo, bar, @@ -48,6 +57,7 @@ export function unused( bar: string, baz: string, ): Complex { + // inline comment in untested function return complex( foo, bar, @@ -62,6 +72,9 @@ export const π = Math.PI; // And same applies for this one, this one is unused and will show up in // lacking coverage. export function ƒ(): number { + /* + * block comment in untested function + */ return ( 0 ); diff --git a/tests/testdata/coverage/complex_expected.lcov b/tests/testdata/coverage/complex_expected.lcov index 94b86465ae..7e5c0f40f6 100644 --- a/tests/testdata/coverage/complex_expected.lcov +++ b/tests/testdata/coverage/complex_expected.lcov @@ -1,8 +1,8 @@ SF:[WILDCARD]complex.ts -FN:17,dependency -FN:32,complex -FN:46,unused -FN:64,ƒ +FN:22,dependency +FN:38,complex +FN:55,unused +FN:74,ƒ FNDA:1,dependency FNDA:1,complex FNDA:0,unused @@ -11,57 +11,41 @@ FNF:4 FNH:2 BRF:0 BRH:0 -DA:1,1 -DA:13,1 -DA:14,1 -DA:15,1 -DA:16,1 -DA:17,2 -DA:18,2 -DA:19,2 -DA:20,2 DA:22,2 DA:23,2 DA:24,2 DA:25,2 -DA:26,2 -DA:27,2 -DA:29,1 -DA:30,1 -DA:31,1 -DA:32,1 -DA:33,1 -DA:34,1 -DA:35,1 -DA:37,2 -DA:38,2 -DA:39,2 -DA:40,2 -DA:42,2 -DA:44,1 -DA:45,1 -DA:46,0 -DA:47,0 -DA:48,0 -DA:49,0 -DA:51,0 -DA:52,0 -DA:53,0 -DA:54,0 +DA:28,2 +DA:29,2 +DA:30,2 +DA:31,2 +DA:32,2 +DA:33,2 +DA:38,1 +DA:39,1 +DA:40,1 +DA:41,1 +DA:46,2 +DA:47,2 +DA:48,2 +DA:49,2 +DA:51,2 +DA:55,0 DA:56,0 -DA:58,1 -DA:59,1 -DA:60,1 -DA:62,1 -DA:63,1 +DA:57,0 +DA:58,0 +DA:61,0 +DA:62,0 +DA:63,0 DA:64,0 -DA:65,0 DA:66,0 -DA:68,0 DA:70,1 -DA:71,0 -DA:73,1 -DA:74,1 -LH:37 -LF:51 +DA:74,0 +DA:78,0 +DA:79,0 +DA:81,0 +DA:84,0 +DA:87,1 +LH:21 +LF:35 end_of_record diff --git a/tests/testdata/coverage/complex_expected.out b/tests/testdata/coverage/complex_expected.out index 3d5f6a0ab6..f626024b96 100644 --- a/tests/testdata/coverage/complex_expected.out +++ b/tests/testdata/coverage/complex_expected.out @@ -1,20 +1,21 @@ -cover [WILDCARD]/coverage/complex.ts ... 72.549% (37/51) - 46 | export function unused( - 47 | foo: string, - 48 | bar: string, - 49 | baz: string, +cover [WILDCARD]/coverage/complex.ts ... 60.000% (21/35) + 55 | export function unused( + 56 | foo: string, + 57 | bar: string, + 58 | baz: string, -----|----- - 51 | return complex( - 52 | foo, - 53 | bar, - 54 | baz, + 61 | return complex( + 62 | foo, + 63 | bar, + 64 | baz, -----|----- - 56 | } + 66 | } -----|----- - 64 | export function ƒ(): number { - 65 | return ( - 66 | 0 + 74 | export function ƒ(): number { -----|----- - 68 | } + 78 | return ( + 79 | 0 -----|----- - 71 | console.log("%s", () => 1); + 81 | } +-----|----- + 84 | console.log("%s", () => 1); From 90edca21a26fd2decd0603fea37af10d1e11e454 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 31 Oct 2024 11:35:17 -0400 Subject: [PATCH 012/227] fix: surface package.json location on dep parse failure (#26665) Related: https://github.com/denoland/deno/issues/26653 --- cli/args/mod.rs | 1 + cli/args/package_json.rs | 25 ++++++++++++++++--- cli/npm/managed/mod.rs | 20 +++++++++------ .../install/invalid_scheme/__test__.jsonc | 5 ++++ .../specs/install/invalid_scheme/install.out | 5 ++++ .../specs/install/invalid_scheme/package.json | 6 +++++ .../run/package_json/invalid_value/add.out | 3 ++- .../package_json/invalid_value/install.out | 3 ++- 8 files changed, 56 insertions(+), 12 deletions(-) create mode 100644 tests/specs/install/invalid_scheme/__test__.jsonc create mode 100644 tests/specs/install/invalid_scheme/install.out create mode 100644 tests/specs/install/invalid_scheme/package.json diff --git a/cli/args/mod.rs b/cli/args/mod.rs index 754cd38fa9..d725264623 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -46,6 +46,7 @@ pub use flags::*; pub use lockfile::CliLockfile; pub use lockfile::CliLockfileReadFromPathOptions; pub use package_json::NpmInstallDepsProvider; +pub use package_json::PackageJsonDepValueParseWithLocationError; use deno_ast::ModuleSpecifier; use deno_core::anyhow::bail; diff --git a/cli/args/package_json.rs b/cli/args/package_json.rs index 2ef39a30d2..7dc75550c3 100644 --- a/cli/args/package_json.rs +++ b/cli/args/package_json.rs @@ -5,10 +5,12 @@ use std::sync::Arc; use deno_config::workspace::Workspace; use deno_core::serde_json; +use deno_core::url::Url; use deno_package_json::PackageJsonDepValue; use deno_package_json::PackageJsonDepValueParseError; use deno_semver::npm::NpmPackageReqReference; use deno_semver::package::PackageReq; +use thiserror::Error; #[derive(Debug)] pub struct InstallNpmRemotePkg { @@ -23,11 +25,20 @@ pub struct InstallNpmWorkspacePkg { pub target_dir: PathBuf, } +#[derive(Debug, Error, Clone)] +#[error("Failed to install '{}'\n at {}", alias, location)] +pub struct PackageJsonDepValueParseWithLocationError { + pub location: Url, + pub alias: String, + #[source] + pub source: PackageJsonDepValueParseError, +} + #[derive(Debug, Default)] pub struct NpmInstallDepsProvider { remote_pkgs: Vec, workspace_pkgs: Vec, - pkg_json_dep_errors: Vec, + pkg_json_dep_errors: Vec, } impl NpmInstallDepsProvider { @@ -89,7 +100,13 @@ impl NpmInstallDepsProvider { let dep = match dep { Ok(dep) => dep, Err(err) => { - pkg_json_dep_errors.push(err); + pkg_json_dep_errors.push( + PackageJsonDepValueParseWithLocationError { + location: pkg_json.specifier(), + alias, + source: err, + }, + ); continue; } }; @@ -150,7 +167,9 @@ impl NpmInstallDepsProvider { &self.workspace_pkgs } - pub fn pkg_json_dep_errors(&self) -> &[PackageJsonDepValueParseError] { + pub fn pkg_json_dep_errors( + &self, + ) -> &[PackageJsonDepValueParseWithLocationError] { &self.pkg_json_dep_errors } } diff --git a/cli/npm/managed/mod.rs b/cli/npm/managed/mod.rs index d0880557fe..a0754812bb 100644 --- a/cli/npm/managed/mod.rs +++ b/cli/npm/managed/mod.rs @@ -38,6 +38,7 @@ use crate::args::LifecycleScriptsConfig; use crate::args::NpmInstallDepsProvider; use crate::args::NpmProcessState; use crate::args::NpmProcessStateKind; +use crate::args::PackageJsonDepValueParseWithLocationError; use crate::cache::DenoCacheEnvFsAdapter; use crate::cache::FastInsecureHasher; use crate::http_util::HttpClientProvider; @@ -480,19 +481,24 @@ impl ManagedCliNpmResolver { self.resolution.resolve_pkg_id_from_pkg_req(req) } - pub fn ensure_no_pkg_json_dep_errors(&self) -> Result<(), AnyError> { + pub fn ensure_no_pkg_json_dep_errors( + &self, + ) -> Result<(), Box> { for err in self.npm_install_deps_provider.pkg_json_dep_errors() { - match err { + match &err.source { deno_package_json::PackageJsonDepValueParseError::VersionReq(_) => { - return Err( - AnyError::from(err.clone()) - .context("Failed to install from package.json"), - ); + return Err(Box::new(err.clone())); } deno_package_json::PackageJsonDepValueParseError::Unsupported { .. } => { - log::warn!("{} {} in package.json", colors::yellow("Warning"), err) + // only warn for this one + log::warn!( + "{} {}\n at {}", + colors::yellow("Warning"), + err.source, + err.location, + ) } } } diff --git a/tests/specs/install/invalid_scheme/__test__.jsonc b/tests/specs/install/invalid_scheme/__test__.jsonc new file mode 100644 index 0000000000..c4d3ebbf06 --- /dev/null +++ b/tests/specs/install/invalid_scheme/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "tempDir": true, + "args": "install", + "output": "install.out" +} diff --git a/tests/specs/install/invalid_scheme/install.out b/tests/specs/install/invalid_scheme/install.out new file mode 100644 index 0000000000..cf100216bd --- /dev/null +++ b/tests/specs/install/invalid_scheme/install.out @@ -0,0 +1,5 @@ +Warning Not implemented scheme 'git' + at file:///[WILDLINE]/package.json +Download http://localhost:4260/@denotest%2fadd +Download http://localhost:4260/@denotest/add/1.0.0.tgz +Initialize @denotest/add@1.0.0 diff --git a/tests/specs/install/invalid_scheme/package.json b/tests/specs/install/invalid_scheme/package.json new file mode 100644 index 0000000000..5e50ae591d --- /dev/null +++ b/tests/specs/install/invalid_scheme/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "@denotest/add": "*", + "deno": "git:denoland/deno" + } +} diff --git a/tests/specs/run/package_json/invalid_value/add.out b/tests/specs/run/package_json/invalid_value/add.out index 9b7493c1a2..32d9acaed6 100644 --- a/tests/specs/run/package_json/invalid_value/add.out +++ b/tests/specs/run/package_json/invalid_value/add.out @@ -1,5 +1,6 @@ Add npm:cowsay@1.5.0 -error: Failed to install from package.json +error: Failed to install '@denotest/cjs-default-export' + at file:///[WILDLINE]/package.json Caused by: 0: Invalid version requirement diff --git a/tests/specs/run/package_json/invalid_value/install.out b/tests/specs/run/package_json/invalid_value/install.out index cc82b345b0..ca3492ab22 100644 --- a/tests/specs/run/package_json/invalid_value/install.out +++ b/tests/specs/run/package_json/invalid_value/install.out @@ -1,4 +1,5 @@ -error: Failed to install from package.json +error: Failed to install '@denotest/cjs-default-export' + at file:///[WILDLINE]/package.json Caused by: 0: Invalid version requirement From 951103fc8de952f32386121d3f0e4803fe267ea4 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Thu, 31 Oct 2024 10:02:17 -0700 Subject: [PATCH 013/227] fix(ext/node): convert errors from `fs.readFile/fs.readFileSync` to node format (#26632) Fixes the original issue reported in #26404. storybook runs into other errors after this PR (the new errors will be fixed in other PRs). Some code used by a dependency of storybook does a [string comparison on the error message](https://github.com/chromaui/chromatic-cli/blob/ce30b2be343cb96a0826390b95ea42befb2be547/node-src/lib/getConfiguration.ts#L88-L92) thrown here to check for a file not found error. --- ext/node/polyfills/_fs/_fs_readFile.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ext/node/polyfills/_fs/_fs_readFile.ts b/ext/node/polyfills/_fs/_fs_readFile.ts index 0f05ee1678..cf7e0305d8 100644 --- a/ext/node/polyfills/_fs/_fs_readFile.ts +++ b/ext/node/polyfills/_fs/_fs_readFile.ts @@ -19,6 +19,7 @@ import { TextEncodings, } from "ext:deno_node/_utils.ts"; import { FsFile } from "ext:deno_fs/30_fs.js"; +import { denoErrorToNodeError } from "ext:deno_node/internal/errors.ts"; function maybeDecode(data: Uint8Array, encoding: TextEncodings): string; function maybeDecode( @@ -87,7 +88,7 @@ export function readFile( } const buffer = maybeDecode(data, encoding); (cb as BinaryCallback)(null, buffer); - }, (err) => cb && cb(err)); + }, (err) => cb && cb(denoErrorToNodeError(err))); } } @@ -117,7 +118,12 @@ export function readFileSync( opt?: FileOptionsArgument, ): string | Buffer { path = path instanceof URL ? pathFromURL(path) : path; - const data = Deno.readFileSync(path); + let data; + try { + data = Deno.readFileSync(path); + } catch (err) { + throw denoErrorToNodeError(err); + } const encoding = getEncoding(opt); if (encoding && encoding !== "binary") { const text = maybeDecode(data, encoding); From 6d44952d4daaaab8ed9ec82212d2256c058eb05d Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Thu, 31 Oct 2024 10:02:31 -0700 Subject: [PATCH 014/227] fix(ext/node): resolve exports even if parent module filename isn't present (#26553) Fixes https://github.com/denoland/deno/issues/26505 I'm not exactly sure how this case comes about (I tried to write tests for it but couldn't manage to reproduce it), but what happens is the parent filename ends up null, and we bail out of resolving the specifier in package exports. I've checked, and in node the parent filename is also null (so that's not a bug on our part), but node continues to resolve even in that case. So this PR should match node's behavior more closely than we currently do. --- ext/node/ops/require.rs | 8 ++++++-- ext/node/polyfills/01_require.js | 6 +----- .../cjs-multiple-exports/1.0.0/package.json | 8 ++++++++ .../cjs-multiple-exports/1.0.0/src/add.js | 3 +++ .../cjs-multiple-exports/1.0.0/src/index.js | 3 +++ .../__test__.jsonc | 13 +++++++++++++ .../main.cjs | 16 ++++++++++++++++ .../package.json | 5 +++++ 8 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/package.json create mode 100644 tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/src/add.js create mode 100644 tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/src/index.js create mode 100644 tests/specs/node/require_export_from_parent_with_no_filename/__test__.jsonc create mode 100644 tests/specs/node/require_export_from_parent_with_no_filename/main.cjs create mode 100644 tests/specs/node/require_export_from_parent_with_no_filename/package.json diff --git a/ext/node/ops/require.rs b/ext/node/ops/require.rs index 43867053b0..7524fb43c7 100644 --- a/ext/node/ops/require.rs +++ b/ext/node/ops/require.rs @@ -529,12 +529,16 @@ where return Ok(None); }; - let referrer = Url::from_file_path(parent_path).unwrap(); + let referrer = if parent_path.is_empty() { + None + } else { + Some(Url::from_file_path(parent_path).unwrap()) + }; let r = node_resolver.package_exports_resolve( &pkg.path, &format!(".{expansion}"), exports, - Some(&referrer), + referrer.as_ref(), NodeModuleKind::Cjs, REQUIRE_CONDITIONS, NodeResolutionMode::Execution, diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js index 5b0980c310..7935903a8d 100644 --- a/ext/node/polyfills/01_require.js +++ b/ext/node/polyfills/01_require.js @@ -523,17 +523,13 @@ function resolveExports( return; } - if (!parentPath) { - return false; - } - return op_require_resolve_exports( usesLocalNodeModulesDir, modulesPath, request, name, expansion, - parentPath, + parentPath ?? "", ) ?? false; } diff --git a/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/package.json b/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/package.json new file mode 100644 index 0000000000..43f07a2351 --- /dev/null +++ b/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/package.json @@ -0,0 +1,8 @@ +{ + "name": "@denotest/cjs-multiple-exports", + "version": "1.0.0", + "exports": { + ".": "./src/index.js", + "./add": "./src/add.js" + } +} \ No newline at end of file diff --git a/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/src/add.js b/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/src/add.js new file mode 100644 index 0000000000..42c8a7c604 --- /dev/null +++ b/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/src/add.js @@ -0,0 +1,3 @@ +module.exports = function add(a, b) { + return a + b; +}; \ No newline at end of file diff --git a/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/src/index.js b/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/src/index.js new file mode 100644 index 0000000000..432ed652ed --- /dev/null +++ b/tests/registry/npm/@denotest/cjs-multiple-exports/1.0.0/src/index.js @@ -0,0 +1,3 @@ +module.exports = { + hello: "world" +}; \ No newline at end of file diff --git a/tests/specs/node/require_export_from_parent_with_no_filename/__test__.jsonc b/tests/specs/node/require_export_from_parent_with_no_filename/__test__.jsonc new file mode 100644 index 0000000000..a3de08e460 --- /dev/null +++ b/tests/specs/node/require_export_from_parent_with_no_filename/__test__.jsonc @@ -0,0 +1,13 @@ +{ + "tempDir": true, + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "run -A main.cjs", + "output": "3\n" + } + ] +} diff --git a/tests/specs/node/require_export_from_parent_with_no_filename/main.cjs b/tests/specs/node/require_export_from_parent_with_no_filename/main.cjs new file mode 100644 index 0000000000..3335ae1bf9 --- /dev/null +++ b/tests/specs/node/require_export_from_parent_with_no_filename/main.cjs @@ -0,0 +1,16 @@ +const path = require("node:path"); +const Module = require("node:module"); +function requireFromString(code, filename) { + const paths = Module._nodeModulePaths((0, path.dirname)(filename)); + const m = new Module(filename, module.parent); + m.paths = paths; + m._compile(code, filename); + return m.exports; +} + +const code = ` +const add = require("@denotest/cjs-multiple-exports/add"); + +console.log(add(1, 2)); +`; +requireFromString(code, "fake.js"); diff --git a/tests/specs/node/require_export_from_parent_with_no_filename/package.json b/tests/specs/node/require_export_from_parent_with_no_filename/package.json new file mode 100644 index 0000000000..9cd6438953 --- /dev/null +++ b/tests/specs/node/require_export_from_parent_with_no_filename/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@denotest/cjs-multiple-exports": "1.0.0" + } +} From 6c6bbeb97495e8c3e8eac7bea27bf836f02b575f Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Thu, 31 Oct 2024 22:18:33 -0700 Subject: [PATCH 015/227] fix(node): Implement `os.userInfo` properly, add missing `toPrimitive` (#24702) Fixes the implementation of `os.userInfo`, and adds a missing `toPrimitive` for `tmpdir`. This allows us to enable the corresponding node_compat test. --- ext/node/lib.rs | 2 +- ext/node/ops/os/mod.rs | 156 ++++++++++- ext/node/polyfills/internal/errors.ts | 13 - ext/node/polyfills/os.ts | 53 ++-- runtime/errors.rs | 1 + runtime/permissions/lib.rs | 8 +- tests/node_compat/config.jsonc | 3 +- tests/node_compat/runner/TODO.md | 1 - tests/node_compat/test/parallel/test-os.js | 286 +++++++++++++++++++++ 9 files changed, 469 insertions(+), 54 deletions(-) create mode 100644 tests/node_compat/test/parallel/test-os.js diff --git a/ext/node/lib.rs b/ext/node/lib.rs index 32624f38b7..b34bea815b 100644 --- a/ext/node/lib.rs +++ b/ext/node/lib.rs @@ -348,7 +348,7 @@ deno_core::extension!(deno_node, ops::http2::op_http2_send_response, ops::os::op_node_os_get_priority

, ops::os::op_node_os_set_priority

, - ops::os::op_node_os_username

, + ops::os::op_node_os_user_info

, ops::os::op_geteuid

, ops::os::op_getegid

, ops::os::op_cpus

, diff --git a/ext/node/ops/os/mod.rs b/ext/node/ops/os/mod.rs index b4c9eaa8ca..ea7e6b99fd 100644 --- a/ext/node/ops/os/mod.rs +++ b/ext/node/ops/os/mod.rs @@ -1,5 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use std::mem::MaybeUninit; + use crate::NodePermissions; use deno_core::op2; use deno_core::OpState; @@ -15,6 +17,8 @@ pub enum OsError { Permission(deno_core::error::AnyError), #[error("Failed to get cpu info")] FailedToGetCpuInfo, + #[error("Failed to get user info")] + FailedToGetUserInfo(#[source] std::io::Error), } #[op2(fast)] @@ -54,20 +58,162 @@ where priority::set_priority(pid, priority).map_err(OsError::Priority) } +#[derive(serde::Serialize)] +pub struct UserInfo { + username: String, + homedir: String, + shell: Option, +} + +#[cfg(unix)] +fn get_user_info(uid: u32) -> Result { + use std::ffi::CStr; + let mut pw: MaybeUninit = MaybeUninit::uninit(); + let mut result: *mut libc::passwd = std::ptr::null_mut(); + // SAFETY: libc call, no invariants + let max_buf_size = unsafe { libc::sysconf(libc::_SC_GETPW_R_SIZE_MAX) }; + let buf_size = if max_buf_size < 0 { + // from the man page + 16_384 + } else { + max_buf_size as usize + }; + let mut buf = { + let mut b = Vec::>::with_capacity(buf_size); + // SAFETY: MaybeUninit has no initialization invariants, and len == cap + unsafe { + b.set_len(buf_size); + } + b + }; + // SAFETY: libc call, args are correct + let s = unsafe { + libc::getpwuid_r( + uid, + pw.as_mut_ptr(), + buf.as_mut_ptr().cast(), + buf_size, + std::ptr::addr_of_mut!(result), + ) + }; + if result.is_null() { + if s != 0 { + return Err( + OsError::FailedToGetUserInfo(std::io::Error::last_os_error()), + ); + } else { + return Err(OsError::FailedToGetUserInfo(std::io::Error::from( + std::io::ErrorKind::NotFound, + ))); + } + } + // SAFETY: pw was initialized by the call to `getpwuid_r` above + let pw = unsafe { pw.assume_init() }; + // SAFETY: initialized above, pw alive until end of function, nul terminated + let username = unsafe { CStr::from_ptr(pw.pw_name) }; + // SAFETY: initialized above, pw alive until end of function, nul terminated + let homedir = unsafe { CStr::from_ptr(pw.pw_dir) }; + // SAFETY: initialized above, pw alive until end of function, nul terminated + let shell = unsafe { CStr::from_ptr(pw.pw_shell) }; + Ok(UserInfo { + username: username.to_string_lossy().into_owned(), + homedir: homedir.to_string_lossy().into_owned(), + shell: Some(shell.to_string_lossy().into_owned()), + }) +} + +#[cfg(windows)] +fn get_user_info(_uid: u32) -> Result { + use std::ffi::OsString; + use std::os::windows::ffi::OsStringExt; + + use windows_sys::Win32::Foundation::CloseHandle; + use windows_sys::Win32::Foundation::GetLastError; + use windows_sys::Win32::Foundation::ERROR_INSUFFICIENT_BUFFER; + use windows_sys::Win32::Foundation::HANDLE; + use windows_sys::Win32::System::Threading::GetCurrentProcess; + use windows_sys::Win32::System::Threading::OpenProcessToken; + use windows_sys::Win32::UI::Shell::GetUserProfileDirectoryW; + struct Handle(HANDLE); + impl Drop for Handle { + fn drop(&mut self) { + // SAFETY: win32 call + unsafe { + CloseHandle(self.0); + } + } + } + let mut token: MaybeUninit = MaybeUninit::uninit(); + + // Get a handle to the current process + // SAFETY: win32 call + unsafe { + if OpenProcessToken( + GetCurrentProcess(), + windows_sys::Win32::Security::TOKEN_READ, + token.as_mut_ptr(), + ) == 0 + { + return Err( + OsError::FailedToGetUserInfo(std::io::Error::last_os_error()), + ); + } + } + + // SAFETY: initialized by call above + let token = Handle(unsafe { token.assume_init() }); + + let mut bufsize = 0; + // get the size for the homedir buf (it'll end up in `bufsize`) + // SAFETY: win32 call + unsafe { + GetUserProfileDirectoryW(token.0, std::ptr::null_mut(), &mut bufsize); + let err = GetLastError(); + if err != ERROR_INSUFFICIENT_BUFFER { + return Err(OsError::FailedToGetUserInfo( + std::io::Error::from_raw_os_error(err as i32), + )); + } + } + let mut path = vec![0; bufsize as usize]; + // Actually get the homedir + // SAFETY: path is `bufsize` elements + unsafe { + if GetUserProfileDirectoryW(token.0, path.as_mut_ptr(), &mut bufsize) == 0 { + return Err( + OsError::FailedToGetUserInfo(std::io::Error::last_os_error()), + ); + } + } + // remove trailing nul + path.pop(); + let homedir_wide = OsString::from_wide(&path); + let homedir = homedir_wide.to_string_lossy().into_owned(); + + Ok(UserInfo { + username: deno_whoami::username(), + homedir, + shell: None, + }) +} + #[op2] -#[string] -pub fn op_node_os_username

( +#[serde] +pub fn op_node_os_user_info

( state: &mut OpState, -) -> Result + #[smi] uid: u32, +) -> Result where P: NodePermissions + 'static, { { let permissions = state.borrow_mut::

(); - permissions.check_sys("username", "node:os.userInfo()")?; + permissions + .check_sys("userInfo", "node:os.userInfo()") + .map_err(OsError::Permission)?; } - Ok(deno_whoami::username()) + get_user_info(uid) } #[op2(fast)] diff --git a/ext/node/polyfills/internal/errors.ts b/ext/node/polyfills/internal/errors.ts index 51bd7a0250..5a3d4437a1 100644 --- a/ext/node/polyfills/internal/errors.ts +++ b/ext/node/polyfills/internal/errors.ts @@ -2558,19 +2558,6 @@ export class ERR_FS_RMDIR_ENOTDIR extends NodeSystemError { } } -export class ERR_OS_NO_HOMEDIR extends NodeSystemError { - constructor() { - const code = isWindows ? "ENOENT" : "ENOTDIR"; - const ctx: NodeSystemErrorCtx = { - message: "not a directory", - syscall: "home", - code, - errno: isWindows ? osConstants.errno.ENOENT : osConstants.errno.ENOTDIR, - }; - super(code, ctx, "Path is not a directory"); - } -} - export class ERR_HTTP_SOCKET_ASSIGNED extends NodeError { constructor() { super( diff --git a/ext/node/polyfills/os.ts b/ext/node/polyfills/os.ts index e47e8679ec..edc89ed2c3 100644 --- a/ext/node/polyfills/os.ts +++ b/ext/node/polyfills/os.ts @@ -28,16 +28,17 @@ import { op_homedir, op_node_os_get_priority, op_node_os_set_priority, - op_node_os_username, + op_node_os_user_info, } from "ext:core/ops"; import { validateIntegerRange } from "ext:deno_node/_utils.ts"; import process from "node:process"; import { isWindows } from "ext:deno_node/_util/os.ts"; -import { ERR_OS_NO_HOMEDIR } from "ext:deno_node/internal/errors.ts"; import { os } from "ext:deno_node/internal_binding/constants.ts"; import { osUptime } from "ext:runtime/30_os.js"; import { Buffer } from "ext:deno_node/internal/buffer.mjs"; +import { primordials } from "ext:core/mod.js"; +const { StringPrototypeEndsWith, StringPrototypeSlice } = primordials; export const constants = os; @@ -136,6 +137,8 @@ export function arch(): string { (uptime as any)[Symbol.toPrimitive] = (): number => uptime(); // deno-lint-ignore no-explicit-any (machine as any)[Symbol.toPrimitive] = (): string => machine(); +// deno-lint-ignore no-explicit-any +(tmpdir as any)[Symbol.toPrimitive] = (): string | null => tmpdir(); export function cpus(): CPUCoreInfo[] { return op_cpus(); @@ -268,26 +271,27 @@ export function setPriority(pid: number, priority?: number) { export function tmpdir(): string | null { /* This follows the node js implementation, but has a few differences: - * On windows, if none of the environment variables are defined, - we return null. - * On unix we use a plain Deno.env.get, instead of safeGetenv, + * We use a plain Deno.env.get, instead of safeGetenv, which special cases setuid binaries. - * Node removes a single trailing / or \, we remove all. */ if (isWindows) { - const temp = Deno.env.get("TEMP") || Deno.env.get("TMP"); - if (temp) { - return temp.replace(/(? 1 && StringPrototypeEndsWith(temp, "\\") && + !StringPrototypeEndsWith(temp, ":\\") + ) { + temp = StringPrototypeSlice(temp, 0, -1); } - const base = Deno.env.get("SYSTEMROOT") || Deno.env.get("WINDIR"); - if (base) { - return base + "\\temp"; - } - return null; + + return temp; } else { // !isWindows - const temp = Deno.env.get("TMPDIR") || Deno.env.get("TMP") || + let temp = Deno.env.get("TMPDIR") || Deno.env.get("TMP") || Deno.env.get("TEMP") || "/tmp"; - return temp.replace(/(? 1 && StringPrototypeEndsWith(temp, "/")) { + temp = StringPrototypeSlice(temp, 0, -1); + } + return temp; } } @@ -320,7 +324,6 @@ export function uptime(): number { return osUptime(); } -/** Not yet implemented */ export function userInfo( options: UserInfoOptions = { encoding: "utf-8" }, ): UserInfo { @@ -331,20 +334,10 @@ export function userInfo( uid = -1; gid = -1; } - - // TODO(@crowlKats): figure out how to do this correctly: - // The value of homedir returned by os.userInfo() is provided by the operating system. - // This differs from the result of os.homedir(), which queries environment - // variables for the home directory before falling back to the operating system response. - let _homedir = homedir(); - if (!_homedir) { - throw new ERR_OS_NO_HOMEDIR(); - } - let shell = isWindows ? null : (Deno.env.get("SHELL") || null); - let username = op_node_os_username(); + let { username, homedir, shell } = op_node_os_user_info(uid); if (options?.encoding === "buffer") { - _homedir = _homedir ? Buffer.from(_homedir) : _homedir; + homedir = homedir ? Buffer.from(homedir) : homedir; shell = shell ? Buffer.from(shell) : shell; username = Buffer.from(username); } @@ -352,7 +345,7 @@ export function userInfo( return { uid, gid, - homedir: _homedir, + homedir, shell, username, }; diff --git a/runtime/errors.rs b/runtime/errors.rs index 07bf694dc1..a5c436e751 100644 --- a/runtime/errors.rs +++ b/runtime/errors.rs @@ -1086,6 +1086,7 @@ mod node { }, OsError::Permission(e) => get_error_class_name(e).unwrap_or("Error"), OsError::FailedToGetCpuInfo => "TypeError", + OsError::FailedToGetUserInfo(e) => get_io_error_class(e), } } diff --git a/runtime/permissions/lib.rs b/runtime/permissions/lib.rs index 1e1321bb2f..84503f025b 100644 --- a/runtime/permissions/lib.rs +++ b/runtime/permissions/lib.rs @@ -1368,8 +1368,12 @@ impl SysDescriptor { match kind.as_str() { "hostname" | "osRelease" | "osUptime" | "loadavg" | "networkInterfaces" | "systemMemoryInfo" | "uid" | "gid" | "cpus" - | "homedir" | "getegid" | "username" | "statfs" | "getPriority" - | "setPriority" => Ok(Self(kind)), + | "homedir" | "getegid" | "statfs" | "getPriority" | "setPriority" + | "userInfo" => Ok(Self(kind)), + + // the underlying permission check changed to `userInfo` to better match the API, + // alias this to avoid breaking existing projects with `--allow-sys=username` + "username" => Ok(Self("userInfo".into())), _ => Err(type_error(format!("unknown system info kind \"{kind}\""))), } } diff --git a/tests/node_compat/config.jsonc b/tests/node_compat/config.jsonc index a99a427900..16951d9ede 100644 --- a/tests/node_compat/config.jsonc +++ b/tests/node_compat/config.jsonc @@ -87,8 +87,6 @@ "test-net-server-try-ports.js", "test-net-socket-timeout.js", "test-net-write-arguments.js", - // TODO(nathanwhit): Disable os.userInfo is slightly incorrect - // "test-os.js", "test-path-resolve.js", "test-querystring.js", "test-readline-interface.js", @@ -448,6 +446,7 @@ "test-next-tick-when-exiting.js", "test-next-tick.js", "test-nodeeventtarget.js", + "test-os.js", "test-outgoing-message-destroy.js", "test-outgoing-message-pipe.js", "test-parse-args.mjs", diff --git a/tests/node_compat/runner/TODO.md b/tests/node_compat/runner/TODO.md index 35a67e72d2..231a4f62c9 100644 --- a/tests/node_compat/runner/TODO.md +++ b/tests/node_compat/runner/TODO.md @@ -1878,7 +1878,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-os-homedir-no-envvar.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-os-homedir-no-envvar.js) - [parallel/test-os-process-priority.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-os-process-priority.js) - [parallel/test-os-userinfo-handles-getter-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-os-userinfo-handles-getter-errors.js) -- [parallel/test-os.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-os.js) - [parallel/test-path-posix-relative-on-windows.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-path-posix-relative-on-windows.js) - [parallel/test-pending-deprecation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-pending-deprecation.js) - [parallel/test-perf-gc-crash.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-perf-gc-crash.js) diff --git a/tests/node_compat/test/parallel/test-os.js b/tests/node_compat/test/parallel/test-os.js new file mode 100644 index 0000000000..f7c24342ad --- /dev/null +++ b/tests/node_compat/test/parallel/test-os.js @@ -0,0 +1,286 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 18.12.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const os = require('os'); +const path = require('path'); +const { inspect } = require('util'); + +const is = { + number: (value, key) => { + assert(!Number.isNaN(value), `${key} should not be NaN`); + assert.strictEqual(typeof value, 'number'); + }, + string: (value) => { assert.strictEqual(typeof value, 'string'); }, + array: (value) => { assert.ok(Array.isArray(value)); }, + object: (value) => { + assert.strictEqual(typeof value, 'object'); + assert.notStrictEqual(value, null); + } +}; + +process.env.TMPDIR = '/tmpdir'; +process.env.TMP = '/tmp'; +process.env.TEMP = '/temp'; +if (common.isWindows) { + assert.strictEqual(os.tmpdir(), '/temp'); + process.env.TEMP = ''; + assert.strictEqual(os.tmpdir(), '/tmp'); + process.env.TMP = ''; + const expected = `${process.env.SystemRoot || process.env.windir}\\temp`; + assert.strictEqual(os.tmpdir(), expected); + process.env.TEMP = '\\temp\\'; + assert.strictEqual(os.tmpdir(), '\\temp'); + process.env.TEMP = '\\tmpdir/'; + assert.strictEqual(os.tmpdir(), '\\tmpdir/'); + process.env.TEMP = '\\'; + assert.strictEqual(os.tmpdir(), '\\'); + process.env.TEMP = 'C:\\'; + assert.strictEqual(os.tmpdir(), 'C:\\'); +} else { + assert.strictEqual(os.tmpdir(), '/tmpdir'); + process.env.TMPDIR = ''; + assert.strictEqual(os.tmpdir(), '/tmp'); + process.env.TMP = ''; + assert.strictEqual(os.tmpdir(), '/temp'); + process.env.TEMP = ''; + assert.strictEqual(os.tmpdir(), '/tmp'); + process.env.TMPDIR = '/tmpdir/'; + assert.strictEqual(os.tmpdir(), '/tmpdir'); + process.env.TMPDIR = '/tmpdir\\'; + assert.strictEqual(os.tmpdir(), '/tmpdir\\'); + process.env.TMPDIR = '/'; + assert.strictEqual(os.tmpdir(), '/'); +} + +const endianness = os.endianness(); +is.string(endianness); +assert.match(endianness, /[BL]E/); + +const hostname = os.hostname(); +is.string(hostname); +assert.ok(hostname.length > 0); + +// IBMi process priority is different. +if (!common.isIBMi) { + const DUMMY_PRIORITY = 10; + os.setPriority(DUMMY_PRIORITY); + const priority = os.getPriority(); + is.number(priority); + assert.strictEqual(priority, DUMMY_PRIORITY); +} + +// On IBMi, os.uptime() returns 'undefined' +if (!common.isIBMi) { + const uptime = os.uptime(); + is.number(uptime); + assert.ok(uptime > 0); +} + +const cpus = os.cpus(); +is.array(cpus); +assert.ok(cpus.length > 0); +for (const cpu of cpus) { + assert.strictEqual(typeof cpu.model, 'string'); + assert.strictEqual(typeof cpu.speed, 'number'); + assert.strictEqual(typeof cpu.times.user, 'number'); + assert.strictEqual(typeof cpu.times.nice, 'number'); + assert.strictEqual(typeof cpu.times.sys, 'number'); + assert.strictEqual(typeof cpu.times.idle, 'number'); + assert.strictEqual(typeof cpu.times.irq, 'number'); +} + +const type = os.type(); +is.string(type); +assert.ok(type.length > 0); + +const release = os.release(); +is.string(release); +assert.ok(release.length > 0); +// TODO: Check format on more than just AIX +if (common.isAIX) + assert.match(release, /^\d+\.\d+$/); + +const platform = os.platform(); +is.string(platform); +assert.ok(platform.length > 0); + +const arch = os.arch(); +is.string(arch); +assert.ok(arch.length > 0); + +if (!common.isSunOS) { + // not implemented yet + assert.ok(os.loadavg().length > 0); + assert.ok(os.freemem() > 0); + assert.ok(os.totalmem() > 0); +} + +const interfaces = os.networkInterfaces(); +switch (platform) { + case 'linux': { + const filter = (e) => + e.address === '127.0.0.1' && + e.netmask === '255.0.0.0'; + + const actual = interfaces.lo.filter(filter); + const expected = [{ + address: '127.0.0.1', + netmask: '255.0.0.0', + family: 'IPv4', + mac: '00:00:00:00:00:00', + internal: true, + cidr: '127.0.0.1/8' + }]; + assert.deepStrictEqual(actual, expected); + break; + } + case 'win32': { + const filter = (e) => + e.address === '127.0.0.1'; + + const actual = interfaces['Loopback Pseudo-Interface 1'].filter(filter); + const expected = [{ + address: '127.0.0.1', + netmask: '255.0.0.0', + family: 'IPv4', + mac: '00:00:00:00:00:00', + internal: true, + cidr: '127.0.0.1/8' + }]; + assert.deepStrictEqual(actual, expected); + break; + } +} +const netmaskToCIDRSuffixMap = new Map(Object.entries({ + '255.0.0.0': 8, + '255.255.255.0': 24, + 'ffff:ffff:ffff:ffff::': 64, + 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff': 128 +})); + +Object.values(interfaces) + .flat(Infinity) + .map((v) => ({ v, mask: netmaskToCIDRSuffixMap.get(v.netmask) })) + .forEach(({ v, mask }) => { + assert.ok('cidr' in v, `"cidr" prop not found in ${inspect(v)}`); + if (mask) { + assert.strictEqual(v.cidr, `${v.address}/${mask}`); + } + }); + +const EOL = os.EOL; +if (common.isWindows) { + assert.strictEqual(EOL, '\r\n'); +} else { + assert.strictEqual(EOL, '\n'); +} + +const home = os.homedir(); +is.string(home); +assert.ok(home.includes(path.sep)); + +const version = os.version(); +assert.strictEqual(typeof version, 'string'); +assert(version); + +if (common.isWindows && process.env.USERPROFILE) { + assert.strictEqual(home, process.env.USERPROFILE); + delete process.env.USERPROFILE; + assert.ok(os.homedir().includes(path.sep)); + process.env.USERPROFILE = home; +} else if (!common.isWindows && process.env.HOME) { + assert.strictEqual(home, process.env.HOME); + delete process.env.HOME; + assert.ok(os.homedir().includes(path.sep)); + process.env.HOME = home; +} + +const pwd = os.userInfo(); +is.object(pwd); +const pwdBuf = os.userInfo({ encoding: 'buffer' }); + +if (common.isWindows) { + assert.strictEqual(pwd.uid, -1); + assert.strictEqual(pwd.gid, -1); + assert.strictEqual(pwd.shell, null); + assert.strictEqual(pwdBuf.uid, -1); + assert.strictEqual(pwdBuf.gid, -1); + assert.strictEqual(pwdBuf.shell, null); +} else { + is.number(pwd.uid); + is.number(pwd.gid); + assert.strictEqual(typeof pwd.shell, 'string'); + // It's possible for /etc/passwd to leave the user's shell blank. + if (pwd.shell.length > 0) { + assert(pwd.shell.includes(path.sep)); + } + assert.strictEqual(pwd.uid, pwdBuf.uid); + assert.strictEqual(pwd.gid, pwdBuf.gid); + assert.strictEqual(pwd.shell, pwdBuf.shell.toString('utf8')); +} + +is.string(pwd.username); +assert.ok(pwd.homedir.includes(path.sep)); +assert.strictEqual(pwd.username, pwdBuf.username.toString('utf8')); +assert.strictEqual(pwd.homedir, pwdBuf.homedir.toString('utf8')); + +assert.strictEqual(`${os.hostname}`, os.hostname()); +assert.strictEqual(`${os.homedir}`, os.homedir()); +assert.strictEqual(`${os.release}`, os.release()); +assert.strictEqual(`${os.type}`, os.type()); +assert.strictEqual(`${os.endianness}`, os.endianness()); +assert.strictEqual(`${os.tmpdir}`, os.tmpdir()); +assert.strictEqual(`${os.arch}`, os.arch()); +assert.strictEqual(`${os.platform}`, os.platform()); +assert.strictEqual(`${os.version}`, os.version()); +assert.strictEqual(`${os.machine}`, os.machine()); +assert.strictEqual(+os.totalmem, os.totalmem()); + +// Assert that the following values are coercible to numbers. +// On IBMi, os.uptime() returns 'undefined' +if (!common.isIBMi) { + is.number(+os.uptime, 'uptime'); + is.number(os.uptime(), 'uptime'); +} + +is.number(+os.availableParallelism, 'availableParallelism'); +is.number(os.availableParallelism(), 'availableParallelism'); +is.number(+os.freemem, 'freemem'); +is.number(os.freemem(), 'freemem'); + +const devNull = os.devNull; +if (common.isWindows) { + assert.strictEqual(devNull, '\\\\.\\nul'); +} else { + assert.strictEqual(devNull, '/dev/null'); +} + +assert.ok(os.availableParallelism() > 0); From 04ae1a551726dd6e0047a942b459d18e1dcb1935 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Thu, 31 Oct 2024 22:19:19 -0700 Subject: [PATCH 016/227] fix(cli): set `npm_config_user_agent` when running npm packages or tasks (#26639) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #25342. Still not sure on the exact user agent to set (should it include `node`?). After this PR, here's the state of running some `create-*` packages (just ones I could think of off the top of my head): | package | prints/runs/suggests deno install | notes | | ---------------- | ------------- | ------ | | `create-next-app` | ❌ | falls back to npm, needs a PR ([code](https://github.com/vercel/next.js/blob/c32e2802097c03fd9f95b1dae228d6e0257569c0/packages/create-next-app/helpers/get-pkg-manager.ts#L3)) | `sv create` | ❌ | uses `package-manager-detector`, needs a PR ([code](https://github.com/antfu-collective/package-manager-detector/tree/main)) | `create-qwik` | ✅ | runs `deno install` but suggests `deno start` which doesn't work (should be `deno task start` or `deno run start`) | `create-astro` | ✅ | runs `deno install` but suggests `npm run dev` later in output, probably needs a PR | `nuxi init` | ❌ | deno not an option in dialog, needs a PR ([code](https://github.com/nuxt/cli/blob/f04e2e894446f597da9d971b7eb03191d5a0da7e/src/commands/init.ts#L96-L102)) | `create-react-app` | ❌ | uses npm | `ng new` (`@angular/cli`) | ❌ | uses npm | `create-vite` | ✅ | suggests working deno commands 🎉 | `create-solid` | ❌ | suggests npm commands, needs PR It's possible that fixing `package-manager-detector` or other packages might make some of these just work, but haven't looked too carefully at each --- cli/npm/mod.rs | 12 +++++ cli/task_runner.rs | 10 +++- cli/tools/run/mod.rs | 18 ++++++++ .../print-npm-user-agent/1.0.0/index.js | 2 + .../print-npm-user-agent/1.0.0/package.json | 10 ++++ .../npm/user_agent_env_var/__test__.jsonc | 46 +++++++++++++++++++ .../npm/user_agent_env_var/bin_command.out | 2 + tests/specs/npm/user_agent_env_var/deno.jsonc | 3 ++ tests/specs/npm/user_agent_env_var/main.ts | 1 + .../specs/npm/user_agent_env_var/package.json | 8 ++++ .../npm/user_agent_env_var/postinstall.out | 10 ++++ tests/specs/npm/user_agent_env_var/run.out | 1 + tests/specs/npm/user_agent_env_var/test.mjs | 1 + 13 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 tests/registry/npm/@denotest/print-npm-user-agent/1.0.0/index.js create mode 100644 tests/registry/npm/@denotest/print-npm-user-agent/1.0.0/package.json create mode 100644 tests/specs/npm/user_agent_env_var/__test__.jsonc create mode 100644 tests/specs/npm/user_agent_env_var/bin_command.out create mode 100644 tests/specs/npm/user_agent_env_var/deno.jsonc create mode 100644 tests/specs/npm/user_agent_env_var/main.ts create mode 100644 tests/specs/npm/user_agent_env_var/package.json create mode 100644 tests/specs/npm/user_agent_env_var/postinstall.out create mode 100644 tests/specs/npm/user_agent_env_var/run.out create mode 100644 tests/specs/npm/user_agent_env_var/test.mjs diff --git a/cli/npm/mod.rs b/cli/npm/mod.rs index f48f7a7405..3971b1a0b3 100644 --- a/cli/npm/mod.rs +++ b/cli/npm/mod.rs @@ -189,3 +189,15 @@ impl NpmFetchResolver { info } } + +pub const NPM_CONFIG_USER_AGENT_ENV_VAR: &str = "npm_config_user_agent"; + +pub fn get_npm_config_user_agent() -> String { + format!( + "deno/{} npm/? deno/{} {} {}", + env!("CARGO_PKG_VERSION"), + env!("CARGO_PKG_VERSION"), + std::env::consts::OS, + std::env::consts::ARCH + ) +} diff --git a/cli/task_runner.rs b/cli/task_runner.rs index 418043b23f..43840e868d 100644 --- a/cli/task_runner.rs +++ b/cli/task_runner.rs @@ -155,6 +155,12 @@ fn prepare_env_vars( initial_cwd.to_string_lossy().to_string(), ); } + if !env_vars.contains_key(crate::npm::NPM_CONFIG_USER_AGENT_ENV_VAR) { + env_vars.insert( + crate::npm::NPM_CONFIG_USER_AGENT_ENV_VAR.into(), + crate::npm::get_npm_config_user_agent(), + ); + } if let Some(node_modules_dir) = node_modules_dir { prepend_to_path( &mut env_vars, @@ -204,7 +210,7 @@ impl ShellCommand for NpmCommand { mut context: ShellCommandContext, ) -> LocalBoxFuture<'static, ExecuteResult> { if context.args.first().map(|s| s.as_str()) == Some("run") - && context.args.len() > 2 + && context.args.len() >= 2 // for now, don't run any npm scripts that have a flag because // we don't handle stuff like `--workspaces` properly && !context.args.iter().any(|s| s.starts_with('-')) @@ -267,10 +273,12 @@ impl ShellCommand for NodeCommand { ) .execute(context); } + args.extend(["run", "-A"].into_iter().map(|s| s.to_string())); args.extend(context.args.iter().cloned()); let mut state = context.state; + state.apply_env_var(USE_PKG_JSON_HIDDEN_ENV_VAR_NAME, "1"); ExecutableCommand::new("deno".to_string(), std::env::current_exe().unwrap()) .execute(ShellCommandContext { diff --git a/cli/tools/run/mod.rs b/cli/tools/run/mod.rs index 152e2650bd..bebb3f5881 100644 --- a/cli/tools/run/mod.rs +++ b/cli/tools/run/mod.rs @@ -30,6 +30,16 @@ To grant permissions, set them before the script argument. For example: } } +fn set_npm_user_agent() { + static ONCE: std::sync::Once = std::sync::Once::new(); + ONCE.call_once(|| { + std::env::set_var( + crate::npm::NPM_CONFIG_USER_AGENT_ENV_VAR, + crate::npm::get_npm_config_user_agent(), + ); + }); +} + pub async fn run_script( mode: WorkerExecutionMode, flags: Arc, @@ -58,6 +68,10 @@ pub async fn run_script( let main_module = cli_options.resolve_main_module()?; + if main_module.scheme() == "npm" { + set_npm_user_agent(); + } + maybe_npm_install(&factory).await?; let worker_factory = factory.create_cli_main_worker_factory().await?; @@ -119,6 +133,10 @@ async fn run_with_watch( let cli_options = factory.cli_options()?; let main_module = cli_options.resolve_main_module()?; + if main_module.scheme() == "npm" { + set_npm_user_agent(); + } + maybe_npm_install(&factory).await?; let _ = watcher_communicator.watch_paths(cli_options.watch_paths()); diff --git a/tests/registry/npm/@denotest/print-npm-user-agent/1.0.0/index.js b/tests/registry/npm/@denotest/print-npm-user-agent/1.0.0/index.js new file mode 100644 index 0000000000..b835b8e25e --- /dev/null +++ b/tests/registry/npm/@denotest/print-npm-user-agent/1.0.0/index.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +console.log(`npm_config_user_agent: ${process.env["npm_config_user_agent"]}`); \ No newline at end of file diff --git a/tests/registry/npm/@denotest/print-npm-user-agent/1.0.0/package.json b/tests/registry/npm/@denotest/print-npm-user-agent/1.0.0/package.json new file mode 100644 index 0000000000..9071173467 --- /dev/null +++ b/tests/registry/npm/@denotest/print-npm-user-agent/1.0.0/package.json @@ -0,0 +1,10 @@ +{ + "name": "@denotest/print-npm-user-agent", + "version": "1.0.0", + "bin": { + "print-npm-user-agent": "index.js" + }, + "scripts": { + "postinstall": "echo postinstall && node index.js && exit 1" + } +} \ No newline at end of file diff --git a/tests/specs/npm/user_agent_env_var/__test__.jsonc b/tests/specs/npm/user_agent_env_var/__test__.jsonc new file mode 100644 index 0000000000..a2af970a0e --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/__test__.jsonc @@ -0,0 +1,46 @@ +{ + "tempDir": true, + "tests": { + "set_for_npm_package": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "run -A npm:@denotest/print-npm-user-agent", + "output": "run.out" + } + ] + }, + "unset_for_local_file": { + "steps": [ + { + "args": "run -A main.ts", + "output": "Download [WILDCARD]\nnpm_config_user_agent: undefined\n" + } + ] + }, + "set_for_tasks": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "task run-via-bin", + "output": "bin_command.out" + } + ] + }, + "set_for_lifecycle_scripts": { + "steps": [ + { + "args": "install --allow-scripts", + "output": "postinstall.out", + "exitCode": 1 + } + ] + } + } +} diff --git a/tests/specs/npm/user_agent_env_var/bin_command.out b/tests/specs/npm/user_agent_env_var/bin_command.out new file mode 100644 index 0000000000..c8e9413038 --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/bin_command.out @@ -0,0 +1,2 @@ +Task run-via-bin print-npm-user-agent +npm_config_user_agent: deno/[WILDCARD] npm/? deno/[WILDCARD] [WILDCARD] [WILDCARD] diff --git a/tests/specs/npm/user_agent_env_var/deno.jsonc b/tests/specs/npm/user_agent_env_var/deno.jsonc new file mode 100644 index 0000000000..fbd70ec480 --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/deno.jsonc @@ -0,0 +1,3 @@ +{ + "nodeModulesDir": "auto" +} diff --git a/tests/specs/npm/user_agent_env_var/main.ts b/tests/specs/npm/user_agent_env_var/main.ts new file mode 100644 index 0000000000..2c51107e3c --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/main.ts @@ -0,0 +1 @@ +console.log(`npm_config_user_agent: ${Deno.env.get("npm_config_user_agent")}`); diff --git a/tests/specs/npm/user_agent_env_var/package.json b/tests/specs/npm/user_agent_env_var/package.json new file mode 100644 index 0000000000..12cc0cc6fb --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/package.json @@ -0,0 +1,8 @@ +{ + "scripts": { + "run-via-bin": "print-npm-user-agent" + }, + "dependencies": { + "@denotest/print-npm-user-agent": "1.0.0" + } +} diff --git a/tests/specs/npm/user_agent_env_var/postinstall.out b/tests/specs/npm/user_agent_env_var/postinstall.out new file mode 100644 index 0000000000..19a08598fb --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/postinstall.out @@ -0,0 +1,10 @@ +Download http://localhost:4260/@denotest%2fprint-npm-user-agent +Download http://localhost:4260/@denotest/print-npm-user-agent/1.0.0.tgz +Initialize @denotest/print-npm-user-agent@1.0.0 +Initialize @denotest/print-npm-user-agent@1.0.0: running 'postinstall' script +error: script 'postinstall' in '@denotest/print-npm-user-agent@1.0.0' failed with exit code 1 +stdout: +postinstall +npm_config_user_agent: deno/[WILDCARD] npm/? deno/[WILDCARD] [WILDCARD] [WILDCARD] + +error: failed to run scripts for packages: @denotest/print-npm-user-agent@1.0.0 diff --git a/tests/specs/npm/user_agent_env_var/run.out b/tests/specs/npm/user_agent_env_var/run.out new file mode 100644 index 0000000000..a630ac412f --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/run.out @@ -0,0 +1 @@ +npm_config_user_agent: deno/[WILDCARD] npm/? deno/[WILDCARD] [WILDCARD] [WILDCARD] diff --git a/tests/specs/npm/user_agent_env_var/test.mjs b/tests/specs/npm/user_agent_env_var/test.mjs new file mode 100644 index 0000000000..ae035d40ef --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/test.mjs @@ -0,0 +1 @@ +console.log(process.env.npm_config_user_agent); From 4774eab64d5176e997b6431f03f075782321b3d9 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Fri, 1 Nov 2024 16:13:02 +0530 Subject: [PATCH 017/227] chore: upgrade to rust 1.82 and LLVM 19 (#26615) Upgrade to rust 1.82 and LLVM 19 . Removes one webusb test because `requestAdapter` not working on new ubuntu 24 runners --- .github/workflows/ci.generate.ts | 10 +++--- .github/workflows/ci.yml | 36 +++++++++++----------- cli/tools/info.rs | 4 +-- ext/node/ops/crypto/sign.rs | 30 ++++++++---------- runtime/permissions/prompter.rs | 2 +- rust-toolchain.toml | 2 +- tests/napi/src/async.rs | 2 +- tests/specs/future/unstable_flags/main.js | 1 - tests/specs/future/unstable_flags/main.out | 1 - 9 files changed, 40 insertions(+), 48 deletions(-) diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts index d5ee67b654..49d11107d5 100755 --- a/.github/workflows/ci.generate.ts +++ b/.github/workflows/ci.generate.ts @@ -7,8 +7,8 @@ import { stringify } from "jsr:@std/yaml@^0.221/stringify"; // automatically via regex, so ensure that this line maintains this format. const cacheVersion = 23; -const ubuntuX86Runner = "ubuntu-22.04"; -const ubuntuX86XlRunner = "ubuntu-22.04-xl"; +const ubuntuX86Runner = "ubuntu-24.04"; +const ubuntuX86XlRunner = "ubuntu-24.04-xl"; const ubuntuARMRunner = "ubicloud-standard-16-arm"; const windowsX86Runner = "windows-2022"; const windowsX86XlRunner = "windows-2022-xl"; @@ -59,7 +59,7 @@ const prCacheKeyPrefix = `${cacheVersion}-cargo-target-\${{ matrix.os }}-\${{ matrix.arch }}-\${{ matrix.profile }}-\${{ matrix.job }}-`; // Note that you may need to add more version to the `apt-get remove` line below if you change this -const llvmVersion = 18; +const llvmVersion = 19; const installPkgsCommand = `sudo apt-get install --no-install-recommends clang-${llvmVersion} lld-${llvmVersion} clang-tools-${llvmVersion} clang-format-${llvmVersion} clang-tidy-${llvmVersion}`; const sysRootStep = { @@ -71,7 +71,7 @@ export DEBIAN_FRONTEND=noninteractive sudo apt-get -qq remove --purge -y man-db > /dev/null 2> /dev/null # Remove older clang before we install sudo apt-get -qq remove \ - 'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' > /dev/null 2> /dev/null + 'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'clang-17*' 'clang-18*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' 'lld-17*' 'lld-18*' > /dev/null 2> /dev/null # Install clang-XXX, lld-XXX, and debootstrap. echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${llvmVersion} main" | @@ -86,7 +86,7 @@ ${installPkgsCommand} || echo 'Failed. Trying again.' && sudo apt-get clean && s (yes '' | sudo update-alternatives --force --all) > /dev/null 2> /dev/null || true echo "Decompressing sysroot..." -wget -q https://github.com/denoland/deno_sysroot_build/releases/download/sysroot-20240528/sysroot-\`uname -m\`.tar.xz -O /tmp/sysroot.tar.xz +wget -q https://github.com/denoland/deno_sysroot_build/releases/download/sysroot-20241030/sysroot-\`uname -m\`.tar.xz -O /tmp/sysroot.tar.xz cd / xzcat /tmp/sysroot.tar.xz | sudo tar -x sudo mount --rbind /dev /sysroot/dev diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6421d9244..a9c06de17a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: profile: debug - os: macos arch: x86_64 - runner: '${{ (!contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'')) && ''ubuntu-22.04'' || ''macos-13'' }}' + runner: '${{ (!contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'')) && ''ubuntu-24.04'' || ''macos-13'' }}' job: test profile: release skip: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'') }}' @@ -73,7 +73,7 @@ jobs: profile: debug - os: macos arch: aarch64 - runner: '${{ (!contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'')) && ''ubuntu-22.04'' || ''macos-14'' }}' + runner: '${{ (!contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'')) && ''ubuntu-24.04'' || ''macos-14'' }}' job: test profile: release skip: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'') }}' @@ -84,33 +84,33 @@ jobs: profile: debug - os: windows arch: x86_64 - runner: '${{ (!contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'')) && ''ubuntu-22.04'' || github.repository == ''denoland/deno'' && ''windows-2022-xl'' || ''windows-2022'' }}' + runner: '${{ (!contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'')) && ''ubuntu-24.04'' || github.repository == ''denoland/deno'' && ''windows-2022-xl'' || ''windows-2022'' }}' job: test profile: release skip: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'') }}' - os: linux arch: x86_64 - runner: '${{ github.repository == ''denoland/deno'' && ''ubuntu-22.04-xl'' || ''ubuntu-22.04'' }}' + runner: '${{ github.repository == ''denoland/deno'' && ''ubuntu-24.04-xl'' || ''ubuntu-24.04'' }}' job: test profile: release use_sysroot: true wpt: '${{ !startsWith(github.ref, ''refs/tags/'') }}' - os: linux arch: x86_64 - runner: '${{ (!contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'' && !contains(github.event.pull_request.labels.*.name, ''ci-bench''))) && ''ubuntu-22.04'' || github.repository == ''denoland/deno'' && ''ubuntu-22.04-xl'' || ''ubuntu-22.04'' }}' + runner: '${{ (!contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'' && !contains(github.event.pull_request.labels.*.name, ''ci-bench''))) && ''ubuntu-24.04'' || github.repository == ''denoland/deno'' && ''ubuntu-24.04-xl'' || ''ubuntu-24.04'' }}' job: bench profile: release use_sysroot: true skip: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'' && !contains(github.event.pull_request.labels.*.name, ''ci-bench'')) }}' - os: linux arch: x86_64 - runner: ubuntu-22.04 + runner: ubuntu-24.04 job: test profile: debug use_sysroot: true - os: linux arch: x86_64 - runner: ubuntu-22.04 + runner: ubuntu-24.04 job: lint profile: debug - os: linux @@ -252,22 +252,22 @@ jobs: # to complete. sudo apt-get -qq remove --purge -y man-db > /dev/null 2> /dev/null # Remove older clang before we install - sudo apt-get -qq remove 'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' > /dev/null 2> /dev/null + sudo apt-get -qq remove 'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'clang-17*' 'clang-18*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' 'lld-17*' 'lld-18*' > /dev/null 2> /dev/null # Install clang-XXX, lld-XXX, and debootstrap. - echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" | - sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-jammy-18.list + echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main" | + sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-jammy-19.list curl https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo dd of=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg sudo apt-get update # this was unreliable sometimes, so try again if it fails - sudo apt-get install --no-install-recommends clang-18 lld-18 clang-tools-18 clang-format-18 clang-tidy-18 || echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install --no-install-recommends clang-18 lld-18 clang-tools-18 clang-format-18 clang-tidy-18 + sudo apt-get install --no-install-recommends clang-19 lld-19 clang-tools-19 clang-format-19 clang-tidy-19 || echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install --no-install-recommends clang-19 lld-19 clang-tools-19 clang-format-19 clang-tidy-19 # Fix alternatives (yes '' | sudo update-alternatives --force --all) > /dev/null 2> /dev/null || true echo "Decompressing sysroot..." - wget -q https://github.com/denoland/deno_sysroot_build/releases/download/sysroot-20240528/sysroot-`uname -m`.tar.xz -O /tmp/sysroot.tar.xz + wget -q https://github.com/denoland/deno_sysroot_build/releases/download/sysroot-20241030/sysroot-`uname -m`.tar.xz -O /tmp/sysroot.tar.xz cd / xzcat /tmp/sysroot.tar.xz | sudo tar -x sudo mount --rbind /dev /sysroot/dev @@ -299,8 +299,8 @@ jobs: CARGO_PROFILE_RELEASE_LTO=false RUSTFLAGS<<__1 -C linker-plugin-lto=true - -C linker=clang-18 - -C link-arg=-fuse-ld=lld-18 + -C linker=clang-19 + -C link-arg=-fuse-ld=lld-19 -C link-arg=-ldl -C link-arg=-Wl,--allow-shlib-undefined -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache @@ -310,8 +310,8 @@ jobs: __1 RUSTDOCFLAGS<<__1 -C linker-plugin-lto=true - -C linker=clang-18 - -C link-arg=-fuse-ld=lld-18 + -C linker=clang-19 + -C link-arg=-fuse-ld=lld-19 -C link-arg=-ldl -C link-arg=-Wl,--allow-shlib-undefined -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache @@ -319,7 +319,7 @@ jobs: --cfg tokio_unstable $RUSTFLAGS __1 - CC=/usr/bin/clang-18 + CC=/usr/bin/clang-19 CFLAGS=-flto=thin $CFLAGS " > $GITHUB_ENV - name: Remove macOS cURL --ipv4 flag @@ -688,7 +688,7 @@ jobs: key: '23-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}' publish-canary: name: publish canary - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 needs: - build if: github.repository == 'denoland/deno' && github.ref == 'refs/heads/main' diff --git a/cli/tools/info.rs b/cli/tools/info.rs index 3febaff579..b53485bd6b 100644 --- a/cli/tools/info.rs +++ b/cli/tools/info.rs @@ -530,7 +530,7 @@ impl<'a> GraphDisplayContext<'a> { fn build_module_info(&mut self, module: &Module, type_dep: bool) -> TreeNode { enum PackageOrSpecifier { - Package(NpmResolutionPackage), + Package(Box), Specifier(ModuleSpecifier), } @@ -538,7 +538,7 @@ impl<'a> GraphDisplayContext<'a> { let package_or_specifier = match module.npm() { Some(npm) => match self.npm_info.resolve_package(npm.nv_reference.nv()) { - Some(package) => Package(package.clone()), + Some(package) => Package(Box::new(package.clone())), None => Specifier(module.specifier().clone()), // should never happen }, None => Specifier(module.specifier().clone()), diff --git a/ext/node/ops/crypto/sign.rs b/ext/node/ops/crypto/sign.rs index b7779a5d80..31744f86ba 100644 --- a/ext/node/ops/crypto/sign.rs +++ b/ext/node/ops/crypto/sign.rs @@ -79,18 +79,15 @@ impl KeyObjectHandle { AsymmetricPrivateKey::RsaPss(key) => { let mut hash_algorithm = None; let mut salt_length = None; - match &key.details { - Some(details) => { - if details.hash_algorithm != details.mf1_hash_algorithm { - return Err(type_error( + if let Some(details) = &key.details { + if details.hash_algorithm != details.mf1_hash_algorithm { + return Err(type_error( "rsa-pss with different mf1 hash algorithm and hash algorithm is not supported", )); - } - hash_algorithm = Some(details.hash_algorithm); - salt_length = Some(details.salt_length as usize); } - None => {} - }; + hash_algorithm = Some(details.hash_algorithm); + salt_length = Some(details.salt_length as usize); + } if let Some(s) = pss_salt_length { salt_length = Some(s as usize); } @@ -215,18 +212,15 @@ impl KeyObjectHandle { AsymmetricPublicKey::RsaPss(key) => { let mut hash_algorithm = None; let mut salt_length = None; - match &key.details { - Some(details) => { - if details.hash_algorithm != details.mf1_hash_algorithm { - return Err(type_error( + if let Some(details) = &key.details { + if details.hash_algorithm != details.mf1_hash_algorithm { + return Err(type_error( "rsa-pss with different mf1 hash algorithm and hash algorithm is not supported", )); - } - hash_algorithm = Some(details.hash_algorithm); - salt_length = Some(details.salt_length as usize); } - None => {} - }; + hash_algorithm = Some(details.hash_algorithm); + salt_length = Some(details.salt_length as usize); + } if let Some(s) = pss_salt_length { salt_length = Some(s as usize); } diff --git a/runtime/permissions/prompter.rs b/runtime/permissions/prompter.rs index 316911edc1..b582b4f53e 100644 --- a/runtime/permissions/prompter.rs +++ b/runtime/permissions/prompter.rs @@ -269,7 +269,7 @@ fn get_stdin_metadata() -> std::io::Result { unsafe { let stdin = std::fs::File::from_raw_fd(0); let metadata = stdin.metadata().unwrap(); - stdin.into_raw_fd(); + let _ = stdin.into_raw_fd(); Ok(metadata) } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index f19c7df470..3d572e0d69 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.81.0" +channel = "1.82.0" components = ["rustfmt", "clippy"] diff --git a/tests/napi/src/async.rs b/tests/napi/src/async.rs index 3d3827b51c..367d2e9ef0 100644 --- a/tests/napi/src/async.rs +++ b/tests/napi/src/async.rs @@ -95,7 +95,7 @@ extern "C" fn test_async_work( )); let mut baton = unsafe { Box::from_raw(baton_ptr as *mut Baton) }; baton.task = async_work; - Box::into_raw(baton); + let _ = Box::into_raw(baton); assert_napi_ok!(napi_queue_async_work(env, async_work)); ptr::null_mut() diff --git a/tests/specs/future/unstable_flags/main.js b/tests/specs/future/unstable_flags/main.js index 51af892f6b..8cc8960d97 100644 --- a/tests/specs/future/unstable_flags/main.js +++ b/tests/specs/future/unstable_flags/main.js @@ -1,4 +1,3 @@ -console.log(typeof await navigator.gpu.requestAdapter() === "object"); // Throws without `--unstable-gpu` console.log(typeof Deno.dlopen === "function"); // Undefined without `--unstable-ffi` console.log( // Undefined without `--unstable-fs` diff --git a/tests/specs/future/unstable_flags/main.out b/tests/specs/future/unstable_flags/main.out index b979d62f4f..bb101b641b 100644 --- a/tests/specs/future/unstable_flags/main.out +++ b/tests/specs/future/unstable_flags/main.out @@ -1,3 +1,2 @@ true true -true From 826e42a5b5880c974ae019a7a21aade6a718062c Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 1 Nov 2024 12:27:00 -0400 Subject: [PATCH 018/227] fix: improved support for cjs and cts modules (#26558) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * cts support * better cjs/cts type checking * deno compile cjs/cts support * More efficient detect cjs (going towards stabilization) * Determination of whether .js, .ts, .jsx, or .tsx is cjs or esm is only done after loading * Support `import x = require(...);` Co-authored-by: Bartek Iwańczuk --- Cargo.lock | 28 +- Cargo.toml | 6 +- cli/Cargo.toml | 8 +- cli/args/mod.rs | 11 + cli/cache/cache_db.rs | 6 +- cli/cache/emit.rs | 2 + cli/cache/mod.rs | 101 ++--- cli/cache/module_info.rs | 140 +++++-- cli/cache/parsed_source.rs | 60 +-- cli/emit.rs | 77 ++-- cli/factory.rs | 274 ++++++++----- cli/graph_util.rs | 80 ++-- cli/lsp/analysis.rs | 21 +- cli/lsp/code_lens.rs | 4 +- cli/lsp/config.rs | 2 +- cli/lsp/documents.rs | 20 +- cli/lsp/language_server.rs | 2 +- cli/lsp/resolver.rs | 230 ++++++++--- cli/lsp/testing/collectors.rs | 2 +- cli/lsp/tsc.rs | 27 +- cli/main.rs | 2 +- cli/module_loader.rs | 310 ++++++++++++--- cli/node.rs | 134 +++---- cli/npm/byonm.rs | 43 +- cli/npm/managed/cache/mod.rs | 12 +- cli/npm/managed/mod.rs | 91 +++-- cli/npm/managed/resolvers/common.rs | 4 - cli/npm/managed/resolvers/global.rs | 7 +- cli/npm/managed/resolvers/local.rs | 4 - cli/npm/mod.rs | 34 +- cli/resolver.rs | 354 +++++++++++------ cli/standalone/binary.rs | 38 +- cli/standalone/mod.rs | 370 ++++++++++++------ cli/standalone/serialization.rs | 49 ++- cli/tools/bench/mod.rs | 2 +- cli/tools/check.rs | 11 +- cli/tools/compile.rs | 10 - cli/tools/coverage/mod.rs | 23 +- cli/tools/doc.rs | 6 +- cli/tools/registry/tar.rs | 2 +- cli/tools/repl/session.rs | 6 +- cli/tools/run/hmr.rs | 25 +- cli/tools/test/mod.rs | 2 +- cli/tsc/99_main_compiler.js | 2 + cli/tsc/diagnostics.rs | 2 +- cli/tsc/mod.rs | 153 ++++++-- cli/util/extract.rs | 8 +- cli/util/logger.rs | 2 + cli/util/path.rs | 27 -- cli/util/text_encoding.rs | 1 + cli/worker.rs | 171 +++----- ext/node/lib.rs | 47 +-- ext/node/ops/require.rs | 62 +-- ext/node/ops/worker_threads.rs | 40 +- ext/node/polyfills/01_require.js | 31 +- resolvers/deno/fs.rs | 10 - resolvers/deno/npm/byonm.rs | 41 +- resolvers/deno/npm/mod.rs | 1 + resolvers/deno/sloppy_imports.rs | 2 +- resolvers/node/analyze.rs | 50 ++- resolvers/node/errors.rs | 58 --- resolvers/node/lib.rs | 5 +- resolvers/node/npm.rs | 6 + resolvers/node/package_json.rs | 106 ++++- resolvers/node/resolution.rs | 196 ++-------- runtime/errors.rs | 14 +- runtime/shared.rs | 9 +- tests/integration/run_tests.rs | 3 +- .../@denotest/type-commonjs/1.0.0/index.js | 6 +- .../css_import/exists_run_with_check.out | 2 +- tests/specs/compile/cjs/__test__.jsonc | 24 ++ tests/specs/compile/cjs/add.cjs | 1 + tests/specs/compile/cjs/divide.cts | 1 + tests/specs/compile/cjs/main.js | 5 + tests/specs/compile/cjs/multiply.cts | 4 + tests/specs/compile/cjs/output.out | 2 + tests/specs/compile/cjs/reexport.cjs | 1 + tests/specs/compile/detect_cjs/__test__.jsonc | 11 +- tests/specs/compile/detect_cjs/add.js | 2 +- tests/specs/compile/detect_cjs/compile.out | 1 - tests/specs/compile/detect_cjs/output.out | 3 +- tests/specs/compile/detect_cjs/package.json | 5 +- tests/specs/compile/detect_cjs/subtract.ts | 2 + .../npm/require_type_commonjs/__test__.jsonc | 3 +- .../specs/npm/require_type_commonjs/main.out | 5 +- tests/specs/npm/require_type_commonjs/main.ts | 3 +- .../typescript_file_in_package/__test__.jsonc | 4 +- .../npm/typescript_file_in_package/main.out | 3 + .../{typescript_file_in_package => }/main.ts | 0 .../typescript_file_in_package/main.out | 6 - .../specs/run/cjs/main_module/__test__.jsonc | 4 + tests/specs/run/cjs/main_module/main.cjs | 1 + tests/specs/run/cjs/main_module/main.out | 5 + .../reexport_non_analyzable}/__test__.jsonc | 0 .../reexport_non_analyzable}/deno.json | 0 .../reexport_non_analyzable}/main.ts | 0 .../node_modules/foo.cjs | 0 tests/specs/run/cjs/unprepared/__test__.jsonc | 4 + tests/specs/run/cjs/unprepared/file.cjs | 7 + tests/specs/run/cjs/unprepared/main.out | 1 + tests/specs/run/cjs/unprepared/main.ts | 7 + tests/specs/run/cjs/unprepared/output.cjs | 3 + .../run/cts/cjs_import_cts/__test__.jsonc | 13 + .../add.js => cts/cjs_import_cts/add.cts} | 0 tests/specs/run/cts/cjs_import_cts/check.out | 17 + tests/specs/run/cts/cjs_import_cts/main.js | 3 + tests/specs/run/cts/cjs_import_cts/main.out | 1 + .../specs/run/cts/cjs_import_cts/subtract.cjs | 3 + .../cts/import_export_equals/__test__.jsonc | 17 + .../run/cts/import_export_equals/add.cts | 3 + .../run/cts/import_export_equals/main.cts | 3 + .../run/cts/import_export_equals/main.out | 2 + .../run/cts/import_export_equals/mod.mts | 3 + .../import_export_equals/mod.mts.check.out | 5 + .../run/cts/import_export_equals/mod.mts.out | 1 + tests/specs/run/cts/main/__test__.jsonc | 4 + tests/specs/run/cts/main/import_main.cjs | 1 + tests/specs/run/cts/main/main.cts | 5 + tests/specs/run/cts/main/main.out | 1 + .../commonjs/{ => basic}/__test__.jsonc | 0 .../package_json_type/commonjs/basic/add.js | 3 + .../commonjs/{ => basic}/deno.jsonc | 0 .../{ => basic}/import_import_meta.js | 0 .../commonjs/{ => basic}/import_meta.js | 0 .../commonjs/{ => basic}/main_cjs.js | 0 .../commonjs/{ => basic}/main_esm.js | 0 .../{ => basic}/main_esm_import_meta.js | 0 .../{ => basic}/main_esm_import_meta.out | 0 .../commonjs/{ => basic}/main_mix.js | 0 .../commonjs/{ => basic}/main_mix.out | 0 .../commonjs/{ => basic}/not_import_meta.js | 0 .../commonjs/{ => basic}/package.json | 0 .../commonjs/{ => basic}/tla.js | 0 .../commonjs/jsx/__test__.jsonc | 5 + .../run/package_json_type/commonjs/jsx/add.js | 3 + .../package_json_type/commonjs/jsx/deno.jsonc | 10 + .../package_json_type/commonjs/jsx/main.jsx | 7 + .../package_json_type/commonjs/jsx/main.out | 4 + .../commonjs/jsx/package.json | 7 + .../package_json_type/commonjs/jsx/tsx.tsx | 5 + tests/specs/run/remote_cjs_main/output.out | 2 +- tests/specs/run/require_esm/main.out | 2 +- .../npm/deno_run_cowsay_no_permissions.out | 2 +- 143 files changed, 2418 insertions(+), 1527 deletions(-) create mode 100644 tests/specs/compile/cjs/__test__.jsonc create mode 100644 tests/specs/compile/cjs/add.cjs create mode 100644 tests/specs/compile/cjs/divide.cts create mode 100644 tests/specs/compile/cjs/main.js create mode 100644 tests/specs/compile/cjs/multiply.cts create mode 100644 tests/specs/compile/cjs/output.out create mode 100644 tests/specs/compile/cjs/reexport.cjs create mode 100644 tests/specs/compile/detect_cjs/subtract.ts create mode 100644 tests/specs/npm/typescript_file_in_package/main.out rename tests/specs/npm/typescript_file_in_package/{typescript_file_in_package => }/main.ts (100%) delete mode 100644 tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.out create mode 100644 tests/specs/run/cjs/main_module/__test__.jsonc create mode 100644 tests/specs/run/cjs/main_module/main.cjs create mode 100644 tests/specs/run/cjs/main_module/main.out rename tests/specs/run/{cjs_reexport_non_analyzable => cjs/reexport_non_analyzable}/__test__.jsonc (100%) rename tests/specs/run/{cjs_reexport_non_analyzable => cjs/reexport_non_analyzable}/deno.json (100%) rename tests/specs/run/{cjs_reexport_non_analyzable => cjs/reexport_non_analyzable}/main.ts (100%) rename tests/specs/run/{cjs_reexport_non_analyzable => cjs/reexport_non_analyzable}/node_modules/foo.cjs (100%) create mode 100644 tests/specs/run/cjs/unprepared/__test__.jsonc create mode 100644 tests/specs/run/cjs/unprepared/file.cjs create mode 100644 tests/specs/run/cjs/unprepared/main.out create mode 100644 tests/specs/run/cjs/unprepared/main.ts create mode 100644 tests/specs/run/cjs/unprepared/output.cjs create mode 100644 tests/specs/run/cts/cjs_import_cts/__test__.jsonc rename tests/specs/run/{package_json_type/commonjs/add.js => cts/cjs_import_cts/add.cts} (100%) create mode 100644 tests/specs/run/cts/cjs_import_cts/check.out create mode 100644 tests/specs/run/cts/cjs_import_cts/main.js create mode 100644 tests/specs/run/cts/cjs_import_cts/main.out create mode 100644 tests/specs/run/cts/cjs_import_cts/subtract.cjs create mode 100644 tests/specs/run/cts/import_export_equals/__test__.jsonc create mode 100644 tests/specs/run/cts/import_export_equals/add.cts create mode 100644 tests/specs/run/cts/import_export_equals/main.cts create mode 100644 tests/specs/run/cts/import_export_equals/main.out create mode 100644 tests/specs/run/cts/import_export_equals/mod.mts create mode 100644 tests/specs/run/cts/import_export_equals/mod.mts.check.out create mode 100644 tests/specs/run/cts/import_export_equals/mod.mts.out create mode 100644 tests/specs/run/cts/main/__test__.jsonc create mode 100644 tests/specs/run/cts/main/import_main.cjs create mode 100644 tests/specs/run/cts/main/main.cts create mode 100644 tests/specs/run/cts/main/main.out rename tests/specs/run/package_json_type/commonjs/{ => basic}/__test__.jsonc (100%) create mode 100644 tests/specs/run/package_json_type/commonjs/basic/add.js rename tests/specs/run/package_json_type/commonjs/{ => basic}/deno.jsonc (100%) rename tests/specs/run/package_json_type/commonjs/{ => basic}/import_import_meta.js (100%) rename tests/specs/run/package_json_type/commonjs/{ => basic}/import_meta.js (100%) rename tests/specs/run/package_json_type/commonjs/{ => basic}/main_cjs.js (100%) rename tests/specs/run/package_json_type/commonjs/{ => basic}/main_esm.js (100%) rename tests/specs/run/package_json_type/commonjs/{ => basic}/main_esm_import_meta.js (100%) rename tests/specs/run/package_json_type/commonjs/{ => basic}/main_esm_import_meta.out (100%) rename tests/specs/run/package_json_type/commonjs/{ => basic}/main_mix.js (100%) rename tests/specs/run/package_json_type/commonjs/{ => basic}/main_mix.out (100%) rename tests/specs/run/package_json_type/commonjs/{ => basic}/not_import_meta.js (100%) rename tests/specs/run/package_json_type/commonjs/{ => basic}/package.json (100%) rename tests/specs/run/package_json_type/commonjs/{ => basic}/tla.js (100%) create mode 100644 tests/specs/run/package_json_type/commonjs/jsx/__test__.jsonc create mode 100644 tests/specs/run/package_json_type/commonjs/jsx/add.js create mode 100644 tests/specs/run/package_json_type/commonjs/jsx/deno.jsonc create mode 100644 tests/specs/run/package_json_type/commonjs/jsx/main.jsx create mode 100644 tests/specs/run/package_json_type/commonjs/jsx/main.out create mode 100644 tests/specs/run/package_json_type/commonjs/jsx/package.json create mode 100644 tests/specs/run/package_json_type/commonjs/jsx/tsx.tsx diff --git a/Cargo.lock b/Cargo.lock index e0780b2268..8c7b35ca9f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1279,9 +1279,9 @@ dependencies = [ [[package]] name = "deno_ast" -version = "0.42.2" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b9d03b1bbeeecdac54367f075d572131736d06c5be3bc49037855bc5ab1bbb" +checksum = "48d00b724e06d2081a141ec1155756a0b465d413d8e2a7515221f61d482eb2ee" dependencies = [ "base64 0.21.7", "deno_media_type", @@ -1356,9 +1356,9 @@ dependencies = [ [[package]] name = "deno_cache_dir" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693ca429aebf945de5fef30df232044f9f80be4cc5a5e7c8d767226c43880f5a" +checksum = "08c1f52170cd7715f8006da54cde1444863a0d6fbd9c11d037a737db2dec8e22" dependencies = [ "base32", "deno_media_type", @@ -1506,9 +1506,9 @@ dependencies = [ [[package]] name = "deno_doc" -version = "0.154.0" +version = "0.156.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17e204e45b0d79750880114e37b34abe19ad0710d8435a8da8f23a528fe98de4" +checksum = "2585b98d6ad76dae30bf2d7b6d71b8363cae041158b8780d14a2f4fe17590a61" dependencies = [ "anyhow", "cfg-if", @@ -1606,9 +1606,9 @@ dependencies = [ [[package]] name = "deno_graph" -version = "0.83.4" +version = "0.84.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd20bc0780071989c622cbfd5d4fb2e4fd05a247ccd7f791f13c8d2c3792228" +checksum = "cd4f4a14aa069087be41c2998077b0453f0191747898f96e6343f700abfc2c18" dependencies = [ "anyhow", "async-trait", @@ -1726,9 +1726,9 @@ dependencies = [ [[package]] name = "deno_lint" -version = "0.67.0" +version = "0.68.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871b60e32bfb6c110cbb9b0688dbf048f81e5d347fe4ce5a42239263de9dd938" +checksum = "bb994e6d1b18223df0a756c7948143b35682941d615edffef60d5b38822f38ac" dependencies = [ "anyhow", "deno_ast", @@ -1756,9 +1756,9 @@ dependencies = [ [[package]] name = "deno_media_type" -version = "0.1.4" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8978229b82552bf8457a0125aa20863f023619cfc21ebb007b1e571d68fd85b" +checksum = "7fcf552fbdedbe81c89705349d7d2485c7051382b000dfddbdbf7fc25931cf83" dependencies = [ "data-url", "serde", @@ -2608,9 +2608,9 @@ dependencies = [ [[package]] name = "dprint-plugin-typescript" -version = "0.93.0" +version = "0.93.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9308d98b923b7c0335c2ee1560199e3f2321b1be82803107b4ba4ed5dac46cc" +checksum = "5abfd78fe3cde4f5a6699d65f760c8d44da130cf446b6f80a7a9bc6580e156ab" dependencies = [ "anyhow", "deno_ast", diff --git a/Cargo.toml b/Cargo.toml index 285c077809..f57563e0b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,12 +45,12 @@ license = "MIT" repository = "https://github.com/denoland/deno" [workspace.dependencies] -deno_ast = { version = "=0.42.2", features = ["transpiling"] } +deno_ast = { version = "=0.43.3", features = ["transpiling"] } deno_core = { version = "0.316.0" } deno_bench_util = { version = "0.169.0", path = "./bench_util" } deno_lockfile = "=0.23.1" -deno_media_type = { version = "0.1.4", features = ["module_specifier"] } +deno_media_type = { version = "0.2.0", features = ["module_specifier"] } deno_npm = "=0.25.4" deno_path_util = "=0.2.1" deno_permissions = { version = "0.35.0", path = "./runtime/permissions" } @@ -111,7 +111,7 @@ console_static_text = "=0.8.1" dashmap = "5.5.3" data-encoding = "2.3.3" data-url = "=0.3.0" -deno_cache_dir = "=0.13.1" +deno_cache_dir = "=0.13.2" deno_package_json = { version = "0.1.2", default-features = false } dlopen2 = "0.6.1" ecb = "=0.1.2" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 782adfd903..a3e2b71f00 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -72,9 +72,9 @@ deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposa deno_cache_dir = { workspace = true } deno_config = { version = "=0.37.2", features = ["workspace", "sync"] } deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] } -deno_doc = { version = "0.154.0", default-features = false, features = ["rust", "html", "syntect"] } -deno_graph = { version = "=0.83.4" } -deno_lint = { version = "=0.67.0", features = ["docs"] } +deno_doc = { version = "0.156.0", default-features = false, features = ["rust", "html", "syntect"] } +deno_graph = { version = "=0.84.1" } +deno_lint = { version = "=0.68.0", features = ["docs"] } deno_lockfile.workspace = true deno_npm.workspace = true deno_package_json.workspace = true @@ -107,7 +107,7 @@ dotenvy = "0.15.7" dprint-plugin-json = "=0.19.4" dprint-plugin-jupyter = "=0.1.5" dprint-plugin-markdown = "=0.17.8" -dprint-plugin-typescript = "=0.93.0" +dprint-plugin-typescript = "=0.93.1" env_logger = "=0.10.0" fancy-regex = "=0.10.0" faster-hex.workspace = true diff --git a/cli/args/mod.rs b/cli/args/mod.rs index d725264623..e19025f8b1 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -201,6 +201,8 @@ pub fn ts_config_to_transpile_and_emit_options( precompile_jsx_dynamic_props: None, transform_jsx, var_decl_imports: false, + // todo(dsherret): support verbatim_module_syntax here properly + verbatim_module_syntax: false, }, deno_ast::EmitOptions { inline_sources: options.inline_sources, @@ -1602,6 +1604,15 @@ impl CliOptions { } pub fn use_byonm(&self) -> bool { + if matches!( + self.sub_command(), + DenoSubcommand::Install(_) + | DenoSubcommand::Add(_) + | DenoSubcommand::Remove(_) + ) { + // For `deno install/add/remove` we want to force the managed resolver so it can set up `node_modules/` directory. + return false; + } if self.node_modules_dir().ok().flatten().is_none() && self.maybe_node_modules_folder.is_some() && self diff --git a/cli/cache/cache_db.rs b/cli/cache/cache_db.rs index b24078f29b..329ed2d970 100644 --- a/cli/cache/cache_db.rs +++ b/cli/cache/cache_db.rs @@ -57,7 +57,7 @@ impl rusqlite::types::FromSql for CacheDBHash { } /// What should the cache should do on failure? -#[derive(Default)] +#[derive(Debug, Default)] pub enum CacheFailure { /// Return errors if failure mode otherwise unspecified. #[default] @@ -69,6 +69,7 @@ pub enum CacheFailure { } /// Configuration SQL and other parameters for a [`CacheDB`]. +#[derive(Debug)] pub struct CacheDBConfiguration { /// SQL to run for a new database. pub table_initializer: &'static str, @@ -98,6 +99,7 @@ impl CacheDBConfiguration { } } +#[derive(Debug)] enum ConnectionState { Connected(Connection), Blackhole, @@ -106,7 +108,7 @@ enum ConnectionState { /// A cache database that eagerly initializes itself off-thread, preventing initialization operations /// from blocking the main thread. -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct CacheDB { // TODO(mmastrac): We can probably simplify our thread-safe implementation here conn: Arc>>, diff --git a/cli/cache/emit.rs b/cli/cache/emit.rs index 74e1c1101b..3c9eecfcbd 100644 --- a/cli/cache/emit.rs +++ b/cli/cache/emit.rs @@ -10,6 +10,7 @@ use deno_core::unsync::sync::AtomicFlag; use super::DiskCache; /// The cache that stores previously emitted files. +#[derive(Debug)] pub struct EmitCache { disk_cache: DiskCache, emit_failed_flag: AtomicFlag, @@ -91,6 +92,7 @@ impl EmitCache { const LAST_LINE_PREFIX: &str = "\n// denoCacheMetadata="; +#[derive(Debug)] struct EmitFileSerializer { cli_version: &'static str, } diff --git a/cli/cache/mod.rs b/cli/cache/mod.rs index bf8f1b1f0b..50fc135ddf 100644 --- a/cli/cache/mod.rs +++ b/cli/cache/mod.rs @@ -8,14 +8,9 @@ use crate::file_fetcher::FetchOptions; use crate::file_fetcher::FetchPermissionsOptionRef; use crate::file_fetcher::FileFetcher; use crate::file_fetcher::FileOrRedirect; -use crate::npm::CliNpmResolver; -use crate::resolver::CliNodeResolver; use crate::util::fs::atomic_write_file_with_retries; use crate::util::fs::atomic_write_file_with_retries_and_fs; use crate::util::fs::AtomicWriteFileFsAdapter; -use crate::util::path::specifier_has_extension; -use crate::util::text_encoding::arc_str_to_bytes; -use crate::util::text_encoding::from_utf8_lossy_owned; use deno_ast::MediaType; use deno_core::futures; @@ -25,7 +20,9 @@ use deno_graph::source::CacheInfo; use deno_graph::source::LoadFuture; use deno_graph::source::LoadResponse; use deno_graph::source::Loader; +use deno_runtime::deno_fs; use deno_runtime::deno_permissions::PermissionsContainer; +use node_resolver::InNpmPackageChecker; use std::collections::HashMap; use std::path::Path; use std::path::PathBuf; @@ -60,7 +57,6 @@ pub use fast_check::FastCheckCache; pub use incremental::IncrementalCache; pub use module_info::ModuleInfoCache; pub use node::NodeAnalysisCache; -pub use parsed_source::EsmOrCjsChecker; pub use parsed_source::LazyGraphSourceParser; pub use parsed_source::ParsedSourceCache; @@ -181,46 +177,40 @@ pub struct FetchCacherOptions { pub permissions: PermissionsContainer, /// If we're publishing for `deno publish`. pub is_deno_publish: bool, - pub unstable_detect_cjs: bool, } /// A "wrapper" for the FileFetcher and DiskCache for the Deno CLI that provides /// a concise interface to the DENO_DIR when building module graphs. pub struct FetchCacher { pub file_header_overrides: HashMap>, - esm_or_cjs_checker: Arc, file_fetcher: Arc, + fs: Arc, global_http_cache: Arc, - node_resolver: Arc, - npm_resolver: Arc, + in_npm_pkg_checker: Arc, module_info_cache: Arc, permissions: PermissionsContainer, is_deno_publish: bool, - unstable_detect_cjs: bool, cache_info_enabled: bool, } impl FetchCacher { pub fn new( - esm_or_cjs_checker: Arc, file_fetcher: Arc, + fs: Arc, global_http_cache: Arc, - node_resolver: Arc, - npm_resolver: Arc, + in_npm_pkg_checker: Arc, module_info_cache: Arc, options: FetchCacherOptions, ) -> Self { Self { file_fetcher, - esm_or_cjs_checker, + fs, global_http_cache, - node_resolver, - npm_resolver, + in_npm_pkg_checker, module_info_cache, file_header_overrides: options.file_header_overrides, permissions: options.permissions, is_deno_publish: options.is_deno_publish, - unstable_detect_cjs: options.unstable_detect_cjs, cache_info_enabled: false, } } @@ -271,70 +261,23 @@ impl Loader for FetchCacher { ) -> LoadFuture { use deno_graph::source::CacheSetting as LoaderCacheSetting; - if specifier.scheme() == "file" { - if specifier.path().contains("/node_modules/") { - // The specifier might be in a completely different symlinked tree than - // what the node_modules url is in (ex. `/my-project-1/node_modules` - // symlinked to `/my-project-2/node_modules`), so first we checked if the path - // is in a node_modules dir to avoid needlessly canonicalizing, then now compare - // against the canonicalized specifier. - let specifier = - crate::node::resolve_specifier_into_node_modules(specifier); - if self.npm_resolver.in_npm_package(&specifier) { - return Box::pin(futures::future::ready(Ok(Some( - LoadResponse::External { specifier }, - )))); - } - } - - // make local CJS modules external to the graph - if specifier_has_extension(specifier, "cjs") { + if specifier.scheme() == "file" + && specifier.path().contains("/node_modules/") + { + // The specifier might be in a completely different symlinked tree than + // what the node_modules url is in (ex. `/my-project-1/node_modules` + // symlinked to `/my-project-2/node_modules`), so first we checked if the path + // is in a node_modules dir to avoid needlessly canonicalizing, then now compare + // against the canonicalized specifier. + let specifier = crate::node::resolve_specifier_into_node_modules( + specifier, + self.fs.as_ref(), + ); + if self.in_npm_pkg_checker.in_npm_package(&specifier) { return Box::pin(futures::future::ready(Ok(Some( - LoadResponse::External { - specifier: specifier.clone(), - }, + LoadResponse::External { specifier }, )))); } - - if self.unstable_detect_cjs && specifier_has_extension(specifier, "js") { - if let Ok(Some(pkg_json)) = - self.node_resolver.get_closest_package_json(specifier) - { - if pkg_json.typ == "commonjs" { - if let Ok(path) = specifier.to_file_path() { - if let Ok(bytes) = std::fs::read(&path) { - let text: Arc = from_utf8_lossy_owned(bytes).into(); - let is_es_module = match self.esm_or_cjs_checker.is_esm( - specifier, - text.clone(), - MediaType::JavaScript, - ) { - Ok(value) => value, - Err(err) => { - return Box::pin(futures::future::ready(Err(err.into()))); - } - }; - if !is_es_module { - self.node_resolver.mark_cjs_resolution(specifier.clone()); - return Box::pin(futures::future::ready(Ok(Some( - LoadResponse::External { - specifier: specifier.clone(), - }, - )))); - } else { - return Box::pin(futures::future::ready(Ok(Some( - LoadResponse::Module { - specifier: specifier.clone(), - content: arc_str_to_bytes(text), - maybe_headers: None, - }, - )))); - } - } - } - } - } - } } if self.is_deno_publish diff --git a/cli/cache/module_info.rs b/cli/cache/module_info.rs index 4dbb01c37b..060a6f4f0c 100644 --- a/cli/cache/module_info.rs +++ b/cli/cache/module_info.rs @@ -44,18 +44,32 @@ pub static MODULE_INFO_CACHE_DB: CacheDBConfiguration = CacheDBConfiguration { /// A cache of `deno_graph::ModuleInfo` objects. Using this leads to a considerable /// performance improvement because when it exists we can skip parsing a module for /// deno_graph. +#[derive(Debug)] pub struct ModuleInfoCache { conn: CacheDB, + parsed_source_cache: Arc, } impl ModuleInfoCache { #[cfg(test)] - pub fn new_in_memory(version: &'static str) -> Self { - Self::new(CacheDB::in_memory(&MODULE_INFO_CACHE_DB, version)) + pub fn new_in_memory( + version: &'static str, + parsed_source_cache: Arc, + ) -> Self { + Self::new( + CacheDB::in_memory(&MODULE_INFO_CACHE_DB, version), + parsed_source_cache, + ) } - pub fn new(conn: CacheDB) -> Self { - Self { conn } + pub fn new( + conn: CacheDB, + parsed_source_cache: Arc, + ) -> Self { + Self { + conn, + parsed_source_cache, + } } /// Useful for testing: re-create this cache DB with a different current version. @@ -63,6 +77,7 @@ impl ModuleInfoCache { pub(crate) fn recreate_with_version(self, version: &'static str) -> Self { Self { conn: self.conn.recreate_with_version(version), + parsed_source_cache: self.parsed_source_cache, } } @@ -113,13 +128,10 @@ impl ModuleInfoCache { Ok(()) } - pub fn as_module_analyzer<'a>( - &'a self, - parsed_source_cache: &'a Arc, - ) -> ModuleInfoCacheModuleAnalyzer<'a> { + pub fn as_module_analyzer(&self) -> ModuleInfoCacheModuleAnalyzer { ModuleInfoCacheModuleAnalyzer { module_info_cache: self, - parsed_source_cache, + parsed_source_cache: &self.parsed_source_cache, } } } @@ -129,6 +141,84 @@ pub struct ModuleInfoCacheModuleAnalyzer<'a> { parsed_source_cache: &'a Arc, } +impl<'a> ModuleInfoCacheModuleAnalyzer<'a> { + fn load_cached_module_info( + &self, + specifier: &ModuleSpecifier, + media_type: MediaType, + source_hash: CacheDBHash, + ) -> Option { + match self.module_info_cache.get_module_info( + specifier, + media_type, + source_hash, + ) { + Ok(Some(info)) => Some(info), + Ok(None) => None, + Err(err) => { + log::debug!( + "Error loading module cache info for {}. {:#}", + specifier, + err + ); + None + } + } + } + + fn save_module_info_to_cache( + &self, + specifier: &ModuleSpecifier, + media_type: MediaType, + source_hash: CacheDBHash, + module_info: &ModuleInfo, + ) { + if let Err(err) = self.module_info_cache.set_module_info( + specifier, + media_type, + source_hash, + module_info, + ) { + log::debug!( + "Error saving module cache info for {}. {:#}", + specifier, + err + ); + } + } + + pub fn analyze_sync( + &self, + specifier: &ModuleSpecifier, + media_type: MediaType, + source: &Arc, + ) -> Result { + // attempt to load from the cache + let source_hash = CacheDBHash::from_source(source); + if let Some(info) = + self.load_cached_module_info(specifier, media_type, source_hash) + { + return Ok(info); + } + + // otherwise, get the module info from the parsed source cache + let parser = self.parsed_source_cache.as_capturing_parser(); + let analyzer = ParserModuleAnalyzer::new(&parser); + let module_info = + analyzer.analyze_sync(specifier, source.clone(), media_type)?; + + // then attempt to cache it + self.save_module_info_to_cache( + specifier, + media_type, + source_hash, + &module_info, + ); + + Ok(module_info) + } +} + #[async_trait::async_trait(?Send)] impl<'a> deno_graph::ModuleAnalyzer for ModuleInfoCacheModuleAnalyzer<'a> { async fn analyze( @@ -139,20 +229,10 @@ impl<'a> deno_graph::ModuleAnalyzer for ModuleInfoCacheModuleAnalyzer<'a> { ) -> Result { // attempt to load from the cache let source_hash = CacheDBHash::from_source(&source); - match self.module_info_cache.get_module_info( - specifier, - media_type, - source_hash, - ) { - Ok(Some(info)) => return Ok(info), - Ok(None) => {} - Err(err) => { - log::debug!( - "Error loading module cache info for {}. {:#}", - specifier, - err - ); - } + if let Some(info) = + self.load_cached_module_info(specifier, media_type, source_hash) + { + return Ok(info); } // otherwise, get the module info from the parsed source cache @@ -169,18 +249,12 @@ impl<'a> deno_graph::ModuleAnalyzer for ModuleInfoCacheModuleAnalyzer<'a> { .unwrap()?; // then attempt to cache it - if let Err(err) = self.module_info_cache.set_module_info( + self.save_module_info_to_cache( specifier, media_type, source_hash, &module_info, - ) { - log::debug!( - "Error saving module cache info for {}. {:#}", - specifier, - err - ); - } + ); Ok(module_info) } @@ -202,7 +276,7 @@ fn serialize_media_type(media_type: MediaType) -> i64 { Tsx => 11, Json => 12, Wasm => 13, - TsBuildInfo => 14, + Css => 14, SourceMap => 15, Unknown => 16, } @@ -217,7 +291,7 @@ mod test { #[test] pub fn module_info_cache_general_use() { - let cache = ModuleInfoCache::new_in_memory("1.0.0"); + let cache = ModuleInfoCache::new_in_memory("1.0.0", Default::default()); let specifier1 = ModuleSpecifier::parse("https://localhost/mod.ts").unwrap(); let specifier2 = diff --git a/cli/cache/parsed_source.rs b/cli/cache/parsed_source.rs index df6e45c35e..7e819ae998 100644 --- a/cli/cache/parsed_source.rs +++ b/cli/cache/parsed_source.rs @@ -5,12 +5,11 @@ use std::sync::Arc; use deno_ast::MediaType; use deno_ast::ModuleSpecifier; -use deno_ast::ParseDiagnostic; use deno_ast::ParsedSource; use deno_core::parking_lot::Mutex; -use deno_graph::CapturingModuleParser; -use deno_graph::DefaultModuleParser; -use deno_graph::ModuleParser; +use deno_graph::CapturingEsParser; +use deno_graph::DefaultEsParser; +use deno_graph::EsParser; use deno_graph::ParseOptions; use deno_graph::ParsedSourceStore; @@ -47,7 +46,7 @@ impl<'a> LazyGraphSourceParser<'a> { } } -#[derive(Default)] +#[derive(Debug, Default)] pub struct ParsedSourceCache { sources: Mutex>, } @@ -58,12 +57,11 @@ impl ParsedSourceCache { module: &deno_graph::JsModule, ) -> Result { let parser = self.as_capturing_parser(); - // this will conditionally parse because it's using a CapturingModuleParser - parser.parse_module(ParseOptions { + // this will conditionally parse because it's using a CapturingEsParser + parser.parse_program(ParseOptions { specifier: &module.specifier, source: module.source.clone(), media_type: module.media_type, - // don't bother enabling because this method is currently only used for vendoring scope_analysis: false, }) } @@ -87,10 +85,9 @@ impl ParsedSourceCache { specifier, source, media_type, - // don't bother enabling because this method is currently only used for emitting scope_analysis: false, }; - DefaultModuleParser.parse_module(options) + DefaultEsParser.parse_program(options) } /// Frees the parsed source from memory. @@ -100,8 +97,8 @@ impl ParsedSourceCache { /// Creates a parser that will reuse a ParsedSource from the store /// if it exists, or else parse. - pub fn as_capturing_parser(&self) -> CapturingModuleParser { - CapturingModuleParser::new(None, self) + pub fn as_capturing_parser(&self) -> CapturingEsParser { + CapturingEsParser::new(None, self) } } @@ -150,42 +147,3 @@ impl deno_graph::ParsedSourceStore for ParsedSourceCache { } } } - -pub struct EsmOrCjsChecker { - parsed_source_cache: Arc, -} - -impl EsmOrCjsChecker { - pub fn new(parsed_source_cache: Arc) -> Self { - Self { - parsed_source_cache, - } - } - - pub fn is_esm( - &self, - specifier: &ModuleSpecifier, - source: Arc, - media_type: MediaType, - ) -> Result { - // todo(dsherret): add a file cache here to avoid parsing with swc on each run - let source = match self.parsed_source_cache.get_parsed_source(specifier) { - Some(source) => source.clone(), - None => { - let source = deno_ast::parse_program(deno_ast::ParseParams { - specifier: specifier.clone(), - text: source, - media_type, - capture_tokens: true, // capture because it's used for cjs export analysis - scope_analysis: false, - maybe_syntax: None, - })?; - self - .parsed_source_cache - .set_parsed_source(specifier.clone(), source.clone()); - source - } - }; - Ok(source.is_module()) - } -} diff --git a/cli/emit.rs b/cli/emit.rs index 8e93092e67..8c4f2091cf 100644 --- a/cli/emit.rs +++ b/cli/emit.rs @@ -3,11 +3,14 @@ use crate::cache::EmitCache; use crate::cache::FastInsecureHasher; use crate::cache::ParsedSourceCache; +use crate::resolver::CjsTracker; +use deno_ast::ModuleKind; use deno_ast::SourceMapOption; use deno_ast::SourceRange; use deno_ast::SourceRanged; use deno_ast::SourceRangedForSpanned; +use deno_ast::TranspileModuleOptions; use deno_ast::TranspileResult; use deno_core::error::AnyError; use deno_core::futures::stream::FuturesUnordered; @@ -19,7 +22,9 @@ use deno_graph::Module; use deno_graph::ModuleGraph; use std::sync::Arc; +#[derive(Debug)] pub struct Emitter { + cjs_tracker: Arc, emit_cache: Arc, parsed_source_cache: Arc, transpile_and_emit_options: @@ -30,6 +35,7 @@ pub struct Emitter { impl Emitter { pub fn new( + cjs_tracker: Arc, emit_cache: Arc, parsed_source_cache: Arc, transpile_options: deno_ast::TranspileOptions, @@ -42,6 +48,7 @@ impl Emitter { hasher.finish() }; Self { + cjs_tracker, emit_cache, parsed_source_cache, transpile_and_emit_options: Arc::new((transpile_options, emit_options)), @@ -59,21 +66,19 @@ impl Emitter { continue; }; - // todo(https://github.com/denoland/deno_media_type/pull/12): use is_emittable() - let is_emittable = matches!( - module.media_type, - MediaType::TypeScript - | MediaType::Mts - | MediaType::Cts - | MediaType::Jsx - | MediaType::Tsx - ); - if is_emittable { + if module.media_type.is_emittable() { futures.push( self .emit_parsed_source( &module.specifier, module.media_type, + ModuleKind::from_is_cjs( + self.cjs_tracker.is_cjs_with_known_is_script( + &module.specifier, + module.media_type, + module.is_script, + )?, + ), &module.source, ) .boxed_local(), @@ -92,9 +97,10 @@ impl Emitter { pub fn maybe_cached_emit( &self, specifier: &ModuleSpecifier, + module_kind: deno_ast::ModuleKind, source: &str, ) -> Option { - let source_hash = self.get_source_hash(source); + let source_hash = self.get_source_hash(module_kind, source); self.emit_cache.get_emit_code(specifier, source_hash) } @@ -102,11 +108,12 @@ impl Emitter { &self, specifier: &ModuleSpecifier, media_type: MediaType, + module_kind: deno_ast::ModuleKind, source: &Arc, ) -> Result { // Note: keep this in sync with the sync version below let helper = EmitParsedSourceHelper(self); - match helper.pre_emit_parsed_source(specifier, source) { + match helper.pre_emit_parsed_source(specifier, module_kind, source) { PreEmitResult::Cached(emitted_text) => Ok(emitted_text), PreEmitResult::NotCached { source_hash } => { let parsed_source_cache = self.parsed_source_cache.clone(); @@ -119,8 +126,9 @@ impl Emitter { EmitParsedSourceHelper::transpile( &parsed_source_cache, &specifier, - source.clone(), media_type, + module_kind, + source.clone(), &transpile_and_emit_options.0, &transpile_and_emit_options.1, ) @@ -142,18 +150,20 @@ impl Emitter { &self, specifier: &ModuleSpecifier, media_type: MediaType, + module_kind: deno_ast::ModuleKind, source: &Arc, ) -> Result { // Note: keep this in sync with the async version above let helper = EmitParsedSourceHelper(self); - match helper.pre_emit_parsed_source(specifier, source) { + match helper.pre_emit_parsed_source(specifier, module_kind, source) { PreEmitResult::Cached(emitted_text) => Ok(emitted_text), PreEmitResult::NotCached { source_hash } => { let transpiled_source = EmitParsedSourceHelper::transpile( &self.parsed_source_cache, specifier, - source.clone(), media_type, + module_kind, + source.clone(), &self.transpile_and_emit_options.0, &self.transpile_and_emit_options.1, )?; @@ -171,6 +181,7 @@ impl Emitter { pub async fn load_and_emit_for_hmr( &self, specifier: &ModuleSpecifier, + module_kind: deno_ast::ModuleKind, ) -> Result { let media_type = MediaType::from_specifier(specifier); let source_code = tokio::fs::read_to_string( @@ -193,9 +204,14 @@ impl Emitter { let mut options = self.transpile_and_emit_options.1.clone(); options.source_map = SourceMapOption::None; let transpiled_source = parsed_source - .transpile(&self.transpile_and_emit_options.0, &options)? - .into_source() - .into_string()?; + .transpile( + &self.transpile_and_emit_options.0, + &deno_ast::TranspileModuleOptions { + module_kind: Some(module_kind), + }, + &options, + )? + .into_source(); Ok(transpiled_source.text) } MediaType::JavaScript @@ -206,7 +222,7 @@ impl Emitter { | MediaType::Dcts | MediaType::Json | MediaType::Wasm - | MediaType::TsBuildInfo + | MediaType::Css | MediaType::SourceMap | MediaType::Unknown => { // clear this specifier from the parsed source cache as it's now out of date @@ -219,10 +235,11 @@ impl Emitter { /// A hashing function that takes the source code and uses the global emit /// options then generates a string hash which can be stored to /// determine if the cached emit is valid or not. - fn get_source_hash(&self, source_text: &str) -> u64 { + fn get_source_hash(&self, module_kind: ModuleKind, source_text: &str) -> u64 { FastInsecureHasher::new_without_deno_version() // stored in the transpile_and_emit_options_hash .write_str(source_text) .write_u64(self.transpile_and_emit_options_hash) + .write_hashable(module_kind) .finish() } } @@ -239,9 +256,10 @@ impl<'a> EmitParsedSourceHelper<'a> { pub fn pre_emit_parsed_source( &self, specifier: &ModuleSpecifier, + module_kind: deno_ast::ModuleKind, source: &Arc, ) -> PreEmitResult { - let source_hash = self.0.get_source_hash(source); + let source_hash = self.0.get_source_hash(module_kind, source); if let Some(emit_code) = self.0.emit_cache.get_emit_code(specifier, source_hash) @@ -255,8 +273,9 @@ impl<'a> EmitParsedSourceHelper<'a> { pub fn transpile( parsed_source_cache: &ParsedSourceCache, specifier: &ModuleSpecifier, - source: Arc, media_type: MediaType, + module_kind: deno_ast::ModuleKind, + source: Arc, transpile_options: &deno_ast::TranspileOptions, emit_options: &deno_ast::EmitOptions, ) -> Result { @@ -265,8 +284,13 @@ impl<'a> EmitParsedSourceHelper<'a> { let parsed_source = parsed_source_cache .remove_or_parse_module(specifier, source, media_type)?; ensure_no_import_assertion(&parsed_source)?; - let transpile_result = - parsed_source.transpile(transpile_options, emit_options)?; + let transpile_result = parsed_source.transpile( + transpile_options, + &TranspileModuleOptions { + module_kind: Some(module_kind), + }, + emit_options, + )?; let transpiled_source = match transpile_result { TranspileResult::Owned(source) => source, TranspileResult::Cloned(source) => { @@ -275,8 +299,7 @@ impl<'a> EmitParsedSourceHelper<'a> { } }; debug_assert!(transpiled_source.source_map.is_none()); - let text = String::from_utf8(transpiled_source.source)?; - Ok(text) + Ok(transpiled_source.text) } pub fn post_emit_parsed_source( @@ -321,7 +344,7 @@ fn ensure_no_import_assertion( deno_core::anyhow::anyhow!("{}", msg) } - let Some(module) = parsed_source.program_ref().as_module() else { + let deno_ast::ProgramRef::Module(module) = parsed_source.program_ref() else { return Ok(()); }; diff --git a/cli/factory.rs b/cli/factory.rs index d5ef4fd8b3..4a36c75ba2 100644 --- a/cli/factory.rs +++ b/cli/factory.rs @@ -11,10 +11,10 @@ use crate::args::StorageKeyResolver; use crate::args::TsConfigType; use crate::cache::Caches; use crate::cache::CodeCache; +use crate::cache::DenoCacheEnvFsAdapter; use crate::cache::DenoDir; use crate::cache::DenoDirProvider; use crate::cache::EmitCache; -use crate::cache::EsmOrCjsChecker; use crate::cache::GlobalHttpCache; use crate::cache::HttpCache; use crate::cache::LocalHttpCache; @@ -33,12 +33,16 @@ use crate::module_loader::ModuleLoadPreparer; use crate::node::CliCjsCodeAnalyzer; use crate::node::CliNodeCodeTranslator; use crate::npm::create_cli_npm_resolver; +use crate::npm::create_in_npm_pkg_checker; use crate::npm::CliByonmNpmResolverCreateOptions; +use crate::npm::CliManagedInNpmPkgCheckerCreateOptions; +use crate::npm::CliManagedNpmResolverCreateOptions; use crate::npm::CliNpmResolver; use crate::npm::CliNpmResolverCreateOptions; -use crate::npm::CliNpmResolverManagedCreateOptions; use crate::npm::CliNpmResolverManagedSnapshotOption; -use crate::resolver::CjsResolutionStore; +use crate::npm::CreateInNpmPkgCheckerOptions; +use crate::resolver::CjsTracker; +use crate::resolver::CjsTrackerOptions; use crate::resolver::CliDenoResolverFs; use crate::resolver::CliGraphResolver; use crate::resolver::CliGraphResolverOptions; @@ -51,6 +55,7 @@ use crate::tools::check::TypeChecker; use crate::tools::coverage::CoverageCollector; use crate::tools::lint::LintRuleProvider; use crate::tools::run::hmr::HmrRunner; +use crate::tsc::TypeCheckingCjsTracker; use crate::util::file_watcher::WatcherCommunicator; use crate::util::fs::canonicalize_path_maybe_not_exists; use crate::util::progress_bar::ProgressBar; @@ -59,6 +64,7 @@ use crate::worker::CliMainWorkerFactory; use crate::worker::CliMainWorkerOptions; use std::path::PathBuf; +use deno_cache_dir::npm::NpmCacheDir; use deno_config::workspace::PackageJsonDepResolution; use deno_config::workspace::WorkspaceResolver; use deno_core::error::AnyError; @@ -68,6 +74,7 @@ use deno_core::FeatureChecker; use deno_runtime::deno_fs; use deno_runtime::deno_node::DenoFsNodeResolverEnv; use deno_runtime::deno_node::NodeResolver; +use deno_runtime::deno_node::PackageJsonResolver; use deno_runtime::deno_permissions::Permissions; use deno_runtime::deno_permissions::PermissionsContainer; use deno_runtime::deno_tls::rustls::RootCertStore; @@ -77,6 +84,7 @@ use deno_runtime::inspector_server::InspectorServer; use deno_runtime::permissions::RuntimePermissionDescriptorParser; use log::warn; use node_resolver::analyze::NodeCodeTranslator; +use node_resolver::InNpmPackageChecker; use once_cell::sync::OnceCell; use std::future::Future; use std::sync::Arc; @@ -164,39 +172,41 @@ impl Deferred { #[derive(Default)] struct CliFactoryServices { - cli_options: Deferred>, + blob_store: Deferred>, caches: Deferred>, + cjs_tracker: Deferred>, + cli_node_resolver: Deferred>, + cli_options: Deferred>, + code_cache: Deferred>, + emit_cache: Deferred>, + emitter: Deferred>, + feature_checker: Deferred>, file_fetcher: Deferred>, + fs: Deferred>, global_http_cache: Deferred>, http_cache: Deferred>, http_client_provider: Deferred>, - emit_cache: Deferred>, - emitter: Deferred>, - esm_or_cjs_checker: Deferred>, - fs: Deferred>, + in_npm_pkg_checker: Deferred>, main_graph_container: Deferred>, - maybe_inspector_server: Deferred>>, - root_cert_store_provider: Deferred>, - blob_store: Deferred>, - module_info_cache: Deferred>, - parsed_source_cache: Deferred>, - resolver: Deferred>, maybe_file_watcher_reporter: Deferred>, + maybe_inspector_server: Deferred>>, module_graph_builder: Deferred>, module_graph_creator: Deferred>, + module_info_cache: Deferred>, module_load_preparer: Deferred>, node_code_translator: Deferred>, node_resolver: Deferred>, + npm_cache_dir: Deferred>, npm_resolver: Deferred>, + parsed_source_cache: Deferred>, permission_desc_parser: Deferred>, + pkg_json_resolver: Deferred>, + resolver: Deferred>, + root_cert_store_provider: Deferred>, root_permissions_container: Deferred, sloppy_imports_resolver: Deferred>>, text_only_progress_bar: Deferred, type_checker: Deferred>, - cjs_resolutions: Deferred>, - cli_node_resolver: Deferred>, - feature_checker: Deferred>, - code_cache: Deferred>, workspace_resolver: Deferred>, } @@ -300,12 +310,6 @@ impl CliFactory { .get_or_init(|| ProgressBar::new(ProgressBarStyle::TextOnly)) } - pub fn esm_or_cjs_checker(&self) -> &Arc { - self.services.esm_or_cjs_checker.get_or_init(|| { - Arc::new(EsmOrCjsChecker::new(self.parsed_source_cache().clone())) - }) - } - pub fn global_http_cache(&self) -> Result<&Arc, AnyError> { self.services.global_http_cache.get_or_try_init(|| { Ok(Arc::new(GlobalHttpCache::new( @@ -359,56 +363,112 @@ impl CliFactory { self.services.fs.get_or_init(|| Arc::new(deno_fs::RealFs)) } + pub fn in_npm_pkg_checker( + &self, + ) -> Result<&Arc, AnyError> { + self.services.in_npm_pkg_checker.get_or_try_init(|| { + let cli_options = self.cli_options()?; + let options = if cli_options.use_byonm() { + CreateInNpmPkgCheckerOptions::Byonm + } else { + CreateInNpmPkgCheckerOptions::Managed( + CliManagedInNpmPkgCheckerCreateOptions { + root_cache_dir_url: self.npm_cache_dir()?.root_dir_url(), + maybe_node_modules_path: cli_options + .node_modules_dir_path() + .map(|p| p.as_path()), + }, + ) + }; + Ok(create_in_npm_pkg_checker(options)) + }) + } + + pub fn npm_cache_dir(&self) -> Result<&Arc, AnyError> { + self.services.npm_cache_dir.get_or_try_init(|| { + let fs = self.fs(); + let global_path = self.deno_dir()?.npm_folder_path(); + let cli_options = self.cli_options()?; + Ok(Arc::new(NpmCacheDir::new( + &DenoCacheEnvFsAdapter(fs.as_ref()), + global_path, + cli_options.npmrc().get_all_known_registries_urls(), + ))) + }) + } + pub async fn npm_resolver( &self, ) -> Result<&Arc, AnyError> { self .services .npm_resolver - .get_or_try_init_async(async { - let fs = self.fs(); - let cli_options = self.cli_options()?; - // For `deno install` we want to force the managed resolver so it can set up `node_modules/` directory. - create_cli_npm_resolver(if cli_options.use_byonm() && !matches!(cli_options.sub_command(), DenoSubcommand::Install(_) | DenoSubcommand::Add(_) | DenoSubcommand::Remove(_)) { - CliNpmResolverCreateOptions::Byonm(CliByonmNpmResolverCreateOptions { - fs: CliDenoResolverFs(fs.clone()), - root_node_modules_dir: Some(match cli_options.node_modules_dir_path() { - Some(node_modules_path) => node_modules_path.to_path_buf(), - // path needs to be canonicalized for node resolution - // (node_modules_dir_path above is already canonicalized) - None => canonicalize_path_maybe_not_exists(cli_options.initial_cwd())? - .join("node_modules"), - }), - }) - } else { - CliNpmResolverCreateOptions::Managed(CliNpmResolverManagedCreateOptions { - snapshot: match cli_options.resolve_npm_resolution_snapshot()? { - Some(snapshot) => { - CliNpmResolverManagedSnapshotOption::Specified(Some(snapshot)) - } - None => match cli_options.maybe_lockfile() { - Some(lockfile) => { - CliNpmResolverManagedSnapshotOption::ResolveFromLockfile( - lockfile.clone(), - ) - } - None => CliNpmResolverManagedSnapshotOption::Specified(None), + .get_or_try_init_async( + async { + let fs = self.fs(); + let cli_options = self.cli_options()?; + create_cli_npm_resolver(if cli_options.use_byonm() { + CliNpmResolverCreateOptions::Byonm( + CliByonmNpmResolverCreateOptions { + fs: CliDenoResolverFs(fs.clone()), + pkg_json_resolver: self.pkg_json_resolver().clone(), + root_node_modules_dir: Some( + match cli_options.node_modules_dir_path() { + Some(node_modules_path) => node_modules_path.to_path_buf(), + // path needs to be canonicalized for node resolution + // (node_modules_dir_path above is already canonicalized) + None => canonicalize_path_maybe_not_exists( + cli_options.initial_cwd(), + )? + .join("node_modules"), + }, + ), }, - }, - maybe_lockfile: cli_options.maybe_lockfile().cloned(), - fs: fs.clone(), - http_client_provider: self.http_client_provider().clone(), - npm_global_cache_dir: self.deno_dir()?.npm_folder_path(), - cache_setting: cli_options.cache_setting(), - text_only_progress_bar: self.text_only_progress_bar().clone(), - maybe_node_modules_path: cli_options.node_modules_dir_path().cloned(), - npm_install_deps_provider: Arc::new(NpmInstallDepsProvider::from_workspace(cli_options.workspace())), - npm_system_info: cli_options.npm_system_info(), - npmrc: cli_options.npmrc().clone(), - lifecycle_scripts: cli_options.lifecycle_scripts_config(), + ) + } else { + CliNpmResolverCreateOptions::Managed( + CliManagedNpmResolverCreateOptions { + snapshot: match cli_options.resolve_npm_resolution_snapshot()? { + Some(snapshot) => { + CliNpmResolverManagedSnapshotOption::Specified(Some( + snapshot, + )) + } + None => match cli_options.maybe_lockfile() { + Some(lockfile) => { + CliNpmResolverManagedSnapshotOption::ResolveFromLockfile( + lockfile.clone(), + ) + } + None => { + CliNpmResolverManagedSnapshotOption::Specified(None) + } + }, + }, + maybe_lockfile: cli_options.maybe_lockfile().cloned(), + fs: fs.clone(), + http_client_provider: self.http_client_provider().clone(), + npm_cache_dir: self.npm_cache_dir()?.clone(), + cache_setting: cli_options.cache_setting(), + text_only_progress_bar: self.text_only_progress_bar().clone(), + maybe_node_modules_path: cli_options + .node_modules_dir_path() + .cloned(), + npm_install_deps_provider: Arc::new( + NpmInstallDepsProvider::from_workspace( + cli_options.workspace(), + ), + ), + npm_system_info: cli_options.npm_system_info(), + npmrc: cli_options.npmrc().clone(), + lifecycle_scripts: cli_options.lifecycle_scripts_config(), + }, + ) }) - }).await - }.boxed_local()) + .await + } + .boxed_local(), + ) .await } @@ -513,6 +573,7 @@ impl CliFactory { self.services.module_info_cache.get_or_try_init(|| { Ok(Arc::new(ModuleInfoCache::new( self.caches()?.dep_analysis_db(), + self.parsed_source_cache().clone(), ))) }) } @@ -541,6 +602,7 @@ impl CliFactory { ts_config_result.ts_config, )?; Ok(Arc::new(Emitter::new( + self.cjs_tracker()?.clone(), self.emit_cache()?.clone(), self.parsed_source_cache().clone(), transpile_options, @@ -564,7 +626,9 @@ impl CliFactory { async { Ok(Arc::new(NodeResolver::new( DenoFsNodeResolverEnv::new(self.fs().clone()), + self.in_npm_pkg_checker()?.clone(), self.npm_resolver().await?.clone().into_npm_resolver(), + self.pkg_json_resolver().clone(), ))) } .boxed_local(), @@ -582,24 +646,35 @@ impl CliFactory { let caches = self.caches()?; let node_analysis_cache = NodeAnalysisCache::new(caches.node_analysis_db()); - let node_resolver = self.cli_node_resolver().await?.clone(); + let node_resolver = self.node_resolver().await?.clone(); let cjs_esm_analyzer = CliCjsCodeAnalyzer::new( node_analysis_cache, + self.cjs_tracker()?.clone(), self.fs().clone(), - node_resolver, Some(self.parsed_source_cache().clone()), + self.cli_options()?.is_npm_main(), ); Ok(Arc::new(NodeCodeTranslator::new( cjs_esm_analyzer, DenoFsNodeResolverEnv::new(self.fs().clone()), - self.node_resolver().await?.clone(), + self.in_npm_pkg_checker()?.clone(), + node_resolver, self.npm_resolver().await?.clone().into_npm_resolver(), + self.pkg_json_resolver().clone(), ))) }) .await } + pub fn pkg_json_resolver(&self) -> &Arc { + self.services.pkg_json_resolver.get_or_init(|| { + Arc::new(PackageJsonResolver::new(DenoFsNodeResolverEnv::new( + self.fs().clone(), + ))) + }) + } + pub async fn type_checker(&self) -> Result<&Arc, AnyError> { self .services @@ -608,6 +683,10 @@ impl CliFactory { let cli_options = self.cli_options()?; Ok(Arc::new(TypeChecker::new( self.caches()?.clone(), + Arc::new(TypeCheckingCjsTracker::new( + self.cjs_tracker()?.clone(), + self.module_info_cache()?.clone(), + )), cli_options.clone(), self.module_graph_builder().await?.clone(), self.node_resolver().await?.clone(), @@ -626,19 +705,18 @@ impl CliFactory { .get_or_try_init_async(async { let cli_options = self.cli_options()?; Ok(Arc::new(ModuleGraphBuilder::new( - cli_options.clone(), self.caches()?.clone(), - self.esm_or_cjs_checker().clone(), + cli_options.clone(), + self.file_fetcher()?.clone(), self.fs().clone(), - self.resolver().await?.clone(), - self.cli_node_resolver().await?.clone(), - self.npm_resolver().await?.clone(), - self.module_info_cache()?.clone(), - self.parsed_source_cache().clone(), + self.global_http_cache()?.clone(), + self.in_npm_pkg_checker()?.clone(), cli_options.maybe_lockfile().cloned(), self.maybe_file_watcher_reporter().clone(), - self.file_fetcher()?.clone(), - self.global_http_cache()?.clone(), + self.module_info_cache()?.clone(), + self.npm_resolver().await?.clone(), + self.parsed_source_cache().clone(), + self.resolver().await?.clone(), self.root_permissions_container()?.clone(), ))) }) @@ -710,8 +788,17 @@ impl CliFactory { .await } - pub fn cjs_resolutions(&self) -> &Arc { - self.services.cjs_resolutions.get_or_init(Default::default) + pub fn cjs_tracker(&self) -> Result<&Arc, AnyError> { + self.services.cjs_tracker.get_or_try_init(|| { + let options = self.cli_options()?; + Ok(Arc::new(CjsTracker::new( + self.in_npm_pkg_checker()?.clone(), + self.pkg_json_resolver().clone(), + CjsTrackerOptions { + unstable_detect_cjs: options.unstable_detect_cjs(), + }, + ))) + }) } pub async fn cli_node_resolver( @@ -722,8 +809,9 @@ impl CliFactory { .cli_node_resolver .get_or_try_init_async(async { Ok(Arc::new(CliNodeResolver::new( - self.cjs_resolutions().clone(), + self.cjs_tracker()?.clone(), self.fs().clone(), + self.in_npm_pkg_checker()?.clone(), self.node_resolver().await?.clone(), self.npm_resolver().await?.clone(), ))) @@ -761,6 +849,7 @@ impl CliFactory { ) -> Result { let cli_options = self.cli_options()?; Ok(DenoCompileBinaryWriter::new( + self.cjs_tracker()?, self.deno_dir()?, self.emitter()?, self.file_fetcher()?, @@ -791,53 +880,60 @@ impl CliFactory { &self, ) -> Result { let cli_options = self.cli_options()?; + let fs = self.fs(); let node_resolver = self.node_resolver().await?; let npm_resolver = self.npm_resolver().await?; - let fs = self.fs(); let cli_node_resolver = self.cli_node_resolver().await?; let cli_npm_resolver = self.npm_resolver().await?.clone(); + let in_npm_pkg_checker = self.in_npm_pkg_checker()?; let maybe_file_watcher_communicator = if cli_options.has_hmr() { Some(self.watcher_communicator.clone().unwrap()) } else { None }; + let node_code_translator = self.node_code_translator().await?; + let cjs_tracker = self.cjs_tracker()?.clone(); + let pkg_json_resolver = self.pkg_json_resolver().clone(); Ok(CliMainWorkerFactory::new( self.blob_store().clone(), - self.cjs_resolutions().clone(), if cli_options.code_cache_enabled() { Some(self.code_cache()?.clone()) } else { None }, self.feature_checker()?.clone(), - self.fs().clone(), + fs.clone(), maybe_file_watcher_communicator, self.maybe_inspector_server()?.clone(), cli_options.maybe_lockfile().cloned(), Box::new(CliModuleLoaderFactory::new( cli_options, + cjs_tracker, if cli_options.code_cache_enabled() { Some(self.code_cache()?.clone()) } else { None }, self.emitter()?.clone(), + fs.clone(), + in_npm_pkg_checker.clone(), self.main_module_graph_container().await?.clone(), self.module_load_preparer().await?.clone(), + node_code_translator.clone(), cli_node_resolver.clone(), cli_npm_resolver.clone(), NpmModuleLoader::new( - self.cjs_resolutions().clone(), - self.node_code_translator().await?.clone(), + self.cjs_tracker()?.clone(), fs.clone(), - cli_node_resolver.clone(), + node_code_translator.clone(), ), self.parsed_source_cache().clone(), self.resolver().await?.clone(), )), node_resolver.clone(), npm_resolver.clone(), + pkg_json_resolver, self.root_cert_store_provider().clone(), self.root_permissions_container()?.clone(), StorageKeyResolver::from_options(cli_options), @@ -853,8 +949,10 @@ impl CliFactory { let create_hmr_runner = if cli_options.has_hmr() { let watcher_communicator = self.watcher_communicator.clone().unwrap(); let emitter = self.emitter()?.clone(); + let cjs_tracker = self.cjs_tracker()?.clone(); let fn_: crate::worker::CreateHmrRunnerCb = Box::new(move |session| { Box::new(HmrRunner::new( + cjs_tracker.clone(), emitter.clone(), session, watcher_communicator.clone(), @@ -891,7 +989,6 @@ impl CliFactory { inspect_wait: cli_options.inspect_wait().is_some(), strace_ops: cli_options.strace_ops().clone(), is_inspecting: cli_options.is_inspecting(), - is_npm_main: cli_options.is_npm_main(), location: cli_options.location_flag().clone(), // if the user ran a binary command, we'll need to set process.argv[0] // to be the name of the binary command instead of deno @@ -909,7 +1006,6 @@ impl CliFactory { node_ipc: cli_options.node_ipc_fd(), serve_port: cli_options.serve_port(), serve_host: cli_options.serve_host(), - unstable_detect_cjs: cli_options.unstable_detect_cjs(), }) } } diff --git a/cli/graph_util.rs b/cli/graph_util.rs index 2eaee228af..46257cf785 100644 --- a/cli/graph_util.rs +++ b/cli/graph_util.rs @@ -6,7 +6,6 @@ use crate::args::CliLockfile; use crate::args::CliOptions; use crate::args::DENO_DISABLE_PEDANTIC_NODE_WARNINGS; use crate::cache; -use crate::cache::EsmOrCjsChecker; use crate::cache::GlobalHttpCache; use crate::cache::ModuleInfoCache; use crate::cache::ParsedSourceCache; @@ -15,7 +14,6 @@ use crate::errors::get_error_class_name; use crate::file_fetcher::FileFetcher; use crate::npm::CliNpmResolver; use crate::resolver::CliGraphResolver; -use crate::resolver::CliNodeResolver; use crate::resolver::CliSloppyImportsResolver; use crate::resolver::SloppyImportsCachedFs; use crate::tools::check; @@ -50,6 +48,7 @@ use deno_runtime::deno_permissions::PermissionsContainer; use deno_semver::jsr::JsrDepPackageReq; use deno_semver::package::PackageNv; use import_map::ImportMapError; +use node_resolver::InNpmPackageChecker; use std::collections::HashSet; use std::error::Error; use std::ops::Deref; @@ -379,54 +378,51 @@ pub struct BuildFastCheckGraphOptions<'a> { } pub struct ModuleGraphBuilder { - options: Arc, caches: Arc, - esm_or_cjs_checker: Arc, + cli_options: Arc, + file_fetcher: Arc, fs: Arc, - resolver: Arc, - node_resolver: Arc, - npm_resolver: Arc, - module_info_cache: Arc, - parsed_source_cache: Arc, + global_http_cache: Arc, + in_npm_pkg_checker: Arc, lockfile: Option>, maybe_file_watcher_reporter: Option, - file_fetcher: Arc, - global_http_cache: Arc, + module_info_cache: Arc, + npm_resolver: Arc, + parsed_source_cache: Arc, + resolver: Arc, root_permissions_container: PermissionsContainer, } impl ModuleGraphBuilder { #[allow(clippy::too_many_arguments)] pub fn new( - options: Arc, caches: Arc, - esm_or_cjs_checker: Arc, + cli_options: Arc, + file_fetcher: Arc, fs: Arc, - resolver: Arc, - node_resolver: Arc, - npm_resolver: Arc, - module_info_cache: Arc, - parsed_source_cache: Arc, + global_http_cache: Arc, + in_npm_pkg_checker: Arc, lockfile: Option>, maybe_file_watcher_reporter: Option, - file_fetcher: Arc, - global_http_cache: Arc, + module_info_cache: Arc, + npm_resolver: Arc, + parsed_source_cache: Arc, + resolver: Arc, root_permissions_container: PermissionsContainer, ) -> Self { Self { - options, caches, - esm_or_cjs_checker, + cli_options, + file_fetcher, fs, - resolver, - node_resolver, - npm_resolver, - module_info_cache, - parsed_source_cache, + global_http_cache, + in_npm_pkg_checker, lockfile, maybe_file_watcher_reporter, - file_fetcher, - global_http_cache, + module_info_cache, + npm_resolver, + parsed_source_cache, + resolver, root_permissions_container, } } @@ -512,13 +508,11 @@ impl ModuleGraphBuilder { } let maybe_imports = if options.graph_kind.include_types() { - self.options.to_compiler_option_types()? + self.cli_options.to_compiler_option_types()? } else { Vec::new() }; - let analyzer = self - .module_info_cache - .as_module_analyzer(&self.parsed_source_cache); + let analyzer = self.module_info_cache.as_module_analyzer(); let mut loader = match options.loader { Some(loader) => MutLoaderRef::Borrowed(loader), None => MutLoaderRef::Owned(self.create_graph_loader()), @@ -566,7 +560,7 @@ impl ModuleGraphBuilder { // ensure an "npm install" is done if the user has explicitly // opted into using a node_modules directory if self - .options + .cli_options .node_modules_dir()? .map(|m| m.uses_node_modules_dir()) .unwrap_or(false) @@ -677,10 +671,10 @@ impl ModuleGraphBuilder { graph.build_fast_check_type_graph( deno_graph::BuildFastCheckTypeGraphOptions { - jsr_url_provider: &CliJsrUrlProvider, + es_parser: Some(&parser), fast_check_cache: fast_check_cache.as_ref().map(|c| c as _), fast_check_dts: false, - module_parser: Some(&parser), + jsr_url_provider: &CliJsrUrlProvider, resolver: Some(graph_resolver), npm_resolver: Some(&graph_npm_resolver), workspace_fast_check: options.workspace_fast_check, @@ -699,20 +693,18 @@ impl ModuleGraphBuilder { permissions: PermissionsContainer, ) -> cache::FetchCacher { cache::FetchCacher::new( - self.esm_or_cjs_checker.clone(), self.file_fetcher.clone(), + self.fs.clone(), self.global_http_cache.clone(), - self.node_resolver.clone(), - self.npm_resolver.clone(), + self.in_npm_pkg_checker.clone(), self.module_info_cache.clone(), cache::FetchCacherOptions { - file_header_overrides: self.options.resolve_file_header_overrides(), + file_header_overrides: self.cli_options.resolve_file_header_overrides(), permissions, is_deno_publish: matches!( - self.options.sub_command(), + self.cli_options.sub_command(), crate::args::DenoSubcommand::Publish { .. } ), - unstable_detect_cjs: self.options.unstable_detect_cjs(), }, ) } @@ -737,12 +729,12 @@ impl ModuleGraphBuilder { &self.fs, roots, GraphValidOptions { - kind: if self.options.type_check_mode().is_true() { + kind: if self.cli_options.type_check_mode().is_true() { GraphKind::All } else { GraphKind::CodeOnly }, - check_js: self.options.check_js(), + check_js: self.cli_options.check_js(), exit_integrity_errors: true, }, ) diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs index 39f1ae6482..0769c90477 100644 --- a/cli/lsp/analysis.rs +++ b/cli/lsp/analysis.rs @@ -36,7 +36,6 @@ use deno_semver::package::PackageReq; use deno_semver::package::PackageReqReference; use deno_semver::Version; use import_map::ImportMap; -use node_resolver::NpmResolver; use once_cell::sync::Lazy; use regex::Regex; use std::borrow::Cow; @@ -336,7 +335,12 @@ impl<'a> TsResponseImportMapper<'a> { .resolver .maybe_managed_npm_resolver(Some(&self.file_referrer)) { - if npm_resolver.in_npm_package(specifier) { + let in_npm_pkg = self + .resolver + .maybe_node_resolver(Some(&self.file_referrer)) + .map(|n| n.in_npm_package(specifier)) + .unwrap_or(false); + if in_npm_pkg { if let Ok(Some(pkg_id)) = npm_resolver.resolve_pkg_id_from_specifier(specifier) { @@ -1199,14 +1203,11 @@ impl CodeActionCollection { }), ); - match parsed_source.program_ref() { - deno_ast::swc::ast::Program::Module(module) => module - .body - .iter() - .find(|i| i.range().contains(&specifier_range)) - .map(|i| text_info.line_and_column_index(i.range().start)), - deno_ast::swc::ast::Program::Script(_) => None, - } + parsed_source + .program_ref() + .body() + .find(|i| i.range().contains(&specifier_range)) + .map(|i| text_info.line_and_column_index(i.range().start)) } async fn deno_types_for_npm_action( diff --git a/cli/lsp/code_lens.rs b/cli/lsp/code_lens.rs index e117888fba..a57ca3ac9f 100644 --- a/cli/lsp/code_lens.rs +++ b/cli/lsp/code_lens.rs @@ -421,7 +421,7 @@ pub fn collect_test( ) -> Result, AnyError> { let mut collector = DenoTestCollector::new(specifier.clone(), parsed_source.clone()); - parsed_source.module().visit_with(&mut collector); + parsed_source.program().visit_with(&mut collector); Ok(collector.take()) } @@ -581,7 +581,7 @@ mod tests { .unwrap(); let mut collector = DenoTestCollector::new(specifier, parsed_module.clone()); - parsed_module.module().visit_with(&mut collector); + parsed_module.program().visit_with(&mut collector); assert_eq!( collector.take(), vec![ diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs index cac0637a05..34bf64446d 100644 --- a/cli/lsp/config.rs +++ b/cli/lsp/config.rs @@ -985,7 +985,7 @@ impl Config { | MediaType::Tsx => Some(&workspace_settings.typescript), MediaType::Json | MediaType::Wasm - | MediaType::TsBuildInfo + | MediaType::Css | MediaType::SourceMap | MediaType::Unknown => None, } diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs index 7d1ca6810d..8609aed05e 100644 --- a/cli/lsp/documents.rs +++ b/cli/lsp/documents.rs @@ -272,7 +272,7 @@ fn get_maybe_test_module_fut( parsed_source.specifier().clone(), parsed_source.text_info_lazy().clone(), ); - parsed_source.module().visit_with(&mut collector); + parsed_source.program().visit_with(&mut collector); Arc::new(collector.take()) }) .map(Result::ok) @@ -332,12 +332,8 @@ impl Document { .filter(|s| cache.is_valid_file_referrer(s)) .cloned() .or(file_referrer); - let media_type = resolve_media_type( - &specifier, - maybe_headers.as_ref(), - maybe_language_id, - &resolver, - ); + let media_type = + resolve_media_type(&specifier, maybe_headers.as_ref(), maybe_language_id); let (maybe_parsed_source, maybe_module) = if media_type_is_diagnosable(media_type) { parse_and_analyze_module( @@ -399,7 +395,6 @@ impl Document { &self.specifier, self.maybe_headers.as_ref(), self.maybe_language_id, - &resolver, ); let dependencies; let maybe_types_dependency; @@ -764,14 +759,7 @@ fn resolve_media_type( specifier: &ModuleSpecifier, maybe_headers: Option<&HashMap>, maybe_language_id: Option, - resolver: &LspResolver, ) -> MediaType { - if resolver.in_node_modules(specifier) { - if let Some(media_type) = resolver.node_media_type(specifier) { - return media_type; - } - } - if let Some(language_id) = maybe_language_id { return MediaType::from_specifier_and_content_type( specifier, @@ -1561,7 +1549,7 @@ fn parse_source( text: Arc, media_type: MediaType, ) -> ParsedSourceResult { - deno_ast::parse_module(deno_ast::ParseParams { + deno_ast::parse_program(deno_ast::ParseParams { specifier, text, media_type, diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index a592245ce7..4fa0e3afbc 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -904,7 +904,7 @@ impl Inner { | MediaType::Tsx => {} MediaType::Wasm | MediaType::SourceMap - | MediaType::TsBuildInfo + | MediaType::Css | MediaType::Unknown => { if path.extension().and_then(|s| s.to_str()) != Some("jsonc") { continue; diff --git a/cli/lsp/resolver.rs b/cli/lsp/resolver.rs index 00587f8f50..9ce76005e5 100644 --- a/cli/lsp/resolver.rs +++ b/cli/lsp/resolver.rs @@ -2,6 +2,8 @@ use dashmap::DashMap; use deno_ast::MediaType; +use deno_ast::ParsedSource; +use deno_cache_dir::npm::NpmCacheDir; use deno_cache_dir::HttpCache; use deno_config::workspace::PackageJsonDepResolution; use deno_config::workspace::WorkspaceResolver; @@ -14,15 +16,15 @@ use deno_path_util::url_to_file_path; use deno_runtime::deno_fs; use deno_runtime::deno_node::NodeResolver; use deno_runtime::deno_node::PackageJson; +use deno_runtime::deno_node::PackageJsonResolver; use deno_semver::jsr::JsrPackageReqReference; use deno_semver::npm::NpmPackageReqReference; use deno_semver::package::PackageNv; use deno_semver::package::PackageReq; use indexmap::IndexMap; use node_resolver::errors::ClosestPkgJsonError; -use node_resolver::NodeResolution; +use node_resolver::InNpmPackageChecker; use node_resolver::NodeResolutionMode; -use node_resolver::NpmResolver; use std::borrow::Cow; use std::collections::BTreeMap; use std::collections::BTreeSet; @@ -36,6 +38,7 @@ use crate::args::create_default_npmrc; use crate::args::CacheSetting; use crate::args::CliLockfile; use crate::args::NpmInstallDepsProvider; +use crate::cache::DenoCacheEnvFsAdapter; use crate::graph_util::CliJsrUrlProvider; use crate::http_util::HttpClientProvider; use crate::lsp::config::Config; @@ -43,26 +46,32 @@ use crate::lsp::config::ConfigData; use crate::lsp::logging::lsp_warn; use crate::npm::create_cli_npm_resolver_for_lsp; use crate::npm::CliByonmNpmResolverCreateOptions; +use crate::npm::CliManagedInNpmPkgCheckerCreateOptions; +use crate::npm::CliManagedNpmResolverCreateOptions; use crate::npm::CliNpmResolver; use crate::npm::CliNpmResolverCreateOptions; -use crate::npm::CliNpmResolverManagedCreateOptions; use crate::npm::CliNpmResolverManagedSnapshotOption; +use crate::npm::CreateInNpmPkgCheckerOptions; use crate::npm::ManagedCliNpmResolver; -use crate::resolver::CjsResolutionStore; +use crate::resolver::CjsTracker; +use crate::resolver::CjsTrackerOptions; use crate::resolver::CliDenoResolverFs; use crate::resolver::CliGraphResolver; use crate::resolver::CliGraphResolverOptions; use crate::resolver::CliNodeResolver; use crate::resolver::WorkerCliNpmGraphResolver; +use crate::tsc::into_specifier_and_media_type; use crate::util::progress_bar::ProgressBar; use crate::util::progress_bar::ProgressBarStyle; #[derive(Debug, Clone)] struct LspScopeResolver { + cjs_tracker: Option>, graph_resolver: Arc, jsr_resolver: Option>, npm_resolver: Option>, node_resolver: Option>, + pkg_json_resolver: Option>, redirect_resolver: Option>, graph_imports: Arc>, config_data: Option>, @@ -71,10 +80,12 @@ struct LspScopeResolver { impl Default for LspScopeResolver { fn default() -> Self { Self { + cjs_tracker: None, graph_resolver: create_graph_resolver(None, None, None), jsr_resolver: None, npm_resolver: None, node_resolver: None, + pkg_json_resolver: None, redirect_resolver: None, graph_imports: Default::default(), config_data: None, @@ -90,14 +101,35 @@ impl LspScopeResolver { ) -> Self { let mut npm_resolver = None; let mut node_resolver = None; + let mut lsp_cjs_tracker = None; + let fs = Arc::new(deno_fs::RealFs); + let pkg_json_resolver = Arc::new(PackageJsonResolver::new( + deno_runtime::deno_node::DenoFsNodeResolverEnv::new(fs.clone()), + )); if let Some(http_client) = http_client_provider { npm_resolver = create_npm_resolver( config_data.map(|d| d.as_ref()), cache, http_client, + &pkg_json_resolver, ) .await; - node_resolver = create_node_resolver(npm_resolver.as_ref()); + if let Some(npm_resolver) = &npm_resolver { + let in_npm_pkg_checker = create_in_npm_pkg_checker(npm_resolver); + let cjs_tracker = create_cjs_tracker( + in_npm_pkg_checker.clone(), + pkg_json_resolver.clone(), + ); + lsp_cjs_tracker = + Some(Arc::new(LspCjsTracker::new(cjs_tracker.clone()))); + node_resolver = Some(create_node_resolver( + cjs_tracker, + fs.clone(), + in_npm_pkg_checker, + npm_resolver, + pkg_json_resolver.clone(), + )); + } } let graph_resolver = create_graph_resolver( config_data.map(|d| d.as_ref()), @@ -134,10 +166,12 @@ impl LspScopeResolver { }) .unwrap_or_default(); Self { + cjs_tracker: lsp_cjs_tracker, graph_resolver, jsr_resolver, npm_resolver, node_resolver, + pkg_json_resolver: Some(pkg_json_resolver), redirect_resolver, graph_imports, config_data: config_data.cloned(), @@ -147,18 +181,40 @@ impl LspScopeResolver { fn snapshot(&self) -> Arc { let npm_resolver = self.npm_resolver.as_ref().map(|r| r.clone_snapshotted()); - let node_resolver = create_node_resolver(npm_resolver.as_ref()); + let fs = Arc::new(deno_fs::RealFs); + let pkg_json_resolver = Arc::new(PackageJsonResolver::new( + deno_runtime::deno_node::DenoFsNodeResolverEnv::new(fs.clone()), + )); + let mut node_resolver = None; + let mut lsp_cjs_tracker = None; + if let Some(npm_resolver) = &npm_resolver { + let in_npm_pkg_checker = create_in_npm_pkg_checker(npm_resolver); + let cjs_tracker = create_cjs_tracker( + in_npm_pkg_checker.clone(), + pkg_json_resolver.clone(), + ); + lsp_cjs_tracker = Some(Arc::new(LspCjsTracker::new(cjs_tracker.clone()))); + node_resolver = Some(create_node_resolver( + cjs_tracker, + fs, + in_npm_pkg_checker, + npm_resolver, + pkg_json_resolver.clone(), + )); + } let graph_resolver = create_graph_resolver( self.config_data.as_deref(), npm_resolver.as_ref(), node_resolver.as_ref(), ); Arc::new(Self { + cjs_tracker: lsp_cjs_tracker, graph_resolver, jsr_resolver: self.jsr_resolver.clone(), npm_resolver, node_resolver, redirect_resolver: self.redirect_resolver.clone(), + pkg_json_resolver: Some(pkg_json_resolver), graph_imports: self.graph_imports.clone(), config_data: self.config_data.clone(), }) @@ -261,6 +317,22 @@ impl LspResolver { resolver.graph_resolver.create_graph_npm_resolver() } + pub fn maybe_cjs_tracker( + &self, + file_referrer: Option<&ModuleSpecifier>, + ) -> Option<&Arc> { + let resolver = self.get_scope_resolver(file_referrer); + resolver.cjs_tracker.as_ref() + } + + pub fn maybe_node_resolver( + &self, + file_referrer: Option<&ModuleSpecifier>, + ) -> Option<&Arc> { + let resolver = self.get_scope_resolver(file_referrer); + resolver.node_resolver.as_ref() + } + pub fn maybe_managed_npm_resolver( &self, file_referrer: Option<&ModuleSpecifier>, @@ -328,7 +400,7 @@ impl LspResolver { ) -> Option<(ModuleSpecifier, MediaType)> { let resolver = self.get_scope_resolver(file_referrer); let node_resolver = resolver.node_resolver.as_ref()?; - Some(NodeResolution::into_specifier_and_media_type(Some( + Some(into_specifier_and_media_type(Some( node_resolver .resolve_req_reference(req_ref, referrer, NodeResolutionMode::Types) .ok()?, @@ -346,14 +418,10 @@ impl LspResolver { .contains("/node_modules/") } - let global_npm_resolver = self - .get_scope_resolver(Some(specifier)) - .npm_resolver - .as_ref() - .and_then(|npm_resolver| npm_resolver.as_managed()) - .filter(|r| r.root_node_modules_path().is_none()); - if let Some(npm_resolver) = &global_npm_resolver { - if npm_resolver.in_npm_package(specifier) { + if let Some(node_resolver) = + &self.get_scope_resolver(Some(specifier)).node_resolver + { + if node_resolver.in_npm_package(specifier) { return true; } } @@ -361,18 +429,6 @@ impl LspResolver { has_node_modules_dir(specifier) } - pub fn node_media_type( - &self, - specifier: &ModuleSpecifier, - ) -> Option { - let resolver = self.get_scope_resolver(Some(specifier)); - let node_resolver = resolver.node_resolver.as_ref()?; - let resolution = node_resolver - .url_to_node_resolution(specifier.clone()) - .ok()?; - Some(NodeResolution::into_specifier_and_media_type(Some(resolution)).1) - } - pub fn is_bare_package_json_dep( &self, specifier_text: &str, @@ -398,10 +454,10 @@ impl LspResolver { referrer: &ModuleSpecifier, ) -> Result>, ClosestPkgJsonError> { let resolver = self.get_scope_resolver(Some(referrer)); - let Some(node_resolver) = resolver.node_resolver.as_ref() else { + let Some(pkg_json_resolver) = resolver.pkg_json_resolver.as_ref() else { return Ok(None); }; - node_resolver.get_closest_package_json(referrer) + pkg_json_resolver.get_closest_package_json(referrer) } pub fn resolve_redirects( @@ -457,11 +513,13 @@ async fn create_npm_resolver( config_data: Option<&ConfigData>, cache: &LspCache, http_client_provider: &Arc, + pkg_json_resolver: &Arc, ) -> Option> { let enable_byonm = config_data.map(|d| d.byonm).unwrap_or(false); let options = if enable_byonm { CliNpmResolverCreateOptions::Byonm(CliByonmNpmResolverCreateOptions { fs: CliDenoResolverFs(Arc::new(deno_fs::RealFs)), + pkg_json_resolver: pkg_json_resolver.clone(), root_node_modules_dir: config_data.and_then(|config_data| { config_data.node_modules_dir.clone().or_else(|| { url_to_file_path(&config_data.scope) @@ -471,7 +529,15 @@ async fn create_npm_resolver( }), }) } else { - CliNpmResolverCreateOptions::Managed(CliNpmResolverManagedCreateOptions { + let npmrc = config_data + .and_then(|d| d.npmrc.clone()) + .unwrap_or_else(create_default_npmrc); + let npm_cache_dir = Arc::new(NpmCacheDir::new( + &DenoCacheEnvFsAdapter(&deno_fs::RealFs), + cache.deno_dir().npm_folder_path(), + npmrc.get_all_known_registries_urls(), + )); + CliNpmResolverCreateOptions::Managed(CliManagedNpmResolverCreateOptions { http_client_provider: http_client_provider.clone(), snapshot: match config_data.and_then(|d| d.lockfile.as_ref()) { Some(lockfile) => { @@ -485,7 +551,7 @@ async fn create_npm_resolver( // updating it. Only the cache request should update the lockfile. maybe_lockfile: None, fs: Arc::new(deno_fs::RealFs), - npm_global_cache_dir: cache.deno_dir().npm_folder_path(), + npm_cache_dir, // Use an "only" cache setting in order to make the // user do an explicit "cache" command and prevent // the cache from being filled with lots of packages while @@ -496,9 +562,7 @@ async fn create_npm_resolver( .and_then(|d| d.node_modules_dir.clone()), // only used for top level install, so we can ignore this npm_install_deps_provider: Arc::new(NpmInstallDepsProvider::empty()), - npmrc: config_data - .and_then(|d| d.npmrc.clone()) - .unwrap_or_else(create_default_npmrc), + npmrc, npm_system_info: NpmSystemInfo::default(), lifecycle_scripts: Default::default(), }) @@ -506,28 +570,59 @@ async fn create_npm_resolver( Some(create_cli_npm_resolver_for_lsp(options).await) } +fn create_cjs_tracker( + in_npm_pkg_checker: Arc, + pkg_json_resolver: Arc, +) -> Arc { + Arc::new(CjsTracker::new( + in_npm_pkg_checker, + pkg_json_resolver, + CjsTrackerOptions { + // todo(dsherret): support in the lsp by stabilizing the feature + // so that we don't have to pipe the config in here + unstable_detect_cjs: false, + }, + )) +} + +fn create_in_npm_pkg_checker( + npm_resolver: &Arc, +) -> Arc { + crate::npm::create_in_npm_pkg_checker(match npm_resolver.as_inner() { + crate::npm::InnerCliNpmResolverRef::Byonm(_) => { + CreateInNpmPkgCheckerOptions::Byonm + } + crate::npm::InnerCliNpmResolverRef::Managed(m) => { + CreateInNpmPkgCheckerOptions::Managed( + CliManagedInNpmPkgCheckerCreateOptions { + root_cache_dir_url: m.global_cache_root_url(), + maybe_node_modules_path: m.maybe_node_modules_path(), + }, + ) + } + }) +} + fn create_node_resolver( - npm_resolver: Option<&Arc>, -) -> Option> { - use once_cell::sync::Lazy; - - // it's not ideal to share this across all scopes and to - // never clear it, but it's fine for the time being - static CJS_RESOLUTIONS: Lazy> = - Lazy::new(Default::default); - - let npm_resolver = npm_resolver?; - let fs = Arc::new(deno_fs::RealFs); + cjs_tracker: Arc, + fs: Arc, + in_npm_pkg_checker: Arc, + npm_resolver: &Arc, + pkg_json_resolver: Arc, +) -> Arc { let node_resolver_inner = Arc::new(NodeResolver::new( deno_runtime::deno_node::DenoFsNodeResolverEnv::new(fs.clone()), + in_npm_pkg_checker.clone(), npm_resolver.clone().into_npm_resolver(), + pkg_json_resolver.clone(), )); - Some(Arc::new(CliNodeResolver::new( - CJS_RESOLUTIONS.clone(), + Arc::new(CliNodeResolver::new( + cjs_tracker.clone(), fs, + in_npm_pkg_checker, node_resolver_inner, npm_resolver.clone(), - ))) + )) } fn create_graph_resolver( @@ -702,6 +797,45 @@ impl RedirectResolver { } } +#[derive(Debug)] +pub struct LspCjsTracker { + cjs_tracker: Arc, +} + +impl LspCjsTracker { + pub fn new(cjs_tracker: Arc) -> Self { + Self { cjs_tracker } + } + + pub fn is_cjs( + &self, + specifier: &ModuleSpecifier, + media_type: MediaType, + maybe_parsed_source: Option<&ParsedSource>, + ) -> bool { + if let Some(module_kind) = + self.cjs_tracker.get_known_kind(specifier, media_type) + { + module_kind.is_cjs() + } else { + let maybe_is_script = maybe_parsed_source.map(|p| p.compute_is_script()); + maybe_is_script + .and_then(|is_script| { + self + .cjs_tracker + .is_cjs_with_known_is_script(specifier, media_type, is_script) + .ok() + }) + .unwrap_or_else(|| { + self + .cjs_tracker + .is_maybe_cjs(specifier, media_type) + .unwrap_or(false) + }) + } + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/cli/lsp/testing/collectors.rs b/cli/lsp/testing/collectors.rs index 2f2ddb8773..2dd7ec0d96 100644 --- a/cli/lsp/testing/collectors.rs +++ b/cli/lsp/testing/collectors.rs @@ -650,7 +650,7 @@ pub mod tests { .unwrap(); let text_info = parsed_module.text_info_lazy().clone(); let mut collector = TestCollector::new(specifier, text_info); - parsed_module.module().visit_with(&mut collector); + parsed_module.program().visit_with(&mut collector); collector.take() } diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index 0f31d7dd3b..5fcdb3575a 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -4362,14 +4362,25 @@ fn op_load<'s>( None } else { let asset_or_document = state.get_asset_or_document(&specifier); - asset_or_document.map(|doc| LoadResponse { - data: doc.text(), - script_kind: crate::tsc::as_ts_script_kind(doc.media_type()), - version: state.script_version(&specifier), - is_cjs: matches!( - doc.media_type(), - MediaType::Cjs | MediaType::Cts | MediaType::Dcts - ), + asset_or_document.map(|doc| { + let maybe_cjs_tracker = state + .state_snapshot + .resolver + .maybe_cjs_tracker(Some(&specifier)); + LoadResponse { + data: doc.text(), + script_kind: crate::tsc::as_ts_script_kind(doc.media_type()), + version: state.script_version(&specifier), + is_cjs: maybe_cjs_tracker + .map(|t| { + t.is_cjs( + &specifier, + doc.media_type(), + doc.maybe_parsed_source().and_then(|p| p.as_ref().ok()), + ) + }) + .unwrap_or(false), + } }) }; diff --git a/cli/main.rs b/cli/main.rs index c2639c9088..04daff6700 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -135,7 +135,7 @@ async fn run_subcommand(flags: Arc) -> Result { tools::compile::compile(flags, compile_flags).await }), DenoSubcommand::Coverage(coverage_flags) => spawn_subcommand(async { - tools::coverage::cover_files(flags, coverage_flags).await + tools::coverage::cover_files(flags, coverage_flags) }), DenoSubcommand::Fmt(fmt_flags) => { spawn_subcommand( diff --git a/cli/module_loader.rs b/cli/module_loader.rs index 4a020516e7..43c9e1aa07 100644 --- a/cli/module_loader.rs +++ b/cli/module_loader.rs @@ -2,6 +2,7 @@ use std::borrow::Cow; use std::cell::RefCell; +use std::path::Path; use std::path::PathBuf; use std::pin::Pin; use std::rc::Rc; @@ -23,19 +24,23 @@ use crate::graph_container::ModuleGraphUpdatePermit; use crate::graph_util::CreateGraphOptions; use crate::graph_util::ModuleGraphBuilder; use crate::node; +use crate::node::CliNodeCodeTranslator; use crate::npm::CliNpmResolver; +use crate::resolver::CjsTracker; use crate::resolver::CliGraphResolver; use crate::resolver::CliNodeResolver; use crate::resolver::ModuleCodeStringSource; +use crate::resolver::NotSupportedKindInNpmError; use crate::resolver::NpmModuleLoader; use crate::tools::check; use crate::tools::check::TypeChecker; use crate::util::progress_bar::ProgressBar; use crate::util::text_encoding::code_without_source_map; use crate::util::text_encoding::source_map_from_code; -use crate::worker::ModuleLoaderAndSourceMapGetter; +use crate::worker::CreateModuleLoaderResult; use crate::worker::ModuleLoaderFactory; use deno_ast::MediaType; +use deno_ast::ModuleKind; use deno_core::anyhow::anyhow; use deno_core::anyhow::bail; use deno_core::anyhow::Context; @@ -63,9 +68,12 @@ use deno_graph::Module; use deno_graph::ModuleGraph; use deno_graph::Resolution; use deno_runtime::code_cache; +use deno_runtime::deno_fs::FileSystem; use deno_runtime::deno_node::create_host_defined_options; +use deno_runtime::deno_node::NodeRequireLoader; use deno_runtime::deno_permissions::PermissionsContainer; use deno_semver::npm::NpmPackageReqReference; +use node_resolver::InNpmPackageChecker; use node_resolver::NodeResolutionMode; pub struct ModuleLoadPreparer { @@ -198,11 +206,16 @@ struct SharedCliModuleLoaderState { lib_worker: TsTypeLib, initial_cwd: PathBuf, is_inspecting: bool, + is_npm_main: bool, is_repl: bool, + cjs_tracker: Arc, code_cache: Option>, emitter: Arc, + fs: Arc, + in_npm_pkg_checker: Arc, main_module_graph_container: Arc, module_load_preparer: Arc, + node_code_translator: Arc, node_resolver: Arc, npm_resolver: Arc, npm_module_loader: NpmModuleLoader, @@ -218,10 +231,14 @@ impl CliModuleLoaderFactory { #[allow(clippy::too_many_arguments)] pub fn new( options: &CliOptions, + cjs_tracker: Arc, code_cache: Option>, emitter: Arc, + fs: Arc, + in_npm_pkg_checker: Arc, main_module_graph_container: Arc, module_load_preparer: Arc, + node_code_translator: Arc, node_resolver: Arc, npm_resolver: Arc, npm_module_loader: NpmModuleLoader, @@ -235,14 +252,19 @@ impl CliModuleLoaderFactory { lib_worker: options.ts_type_lib_worker(), initial_cwd: options.initial_cwd().to_path_buf(), is_inspecting: options.is_inspecting(), + is_npm_main: options.is_npm_main(), is_repl: matches!( options.sub_command(), DenoSubcommand::Repl(_) | DenoSubcommand::Jupyter(_) ), + cjs_tracker, code_cache, emitter, + fs, + in_npm_pkg_checker, main_module_graph_container, module_load_preparer, + node_code_translator, node_resolver, npm_resolver, npm_module_loader, @@ -259,19 +281,30 @@ impl CliModuleLoaderFactory { is_worker: bool, parent_permissions: PermissionsContainer, permissions: PermissionsContainer, - ) -> ModuleLoaderAndSourceMapGetter { - let loader = Rc::new(CliModuleLoader(Rc::new(CliModuleLoaderInner { - lib, - is_worker, - parent_permissions, - permissions, + ) -> CreateModuleLoaderResult { + let module_loader = + Rc::new(CliModuleLoader(Rc::new(CliModuleLoaderInner { + lib, + is_worker, + is_npm_main: self.shared.is_npm_main, + parent_permissions, + permissions, + graph_container: graph_container.clone(), + node_code_translator: self.shared.node_code_translator.clone(), + emitter: self.shared.emitter.clone(), + parsed_source_cache: self.shared.parsed_source_cache.clone(), + shared: self.shared.clone(), + }))); + let node_require_loader = Rc::new(CliNodeRequireLoader::new( + self.shared.emitter.clone(), + self.shared.fs.clone(), graph_container, - emitter: self.shared.emitter.clone(), - parsed_source_cache: self.shared.parsed_source_cache.clone(), - shared: self.shared.clone(), - }))); - ModuleLoaderAndSourceMapGetter { - module_loader: loader, + self.shared.in_npm_pkg_checker.clone(), + self.shared.npm_resolver.clone(), + )); + CreateModuleLoaderResult { + module_loader, + node_require_loader, } } } @@ -280,7 +313,7 @@ impl ModuleLoaderFactory for CliModuleLoaderFactory { fn create_for_main( &self, root_permissions: PermissionsContainer, - ) -> ModuleLoaderAndSourceMapGetter { + ) -> CreateModuleLoaderResult { self.create_with_lib( (*self.shared.main_module_graph_container).clone(), self.shared.lib_window, @@ -294,7 +327,7 @@ impl ModuleLoaderFactory for CliModuleLoaderFactory { &self, parent_permissions: PermissionsContainer, permissions: PermissionsContainer, - ) -> ModuleLoaderAndSourceMapGetter { + ) -> CreateModuleLoaderResult { self.create_with_lib( // create a fresh module graph for the worker WorkerModuleGraphContainer::new(Arc::new(ModuleGraph::new( @@ -310,6 +343,7 @@ impl ModuleLoaderFactory for CliModuleLoaderFactory { struct CliModuleLoaderInner { lib: TsTypeLib, + is_npm_main: bool, is_worker: bool, /// The initial set of permissions used to resolve the static imports in the /// worker. These are "allow all" for main worker, and parent thread @@ -318,6 +352,7 @@ struct CliModuleLoaderInner { permissions: PermissionsContainer, shared: Arc, emitter: Arc, + node_code_translator: Arc, parsed_source_cache: Arc, graph_container: TGraphContainer, } @@ -331,24 +366,7 @@ impl maybe_referrer: Option<&ModuleSpecifier>, requested_module_type: RequestedModuleType, ) -> Result { - let code_source = match self.load_prepared_module(specifier).await? { - Some(code_source) => code_source, - None => { - if self.shared.npm_module_loader.if_in_npm_package(specifier) { - self - .shared - .npm_module_loader - .load(specifier, maybe_referrer) - .await? - } else { - let mut msg = format!("Loading unprepared module: {specifier}"); - if let Some(referrer) = maybe_referrer { - msg = format!("{}, imported from: {}", msg, referrer.as_str()); - } - return Err(anyhow!(msg)); - } - } - }; + let code_source = self.load_code_source(specifier, maybe_referrer).await?; let code = if self.shared.is_inspecting { // we need the code with the source map in order for // it to work with --inspect or --inspect-brk @@ -402,6 +420,29 @@ impl )) } + async fn load_code_source( + &self, + specifier: &ModuleSpecifier, + maybe_referrer: Option<&ModuleSpecifier>, + ) -> Result { + if let Some(code_source) = self.load_prepared_module(specifier).await? { + return Ok(code_source); + } + if self.shared.node_resolver.in_npm_package(specifier) { + return self + .shared + .npm_module_loader + .load(specifier, maybe_referrer) + .await; + } + + let mut msg = format!("Loading unprepared module: {specifier}"); + if let Some(referrer) = maybe_referrer { + msg = format!("{}, imported from: {}", msg, referrer.as_str()); + } + Err(anyhow!(msg)) + } + fn resolve_referrer( &self, referrer: &str, @@ -474,15 +515,11 @@ impl if self.shared.is_repl { if let Ok(reference) = NpmPackageReqReference::from_specifier(&specifier) { - return self - .shared - .node_resolver - .resolve_req_reference( - &reference, - referrer, - NodeResolutionMode::Execution, - ) - .map(|res| res.into_url()); + return self.shared.node_resolver.resolve_req_reference( + &reference, + referrer, + NodeResolutionMode::Execution, + ); } } @@ -506,13 +543,15 @@ impl .with_context(|| { format!("Could not resolve '{}'.", module.nv_reference) })? - .into_url() } Some(Module::Node(module)) => module.specifier.clone(), Some(Module::Js(module)) => module.specifier.clone(), Some(Module::Json(module)) => module.specifier.clone(), Some(Module::External(module)) => { - node::resolve_specifier_into_node_modules(&module.specifier) + node::resolve_specifier_into_node_modules( + &module.specifier, + self.shared.fs.as_ref(), + ) } None => specifier.into_owned(), }; @@ -534,7 +573,7 @@ impl }) => { let transpile_result = self .emitter - .emit_parsed_source(specifier, media_type, source) + .emit_parsed_source(specifier, media_type, ModuleKind::Esm, source) .await?; // at this point, we no longer need the parsed source in memory, so free it @@ -547,11 +586,19 @@ impl media_type, })) } + Some(CodeOrDeferredEmit::Cjs { + specifier, + media_type, + source, + }) => self + .load_maybe_cjs(specifier, media_type, source) + .await + .map(Some), None => Ok(None), } } - fn load_prepared_module_sync( + fn load_prepared_module_for_source_map_sync( &self, specifier: &ModuleSpecifier, ) -> Result, AnyError> { @@ -564,9 +611,12 @@ impl media_type, source, }) => { - let transpile_result = self - .emitter - .emit_parsed_source_sync(specifier, media_type, source)?; + let transpile_result = self.emitter.emit_parsed_source_sync( + specifier, + media_type, + ModuleKind::Esm, + source, + )?; // at this point, we no longer need the parsed source in memory, so free it self.parsed_source_cache.free(specifier); @@ -578,6 +628,14 @@ impl media_type, })) } + Some(CodeOrDeferredEmit::Cjs { .. }) => { + self.parsed_source_cache.free(specifier); + + // todo(dsherret): to make this work, we should probably just + // rely on the CJS export cache. At the moment this is hard because + // cjs export analysis is only async + Ok(None) + } None => Ok(None), } } @@ -607,20 +665,40 @@ impl source, media_type, specifier, + is_script, .. })) => { + // todo(dsherret): revert in https://github.com/denoland/deno/pull/26439 + if self.is_npm_main && *is_script + || self.shared.cjs_tracker.is_cjs_with_known_is_script( + specifier, + *media_type, + *is_script, + )? + { + return Ok(Some(CodeOrDeferredEmit::Cjs { + specifier, + media_type: *media_type, + source, + })); + } let code: ModuleCodeString = match media_type { MediaType::JavaScript | MediaType::Unknown - | MediaType::Cjs | MediaType::Mjs | MediaType::Json => source.clone().into(), MediaType::Dts | MediaType::Dcts | MediaType::Dmts => { Default::default() } + MediaType::Cjs | MediaType::Cts => { + return Ok(Some(CodeOrDeferredEmit::Cjs { + specifier, + media_type: *media_type, + source, + })); + } MediaType::TypeScript | MediaType::Mts - | MediaType::Cts | MediaType::Jsx | MediaType::Tsx => { return Ok(Some(CodeOrDeferredEmit::DeferredEmit { @@ -629,7 +707,7 @@ impl source, })); } - MediaType::TsBuildInfo | MediaType::Wasm | MediaType::SourceMap => { + MediaType::Css | MediaType::Wasm | MediaType::SourceMap => { panic!("Unexpected media type {media_type} for {specifier}") } }; @@ -651,6 +729,48 @@ impl | None => Ok(None), } } + + async fn load_maybe_cjs( + &self, + specifier: &ModuleSpecifier, + media_type: MediaType, + original_source: &Arc, + ) -> Result { + let js_source = if media_type.is_emittable() { + Cow::Owned( + self + .emitter + .emit_parsed_source( + specifier, + media_type, + ModuleKind::Cjs, + original_source, + ) + .await?, + ) + } else { + Cow::Borrowed(original_source.as_ref()) + }; + let text = self + .node_code_translator + .translate_cjs_to_esm(specifier, Some(js_source)) + .await?; + // at this point, we no longer need the parsed source in memory, so free it + self.parsed_source_cache.free(specifier); + Ok(ModuleCodeStringSource { + code: match text { + // perf: if the text is borrowed, that means it didn't make any changes + // to the original source, so we can just provide that instead of cloning + // the borrowed text + Cow::Borrowed(_) => { + ModuleSourceCode::String(original_source.clone().into()) + } + Cow::Owned(text) => ModuleSourceCode::String(text.into()), + }, + found_url: specifier.clone(), + media_type, + }) + } } enum CodeOrDeferredEmit<'a> { @@ -660,6 +780,11 @@ enum CodeOrDeferredEmit<'a> { media_type: MediaType, source: &'a Arc, }, + Cjs { + specifier: &'a ModuleSpecifier, + media_type: MediaType, + source: &'a Arc, + }, } // todo(dsherret): this double Rc boxing is not ideal @@ -821,7 +946,10 @@ impl ModuleLoader "wasm" | "file" | "http" | "https" | "data" | "blob" => (), _ => return None, } - let source = self.0.load_prepared_module_sync(&specifier).ok()??; + let source = self + .0 + .load_prepared_module_for_source_map_sync(&specifier) + .ok()??; source_map_from_code(source.code.as_bytes()) } @@ -900,3 +1028,79 @@ impl ModuleGraphUpdatePermit for WorkerModuleGraphUpdatePermit { drop(self.permit); // explicit drop for clarity } } + +#[derive(Debug)] +struct CliNodeRequireLoader { + emitter: Arc, + fs: Arc, + graph_container: TGraphContainer, + in_npm_pkg_checker: Arc, + npm_resolver: Arc, +} + +impl + CliNodeRequireLoader +{ + pub fn new( + emitter: Arc, + fs: Arc, + graph_container: TGraphContainer, + in_npm_pkg_checker: Arc, + npm_resolver: Arc, + ) -> Self { + Self { + emitter, + fs, + graph_container, + in_npm_pkg_checker, + npm_resolver, + } + } +} + +impl NodeRequireLoader + for CliNodeRequireLoader +{ + fn ensure_read_permission<'a>( + &self, + permissions: &mut dyn deno_runtime::deno_node::NodePermissions, + path: &'a Path, + ) -> Result, AnyError> { + if let Ok(url) = deno_path_util::url_from_file_path(path) { + // allow reading if it's in the module graph + if self.graph_container.graph().get(&url).is_some() { + return Ok(std::borrow::Cow::Borrowed(path)); + } + } + self.npm_resolver.ensure_read_permission(permissions, path) + } + + fn load_text_file_lossy(&self, path: &Path) -> Result { + // todo(dsherret): use the preloaded module from the graph if available? + let media_type = MediaType::from_path(path); + let text = self.fs.read_text_file_lossy_sync(path, None)?; + if media_type.is_emittable() { + let specifier = deno_path_util::url_from_file_path(path)?; + if self.in_npm_pkg_checker.in_npm_package(&specifier) { + return Err( + NotSupportedKindInNpmError { + media_type, + specifier, + } + .into(), + ); + } + self.emitter.emit_parsed_source_sync( + &specifier, + media_type, + // this is probably not super accurate due to require esm, but probably ok. + // If we find this causes a lot of churn in the emit cache then we should + // investigate how we can make this better + ModuleKind::Cjs, + &text.into(), + ) + } else { + Ok(text) + } + } +} diff --git a/cli/node.rs b/cli/node.rs index 733d5f8717..1d410a726a 100644 --- a/cli/node.rs +++ b/cli/node.rs @@ -1,11 +1,14 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use std::borrow::Cow; use std::sync::Arc; use deno_ast::MediaType; use deno_ast::ModuleSpecifier; use deno_core::error::AnyError; use deno_graph::ParsedSourceStore; +use deno_path_util::url_from_file_path; +use deno_path_util::url_to_file_path; use deno_runtime::deno_fs; use deno_runtime::deno_node::DenoFsNodeResolverEnv; use node_resolver::analyze::CjsAnalysis as ExtNodeCjsAnalysis; @@ -18,8 +21,8 @@ use serde::Serialize; use crate::cache::CacheDBHash; use crate::cache::NodeAnalysisCache; use crate::cache::ParsedSourceCache; -use crate::resolver::CliNodeResolver; -use crate::util::fs::canonicalize_path_maybe_not_exists; +use crate::resolver::CjsTracker; +use crate::util::fs::canonicalize_path_maybe_not_exists_with_fs; pub type CliNodeCodeTranslator = NodeCodeTranslator; @@ -32,14 +35,14 @@ pub type CliNodeCodeTranslator = /// because the node_modules folder might not exist at that time. pub fn resolve_specifier_into_node_modules( specifier: &ModuleSpecifier, + fs: &dyn deno_fs::FileSystem, ) -> ModuleSpecifier { - specifier - .to_file_path() + url_to_file_path(specifier) .ok() // this path might not exist at the time the graph is being created // because the node_modules folder might not yet exist - .and_then(|path| canonicalize_path_maybe_not_exists(&path).ok()) - .and_then(|path| ModuleSpecifier::from_file_path(path).ok()) + .and_then(|path| canonicalize_path_maybe_not_exists_with_fs(&path, fs).ok()) + .and_then(|path| url_from_file_path(&path).ok()) .unwrap_or_else(|| specifier.clone()) } @@ -56,23 +59,29 @@ pub enum CliCjsAnalysis { pub struct CliCjsCodeAnalyzer { cache: NodeAnalysisCache, + cjs_tracker: Arc, fs: deno_fs::FileSystemRc, - node_resolver: Arc, parsed_source_cache: Option>, + // todo(dsherret): hack, remove in https://github.com/denoland/deno/pull/26439 + // For example, this does not properly handle if cjs analysis was already done + // and has been cached. + is_npm_main: bool, } impl CliCjsCodeAnalyzer { pub fn new( cache: NodeAnalysisCache, + cjs_tracker: Arc, fs: deno_fs::FileSystemRc, - node_resolver: Arc, parsed_source_cache: Option>, + is_npm_main: bool, ) -> Self { Self { cache, + cjs_tracker, fs, - node_resolver, parsed_source_cache, + is_npm_main, } } @@ -88,7 +97,7 @@ impl CliCjsCodeAnalyzer { return Ok(analysis); } - let mut media_type = MediaType::from_specifier(specifier); + let media_type = MediaType::from_specifier(specifier); if media_type == MediaType::Json { return Ok(CliCjsAnalysis::Cjs { exports: vec![], @@ -96,62 +105,53 @@ impl CliCjsCodeAnalyzer { }); } - if media_type == MediaType::JavaScript { - if let Some(package_json) = - self.node_resolver.get_closest_package_json(specifier)? - { - match package_json.typ.as_str() { - "commonjs" => { - media_type = MediaType::Cjs; - } - "module" => { - media_type = MediaType::Mjs; - } - _ => {} - } - } - } + let cjs_tracker = self.cjs_tracker.clone(); + let is_npm_main = self.is_npm_main; + let is_maybe_cjs = + cjs_tracker.is_maybe_cjs(specifier, media_type)? || is_npm_main; + let analysis = if is_maybe_cjs { + let maybe_parsed_source = self + .parsed_source_cache + .as_ref() + .and_then(|c| c.remove_parsed_source(specifier)); - let maybe_parsed_source = self - .parsed_source_cache - .as_ref() - .and_then(|c| c.remove_parsed_source(specifier)); - - let analysis = deno_core::unsync::spawn_blocking({ - let specifier = specifier.clone(); - let source: Arc = source.into(); - move || -> Result<_, deno_ast::ParseDiagnostic> { - let parsed_source = - maybe_parsed_source.map(Ok).unwrap_or_else(|| { - deno_ast::parse_program(deno_ast::ParseParams { - specifier, - text: source, - media_type, - capture_tokens: true, - scope_analysis: false, - maybe_syntax: None, + deno_core::unsync::spawn_blocking({ + let specifier = specifier.clone(); + let source: Arc = source.into(); + move || -> Result<_, AnyError> { + let parsed_source = + maybe_parsed_source.map(Ok).unwrap_or_else(|| { + deno_ast::parse_program(deno_ast::ParseParams { + specifier, + text: source, + media_type, + capture_tokens: true, + scope_analysis: false, + maybe_syntax: None, + }) + })?; + let is_script = parsed_source.compute_is_script(); + let is_cjs = cjs_tracker.is_cjs_with_known_is_script( + parsed_source.specifier(), + media_type, + is_script, + )? || is_script && is_npm_main; + if is_cjs { + let analysis = parsed_source.analyze_cjs(); + Ok(CliCjsAnalysis::Cjs { + exports: analysis.exports, + reexports: analysis.reexports, }) - })?; - if parsed_source.is_script() { - let analysis = parsed_source.analyze_cjs(); - Ok(CliCjsAnalysis::Cjs { - exports: analysis.exports, - reexports: analysis.reexports, - }) - } else if media_type == MediaType::Cjs { - // FIXME: `deno_ast` should internally handle MediaType::Cjs implying that - // the result must never be Esm - Ok(CliCjsAnalysis::Cjs { - exports: vec![], - reexports: vec![], - }) - } else { - Ok(CliCjsAnalysis::Esm) + } else { + Ok(CliCjsAnalysis::Esm) + } } - } - }) - .await - .unwrap()?; + }) + .await + .unwrap()? + } else { + CliCjsAnalysis::Esm + }; self .cache @@ -163,11 +163,11 @@ impl CliCjsCodeAnalyzer { #[async_trait::async_trait(?Send)] impl CjsCodeAnalyzer for CliCjsCodeAnalyzer { - async fn analyze_cjs( + async fn analyze_cjs<'a>( &self, specifier: &ModuleSpecifier, - source: Option, - ) -> Result { + source: Option>, + ) -> Result, AnyError> { let source = match source { Some(source) => source, None => { @@ -175,7 +175,7 @@ impl CjsCodeAnalyzer for CliCjsCodeAnalyzer { if let Ok(source_from_file) = self.fs.read_text_file_lossy_async(path, None).await { - source_from_file + Cow::Owned(source_from_file) } else { return Ok(ExtNodeCjsAnalysis::Cjs(CjsAnalysisExports { exports: vec![], diff --git a/cli/npm/byonm.rs b/cli/npm/byonm.rs index fc095ab16f..4535b07fc5 100644 --- a/cli/npm/byonm.rs +++ b/cli/npm/byonm.rs @@ -10,8 +10,8 @@ use deno_core::serde_json; use deno_core::url::Url; use deno_resolver::npm::ByonmNpmResolver; use deno_resolver::npm::ByonmNpmResolverCreateOptions; +use deno_runtime::deno_node::DenoFsNodeResolverEnv; use deno_runtime::deno_node::NodePermissions; -use deno_runtime::deno_node::NodeRequireResolver; use deno_runtime::ops::process::NpmProcessStateProvider; use deno_semver::package::PackageReq; use node_resolver::NpmResolver; @@ -25,30 +25,14 @@ use super::InnerCliNpmResolverRef; use super::ResolvePkgFolderFromDenoReqError; pub type CliByonmNpmResolverCreateOptions = - ByonmNpmResolverCreateOptions; -pub type CliByonmNpmResolver = ByonmNpmResolver; + ByonmNpmResolverCreateOptions; +pub type CliByonmNpmResolver = + ByonmNpmResolver; // todo(dsherret): the services hanging off `CliNpmResolver` doesn't seem ideal. We should probably decouple. #[derive(Debug)] struct CliByonmWrapper(Arc); -impl NodeRequireResolver for CliByonmWrapper { - fn ensure_read_permission<'a>( - &self, - permissions: &mut dyn NodePermissions, - path: &'a Path, - ) -> Result, AnyError> { - if !path - .components() - .any(|c| c.as_os_str().to_ascii_lowercase() == "node_modules") - { - permissions.check_read_path(path) - } else { - Ok(Cow::Borrowed(path)) - } - } -} - impl NpmProcessStateProvider for CliByonmWrapper { fn get_npm_process_state(&self) -> String { serde_json::to_string(&NpmProcessState { @@ -67,10 +51,6 @@ impl CliNpmResolver for CliByonmNpmResolver { self } - fn into_require_resolver(self: Arc) -> Arc { - Arc::new(CliByonmWrapper(self)) - } - fn into_process_state_provider( self: Arc, ) -> Arc { @@ -100,6 +80,21 @@ impl CliNpmResolver for CliByonmNpmResolver { .map_err(ResolvePkgFolderFromDenoReqError::Byonm) } + fn ensure_read_permission<'a>( + &self, + permissions: &mut dyn NodePermissions, + path: &'a Path, + ) -> Result, AnyError> { + if !path + .components() + .any(|c| c.as_os_str().to_ascii_lowercase() == "node_modules") + { + permissions.check_read_path(path) + } else { + Ok(Cow::Borrowed(path)) + } + } + fn check_state_hash(&self) -> Option { // it is very difficult to determine the check state hash for byonm // so we just return None to signify check caching is not supported diff --git a/cli/npm/managed/cache/mod.rs b/cli/npm/managed/cache/mod.rs index aaec486681..8ae99f41e0 100644 --- a/cli/npm/managed/cache/mod.rs +++ b/cli/npm/managed/cache/mod.rs @@ -36,7 +36,7 @@ pub use tarball::TarballCache; /// Stores a single copy of npm packages in a cache. #[derive(Debug)] pub struct NpmCache { - cache_dir: NpmCacheDir, + cache_dir: Arc, cache_setting: CacheSetting, npmrc: Arc, /// ensures a package is only downloaded once per run @@ -45,7 +45,7 @@ pub struct NpmCache { impl NpmCache { pub fn new( - cache_dir: NpmCacheDir, + cache_dir: Arc, cache_setting: CacheSetting, npmrc: Arc, ) -> Self { @@ -61,6 +61,10 @@ impl NpmCache { &self.cache_setting } + pub fn root_dir_path(&self) -> &Path { + self.cache_dir.root_dir() + } + pub fn root_dir_url(&self) -> &Url { self.cache_dir.root_dir_url() } @@ -152,10 +156,6 @@ impl NpmCache { self.cache_dir.package_name_folder(name, registry_url) } - pub fn root_folder(&self) -> PathBuf { - self.cache_dir.root_dir().to_owned() - } - pub fn resolve_package_folder_id_from_specifier( &self, specifier: &ModuleSpecifier, diff --git a/cli/npm/managed/mod.rs b/cli/npm/managed/mod.rs index a0754812bb..4a91bc3474 100644 --- a/cli/npm/managed/mod.rs +++ b/cli/npm/managed/mod.rs @@ -12,6 +12,7 @@ use deno_cache_dir::npm::NpmCacheDir; use deno_core::anyhow::Context; use deno_core::error::AnyError; use deno_core::serde_json; +use deno_core::url::Url; use deno_npm::npm_rc::ResolvedNpmRc; use deno_npm::registry::NpmPackageInfo; use deno_npm::registry::NpmRegistryApi; @@ -24,12 +25,12 @@ use deno_npm::NpmSystemInfo; use deno_runtime::colors; use deno_runtime::deno_fs::FileSystem; use deno_runtime::deno_node::NodePermissions; -use deno_runtime::deno_node::NodeRequireResolver; use deno_runtime::ops::process::NpmProcessStateProvider; use deno_semver::package::PackageNv; use deno_semver::package::PackageReq; use node_resolver::errors::PackageFolderResolveError; use node_resolver::errors::PackageFolderResolveIoError; +use node_resolver::InNpmPackageChecker; use node_resolver::NpmResolver; use resolution::AddPkgReqsResult; @@ -39,7 +40,6 @@ use crate::args::NpmInstallDepsProvider; use crate::args::NpmProcessState; use crate::args::NpmProcessStateKind; use crate::args::PackageJsonDepValueParseWithLocationError; -use crate::cache::DenoCacheEnvFsAdapter; use crate::cache::FastInsecureHasher; use crate::http_util::HttpClientProvider; use crate::util::fs::canonicalize_path_maybe_not_exists_with_fs; @@ -66,12 +66,12 @@ pub enum CliNpmResolverManagedSnapshotOption { Specified(Option), } -pub struct CliNpmResolverManagedCreateOptions { +pub struct CliManagedNpmResolverCreateOptions { pub snapshot: CliNpmResolverManagedSnapshotOption, pub maybe_lockfile: Option>, pub fs: Arc, pub http_client_provider: Arc, - pub npm_global_cache_dir: PathBuf, + pub npm_cache_dir: Arc, pub cache_setting: crate::args::CacheSetting, pub text_only_progress_bar: crate::util::progress_bar::ProgressBar, pub maybe_node_modules_path: Option, @@ -82,7 +82,7 @@ pub struct CliNpmResolverManagedCreateOptions { } pub async fn create_managed_npm_resolver_for_lsp( - options: CliNpmResolverManagedCreateOptions, + options: CliManagedNpmResolverCreateOptions, ) -> Arc { let npm_cache = create_cache(&options); let npm_api = create_api(&options, npm_cache.clone()); @@ -115,7 +115,7 @@ pub async fn create_managed_npm_resolver_for_lsp( } pub async fn create_managed_npm_resolver( - options: CliNpmResolverManagedCreateOptions, + options: CliManagedNpmResolverCreateOptions, ) -> Result, AnyError> { let npm_cache = create_cache(&options); let npm_api = create_api(&options, npm_cache.clone()); @@ -189,20 +189,16 @@ fn create_inner( )) } -fn create_cache(options: &CliNpmResolverManagedCreateOptions) -> Arc { +fn create_cache(options: &CliManagedNpmResolverCreateOptions) -> Arc { Arc::new(NpmCache::new( - NpmCacheDir::new( - &DenoCacheEnvFsAdapter(options.fs.as_ref()), - options.npm_global_cache_dir.clone(), - options.npmrc.get_all_known_registries_urls(), - ), + options.npm_cache_dir.clone(), options.cache_setting.clone(), options.npmrc.clone(), )) } fn create_api( - options: &CliNpmResolverManagedCreateOptions, + options: &CliManagedNpmResolverCreateOptions, npm_cache: Arc, ) -> Arc { Arc::new(CliNpmRegistryApi::new( @@ -259,6 +255,35 @@ async fn snapshot_from_lockfile( Ok(snapshot) } +#[derive(Debug)] +struct ManagedInNpmPackageChecker { + root_dir: Url, +} + +impl InNpmPackageChecker for ManagedInNpmPackageChecker { + fn in_npm_package(&self, specifier: &Url) -> bool { + specifier.as_ref().starts_with(self.root_dir.as_str()) + } +} + +pub struct CliManagedInNpmPkgCheckerCreateOptions<'a> { + pub root_cache_dir_url: &'a Url, + pub maybe_node_modules_path: Option<&'a Path>, +} + +pub fn create_managed_in_npm_pkg_checker( + options: CliManagedInNpmPkgCheckerCreateOptions, +) -> Arc { + let root_dir = match options.maybe_node_modules_path { + Some(node_modules_folder) => { + deno_path_util::url_from_directory_path(node_modules_folder).unwrap() + } + None => options.root_cache_dir_url.clone(), + }; + debug_assert!(root_dir.as_str().ends_with('/')); + Arc::new(ManagedInNpmPackageChecker { root_dir }) +} + /// An npm resolver where the resolution is managed by Deno rather than /// the user bringing their own node_modules (BYONM) on the file system. pub struct ManagedCliNpmResolver { @@ -555,8 +580,16 @@ impl ManagedCliNpmResolver { .map_err(|err| err.into()) } - pub fn global_cache_root_folder(&self) -> PathBuf { - self.npm_cache.root_folder() + pub fn maybe_node_modules_path(&self) -> Option<&Path> { + self.fs_resolver.node_modules_path() + } + + pub fn global_cache_root_path(&self) -> &Path { + self.npm_cache.root_dir_path() + } + + pub fn global_cache_root_url(&self) -> &Url { + self.npm_cache.root_dir_url() } } @@ -591,22 +624,6 @@ impl NpmResolver for ManagedCliNpmResolver { log::debug!("Resolved {} from {} to {}", name, referrer, path.display()); Ok(path) } - - fn in_npm_package(&self, specifier: &ModuleSpecifier) -> bool { - let root_dir_url = self.fs_resolver.root_dir_url(); - debug_assert!(root_dir_url.as_str().ends_with('/')); - specifier.as_ref().starts_with(root_dir_url.as_str()) - } -} - -impl NodeRequireResolver for ManagedCliNpmResolver { - fn ensure_read_permission<'a>( - &self, - permissions: &mut dyn NodePermissions, - path: &'a Path, - ) -> Result, AnyError> { - self.fs_resolver.ensure_read_permission(permissions, path) - } } impl NpmProcessStateProvider for ManagedCliNpmResolver { @@ -623,10 +640,6 @@ impl CliNpmResolver for ManagedCliNpmResolver { self } - fn into_require_resolver(self: Arc) -> Arc { - self - } - fn into_process_state_provider( self: Arc, ) -> Arc { @@ -687,6 +700,14 @@ impl CliNpmResolver for ManagedCliNpmResolver { .map_err(ResolvePkgFolderFromDenoReqError::Managed) } + fn ensure_read_permission<'a>( + &self, + permissions: &mut dyn NodePermissions, + path: &'a Path, + ) -> Result, AnyError> { + self.fs_resolver.ensure_read_permission(permissions, path) + } + fn check_state_hash(&self) -> Option { // We could go further and check all the individual // npm packages, but that's probably overkill. diff --git a/cli/npm/managed/resolvers/common.rs b/cli/npm/managed/resolvers/common.rs index 867bb4168a..590f8fb25c 100644 --- a/cli/npm/managed/resolvers/common.rs +++ b/cli/npm/managed/resolvers/common.rs @@ -17,7 +17,6 @@ use deno_core::anyhow::Context; use deno_core::error::AnyError; use deno_core::futures; use deno_core::futures::StreamExt; -use deno_core::url::Url; use deno_npm::NpmPackageCacheFolderId; use deno_npm::NpmPackageId; use deno_npm::NpmResolutionPackage; @@ -30,9 +29,6 @@ use crate::npm::managed::cache::TarballCache; /// Part of the resolution that interacts with the file system. #[async_trait(?Send)] pub trait NpmPackageFsResolver: Send + Sync { - /// Specifier for the root directory. - fn root_dir_url(&self) -> &Url; - /// The local node_modules folder if it is applicable to the implementation. fn node_modules_path(&self) -> Option<&Path>; diff --git a/cli/npm/managed/resolvers/global.rs b/cli/npm/managed/resolvers/global.rs index 5be315e992..f0193e78e9 100644 --- a/cli/npm/managed/resolvers/global.rs +++ b/cli/npm/managed/resolvers/global.rs @@ -11,7 +11,6 @@ use crate::colors; use async_trait::async_trait; use deno_ast::ModuleSpecifier; use deno_core::error::AnyError; -use deno_core::url::Url; use deno_npm::NpmPackageCacheFolderId; use deno_npm::NpmPackageId; use deno_npm::NpmResolutionPackage; @@ -56,7 +55,7 @@ impl GlobalNpmPackageResolver { Self { registry_read_permission_checker: RegistryReadPermissionChecker::new( fs, - cache.root_folder(), + cache.root_dir_path().to_path_buf(), ), cache, tarball_cache, @@ -69,10 +68,6 @@ impl GlobalNpmPackageResolver { #[async_trait(?Send)] impl NpmPackageFsResolver for GlobalNpmPackageResolver { - fn root_dir_url(&self) -> &Url { - self.cache.root_dir_url() - } - fn node_modules_path(&self) -> Option<&Path> { None } diff --git a/cli/npm/managed/resolvers/local.rs b/cli/npm/managed/resolvers/local.rs index 54f7576ade..0968be8a7e 100644 --- a/cli/npm/managed/resolvers/local.rs +++ b/cli/npm/managed/resolvers/local.rs @@ -155,10 +155,6 @@ impl LocalNpmPackageResolver { #[async_trait(?Send)] impl NpmPackageFsResolver for LocalNpmPackageResolver { - fn root_dir_url(&self) -> &Url { - &self.root_node_modules_url - } - fn node_modules_path(&self) -> Option<&Path> { Some(self.root_node_modules_path.as_ref()) } diff --git a/cli/npm/mod.rs b/cli/npm/mod.rs index 3971b1a0b3..0d434ca27f 100644 --- a/cli/npm/mod.rs +++ b/cli/npm/mod.rs @@ -4,6 +4,7 @@ mod byonm; mod common; mod managed; +use std::borrow::Cow; use std::path::Path; use std::path::PathBuf; use std::sync::Arc; @@ -15,13 +16,16 @@ use deno_core::error::AnyError; use deno_core::serde_json; use deno_npm::npm_rc::ResolvedNpmRc; use deno_npm::registry::NpmPackageInfo; +use deno_resolver::npm::ByonmInNpmPackageChecker; use deno_resolver::npm::ByonmNpmResolver; use deno_resolver::npm::ByonmResolvePkgFolderFromDenoReqError; -use deno_runtime::deno_node::NodeRequireResolver; +use deno_runtime::deno_node::NodePermissions; use deno_runtime::ops::process::NpmProcessStateProvider; use deno_semver::package::PackageNv; use deno_semver::package::PackageReq; use managed::cache::registry_info::get_package_url; +use managed::create_managed_in_npm_pkg_checker; +use node_resolver::InNpmPackageChecker; use node_resolver::NpmResolver; use thiserror::Error; @@ -29,7 +33,8 @@ use crate::file_fetcher::FileFetcher; pub use self::byonm::CliByonmNpmResolver; pub use self::byonm::CliByonmNpmResolverCreateOptions; -pub use self::managed::CliNpmResolverManagedCreateOptions; +pub use self::managed::CliManagedInNpmPkgCheckerCreateOptions; +pub use self::managed::CliManagedNpmResolverCreateOptions; pub use self::managed::CliNpmResolverManagedSnapshotOption; pub use self::managed::ManagedCliNpmResolver; @@ -42,7 +47,7 @@ pub enum ResolvePkgFolderFromDenoReqError { } pub enum CliNpmResolverCreateOptions { - Managed(CliNpmResolverManagedCreateOptions), + Managed(CliManagedNpmResolverCreateOptions), Byonm(CliByonmNpmResolverCreateOptions), } @@ -68,6 +73,22 @@ pub async fn create_cli_npm_resolver( } } +pub enum CreateInNpmPkgCheckerOptions<'a> { + Managed(CliManagedInNpmPkgCheckerCreateOptions<'a>), + Byonm, +} + +pub fn create_in_npm_pkg_checker( + options: CreateInNpmPkgCheckerOptions, +) -> Arc { + match options { + CreateInNpmPkgCheckerOptions::Managed(options) => { + create_managed_in_npm_pkg_checker(options) + } + CreateInNpmPkgCheckerOptions::Byonm => Arc::new(ByonmInNpmPackageChecker), + } +} + pub enum InnerCliNpmResolverRef<'a> { Managed(&'a ManagedCliNpmResolver), #[allow(dead_code)] @@ -76,7 +97,6 @@ pub enum InnerCliNpmResolverRef<'a> { pub trait CliNpmResolver: NpmResolver { fn into_npm_resolver(self: Arc) -> Arc; - fn into_require_resolver(self: Arc) -> Arc; fn into_process_state_provider( self: Arc, ) -> Arc; @@ -107,6 +127,12 @@ pub trait CliNpmResolver: NpmResolver { referrer: &ModuleSpecifier, ) -> Result; + fn ensure_read_permission<'a>( + &self, + permissions: &mut dyn NodePermissions, + path: &'a Path, + ) -> Result, AnyError>; + /// Returns a hash returning the state of the npm resolver /// or `None` if the state currently can't be determined. fn check_state_hash(&self) -> Option; diff --git a/cli/resolver.rs b/cli/resolver.rs index 84c671268a..710b975093 100644 --- a/cli/resolver.rs +++ b/cli/resolver.rs @@ -4,6 +4,7 @@ use async_trait::async_trait; use dashmap::DashMap; use dashmap::DashSet; use deno_ast::MediaType; +use deno_ast::ModuleKind; use deno_config::workspace::MappedResolution; use deno_config::workspace::MappedResolutionDiagnostic; use deno_config::workspace::MappedResolutionError; @@ -11,6 +12,7 @@ use deno_config::workspace::WorkspaceResolver; use deno_core::anyhow::anyhow; use deno_core::anyhow::Context; use deno_core::error::AnyError; +use deno_core::url::Url; use deno_core::ModuleSourceCode; use deno_core::ModuleSpecifier; use deno_graph::source::ResolutionMode; @@ -29,6 +31,7 @@ use deno_runtime::deno_fs; use deno_runtime::deno_fs::FileSystem; use deno_runtime::deno_node::is_builtin_node_module; use deno_runtime::deno_node::NodeResolver; +use deno_runtime::deno_node::PackageJsonResolver; use deno_semver::npm::NpmPackageReqReference; use deno_semver::package::PackageReq; use node_resolver::errors::ClosestPkgJsonError; @@ -38,21 +41,22 @@ use node_resolver::errors::PackageFolderResolveErrorKind; use node_resolver::errors::PackageFolderResolveIoError; use node_resolver::errors::PackageNotFoundError; use node_resolver::errors::PackageResolveErrorKind; -use node_resolver::errors::UrlToNodeResolutionError; +use node_resolver::errors::PackageSubpathResolveError; +use node_resolver::InNpmPackageChecker; use node_resolver::NodeModuleKind; use node_resolver::NodeResolution; use node_resolver::NodeResolutionMode; -use node_resolver::PackageJson; +use std::borrow::Cow; use std::path::Path; use std::path::PathBuf; use std::sync::Arc; +use thiserror::Error; use crate::args::JsxImportSourceConfig; use crate::args::DENO_DISABLE_PEDANTIC_NODE_WARNINGS; use crate::node::CliNodeCodeTranslator; use crate::npm::CliNpmResolver; use crate::npm::InnerCliNpmResolverRef; -use crate::util::path::specifier_has_extension; use crate::util::sync::AtomicFlag; use crate::util::text_encoding::from_utf8_lossy_owned; @@ -104,36 +108,32 @@ impl deno_resolver::fs::DenoResolverFs for CliDenoResolverFs { #[derive(Debug)] pub struct CliNodeResolver { - cjs_resolutions: Arc, + cjs_tracker: Arc, fs: Arc, + in_npm_pkg_checker: Arc, node_resolver: Arc, npm_resolver: Arc, } impl CliNodeResolver { pub fn new( - cjs_resolutions: Arc, + cjs_tracker: Arc, fs: Arc, + in_npm_pkg_checker: Arc, node_resolver: Arc, npm_resolver: Arc, ) -> Self { Self { - cjs_resolutions, + cjs_tracker, fs, + in_npm_pkg_checker, node_resolver, npm_resolver, } } pub fn in_npm_package(&self, specifier: &ModuleSpecifier) -> bool { - self.npm_resolver.in_npm_package(specifier) - } - - pub fn get_closest_package_json( - &self, - referrer: &ModuleSpecifier, - ) -> Result>, ClosestPkgJsonError> { - self.node_resolver.get_closest_package_json(referrer) + self.in_npm_pkg_checker.in_npm_package(specifier) } pub fn resolve_if_for_npm_pkg( @@ -153,8 +153,7 @@ impl CliNodeResolver { | NodeResolveErrorKind::UnsupportedEsmUrlScheme(_) | NodeResolveErrorKind::DataUrlReferrer(_) | NodeResolveErrorKind::TypesNotFound(_) - | NodeResolveErrorKind::FinalizeResolution(_) - | NodeResolveErrorKind::UrlToNodeResolution(_) => Err(err.into()), + | NodeResolveErrorKind::FinalizeResolution(_) => Err(err.into()), NodeResolveErrorKind::PackageResolve(err) => { let err = err.into_kind(); match err { @@ -216,7 +215,11 @@ impl CliNodeResolver { referrer: &ModuleSpecifier, mode: NodeResolutionMode, ) -> Result { - let referrer_kind = if self.cjs_resolutions.is_known_cjs(referrer) { + let referrer_kind = if self + .cjs_tracker + .is_maybe_cjs(referrer, MediaType::from_specifier(referrer)) + .map_err(|err| NodeResolveErrorKind::PackageResolve(err.into()))? + { NodeModuleKind::Cjs } else { NodeModuleKind::Esm @@ -226,7 +229,7 @@ impl CliNodeResolver { self .node_resolver .resolve(specifier, referrer, referrer_kind, mode)?; - Ok(self.handle_node_resolution(res)) + Ok(res) } pub fn resolve_req_reference( @@ -234,7 +237,7 @@ impl CliNodeResolver { req_ref: &NpmPackageReqReference, referrer: &ModuleSpecifier, mode: NodeResolutionMode, - ) -> Result { + ) -> Result { self.resolve_req_with_sub_path( req_ref.req(), req_ref.sub_path(), @@ -249,7 +252,7 @@ impl CliNodeResolver { sub_path: Option<&str>, referrer: &ModuleSpecifier, mode: NodeResolutionMode, - ) -> Result { + ) -> Result { let package_folder = self .npm_resolver .resolve_pkg_folder_from_deno_module_req(req, referrer)?; @@ -260,7 +263,7 @@ impl CliNodeResolver { mode, ); match resolution_result { - Ok(resolution) => Ok(resolution), + Ok(url) => Ok(url), Err(err) => { if self.npm_resolver.as_byonm().is_some() { let package_json_path = package_folder.join("package.json"); @@ -271,7 +274,7 @@ impl CliNodeResolver { )); } } - Err(err) + Err(err.into()) } } } @@ -282,16 +285,13 @@ impl CliNodeResolver { sub_path: Option<&str>, maybe_referrer: Option<&ModuleSpecifier>, mode: NodeResolutionMode, - ) -> Result { - let res = self - .node_resolver - .resolve_package_subpath_from_deno_module( - package_folder, - sub_path, - maybe_referrer, - mode, - )?; - Ok(self.handle_node_resolution(res)) + ) -> Result { + self.node_resolver.resolve_package_subpath_from_deno_module( + package_folder, + sub_path, + maybe_referrer, + mode, + ) } pub fn handle_if_in_node_modules( @@ -306,71 +306,45 @@ impl CliNodeResolver { // so canoncalize then check if it's in the node_modules directory. // If so, check if we need to store this specifier as being a CJS // resolution. - let specifier = - crate::node::resolve_specifier_into_node_modules(specifier); - if self.in_npm_package(&specifier) { - let resolution = - self.node_resolver.url_to_node_resolution(specifier)?; - let resolution = self.handle_node_resolution(resolution); - return Ok(Some(resolution.into_url())); - } + let specifier = crate::node::resolve_specifier_into_node_modules( + specifier, + self.fs.as_ref(), + ); + return Ok(Some(specifier)); } Ok(None) } - - pub fn url_to_node_resolution( - &self, - specifier: ModuleSpecifier, - ) -> Result { - self.node_resolver.url_to_node_resolution(specifier) - } - - fn handle_node_resolution( - &self, - resolution: NodeResolution, - ) -> NodeResolution { - if let NodeResolution::CommonJs(specifier) = &resolution { - // remember that this was a common js resolution - self.mark_cjs_resolution(specifier.clone()); - } - resolution - } - - pub fn mark_cjs_resolution(&self, specifier: ModuleSpecifier) { - self.cjs_resolutions.insert(specifier); - } } -// todo(dsherret): move to module_loader.rs +#[derive(Debug, Error)] +#[error("{media_type} files are not supported in npm packages: {specifier}")] +pub struct NotSupportedKindInNpmError { + pub media_type: MediaType, + pub specifier: Url, +} + +// todo(dsherret): move to module_loader.rs (it seems to be here due to use in standalone) #[derive(Clone)] pub struct NpmModuleLoader { - cjs_resolutions: Arc, - node_code_translator: Arc, + cjs_tracker: Arc, fs: Arc, - node_resolver: Arc, + node_code_translator: Arc, } impl NpmModuleLoader { pub fn new( - cjs_resolutions: Arc, - node_code_translator: Arc, + cjs_tracker: Arc, fs: Arc, - node_resolver: Arc, + node_code_translator: Arc, ) -> Self { Self { - cjs_resolutions, + cjs_tracker, node_code_translator, fs, - node_resolver, } } - pub fn if_in_npm_package(&self, specifier: &ModuleSpecifier) -> bool { - self.node_resolver.in_npm_package(specifier) - || self.cjs_resolutions.is_known_cjs(specifier) - } - pub async fn load( &self, specifier: &ModuleSpecifier, @@ -413,20 +387,30 @@ impl NpmModuleLoader { } })?; - let code = if self.cjs_resolutions.is_known_cjs(specifier) { + let media_type = MediaType::from_specifier(specifier); + if media_type.is_emittable() { + return Err(AnyError::from(NotSupportedKindInNpmError { + media_type, + specifier: specifier.clone(), + })); + } + + let code = if self.cjs_tracker.is_maybe_cjs(specifier, media_type)? { // translate cjs to esm if it's cjs and inject node globals let code = from_utf8_lossy_owned(code); ModuleSourceCode::String( self .node_code_translator - .translate_cjs_to_esm(specifier, Some(code)) + .translate_cjs_to_esm(specifier, Some(Cow::Owned(code))) .await? + .into_owned() .into(), ) } else { // esm and json code is untouched ModuleSourceCode::Bytes(code.into_boxed_slice().into()) }; + Ok(ModuleCodeStringSource { code, found_url: specifier.clone(), @@ -435,21 +419,165 @@ impl NpmModuleLoader { } } +pub struct CjsTrackerOptions { + pub unstable_detect_cjs: bool, +} + /// Keeps track of what module specifiers were resolved as CJS. -#[derive(Debug, Default)] -pub struct CjsResolutionStore(DashSet); +/// +/// Modules that are `.js` or `.ts` are only known to be CJS or +/// ESM after they're loaded based on their contents. So these files +/// will be "maybe CJS" until they're loaded. +#[derive(Debug)] +pub struct CjsTracker { + in_npm_pkg_checker: Arc, + pkg_json_resolver: Arc, + unstable_detect_cjs: bool, + known: DashMap, +} -impl CjsResolutionStore { - pub fn is_known_cjs(&self, specifier: &ModuleSpecifier) -> bool { - if specifier.scheme() != "file" { - return false; +impl CjsTracker { + pub fn new( + in_npm_pkg_checker: Arc, + pkg_json_resolver: Arc, + options: CjsTrackerOptions, + ) -> Self { + Self { + in_npm_pkg_checker, + pkg_json_resolver, + unstable_detect_cjs: options.unstable_detect_cjs, + known: Default::default(), } - - specifier_has_extension(specifier, "cjs") || self.0.contains(specifier) } - pub fn insert(&self, specifier: ModuleSpecifier) { - self.0.insert(specifier); + /// Checks whether the file might be treated as CJS, but it's not for sure + /// yet because the source hasn't been loaded to see whether it contains + /// imports or exports. + pub fn is_maybe_cjs( + &self, + specifier: &ModuleSpecifier, + media_type: MediaType, + ) -> Result { + self.treat_as_cjs_with_is_script(specifier, media_type, None) + } + + /// Gets whether the file is CJS. If true, this is for sure + /// cjs because `is_script` is provided. + /// + /// `is_script` should be `true` when the contents of the file at the + /// provided specifier are known to be a script and not an ES module. + pub fn is_cjs_with_known_is_script( + &self, + specifier: &ModuleSpecifier, + media_type: MediaType, + is_script: bool, + ) -> Result { + self.treat_as_cjs_with_is_script(specifier, media_type, Some(is_script)) + } + + fn treat_as_cjs_with_is_script( + &self, + specifier: &ModuleSpecifier, + media_type: MediaType, + is_script: Option, + ) -> Result { + let kind = match self + .get_known_kind_with_is_script(specifier, media_type, is_script) + { + Some(kind) => kind, + None => self.check_based_on_pkg_json(specifier)?, + }; + Ok(kind.is_cjs()) + } + + pub fn get_known_kind( + &self, + specifier: &ModuleSpecifier, + media_type: MediaType, + ) -> Option { + self.get_known_kind_with_is_script(specifier, media_type, None) + } + + fn get_known_kind_with_is_script( + &self, + specifier: &ModuleSpecifier, + media_type: MediaType, + is_script: Option, + ) -> Option { + if specifier.scheme() != "file" { + return Some(ModuleKind::Esm); + } + + match media_type { + MediaType::Mts | MediaType::Mjs | MediaType::Dmts => Some(ModuleKind::Esm), + MediaType::Cjs | MediaType::Cts | MediaType::Dcts => Some(ModuleKind::Cjs), + MediaType::Dts => { + // dts files are always determined based on the package.json because + // they contain imports/exports even when considered CJS + if let Some(value) = self.known.get(specifier).map(|v| *v) { + Some(value) + } else { + let value = self.check_based_on_pkg_json(specifier).ok(); + if let Some(value) = value { + self.known.insert(specifier.clone(), value); + } + Some(value.unwrap_or(ModuleKind::Esm)) + } + } + MediaType::Wasm | + MediaType::Json => Some(ModuleKind::Esm), + MediaType::JavaScript + | MediaType::Jsx + | MediaType::TypeScript + | MediaType::Tsx + // treat these as unknown + | MediaType::Css + | MediaType::SourceMap + | MediaType::Unknown => { + if let Some(value) = self.known.get(specifier).map(|v| *v) { + if value.is_cjs() && is_script == Some(false) { + // we now know this is actually esm + self.known.insert(specifier.clone(), ModuleKind::Esm); + Some(ModuleKind::Esm) + } else { + Some(value) + } + } else if is_script == Some(false) { + // we know this is esm + self.known.insert(specifier.clone(), ModuleKind::Esm); + Some(ModuleKind::Esm) + } else { + None + } + } + } + } + + fn check_based_on_pkg_json( + &self, + specifier: &ModuleSpecifier, + ) -> Result { + if self.in_npm_pkg_checker.in_npm_package(specifier) { + if let Some(pkg_json) = + self.pkg_json_resolver.get_closest_package_json(specifier)? + { + let is_file_location_cjs = pkg_json.typ != "module"; + Ok(ModuleKind::from_is_cjs(is_file_location_cjs)) + } else { + Ok(ModuleKind::Cjs) + } + } else if self.unstable_detect_cjs { + if let Some(pkg_json) = + self.pkg_json_resolver.get_closest_package_json(specifier)? + { + let is_cjs_type = pkg_json.typ == "commonjs"; + Ok(ModuleKind::from_is_cjs(is_cjs_type)) + } else { + Ok(ModuleKind::Esm) + } + } else { + Ok(ModuleKind::Esm) + } } } @@ -633,8 +761,7 @@ impl Resolver for CliGraphResolver { Some(referrer), to_node_mode(mode), ) - .map_err(ResolveError::Other) - .map(|res| res.into_url()), + .map_err(|e| ResolveError::Other(e.into())), MappedResolution::PackageJson { dep_result, alias, @@ -665,19 +792,17 @@ impl Resolver for CliGraphResolver { ) .map_err(|e| ResolveError::Other(e.into())) .and_then(|pkg_folder| { - Ok( - self - .node_resolver - .as_ref() - .unwrap() - .resolve_package_sub_path_from_deno_module( - pkg_folder, - sub_path.as_deref(), - Some(referrer), - to_node_mode(mode), - )? - .into_url(), - ) + self + .node_resolver + .as_ref() + .unwrap() + .resolve_package_sub_path_from_deno_module( + pkg_folder, + sub_path.as_deref(), + Some(referrer), + to_node_mode(mode), + ) + .map_err(|e| ResolveError::Other(e.into())) }), }) } @@ -717,23 +842,20 @@ impl Resolver for CliGraphResolver { npm_req_ref.req(), ) { - return Ok( - node_resolver - .resolve_package_sub_path_from_deno_module( - pkg_folder, - npm_req_ref.sub_path(), - Some(referrer), - to_node_mode(mode), - )? - .into_url(), - ); + return node_resolver + .resolve_package_sub_path_from_deno_module( + pkg_folder, + npm_req_ref.sub_path(), + Some(referrer), + to_node_mode(mode), + ) + .map_err(|e| ResolveError::Other(e.into())); } // do npm resolution for byonm if is_byonm { return node_resolver .resolve_req_reference(&npm_req_ref, referrer, to_node_mode(mode)) - .map(|res| res.into_url()) .map_err(|err| err.into()); } } @@ -751,9 +873,7 @@ impl Resolver for CliGraphResolver { .map_err(ResolveError::Other)?; if let Some(res) = maybe_resolution { match res { - NodeResolution::Esm(url) | NodeResolution::CommonJs(url) => { - return Ok(url) - } + NodeResolution::Module(url) => return Ok(url), NodeResolution::BuiltIn(_) => { // don't resolve bare specifiers for built-in modules via node resolution } diff --git a/cli/standalone/binary.rs b/cli/standalone/binary.rs index f41f3003ff..9e26512268 100644 --- a/cli/standalone/binary.rs +++ b/cli/standalone/binary.rs @@ -21,6 +21,7 @@ use std::process::Command; use std::sync::Arc; use deno_ast::MediaType; +use deno_ast::ModuleKind; use deno_ast::ModuleSpecifier; use deno_config::workspace::PackageJsonDepResolution; use deno_config::workspace::ResolverWorkspaceJsrPackage; @@ -67,6 +68,7 @@ use crate::file_fetcher::FileFetcher; use crate::http_util::HttpClientProvider; use crate::npm::CliNpmResolver; use crate::npm::InnerCliNpmResolverRef; +use crate::resolver::CjsTracker; use crate::shared::ReleaseChannel; use crate::standalone::virtual_fs::VfsEntry; use crate::util::archive; @@ -257,6 +259,10 @@ impl StandaloneModules { } } + pub fn has_file(&self, path: &Path) -> bool { + self.vfs.file_entry(path).is_ok() + } + pub fn read<'a>( &'a self, specifier: &'a ModuleSpecifier, @@ -353,6 +359,7 @@ pub fn extract_standalone( } pub struct DenoCompileBinaryWriter<'a> { + cjs_tracker: &'a CjsTracker, deno_dir: &'a DenoDir, emitter: &'a Emitter, file_fetcher: &'a FileFetcher, @@ -365,6 +372,7 @@ pub struct DenoCompileBinaryWriter<'a> { impl<'a> DenoCompileBinaryWriter<'a> { #[allow(clippy::too_many_arguments)] pub fn new( + cjs_tracker: &'a CjsTracker, deno_dir: &'a DenoDir, emitter: &'a Emitter, file_fetcher: &'a FileFetcher, @@ -374,6 +382,7 @@ impl<'a> DenoCompileBinaryWriter<'a> { npm_system_info: NpmSystemInfo, ) -> Self { Self { + cjs_tracker, deno_dir, emitter, file_fetcher, @@ -599,19 +608,21 @@ impl<'a> DenoCompileBinaryWriter<'a> { } let (maybe_source, media_type) = match module { deno_graph::Module::Js(m) => { - // todo(https://github.com/denoland/deno_media_type/pull/12): use is_emittable() - let is_emittable = matches!( - m.media_type, - MediaType::TypeScript - | MediaType::Mts - | MediaType::Cts - | MediaType::Jsx - | MediaType::Tsx - ); - let source = if is_emittable { + let source = if m.media_type.is_emittable() { + let is_cjs = self.cjs_tracker.is_cjs_with_known_is_script( + &m.specifier, + m.media_type, + m.is_script, + )?; + let module_kind = ModuleKind::from_is_cjs(is_cjs); let source = self .emitter - .emit_parsed_source(&m.specifier, m.media_type, &m.source) + .emit_parsed_source( + &m.specifier, + m.media_type, + module_kind, + &m.source, + ) .await?; source.into_bytes() } else { @@ -745,8 +756,9 @@ impl<'a> DenoCompileBinaryWriter<'a> { } else { // DO NOT include the user's registry url as it may contain credentials, // but also don't make this dependent on the registry url - let global_cache_root_path = npm_resolver.global_cache_root_folder(); - let mut builder = VfsBuilder::new(global_cache_root_path)?; + let global_cache_root_path = npm_resolver.global_cache_root_path(); + let mut builder = + VfsBuilder::new(global_cache_root_path.to_path_buf())?; let mut packages = npm_resolver.all_system_packages(&self.npm_system_info); packages.sort_by(|a, b| a.id.cmp(&b.id)); // determinism diff --git a/cli/standalone/mod.rs b/cli/standalone/mod.rs index 3a62b6ff96..85610f4c20 100644 --- a/cli/standalone/mod.rs +++ b/cli/standalone/mod.rs @@ -19,6 +19,7 @@ use deno_core::error::type_error; use deno_core::error::AnyError; use deno_core::futures::FutureExt; use deno_core::v8_set_flags; +use deno_core::FastString; use deno_core::FeatureChecker; use deno_core::ModuleLoader; use deno_core::ModuleSourceCode; @@ -30,7 +31,9 @@ use deno_npm::npm_rc::ResolvedNpmRc; use deno_package_json::PackageJsonDepValue; use deno_runtime::deno_fs; use deno_runtime::deno_node::create_host_defined_options; +use deno_runtime::deno_node::NodeRequireLoader; use deno_runtime::deno_node::NodeResolver; +use deno_runtime::deno_node::PackageJsonResolver; use deno_runtime::deno_permissions::Permissions; use deno_runtime::deno_permissions::PermissionsContainer; use deno_runtime::deno_tls::rustls::RootCertStore; @@ -43,6 +46,7 @@ use deno_semver::npm::NpmPackageReqReference; use import_map::parse_from_json; use node_resolver::analyze::NodeCodeTranslator; use node_resolver::NodeResolutionMode; +use serialization::DenoCompileModuleSource; use std::borrow::Cow; use std::rc::Rc; use std::sync::Arc; @@ -61,12 +65,18 @@ use crate::cache::NodeAnalysisCache; use crate::cache::RealDenoCacheEnv; use crate::http_util::HttpClientProvider; use crate::node::CliCjsCodeAnalyzer; +use crate::node::CliNodeCodeTranslator; use crate::npm::create_cli_npm_resolver; +use crate::npm::create_in_npm_pkg_checker; use crate::npm::CliByonmNpmResolverCreateOptions; +use crate::npm::CliManagedInNpmPkgCheckerCreateOptions; +use crate::npm::CliManagedNpmResolverCreateOptions; +use crate::npm::CliNpmResolver; use crate::npm::CliNpmResolverCreateOptions; -use crate::npm::CliNpmResolverManagedCreateOptions; use crate::npm::CliNpmResolverManagedSnapshotOption; -use crate::resolver::CjsResolutionStore; +use crate::npm::CreateInNpmPkgCheckerOptions; +use crate::resolver::CjsTracker; +use crate::resolver::CjsTrackerOptions; use crate::resolver::CliDenoResolverFs; use crate::resolver::CliNodeResolver; use crate::resolver::NpmModuleLoader; @@ -75,7 +85,7 @@ use crate::util::progress_bar::ProgressBarStyle; use crate::util::v8::construct_v8_flags; use crate::worker::CliMainWorkerFactory; use crate::worker::CliMainWorkerOptions; -use crate::worker::ModuleLoaderAndSourceMapGetter; +use crate::worker::CreateModuleLoaderResult; use crate::worker::ModuleLoaderFactory; pub mod binary; @@ -91,10 +101,14 @@ use self::binary::Metadata; use self::file_system::DenoCompileFileSystem; struct SharedModuleLoaderState { + cjs_tracker: Arc, + fs: Arc, modules: StandaloneModules, - workspace_resolver: WorkspaceResolver, + node_code_translator: Arc, node_resolver: Arc, npm_module_loader: Arc, + npm_resolver: Arc, + workspace_resolver: WorkspaceResolver, } #[derive(Clone)] @@ -102,6 +116,12 @@ struct EmbeddedModuleLoader { shared: Arc, } +impl std::fmt::Debug for EmbeddedModuleLoader { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("EmbeddedModuleLoader").finish() + } +} + pub const MODULE_NOT_FOUND: &str = "Module not found"; pub const UNSUPPORTED_SCHEME: &str = "Unsupported scheme"; @@ -159,8 +179,7 @@ impl ModuleLoader for EmbeddedModuleLoader { sub_path.as_deref(), Some(&referrer), NodeResolutionMode::Execution, - )? - .into_url(), + )?, ), Ok(MappedResolution::PackageJson { dep_result, @@ -168,16 +187,14 @@ impl ModuleLoader for EmbeddedModuleLoader { alias, .. }) => match dep_result.as_ref().map_err(|e| AnyError::from(e.clone()))? { - PackageJsonDepValue::Req(req) => self - .shared - .node_resolver - .resolve_req_with_sub_path( + PackageJsonDepValue::Req(req) => { + self.shared.node_resolver.resolve_req_with_sub_path( req, sub_path.as_deref(), &referrer, NodeResolutionMode::Execution, ) - .map(|res| res.into_url()), + } PackageJsonDepValue::Workspace(version_req) => { let pkg_folder = self .shared @@ -195,8 +212,7 @@ impl ModuleLoader for EmbeddedModuleLoader { sub_path.as_deref(), Some(&referrer), NodeResolutionMode::Execution, - )? - .into_url(), + )?, ) } }, @@ -205,15 +221,11 @@ impl ModuleLoader for EmbeddedModuleLoader { if let Ok(reference) = NpmPackageReqReference::from_specifier(&specifier) { - return self - .shared - .node_resolver - .resolve_req_reference( - &reference, - &referrer, - NodeResolutionMode::Execution, - ) - .map(|res| res.into_url()); + return self.shared.node_resolver.resolve_req_reference( + &reference, + &referrer, + NodeResolutionMode::Execution, + ); } if specifier.scheme() == "jsr" { @@ -317,17 +329,72 @@ impl ModuleLoader for EmbeddedModuleLoader { match self.shared.modules.read(original_specifier) { Ok(Some(module)) => { + let media_type = module.media_type; let (module_specifier, module_type, module_source) = - module.into_for_v8(); - deno_core::ModuleLoadResponse::Sync(Ok( - deno_core::ModuleSource::new_with_redirect( - module_type, - module_source, - original_specifier, - module_specifier, - None, - ), - )) + module.into_parts(); + let is_maybe_cjs = match self + .shared + .cjs_tracker + .is_maybe_cjs(original_specifier, media_type) + { + Ok(is_maybe_cjs) => is_maybe_cjs, + Err(err) => { + return deno_core::ModuleLoadResponse::Sync(Err(type_error( + format!("{:?}", err), + ))); + } + }; + if is_maybe_cjs { + let original_specifier = original_specifier.clone(); + let module_specifier = module_specifier.clone(); + let shared = self.shared.clone(); + deno_core::ModuleLoadResponse::Async( + async move { + let source = match module_source { + DenoCompileModuleSource::String(string) => { + Cow::Borrowed(string) + } + DenoCompileModuleSource::Bytes(module_code_bytes) => { + match module_code_bytes { + Cow::Owned(bytes) => Cow::Owned( + crate::util::text_encoding::from_utf8_lossy_owned(bytes), + ), + Cow::Borrowed(bytes) => String::from_utf8_lossy(bytes), + } + } + }; + let source = shared + .node_code_translator + .translate_cjs_to_esm(&module_specifier, Some(source)) + .await?; + let module_source = match source { + Cow::Owned(source) => ModuleSourceCode::String(source.into()), + Cow::Borrowed(source) => { + ModuleSourceCode::String(FastString::from_static(source)) + } + }; + Ok(deno_core::ModuleSource::new_with_redirect( + module_type, + module_source, + &original_specifier, + &module_specifier, + None, + )) + } + .boxed_local(), + ) + } else { + let module_source = module_source.into_for_v8(); + deno_core::ModuleLoadResponse::Sync(Ok( + deno_core::ModuleSource::new_with_redirect( + module_type, + module_source, + original_specifier, + module_specifier, + None, + ), + )) + } } Ok(None) => deno_core::ModuleLoadResponse::Sync(Err(type_error( format!("{MODULE_NOT_FOUND}: {}", original_specifier), @@ -339,32 +406,61 @@ impl ModuleLoader for EmbeddedModuleLoader { } } +impl NodeRequireLoader for EmbeddedModuleLoader { + fn ensure_read_permission<'a>( + &self, + permissions: &mut dyn deno_runtime::deno_node::NodePermissions, + path: &'a std::path::Path, + ) -> Result, AnyError> { + if self.shared.modules.has_file(path) { + // allow reading if the file is in the snapshot + return Ok(Cow::Borrowed(path)); + } + + self + .shared + .npm_resolver + .ensure_read_permission(permissions, path) + } + + fn load_text_file_lossy( + &self, + path: &std::path::Path, + ) -> Result { + Ok(self.shared.fs.read_text_file_lossy_sync(path, None)?) + } +} + struct StandaloneModuleLoaderFactory { shared: Arc, } +impl StandaloneModuleLoaderFactory { + pub fn create_result(&self) -> CreateModuleLoaderResult { + let loader = Rc::new(EmbeddedModuleLoader { + shared: self.shared.clone(), + }); + CreateModuleLoaderResult { + module_loader: loader.clone(), + node_require_loader: loader, + } + } +} + impl ModuleLoaderFactory for StandaloneModuleLoaderFactory { fn create_for_main( &self, _root_permissions: PermissionsContainer, - ) -> ModuleLoaderAndSourceMapGetter { - ModuleLoaderAndSourceMapGetter { - module_loader: Rc::new(EmbeddedModuleLoader { - shared: self.shared.clone(), - }), - } + ) -> CreateModuleLoaderResult { + self.create_result() } fn create_for_worker( &self, _parent_permissions: PermissionsContainer, _permissions: PermissionsContainer, - ) -> ModuleLoaderAndSourceMapGetter { - ModuleLoaderAndSourceMapGetter { - module_loader: Rc::new(EmbeddedModuleLoader { - shared: self.shared.clone(), - }), - } + ) -> CreateModuleLoaderResult { + self.create_result() } } @@ -410,106 +506,155 @@ pub async fn run(data: StandaloneData) -> Result { let main_module = root_dir_url.join(&metadata.entrypoint_key).unwrap(); let npm_global_cache_dir = root_path.join(".deno_compile_node_modules"); let cache_setting = CacheSetting::Only; - let npm_resolver = match metadata.node_modules { + let pkg_json_resolver = Arc::new(PackageJsonResolver::new( + deno_runtime::deno_node::DenoFsNodeResolverEnv::new(fs.clone()), + )); + let (in_npm_pkg_checker, npm_resolver) = match metadata.node_modules { Some(binary::NodeModules::Managed { node_modules_dir }) => { + // create an npmrc that uses the fake npm_registry_url to resolve packages + let npmrc = Arc::new(ResolvedNpmRc { + default_config: deno_npm::npm_rc::RegistryConfigWithUrl { + registry_url: npm_registry_url.clone(), + config: Default::default(), + }, + scopes: Default::default(), + registry_configs: Default::default(), + }); + let npm_cache_dir = Arc::new(NpmCacheDir::new( + &DenoCacheEnvFsAdapter(fs.as_ref()), + npm_global_cache_dir, + npmrc.get_all_known_registries_urls(), + )); let snapshot = npm_snapshot.unwrap(); let maybe_node_modules_path = node_modules_dir .map(|node_modules_dir| root_path.join(node_modules_dir)); - create_cli_npm_resolver(CliNpmResolverCreateOptions::Managed( - CliNpmResolverManagedCreateOptions { - snapshot: CliNpmResolverManagedSnapshotOption::Specified(Some( - snapshot, - )), - maybe_lockfile: None, - fs: fs.clone(), - http_client_provider: http_client_provider.clone(), - npm_global_cache_dir, - cache_setting, - text_only_progress_bar: progress_bar, - maybe_node_modules_path, - npm_system_info: Default::default(), - npm_install_deps_provider: Arc::new( - // this is only used for installing packages, which isn't necessary with deno compile - NpmInstallDepsProvider::empty(), - ), - // create an npmrc that uses the fake npm_registry_url to resolve packages - npmrc: Arc::new(ResolvedNpmRc { - default_config: deno_npm::npm_rc::RegistryConfigWithUrl { - registry_url: npm_registry_url.clone(), - config: Default::default(), - }, - scopes: Default::default(), - registry_configs: Default::default(), - }), - lifecycle_scripts: Default::default(), - }, - )) - .await? + let in_npm_pkg_checker = + create_in_npm_pkg_checker(CreateInNpmPkgCheckerOptions::Managed( + CliManagedInNpmPkgCheckerCreateOptions { + root_cache_dir_url: npm_cache_dir.root_dir_url(), + maybe_node_modules_path: maybe_node_modules_path.as_deref(), + }, + )); + let npm_resolver = + create_cli_npm_resolver(CliNpmResolverCreateOptions::Managed( + CliManagedNpmResolverCreateOptions { + snapshot: CliNpmResolverManagedSnapshotOption::Specified(Some( + snapshot, + )), + maybe_lockfile: None, + fs: fs.clone(), + http_client_provider: http_client_provider.clone(), + npm_cache_dir, + cache_setting, + text_only_progress_bar: progress_bar, + maybe_node_modules_path, + npm_system_info: Default::default(), + npm_install_deps_provider: Arc::new( + // this is only used for installing packages, which isn't necessary with deno compile + NpmInstallDepsProvider::empty(), + ), + npmrc, + lifecycle_scripts: Default::default(), + }, + )) + .await?; + (in_npm_pkg_checker, npm_resolver) } Some(binary::NodeModules::Byonm { root_node_modules_dir, }) => { let root_node_modules_dir = root_node_modules_dir.map(|p| vfs.root().join(p)); - create_cli_npm_resolver(CliNpmResolverCreateOptions::Byonm( - CliByonmNpmResolverCreateOptions { + let in_npm_pkg_checker = + create_in_npm_pkg_checker(CreateInNpmPkgCheckerOptions::Byonm); + let npm_resolver = create_cli_npm_resolver( + CliNpmResolverCreateOptions::Byonm(CliByonmNpmResolverCreateOptions { fs: CliDenoResolverFs(fs.clone()), + pkg_json_resolver: pkg_json_resolver.clone(), root_node_modules_dir, - }, - )) - .await? + }), + ) + .await?; + (in_npm_pkg_checker, npm_resolver) } None => { - create_cli_npm_resolver(CliNpmResolverCreateOptions::Managed( - CliNpmResolverManagedCreateOptions { - snapshot: CliNpmResolverManagedSnapshotOption::Specified(None), - maybe_lockfile: None, - fs: fs.clone(), - http_client_provider: http_client_provider.clone(), - npm_global_cache_dir, - cache_setting, - text_only_progress_bar: progress_bar, - maybe_node_modules_path: None, - npm_system_info: Default::default(), - npm_install_deps_provider: Arc::new( - // this is only used for installing packages, which isn't necessary with deno compile - NpmInstallDepsProvider::empty(), - ), - // Packages from different registries are already inlined in the binary, - // so no need to create actual `.npmrc` configuration. - npmrc: create_default_npmrc(), - lifecycle_scripts: Default::default(), - }, - )) - .await? + // Packages from different registries are already inlined in the binary, + // so no need to create actual `.npmrc` configuration. + let npmrc = create_default_npmrc(); + let npm_cache_dir = Arc::new(NpmCacheDir::new( + &DenoCacheEnvFsAdapter(fs.as_ref()), + npm_global_cache_dir, + npmrc.get_all_known_registries_urls(), + )); + let in_npm_pkg_checker = + create_in_npm_pkg_checker(CreateInNpmPkgCheckerOptions::Managed( + CliManagedInNpmPkgCheckerCreateOptions { + root_cache_dir_url: npm_cache_dir.root_dir_url(), + maybe_node_modules_path: None, + }, + )); + let npm_resolver = + create_cli_npm_resolver(CliNpmResolverCreateOptions::Managed( + CliManagedNpmResolverCreateOptions { + snapshot: CliNpmResolverManagedSnapshotOption::Specified(None), + maybe_lockfile: None, + fs: fs.clone(), + http_client_provider: http_client_provider.clone(), + npm_cache_dir, + cache_setting, + text_only_progress_bar: progress_bar, + maybe_node_modules_path: None, + npm_system_info: Default::default(), + npm_install_deps_provider: Arc::new( + // this is only used for installing packages, which isn't necessary with deno compile + NpmInstallDepsProvider::empty(), + ), + npmrc: create_default_npmrc(), + lifecycle_scripts: Default::default(), + }, + )) + .await?; + (in_npm_pkg_checker, npm_resolver) } }; let has_node_modules_dir = npm_resolver.root_node_modules_path().is_some(); let node_resolver = Arc::new(NodeResolver::new( deno_runtime::deno_node::DenoFsNodeResolverEnv::new(fs.clone()), + in_npm_pkg_checker.clone(), npm_resolver.clone().into_npm_resolver(), + pkg_json_resolver.clone(), + )); + let cjs_tracker = Arc::new(CjsTracker::new( + in_npm_pkg_checker.clone(), + pkg_json_resolver.clone(), + CjsTrackerOptions { + unstable_detect_cjs: metadata.unstable_config.detect_cjs, + }, )); - let cjs_resolutions = Arc::new(CjsResolutionStore::default()); let cache_db = Caches::new(deno_dir_provider.clone()); let node_analysis_cache = NodeAnalysisCache::new(cache_db.node_analysis_db()); let cli_node_resolver = Arc::new(CliNodeResolver::new( - cjs_resolutions.clone(), + cjs_tracker.clone(), fs.clone(), + in_npm_pkg_checker.clone(), node_resolver.clone(), npm_resolver.clone(), )); let cjs_esm_code_analyzer = CliCjsCodeAnalyzer::new( node_analysis_cache, + cjs_tracker.clone(), fs.clone(), - cli_node_resolver.clone(), None, + false, ); let node_code_translator = Arc::new(NodeCodeTranslator::new( cjs_esm_code_analyzer, deno_runtime::deno_node::DenoFsNodeResolverEnv::new(fs.clone()), + in_npm_pkg_checker, node_resolver.clone(), npm_resolver.clone().into_npm_resolver(), + pkg_json_resolver.clone(), )); let workspace_resolver = { let import_map = match metadata.workspace_resolver.import_map { @@ -562,15 +707,18 @@ pub async fn run(data: StandaloneData) -> Result { }; let module_loader_factory = StandaloneModuleLoaderFactory { shared: Arc::new(SharedModuleLoaderState { + cjs_tracker: cjs_tracker.clone(), + fs: fs.clone(), modules, - workspace_resolver, + node_code_translator: node_code_translator.clone(), node_resolver: cli_node_resolver.clone(), npm_module_loader: Arc::new(NpmModuleLoader::new( - cjs_resolutions.clone(), - node_code_translator, + cjs_tracker.clone(), fs.clone(), - cli_node_resolver, + node_code_translator, )), + npm_resolver: npm_resolver.clone(), + workspace_resolver, }), }; @@ -609,7 +757,6 @@ pub async fn run(data: StandaloneData) -> Result { }); let worker_factory = CliMainWorkerFactory::new( Arc::new(BlobStore::default()), - cjs_resolutions, // Code cache is not supported for standalone binary yet. None, feature_checker, @@ -620,6 +767,7 @@ pub async fn run(data: StandaloneData) -> Result { Box::new(module_loader_factory), node_resolver, npm_resolver, + pkg_json_resolver, root_cert_store_provider, permissions, StorageKeyResolver::empty(), @@ -635,7 +783,6 @@ pub async fn run(data: StandaloneData) -> Result { inspect_wait: false, strace_ops: None, is_inspecting: false, - is_npm_main: main_module.scheme() == "npm", skip_op_registration: true, location: metadata.location, argv0: NpmPackageReqReference::from_specifier(&main_module) @@ -652,7 +799,6 @@ pub async fn run(data: StandaloneData) -> Result { node_ipc: None, serve_port: None, serve_host: None, - unstable_detect_cjs: metadata.unstable_config.detect_cjs, }, ); diff --git a/cli/standalone/serialization.rs b/cli/standalone/serialization.rs index 7b63c584e7..a5eb649bfd 100644 --- a/cli/standalone/serialization.rs +++ b/cli/standalone/serialization.rs @@ -214,14 +214,13 @@ impl RemoteModulesStoreBuilder { } } -pub struct DenoCompileModuleData<'a> { - pub specifier: &'a Url, - pub media_type: MediaType, - pub data: Cow<'static, [u8]>, +pub enum DenoCompileModuleSource { + String(&'static str), + Bytes(Cow<'static, [u8]>), } -impl<'a> DenoCompileModuleData<'a> { - pub fn into_for_v8(self) -> (&'a Url, ModuleType, ModuleSourceCode) { +impl DenoCompileModuleSource { + pub fn into_for_v8(self) -> ModuleSourceCode { fn into_bytes(data: Cow<'static, [u8]>) -> ModuleSourceCode { ModuleSourceCode::Bytes(match data { Cow::Borrowed(d) => d.into(), @@ -229,16 +228,31 @@ impl<'a> DenoCompileModuleData<'a> { }) } - fn into_string_unsafe(data: Cow<'static, [u8]>) -> ModuleSourceCode { + match self { // todo(https://github.com/denoland/deno_core/pull/943): store whether // the string is ascii or not ahead of time so we can avoid the is_ascii() // check in FastString::from_static + Self::String(s) => ModuleSourceCode::String(FastString::from_static(s)), + Self::Bytes(b) => into_bytes(b), + } + } +} + +pub struct DenoCompileModuleData<'a> { + pub specifier: &'a Url, + pub media_type: MediaType, + pub data: Cow<'static, [u8]>, +} + +impl<'a> DenoCompileModuleData<'a> { + pub fn into_parts(self) -> (&'a Url, ModuleType, DenoCompileModuleSource) { + fn into_string_unsafe(data: Cow<'static, [u8]>) -> DenoCompileModuleSource { match data { - Cow::Borrowed(d) => ModuleSourceCode::String( + Cow::Borrowed(d) => DenoCompileModuleSource::String( // SAFETY: we know this is a valid utf8 string - unsafe { FastString::from_static(std::str::from_utf8_unchecked(d)) }, + unsafe { std::str::from_utf8_unchecked(d) }, ), - Cow::Owned(d) => ModuleSourceCode::Bytes(d.into_boxed_slice().into()), + Cow::Owned(d) => DenoCompileModuleSource::Bytes(Cow::Owned(d)), } } @@ -257,11 +271,14 @@ impl<'a> DenoCompileModuleData<'a> { (ModuleType::JavaScript, into_string_unsafe(self.data)) } MediaType::Json => (ModuleType::Json, into_string_unsafe(self.data)), - MediaType::Wasm => (ModuleType::Wasm, into_bytes(self.data)), - // just assume javascript if we made it here - MediaType::TsBuildInfo | MediaType::SourceMap | MediaType::Unknown => { - (ModuleType::JavaScript, into_bytes(self.data)) + MediaType::Wasm => { + (ModuleType::Wasm, DenoCompileModuleSource::Bytes(self.data)) } + // just assume javascript if we made it here + MediaType::Css | MediaType::SourceMap | MediaType::Unknown => ( + ModuleType::JavaScript, + DenoCompileModuleSource::Bytes(self.data), + ), }; (self.specifier, media_type, source) } @@ -551,7 +568,7 @@ fn serialize_media_type(media_type: MediaType) -> u8 { MediaType::Tsx => 10, MediaType::Json => 11, MediaType::Wasm => 12, - MediaType::TsBuildInfo => 13, + MediaType::Css => 13, MediaType::SourceMap => 14, MediaType::Unknown => 15, } @@ -572,7 +589,7 @@ fn deserialize_media_type(value: u8) -> Result { 10 => Ok(MediaType::Tsx), 11 => Ok(MediaType::Json), 12 => Ok(MediaType::Wasm), - 13 => Ok(MediaType::TsBuildInfo), + 13 => Ok(MediaType::Css), 14 => Ok(MediaType::SourceMap), 15 => Ok(MediaType::Unknown), _ => bail!("Unknown media type value: {}", value), diff --git a/cli/tools/bench/mod.rs b/cli/tools/bench/mod.rs index be5d0ad0e1..272d063355 100644 --- a/cli/tools/bench/mod.rs +++ b/cli/tools/bench/mod.rs @@ -193,7 +193,7 @@ async fn bench_specifier_inner( .await?; // We execute the main module as a side module so that import.meta.main is not set. - worker.execute_side_module_possibly_with_npm().await?; + worker.execute_side_module().await?; let mut worker = worker.into_main_worker(); diff --git a/cli/tools/check.rs b/cli/tools/check.rs index 7edb392d48..d880278884 100644 --- a/cli/tools/check.rs +++ b/cli/tools/check.rs @@ -32,6 +32,7 @@ use crate::graph_util::ModuleGraphBuilder; use crate::npm::CliNpmResolver; use crate::tsc; use crate::tsc::Diagnostics; +use crate::tsc::TypeCheckingCjsTracker; use crate::util::extract; use crate::util::path::to_percent_decoded_str; @@ -99,6 +100,7 @@ pub struct CheckOptions { pub struct TypeChecker { caches: Arc, + cjs_tracker: Arc, cli_options: Arc, module_graph_builder: Arc, node_resolver: Arc, @@ -108,6 +110,7 @@ pub struct TypeChecker { impl TypeChecker { pub fn new( caches: Arc, + cjs_tracker: Arc, cli_options: Arc, module_graph_builder: Arc, node_resolver: Arc, @@ -115,6 +118,7 @@ impl TypeChecker { ) -> Self { Self { caches, + cjs_tracker, cli_options, module_graph_builder, node_resolver, @@ -244,6 +248,7 @@ impl TypeChecker { graph: graph.clone(), hash_data, maybe_npm: Some(tsc::RequestNpmState { + cjs_tracker: self.cjs_tracker.clone(), node_resolver: self.node_resolver.clone(), npm_resolver: self.npm_resolver.clone(), }), @@ -346,7 +351,7 @@ fn get_check_hash( } } MediaType::Json - | MediaType::TsBuildInfo + | MediaType::Css | MediaType::SourceMap | MediaType::Wasm | MediaType::Unknown => continue, @@ -428,7 +433,7 @@ fn get_tsc_roots( } MediaType::Json | MediaType::Wasm - | MediaType::TsBuildInfo + | MediaType::Css | MediaType::SourceMap | MediaType::Unknown => None, }, @@ -536,7 +541,7 @@ fn has_ts_check(media_type: MediaType, file_text: &str) -> bool { | MediaType::Tsx | MediaType::Json | MediaType::Wasm - | MediaType::TsBuildInfo + | MediaType::Css | MediaType::SourceMap | MediaType::Unknown => false, } diff --git a/cli/tools/compile.rs b/cli/tools/compile.rs index 5a4a938bb9..b3e9993379 100644 --- a/cli/tools/compile.rs +++ b/cli/tools/compile.rs @@ -53,16 +53,6 @@ pub async fn compile( ); } - if cli_options.unstable_detect_cjs() { - log::warn!( - concat!( - "{} --unstable-detect-cjs is not properly supported in deno compile. ", - "The compiled executable may encounter runtime errors.", - ), - crate::colors::yellow("Warning"), - ); - } - let output_path = resolve_compile_executable_output_path( http_client, &compile_flags, diff --git a/cli/tools/coverage/mod.rs b/cli/tools/coverage/mod.rs index 48922f1449..f593332475 100644 --- a/cli/tools/coverage/mod.rs +++ b/cli/tools/coverage/mod.rs @@ -6,12 +6,12 @@ use crate::args::FileFlags; use crate::args::Flags; use crate::cdp; use crate::factory::CliFactory; -use crate::npm::CliNpmResolver; use crate::tools::fmt::format_json; use crate::tools::test::is_supported_test_path; use crate::util::text_encoding::source_map_from_code; use deno_ast::MediaType; +use deno_ast::ModuleKind; use deno_ast::ModuleSpecifier; use deno_config::glob::FileCollector; use deno_config::glob::FilePatterns; @@ -25,6 +25,7 @@ use deno_core::serde_json; use deno_core::sourcemap::SourceMap; use deno_core::url::Url; use deno_core::LocalInspectorSession; +use node_resolver::InNpmPackageChecker; use regex::Regex; use std::fs; use std::fs::File; @@ -461,7 +462,7 @@ fn filter_coverages( coverages: Vec, include: Vec, exclude: Vec, - npm_resolver: &dyn CliNpmResolver, + in_npm_pkg_checker: &dyn InNpmPackageChecker, ) -> Vec { let include: Vec = include.iter().map(|e| Regex::new(e).unwrap()).collect(); @@ -485,7 +486,7 @@ fn filter_coverages( || doc_test_re.is_match(e.url.as_str()) || Url::parse(&e.url) .ok() - .map(|url| npm_resolver.in_npm_package(&url)) + .map(|url| in_npm_pkg_checker.in_npm_package(&url)) .unwrap_or(false); let is_included = include.iter().any(|p| p.is_match(&e.url)); @@ -496,7 +497,7 @@ fn filter_coverages( .collect::>() } -pub async fn cover_files( +pub fn cover_files( flags: Arc, coverage_flags: CoverageFlags, ) -> Result<(), AnyError> { @@ -506,9 +507,10 @@ pub async fn cover_files( let factory = CliFactory::from_flags(flags); let cli_options = factory.cli_options()?; - let npm_resolver = factory.npm_resolver().await?; + let in_npm_pkg_checker = factory.in_npm_pkg_checker()?; let file_fetcher = factory.file_fetcher()?; let emitter = factory.emitter()?; + let cjs_tracker = factory.cjs_tracker()?; assert!(!coverage_flags.files.include.is_empty()); @@ -528,7 +530,7 @@ pub async fn cover_files( script_coverages, coverage_flags.include, coverage_flags.exclude, - npm_resolver.as_ref(), + in_npm_pkg_checker.as_ref(), ); if script_coverages.is_empty() { return Err(generic_error("No covered files included in the report")); @@ -585,6 +587,8 @@ pub async fn cover_files( let transpiled_code = match file.media_type { MediaType::JavaScript | MediaType::Unknown + | MediaType::Css + | MediaType::Wasm | MediaType::Cjs | MediaType::Mjs | MediaType::Json => None, @@ -594,7 +598,10 @@ pub async fn cover_files( | MediaType::Mts | MediaType::Cts | MediaType::Tsx => { - Some(match emitter.maybe_cached_emit(&file.specifier, &file.source) { + let module_kind = ModuleKind::from_is_cjs( + cjs_tracker.is_maybe_cjs(&file.specifier, file.media_type)?, + ); + Some(match emitter.maybe_cached_emit(&file.specifier, module_kind, &file.source) { Some(code) => code, None => { return Err(anyhow!( @@ -605,7 +612,7 @@ pub async fn cover_files( } }) } - MediaType::Wasm | MediaType::TsBuildInfo | MediaType::SourceMap => { + MediaType::SourceMap => { unreachable!() } }; diff --git a/cli/tools/doc.rs b/cli/tools/doc.rs index 5e18546a28..e33da4efb2 100644 --- a/cli/tools/doc.rs +++ b/cli/tools/doc.rs @@ -22,9 +22,9 @@ use deno_core::serde_json; use deno_doc as doc; use deno_doc::html::UrlResolveKind; use deno_graph::source::NullFileSystem; +use deno_graph::EsParser; use deno_graph::GraphKind; use deno_graph::ModuleAnalyzer; -use deno_graph::ModuleParser; use deno_graph::ModuleSpecifier; use doc::html::ShortPath; use doc::DocDiagnostic; @@ -37,7 +37,7 @@ const JSON_SCHEMA_VERSION: u8 = 1; async fn generate_doc_nodes_for_builtin_types( doc_flags: DocFlags, - parser: &dyn ModuleParser, + parser: &dyn EsParser, analyzer: &dyn ModuleAnalyzer, ) -> Result>, AnyError> { let source_file_specifier = @@ -96,7 +96,7 @@ pub async fn doc( let module_info_cache = factory.module_info_cache()?; let parsed_source_cache = factory.parsed_source_cache(); let capturing_parser = parsed_source_cache.as_capturing_parser(); - let analyzer = module_info_cache.as_module_analyzer(parsed_source_cache); + let analyzer = module_info_cache.as_module_analyzer(); let doc_nodes_by_url = match doc_flags.source_files { DocSourceFileFlag::Builtin => { diff --git a/cli/tools/registry/tar.rs b/cli/tools/registry/tar.rs index aca125e00b..6d1801ce69 100644 --- a/cli/tools/registry/tar.rs +++ b/cli/tools/registry/tar.rs @@ -120,7 +120,7 @@ fn resolve_content_maybe_unfurling( | MediaType::Unknown | MediaType::Json | MediaType::Wasm - | MediaType::TsBuildInfo => { + | MediaType::Css => { // not unfurlable data return Ok(data); } diff --git a/cli/tools/repl/session.rs b/cli/tools/repl/session.rs index 484664dae4..23b0f11ac5 100644 --- a/cli/tools/repl/session.rs +++ b/cli/tools/repl/session.rs @@ -25,6 +25,7 @@ use deno_ast::swc::visit::noop_visit_type; use deno_ast::swc::visit::Visit; use deno_ast::swc::visit::VisitWith; use deno_ast::ImportsNotUsedAsValues; +use deno_ast::ModuleKind; use deno_ast::ModuleSpecifier; use deno_ast::ParseDiagnosticsError; use deno_ast::ParsedSource; @@ -641,6 +642,10 @@ impl ReplSession { jsx_fragment_factory: self.jsx.frag_factory.clone(), jsx_import_source: self.jsx.import_source.clone(), var_decl_imports: true, + verbatim_module_syntax: false, + }, + &deno_ast::TranspileModuleOptions { + module_kind: Some(ModuleKind::Esm), }, &deno_ast::EmitOptions { source_map: deno_ast::SourceMapOption::None, @@ -651,7 +656,6 @@ impl ReplSession { }, )? .into_source() - .into_string()? .text; let value = self diff --git a/cli/tools/run/hmr.rs b/cli/tools/run/hmr.rs index 6ccf8e344b..6cebedd012 100644 --- a/cli/tools/run/hmr.rs +++ b/cli/tools/run/hmr.rs @@ -1,9 +1,11 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -use crate::cdp; -use crate::emit::Emitter; -use crate::util::file_watcher::WatcherCommunicator; -use crate::util::file_watcher::WatcherRestartMode; +use std::collections::HashMap; +use std::path::PathBuf; +use std::sync::Arc; + +use deno_ast::MediaType; +use deno_ast::ModuleKind; use deno_core::error::generic_error; use deno_core::error::AnyError; use deno_core::futures::StreamExt; @@ -12,11 +14,14 @@ use deno_core::serde_json::{self}; use deno_core::url::Url; use deno_core::LocalInspectorSession; use deno_terminal::colors; -use std::collections::HashMap; -use std::path::PathBuf; -use std::sync::Arc; use tokio::select; +use crate::cdp; +use crate::emit::Emitter; +use crate::resolver::CjsTracker; +use crate::util::file_watcher::WatcherCommunicator; +use crate::util::file_watcher::WatcherRestartMode; + fn explain(status: &cdp::Status) -> &'static str { match status { cdp::Status::Ok => "OK", @@ -58,6 +63,7 @@ pub struct HmrRunner { session: LocalInspectorSession, watcher_communicator: Arc, script_ids: HashMap, + cjs_tracker: Arc, emitter: Arc, } @@ -139,7 +145,8 @@ impl crate::worker::HmrRunner for HmrRunner { }; let source_code = self.emitter.load_and_emit_for_hmr( - &module_url + &module_url, + ModuleKind::from_is_cjs(self.cjs_tracker.is_maybe_cjs(&module_url, MediaType::from_specifier(&module_url))?), ).await?; let mut tries = 1; @@ -172,12 +179,14 @@ impl crate::worker::HmrRunner for HmrRunner { impl HmrRunner { pub fn new( + cjs_tracker: Arc, emitter: Arc, session: LocalInspectorSession, watcher_communicator: Arc, ) -> Self { Self { session, + cjs_tracker, emitter, watcher_communicator, script_ids: HashMap::new(), diff --git a/cli/tools/test/mod.rs b/cli/tools/test/mod.rs index e81abad0b2..fa849614fa 100644 --- a/cli/tools/test/mod.rs +++ b/cli/tools/test/mod.rs @@ -631,7 +631,7 @@ async fn configure_main_worker( "Deno[Deno.internal].core.setLeakTracingEnabled(true);", )?; } - let res = worker.execute_side_module_possibly_with_npm().await; + let res = worker.execute_side_module().await; let mut worker = worker.into_main_worker(); match res { Ok(()) => Ok(()), diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index 6011dece76..bdc4340e33 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -845,6 +845,8 @@ delete Object.prototype.__proto__; jqueryMessage, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592": jqueryMessage, + "Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set_6263": + "Module '{0}' was resolved to '{1}', but importing these modules is not supported.", }; })()); diff --git a/cli/tsc/diagnostics.rs b/cli/tsc/diagnostics.rs index b0394ec177..d3795706eb 100644 --- a/cli/tsc/diagnostics.rs +++ b/cli/tsc/diagnostics.rs @@ -323,7 +323,7 @@ impl Diagnostics { // todo(dsherret): use a short lived cache to prevent parsing // source maps so often if let Ok(source_map) = - SourceMap::from_slice(&fast_check_module.source_map) + SourceMap::from_slice(fast_check_module.source_map.as_bytes()) { if let Some(start) = d.start.as_mut() { let maybe_token = source_map diff --git a/cli/tsc/mod.rs b/cli/tsc/mod.rs index de91889b62..dc7fc38f7a 100644 --- a/cli/tsc/mod.rs +++ b/cli/tsc/mod.rs @@ -3,9 +3,11 @@ use crate::args::TsConfig; use crate::args::TypeCheckMode; use crate::cache::FastInsecureHasher; +use crate::cache::ModuleInfoCache; use crate::node; use crate::npm::CliNpmResolver; use crate::npm::ResolvePkgFolderFromDenoReqError; +use crate::resolver::CjsTracker; use crate::util::checksum; use crate::util::path::mapped_specifier_for_tsc; @@ -32,13 +34,13 @@ use deno_graph::GraphKind; use deno_graph::Module; use deno_graph::ModuleGraph; use deno_graph::ResolutionResolved; +use deno_runtime::deno_fs; use deno_runtime::deno_node::NodeResolver; use deno_semver::npm::NpmPackageReqReference; use node_resolver::errors::NodeJsErrorCode; use node_resolver::errors::NodeJsErrorCoded; -use node_resolver::errors::ResolvePkgSubpathFromDenoModuleError; +use node_resolver::errors::PackageSubpathResolveError; use node_resolver::NodeModuleKind; -use node_resolver::NodeResolution; use node_resolver::NodeResolutionMode; use once_cell::sync::Lazy; use std::borrow::Cow; @@ -302,8 +304,76 @@ pub struct EmittedFile { pub media_type: MediaType, } +pub fn into_specifier_and_media_type( + specifier: Option, +) -> (ModuleSpecifier, MediaType) { + match specifier { + Some(specifier) => { + let media_type = MediaType::from_specifier(&specifier); + + (specifier, media_type) + } + None => ( + Url::parse("internal:///missing_dependency.d.ts").unwrap(), + MediaType::Dts, + ), + } +} + +#[derive(Debug)] +pub struct TypeCheckingCjsTracker { + cjs_tracker: Arc, + module_info_cache: Arc, +} + +impl TypeCheckingCjsTracker { + pub fn new( + cjs_tracker: Arc, + module_info_cache: Arc, + ) -> Self { + Self { + cjs_tracker, + module_info_cache, + } + } + + pub fn is_cjs( + &self, + specifier: &ModuleSpecifier, + media_type: MediaType, + code: &Arc, + ) -> bool { + if let Some(module_kind) = + self.cjs_tracker.get_known_kind(specifier, media_type) + { + module_kind.is_cjs() + } else { + let maybe_is_script = self + .module_info_cache + .as_module_analyzer() + .analyze_sync(specifier, media_type, code) + .ok() + .map(|info| info.is_script); + maybe_is_script + .and_then(|is_script| { + self + .cjs_tracker + .is_cjs_with_known_is_script(specifier, media_type, is_script) + .ok() + }) + .unwrap_or_else(|| { + self + .cjs_tracker + .is_maybe_cjs(specifier, media_type) + .unwrap_or(false) + }) + } + } +} + #[derive(Debug)] pub struct RequestNpmState { + pub cjs_tracker: Arc, pub node_resolver: Arc, pub npm_resolver: Arc, } @@ -456,7 +526,7 @@ pub fn as_ts_script_kind(media_type: MediaType) -> i32 { MediaType::Tsx => 4, MediaType::Json => 6, MediaType::SourceMap - | MediaType::TsBuildInfo + | MediaType::Css | MediaType::Wasm | MediaType::Unknown => 0, } @@ -489,25 +559,22 @@ fn op_load_inner( ) -> Result, AnyError> { fn load_from_node_modules( specifier: &ModuleSpecifier, - node_resolver: Option<&NodeResolver>, + npm_state: Option<&RequestNpmState>, media_type: &mut MediaType, is_cjs: &mut bool, ) -> Result { *media_type = MediaType::from_specifier(specifier); - *is_cjs = node_resolver - .map(|node_resolver| { - match node_resolver.url_to_node_resolution(specifier.clone()) { - Ok(NodeResolution::CommonJs(_)) => true, - Ok(NodeResolution::Esm(_)) - | Ok(NodeResolution::BuiltIn(_)) - | Err(_) => false, - } - }) - .unwrap_or(false); let file_path = specifier.to_file_path().unwrap(); let code = std::fs::read_to_string(&file_path) .with_context(|| format!("Unable to load {}", file_path.display()))?; - Ok(code) + let code: Arc = code.into(); + *is_cjs = npm_state + .map(|npm_state| { + npm_state.cjs_tracker.is_cjs(specifier, *media_type, &code) + }) + .unwrap_or(false); + // todo(dsherret): how to avoid cloning here? + Ok(code.to_string()) } let state = state.borrow_mut::(); @@ -560,6 +627,9 @@ fn op_load_inner( match module { Module::Js(module) => { media_type = module.media_type; + if matches!(media_type, MediaType::Cjs | MediaType::Cts) { + is_cjs = true; + } let source = module .fast_check_module() .map(|m| &*m.source) @@ -573,11 +643,13 @@ fn op_load_inner( Module::Npm(_) | Module::Node(_) => None, Module::External(module) => { // means it's Deno code importing an npm module - let specifier = - node::resolve_specifier_into_node_modules(&module.specifier); + let specifier = node::resolve_specifier_into_node_modules( + &module.specifier, + &deno_fs::RealFs, + ); Some(Cow::Owned(load_from_node_modules( &specifier, - state.maybe_npm.as_ref().map(|n| n.node_resolver.as_ref()), + state.maybe_npm.as_ref(), &mut media_type, &mut is_cjs, )?)) @@ -590,7 +662,7 @@ fn op_load_inner( { Some(Cow::Owned(load_from_node_modules( specifier, - Some(npm.node_resolver.as_ref()), + Some(npm), &mut media_type, &mut is_cjs, )?)) @@ -739,7 +811,13 @@ fn op_resolve_inner( } } }; - (specifier_str, media_type.as_ts_extension()) + ( + specifier_str, + match media_type { + MediaType::Css => ".js", // surface these as .js for typescript + media_type => media_type.as_ts_extension(), + }, + ) } None => ( MISSING_DEPENDENCY_SPECIFIER.to_string(), @@ -810,29 +888,27 @@ fn resolve_graph_specifier_types( Some(referrer), NodeResolutionMode::Types, ); - let maybe_resolution = match res_result { - Ok(res) => Some(res), + let maybe_url = match res_result { + Ok(url) => Some(url), Err(err) => match err.code() { NodeJsErrorCode::ERR_TYPES_NOT_FOUND | NodeJsErrorCode::ERR_MODULE_NOT_FOUND => None, _ => return Err(err.into()), }, }; - Ok(Some(NodeResolution::into_specifier_and_media_type( - maybe_resolution, - ))) + Ok(Some(into_specifier_and_media_type(maybe_url))) } else { Ok(None) } } Some(Module::External(module)) => { // we currently only use "External" for when the module is in an npm package - Ok(state.maybe_npm.as_ref().map(|npm| { - let specifier = - node::resolve_specifier_into_node_modules(&module.specifier); - NodeResolution::into_specifier_and_media_type( - npm.node_resolver.url_to_node_resolution(specifier).ok(), - ) + Ok(state.maybe_npm.as_ref().map(|_| { + let specifier = node::resolve_specifier_into_node_modules( + &module.specifier, + &deno_fs::RealFs, + ); + into_specifier_and_media_type(Some(specifier)) })) } Some(Module::Node(_)) | None => Ok(None), @@ -844,7 +920,7 @@ enum ResolveNonGraphSpecifierTypesError { #[error(transparent)] ResolvePkgFolderFromDenoReq(#[from] ResolvePkgFolderFromDenoReqError), #[error(transparent)] - ResolvePkgSubpathFromDenoModule(#[from] ResolvePkgSubpathFromDenoModuleError), + PackageSubpathResolve(#[from] PackageSubpathResolveError), } fn resolve_non_graph_specifier_types( @@ -863,7 +939,7 @@ fn resolve_non_graph_specifier_types( let node_resolver = &npm.node_resolver; if node_resolver.in_npm_package(referrer) { // we're in an npm package, so use node resolution - Ok(Some(NodeResolution::into_specifier_and_media_type( + Ok(Some(into_specifier_and_media_type( node_resolver .resolve( raw_specifier, @@ -871,7 +947,8 @@ fn resolve_non_graph_specifier_types( referrer_kind, NodeResolutionMode::Types, ) - .ok(), + .ok() + .map(|res| res.into_url()), ))) } else if let Ok(npm_req_ref) = NpmPackageReqReference::from_str(raw_specifier) @@ -890,17 +967,15 @@ fn resolve_non_graph_specifier_types( Some(referrer), NodeResolutionMode::Types, ); - let maybe_resolution = match res_result { - Ok(res) => Some(res), + let maybe_url = match res_result { + Ok(url) => Some(url), Err(err) => match err.code() { NodeJsErrorCode::ERR_TYPES_NOT_FOUND | NodeJsErrorCode::ERR_MODULE_NOT_FOUND => None, _ => return Err(err.into()), }, }; - Ok(Some(NodeResolution::into_specifier_and_media_type( - maybe_resolution, - ))) + Ok(Some(into_specifier_and_media_type(maybe_url))) } else { Ok(None) } diff --git a/cli/util/extract.rs b/cli/util/extract.rs index 873b7e7f2d..f577cbefec 100644 --- a/cli/util/extract.rs +++ b/cli/util/extract.rs @@ -64,7 +64,7 @@ fn extract_inner( }) { Ok(parsed) => { let mut c = ExportCollector::default(); - c.visit_program(parsed.program_ref()); + c.visit_program(parsed.program().as_ref()); c } Err(_) => ExportCollector::default(), @@ -570,14 +570,14 @@ fn generate_pseudo_file( })?; let top_level_atoms = swc_utils::collect_decls_with_ctxt::( - parsed.program_ref(), + &parsed.program_ref(), parsed.top_level_context(), ); let transformed = parsed .program_ref() - .clone() + .to_owned() .fold_with(&mut as_folder(Transform { specifier: &file.specifier, base_file_specifier, @@ -1416,7 +1416,7 @@ console.log(Foo); }) .unwrap(); - collector.visit_program(parsed.program_ref()); + parsed.program_ref().visit_with(&mut collector); collector } diff --git a/cli/util/logger.rs b/cli/util/logger.rs index cdc89411fe..d93753dfd3 100644 --- a/cli/util/logger.rs +++ b/cli/util/logger.rs @@ -65,6 +65,8 @@ pub fn init(maybe_level: Option) { .filter_module("swc_ecma_parser", log::LevelFilter::Error) // Suppress span lifecycle logs since they are too verbose .filter_module("tracing::span", log::LevelFilter::Off) + // for deno_compile, this is too verbose + .filter_module("editpe", log::LevelFilter::Error) .format(|buf, record| { let mut target = record.target().to_string(); if let Some(line_no) = record.line() { diff --git a/cli/util/path.rs b/cli/util/path.rs index e4ae6e7cb1..58bed664f9 100644 --- a/cli/util/path.rs +++ b/cli/util/path.rs @@ -42,21 +42,6 @@ pub fn get_extension(file_path: &Path) -> Option { .map(|e| e.to_lowercase()); } -pub fn specifier_has_extension( - specifier: &ModuleSpecifier, - searching_ext: &str, -) -> bool { - let Some((_, ext)) = specifier.path().rsplit_once('.') else { - return false; - }; - let searching_ext = searching_ext.strip_prefix('.').unwrap_or(searching_ext); - debug_assert!(!searching_ext.contains('.')); // exts like .d.ts are not implemented here - if ext.len() != searching_ext.len() { - return false; - } - ext.eq_ignore_ascii_case(searching_ext) -} - pub fn get_atomic_dir_path(file_path: &Path) -> PathBuf { let rand = gen_rand_path_component(); let new_file_name = format!( @@ -350,18 +335,6 @@ mod test { } } - #[test] - fn test_specifier_has_extension() { - fn get(specifier: &str, ext: &str) -> bool { - specifier_has_extension(&ModuleSpecifier::parse(specifier).unwrap(), ext) - } - - assert!(get("file:///a/b/c.ts", "ts")); - assert!(get("file:///a/b/c.ts", ".ts")); - assert!(!get("file:///a/b/c.ts", ".cts")); - assert!(get("file:///a/b/c.CtS", ".cts")); - } - #[test] fn test_to_percent_decoded_str() { let str = to_percent_decoded_str("%F0%9F%A6%95"); diff --git a/cli/util/text_encoding.rs b/cli/util/text_encoding.rs index df72cc2be6..8524e63ebb 100644 --- a/cli/util/text_encoding.rs +++ b/cli/util/text_encoding.rs @@ -97,6 +97,7 @@ fn find_source_map_range(code: &[u8]) -> Option> { } /// Converts an `Arc` to an `Arc<[u8]>`. +#[allow(dead_code)] pub fn arc_str_to_bytes(arc_str: Arc) -> Arc<[u8]> { let raw = Arc::into_raw(arc_str); // SAFETY: This is safe because they have the same memory layout. diff --git a/cli/worker.rs b/cli/worker.rs index e230197d2b..baacd681a1 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -14,16 +14,17 @@ use deno_core::v8; use deno_core::CompiledWasmModuleStore; use deno_core::Extension; use deno_core::FeatureChecker; -use deno_core::ModuleId; use deno_core::ModuleLoader; use deno_core::PollEventLoopOptions; use deno_core::SharedArrayBufferStore; use deno_runtime::code_cache; use deno_runtime::deno_broadcast_channel::InMemoryBroadcastChannel; use deno_runtime::deno_fs; -use deno_runtime::deno_node; use deno_runtime::deno_node::NodeExtInitServices; +use deno_runtime::deno_node::NodeRequireLoader; +use deno_runtime::deno_node::NodeRequireLoaderRc; use deno_runtime::deno_node::NodeResolver; +use deno_runtime::deno_node::PackageJsonResolver; use deno_runtime::deno_permissions::PermissionsContainer; use deno_runtime::deno_tls::RootCertStoreProvider; use deno_runtime::deno_web::BlobStore; @@ -42,7 +43,6 @@ use deno_runtime::WorkerExecutionMode; use deno_runtime::WorkerLogLevel; use deno_semver::npm::NpmPackageReqReference; use deno_terminal::colors; -use node_resolver::NodeResolution; use node_resolver::NodeResolutionMode; use tokio::select; @@ -51,28 +51,27 @@ use crate::args::DenoSubcommand; use crate::args::StorageKeyResolver; use crate::errors; use crate::npm::CliNpmResolver; -use crate::resolver::CjsResolutionStore; use crate::util::checksum; use crate::util::file_watcher::WatcherCommunicator; use crate::util::file_watcher::WatcherRestartMode; -use crate::util::path::specifier_has_extension; use crate::version; -pub struct ModuleLoaderAndSourceMapGetter { +pub struct CreateModuleLoaderResult { pub module_loader: Rc, + pub node_require_loader: Rc, } pub trait ModuleLoaderFactory: Send + Sync { fn create_for_main( &self, root_permissions: PermissionsContainer, - ) -> ModuleLoaderAndSourceMapGetter; + ) -> CreateModuleLoaderResult; fn create_for_worker( &self, parent_permissions: PermissionsContainer, permissions: PermissionsContainer, - ) -> ModuleLoaderAndSourceMapGetter; + ) -> CreateModuleLoaderResult; } #[async_trait::async_trait(?Send)] @@ -109,7 +108,6 @@ pub struct CliMainWorkerOptions { pub inspect_wait: bool, pub strace_ops: Option>, pub is_inspecting: bool, - pub is_npm_main: bool, pub location: Option, pub argv0: Option, pub node_debug: Option, @@ -122,13 +120,11 @@ pub struct CliMainWorkerOptions { pub node_ipc: Option, pub serve_port: Option, pub serve_host: Option, - pub unstable_detect_cjs: bool, } struct SharedWorkerState { blob_store: Arc, broadcast_channel: InMemoryBroadcastChannel, - cjs_resolution_store: Arc, code_cache: Option>, compiled_wasm_module_store: CompiledWasmModuleStore, feature_checker: Arc, @@ -139,6 +135,7 @@ struct SharedWorkerState { module_loader_factory: Box, node_resolver: Arc, npm_resolver: Arc, + pkg_json_resolver: Arc, root_cert_store_provider: Arc, root_permissions: PermissionsContainer, shared_array_buffer_store: SharedArrayBufferStore, @@ -148,11 +145,15 @@ struct SharedWorkerState { } impl SharedWorkerState { - pub fn create_node_init_services(&self) -> NodeExtInitServices { + pub fn create_node_init_services( + &self, + node_require_loader: NodeRequireLoaderRc, + ) -> NodeExtInitServices { NodeExtInitServices { - node_require_resolver: self.npm_resolver.clone().into_require_resolver(), + node_require_loader, node_resolver: self.node_resolver.clone(), npm_resolver: self.npm_resolver.clone().into_npm_resolver(), + pkg_json_resolver: self.pkg_json_resolver.clone(), } } @@ -163,7 +164,6 @@ impl SharedWorkerState { pub struct CliMainWorker { main_module: ModuleSpecifier, - is_main_cjs: bool, worker: MainWorker, shared: Arc, } @@ -185,17 +185,7 @@ impl CliMainWorker { log::debug!("main_module {}", self.main_module); - if self.is_main_cjs { - deno_node::load_cjs_module( - &mut self.worker.js_runtime, - &self.main_module.to_file_path().unwrap().to_string_lossy(), - true, - self.shared.options.inspect_brk, - )?; - } else { - self.execute_main_module_possibly_with_npm().await?; - } - + self.execute_main_module().await?; self.worker.dispatch_load_event()?; loop { @@ -283,22 +273,7 @@ impl CliMainWorker { /// Execute the given main module emitting load and unload events before and after execution /// respectively. pub async fn execute(&mut self) -> Result<(), AnyError> { - if self.inner.is_main_cjs { - deno_node::load_cjs_module( - &mut self.inner.worker.js_runtime, - &self - .inner - .main_module - .to_file_path() - .unwrap() - .to_string_lossy(), - true, - self.inner.shared.options.inspect_brk, - )?; - } else { - self.inner.execute_main_module_possibly_with_npm().await?; - } - + self.inner.execute_main_module().await?; self.inner.worker.dispatch_load_event()?; self.pending_unload = true; @@ -339,24 +314,13 @@ impl CliMainWorker { executor.execute().await } - pub async fn execute_main_module_possibly_with_npm( - &mut self, - ) -> Result<(), AnyError> { + pub async fn execute_main_module(&mut self) -> Result<(), AnyError> { let id = self.worker.preload_main_module(&self.main_module).await?; - self.evaluate_module_possibly_with_npm(id).await + self.worker.evaluate_module(id).await } - pub async fn execute_side_module_possibly_with_npm( - &mut self, - ) -> Result<(), AnyError> { + pub async fn execute_side_module(&mut self) -> Result<(), AnyError> { let id = self.worker.preload_side_module(&self.main_module).await?; - self.evaluate_module_possibly_with_npm(id).await - } - - async fn evaluate_module_possibly_with_npm( - &mut self, - id: ModuleId, - ) -> Result<(), AnyError> { self.worker.evaluate_module(id).await } @@ -426,7 +390,6 @@ impl CliMainWorkerFactory { #[allow(clippy::too_many_arguments)] pub fn new( blob_store: Arc, - cjs_resolution_store: Arc, code_cache: Option>, feature_checker: Arc, fs: Arc, @@ -436,6 +399,7 @@ impl CliMainWorkerFactory { module_loader_factory: Box, node_resolver: Arc, npm_resolver: Arc, + pkg_json_resolver: Arc, root_cert_store_provider: Arc, root_permissions: PermissionsContainer, storage_key_resolver: StorageKeyResolver, @@ -446,7 +410,6 @@ impl CliMainWorkerFactory { shared: Arc::new(SharedWorkerState { blob_store, broadcast_channel: Default::default(), - cjs_resolution_store, code_cache, compiled_wasm_module_store: Default::default(), feature_checker, @@ -457,6 +420,7 @@ impl CliMainWorkerFactory { module_loader_factory, node_resolver, npm_resolver, + pkg_json_resolver, root_cert_store_provider, root_permissions, shared_array_buffer_store: Default::default(), @@ -492,10 +456,13 @@ impl CliMainWorkerFactory { stdio: deno_runtime::deno_io::Stdio, ) -> Result { let shared = &self.shared; - let ModuleLoaderAndSourceMapGetter { module_loader } = shared + let CreateModuleLoaderResult { + module_loader, + node_require_loader, + } = shared .module_loader_factory .create_for_main(permissions.clone()); - let (main_module, is_main_cjs) = if let Ok(package_ref) = + let main_module = if let Ok(package_ref) = NpmPackageReqReference::from_specifier(&main_module) { if let Some(npm_resolver) = shared.npm_resolver.as_managed() { @@ -515,9 +482,8 @@ impl CliMainWorkerFactory { package_ref.req(), &referrer, )?; - let node_resolution = self + let main_module = self .resolve_binary_entrypoint(&package_folder, package_ref.sub_path())?; - let is_main_cjs = matches!(node_resolution, NodeResolution::CommonJs(_)); if let Some(lockfile) = &shared.maybe_lockfile { // For npm binary commands, ensure that the lockfile gets updated @@ -526,36 +492,9 @@ impl CliMainWorkerFactory { lockfile.write_if_changed()?; } - (node_resolution.into_url(), is_main_cjs) - } else if shared.options.is_npm_main - || shared.node_resolver.in_npm_package(&main_module) - { - let node_resolution = - shared.node_resolver.url_to_node_resolution(main_module)?; - let is_main_cjs = matches!(node_resolution, NodeResolution::CommonJs(_)); - (node_resolution.into_url(), is_main_cjs) + main_module } else { - let is_maybe_cjs_js_ext = self.shared.options.unstable_detect_cjs - && specifier_has_extension(&main_module, "js") - && self - .shared - .node_resolver - .get_closest_package_json(&main_module) - .ok() - .flatten() - .map(|pkg_json| pkg_json.typ == "commonjs") - .unwrap_or(false); - let is_cjs = if is_maybe_cjs_js_ext { - // fill the cjs resolution store by preparing the module load - module_loader - .prepare_load(&main_module, None, false) - .await?; - self.shared.cjs_resolution_store.is_known_cjs(&main_module) - } else { - main_module.scheme() == "file" - && specifier_has_extension(&main_module, "cjs") - }; - (main_module, is_cjs) + main_module }; let maybe_inspector_server = shared.maybe_inspector_server.clone(); @@ -597,7 +536,9 @@ impl CliMainWorkerFactory { root_cert_store_provider: Some(shared.root_cert_store_provider.clone()), module_loader, fs: shared.fs.clone(), - node_services: Some(shared.create_node_init_services()), + node_services: Some( + shared.create_node_init_services(node_require_loader), + ), npm_process_state_provider: Some(shared.npm_process_state_provider()), blob_store: shared.blob_store.clone(), broadcast_channel: shared.broadcast_channel.clone(), @@ -682,7 +623,6 @@ impl CliMainWorkerFactory { Ok(CliMainWorker { main_module, - is_main_cjs, worker, shared: shared.clone(), }) @@ -692,19 +632,19 @@ impl CliMainWorkerFactory { &self, package_folder: &Path, sub_path: Option<&str>, - ) -> Result { + ) -> Result { match self .shared .node_resolver .resolve_binary_export(package_folder, sub_path) { - Ok(node_resolution) => Ok(node_resolution), + Ok(specifier) => Ok(specifier), Err(original_err) => { // if the binary entrypoint was not found, fallback to regular node resolution let result = self.resolve_binary_entrypoint_fallback(package_folder, sub_path); match result { - Ok(Some(resolution)) => Ok(resolution), + Ok(Some(specifier)) => Ok(specifier), Ok(None) => Err(original_err.into()), Err(fallback_err) => { bail!("{:#}\n\nFallback failed: {:#}", original_err, fallback_err) @@ -719,7 +659,7 @@ impl CliMainWorkerFactory { &self, package_folder: &Path, sub_path: Option<&str>, - ) -> Result, AnyError> { + ) -> Result, AnyError> { // only fallback if the user specified a sub path if sub_path.is_none() { // it's confusing to users if the package doesn't have any binary @@ -728,7 +668,7 @@ impl CliMainWorkerFactory { return Ok(None); } - let resolution = self + let specifier = self .shared .node_resolver .resolve_package_subpath_from_deno_module( @@ -737,19 +677,14 @@ impl CliMainWorkerFactory { /* referrer */ None, NodeResolutionMode::Execution, )?; - match &resolution { - NodeResolution::BuiltIn(_) => Ok(None), - NodeResolution::CommonJs(specifier) | NodeResolution::Esm(specifier) => { - if specifier - .to_file_path() - .map(|p| p.exists()) - .unwrap_or(false) - { - Ok(Some(resolution)) - } else { - bail!("Cannot find module '{}'", specifier) - } - } + if specifier + .to_file_path() + .map(|p| p.exists()) + .unwrap_or(false) + { + Ok(Some(specifier)) + } else { + bail!("Cannot find module '{}'", specifier) } } } @@ -761,11 +696,13 @@ fn create_web_worker_callback( Arc::new(move |args| { let maybe_inspector_server = shared.maybe_inspector_server.clone(); - let ModuleLoaderAndSourceMapGetter { module_loader } = - shared.module_loader_factory.create_for_worker( - args.parent_permissions.clone(), - args.permissions.clone(), - ); + let CreateModuleLoaderResult { + module_loader, + node_require_loader, + } = shared.module_loader_factory.create_for_worker( + args.parent_permissions.clone(), + args.permissions.clone(), + ); let create_web_worker_cb = create_web_worker_callback(shared.clone(), stdio.clone()); @@ -795,7 +732,9 @@ fn create_web_worker_callback( root_cert_store_provider: Some(shared.root_cert_store_provider.clone()), module_loader, fs: shared.fs.clone(), - node_services: Some(shared.create_node_init_services()), + node_services: Some( + shared.create_node_init_services(node_require_loader), + ), blob_store: shared.blob_store.clone(), broadcast_channel: shared.broadcast_channel.clone(), shared_array_buffer_store: Some(shared.shared_array_buffer_store.clone()), diff --git a/ext/node/lib.rs b/ext/node/lib.rs index b34bea815b..db6d08e11e 100644 --- a/ext/node/lib.rs +++ b/ext/node/lib.rs @@ -9,15 +9,11 @@ use std::path::Path; use std::path::PathBuf; use deno_core::error::AnyError; -use deno_core::located_script_name; use deno_core::op2; use deno_core::url::Url; #[allow(unused_imports)] use deno_core::v8; use deno_core::v8::ExternalReference; -use deno_core::JsRuntime; -use deno_fs::sync::MaybeSend; -use deno_fs::sync::MaybeSync; use node_resolver::NpmResolverRc; use once_cell::sync::Lazy; @@ -125,16 +121,17 @@ impl NodePermissions for deno_permissions::PermissionsContainer { } #[allow(clippy::disallowed_types)] -pub type NodeRequireResolverRc = - deno_fs::sync::MaybeArc; +pub type NodeRequireLoaderRc = std::rc::Rc; -pub trait NodeRequireResolver: std::fmt::Debug + MaybeSend + MaybeSync { +pub trait NodeRequireLoader { #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] fn ensure_read_permission<'a>( &self, permissions: &mut dyn NodePermissions, path: &'a Path, ) -> Result, AnyError>; + + fn load_text_file_lossy(&self, path: &Path) -> Result; } pub static NODE_ENV_VAR_ALLOWLIST: Lazy> = Lazy::new(|| { @@ -152,10 +149,12 @@ fn op_node_build_os() -> String { env!("TARGET").split('-').nth(2).unwrap().to_string() } +#[derive(Clone)] pub struct NodeExtInitServices { - pub node_require_resolver: NodeRequireResolverRc, + pub node_require_loader: NodeRequireLoaderRc, pub node_resolver: NodeResolverRc, pub npm_resolver: NpmResolverRc, + pub pkg_json_resolver: PackageJsonResolverRc, } deno_core::extension!(deno_node, @@ -639,9 +638,10 @@ deno_core::extension!(deno_node, state.put(options.fs.clone()); if let Some(init) = &options.maybe_init { - state.put(init.node_require_resolver.clone()); + state.put(init.node_require_loader.clone()); state.put(init.node_resolver.clone()); state.put(init.npm_resolver.clone()); + state.put(init.pkg_json_resolver.clone()); } }, global_template_middleware = global_template_middleware, @@ -761,33 +761,16 @@ deno_core::extension!(deno_node, }, ); -pub fn load_cjs_module( - js_runtime: &mut JsRuntime, - module: &str, - main: bool, - inspect_brk: bool, -) -> Result<(), AnyError> { - fn escape_for_single_quote_string(text: &str) -> String { - text.replace('\\', r"\\").replace('\'', r"\'") - } - - let source_code = format!( - r#"(function loadCjsModule(moduleName, isMain, inspectBrk) {{ - Deno[Deno.internal].node.loadCjsModule(moduleName, isMain, inspectBrk); - }})('{module}', {main}, {inspect_brk});"#, - main = main, - module = escape_for_single_quote_string(module), - inspect_brk = inspect_brk, - ); - - js_runtime.execute_script(located_script_name!(), source_code)?; - Ok(()) -} - pub type NodeResolver = node_resolver::NodeResolver; #[allow(clippy::disallowed_types)] pub type NodeResolverRc = deno_fs::sync::MaybeArc>; +pub type PackageJsonResolver = + node_resolver::PackageJsonResolver; +#[allow(clippy::disallowed_types)] +pub type PackageJsonResolverRc = deno_fs::sync::MaybeArc< + node_resolver::PackageJsonResolver, +>; #[derive(Debug)] pub struct DenoFsNodeResolverEnv { diff --git a/ext/node/ops/require.rs b/ext/node/ops/require.rs index 7524fb43c7..30db8b6293 100644 --- a/ext/node/ops/require.rs +++ b/ext/node/ops/require.rs @@ -9,6 +9,7 @@ use deno_core::OpState; use deno_fs::FileSystemRc; use deno_package_json::PackageJsonRc; use deno_path_util::normalize_path; +use deno_path_util::url_to_file_path; use node_resolver::NodeModuleKind; use node_resolver::NodeResolutionMode; use node_resolver::REQUIRE_CONDITIONS; @@ -19,9 +20,10 @@ use std::path::PathBuf; use std::rc::Rc; use crate::NodePermissions; -use crate::NodeRequireResolverRc; +use crate::NodeRequireLoaderRc; use crate::NodeResolverRc; use crate::NpmResolverRc; +use crate::PackageJsonResolverRc; #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] fn ensure_read_permission<'a, P>( @@ -31,9 +33,9 @@ fn ensure_read_permission<'a, P>( where P: NodePermissions + 'static, { - let resolver = state.borrow::().clone(); + let loader = state.borrow::().clone(); let permissions = state.borrow_mut::

(); - resolver.ensure_read_permission(permissions, file_path) + loader.ensure_read_permission(permissions, file_path) } #[derive(Debug, thiserror::Error)] @@ -54,10 +56,14 @@ pub enum RequireError { PackageImportsResolve( #[from] node_resolver::errors::PackageImportsResolveError, ), - #[error("failed to convert '{0}' to file path")] - FilePathConversion(Url), + #[error(transparent)] + FilePathConversion(#[from] deno_path_util::UrlToFilePathError), + #[error(transparent)] + UrlConversion(#[from] deno_path_util::PathToUrlError), #[error(transparent)] Fs(#[from] deno_io::fs::FsError), + #[error(transparent)] + ReadModule(deno_core::error::AnyError), #[error("Unable to get CWD: {0}")] UnableToGetCwd(deno_io::fs::FsError), } @@ -229,8 +235,11 @@ pub fn op_require_is_deno_dir_package( state: &mut OpState, #[string] path: String, ) -> bool { - let resolver = state.borrow::(); - resolver.in_npm_package_at_file_path(&PathBuf::from(path)) + let resolver = state.borrow::(); + match deno_path_util::url_from_file_path(&PathBuf::from(path)) { + Ok(specifier) => resolver.in_npm_package(&specifier), + Err(_) => false, + } } #[op2] @@ -411,8 +420,8 @@ where return Ok(None); } - let node_resolver = state.borrow::(); - let pkg = node_resolver + let pkg_json_resolver = state.borrow::(); + let pkg = pkg_json_resolver .get_closest_package_json_from_path(&PathBuf::from(parent_path.unwrap())) .ok() .flatten(); @@ -441,6 +450,7 @@ where let referrer = deno_core::url::Url::from_file_path(&pkg.path).unwrap(); if let Some(exports) = &pkg.exports { + let node_resolver = state.borrow::(); let r = node_resolver.package_exports_resolve( &pkg.path, &expansion, @@ -470,10 +480,13 @@ where P: NodePermissions + 'static, { let file_path = PathBuf::from(file_path); + // todo(dsherret): there's multiple borrows to NodeRequireLoaderRc here let file_path = ensure_read_permission::

(state, &file_path) .map_err(RequireError::Permission)?; - let fs = state.borrow::(); - Ok(fs.read_text_file_lossy_sync(&file_path, None)?) + let loader = state.borrow::(); + loader + .load_text_file_lossy(&file_path) + .map_err(RequireError::ReadModule) } #[op2] @@ -503,11 +516,12 @@ where P: NodePermissions + 'static, { let fs = state.borrow::(); - let npm_resolver = state.borrow::(); let node_resolver = state.borrow::(); + let pkg_json_resolver = state.borrow::(); let modules_path = PathBuf::from(&modules_path_str); - let pkg_path = if npm_resolver.in_npm_package_at_file_path(&modules_path) + let modules_specifier = deno_path_util::url_from_file_path(&modules_path)?; + let pkg_path = if node_resolver.in_npm_package(&modules_specifier) && !uses_local_node_modules_dir { modules_path @@ -521,7 +535,7 @@ where } }; let Some(pkg) = - node_resolver.load_package_json(&pkg_path.join("package.json"))? + pkg_json_resolver.load_package_json(&pkg_path.join("package.json"))? else { return Ok(None); }; @@ -561,8 +575,8 @@ where { let filename = PathBuf::from(filename); // permissions: allow reading the closest package.json files - let node_resolver = state.borrow::().clone(); - node_resolver.get_closest_package_json_from_path(&filename) + let pkg_json_resolver = state.borrow::(); + pkg_json_resolver.get_closest_package_json_from_path(&filename) } #[op2] @@ -574,13 +588,13 @@ pub fn op_require_read_package_scope

( where P: NodePermissions + 'static, { - let node_resolver = state.borrow::().clone(); + let pkg_json_resolver = state.borrow::(); let package_json_path = PathBuf::from(package_json_path); if package_json_path.file_name() != Some("package.json".as_ref()) { // permissions: do not allow reading a non-package.json file return None; } - node_resolver + pkg_json_resolver .load_package_json(&package_json_path) .ok() .flatten() @@ -599,14 +613,15 @@ where let referrer_path = PathBuf::from(&referrer_filename); let referrer_path = ensure_read_permission::

(state, &referrer_path) .map_err(RequireError::Permission)?; - let node_resolver = state.borrow::(); + let pkg_json_resolver = state.borrow::(); let Some(pkg) = - node_resolver.get_closest_package_json_from_path(&referrer_path)? + pkg_json_resolver.get_closest_package_json_from_path(&referrer_path)? else { return Ok(None); }; if pkg.imports.is_some() { + let node_resolver = state.borrow::(); let referrer_url = Url::from_file_path(&referrer_filename).unwrap(); let url = node_resolver.package_imports_resolve( &request, @@ -637,13 +652,6 @@ fn url_to_file_path_string(url: &Url) -> Result { Ok(file_path.to_string_lossy().into_owned()) } -fn url_to_file_path(url: &Url) -> Result { - match url.to_file_path() { - Ok(file_path) => Ok(file_path), - Err(()) => Err(RequireError::FilePathConversion(url.clone())), - } -} - #[op2(fast)] pub fn op_require_can_parse_as_esm( scope: &mut v8::HandleScope, diff --git a/ext/node/ops/worker_threads.rs b/ext/node/ops/worker_threads.rs index e33cf91574..d2e5758826 100644 --- a/ext/node/ops/worker_threads.rs +++ b/ext/node/ops/worker_threads.rs @@ -4,14 +4,12 @@ use deno_core::op2; use deno_core::url::Url; use deno_core::OpState; use deno_fs::FileSystemRc; -use node_resolver::NodeResolution; use std::borrow::Cow; use std::path::Path; use std::path::PathBuf; use crate::NodePermissions; -use crate::NodeRequireResolverRc; -use crate::NodeResolverRc; +use crate::NodeRequireLoaderRc; #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] fn ensure_read_permission<'a, P>( @@ -21,9 +19,9 @@ fn ensure_read_permission<'a, P>( where P: NodePermissions + 'static, { - let resolver = state.borrow::().clone(); + let loader = state.borrow::().clone(); let permissions = state.borrow_mut::

(); - resolver.ensure_read_permission(permissions, file_path) + loader.ensure_read_permission(permissions, file_path) } #[derive(Debug, thiserror::Error)] @@ -42,14 +40,11 @@ pub enum WorkerThreadsFilenameError { UrlToPath, #[error("File not found [{0:?}]")] FileNotFound(PathBuf), - #[error("Neither ESM nor CJS")] - NeitherEsmNorCjs, - #[error("{0}")] - UrlToNodeResolution(node_resolver::errors::UrlToNodeResolutionError), #[error(transparent)] Fs(#[from] deno_io::fs::FsError), } +// todo(dsherret): we should remove this and do all this work inside op_create_worker #[op2] #[string] pub fn op_worker_threads_filename

( @@ -88,30 +83,5 @@ where url_path.to_path_buf(), )); } - let node_resolver = state.borrow::(); - match node_resolver - .url_to_node_resolution(url) - .map_err(WorkerThreadsFilenameError::UrlToNodeResolution)? - { - NodeResolution::Esm(u) => Ok(u.to_string()), - NodeResolution::CommonJs(u) => wrap_cjs(u), - NodeResolution::BuiltIn(_) => { - Err(WorkerThreadsFilenameError::NeitherEsmNorCjs) - } - } -} - -/// -/// Wrap a CJS file-URL and the required setup in a stringified `data:`-URL -/// -fn wrap_cjs(url: Url) -> Result { - let path = url - .to_file_path() - .map_err(|_| WorkerThreadsFilenameError::UrlToPath)?; - let filename = path.file_name().unwrap().to_string_lossy(); - Ok(format!( - "data:text/javascript,import {{ createRequire }} from \"node:module\";\ - const require = createRequire(\"{}\"); require(\"./{}\");", - url, filename, - )) + Ok(url.to_string()) } diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js index 7935903a8d..296d819aa5 100644 --- a/ext/node/polyfills/01_require.js +++ b/ext/node/polyfills/01_require.js @@ -1071,13 +1071,35 @@ Module._extensions[".js"] = function (module, filename) { } else if (pkg?.type === "commonjs") { format = "commonjs"; } - } else if (StringPrototypeEndsWith(filename, ".cjs")) { - format = "commonjs"; } module._compile(content, filename, format); }; +Module._extensions[".ts"] = + Module._extensions[".jsx"] = + Module._extensions[".tsx"] = + function (module, filename) { + const content = op_require_read_file(filename); + + let format; + const pkg = op_require_read_closest_package_json(filename); + if (pkg?.type === "module") { + format = "module"; + } else if (pkg?.type === "commonjs") { + format = "commonjs"; + } + + module._compile(content, filename, format); + }; + +Module._extensions[".cjs"] = + Module._extensions[".cts"] = + function (module, filename) { + const content = op_require_read_file(filename); + module._compile(content, filename, "commonjs"); + }; + function loadESMFromCJS(module, filename, code) { const namespace = op_import_sync( url.pathToFileURL(filename).toString(), @@ -1087,7 +1109,10 @@ function loadESMFromCJS(module, filename, code) { module.exports = namespace; } -Module._extensions[".mjs"] = function (module, filename) { +Module._extensions[".mjs"] = Module._extensions[".mts"] = function ( + module, + filename, +) { loadESMFromCJS(module, filename); }; diff --git a/resolvers/deno/fs.rs b/resolvers/deno/fs.rs index b08be37982..44495fa7c2 100644 --- a/resolvers/deno/fs.rs +++ b/resolvers/deno/fs.rs @@ -15,13 +15,3 @@ pub trait DenoResolverFs { fn is_dir_sync(&self, path: &Path) -> bool; fn read_dir_sync(&self, dir_path: &Path) -> std::io::Result>; } - -pub(crate) struct DenoPkgJsonFsAdapter<'a, Fs: DenoResolverFs>(pub &'a Fs); - -impl<'a, Fs: DenoResolverFs> deno_package_json::fs::DenoPkgJsonFs - for DenoPkgJsonFsAdapter<'a, Fs> -{ - fn read_to_string_lossy(&self, path: &Path) -> std::io::Result { - self.0.read_to_string_lossy(path) - } -} diff --git a/resolvers/deno/npm/byonm.rs b/resolvers/deno/npm/byonm.rs index 3394b3e501..b85117052c 100644 --- a/resolvers/deno/npm/byonm.rs +++ b/resolvers/deno/npm/byonm.rs @@ -10,16 +10,17 @@ use deno_package_json::PackageJsonDepValue; use deno_path_util::url_to_file_path; use deno_semver::package::PackageReq; use deno_semver::Version; +use node_resolver::env::NodeResolverEnv; use node_resolver::errors::PackageFolderResolveError; use node_resolver::errors::PackageFolderResolveIoError; use node_resolver::errors::PackageJsonLoadError; use node_resolver::errors::PackageNotFoundError; -use node_resolver::load_pkg_json; +use node_resolver::InNpmPackageChecker; use node_resolver::NpmResolver; +use node_resolver::PackageJsonResolverRc; use thiserror::Error; use url::Url; -use crate::fs::DenoPkgJsonFsAdapter; use crate::fs::DenoResolverFs; use super::local::normalize_pkg_name_for_node_modules_deno_folder; @@ -36,32 +37,41 @@ pub enum ByonmResolvePkgFolderFromDenoReqError { Io(#[from] std::io::Error), } -pub struct ByonmNpmResolverCreateOptions { - pub fs: Fs, +pub struct ByonmNpmResolverCreateOptions< + Fs: DenoResolverFs, + TEnv: NodeResolverEnv, +> { // todo(dsherret): investigate removing this pub root_node_modules_dir: Option, + pub fs: Fs, + pub pkg_json_resolver: PackageJsonResolverRc, } #[derive(Debug)] -pub struct ByonmNpmResolver { +pub struct ByonmNpmResolver { fs: Fs, + pkg_json_resolver: PackageJsonResolverRc, root_node_modules_dir: Option, } -impl Clone for ByonmNpmResolver { +impl Clone + for ByonmNpmResolver +{ fn clone(&self) -> Self { Self { fs: self.fs.clone(), + pkg_json_resolver: self.pkg_json_resolver.clone(), root_node_modules_dir: self.root_node_modules_dir.clone(), } } } -impl ByonmNpmResolver { - pub fn new(options: ByonmNpmResolverCreateOptions) -> Self { +impl ByonmNpmResolver { + pub fn new(options: ByonmNpmResolverCreateOptions) -> Self { Self { - fs: options.fs, root_node_modules_dir: options.root_node_modules_dir, + fs: options.fs, + pkg_json_resolver: options.pkg_json_resolver, } } @@ -73,7 +83,7 @@ impl ByonmNpmResolver { &self, path: &Path, ) -> Result>, PackageJsonLoadError> { - load_pkg_json(&DenoPkgJsonFsAdapter(&self.fs), path) + self.pkg_json_resolver.load_package_json(path) } /// Finds the ancestor package.json that contains the specified dependency. @@ -290,8 +300,10 @@ impl ByonmNpmResolver { } } -impl NpmResolver - for ByonmNpmResolver +impl< + Fs: DenoResolverFs + Send + Sync + std::fmt::Debug, + TEnv: NodeResolverEnv, + > NpmResolver for ByonmNpmResolver { fn resolve_package_folder_from_package( &self, @@ -342,7 +354,12 @@ impl NpmResolver .into() }) } +} +#[derive(Debug)] +pub struct ByonmInNpmPackageChecker; + +impl InNpmPackageChecker for ByonmInNpmPackageChecker { fn in_npm_package(&self, specifier: &Url) -> bool { specifier.scheme() == "file" && specifier diff --git a/resolvers/deno/npm/mod.rs b/resolvers/deno/npm/mod.rs index 9d885cad31..45e2341c78 100644 --- a/resolvers/deno/npm/mod.rs +++ b/resolvers/deno/npm/mod.rs @@ -3,6 +3,7 @@ mod byonm; mod local; +pub use byonm::ByonmInNpmPackageChecker; pub use byonm::ByonmNpmResolver; pub use byonm::ByonmNpmResolverCreateOptions; pub use byonm::ByonmResolvePkgFolderFromDenoReqError; diff --git a/resolvers/deno/sloppy_imports.rs b/resolvers/deno/sloppy_imports.rs index e215e87686..7aba5b771a 100644 --- a/resolvers/deno/sloppy_imports.rs +++ b/resolvers/deno/sloppy_imports.rs @@ -232,7 +232,7 @@ impl SloppyImportsResolver { | MediaType::Tsx | MediaType::Json | MediaType::Wasm - | MediaType::TsBuildInfo + | MediaType::Css | MediaType::SourceMap => { return None; } diff --git a/resolvers/node/analyze.rs b/resolvers/node/analyze.rs index 009296006a..c7415933d7 100644 --- a/resolvers/node/analyze.rs +++ b/resolvers/node/analyze.rs @@ -19,18 +19,19 @@ use anyhow::Error as AnyError; use url::Url; use crate::env::NodeResolverEnv; -use crate::package_json::load_pkg_json; +use crate::npm::InNpmPackageCheckerRc; use crate::resolution::NodeResolverRc; use crate::NodeModuleKind; use crate::NodeResolutionMode; use crate::NpmResolverRc; +use crate::PackageJsonResolverRc; use crate::PathClean; #[derive(Debug, Clone)] -pub enum CjsAnalysis { +pub enum CjsAnalysis<'a> { /// File was found to be an ES module and the translator should /// load the code as ESM. - Esm(String), + Esm(Cow<'a, str>), Cjs(CjsAnalysisExports), } @@ -50,11 +51,11 @@ pub trait CjsCodeAnalyzer { /// already has it. If the source is needed by the implementation, /// then it can use the provided source, or otherwise load it if /// necessary. - async fn analyze_cjs( + async fn analyze_cjs<'a>( &self, specifier: &Url, - maybe_source: Option, - ) -> Result; + maybe_source: Option>, + ) -> Result, AnyError>; } pub struct NodeCodeTranslator< @@ -63,8 +64,10 @@ pub struct NodeCodeTranslator< > { cjs_code_analyzer: TCjsCodeAnalyzer, env: TNodeResolverEnv, + in_npm_pkg_checker: InNpmPackageCheckerRc, node_resolver: NodeResolverRc, npm_resolver: NpmResolverRc, + pkg_json_resolver: PackageJsonResolverRc, } impl @@ -73,14 +76,18 @@ impl pub fn new( cjs_code_analyzer: TCjsCodeAnalyzer, env: TNodeResolverEnv, + in_npm_pkg_checker: InNpmPackageCheckerRc, node_resolver: NodeResolverRc, npm_resolver: NpmResolverRc, + pkg_json_resolver: PackageJsonResolverRc, ) -> Self { Self { cjs_code_analyzer, env, + in_npm_pkg_checker, node_resolver, npm_resolver, + pkg_json_resolver, } } @@ -90,11 +97,11 @@ impl /// For all discovered reexports the analysis will be performed recursively. /// /// If successful a source code for equivalent ES module is returned. - pub async fn translate_cjs_to_esm( + pub async fn translate_cjs_to_esm<'a>( &self, entry_specifier: &Url, - source: Option, - ) -> Result { + source: Option>, + ) -> Result, AnyError> { let mut temp_var_count = 0; let analysis = self @@ -108,7 +115,7 @@ impl }; let mut source = vec![ - r#"import {createRequire as __internalCreateRequire} from "node:module"; + r#"import {createRequire as __internalCreateRequire, Module as __internalModule } from "node:module"; const require = __internalCreateRequire(import.meta.url);"# .to_string(), ]; @@ -135,7 +142,12 @@ impl } source.push(format!( - "const mod = require(\"{}\");", + r#"let mod; + if (import.meta.main) {{ + mod = __internalModule._load("{0}", null, true) + }} else {{ + mod = require("{0}"); + }}"#, url_to_file_path(entry_specifier) .unwrap() .to_str() @@ -159,7 +171,7 @@ impl source.push("export default mod;".to_string()); let translated_source = source.join("\n"); - Ok(translated_source) + Ok(Cow::Owned(translated_source)) } async fn analyze_reexports<'a>( @@ -174,7 +186,7 @@ impl struct Analysis { reexport_specifier: url::Url, referrer: url::Url, - analysis: CjsAnalysis, + analysis: CjsAnalysis<'static>, } type AnalysisFuture<'a> = LocalBoxFuture<'a, Result>; @@ -329,8 +341,9 @@ impl }?; let package_json_path = module_dir.join("package.json"); - let maybe_package_json = - load_pkg_json(self.env.pkg_json_fs(), &package_json_path)?; + let maybe_package_json = self + .pkg_json_resolver + .load_package_json(&package_json_path)?; if let Some(package_json) = maybe_package_json { if let Some(exports) = &package_json.exports { return Some( @@ -356,8 +369,9 @@ impl if self.env.is_dir_sync(&d) { // subdir might have a package.json that specifies the entrypoint let package_json_path = d.join("package.json"); - let maybe_package_json = - load_pkg_json(self.env.pkg_json_fs(), &package_json_path)?; + let maybe_package_json = self + .pkg_json_resolver + .load_package_json(&package_json_path)?; if let Some(package_json) = maybe_package_json { if let Some(main) = package_json.main(NodeModuleKind::Cjs) { return Ok(Some(url_from_file_path(&d.join(main).clean())?)); @@ -382,7 +396,7 @@ impl // as a fallback, attempt to resolve it via the ancestor directories let mut last = referrer_path.as_path(); while let Some(parent) = last.parent() { - if !self.npm_resolver.in_npm_package_at_dir_path(parent) { + if !self.in_npm_pkg_checker.in_npm_package_at_dir_path(parent) { break; } let path = if parent.ends_with("node_modules") { diff --git a/resolvers/node/errors.rs b/resolvers/node/errors.rs index 4ba829eda5..aacbecefb4 100644 --- a/resolvers/node/errors.rs +++ b/resolvers/node/errors.rs @@ -81,29 +81,6 @@ pub trait NodeJsErrorCoded { fn code(&self) -> NodeJsErrorCode; } -kinded_err!( - ResolvePkgSubpathFromDenoModuleError, - ResolvePkgSubpathFromDenoModuleErrorKind -); - -impl NodeJsErrorCoded for ResolvePkgSubpathFromDenoModuleError { - fn code(&self) -> NodeJsErrorCode { - use ResolvePkgSubpathFromDenoModuleErrorKind::*; - match self.as_kind() { - PackageSubpathResolve(e) => e.code(), - UrlToNodeResolution(e) => e.code(), - } - } -} - -#[derive(Debug, Error)] -pub enum ResolvePkgSubpathFromDenoModuleErrorKind { - #[error(transparent)] - PackageSubpathResolve(#[from] PackageSubpathResolveError), - #[error(transparent)] - UrlToNodeResolution(#[from] UrlToNodeResolutionError), -} - // todo(https://github.com/denoland/deno_core/issues/810): make this a TypeError #[derive(Debug, Clone, Error)] #[error( @@ -394,37 +371,6 @@ impl NodeJsErrorCoded for CanonicalizingPkgJsonDirError { } } -#[derive(Debug, Error)] -#[error("TypeScript files are not supported in npm packages: {specifier}")] -pub struct TypeScriptNotSupportedInNpmError { - pub specifier: Url, -} - -impl NodeJsErrorCoded for TypeScriptNotSupportedInNpmError { - fn code(&self) -> NodeJsErrorCode { - NodeJsErrorCode::ERR_UNKNOWN_FILE_EXTENSION - } -} - -kinded_err!(UrlToNodeResolutionError, UrlToNodeResolutionErrorKind); - -impl NodeJsErrorCoded for UrlToNodeResolutionError { - fn code(&self) -> NodeJsErrorCode { - match self.as_kind() { - UrlToNodeResolutionErrorKind::TypeScriptNotSupported(e) => e.code(), - UrlToNodeResolutionErrorKind::ClosestPkgJson(e) => e.code(), - } - } -} - -#[derive(Debug, Error)] -pub enum UrlToNodeResolutionErrorKind { - #[error(transparent)] - TypeScriptNotSupported(#[from] TypeScriptNotSupportedInNpmError), - #[error(transparent)] - ClosestPkgJson(#[from] ClosestPkgJsonError), -} - // todo(https://github.com/denoland/deno_core/issues/810): make this a TypeError #[derive(Debug, Error)] #[error( @@ -533,8 +479,6 @@ pub enum NodeResolveErrorKind { TypesNotFound(#[from] TypesNotFoundError), #[error(transparent)] FinalizeResolution(#[from] FinalizeResolutionError), - #[error(transparent)] - UrlToNodeResolution(#[from] UrlToNodeResolutionError), } kinded_err!(FinalizeResolutionError, FinalizeResolutionErrorKind); @@ -728,8 +672,6 @@ pub enum ResolvePkgJsonBinExportError { MissingPkgJson { pkg_json_path: PathBuf }, #[error("Failed resolving binary export. {message}")] InvalidBinProperty { message: String }, - #[error(transparent)] - UrlToNodeResolution(#[from] UrlToNodeResolutionError), } #[derive(Debug, Error)] diff --git a/resolvers/node/lib.rs b/resolvers/node/lib.rs index f03f770486..18b0a85363 100644 --- a/resolvers/node/lib.rs +++ b/resolvers/node/lib.rs @@ -13,9 +13,12 @@ mod resolution; mod sync; pub use deno_package_json::PackageJson; +pub use npm::InNpmPackageChecker; +pub use npm::InNpmPackageCheckerRc; pub use npm::NpmResolver; pub use npm::NpmResolverRc; -pub use package_json::load_pkg_json; +pub use package_json::PackageJsonResolver; +pub use package_json::PackageJsonResolverRc; pub use package_json::PackageJsonThreadLocalCache; pub use path::PathClean; pub use resolution::parse_npm_pkg_name; diff --git a/resolvers/node/npm.rs b/resolvers/node/npm.rs index 6b5f21db62..2132f0b545 100644 --- a/resolvers/node/npm.rs +++ b/resolvers/node/npm.rs @@ -22,7 +22,13 @@ pub trait NpmResolver: std::fmt::Debug + MaybeSend + MaybeSync { specifier: &str, referrer: &Url, ) -> Result; +} +#[allow(clippy::disallowed_types)] +pub type InNpmPackageCheckerRc = crate::sync::MaybeArc; + +/// Checks if a provided specifier is in an npm package. +pub trait InNpmPackageChecker: std::fmt::Debug + MaybeSend + MaybeSync { fn in_npm_package(&self, specifier: &Url) -> bool; fn in_npm_package_at_dir_path(&self, path: &Path) -> bool { diff --git a/resolvers/node/package_json.rs b/resolvers/node/package_json.rs index de750f1d7e..6967779e5d 100644 --- a/resolvers/node/package_json.rs +++ b/resolvers/node/package_json.rs @@ -2,15 +2,21 @@ use deno_package_json::PackageJson; use deno_package_json::PackageJsonRc; +use deno_path_util::strip_unc_prefix; use std::cell::RefCell; use std::collections::HashMap; use std::io::ErrorKind; use std::path::Path; use std::path::PathBuf; +use url::Url; +use crate::env::NodeResolverEnv; +use crate::errors::CanonicalizingPkgJsonDirError; +use crate::errors::ClosestPkgJsonError; use crate::errors::PackageJsonLoadError; -// use a thread local cache so that workers have their own distinct cache +// todo(dsherret): this isn't exactly correct and we should change it to instead +// be created per worker and passed down as a ctor arg to the pkg json resolver thread_local! { static CACHE: RefCell> = RefCell::new(HashMap::new()); } @@ -33,21 +39,91 @@ impl deno_package_json::PackageJsonCache for PackageJsonThreadLocalCache { } } -/// Helper to load a package.json file using the thread local cache -/// in node_resolver. -pub fn load_pkg_json( - fs: &dyn deno_package_json::fs::DenoPkgJsonFs, - path: &Path, -) -> Result, PackageJsonLoadError> { - let result = - PackageJson::load_from_path(path, fs, Some(&PackageJsonThreadLocalCache)); - match result { - Ok(pkg_json) => Ok(Some(pkg_json)), - Err(deno_package_json::PackageJsonLoadError::Io { source, .. }) - if source.kind() == ErrorKind::NotFound => - { +#[allow(clippy::disallowed_types)] +pub type PackageJsonResolverRc = + crate::sync::MaybeArc>; + +#[derive(Debug)] +pub struct PackageJsonResolver { + env: TEnv, +} + +impl PackageJsonResolver { + pub fn new(env: TEnv) -> Self { + Self { env } + } + + pub fn get_closest_package_json( + &self, + url: &Url, + ) -> Result, ClosestPkgJsonError> { + let Ok(file_path) = deno_path_util::url_to_file_path(url) else { + return Ok(None); + }; + self.get_closest_package_json_from_path(&file_path) + } + + pub fn get_closest_package_json_from_path( + &self, + file_path: &Path, + ) -> Result, ClosestPkgJsonError> { + // we use this for deno compile using byonm because the script paths + // won't be in virtual file system, but the package.json paths will be + fn canonicalize_first_ancestor_exists( + dir_path: &Path, + env: &TEnv, + ) -> Result, std::io::Error> { + for ancestor in dir_path.ancestors() { + match env.realpath_sync(ancestor) { + Ok(dir_path) => return Ok(Some(dir_path)), + Err(err) if err.kind() == std::io::ErrorKind::NotFound => { + // keep searching + } + Err(err) => return Err(err), + } + } Ok(None) } - Err(err) => Err(PackageJsonLoadError(err)), + + let parent_dir = file_path.parent().unwrap(); + let Some(start_dir) = canonicalize_first_ancestor_exists( + parent_dir, &self.env, + ) + .map_err(|source| CanonicalizingPkgJsonDirError { + dir_path: parent_dir.to_path_buf(), + source, + })? + else { + return Ok(None); + }; + let start_dir = strip_unc_prefix(start_dir); + for current_dir in start_dir.ancestors() { + let package_json_path = current_dir.join("package.json"); + if let Some(pkg_json) = self.load_package_json(&package_json_path)? { + return Ok(Some(pkg_json)); + } + } + + Ok(None) + } + + pub fn load_package_json( + &self, + path: &Path, + ) -> Result, PackageJsonLoadError> { + let result = PackageJson::load_from_path( + path, + self.env.pkg_json_fs(), + Some(&PackageJsonThreadLocalCache), + ); + match result { + Ok(pkg_json) => Ok(Some(pkg_json)), + Err(deno_package_json::PackageJsonLoadError::Io { source, .. }) + if source.kind() == ErrorKind::NotFound => + { + Ok(None) + } + Err(err) => Err(PackageJsonLoadError(err)), + } } } diff --git a/resolvers/node/resolution.rs b/resolvers/node/resolution.rs index 811583a5ee..d44539e978 100644 --- a/resolvers/node/resolution.rs +++ b/resolvers/node/resolution.rs @@ -6,9 +6,6 @@ use std::path::PathBuf; use anyhow::bail; use anyhow::Error as AnyError; -use deno_media_type::MediaType; -use deno_package_json::PackageJsonRc; -use deno_path_util::strip_unc_prefix; use deno_path_util::url_from_file_path; use serde_json::Map; use serde_json::Value; @@ -16,8 +13,6 @@ use url::Url; use crate::env::NodeResolverEnv; use crate::errors; -use crate::errors::CanonicalizingPkgJsonDirError; -use crate::errors::ClosestPkgJsonError; use crate::errors::DataUrlReferrerError; use crate::errors::FinalizeResolutionError; use crate::errors::InvalidModuleSpecifierError; @@ -32,7 +27,6 @@ use crate::errors::PackageExportsResolveError; use crate::errors::PackageImportNotDefinedError; use crate::errors::PackageImportsResolveError; use crate::errors::PackageImportsResolveErrorKind; -use crate::errors::PackageJsonLoadError; use crate::errors::PackagePathNotExportedError; use crate::errors::PackageResolveError; use crate::errors::PackageSubpathResolveError; @@ -42,14 +36,13 @@ use crate::errors::PackageTargetResolveError; use crate::errors::PackageTargetResolveErrorKind; use crate::errors::ResolveBinaryCommandsError; use crate::errors::ResolvePkgJsonBinExportError; -use crate::errors::ResolvePkgSubpathFromDenoModuleError; -use crate::errors::TypeScriptNotSupportedInNpmError; use crate::errors::TypesNotFoundError; use crate::errors::TypesNotFoundErrorData; use crate::errors::UnsupportedDirImportError; use crate::errors::UnsupportedEsmUrlSchemeError; -use crate::errors::UrlToNodeResolutionError; +use crate::npm::InNpmPackageCheckerRc; use crate::NpmResolverRc; +use crate::PackageJsonResolverRc; use crate::PathClean; use deno_package_json::PackageJson; @@ -73,16 +66,14 @@ impl NodeResolutionMode { #[derive(Debug)] pub enum NodeResolution { - Esm(Url), - CommonJs(Url), + Module(Url), BuiltIn(String), } impl NodeResolution { pub fn into_url(self) -> Url { match self { - Self::Esm(u) => u, - Self::CommonJs(u) => u, + Self::Module(u) => u, Self::BuiltIn(specifier) => { if specifier.starts_with("node:") { Url::parse(&specifier).unwrap() @@ -92,42 +83,6 @@ impl NodeResolution { } } } - - pub fn into_specifier_and_media_type( - resolution: Option, - ) -> (Url, MediaType) { - match resolution { - Some(NodeResolution::CommonJs(specifier)) => { - let media_type = MediaType::from_specifier(&specifier); - ( - specifier, - match media_type { - MediaType::JavaScript | MediaType::Jsx => MediaType::Cjs, - MediaType::TypeScript | MediaType::Tsx => MediaType::Cts, - MediaType::Dts => MediaType::Dcts, - _ => media_type, - }, - ) - } - Some(NodeResolution::Esm(specifier)) => { - let media_type = MediaType::from_specifier(&specifier); - ( - specifier, - match media_type { - MediaType::JavaScript | MediaType::Jsx => MediaType::Mjs, - MediaType::TypeScript | MediaType::Tsx => MediaType::Mts, - MediaType::Dts => MediaType::Dmts, - _ => media_type, - }, - ) - } - Some(resolution) => (resolution.into_url(), MediaType::Dts), - None => ( - Url::parse("internal:///missing_dependency.d.ts").unwrap(), - MediaType::Dts, - ), - } - } } #[allow(clippy::disallowed_types)] @@ -136,16 +91,28 @@ pub type NodeResolverRc = crate::sync::MaybeArc>; #[derive(Debug)] pub struct NodeResolver { env: TEnv, + in_npm_pkg_checker: InNpmPackageCheckerRc, npm_resolver: NpmResolverRc, + pkg_json_resolver: PackageJsonResolverRc, } impl NodeResolver { - pub fn new(env: TEnv, npm_resolver: NpmResolverRc) -> Self { - Self { env, npm_resolver } + pub fn new( + env: TEnv, + in_npm_pkg_checker: InNpmPackageCheckerRc, + npm_resolver: NpmResolverRc, + pkg_json_resolver: PackageJsonResolverRc, + ) -> Self { + Self { + env, + in_npm_pkg_checker, + npm_resolver, + pkg_json_resolver, + } } pub fn in_npm_package(&self, specifier: &Url) -> bool { - self.npm_resolver.in_npm_package(specifier) + self.in_npm_pkg_checker.in_npm_package(specifier) } /// This function is an implementation of `defaultResolve` in @@ -166,7 +133,7 @@ impl NodeResolver { if let Ok(url) = Url::parse(specifier) { if url.scheme() == "data" { - return Ok(NodeResolution::Esm(url)); + return Ok(NodeResolution::Module(url)); } if let Some(module_name) = @@ -191,7 +158,7 @@ impl NodeResolver { let url = referrer .join(specifier) .map_err(|source| DataUrlReferrerError { source })?; - return Ok(NodeResolution::Esm(url)); + return Ok(NodeResolution::Module(url)); } } @@ -212,7 +179,7 @@ impl NodeResolver { }; let url = self.finalize_resolution(url, Some(referrer))?; - let resolve_response = self.url_to_node_resolution(url)?; + let resolve_response = NodeResolution::Module(url); // TODO(bartlomieju): skipped checking errors for commonJS resolution and // "preserveSymlinksMain"/"preserveSymlinks" options. Ok(resolve_response) @@ -236,6 +203,7 @@ impl NodeResolver { })?) } else if specifier.starts_with('#') { let pkg_config = self + .pkg_json_resolver .get_closest_package_json(referrer) .map_err(PackageImportsResolveErrorKind::ClosestPkgJson) .map_err(|err| PackageImportsResolveError(Box::new(err)))?; @@ -332,7 +300,7 @@ impl NodeResolver { package_subpath: Option<&str>, maybe_referrer: Option<&Url>, mode: NodeResolutionMode, - ) -> Result { + ) -> Result { let node_module_kind = NodeModuleKind::Esm; let package_subpath = package_subpath .map(|s| format!("./{s}")) @@ -345,10 +313,9 @@ impl NodeResolver { DEFAULT_CONDITIONS, mode, )?; - let resolve_response = self.url_to_node_resolution(resolved_url)?; // TODO(bartlomieju): skipped checking errors for commonJS resolution and // "preserveSymlinksMain"/"preserveSymlinks" options. - Ok(resolve_response) + Ok(resolved_url) } pub fn resolve_binary_commands( @@ -356,7 +323,9 @@ impl NodeResolver { package_folder: &Path, ) -> Result, ResolveBinaryCommandsError> { let pkg_json_path = package_folder.join("package.json"); - let Some(package_json) = self.load_package_json(&pkg_json_path)? else { + let Some(package_json) = + self.pkg_json_resolver.load_package_json(&pkg_json_path)? + else { return Ok(Vec::new()); }; @@ -381,9 +350,11 @@ impl NodeResolver { &self, package_folder: &Path, sub_path: Option<&str>, - ) -> Result { + ) -> Result { let pkg_json_path = package_folder.join("package.json"); - let Some(package_json) = self.load_package_json(&pkg_json_path)? else { + let Some(package_json) = + self.pkg_json_resolver.load_package_json(&pkg_json_path)? + else { return Err(ResolvePkgJsonBinExportError::MissingPkgJson { pkg_json_path, }); @@ -396,37 +367,9 @@ impl NodeResolver { })?; let url = url_from_file_path(&package_folder.join(bin_entry)).unwrap(); - let resolve_response = self.url_to_node_resolution(url)?; // TODO(bartlomieju): skipped checking errors for commonJS resolution and // "preserveSymlinksMain"/"preserveSymlinks" options. - Ok(resolve_response) - } - - pub fn url_to_node_resolution( - &self, - url: Url, - ) -> Result { - let url_str = url.as_str().to_lowercase(); - if url_str.starts_with("http") || url_str.ends_with(".json") { - Ok(NodeResolution::Esm(url)) - } else if url_str.ends_with(".js") || url_str.ends_with(".d.ts") { - let maybe_package_config = self.get_closest_package_json(&url)?; - match maybe_package_config { - Some(c) if c.typ == "module" => Ok(NodeResolution::Esm(url)), - Some(_) => Ok(NodeResolution::CommonJs(url)), - None => Ok(NodeResolution::Esm(url)), - } - } else if url_str.ends_with(".mjs") || url_str.ends_with(".d.mts") { - Ok(NodeResolution::Esm(url)) - } else if url_str.ends_with(".ts") || url_str.ends_with(".mts") { - if self.in_npm_package(&url) { - Err(TypeScriptNotSupportedInNpmError { specifier: url }.into()) - } else { - Ok(NodeResolution::Esm(url)) - } - } else { - Ok(NodeResolution::CommonJs(url)) - } + Ok(url) } /// Checks if the resolved file has a corresponding declaration file. @@ -1101,7 +1044,9 @@ impl NodeResolver { let (package_name, package_subpath, _is_scoped) = parse_npm_pkg_name(specifier, referrer)?; - if let Some(package_config) = self.get_closest_package_json(referrer)? { + if let Some(package_config) = + self.pkg_json_resolver.get_closest_package_json(referrer)? + { // ResolveSelf if package_config.name.as_ref() == Some(&package_name) { if let Some(exports) = &package_config.exports { @@ -1216,7 +1161,10 @@ impl NodeResolver { mode: NodeResolutionMode, ) -> Result { let package_json_path = package_dir_path.join("package.json"); - match self.load_package_json(&package_json_path)? { + match self + .pkg_json_resolver + .load_package_json(&package_json_path)? + { Some(pkg_json) => self.resolve_package_subpath( &pkg_json, package_subpath, @@ -1337,70 +1285,6 @@ impl NodeResolver { } } - pub fn get_closest_package_json( - &self, - url: &Url, - ) -> Result, ClosestPkgJsonError> { - let Ok(file_path) = deno_path_util::url_to_file_path(url) else { - return Ok(None); - }; - self.get_closest_package_json_from_path(&file_path) - } - - pub fn get_closest_package_json_from_path( - &self, - file_path: &Path, - ) -> Result, ClosestPkgJsonError> { - // we use this for deno compile using byonm because the script paths - // won't be in virtual file system, but the package.json paths will be - fn canonicalize_first_ancestor_exists( - dir_path: &Path, - env: &dyn NodeResolverEnv, - ) -> Result, std::io::Error> { - for ancestor in dir_path.ancestors() { - match env.realpath_sync(ancestor) { - Ok(dir_path) => return Ok(Some(dir_path)), - Err(err) if err.kind() == std::io::ErrorKind::NotFound => { - // keep searching - } - Err(err) => return Err(err), - } - } - Ok(None) - } - - let parent_dir = file_path.parent().unwrap(); - let Some(start_dir) = canonicalize_first_ancestor_exists( - parent_dir, &self.env, - ) - .map_err(|source| CanonicalizingPkgJsonDirError { - dir_path: parent_dir.to_path_buf(), - source, - })? - else { - return Ok(None); - }; - let start_dir = strip_unc_prefix(start_dir); - for current_dir in start_dir.ancestors() { - let package_json_path = current_dir.join("package.json"); - if let Some(pkg_json) = self.load_package_json(&package_json_path)? { - return Ok(Some(pkg_json)); - } - } - - Ok(None) - } - - pub fn load_package_json( - &self, - package_json_path: &Path, - ) -> Result, PackageJsonLoadError> { - crate::package_json::load_pkg_json( - self.env.pkg_json_fs(), - package_json_path, - ) - } - pub(super) fn legacy_main_resolve( &self, package_json: &PackageJson, diff --git a/runtime/errors.rs b/runtime/errors.rs index a5c436e751..ada26ec35f 100644 --- a/runtime/errors.rs +++ b/runtime/errors.rs @@ -1048,8 +1048,6 @@ mod node { WorkerThreadsFilenameError::UrlToPathString => "Error", WorkerThreadsFilenameError::UrlToPath => "Error", WorkerThreadsFilenameError::FileNotFound(_) => "Error", - WorkerThreadsFilenameError::NeitherEsmNorCjs => "Error", - WorkerThreadsFilenameError::UrlToNodeResolution(_) => "Error", WorkerThreadsFilenameError::Fs(e) => super::get_fs_error(e), } } @@ -1058,11 +1056,13 @@ mod node { match error { RequireError::UrlParse(e) => get_url_parse_error_class(e), RequireError::Permission(e) => get_error_class_name(e).unwrap_or("Error"), - RequireError::PackageExportsResolve(_) => "Error", - RequireError::PackageJsonLoad(_) => "Error", - RequireError::ClosestPkgJson(_) => "Error", - RequireError::FilePathConversion(_) => "Error", - RequireError::PackageImportsResolve(_) => "Error", + RequireError::PackageExportsResolve(_) + | RequireError::PackageJsonLoad(_) + | RequireError::ClosestPkgJson(_) + | RequireError::FilePathConversion(_) + | RequireError::UrlConversion(_) + | RequireError::ReadModule(_) + | RequireError::PackageImportsResolve(_) => "Error", RequireError::Fs(e) | RequireError::UnableToGetCwd(e) => { super::get_fs_error(e) } diff --git a/runtime/shared.rs b/runtime/shared.rs index 02dfd18719..f7d76f67a7 100644 --- a/runtime/shared.rs +++ b/runtime/shared.rs @@ -98,6 +98,7 @@ pub fn maybe_transpile_source( imports_not_used_as_values: deno_ast::ImportsNotUsedAsValues::Remove, ..Default::default() }, + &deno_ast::TranspileModuleOptions::default(), &deno_ast::EmitOptions { source_map: if cfg!(debug_assertions) { SourceMapOption::Separate @@ -109,9 +110,9 @@ pub fn maybe_transpile_source( )? .into_source(); - let maybe_source_map: Option = - transpiled_source.source_map.map(|sm| sm.into()); - let source_text = String::from_utf8(transpiled_source.source)?; - + let maybe_source_map: Option = transpiled_source + .source_map + .map(|sm| sm.into_bytes().into()); + let source_text = transpiled_source.text; Ok((source_text.into(), maybe_source_map)) } diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs index db9f79556e..a07dd56c83 100644 --- a/tests/integration/run_tests.rs +++ b/tests/integration/run_tests.rs @@ -3605,7 +3605,8 @@ fn running_declaration_files() { temp_dir.write(file, ""); context .new_command() - .args_vec(["run", file]) + // todo(dsherret): investigate why --allow-read is required here + .args_vec(["run", "--allow-read", file]) .run() .skip_output_check() .assert_exit_code(0); diff --git a/tests/registry/npm/@denotest/type-commonjs/1.0.0/index.js b/tests/registry/npm/@denotest/type-commonjs/1.0.0/index.js index cb0ff5c3b5..d3f80a0495 100644 --- a/tests/registry/npm/@denotest/type-commonjs/1.0.0/index.js +++ b/tests/registry/npm/@denotest/type-commonjs/1.0.0/index.js @@ -1 +1,5 @@ -export {}; +// this module is declared as CommonJS, but during loading we'll +// discover it's ESM and load it fine +export function add(a, b) { + return a + b; +} diff --git a/tests/specs/check/css_import/exists_run_with_check.out b/tests/specs/check/css_import/exists_run_with_check.out index 1a1dafeb74..315769e40c 100644 --- a/tests/specs/check/css_import/exists_run_with_check.out +++ b/tests/specs/check/css_import/exists_run_with_check.out @@ -1,3 +1,3 @@ -error: Expected a JavaScript or TypeScript module, but identified a Unknown module. Importing these types of modules is currently not supported. +error: Expected a JavaScript or TypeScript module, but identified a Css module. Importing these types of modules is currently not supported. Specifier: file:///[WILDLINE]/app.css at file:///[WILDLINE]/exists.ts:2:8 diff --git a/tests/specs/compile/cjs/__test__.jsonc b/tests/specs/compile/cjs/__test__.jsonc new file mode 100644 index 0000000000..9bdcf4724f --- /dev/null +++ b/tests/specs/compile/cjs/__test__.jsonc @@ -0,0 +1,24 @@ +{ + "tempDir": true, + "steps": [{ + "if": "unix", + "args": "compile --output main main.js", + "output": "[WILDCARD]" + }, { + "if": "unix", + "commandName": "./main", + "args": [], + "output": "output.out", + "exitCode": 0 + }, { + "if": "windows", + "args": "compile --output main.exe main.js", + "output": "[WILDCARD]" + }, { + "if": "windows", + "commandName": "./main.exe", + "args": [], + "output": "output.out", + "exitCode": 0 + }] +} diff --git a/tests/specs/compile/cjs/add.cjs b/tests/specs/compile/cjs/add.cjs new file mode 100644 index 0000000000..bf90601267 --- /dev/null +++ b/tests/specs/compile/cjs/add.cjs @@ -0,0 +1 @@ +module.exports = (a, b) => a + b; diff --git a/tests/specs/compile/cjs/divide.cts b/tests/specs/compile/cjs/divide.cts new file mode 100644 index 0000000000..d89a600a4e --- /dev/null +++ b/tests/specs/compile/cjs/divide.cts @@ -0,0 +1 @@ +module.exports.divide = (a: number, b: number) => a / b; diff --git a/tests/specs/compile/cjs/main.js b/tests/specs/compile/cjs/main.js new file mode 100644 index 0000000000..c2a8c7be02 --- /dev/null +++ b/tests/specs/compile/cjs/main.js @@ -0,0 +1,5 @@ +import { add } from "./reexport.cjs"; +import { multiply } from "./multiply.cts"; + +console.log(add(1, 2)); +console.log(multiply(2, 3)); diff --git a/tests/specs/compile/cjs/multiply.cts b/tests/specs/compile/cjs/multiply.cts new file mode 100644 index 0000000000..3c0618cfc5 --- /dev/null +++ b/tests/specs/compile/cjs/multiply.cts @@ -0,0 +1,4 @@ +/// +exports.multiply = function (a: number, b: number): number { + return require("./divide.cts").divide(a, 1 / b); +}; diff --git a/tests/specs/compile/cjs/output.out b/tests/specs/compile/cjs/output.out new file mode 100644 index 0000000000..2559e5c49e --- /dev/null +++ b/tests/specs/compile/cjs/output.out @@ -0,0 +1,2 @@ +3 +6 diff --git a/tests/specs/compile/cjs/reexport.cjs b/tests/specs/compile/cjs/reexport.cjs new file mode 100644 index 0000000000..af7cecfdf4 --- /dev/null +++ b/tests/specs/compile/cjs/reexport.cjs @@ -0,0 +1 @@ +module.exports.add = require("./add.cjs"); diff --git a/tests/specs/compile/detect_cjs/__test__.jsonc b/tests/specs/compile/detect_cjs/__test__.jsonc index 32bebb7a57..0abf121f05 100644 --- a/tests/specs/compile/detect_cjs/__test__.jsonc +++ b/tests/specs/compile/detect_cjs/__test__.jsonc @@ -1,24 +1,27 @@ { "tempDir": true, "steps": [{ + "args": "install", + "output": "[WILDCARD]" + }, { "if": "unix", - "args": "compile --allow-read --output main main.js", + "args": "compile --output main main.js", "output": "compile.out" }, { "if": "unix", "commandName": "./main", "args": [], "output": "output.out", - "exitCode": 1 + "exitCode": 0 }, { "if": "windows", - "args": "compile --allow-read --output main.exe main.js", + "args": "compile --output main.exe main.js", "output": "compile.out" }, { "if": "windows", "commandName": "./main.exe", "args": [], "output": "output.out", - "exitCode": 1 + "exitCode": 0 }] } diff --git a/tests/specs/compile/detect_cjs/add.js b/tests/specs/compile/detect_cjs/add.js index 2a886fbc18..94b0263f0e 100644 --- a/tests/specs/compile/detect_cjs/add.js +++ b/tests/specs/compile/detect_cjs/add.js @@ -1,3 +1,3 @@ module.exports.add = function (a, b) { - return a + b; + return require("./subtract.ts").subtract(a, -b); }; diff --git a/tests/specs/compile/detect_cjs/compile.out b/tests/specs/compile/detect_cjs/compile.out index 6509b7f29c..913e363c3e 100644 --- a/tests/specs/compile/detect_cjs/compile.out +++ b/tests/specs/compile/detect_cjs/compile.out @@ -1,3 +1,2 @@ -Warning --unstable-detect-cjs is not properly supported in deno compile. The compiled executable may encounter runtime errors. Check file:///[WILDLINE]/main.js Compile file:///[WILDLINE] diff --git a/tests/specs/compile/detect_cjs/output.out b/tests/specs/compile/detect_cjs/output.out index e1c27b8dcf..00750edc07 100644 --- a/tests/specs/compile/detect_cjs/output.out +++ b/tests/specs/compile/detect_cjs/output.out @@ -1,2 +1 @@ -error: Uncaught SyntaxError: The requested module './add.js' does not provide an export named 'add' - at (file:///[WILDLINE]) +3 diff --git a/tests/specs/compile/detect_cjs/package.json b/tests/specs/compile/detect_cjs/package.json index 5bbefffbab..6e65b32ed5 100644 --- a/tests/specs/compile/detect_cjs/package.json +++ b/tests/specs/compile/detect_cjs/package.json @@ -1,3 +1,6 @@ { - "type": "commonjs" + "type": "commonjs", + "dependencies": { + "@types/node": "*" + } } diff --git a/tests/specs/compile/detect_cjs/subtract.ts b/tests/specs/compile/detect_cjs/subtract.ts new file mode 100644 index 0000000000..e4f6760b77 --- /dev/null +++ b/tests/specs/compile/detect_cjs/subtract.ts @@ -0,0 +1,2 @@ +/// +module.exports.subtract = (a: number, b: number) => a - b; diff --git a/tests/specs/npm/require_type_commonjs/__test__.jsonc b/tests/specs/npm/require_type_commonjs/__test__.jsonc index c9ba97ff52..a71173ce37 100644 --- a/tests/specs/npm/require_type_commonjs/__test__.jsonc +++ b/tests/specs/npm/require_type_commonjs/__test__.jsonc @@ -1,5 +1,4 @@ { "args": "run --allow-read --quiet main.ts", - "output": "main.out", - "exitCode": 1 + "output": "main.out" } diff --git a/tests/specs/npm/require_type_commonjs/main.out b/tests/specs/npm/require_type_commonjs/main.out index d715db8a94..00750edc07 100644 --- a/tests/specs/npm/require_type_commonjs/main.out +++ b/tests/specs/npm/require_type_commonjs/main.out @@ -1,4 +1 @@ -error: 'import', and 'export' cannot be used outside of module code at file://[WILDCARD]/@denotest/type-commonjs/1.0.0/index.js:1:1 - - export {}; - ~~~~~~ +3 diff --git a/tests/specs/npm/require_type_commonjs/main.ts b/tests/specs/npm/require_type_commonjs/main.ts index 243eb216e4..95ec6099ec 100644 --- a/tests/specs/npm/require_type_commonjs/main.ts +++ b/tests/specs/npm/require_type_commonjs/main.ts @@ -1 +1,2 @@ -import "npm:@denotest/type-commonjs"; +import { add } from "npm:@denotest/type-commonjs"; +console.log(add(1, 2)); diff --git a/tests/specs/npm/typescript_file_in_package/__test__.jsonc b/tests/specs/npm/typescript_file_in_package/__test__.jsonc index 08979ed257..7b5c5e1b67 100644 --- a/tests/specs/npm/typescript_file_in_package/__test__.jsonc +++ b/tests/specs/npm/typescript_file_in_package/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run typescript_file_in_package/main.ts", - "output": "typescript_file_in_package/main.out", + "args": "run main.ts", + "output": "main.out", "exitCode": 1 } diff --git a/tests/specs/npm/typescript_file_in_package/main.out b/tests/specs/npm/typescript_file_in_package/main.out new file mode 100644 index 0000000000..58290a8737 --- /dev/null +++ b/tests/specs/npm/typescript_file_in_package/main.out @@ -0,0 +1,3 @@ +Download http://localhost:4260/@denotest%2ftypescript-file +Download http://localhost:4260/@denotest/typescript-file/1.0.0.tgz +error: TypeScript files are not supported in npm packages: file:///[WILDCARD]/@denotest/typescript-file/1.0.0/index.ts diff --git a/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.ts b/tests/specs/npm/typescript_file_in_package/main.ts similarity index 100% rename from tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.ts rename to tests/specs/npm/typescript_file_in_package/main.ts diff --git a/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.out b/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.out deleted file mode 100644 index b3faa87900..0000000000 --- a/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.out +++ /dev/null @@ -1,6 +0,0 @@ -Download http://localhost:4260/@denotest%2ftypescript-file -Download http://localhost:4260/@denotest/typescript-file/1.0.0.tgz -error: Could not resolve 'npm:@denotest/typescript-file@1.0.0'. - -Caused by: - TypeScript files are not supported in npm packages: file:///[WILDCARD]/@denotest/typescript-file/1.0.0/index.ts diff --git a/tests/specs/run/cjs/main_module/__test__.jsonc b/tests/specs/run/cjs/main_module/__test__.jsonc new file mode 100644 index 0000000000..e756a63627 --- /dev/null +++ b/tests/specs/run/cjs/main_module/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read main.cjs", + "output": "main.out" +} diff --git a/tests/specs/run/cjs/main_module/main.cjs b/tests/specs/run/cjs/main_module/main.cjs new file mode 100644 index 0000000000..2a4c57ab1c --- /dev/null +++ b/tests/specs/run/cjs/main_module/main.cjs @@ -0,0 +1 @@ +console.log(require.main); diff --git a/tests/specs/run/cjs/main_module/main.out b/tests/specs/run/cjs/main_module/main.out new file mode 100644 index 0000000000..93b86d27e3 --- /dev/null +++ b/tests/specs/run/cjs/main_module/main.out @@ -0,0 +1,5 @@ +Module { + id: ".", + [WILDCARD] + filename: "[WILDCARD]main.cjs", +[WILDCARD] \ No newline at end of file diff --git a/tests/specs/run/cjs_reexport_non_analyzable/__test__.jsonc b/tests/specs/run/cjs/reexport_non_analyzable/__test__.jsonc similarity index 100% rename from tests/specs/run/cjs_reexport_non_analyzable/__test__.jsonc rename to tests/specs/run/cjs/reexport_non_analyzable/__test__.jsonc diff --git a/tests/specs/run/cjs_reexport_non_analyzable/deno.json b/tests/specs/run/cjs/reexport_non_analyzable/deno.json similarity index 100% rename from tests/specs/run/cjs_reexport_non_analyzable/deno.json rename to tests/specs/run/cjs/reexport_non_analyzable/deno.json diff --git a/tests/specs/run/cjs_reexport_non_analyzable/main.ts b/tests/specs/run/cjs/reexport_non_analyzable/main.ts similarity index 100% rename from tests/specs/run/cjs_reexport_non_analyzable/main.ts rename to tests/specs/run/cjs/reexport_non_analyzable/main.ts diff --git a/tests/specs/run/cjs_reexport_non_analyzable/node_modules/foo.cjs b/tests/specs/run/cjs/reexport_non_analyzable/node_modules/foo.cjs similarity index 100% rename from tests/specs/run/cjs_reexport_non_analyzable/node_modules/foo.cjs rename to tests/specs/run/cjs/reexport_non_analyzable/node_modules/foo.cjs diff --git a/tests/specs/run/cjs/unprepared/__test__.jsonc b/tests/specs/run/cjs/unprepared/__test__.jsonc new file mode 100644 index 0000000000..f816bad869 --- /dev/null +++ b/tests/specs/run/cjs/unprepared/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run -A main.ts", + "output": "main.out" +} diff --git a/tests/specs/run/cjs/unprepared/file.cjs b/tests/specs/run/cjs/unprepared/file.cjs new file mode 100644 index 0000000000..ba0c6fa6ff --- /dev/null +++ b/tests/specs/run/cjs/unprepared/file.cjs @@ -0,0 +1,7 @@ +// non-analyzable +const moduleName = "./output.cjs"; +function getModuleName() { + return moduleName; +} + +require(getModuleName()); diff --git a/tests/specs/run/cjs/unprepared/main.out b/tests/specs/run/cjs/unprepared/main.out new file mode 100644 index 0000000000..e965047ad7 --- /dev/null +++ b/tests/specs/run/cjs/unprepared/main.out @@ -0,0 +1 @@ +Hello diff --git a/tests/specs/run/cjs/unprepared/main.ts b/tests/specs/run/cjs/unprepared/main.ts new file mode 100644 index 0000000000..5630b4fbc3 --- /dev/null +++ b/tests/specs/run/cjs/unprepared/main.ts @@ -0,0 +1,7 @@ +// non-analyzable +const moduleName = "./output.cjs"; +function getModuleName() { + return moduleName; +} + +await import(getModuleName()); diff --git a/tests/specs/run/cjs/unprepared/output.cjs b/tests/specs/run/cjs/unprepared/output.cjs new file mode 100644 index 0000000000..54ed3702f5 --- /dev/null +++ b/tests/specs/run/cjs/unprepared/output.cjs @@ -0,0 +1,3 @@ +console.log("Hello"); + +module.exports = 1; diff --git a/tests/specs/run/cts/cjs_import_cts/__test__.jsonc b/tests/specs/run/cts/cjs_import_cts/__test__.jsonc new file mode 100644 index 0000000000..2205183d07 --- /dev/null +++ b/tests/specs/run/cts/cjs_import_cts/__test__.jsonc @@ -0,0 +1,13 @@ +{ + "tests": { + "no_check": { + "args": "run --allow-read main.js", + "output": "main.out" + }, + "check": { + "args": "check main.js", + "output": "check.out", + "exitCode": 1 + } + } +} diff --git a/tests/specs/run/package_json_type/commonjs/add.js b/tests/specs/run/cts/cjs_import_cts/add.cts similarity index 100% rename from tests/specs/run/package_json_type/commonjs/add.js rename to tests/specs/run/cts/cjs_import_cts/add.cts diff --git a/tests/specs/run/cts/cjs_import_cts/check.out b/tests/specs/run/cts/cjs_import_cts/check.out new file mode 100644 index 0000000000..a27e8d7af7 --- /dev/null +++ b/tests/specs/run/cts/cjs_import_cts/check.out @@ -0,0 +1,17 @@ +Check file:///[WILDLINE]main.js +error: TS2580 [ERROR]: Cannot find name 'module'. +module.exports.add = function (a, b) { +~~~~~~ + at file:///[WILDLINE] + +TS7006 [ERROR]: Parameter 'a' implicitly has an 'any' type. +module.exports.add = function (a, b) { + ^ + at file:///[WILDLINE] + +TS7006 [ERROR]: Parameter 'b' implicitly has an 'any' type. +module.exports.add = function (a, b) { + ^ + at file:///[WILDLINE] + +Found 3 errors. diff --git a/tests/specs/run/cts/cjs_import_cts/main.js b/tests/specs/run/cts/cjs_import_cts/main.js new file mode 100644 index 0000000000..9546a0fea5 --- /dev/null +++ b/tests/specs/run/cts/cjs_import_cts/main.js @@ -0,0 +1,3 @@ +import { subtract } from "./subtract.cjs"; + +console.log(subtract(1, 2)); diff --git a/tests/specs/run/cts/cjs_import_cts/main.out b/tests/specs/run/cts/cjs_import_cts/main.out new file mode 100644 index 0000000000..3a2e3f4984 --- /dev/null +++ b/tests/specs/run/cts/cjs_import_cts/main.out @@ -0,0 +1 @@ +-1 diff --git a/tests/specs/run/cts/cjs_import_cts/subtract.cjs b/tests/specs/run/cts/cjs_import_cts/subtract.cjs new file mode 100644 index 0000000000..7dee54346f --- /dev/null +++ b/tests/specs/run/cts/cjs_import_cts/subtract.cjs @@ -0,0 +1,3 @@ +module.exports.subtract = function (a, b) { + return require("./add.cts").add(a, -b); +}; diff --git a/tests/specs/run/cts/import_export_equals/__test__.jsonc b/tests/specs/run/cts/import_export_equals/__test__.jsonc new file mode 100644 index 0000000000..6a5c6db420 --- /dev/null +++ b/tests/specs/run/cts/import_export_equals/__test__.jsonc @@ -0,0 +1,17 @@ +{ + "tests": { + "main": { + "args": "run --check --allow-read=. main.cts", + "output": "main.out" + }, + "mts": { + "args": "run --allow-read=. mod.mts", + "output": "mod.mts.out" + }, + "mts_check": { + "args": "check mod.mts", + "output": "mod.mts.check.out", + "exitCode": 1 + } + } +} diff --git a/tests/specs/run/cts/import_export_equals/add.cts b/tests/specs/run/cts/import_export_equals/add.cts new file mode 100644 index 0000000000..adf3503ac5 --- /dev/null +++ b/tests/specs/run/cts/import_export_equals/add.cts @@ -0,0 +1,3 @@ +export = function (a: number, b: number) { + return a + b; +}; diff --git a/tests/specs/run/cts/import_export_equals/main.cts b/tests/specs/run/cts/import_export_equals/main.cts new file mode 100644 index 0000000000..e5c45f92e0 --- /dev/null +++ b/tests/specs/run/cts/import_export_equals/main.cts @@ -0,0 +1,3 @@ +import add = require("./add.cts"); + +console.log(add(1, 2)); diff --git a/tests/specs/run/cts/import_export_equals/main.out b/tests/specs/run/cts/import_export_equals/main.out new file mode 100644 index 0000000000..e7a973a7d0 --- /dev/null +++ b/tests/specs/run/cts/import_export_equals/main.out @@ -0,0 +1,2 @@ +Check file:///[WILDLINE]/main.cts +3 diff --git a/tests/specs/run/cts/import_export_equals/mod.mts b/tests/specs/run/cts/import_export_equals/mod.mts new file mode 100644 index 0000000000..5fbbd6c6a0 --- /dev/null +++ b/tests/specs/run/cts/import_export_equals/mod.mts @@ -0,0 +1,3 @@ +import add from "./add.cts"; + +console.log(add(1, "test")); diff --git a/tests/specs/run/cts/import_export_equals/mod.mts.check.out b/tests/specs/run/cts/import_export_equals/mod.mts.check.out new file mode 100644 index 0000000000..8703539019 --- /dev/null +++ b/tests/specs/run/cts/import_export_equals/mod.mts.check.out @@ -0,0 +1,5 @@ +Check file:///[WILDLINE]/mod.mts +error: TS2345 [ERROR]: Argument of type 'string' is not assignable to parameter of type 'number'. +console.log(add(1, "test")); + ~~~~~~ + at file:///[WILDLINE]/mod.mts:3:20 diff --git a/tests/specs/run/cts/import_export_equals/mod.mts.out b/tests/specs/run/cts/import_export_equals/mod.mts.out new file mode 100644 index 0000000000..208465a080 --- /dev/null +++ b/tests/specs/run/cts/import_export_equals/mod.mts.out @@ -0,0 +1 @@ +1test diff --git a/tests/specs/run/cts/main/__test__.jsonc b/tests/specs/run/cts/main/__test__.jsonc new file mode 100644 index 0000000000..0157b44e96 --- /dev/null +++ b/tests/specs/run/cts/main/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read main.cts", + "output": "main.out" +} diff --git a/tests/specs/run/cts/main/import_main.cjs b/tests/specs/run/cts/main/import_main.cjs new file mode 100644 index 0000000000..f61e0da2a6 --- /dev/null +++ b/tests/specs/run/cts/main/import_main.cjs @@ -0,0 +1 @@ +require("./main.cts").sayHello(); diff --git a/tests/specs/run/cts/main/main.cts b/tests/specs/run/cts/main/main.cts new file mode 100644 index 0000000000..0b0330686b --- /dev/null +++ b/tests/specs/run/cts/main/main.cts @@ -0,0 +1,5 @@ +module.exports.sayHello = function () { + console.log("Hello"); +}; + +require("./import_main.cjs"); diff --git a/tests/specs/run/cts/main/main.out b/tests/specs/run/cts/main/main.out new file mode 100644 index 0000000000..e965047ad7 --- /dev/null +++ b/tests/specs/run/cts/main/main.out @@ -0,0 +1 @@ +Hello diff --git a/tests/specs/run/package_json_type/commonjs/__test__.jsonc b/tests/specs/run/package_json_type/commonjs/basic/__test__.jsonc similarity index 100% rename from tests/specs/run/package_json_type/commonjs/__test__.jsonc rename to tests/specs/run/package_json_type/commonjs/basic/__test__.jsonc diff --git a/tests/specs/run/package_json_type/commonjs/basic/add.js b/tests/specs/run/package_json_type/commonjs/basic/add.js new file mode 100644 index 0000000000..2a886fbc18 --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/basic/add.js @@ -0,0 +1,3 @@ +module.exports.add = function (a, b) { + return a + b; +}; diff --git a/tests/specs/run/package_json_type/commonjs/deno.jsonc b/tests/specs/run/package_json_type/commonjs/basic/deno.jsonc similarity index 100% rename from tests/specs/run/package_json_type/commonjs/deno.jsonc rename to tests/specs/run/package_json_type/commonjs/basic/deno.jsonc diff --git a/tests/specs/run/package_json_type/commonjs/import_import_meta.js b/tests/specs/run/package_json_type/commonjs/basic/import_import_meta.js similarity index 100% rename from tests/specs/run/package_json_type/commonjs/import_import_meta.js rename to tests/specs/run/package_json_type/commonjs/basic/import_import_meta.js diff --git a/tests/specs/run/package_json_type/commonjs/import_meta.js b/tests/specs/run/package_json_type/commonjs/basic/import_meta.js similarity index 100% rename from tests/specs/run/package_json_type/commonjs/import_meta.js rename to tests/specs/run/package_json_type/commonjs/basic/import_meta.js diff --git a/tests/specs/run/package_json_type/commonjs/main_cjs.js b/tests/specs/run/package_json_type/commonjs/basic/main_cjs.js similarity index 100% rename from tests/specs/run/package_json_type/commonjs/main_cjs.js rename to tests/specs/run/package_json_type/commonjs/basic/main_cjs.js diff --git a/tests/specs/run/package_json_type/commonjs/main_esm.js b/tests/specs/run/package_json_type/commonjs/basic/main_esm.js similarity index 100% rename from tests/specs/run/package_json_type/commonjs/main_esm.js rename to tests/specs/run/package_json_type/commonjs/basic/main_esm.js diff --git a/tests/specs/run/package_json_type/commonjs/main_esm_import_meta.js b/tests/specs/run/package_json_type/commonjs/basic/main_esm_import_meta.js similarity index 100% rename from tests/specs/run/package_json_type/commonjs/main_esm_import_meta.js rename to tests/specs/run/package_json_type/commonjs/basic/main_esm_import_meta.js diff --git a/tests/specs/run/package_json_type/commonjs/main_esm_import_meta.out b/tests/specs/run/package_json_type/commonjs/basic/main_esm_import_meta.out similarity index 100% rename from tests/specs/run/package_json_type/commonjs/main_esm_import_meta.out rename to tests/specs/run/package_json_type/commonjs/basic/main_esm_import_meta.out diff --git a/tests/specs/run/package_json_type/commonjs/main_mix.js b/tests/specs/run/package_json_type/commonjs/basic/main_mix.js similarity index 100% rename from tests/specs/run/package_json_type/commonjs/main_mix.js rename to tests/specs/run/package_json_type/commonjs/basic/main_mix.js diff --git a/tests/specs/run/package_json_type/commonjs/main_mix.out b/tests/specs/run/package_json_type/commonjs/basic/main_mix.out similarity index 100% rename from tests/specs/run/package_json_type/commonjs/main_mix.out rename to tests/specs/run/package_json_type/commonjs/basic/main_mix.out diff --git a/tests/specs/run/package_json_type/commonjs/not_import_meta.js b/tests/specs/run/package_json_type/commonjs/basic/not_import_meta.js similarity index 100% rename from tests/specs/run/package_json_type/commonjs/not_import_meta.js rename to tests/specs/run/package_json_type/commonjs/basic/not_import_meta.js diff --git a/tests/specs/run/package_json_type/commonjs/package.json b/tests/specs/run/package_json_type/commonjs/basic/package.json similarity index 100% rename from tests/specs/run/package_json_type/commonjs/package.json rename to tests/specs/run/package_json_type/commonjs/basic/package.json diff --git a/tests/specs/run/package_json_type/commonjs/tla.js b/tests/specs/run/package_json_type/commonjs/basic/tla.js similarity index 100% rename from tests/specs/run/package_json_type/commonjs/tla.js rename to tests/specs/run/package_json_type/commonjs/basic/tla.js diff --git a/tests/specs/run/package_json_type/commonjs/jsx/__test__.jsonc b/tests/specs/run/package_json_type/commonjs/jsx/__test__.jsonc new file mode 100644 index 0000000000..f815fd72cb --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/jsx/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "tempDir": true, + "args": "run -A --quiet main.jsx", + "output": "main.out" +} diff --git a/tests/specs/run/package_json_type/commonjs/jsx/add.js b/tests/specs/run/package_json_type/commonjs/jsx/add.js new file mode 100644 index 0000000000..2a886fbc18 --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/jsx/add.js @@ -0,0 +1,3 @@ +module.exports.add = function (a, b) { + return a + b; +}; diff --git a/tests/specs/run/package_json_type/commonjs/jsx/deno.jsonc b/tests/specs/run/package_json_type/commonjs/jsx/deno.jsonc new file mode 100644 index 0000000000..192ddb98c4 --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/jsx/deno.jsonc @@ -0,0 +1,10 @@ +{ + "nodeModulesDir": "auto", + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "react" + }, + "unstable": [ + "detect-cjs" + ] +} diff --git a/tests/specs/run/package_json_type/commonjs/jsx/main.jsx b/tests/specs/run/package_json_type/commonjs/jsx/main.jsx new file mode 100644 index 0000000000..1922fce1bb --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/jsx/main.jsx @@ -0,0 +1,7 @@ +const { add } = require("./add.js"); + +console.log(add(1, 2)); + +console.log(

!= null); + +require("./tsx.tsx"); diff --git a/tests/specs/run/package_json_type/commonjs/jsx/main.out b/tests/specs/run/package_json_type/commonjs/jsx/main.out new file mode 100644 index 0000000000..cdcf045418 --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/jsx/main.out @@ -0,0 +1,4 @@ +3 +true +4 +true diff --git a/tests/specs/run/package_json_type/commonjs/jsx/package.json b/tests/specs/run/package_json_type/commonjs/jsx/package.json new file mode 100644 index 0000000000..88afcdcd95 --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/jsx/package.json @@ -0,0 +1,7 @@ +{ + "type": "commonjs", + "dependencies": { + "@types/react": "*", + "react": "*" + } +} diff --git a/tests/specs/run/package_json_type/commonjs/jsx/tsx.tsx b/tests/specs/run/package_json_type/commonjs/jsx/tsx.tsx new file mode 100644 index 0000000000..ad8f0c0a9c --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/jsx/tsx.tsx @@ -0,0 +1,5 @@ +import mod = require("./add.js"); + +console.log(mod.add(2, 2)); + +console.log(
!= null); diff --git a/tests/specs/run/remote_cjs_main/output.out b/tests/specs/run/remote_cjs_main/output.out index f75c33907a..360934acb7 100644 --- a/tests/specs/run/remote_cjs_main/output.out +++ b/tests/specs/run/remote_cjs_main/output.out @@ -1,3 +1,3 @@ Download http://localhost:4545/run/add.cjs -error: Expected a JavaScript or TypeScript module, but identified a Cjs module. Importing these types of modules is currently not supported. +error: Remote CJS modules are not supported. Specifier: http://localhost:4545/run/add.cjs diff --git a/tests/specs/run/require_esm/main.out b/tests/specs/run/require_esm/main.out index d17b1ead55..57b842b345 100644 --- a/tests/specs/run/require_esm/main.out +++ b/tests/specs/run/require_esm/main.out @@ -1,6 +1,6 @@ [Module: null prototype] { sync_js: 1 } [Module: null prototype] { sync_mjs: 1 } -error: Uncaught Error: Top-level await is not allowed in synchronous evaluation +error: Uncaught (in promise) Error: Top-level await is not allowed in synchronous evaluation at loadESMFromCJS (node:module:[WILDCARD]) at Module._compile (node:module:[WILDCARD]) at Object.Module._extensions..js (node:module:[WILDCARD]) diff --git a/tests/testdata/npm/deno_run_cowsay_no_permissions.out b/tests/testdata/npm/deno_run_cowsay_no_permissions.out index 6434620e2e..25b79d9a7d 100644 --- a/tests/testdata/npm/deno_run_cowsay_no_permissions.out +++ b/tests/testdata/npm/deno_run_cowsay_no_permissions.out @@ -1,2 +1,2 @@ -error: Uncaught NotCapable: Requires read access to , specify the required permissions during compilation using `deno compile --allow-read` +error: Uncaught (in promise) NotCapable: Requires read access to , specify the required permissions during compilation using `deno compile --allow-read` [WILDCARD] From 2c8a0e791732ab00907ca11c3a4918ad26ead03f Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Fri, 1 Nov 2024 19:10:35 -0700 Subject: [PATCH 019/227] fix(add): only add npm deps to package.json if it's at least as close as deno.json (#26683) Fixes https://github.com/denoland/deno/issues/26653 --- cli/tools/registry/pm.rs | 26 ++++++++++++++++++- .../package_json_and_deno_json/__test__.jsonc | 23 ++++++++++++++++ .../subdir/deno.json | 4 +++ .../package_json_and_deno_json/subdir/mod.ts | 0 .../subdir/prefer_if_closer_deno.json.out | 9 +++++++ 5 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 tests/specs/add/package_json_and_deno_json/subdir/deno.json create mode 100644 tests/specs/add/package_json_and_deno_json/subdir/mod.ts create mode 100644 tests/specs/add/package_json_and_deno_json/subdir/prefer_if_closer_deno.json.out diff --git a/cli/tools/registry/pm.rs b/cli/tools/registry/pm.rs index d1be901d67..4e03879983 100644 --- a/cli/tools/registry/pm.rs +++ b/cli/tools/registry/pm.rs @@ -1,5 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use std::path::Path; use std::path::PathBuf; use std::sync::Arc; @@ -333,6 +334,14 @@ fn load_configs( Ok((cli_factory, npm_config, deno_config)) } +fn path_distance(a: &Path, b: &Path) -> usize { + let diff = pathdiff::diff_paths(a, b); + let Some(diff) = diff else { + return usize::MAX; + }; + diff.components().count() +} + pub async fn add( flags: Arc, add_flags: AddFlags, @@ -357,6 +366,21 @@ pub async fn add( } } + let start_dir = cli_factory.cli_options()?.start_dir.dir_path(); + + // only prefer to add npm deps to `package.json` if there isn't a closer deno.json. + // example: if deno.json is in the CWD and package.json is in the parent, we should add + // npm deps to deno.json, since it's closer + let prefer_npm_config = match (npm_config.as_ref(), deno_config.as_ref()) { + (Some(npm), Some(deno)) => { + let npm_distance = path_distance(&npm.path, &start_dir); + let deno_distance = path_distance(&deno.path, &start_dir); + npm_distance <= deno_distance + } + (Some(_), None) => true, + (None, _) => false, + }; + let http_client = cli_factory.http_client_provider(); let deps_http_cache = cli_factory.global_http_cache()?; let mut deps_file_fetcher = FileFetcher::new( @@ -455,7 +479,7 @@ pub async fn add( selected_package.selected_version ); - if selected_package.package_name.starts_with("npm:") { + if selected_package.package_name.starts_with("npm:") && prefer_npm_config { if let Some(npm) = &mut npm_config { npm.add(selected_package, dev); } else { diff --git a/tests/specs/add/package_json_and_deno_json/__test__.jsonc b/tests/specs/add/package_json_and_deno_json/__test__.jsonc index 0beee02d15..8d67a07c82 100644 --- a/tests/specs/add/package_json_and_deno_json/__test__.jsonc +++ b/tests/specs/add/package_json_and_deno_json/__test__.jsonc @@ -41,6 +41,29 @@ "output": "good\n" } ] + }, + "only_prefers_package_json_if_closer": { + "steps": [ + { + "cwd": "./subdir", + "args": "add npm:@denotest/esm-basic jsr:@denotest/add npm:@denotest/say-hello", + "output": "[WILDCARD]" + }, + { + "args": [ + "eval", + "console.log(Deno.readTextFileSync('package.json').trim())" + ], + "output": "{}\n" + }, + { + "args": [ + "eval", + "console.log(Deno.readTextFileSync('./subdir/deno.json').trim())" + ], + "output": "subdir/prefer_if_closer_deno.json.out" + } + ] } } } diff --git a/tests/specs/add/package_json_and_deno_json/subdir/deno.json b/tests/specs/add/package_json_and_deno_json/subdir/deno.json new file mode 100644 index 0000000000..cc54bbd8a2 --- /dev/null +++ b/tests/specs/add/package_json_and_deno_json/subdir/deno.json @@ -0,0 +1,4 @@ +{ + "name": "@test/subdir", + "exports": "./mod.ts" +} diff --git a/tests/specs/add/package_json_and_deno_json/subdir/mod.ts b/tests/specs/add/package_json_and_deno_json/subdir/mod.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/specs/add/package_json_and_deno_json/subdir/prefer_if_closer_deno.json.out b/tests/specs/add/package_json_and_deno_json/subdir/prefer_if_closer_deno.json.out new file mode 100644 index 0000000000..8a5819d503 --- /dev/null +++ b/tests/specs/add/package_json_and_deno_json/subdir/prefer_if_closer_deno.json.out @@ -0,0 +1,9 @@ +{ + "name": "@test/subdir", + "exports": "./mod.ts", + "imports": { + "@denotest/add": "jsr:@denotest/add@^1.0.0", + "@denotest/esm-basic": "npm:@denotest/esm-basic@^1.0.0", + "@denotest/say-hello": "npm:@denotest/say-hello@^1.0.0" + } +} From d95f06f20b97839d9a2aaeb590f4ed30b6383b0f Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Mon, 4 Nov 2024 16:36:21 +0000 Subject: [PATCH 020/227] perf(lsp): don't walk coverage directory (#26715) --- cli/lsp/language_server.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 4fa0e3afbc..61a02f036e 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -863,7 +863,10 @@ impl Inner { // We ignore these directories by default because there is a // high likelihood they aren't relevant. Someone can opt-into // them by specifying one of them as an enabled path. - if matches!(dir_name.as_str(), "vendor" | "node_modules" | ".git") { + if matches!( + dir_name.as_str(), + "vendor" | "coverage" | "node_modules" | ".git" + ) { continue; } // ignore cargo target directories for anyone using Deno with Rust @@ -3944,7 +3947,9 @@ mod tests { fn test_walk_workspace() { let temp_dir = TempDir::new(); temp_dir.create_dir_all("root1/vendor/"); + temp_dir.create_dir_all("root1/coverage/"); temp_dir.write("root1/vendor/mod.ts", ""); // no, vendor + temp_dir.write("root1/coverage/mod.ts", ""); // no, coverage temp_dir.create_dir_all("root1/node_modules/"); temp_dir.write("root1/node_modules/mod.ts", ""); // no, node_modules From fb1d33a7111e45e9b414cfe922a5db5ee4daf3ea Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Tue, 5 Nov 2024 02:17:11 +0900 Subject: [PATCH 021/227] chore: update dlint to v0.68.0 for internal (#26711) --- cli/bench/encode_into.js | 3 +-- cli/bench/getrandom.js | 3 +-- cli/bench/op_now.js | 3 +-- cli/bench/secure_curves.js | 3 +-- cli/bench/tty.js | 3 +-- cli/bench/url_parse.js | 3 +-- cli/bench/write_file.js | 3 +-- ext/node/polyfills/_fs/_fs_common.ts | 1 + ext/node/polyfills/_fs/_fs_open.ts | 4 ++-- ext/node/polyfills/_fs/_fs_readv.ts | 1 + ext/node/polyfills/internal/crypto/keygen.ts | 1 + ext/node/polyfills/internal/crypto/random.ts | 1 + ext/node/polyfills/internal_binding/http_parser.ts | 1 + ext/node/polyfills/vm.js | 1 + runtime/js/99_main.js | 1 + tests/node_compat/test/fixtures/child-process-spawn-node.js | 1 + tests/unit/globals_test.ts | 1 + tools/lint.js | 3 ++- tools/util.js | 4 ++-- 19 files changed, 22 insertions(+), 19 deletions(-) diff --git a/cli/bench/encode_into.js b/cli/bench/encode_into.js index 11f5a56d90..ab5e11b04d 100644 --- a/cli/bench/encode_into.js +++ b/cli/bench/encode_into.js @@ -1,6 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -// deno-lint-ignore-file no-console +// deno-lint-ignore-file no-console no-process-globals let [total, count] = typeof Deno !== "undefined" ? Deno.args diff --git a/cli/bench/getrandom.js b/cli/bench/getrandom.js index 3c3ec4aa19..fe99bbcbdf 100644 --- a/cli/bench/getrandom.js +++ b/cli/bench/getrandom.js @@ -1,6 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -// deno-lint-ignore-file no-console +// deno-lint-ignore-file no-console no-process-globals let [total, count] = typeof Deno !== "undefined" ? Deno.args diff --git a/cli/bench/op_now.js b/cli/bench/op_now.js index bcc3ea3c56..7c1427c809 100644 --- a/cli/bench/op_now.js +++ b/cli/bench/op_now.js @@ -1,6 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -// deno-lint-ignore-file no-console +// deno-lint-ignore-file no-console no-process-globals const queueMicrotask = globalThis.queueMicrotask || process.nextTick; let [total, count] = typeof Deno !== "undefined" diff --git a/cli/bench/secure_curves.js b/cli/bench/secure_curves.js index 02d248b23f..912b75cccd 100644 --- a/cli/bench/secure_curves.js +++ b/cli/bench/secure_curves.js @@ -1,6 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -// deno-lint-ignore-file no-console +// deno-lint-ignore-file no-console no-process-globals let [total, count] = typeof Deno !== "undefined" ? Deno.args diff --git a/cli/bench/tty.js b/cli/bench/tty.js index 248a901137..e494e76af7 100644 --- a/cli/bench/tty.js +++ b/cli/bench/tty.js @@ -1,6 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -// deno-lint-ignore-file no-console +// deno-lint-ignore-file no-console no-process-globals const queueMicrotask = globalThis.queueMicrotask || process.nextTick; let [total, count] = typeof Deno !== "undefined" diff --git a/cli/bench/url_parse.js b/cli/bench/url_parse.js index 367cf73f46..9cb0045f64 100644 --- a/cli/bench/url_parse.js +++ b/cli/bench/url_parse.js @@ -1,6 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -// deno-lint-ignore-file no-console +// deno-lint-ignore-file no-console no-process-globals const queueMicrotask = globalThis.queueMicrotask || process.nextTick; let [total, count] = typeof Deno !== "undefined" diff --git a/cli/bench/write_file.js b/cli/bench/write_file.js index 104a23a8db..747503ce2a 100644 --- a/cli/bench/write_file.js +++ b/cli/bench/write_file.js @@ -1,6 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -// deno-lint-ignore-file no-console +// deno-lint-ignore-file no-console no-process-globals const queueMicrotask = globalThis.queueMicrotask || process.nextTick; let [total, count] = typeof Deno !== "undefined" diff --git a/ext/node/polyfills/_fs/_fs_common.ts b/ext/node/polyfills/_fs/_fs_common.ts index ac0bf5a551..a29548bb36 100644 --- a/ext/node/polyfills/_fs/_fs_common.ts +++ b/ext/node/polyfills/_fs/_fs_common.ts @@ -20,6 +20,7 @@ import { notImplemented, TextEncodings, } from "ext:deno_node/_utils.ts"; +import { type Buffer } from "node:buffer"; export type CallbackWithError = (err: ErrnoException | null) => void; diff --git a/ext/node/polyfills/_fs/_fs_open.ts b/ext/node/polyfills/_fs/_fs_open.ts index 8bd989790b..31ca4bb619 100644 --- a/ext/node/polyfills/_fs/_fs_open.ts +++ b/ext/node/polyfills/_fs/_fs_open.ts @@ -147,8 +147,8 @@ export function open( export function openPromise( path: string | Buffer | URL, - flags?: openFlags = "r", - mode? = 0o666, + flags: openFlags = "r", + mode = 0o666, ): Promise { return new Promise((resolve, reject) => { open(path, flags, mode, (err, fd) => { diff --git a/ext/node/polyfills/_fs/_fs_readv.ts b/ext/node/polyfills/_fs/_fs_readv.ts index 384f5e319a..2259f029ae 100644 --- a/ext/node/polyfills/_fs/_fs_readv.ts +++ b/ext/node/polyfills/_fs/_fs_readv.ts @@ -15,6 +15,7 @@ import { maybeCallback } from "ext:deno_node/_fs/_fs_common.ts"; import { validateInteger } from "ext:deno_node/internal/validators.mjs"; import * as io from "ext:deno_io/12_io.js"; import { op_fs_seek_async, op_fs_seek_sync } from "ext:core/ops"; +import process from "node:process"; type Callback = ( err: ErrnoException | null, diff --git a/ext/node/polyfills/internal/crypto/keygen.ts b/ext/node/polyfills/internal/crypto/keygen.ts index a40c76c0d7..44bfd83277 100644 --- a/ext/node/polyfills/internal/crypto/keygen.ts +++ b/ext/node/polyfills/internal/crypto/keygen.ts @@ -29,6 +29,7 @@ import { } from "ext:deno_node/internal/validators.mjs"; import { Buffer } from "node:buffer"; import { KeyFormat, KeyType } from "ext:deno_node/internal/crypto/types.ts"; +import process from "node:process"; import { op_node_generate_dh_group_key, diff --git a/ext/node/polyfills/internal/crypto/random.ts b/ext/node/polyfills/internal/crypto/random.ts index 4219414dc1..a41b868190 100644 --- a/ext/node/polyfills/internal/crypto/random.ts +++ b/ext/node/polyfills/internal/crypto/random.ts @@ -38,6 +38,7 @@ import { ERR_INVALID_ARG_TYPE, ERR_OUT_OF_RANGE, } from "ext:deno_node/internal/errors.ts"; +import { Buffer } from "node:buffer"; export { default as randomBytes } from "ext:deno_node/internal/crypto/_randomBytes.ts"; export { diff --git a/ext/node/polyfills/internal_binding/http_parser.ts b/ext/node/polyfills/internal_binding/http_parser.ts index ca4f896e20..bad10d9851 100644 --- a/ext/node/polyfills/internal_binding/http_parser.ts +++ b/ext/node/polyfills/internal_binding/http_parser.ts @@ -126,6 +126,7 @@ ObjectSetPrototypeOf(HTTPParser.prototype, AsyncWrap.prototype); function defineProps(obj: object, props: Record) { for (const entry of new SafeArrayIterator(ObjectEntries(props))) { ObjectDefineProperty(obj, entry[0], { + __proto__: null, value: entry[1], enumerable: true, writable: true, diff --git a/ext/node/polyfills/vm.js b/ext/node/polyfills/vm.js index 183ddad2f4..b64c847c58 100644 --- a/ext/node/polyfills/vm.js +++ b/ext/node/polyfills/vm.js @@ -182,6 +182,7 @@ function getContextOptions(options) { let defaultContextNameIndex = 1; export function createContext( + // deno-lint-ignore prefer-primordials contextObject = {}, options = { __proto__: null }, ) { diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index 56a5b411bb..4d391dcc3a 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -696,6 +696,7 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) { // are lost. let jupyterNs = undefined; ObjectDefineProperty(finalDenoNs, "jupyter", { + __proto__: null, get() { if (jupyterNs) { return jupyterNs; diff --git a/tests/node_compat/test/fixtures/child-process-spawn-node.js b/tests/node_compat/test/fixtures/child-process-spawn-node.js index d403aabf91..7112567e01 100644 --- a/tests/node_compat/test/fixtures/child-process-spawn-node.js +++ b/tests/node_compat/test/fixtures/child-process-spawn-node.js @@ -1,5 +1,6 @@ const assert = require("assert"); const debug = require('util').debuglog('test'); +const process = require("process"); function onmessage(m) { debug("CHILD got message:", m); diff --git a/tests/unit/globals_test.ts b/tests/unit/globals_test.ts index 45a0458357..6de228e1c9 100644 --- a/tests/unit/globals_test.ts +++ b/tests/unit/globals_test.ts @@ -1,4 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// deno-lint-ignore-file no-node-globals import { assert, diff --git a/tools/lint.js b/tools/lint.js index 1f3f56498b..b591cae0ba 100755 --- a/tools/lint.js +++ b/tools/lint.js @@ -56,12 +56,13 @@ async function dlint() { ":!:cli/tsc/compiler.d.ts", ":!:runtime/examples/", ":!:target/", + ":!:tests/ffi/tests/test.js", ":!:tests/registry/**", ":!:tests/specs/**", ":!:tests/testdata/**", ":!:tests/unit_node/testdata/**", - ":!:tests/wpt/suite/**", ":!:tests/wpt/runner/**", + ":!:tests/wpt/suite/**", ]); if (!sourceFiles.length) { diff --git a/tools/util.js b/tools/util.js index 99133628ce..8c7cea15d8 100644 --- a/tools/util.js +++ b/tools/util.js @@ -11,7 +11,7 @@ export { delay } from "@std/async/delay"; // [toolName] --version output const versions = { - "dlint": "dlint 0.60.0", + "dlint": "dlint 0.68.0", }; const compressed = new Set(["ld64.lld", "rcodesign"]); @@ -178,7 +178,7 @@ export function getPrebuiltToolPath(toolName) { return join(PREBUILT_TOOL_DIR, toolName + executableSuffix); } -const commitId = "b8aac22e0cd7c1c6557a56a813fe0c25486fafee"; +const commitId = "7a3a6fee951b3381c59aa4c907274957f324ce8c"; const downloadUrl = `https://raw.githubusercontent.com/denoland/deno_third_party/${commitId}/prebuilt/${platformDirName}`; From fe9f0ee5934871175758857899fe64e56c397fd5 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Mon, 4 Nov 2024 09:17:21 -0800 Subject: [PATCH 022/227] refactor(runtime/permissions): use concrete error types (#26464) --- Cargo.lock | 1 + cli/args/flags.rs | 3 +- cli/args/flags_net.rs | 2 +- cli/npm/byonm.rs | 2 +- cli/npm/managed/resolvers/common.rs | 2 +- cli/tools/info.rs | 10 +- ext/fetch/lib.rs | 23 +- ext/ffi/call.rs | 14 +- ext/ffi/callback.rs | 6 +- ext/ffi/dlfcn.rs | 6 +- ext/ffi/lib.rs | 11 +- ext/ffi/repr.rs | 86 +-- ext/fs/lib.rs | 50 +- ext/fs/ops.rs | 217 +++----- ext/kv/remote.rs | 13 +- ext/kv/sqlite.rs | 12 +- ext/napi/lib.rs | 15 +- ext/net/lib.rs | 17 +- ext/net/ops.rs | 36 +- ext/node/lib.rs | 34 +- ext/node/ops/fs.rs | 35 +- ext/node/ops/http.rs | 4 +- ext/node/ops/os/mod.rs | 14 +- ext/websocket/lib.rs | 18 +- runtime/errors.rs | 147 ++++-- runtime/ops/fs_events.rs | 5 +- runtime/ops/os/mod.rs | 23 +- runtime/ops/permissions.rs | 43 +- runtime/ops/process.rs | 24 +- runtime/ops/worker_host.rs | 2 +- runtime/permissions.rs | 44 +- runtime/permissions/Cargo.toml | 1 + runtime/permissions/lib.rs | 776 ++++++++++++++++++---------- runtime/permissions/prompter.rs | 69 ++- runtime/snapshot.rs | 64 +-- 35 files changed, 999 insertions(+), 830 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8c7b35ca9f..a8a501716c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1972,6 +1972,7 @@ dependencies = [ "once_cell", "percent-encoding", "serde", + "thiserror", "which 4.4.2", "winapi", ] diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 1a1213aac2..eb77971748 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -3388,8 +3388,7 @@ fn permission_args(app: Command, requires: Option<&'static str>) -> Command { .value_name("IP_OR_HOSTNAME") .help("Allow network access. Optionally specify allowed IP addresses and host names, with ports as necessary") .value_parser(flags_net::validator) - .hide(true) - ; + .hide(true); if let Some(requires) = requires { arg = arg.requires(requires) } diff --git a/cli/args/flags_net.rs b/cli/args/flags_net.rs index 88ffcf0e46..abfcf28382 100644 --- a/cli/args/flags_net.rs +++ b/cli/args/flags_net.rs @@ -51,7 +51,7 @@ pub fn parse(paths: Vec) -> clap::error::Result> { } } else { NetDescriptor::parse(&host_and_port).map_err(|e| { - clap::Error::raw(clap::error::ErrorKind::InvalidValue, format!("{e:?}")) + clap::Error::raw(clap::error::ErrorKind::InvalidValue, e.to_string()) })?; out.push(host_and_port) } diff --git a/cli/npm/byonm.rs b/cli/npm/byonm.rs index 4535b07fc5..45fa4cfd1f 100644 --- a/cli/npm/byonm.rs +++ b/cli/npm/byonm.rs @@ -89,7 +89,7 @@ impl CliNpmResolver for CliByonmNpmResolver { .components() .any(|c| c.as_os_str().to_ascii_lowercase() == "node_modules") { - permissions.check_read_path(path) + permissions.check_read_path(path).map_err(Into::into) } else { Ok(Cow::Borrowed(path)) } diff --git a/cli/npm/managed/resolvers/common.rs b/cli/npm/managed/resolvers/common.rs index 590f8fb25c..eee11c7604 100644 --- a/cli/npm/managed/resolvers/common.rs +++ b/cli/npm/managed/resolvers/common.rs @@ -133,7 +133,7 @@ impl RegistryReadPermissionChecker { } } - permissions.check_read_path(path) + permissions.check_read_path(path).map_err(Into::into) } } diff --git a/cli/tools/info.rs b/cli/tools/info.rs index b53485bd6b..c2f5a8cb8d 100644 --- a/cli/tools/info.rs +++ b/cli/tools/info.rs @@ -645,10 +645,12 @@ impl<'a> GraphDisplayContext<'a> { let message = match err { HttpsChecksumIntegrity(_) => "(checksum integrity error)", Decode(_) => "(loading decode error)", - Loader(err) => match deno_core::error::get_custom_error_class(err) { - Some("NotCapable") => "(not capable, requires --allow-import)", - _ => "(loading error)", - }, + Loader(err) => { + match deno_runtime::errors::get_error_class_name(err) { + Some("NotCapable") => "(not capable, requires --allow-import)", + _ => "(loading error)", + } + } Jsr(_) => "(loading error)", NodeUnknownBuiltinModule(_) => "(unknown node built-in error)", Npm(_) => "(npm loading error)", diff --git a/ext/fetch/lib.rs b/ext/fetch/lib.rs index 4df8dc3d72..7ef26431c2 100644 --- a/ext/fetch/lib.rs +++ b/ext/fetch/lib.rs @@ -39,6 +39,7 @@ use deno_core::OpState; use deno_core::RcRef; use deno_core::Resource; use deno_core::ResourceId; +use deno_permissions::PermissionCheckError; use deno_tls::rustls::RootCertStore; use deno_tls::Proxy; use deno_tls::RootCertStoreProvider; @@ -149,7 +150,7 @@ pub enum FetchError { #[error(transparent)] Resource(deno_core::error::AnyError), #[error(transparent)] - Permission(deno_core::error::AnyError), + Permission(#[from] PermissionCheckError), #[error("NetworkError when attempting to fetch resource")] NetworkError, #[error("Fetching files only supports the GET method: received {0}")] @@ -346,13 +347,13 @@ pub trait FetchPermissions { &mut self, url: &Url, api_name: &str, - ) -> Result<(), deno_core::error::AnyError>; + ) -> Result<(), PermissionCheckError>; #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] fn check_read<'a>( &mut self, p: &'a Path, api_name: &str, - ) -> Result, deno_core::error::AnyError>; + ) -> Result, PermissionCheckError>; } impl FetchPermissions for deno_permissions::PermissionsContainer { @@ -361,7 +362,7 @@ impl FetchPermissions for deno_permissions::PermissionsContainer { &mut self, url: &Url, api_name: &str, - ) -> Result<(), deno_core::error::AnyError> { + ) -> Result<(), PermissionCheckError> { deno_permissions::PermissionsContainer::check_net_url(self, url, api_name) } @@ -370,7 +371,7 @@ impl FetchPermissions for deno_permissions::PermissionsContainer { &mut self, path: &'a Path, api_name: &str, - ) -> Result, deno_core::error::AnyError> { + ) -> Result, PermissionCheckError> { deno_permissions::PermissionsContainer::check_read_path( self, path, @@ -414,9 +415,7 @@ where "file" => { let path = url.to_file_path().map_err(|_| FetchError::NetworkError)?; let permissions = state.borrow_mut::(); - let path = permissions - .check_read(&path, "fetch()") - .map_err(FetchError::Permission)?; + let path = permissions.check_read(&path, "fetch()")?; let url = match path { Cow::Owned(path) => Url::from_file_path(path).unwrap(), Cow::Borrowed(_) => url, @@ -442,9 +441,7 @@ where } "http" | "https" => { let permissions = state.borrow_mut::(); - permissions - .check_net_url(&url, "fetch()") - .map_err(FetchError::Resource)?; + permissions.check_net_url(&url, "fetch()")?; let maybe_authority = extract_authority(&mut url); let uri = url @@ -863,9 +860,7 @@ where if let Some(proxy) = args.proxy.clone() { let permissions = state.borrow_mut::(); let url = Url::parse(&proxy.url)?; - permissions - .check_net_url(&url, "Deno.createHttpClient()") - .map_err(FetchError::Permission)?; + permissions.check_net_url(&url, "Deno.createHttpClient()")?; } let options = state.borrow::(); diff --git a/ext/ffi/call.rs b/ext/ffi/call.rs index ef61dc383e..bbff0ee48f 100644 --- a/ext/ffi/call.rs +++ b/ext/ffi/call.rs @@ -32,7 +32,9 @@ pub enum CallError { #[error("Invalid FFI symbol name: '{0}'")] InvalidSymbol(String), #[error(transparent)] - Permission(deno_core::error::AnyError), + Permission(#[from] deno_permissions::PermissionCheckError), + #[error(transparent)] + Resource(deno_core::error::AnyError), #[error(transparent)] Callback(#[from] super::CallbackError), } @@ -301,9 +303,7 @@ where { let mut state = state.borrow_mut(); let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(CallError::Permission)?; + permissions.check_partial_no_path()?; }; let symbol = PtrSymbol::new(pointer, &def)?; @@ -347,7 +347,7 @@ pub fn op_ffi_call_nonblocking( let resource = state .resource_table .get::(rid) - .map_err(CallError::Permission)?; + .map_err(CallError::Resource)?; let symbols = &resource.symbols; *symbols .get(&symbol) @@ -401,9 +401,7 @@ where { let mut state = state.borrow_mut(); let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(CallError::Permission)?; + permissions.check_partial_no_path()?; }; let symbol = PtrSymbol::new(pointer, &def)?; diff --git a/ext/ffi/callback.rs b/ext/ffi/callback.rs index f33e0413a3..29583c800c 100644 --- a/ext/ffi/callback.rs +++ b/ext/ffi/callback.rs @@ -38,7 +38,7 @@ pub enum CallbackError { #[error(transparent)] Resource(deno_core::error::AnyError), #[error(transparent)] - Permission(deno_core::error::AnyError), + Permission(#[from] deno_permissions::PermissionCheckError), #[error(transparent)] Other(deno_core::error::AnyError), } @@ -572,9 +572,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(CallbackError::Permission)?; + permissions.check_partial_no_path()?; let thread_id: u32 = LOCAL_THREAD_ID.with(|s| { let value = *s.borrow(); diff --git a/ext/ffi/dlfcn.rs b/ext/ffi/dlfcn.rs index 53bdcbc5cc..55909468f8 100644 --- a/ext/ffi/dlfcn.rs +++ b/ext/ffi/dlfcn.rs @@ -30,7 +30,7 @@ pub enum DlfcnError { #[error(transparent)] Dlopen(#[from] dlopen2::Error), #[error(transparent)] - Permission(deno_core::error::AnyError), + Permission(#[from] deno_permissions::PermissionCheckError), #[error(transparent)] Other(deno_core::error::AnyError), } @@ -133,9 +133,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - let path = permissions - .check_partial_with_path(&args.path) - .map_err(DlfcnError::Permission)?; + let path = permissions.check_partial_with_path(&args.path)?; let lib = Library::open(&path).map_err(|e| { dlopen2::Error::OpeningLibraryError(std::io::Error::new( diff --git a/ext/ffi/lib.rs b/ext/ffi/lib.rs index 237f8c3b05..73ec7757ab 100644 --- a/ext/ffi/lib.rs +++ b/ext/ffi/lib.rs @@ -1,7 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -use deno_core::error::AnyError; - use std::mem::size_of; use std::os::raw::c_char; use std::os::raw::c_short; @@ -31,6 +29,7 @@ use symbol::Symbol; pub use call::CallError; pub use callback::CallbackError; +use deno_permissions::PermissionCheckError; pub use dlfcn::DlfcnError; pub use ir::IRError; pub use r#static::StaticError; @@ -48,17 +47,17 @@ const _: () = { pub const UNSTABLE_FEATURE_NAME: &str = "ffi"; pub trait FfiPermissions { - fn check_partial_no_path(&mut self) -> Result<(), AnyError>; + fn check_partial_no_path(&mut self) -> Result<(), PermissionCheckError>; #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] fn check_partial_with_path( &mut self, path: &str, - ) -> Result; + ) -> Result; } impl FfiPermissions for deno_permissions::PermissionsContainer { #[inline(always)] - fn check_partial_no_path(&mut self) -> Result<(), AnyError> { + fn check_partial_no_path(&mut self) -> Result<(), PermissionCheckError> { deno_permissions::PermissionsContainer::check_ffi_partial_no_path(self) } @@ -66,7 +65,7 @@ impl FfiPermissions for deno_permissions::PermissionsContainer { fn check_partial_with_path( &mut self, path: &str, - ) -> Result { + ) -> Result { deno_permissions::PermissionsContainer::check_ffi_partial_with_path( self, path, ) diff --git a/ext/ffi/repr.rs b/ext/ffi/repr.rs index 2f04f4feb4..fd8a2c8e70 100644 --- a/ext/ffi/repr.rs +++ b/ext/ffi/repr.rs @@ -46,7 +46,7 @@ pub enum ReprError { #[error("Invalid pointer pointer, pointer is null")] InvalidPointer, #[error(transparent)] - Permission(deno_core::error::AnyError), + Permission(#[from] deno_permissions::PermissionCheckError), } #[op2(fast)] @@ -58,9 +58,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; Ok(ptr_number as *mut c_void) } @@ -75,9 +73,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; Ok(a == b) } @@ -91,9 +87,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; Ok(buf as *mut c_void) } @@ -107,9 +101,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; let Some(buf) = buf.get_backing_store() else { return Ok(0 as _); @@ -130,9 +122,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; if ptr.is_null() { return Err(ReprError::InvalidOffset); @@ -162,9 +152,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; Ok(ptr as usize) } @@ -181,9 +169,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; if ptr.is_null() { return Err(ReprError::InvalidArrayBuffer); @@ -215,9 +201,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; if src.is_null() { Err(ReprError::InvalidArrayBuffer) @@ -246,9 +230,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; if ptr.is_null() { return Err(ReprError::InvalidCString); @@ -272,9 +254,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; if ptr.is_null() { return Err(ReprError::InvalidBool); @@ -294,9 +274,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; if ptr.is_null() { return Err(ReprError::InvalidU8); @@ -318,9 +296,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; if ptr.is_null() { return Err(ReprError::InvalidI8); @@ -342,9 +318,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; if ptr.is_null() { return Err(ReprError::InvalidU16); @@ -366,9 +340,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; if ptr.is_null() { return Err(ReprError::InvalidI16); @@ -390,9 +362,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; if ptr.is_null() { return Err(ReprError::InvalidU32); @@ -412,9 +382,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; if ptr.is_null() { return Err(ReprError::InvalidI32); @@ -437,9 +405,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; if ptr.is_null() { return Err(ReprError::InvalidU64); @@ -465,9 +431,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; if ptr.is_null() { return Err(ReprError::InvalidI64); @@ -490,9 +454,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; if ptr.is_null() { return Err(ReprError::InvalidF32); @@ -512,9 +474,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; if ptr.is_null() { return Err(ReprError::InvalidF64); @@ -534,9 +494,7 @@ where FP: FfiPermissions + 'static, { let permissions = state.borrow_mut::(); - permissions - .check_partial_no_path() - .map_err(ReprError::Permission)?; + permissions.check_partial_no_path()?; if ptr.is_null() { return Err(ReprError::InvalidPointer); diff --git a/ext/fs/lib.rs b/ext/fs/lib.rs index cd2baf22a9..dd852e6be8 100644 --- a/ext/fs/lib.rs +++ b/ext/fs/lib.rs @@ -22,8 +22,8 @@ pub use crate::sync::MaybeSync; use crate::ops::*; -use deno_core::error::AnyError; use deno_io::fs::FsError; +use deno_permissions::PermissionCheckError; use std::borrow::Cow; use std::path::Path; use std::path::PathBuf; @@ -42,45 +42,51 @@ pub trait FsPermissions { &mut self, path: &str, api_name: &str, - ) -> Result; + ) -> Result; #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] fn check_read_path<'a>( &mut self, path: &'a Path, api_name: &str, - ) -> Result, AnyError>; - fn check_read_all(&mut self, api_name: &str) -> Result<(), AnyError>; + ) -> Result, PermissionCheckError>; + fn check_read_all( + &mut self, + api_name: &str, + ) -> Result<(), PermissionCheckError>; fn check_read_blind( &mut self, p: &Path, display: &str, api_name: &str, - ) -> Result<(), AnyError>; + ) -> Result<(), PermissionCheckError>; #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] fn check_write( &mut self, path: &str, api_name: &str, - ) -> Result; + ) -> Result; #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] fn check_write_path<'a>( &mut self, path: &'a Path, api_name: &str, - ) -> Result, AnyError>; + ) -> Result, PermissionCheckError>; #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] fn check_write_partial( &mut self, path: &str, api_name: &str, - ) -> Result; - fn check_write_all(&mut self, api_name: &str) -> Result<(), AnyError>; + ) -> Result; + fn check_write_all( + &mut self, + api_name: &str, + ) -> Result<(), PermissionCheckError>; fn check_write_blind( &mut self, p: &Path, display: &str, api_name: &str, - ) -> Result<(), AnyError>; + ) -> Result<(), PermissionCheckError>; fn check<'a>( &mut self, @@ -140,7 +146,7 @@ impl FsPermissions for deno_permissions::PermissionsContainer { &mut self, path: &str, api_name: &str, - ) -> Result { + ) -> Result { deno_permissions::PermissionsContainer::check_read(self, path, api_name) } @@ -148,7 +154,7 @@ impl FsPermissions for deno_permissions::PermissionsContainer { &mut self, path: &'a Path, api_name: &str, - ) -> Result, AnyError> { + ) -> Result, PermissionCheckError> { deno_permissions::PermissionsContainer::check_read_path( self, path, @@ -160,7 +166,7 @@ impl FsPermissions for deno_permissions::PermissionsContainer { path: &Path, display: &str, api_name: &str, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionCheckError> { deno_permissions::PermissionsContainer::check_read_blind( self, path, display, api_name, ) @@ -170,7 +176,7 @@ impl FsPermissions for deno_permissions::PermissionsContainer { &mut self, path: &str, api_name: &str, - ) -> Result { + ) -> Result { deno_permissions::PermissionsContainer::check_write(self, path, api_name) } @@ -178,7 +184,7 @@ impl FsPermissions for deno_permissions::PermissionsContainer { &mut self, path: &'a Path, api_name: &str, - ) -> Result, AnyError> { + ) -> Result, PermissionCheckError> { deno_permissions::PermissionsContainer::check_write_path( self, path, api_name, ) @@ -188,7 +194,7 @@ impl FsPermissions for deno_permissions::PermissionsContainer { &mut self, path: &str, api_name: &str, - ) -> Result { + ) -> Result { deno_permissions::PermissionsContainer::check_write_partial( self, path, api_name, ) @@ -199,17 +205,23 @@ impl FsPermissions for deno_permissions::PermissionsContainer { p: &Path, display: &str, api_name: &str, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionCheckError> { deno_permissions::PermissionsContainer::check_write_blind( self, p, display, api_name, ) } - fn check_read_all(&mut self, api_name: &str) -> Result<(), AnyError> { + fn check_read_all( + &mut self, + api_name: &str, + ) -> Result<(), PermissionCheckError> { deno_permissions::PermissionsContainer::check_read_all(self, api_name) } - fn check_write_all(&mut self, api_name: &str) -> Result<(), AnyError> { + fn check_write_all( + &mut self, + api_name: &str, + ) -> Result<(), PermissionCheckError> { deno_permissions::PermissionsContainer::check_write_all(self, api_name) } } diff --git a/ext/fs/ops.rs b/ext/fs/ops.rs index a3f59da4ea..9b76b49e61 100644 --- a/ext/fs/ops.rs +++ b/ext/fs/ops.rs @@ -10,6 +10,12 @@ use std::path::PathBuf; use std::path::StripPrefixError; use std::rc::Rc; +use crate::interface::AccessCheckFn; +use crate::interface::FileSystemRc; +use crate::interface::FsDirEntry; +use crate::interface::FsFileType; +use crate::FsPermissions; +use crate::OpenOptions; use deno_core::op2; use deno_core::CancelFuture; use deno_core::CancelHandle; @@ -20,18 +26,12 @@ use deno_core::ToJsBuffer; use deno_io::fs::FileResource; use deno_io::fs::FsError; use deno_io::fs::FsStat; +use deno_permissions::PermissionCheckError; use rand::rngs::ThreadRng; use rand::thread_rng; use rand::Rng; use serde::Serialize; -use crate::interface::AccessCheckFn; -use crate::interface::FileSystemRc; -use crate::interface::FsDirEntry; -use crate::interface::FsFileType; -use crate::FsPermissions; -use crate::OpenOptions; - #[derive(Debug, thiserror::Error)] pub enum FsOpsError { #[error("{0}")] @@ -39,7 +39,7 @@ pub enum FsOpsError { #[error("{0}")] OperationError(#[source] OperationError), #[error(transparent)] - Permission(deno_core::error::AnyError), + Permission(#[from] PermissionCheckError), #[error(transparent)] Resource(deno_core::error::AnyError), #[error("File name or path {0:?} is not valid UTF-8")] @@ -150,8 +150,7 @@ where let path = fs.cwd()?; state .borrow_mut::

() - .check_read_blind(&path, "CWD", "Deno.cwd()") - .map_err(FsOpsError::Permission)?; + .check_read_blind(&path, "CWD", "Deno.cwd()")?; let path_str = path_into_string(path.into_os_string())?; Ok(path_str) } @@ -166,8 +165,7 @@ where { let d = state .borrow_mut::

() - .check_read(directory, "Deno.chdir()") - .map_err(FsOpsError::Permission)?; + .check_read(directory, "Deno.chdir()")?; state .borrow::() .chdir(&d) @@ -253,8 +251,7 @@ where let path = state .borrow_mut::

() - .check_write(&path, "Deno.mkdirSync()") - .map_err(FsOpsError::Permission)?; + .check_write(&path, "Deno.mkdirSync()")?; let fs = state.borrow::(); fs.mkdir_sync(&path, recursive, Some(mode)) @@ -277,10 +274,7 @@ where let (fs, path) = { let mut state = state.borrow_mut(); - let path = state - .borrow_mut::

() - .check_write(&path, "Deno.mkdir()") - .map_err(FsOpsError::Permission)?; + let path = state.borrow_mut::

().check_write(&path, "Deno.mkdir()")?; (state.borrow::().clone(), path) }; @@ -302,8 +296,7 @@ where { let path = state .borrow_mut::

() - .check_write(&path, "Deno.chmodSync()") - .map_err(FsOpsError::Permission)?; + .check_write(&path, "Deno.chmodSync()")?; let fs = state.borrow::(); fs.chmod_sync(&path, mode).context_path("chmod", &path)?; Ok(()) @@ -320,10 +313,7 @@ where { let (fs, path) = { let mut state = state.borrow_mut(); - let path = state - .borrow_mut::

() - .check_write(&path, "Deno.chmod()") - .map_err(FsOpsError::Permission)?; + let path = state.borrow_mut::

().check_write(&path, "Deno.chmod()")?; (state.borrow::().clone(), path) }; fs.chmod_async(path.clone(), mode) @@ -344,8 +334,7 @@ where { let path = state .borrow_mut::

() - .check_write(&path, "Deno.chownSync()") - .map_err(FsOpsError::Permission)?; + .check_write(&path, "Deno.chownSync()")?; let fs = state.borrow::(); fs.chown_sync(&path, uid, gid) .context_path("chown", &path)?; @@ -364,10 +353,7 @@ where { let (fs, path) = { let mut state = state.borrow_mut(); - let path = state - .borrow_mut::

() - .check_write(&path, "Deno.chown()") - .map_err(FsOpsError::Permission)?; + let path = state.borrow_mut::

().check_write(&path, "Deno.chown()")?; (state.borrow::().clone(), path) }; fs.chown_async(path.clone(), uid, gid) @@ -387,8 +373,7 @@ where { let path = state .borrow_mut::

() - .check_write(path, "Deno.removeSync()") - .map_err(FsOpsError::Permission)?; + .check_write(path, "Deno.removeSync()")?; let fs = state.borrow::(); fs.remove_sync(&path, recursive) @@ -411,13 +396,11 @@ where let path = if recursive { state .borrow_mut::

() - .check_write(&path, "Deno.remove()") - .map_err(FsOpsError::Permission)? + .check_write(&path, "Deno.remove()")? } else { state .borrow_mut::

() - .check_write_partial(&path, "Deno.remove()") - .map_err(FsOpsError::Permission)? + .check_write_partial(&path, "Deno.remove()")? }; (state.borrow::().clone(), path) @@ -440,12 +423,8 @@ where P: FsPermissions + 'static, { let permissions = state.borrow_mut::

(); - let from = permissions - .check_read(from, "Deno.copyFileSync()") - .map_err(FsOpsError::Permission)?; - let to = permissions - .check_write(to, "Deno.copyFileSync()") - .map_err(FsOpsError::Permission)?; + let from = permissions.check_read(from, "Deno.copyFileSync()")?; + let to = permissions.check_write(to, "Deno.copyFileSync()")?; let fs = state.borrow::(); fs.copy_file_sync(&from, &to) @@ -466,12 +445,8 @@ where let (fs, from, to) = { let mut state = state.borrow_mut(); let permissions = state.borrow_mut::

(); - let from = permissions - .check_read(&from, "Deno.copyFile()") - .map_err(FsOpsError::Permission)?; - let to = permissions - .check_write(&to, "Deno.copyFile()") - .map_err(FsOpsError::Permission)?; + let from = permissions.check_read(&from, "Deno.copyFile()")?; + let to = permissions.check_write(&to, "Deno.copyFile()")?; (state.borrow::().clone(), from, to) }; @@ -493,8 +468,7 @@ where { let path = state .borrow_mut::

() - .check_read(&path, "Deno.statSync()") - .map_err(FsOpsError::Permission)?; + .check_read(&path, "Deno.statSync()")?; let fs = state.borrow::(); let stat = fs.stat_sync(&path).context_path("stat", &path)?; let serializable_stat = SerializableStat::from(stat); @@ -514,9 +488,7 @@ where let (fs, path) = { let mut state = state.borrow_mut(); let permissions = state.borrow_mut::

(); - let path = permissions - .check_read(&path, "Deno.stat()") - .map_err(FsOpsError::Permission)?; + let path = permissions.check_read(&path, "Deno.stat()")?; (state.borrow::().clone(), path) }; let stat = fs @@ -537,8 +509,7 @@ where { let path = state .borrow_mut::

() - .check_read(&path, "Deno.lstatSync()") - .map_err(FsOpsError::Permission)?; + .check_read(&path, "Deno.lstatSync()")?; let fs = state.borrow::(); let stat = fs.lstat_sync(&path).context_path("lstat", &path)?; let serializable_stat = SerializableStat::from(stat); @@ -558,9 +529,7 @@ where let (fs, path) = { let mut state = state.borrow_mut(); let permissions = state.borrow_mut::

(); - let path = permissions - .check_read(&path, "Deno.lstat()") - .map_err(FsOpsError::Permission)?; + let path = permissions.check_read(&path, "Deno.lstat()")?; (state.borrow::().clone(), path) }; let stat = fs @@ -581,13 +550,9 @@ where { let fs = state.borrow::().clone(); let permissions = state.borrow_mut::

(); - let path = permissions - .check_read(&path, "Deno.realPathSync()") - .map_err(FsOpsError::Permission)?; + let path = permissions.check_read(&path, "Deno.realPathSync()")?; if path.is_relative() { - permissions - .check_read_blind(&fs.cwd()?, "CWD", "Deno.realPathSync()") - .map_err(FsOpsError::Permission)?; + permissions.check_read_blind(&fs.cwd()?, "CWD", "Deno.realPathSync()")?; } let resolved_path = @@ -610,13 +575,9 @@ where let mut state = state.borrow_mut(); let fs = state.borrow::().clone(); let permissions = state.borrow_mut::

(); - let path = permissions - .check_read(&path, "Deno.realPath()") - .map_err(FsOpsError::Permission)?; + let path = permissions.check_read(&path, "Deno.realPath()")?; if path.is_relative() { - permissions - .check_read_blind(&fs.cwd()?, "CWD", "Deno.realPath()") - .map_err(FsOpsError::Permission)?; + permissions.check_read_blind(&fs.cwd()?, "CWD", "Deno.realPath()")?; } (fs, path) }; @@ -640,8 +601,7 @@ where { let path = state .borrow_mut::

() - .check_read(&path, "Deno.readDirSync()") - .map_err(FsOpsError::Permission)?; + .check_read(&path, "Deno.readDirSync()")?; let fs = state.borrow::(); let entries = fs.read_dir_sync(&path).context_path("readdir", &path)?; @@ -662,8 +622,7 @@ where let mut state = state.borrow_mut(); let path = state .borrow_mut::

() - .check_read(&path, "Deno.readDir()") - .map_err(FsOpsError::Permission)?; + .check_read(&path, "Deno.readDir()")?; (state.borrow::().clone(), path) }; @@ -685,15 +644,9 @@ where P: FsPermissions + 'static, { let permissions = state.borrow_mut::

(); - let _ = permissions - .check_read(&oldpath, "Deno.renameSync()") - .map_err(FsOpsError::Permission)?; - let oldpath = permissions - .check_write(&oldpath, "Deno.renameSync()") - .map_err(FsOpsError::Permission)?; - let newpath = permissions - .check_write(&newpath, "Deno.renameSync()") - .map_err(FsOpsError::Permission)?; + let _ = permissions.check_read(&oldpath, "Deno.renameSync()")?; + let oldpath = permissions.check_write(&oldpath, "Deno.renameSync()")?; + let newpath = permissions.check_write(&newpath, "Deno.renameSync()")?; let fs = state.borrow::(); fs.rename_sync(&oldpath, &newpath) @@ -714,15 +667,9 @@ where let (fs, oldpath, newpath) = { let mut state = state.borrow_mut(); let permissions = state.borrow_mut::

(); - _ = permissions - .check_read(&oldpath, "Deno.rename()") - .map_err(FsOpsError::Permission)?; - let oldpath = permissions - .check_write(&oldpath, "Deno.rename()") - .map_err(FsOpsError::Permission)?; - let newpath = permissions - .check_write(&newpath, "Deno.rename()") - .map_err(FsOpsError::Permission)?; + _ = permissions.check_read(&oldpath, "Deno.rename()")?; + let oldpath = permissions.check_write(&oldpath, "Deno.rename()")?; + let newpath = permissions.check_write(&newpath, "Deno.rename()")?; (state.borrow::().clone(), oldpath, newpath) }; @@ -743,18 +690,10 @@ where P: FsPermissions + 'static, { let permissions = state.borrow_mut::

(); - _ = permissions - .check_read(oldpath, "Deno.linkSync()") - .map_err(FsOpsError::Permission)?; - let oldpath = permissions - .check_write(oldpath, "Deno.linkSync()") - .map_err(FsOpsError::Permission)?; - _ = permissions - .check_read(newpath, "Deno.linkSync()") - .map_err(FsOpsError::Permission)?; - let newpath = permissions - .check_write(newpath, "Deno.linkSync()") - .map_err(FsOpsError::Permission)?; + _ = permissions.check_read(oldpath, "Deno.linkSync()")?; + let oldpath = permissions.check_write(oldpath, "Deno.linkSync()")?; + _ = permissions.check_read(newpath, "Deno.linkSync()")?; + let newpath = permissions.check_write(newpath, "Deno.linkSync()")?; let fs = state.borrow::(); fs.link_sync(&oldpath, &newpath) @@ -775,18 +714,10 @@ where let (fs, oldpath, newpath) = { let mut state = state.borrow_mut(); let permissions = state.borrow_mut::

(); - _ = permissions - .check_read(&oldpath, "Deno.link()") - .map_err(FsOpsError::Permission)?; - let oldpath = permissions - .check_write(&oldpath, "Deno.link()") - .map_err(FsOpsError::Permission)?; - _ = permissions - .check_read(&newpath, "Deno.link()") - .map_err(FsOpsError::Permission)?; - let newpath = permissions - .check_write(&newpath, "Deno.link()") - .map_err(FsOpsError::Permission)?; + _ = permissions.check_read(&oldpath, "Deno.link()")?; + let oldpath = permissions.check_write(&oldpath, "Deno.link()")?; + _ = permissions.check_read(&newpath, "Deno.link()")?; + let newpath = permissions.check_write(&newpath, "Deno.link()")?; (state.borrow::().clone(), oldpath, newpath) }; @@ -811,12 +742,8 @@ where let newpath = PathBuf::from(newpath); let permissions = state.borrow_mut::

(); - permissions - .check_write_all("Deno.symlinkSync()") - .map_err(FsOpsError::Permission)?; - permissions - .check_read_all("Deno.symlinkSync()") - .map_err(FsOpsError::Permission)?; + permissions.check_write_all("Deno.symlinkSync()")?; + permissions.check_read_all("Deno.symlinkSync()")?; let fs = state.borrow::(); fs.symlink_sync(&oldpath, &newpath, file_type) @@ -841,12 +768,8 @@ where let fs = { let mut state = state.borrow_mut(); let permissions = state.borrow_mut::

(); - permissions - .check_write_all("Deno.symlink()") - .map_err(FsOpsError::Permission)?; - permissions - .check_read_all("Deno.symlink()") - .map_err(FsOpsError::Permission)?; + permissions.check_write_all("Deno.symlink()")?; + permissions.check_read_all("Deno.symlink()")?; state.borrow::().clone() }; @@ -868,8 +791,7 @@ where { let path = state .borrow_mut::

() - .check_read(&path, "Deno.readLink()") - .map_err(FsOpsError::Permission)?; + .check_read(&path, "Deno.readLink()")?; let fs = state.borrow::(); @@ -891,8 +813,7 @@ where let mut state = state.borrow_mut(); let path = state .borrow_mut::

() - .check_read(&path, "Deno.readLink()") - .map_err(FsOpsError::Permission)?; + .check_read(&path, "Deno.readLink()")?; (state.borrow::().clone(), path) }; @@ -915,8 +836,7 @@ where { let path = state .borrow_mut::

() - .check_write(path, "Deno.truncateSync()") - .map_err(FsOpsError::Permission)?; + .check_write(path, "Deno.truncateSync()")?; let fs = state.borrow::(); fs.truncate_sync(&path, len) @@ -938,8 +858,7 @@ where let mut state = state.borrow_mut(); let path = state .borrow_mut::

() - .check_write(&path, "Deno.truncate()") - .map_err(FsOpsError::Permission)?; + .check_write(&path, "Deno.truncate()")?; (state.borrow::().clone(), path) }; @@ -962,10 +881,7 @@ pub fn op_fs_utime_sync

( where P: FsPermissions + 'static, { - let path = state - .borrow_mut::

() - .check_write(path, "Deno.utime()") - .map_err(FsOpsError::Permission)?; + let path = state.borrow_mut::

().check_write(path, "Deno.utime()")?; let fs = state.borrow::(); fs.utime_sync(&path, atime_secs, atime_nanos, mtime_secs, mtime_nanos) @@ -988,10 +904,7 @@ where { let (fs, path) = { let mut state = state.borrow_mut(); - let path = state - .borrow_mut::

() - .check_write(&path, "Deno.utime()") - .map_err(FsOpsError::Permission)?; + let path = state.borrow_mut::

().check_write(&path, "Deno.utime()")?; (state.borrow::().clone(), path) }; @@ -1219,16 +1132,12 @@ where { let fs = state.borrow::().clone(); let dir = match dir { - Some(dir) => state - .borrow_mut::

() - .check_write(dir, api_name) - .map_err(FsOpsError::Permission)?, + Some(dir) => state.borrow_mut::

().check_write(dir, api_name)?, None => { let dir = fs.tmp_dir().context("tmpdir")?; state .borrow_mut::

() - .check_write_blind(&dir, "TMP", api_name) - .map_err(FsOpsError::Permission)?; + .check_write_blind(&dir, "TMP", api_name)?; dir } }; @@ -1246,16 +1155,12 @@ where let mut state = state.borrow_mut(); let fs = state.borrow::().clone(); let dir = match dir { - Some(dir) => state - .borrow_mut::

() - .check_write(dir, api_name) - .map_err(FsOpsError::Permission)?, + Some(dir) => state.borrow_mut::

().check_write(dir, api_name)?, None => { let dir = fs.tmp_dir().context("tmpdir")?; state .borrow_mut::

() - .check_write_blind(&dir, "TMP", api_name) - .map_err(FsOpsError::Permission)?; + .check_write_blind(&dir, "TMP", api_name)?; dir } }; diff --git a/ext/kv/remote.rs b/ext/kv/remote.rs index 922853588a..4930aacfe3 100644 --- a/ext/kv/remote.rs +++ b/ext/kv/remote.rs @@ -15,6 +15,7 @@ use deno_core::futures::Stream; use deno_core::OpState; use deno_fetch::create_http_client; use deno_fetch::CreateHttpClientOptions; +use deno_permissions::PermissionCheckError; use deno_tls::rustls::RootCertStore; use deno_tls::Proxy; use deno_tls::RootCertStoreProvider; @@ -45,17 +46,17 @@ impl HttpOptions { } pub trait RemoteDbHandlerPermissions { - fn check_env(&mut self, var: &str) -> Result<(), AnyError>; + fn check_env(&mut self, var: &str) -> Result<(), PermissionCheckError>; fn check_net_url( &mut self, url: &Url, api_name: &str, - ) -> Result<(), AnyError>; + ) -> Result<(), PermissionCheckError>; } impl RemoteDbHandlerPermissions for deno_permissions::PermissionsContainer { #[inline(always)] - fn check_env(&mut self, var: &str) -> Result<(), AnyError> { + fn check_env(&mut self, var: &str) -> Result<(), PermissionCheckError> { deno_permissions::PermissionsContainer::check_env(self, var) } @@ -64,7 +65,7 @@ impl RemoteDbHandlerPermissions for deno_permissions::PermissionsContainer { &mut self, url: &Url, api_name: &str, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionCheckError> { deno_permissions::PermissionsContainer::check_net_url(self, url, api_name) } } @@ -103,7 +104,9 @@ impl denokv_remote::RemotePermissions fn check_net_url(&self, url: &Url) -> Result<(), anyhow::Error> { let mut state = self.state.borrow_mut(); let permissions = state.borrow_mut::

(); - permissions.check_net_url(url, "Deno.openKv") + permissions + .check_net_url(url, "Deno.openKv") + .map_err(Into::into) } } diff --git a/ext/kv/sqlite.rs b/ext/kv/sqlite.rs index 0b4a3693c4..9de5209275 100644 --- a/ext/kv/sqlite.rs +++ b/ext/kv/sqlite.rs @@ -13,20 +13,20 @@ use std::sync::Arc; use std::sync::Mutex; use std::sync::OnceLock; +use crate::DatabaseHandler; use async_trait::async_trait; use deno_core::error::type_error; use deno_core::error::AnyError; use deno_core::unsync::spawn_blocking; use deno_core::OpState; use deno_path_util::normalize_path; +use deno_permissions::PermissionCheckError; pub use denokv_sqlite::SqliteBackendError; use denokv_sqlite::SqliteConfig; use denokv_sqlite::SqliteNotifier; use rand::SeedableRng; use rusqlite::OpenFlags; -use crate::DatabaseHandler; - static SQLITE_NOTIFIERS_MAP: OnceLock>> = OnceLock::new(); @@ -42,13 +42,13 @@ pub trait SqliteDbHandlerPermissions { &mut self, p: &str, api_name: &str, - ) -> Result; + ) -> Result; #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] fn check_write<'a>( &mut self, p: &'a Path, api_name: &str, - ) -> Result, AnyError>; + ) -> Result, PermissionCheckError>; } impl SqliteDbHandlerPermissions for deno_permissions::PermissionsContainer { @@ -57,7 +57,7 @@ impl SqliteDbHandlerPermissions for deno_permissions::PermissionsContainer { &mut self, p: &str, api_name: &str, - ) -> Result { + ) -> Result { deno_permissions::PermissionsContainer::check_read(self, p, api_name) } @@ -66,7 +66,7 @@ impl SqliteDbHandlerPermissions for deno_permissions::PermissionsContainer { &mut self, p: &'a Path, api_name: &str, - ) -> Result, AnyError> { + ) -> Result, PermissionCheckError> { deno_permissions::PermissionsContainer::check_write_path(self, p, api_name) } } diff --git a/ext/napi/lib.rs b/ext/napi/lib.rs index 20f924bdbf..88b8c238df 100644 --- a/ext/napi/lib.rs +++ b/ext/napi/lib.rs @@ -43,7 +43,7 @@ pub enum NApiError { #[error("Unable to find register Node-API module at {}", .0.display())] ModuleNotFound(PathBuf), #[error(transparent)] - Permission(deno_core::error::AnyError), + Permission(#[from] PermissionCheckError), } #[cfg(unix)] @@ -55,6 +55,7 @@ use libloading::os::windows::*; // Expose common stuff for ease of use. // `use deno_napi::*` pub use deno_core::v8; +use deno_permissions::PermissionCheckError; pub use std::ffi::CStr; pub use std::os::raw::c_char; pub use std::os::raw::c_void; @@ -508,20 +509,14 @@ deno_core::extension!(deno_napi, pub trait NapiPermissions { #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] - fn check( - &mut self, - path: &str, - ) -> Result; + fn check(&mut self, path: &str) -> Result; } // NOTE(bartlomieju): for now, NAPI uses `--allow-ffi` flag, but that might // change in the future. impl NapiPermissions for deno_permissions::PermissionsContainer { #[inline(always)] - fn check( - &mut self, - path: &str, - ) -> Result { + fn check(&mut self, path: &str) -> Result { deno_permissions::PermissionsContainer::check_ffi(self, path) } } @@ -553,7 +548,7 @@ where let (async_work_sender, cleanup_hooks, external_ops_tracker, path) = { let mut op_state = op_state.borrow_mut(); let permissions = op_state.borrow_mut::(); - let path = permissions.check(&path).map_err(NApiError::Permission)?; + let path = permissions.check(&path)?; let napi_state = op_state.borrow::(); ( op_state.borrow::().clone(), diff --git a/ext/net/lib.rs b/ext/net/lib.rs index b039965d4c..bf8f58aa27 100644 --- a/ext/net/lib.rs +++ b/ext/net/lib.rs @@ -11,6 +11,7 @@ mod tcp; use deno_core::error::AnyError; use deno_core::OpState; +use deno_permissions::PermissionCheckError; use deno_tls::rustls::RootCertStore; use deno_tls::RootCertStoreProvider; use std::borrow::Cow; @@ -25,25 +26,25 @@ pub trait NetPermissions { &mut self, host: &(T, Option), api_name: &str, - ) -> Result<(), AnyError>; + ) -> Result<(), PermissionCheckError>; #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] fn check_read( &mut self, p: &str, api_name: &str, - ) -> Result; + ) -> Result; #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] fn check_write( &mut self, p: &str, api_name: &str, - ) -> Result; + ) -> Result; #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] fn check_write_path<'a>( &mut self, p: &'a Path, api_name: &str, - ) -> Result, AnyError>; + ) -> Result, PermissionCheckError>; } impl NetPermissions for deno_permissions::PermissionsContainer { @@ -52,7 +53,7 @@ impl NetPermissions for deno_permissions::PermissionsContainer { &mut self, host: &(T, Option), api_name: &str, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionCheckError> { deno_permissions::PermissionsContainer::check_net(self, host, api_name) } @@ -61,7 +62,7 @@ impl NetPermissions for deno_permissions::PermissionsContainer { &mut self, path: &str, api_name: &str, - ) -> Result { + ) -> Result { deno_permissions::PermissionsContainer::check_read(self, path, api_name) } @@ -70,7 +71,7 @@ impl NetPermissions for deno_permissions::PermissionsContainer { &mut self, path: &str, api_name: &str, - ) -> Result { + ) -> Result { deno_permissions::PermissionsContainer::check_write(self, path, api_name) } @@ -79,7 +80,7 @@ impl NetPermissions for deno_permissions::PermissionsContainer { &mut self, path: &'a Path, api_name: &str, - ) -> Result, AnyError> { + ) -> Result, PermissionCheckError> { deno_permissions::PermissionsContainer::check_write_path( self, path, api_name, ) diff --git a/ext/net/ops.rs b/ext/net/ops.rs index 0f92dead0c..35bcff8dcf 100644 --- a/ext/net/ops.rs +++ b/ext/net/ops.rs @@ -81,8 +81,8 @@ pub enum NetError { Io(#[from] std::io::Error), #[error("Another accept task is ongoing")] AcceptTaskOngoing, - #[error("{0}")] - Permission(deno_core::error::AnyError), + #[error(transparent)] + Permission(#[from] deno_permissions::PermissionCheckError), #[error("{0}")] Resource(deno_core::error::AnyError), #[error("No resolved address found")] @@ -195,12 +195,10 @@ where { { let mut s = state.borrow_mut(); - s.borrow_mut::() - .check_net( - &(&addr.hostname, Some(addr.port)), - "Deno.DatagramConn.send()", - ) - .map_err(NetError::Permission)?; + s.borrow_mut::().check_net( + &(&addr.hostname, Some(addr.port)), + "Deno.DatagramConn.send()", + )?; } let addr = resolve_addr(&addr.hostname, addr.port) .await? @@ -369,8 +367,7 @@ where let mut state_ = state.borrow_mut(); state_ .borrow_mut::() - .check_net(&(&addr.hostname, Some(addr.port)), "Deno.connect()") - .map_err(NetError::Permission)?; + .check_net(&(&addr.hostname, Some(addr.port)), "Deno.connect()")?; } let addr = resolve_addr(&addr.hostname, addr.port) @@ -420,8 +417,7 @@ where } state .borrow_mut::() - .check_net(&(&addr.hostname, Some(addr.port)), "Deno.listen()") - .map_err(NetError::Permission)?; + .check_net(&(&addr.hostname, Some(addr.port)), "Deno.listen()")?; let addr = resolve_addr_sync(&addr.hostname, addr.port)? .next() .ok_or_else(|| NetError::NoResolvedAddress)?; @@ -449,8 +445,7 @@ where { state .borrow_mut::() - .check_net(&(&addr.hostname, Some(addr.port)), "Deno.listenDatagram()") - .map_err(NetError::Permission)?; + .check_net(&(&addr.hostname, Some(addr.port)), "Deno.listenDatagram()")?; let addr = resolve_addr_sync(&addr.hostname, addr.port)? .next() .ok_or_else(|| NetError::NoResolvedAddress)?; @@ -647,9 +642,7 @@ where let socker_addr = &ns.socket_addr; let ip = socker_addr.ip().to_string(); let port = socker_addr.port(); - perm - .check_net(&(ip, Some(port)), "Deno.resolveDns()") - .map_err(NetError::Permission)?; + perm.check_net(&(ip, Some(port)), "Deno.resolveDns()")?; } } @@ -834,6 +827,7 @@ mod tests { use deno_core::futures::FutureExt; use deno_core::JsRuntime; use deno_core::RuntimeOptions; + use deno_permissions::PermissionCheckError; use socket2::SockRef; use std::net::Ipv4Addr; use std::net::Ipv6Addr; @@ -1041,7 +1035,7 @@ mod tests { &mut self, _host: &(T, Option), _api_name: &str, - ) -> Result<(), deno_core::error::AnyError> { + ) -> Result<(), PermissionCheckError> { Ok(()) } @@ -1049,7 +1043,7 @@ mod tests { &mut self, p: &str, _api_name: &str, - ) -> Result { + ) -> Result { Ok(PathBuf::from(p)) } @@ -1057,7 +1051,7 @@ mod tests { &mut self, p: &str, _api_name: &str, - ) -> Result { + ) -> Result { Ok(PathBuf::from(p)) } @@ -1065,7 +1059,7 @@ mod tests { &mut self, p: &'a Path, _api_name: &str, - ) -> Result, deno_core::error::AnyError> { + ) -> Result, PermissionCheckError> { Ok(Cow::Borrowed(p)) } } diff --git a/ext/node/lib.rs b/ext/node/lib.rs index db6d08e11e..b08b0493b0 100644 --- a/ext/node/lib.rs +++ b/ext/node/lib.rs @@ -24,6 +24,7 @@ pub mod ops; mod polyfill; pub use deno_package_json::PackageJson; +use deno_permissions::PermissionCheckError; pub use node_resolver::PathClean; pub use ops::ipc::ChildPipeFd; pub use ops::ipc::IpcJsonStreamResource; @@ -45,10 +46,13 @@ pub trait NodePermissions { &mut self, url: &Url, api_name: &str, - ) -> Result<(), AnyError>; + ) -> Result<(), PermissionCheckError>; #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] #[inline(always)] - fn check_read(&mut self, path: &str) -> Result { + fn check_read( + &mut self, + path: &str, + ) -> Result { self.check_read_with_api_name(path, None) } #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] @@ -56,20 +60,24 @@ pub trait NodePermissions { &mut self, path: &str, api_name: Option<&str>, - ) -> Result; + ) -> Result; #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] fn check_read_path<'a>( &mut self, path: &'a Path, - ) -> Result, AnyError>; + ) -> Result, PermissionCheckError>; fn query_read_all(&mut self) -> bool; - fn check_sys(&mut self, kind: &str, api_name: &str) -> Result<(), AnyError>; + fn check_sys( + &mut self, + kind: &str, + api_name: &str, + ) -> Result<(), PermissionCheckError>; #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] fn check_write_with_api_name( &mut self, path: &str, api_name: Option<&str>, - ) -> Result; + ) -> Result; } impl NodePermissions for deno_permissions::PermissionsContainer { @@ -78,7 +86,7 @@ impl NodePermissions for deno_permissions::PermissionsContainer { &mut self, url: &Url, api_name: &str, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionCheckError> { deno_permissions::PermissionsContainer::check_net_url(self, url, api_name) } @@ -87,7 +95,7 @@ impl NodePermissions for deno_permissions::PermissionsContainer { &mut self, path: &str, api_name: Option<&str>, - ) -> Result { + ) -> Result { deno_permissions::PermissionsContainer::check_read_with_api_name( self, path, api_name, ) @@ -96,7 +104,7 @@ impl NodePermissions for deno_permissions::PermissionsContainer { fn check_read_path<'a>( &mut self, path: &'a Path, - ) -> Result, AnyError> { + ) -> Result, PermissionCheckError> { deno_permissions::PermissionsContainer::check_read_path(self, path, None) } @@ -109,13 +117,17 @@ impl NodePermissions for deno_permissions::PermissionsContainer { &mut self, path: &str, api_name: Option<&str>, - ) -> Result { + ) -> Result { deno_permissions::PermissionsContainer::check_write_with_api_name( self, path, api_name, ) } - fn check_sys(&mut self, kind: &str, api_name: &str) -> Result<(), AnyError> { + fn check_sys( + &mut self, + kind: &str, + api_name: &str, + ) -> Result<(), PermissionCheckError> { deno_permissions::PermissionsContainer::check_sys(self, kind, api_name) } } diff --git a/ext/node/ops/fs.rs b/ext/node/ops/fs.rs index 98b3c46a14..9c0e4e1ccf 100644 --- a/ext/node/ops/fs.rs +++ b/ext/node/ops/fs.rs @@ -13,7 +13,7 @@ use crate::NodePermissions; #[derive(Debug, thiserror::Error)] pub enum FsError { #[error(transparent)] - Permission(deno_core::error::AnyError), + Permission(#[from] deno_permissions::PermissionCheckError), #[error("{0}")] Io(#[from] std::io::Error), #[cfg(windows)] @@ -53,8 +53,7 @@ where let mut state = state.borrow_mut(); let path = state .borrow_mut::

() - .check_read_with_api_name(&path, Some("node:fs.exists()")) - .map_err(FsError::Permission)?; + .check_read_with_api_name(&path, Some("node:fs.exists()"))?; (state.borrow::().clone(), path) }; @@ -72,12 +71,10 @@ where { let path = state .borrow_mut::

() - .check_read_with_api_name(path, Some("node:fs.cpSync")) - .map_err(FsError::Permission)?; + .check_read_with_api_name(path, Some("node:fs.cpSync"))?; let new_path = state .borrow_mut::

() - .check_write_with_api_name(new_path, Some("node:fs.cpSync")) - .map_err(FsError::Permission)?; + .check_write_with_api_name(new_path, Some("node:fs.cpSync"))?; let fs = state.borrow::(); fs.cp_sync(&path, &new_path)?; @@ -97,12 +94,10 @@ where let mut state = state.borrow_mut(); let path = state .borrow_mut::

() - .check_read_with_api_name(&path, Some("node:fs.cpSync")) - .map_err(FsError::Permission)?; + .check_read_with_api_name(&path, Some("node:fs.cpSync"))?; let new_path = state .borrow_mut::

() - .check_write_with_api_name(&new_path, Some("node:fs.cpSync")) - .map_err(FsError::Permission)?; + .check_write_with_api_name(&new_path, Some("node:fs.cpSync"))?; (state.borrow::().clone(), path, new_path) }; @@ -136,12 +131,10 @@ where let mut state = state.borrow_mut(); let path = state .borrow_mut::

() - .check_read_with_api_name(&path, Some("node:fs.statfs")) - .map_err(FsError::Permission)?; + .check_read_with_api_name(&path, Some("node:fs.statfs"))?; state .borrow_mut::

() - .check_sys("statfs", "node:fs.statfs") - .map_err(FsError::Permission)?; + .check_sys("statfs", "node:fs.statfs")?; path }; #[cfg(unix)] @@ -279,8 +272,7 @@ where { let path = state .borrow_mut::

() - .check_write_with_api_name(path, Some("node:fs.lutimes")) - .map_err(FsError::Permission)?; + .check_write_with_api_name(path, Some("node:fs.lutimes"))?; let fs = state.borrow::(); fs.lutime_sync(&path, atime_secs, atime_nanos, mtime_secs, mtime_nanos)?; @@ -303,8 +295,7 @@ where let mut state = state.borrow_mut(); let path = state .borrow_mut::

() - .check_write_with_api_name(&path, Some("node:fs.lutimesSync")) - .map_err(FsError::Permission)?; + .check_write_with_api_name(&path, Some("node:fs.lutimesSync"))?; (state.borrow::().clone(), path) }; @@ -326,8 +317,7 @@ where { let path = state .borrow_mut::

() - .check_write_with_api_name(&path, Some("node:fs.lchownSync")) - .map_err(FsError::Permission)?; + .check_write_with_api_name(&path, Some("node:fs.lchownSync"))?; let fs = state.borrow::(); fs.lchown_sync(&path, uid, gid)?; Ok(()) @@ -347,8 +337,7 @@ where let mut state = state.borrow_mut(); let path = state .borrow_mut::

() - .check_write_with_api_name(&path, Some("node:fs.lchown")) - .map_err(FsError::Permission)?; + .check_write_with_api_name(&path, Some("node:fs.lchown"))?; (state.borrow::().clone(), path) }; fs.lchown_async(path, uid, gid).await?; diff --git a/ext/node/ops/http.rs b/ext/node/ops/http.rs index 730e1e482b..69571078fe 100644 --- a/ext/node/ops/http.rs +++ b/ext/node/ops/http.rs @@ -78,9 +78,7 @@ where { let permissions = state.borrow_mut::

(); - permissions - .check_net_url(&url, "ClientRequest") - .map_err(FetchError::Permission)?; + permissions.check_net_url(&url, "ClientRequest")?; } let mut header_map = HeaderMap::new(); diff --git a/ext/node/ops/os/mod.rs b/ext/node/ops/os/mod.rs index ea7e6b99fd..d291277ad4 100644 --- a/ext/node/ops/os/mod.rs +++ b/ext/node/ops/os/mod.rs @@ -14,7 +14,7 @@ pub enum OsError { #[error(transparent)] Priority(priority::PriorityError), #[error(transparent)] - Permission(deno_core::error::AnyError), + Permission(#[from] deno_permissions::PermissionCheckError), #[error("Failed to get cpu info")] FailedToGetCpuInfo, #[error("Failed to get user info")] @@ -31,9 +31,7 @@ where { { let permissions = state.borrow_mut::

(); - permissions - .check_sys("getPriority", "node:os.getPriority()") - .map_err(OsError::Permission)?; + permissions.check_sys("getPriority", "node:os.getPriority()")?; } priority::get_priority(pid).map_err(OsError::Priority) @@ -50,9 +48,7 @@ where { { let permissions = state.borrow_mut::

(); - permissions - .check_sys("setPriority", "node:os.setPriority()") - .map_err(OsError::Permission)?; + permissions.check_sys("setPriority", "node:os.setPriority()")?; } priority::set_priority(pid, priority).map_err(OsError::Priority) @@ -266,9 +262,7 @@ where { { let permissions = state.borrow_mut::

(); - permissions - .check_sys("cpus", "node:os.cpus()") - .map_err(OsError::Permission)?; + permissions.check_sys("cpus", "node:os.cpus()")?; } cpus::cpu_info().ok_or(OsError::FailedToGetCpuInfo) diff --git a/ext/websocket/lib.rs b/ext/websocket/lib.rs index 2a67ac5a17..a5734271cf 100644 --- a/ext/websocket/lib.rs +++ b/ext/websocket/lib.rs @@ -50,6 +50,7 @@ use tokio::io::ReadHalf; use tokio::io::WriteHalf; use tokio::net::TcpStream; +use deno_permissions::PermissionCheckError; use fastwebsockets::CloseCode; use fastwebsockets::FragmentCollectorRead; use fastwebsockets::Frame; @@ -75,7 +76,7 @@ pub enum WebsocketError { #[error(transparent)] Url(url::ParseError), #[error(transparent)] - Permission(deno_core::error::AnyError), + Permission(#[from] PermissionCheckError), #[error(transparent)] Resource(deno_core::error::AnyError), #[error(transparent)] @@ -112,7 +113,7 @@ pub trait WebSocketPermissions { &mut self, _url: &url::Url, _api_name: &str, - ) -> Result<(), deno_core::error::AnyError>; + ) -> Result<(), PermissionCheckError>; } impl WebSocketPermissions for deno_permissions::PermissionsContainer { @@ -121,7 +122,7 @@ impl WebSocketPermissions for deno_permissions::PermissionsContainer { &mut self, url: &url::Url, api_name: &str, - ) -> Result<(), deno_core::error::AnyError> { + ) -> Result<(), PermissionCheckError> { deno_permissions::PermissionsContainer::check_net_url(self, url, api_name) } } @@ -158,13 +159,10 @@ pub fn op_ws_check_permission_and_cancel_handle( where WP: WebSocketPermissions + 'static, { - state - .borrow_mut::() - .check_net_url( - &url::Url::parse(&url).map_err(WebsocketError::Url)?, - &api_name, - ) - .map_err(WebsocketError::Permission)?; + state.borrow_mut::().check_net_url( + &url::Url::parse(&url).map_err(WebsocketError::Url)?, + &api_name, + )?; if cancel_handle { let rid = state diff --git a/runtime/errors.rs b/runtime/errors.rs index ada26ec35f..5051150f27 100644 --- a/runtime/errors.rs +++ b/runtime/errors.rs @@ -12,6 +12,8 @@ use crate::ops::fs_events::FsEventsError; use crate::ops::http::HttpStartError; use crate::ops::os::OsError; +use crate::ops::permissions::PermissionError; +use crate::ops::process::CheckRunPermissionError; use crate::ops::process::ProcessError; use crate::ops::signal::SignalError; use crate::ops::tty::TtyError; @@ -48,6 +50,12 @@ use deno_kv::KvError; use deno_kv::KvMutationError; use deno_napi::NApiError; use deno_net::ops::NetError; +use deno_permissions::ChildPermissionError; +use deno_permissions::NetDescriptorFromUrlParseError; +use deno_permissions::PathResolveError; +use deno_permissions::PermissionCheckError; +use deno_permissions::RunDescriptorParseError; +use deno_permissions::SysDescriptorParseError; use deno_tls::TlsError; use deno_web::BlobError; use deno_web::CompressionError; @@ -63,6 +71,54 @@ use std::error::Error; use std::io; use std::sync::Arc; +fn get_run_descriptor_parse_error(e: &RunDescriptorParseError) -> &'static str { + match e { + RunDescriptorParseError::Which(_) => "Error", + RunDescriptorParseError::PathResolve(e) => get_path_resolve_error(e), + RunDescriptorParseError::EmptyRunQuery => "Error", + } +} + +fn get_sys_descriptor_parse_error(e: &SysDescriptorParseError) -> &'static str { + match e { + SysDescriptorParseError::InvalidKind(_) => "TypeError", + SysDescriptorParseError::Empty => "Error", + } +} + +fn get_path_resolve_error(e: &PathResolveError) -> &'static str { + match e { + PathResolveError::CwdResolve(e) => get_io_error_class(e), + PathResolveError::EmptyPath => "Error", + } +} + +fn get_permission_error_class(e: &PermissionError) -> &'static str { + match e { + PermissionError::InvalidPermissionName(_) => "ReferenceError", + PermissionError::PathResolve(e) => get_path_resolve_error(e), + PermissionError::NetDescriptorParse(_) => "URIError", + PermissionError::SysDescriptorParse(e) => get_sys_descriptor_parse_error(e), + PermissionError::RunDescriptorParse(e) => get_run_descriptor_parse_error(e), + } +} + +fn get_permission_check_error_class(e: &PermissionCheckError) -> &'static str { + match e { + PermissionCheckError::PermissionDenied(_) => "NotCapable", + PermissionCheckError::InvalidFilePath(_) => "URIError", + PermissionCheckError::NetDescriptorForUrlParse(e) => match e { + NetDescriptorFromUrlParseError::MissingHost(_) => "TypeError", + NetDescriptorFromUrlParseError::Host(_) => "URIError", + }, + PermissionCheckError::SysDescriptorParse(e) => { + get_sys_descriptor_parse_error(e) + } + PermissionCheckError::PathResolve(e) => get_path_resolve_error(e), + PermissionCheckError::HostParse(_) => "URIError", + } +} + fn get_dlopen_error_class(error: &dlopen2::Error) -> &'static str { use dlopen2::Error::*; match error { @@ -445,7 +501,7 @@ fn get_napi_error_class(e: &NApiError) -> &'static str { NApiError::InvalidPath | NApiError::LibLoading(_) | NApiError::ModuleNotFound(_) => "TypeError", - NApiError::Permission(e) => get_error_class_name(e).unwrap_or("Error"), + NApiError::Permission(e) => get_permission_check_error_class(e), } } @@ -523,7 +579,7 @@ fn get_ffi_repr_error_class(e: &ReprError) -> &'static str { ReprError::InvalidF32 => "TypeError", ReprError::InvalidF64 => "TypeError", ReprError::InvalidPointer => "TypeError", - ReprError::Permission(e) => get_error_class_name(e).unwrap_or("Error"), + ReprError::Permission(e) => get_permission_check_error_class(e), } } @@ -531,7 +587,7 @@ fn get_ffi_dlfcn_error_class(e: &DlfcnError) -> &'static str { match e { DlfcnError::RegisterSymbol { .. } => "Error", DlfcnError::Dlopen(_) => "Error", - DlfcnError::Permission(e) => get_error_class_name(e).unwrap_or("Error"), + DlfcnError::Permission(e) => get_permission_check_error_class(e), DlfcnError::Other(e) => get_error_class_name(e).unwrap_or("Error"), } } @@ -549,7 +605,7 @@ fn get_ffi_callback_error_class(e: &CallbackError) -> &'static str { match e { CallbackError::Resource(e) => get_error_class_name(e).unwrap_or("Error"), CallbackError::Other(e) => get_error_class_name(e).unwrap_or("Error"), - CallbackError::Permission(e) => get_error_class_name(e).unwrap_or("Error"), + CallbackError::Permission(e) => get_permission_check_error_class(e), } } @@ -558,8 +614,9 @@ fn get_ffi_call_error_class(e: &CallError) -> &'static str { CallError::IR(_) => "TypeError", CallError::NonblockingCallFailure(_) => "Error", CallError::InvalidSymbol(_) => "TypeError", - CallError::Permission(e) => get_error_class_name(e).unwrap_or("Error"), + CallError::Permission(e) => get_permission_check_error_class(e), CallError::Callback(e) => get_ffi_callback_error_class(e), + CallError::Resource(e) => get_error_class_name(e).unwrap_or("Error"), } } @@ -633,9 +690,8 @@ fn get_broadcast_channel_error(error: &BroadcastChannelError) -> &'static str { fn get_fetch_error(error: &FetchError) -> &'static str { match error { - FetchError::Resource(e) | FetchError::Permission(e) => { - get_error_class_name(e).unwrap_or("Error") - } + FetchError::Resource(e) => get_error_class_name(e).unwrap_or("Error"), + FetchError::Permission(e) => get_permission_check_error_class(e), FetchError::NetworkError => "TypeError", FetchError::FsNotGet(_) => "TypeError", FetchError::InvalidUrl(_) => "TypeError", @@ -669,9 +725,8 @@ fn get_http_client_create_error(error: &HttpClientCreateError) -> &'static str { fn get_websocket_error(error: &WebsocketError) -> &'static str { match error { - WebsocketError::Permission(e) | WebsocketError::Resource(e) => { - get_error_class_name(e).unwrap_or("Error") - } + WebsocketError::Resource(e) => get_error_class_name(e).unwrap_or("Error"), + WebsocketError::Permission(e) => get_permission_check_error_class(e), WebsocketError::Url(e) => get_url_parse_error_class(e), WebsocketError::Io(e) => get_io_error_class(e), WebsocketError::WebSocket(_) => "TypeError", @@ -708,9 +763,10 @@ fn get_fs_ops_error(error: &FsOpsError) -> &'static str { match error { FsOpsError::Io(e) => get_io_error_class(e), FsOpsError::OperationError(e) => get_fs_error(&e.err), - FsOpsError::Permission(e) - | FsOpsError::Resource(e) - | FsOpsError::Other(e) => get_error_class_name(e).unwrap_or("Error"), + FsOpsError::Permission(e) => get_permission_check_error_class(e), + FsOpsError::Resource(e) | FsOpsError::Other(e) => { + get_error_class_name(e).unwrap_or("Error") + } FsOpsError::InvalidUtf8(_) => "InvalidData", FsOpsError::StripPrefix(_) => "Error", FsOpsError::Canceled(e) => { @@ -777,9 +833,10 @@ fn get_net_error(error: &NetError) -> &'static str { NetError::SocketBusy => "Busy", NetError::Io(e) => get_io_error_class(e), NetError::AcceptTaskOngoing => "Busy", - NetError::RootCertStore(e) - | NetError::Permission(e) - | NetError::Resource(e) => get_error_class_name(e).unwrap_or("Error"), + NetError::RootCertStore(e) | NetError::Resource(e) => { + get_error_class_name(e).unwrap_or("Error") + } + NetError::Permission(e) => get_permission_check_error_class(e), NetError::NoResolvedAddress => "Error", NetError::AddrParse(_) => "Error", NetError::Map(e) => get_net_map_error(e), @@ -810,12 +867,25 @@ fn get_net_map_error(error: &deno_net::io::MapError) -> &'static str { } } +fn get_child_permission_error(e: &ChildPermissionError) -> &'static str { + match e { + ChildPermissionError::Escalation => "NotCapable", + ChildPermissionError::PathResolve(e) => get_path_resolve_error(e), + ChildPermissionError::NetDescriptorParse(_) => "URIError", + ChildPermissionError::EnvDescriptorParse(_) => "Error", + ChildPermissionError::SysDescriptorParse(e) => { + get_sys_descriptor_parse_error(e) + } + ChildPermissionError::RunDescriptorParse(e) => { + get_run_descriptor_parse_error(e) + } + } +} + fn get_create_worker_error(error: &CreateWorkerError) -> &'static str { match error { CreateWorkerError::ClassicWorkers => "DOMExceptionNotSupportedError", - CreateWorkerError::Permission(e) => { - get_error_class_name(e).unwrap_or("Error") - } + CreateWorkerError::Permission(e) => get_child_permission_error(e), CreateWorkerError::ModuleResolution(e) => { get_module_resolution_error_class(e) } @@ -862,9 +932,8 @@ fn get_signal_error(error: &SignalError) -> &'static str { fn get_fs_events_error(error: &FsEventsError) -> &'static str { match error { - FsEventsError::Resource(e) | FsEventsError::Permission(e) => { - get_error_class_name(e).unwrap_or("Error") - } + FsEventsError::Resource(e) => get_error_class_name(e).unwrap_or("Error"), + FsEventsError::Permission(e) => get_permission_check_error_class(e), FsEventsError::Notify(e) => get_notify_error_class(e), FsEventsError::Canceled(e) => { let io_err: io::Error = e.to_owned().into(); @@ -892,9 +961,8 @@ fn get_process_error(error: &ProcessError) -> &'static str { ProcessError::FailedResolvingCwd(e) | ProcessError::Io(e) => { get_io_error_class(e) } - ProcessError::Permission(e) | ProcessError::Resource(e) => { - get_error_class_name(e).unwrap_or("Error") - } + ProcessError::Permission(e) => get_permission_check_error_class(e), + ProcessError::Resource(e) => get_error_class_name(e).unwrap_or("Error"), ProcessError::BorrowMut(_) => "Error", ProcessError::Which(_) => "Error", ProcessError::ChildProcessAlreadyTerminated => "TypeError", @@ -903,6 +971,14 @@ fn get_process_error(error: &ProcessError) -> &'static str { ProcessError::InvalidPid => "TypeError", #[cfg(unix)] ProcessError::Nix(e) => get_nix_error_class(e), + ProcessError::RunPermission(e) => match e { + CheckRunPermissionError::Permission(e) => { + get_permission_check_error_class(e) + } + CheckRunPermissionError::Other(e) => { + get_error_class_name(e).unwrap_or("Error") + } + }, } } @@ -971,6 +1047,7 @@ fn get_fs_error(e: &FsError) -> &'static str { mod node { use super::get_error_class_name; use super::get_io_error_class; + use super::get_permission_check_error_class; use super::get_serde_json_error_class; use super::get_url_parse_error_class; pub use deno_node::ops::blocklist::BlocklistError; @@ -998,7 +1075,7 @@ mod node { pub fn get_fs_error(error: &FsError) -> &'static str { match error { - FsError::Permission(e) => get_error_class_name(e).unwrap_or("Error"), + FsError::Permission(e) => get_permission_check_error_class(e), FsError::Io(e) => get_io_error_class(e), #[cfg(windows)] FsError::PathHasNoRoot => "Error", @@ -1084,7 +1161,7 @@ mod node { #[cfg(windows)] PriorityError::InvalidPriority => "TypeError", }, - OsError::Permission(e) => get_error_class_name(e).unwrap_or("Error"), + OsError::Permission(e) => get_permission_check_error_class(e), OsError::FailedToGetCpuInfo => "TypeError", OsError::FailedToGetUserInfo(e) => get_io_error_class(e), } @@ -1116,7 +1193,7 @@ mod node { fn get_os_error(error: &OsError) -> &'static str { match error { - OsError::Permission(e) => get_error_class_name(e).unwrap_or("Error"), + OsError::Permission(e) => get_permission_check_error_class(e), OsError::InvalidUtf8(_) => "InvalidData", OsError::EnvEmptyKey => "TypeError", OsError::EnvInvalidKey(_) => "TypeError", @@ -1144,6 +1221,18 @@ fn get_sync_fetch_error(error: &SyncFetchError) -> &'static str { pub fn get_error_class_name(e: &AnyError) -> Option<&'static str> { deno_core::error::get_custom_error_class(e) + .or_else(|| { + e.downcast_ref::() + .map(get_child_permission_error) + }) + .or_else(|| { + e.downcast_ref::() + .map(get_permission_check_error_class) + }) + .or_else(|| { + e.downcast_ref::() + .map(get_permission_error_class) + }) .or_else(|| e.downcast_ref::().map(get_fs_error)) .or_else(|| { e.downcast_ref::() diff --git a/runtime/ops/fs_events.rs b/runtime/ops/fs_events.rs index 648553376a..c8e0228bc0 100644 --- a/runtime/ops/fs_events.rs +++ b/runtime/ops/fs_events.rs @@ -114,7 +114,7 @@ pub enum FsEventsError { #[error(transparent)] Resource(deno_core::error::AnyError), #[error(transparent)] - Permission(deno_core::error::AnyError), + Permission(#[from] deno_permissions::PermissionCheckError), #[error(transparent)] Notify(#[from] NotifyError), #[error(transparent)] @@ -181,8 +181,7 @@ fn op_fs_events_open( for path in &paths { let path = state .borrow_mut::() - .check_read(path, "Deno.watchFs()") - .map_err(FsEventsError::Permission)?; + .check_read(path, "Deno.watchFs()")?; let watcher = state.borrow_mut::(); watcher.watcher.watch(&path, recursive_mode)?; diff --git a/runtime/ops/os/mod.rs b/runtime/ops/os/mod.rs index 24b0389e16..9bee9d8234 100644 --- a/runtime/ops/os/mod.rs +++ b/runtime/ops/os/mod.rs @@ -73,7 +73,7 @@ deno_core::extension!( #[derive(Debug, thiserror::Error)] pub enum OsError { #[error(transparent)] - Permission(deno_core::error::AnyError), + Permission(#[from] deno_permissions::PermissionCheckError), #[error("File name or path {0:?} is not valid UTF-8")] InvalidUtf8(std::ffi::OsString), #[error("Key is an empty string.")] @@ -94,8 +94,7 @@ fn op_exec_path(state: &mut OpState) -> Result { let current_exe = env::current_exe().unwrap(); state .borrow_mut::() - .check_read_blind(¤t_exe, "exec_path", "Deno.execPath()") - .map_err(OsError::Permission)?; + .check_read_blind(¤t_exe, "exec_path", "Deno.execPath()")?; // normalize path so it doesn't include '.' or '..' components let path = normalize_path(current_exe); @@ -111,10 +110,7 @@ fn op_set_env( #[string] key: &str, #[string] value: &str, ) -> Result<(), OsError> { - state - .borrow_mut::() - .check_env(key) - .map_err(OsError::Permission)?; + state.borrow_mut::().check_env(key)?; if key.is_empty() { return Err(OsError::EnvEmptyKey); } @@ -146,10 +142,7 @@ fn op_get_env( let skip_permission_check = NODE_ENV_VAR_ALLOWLIST.contains(&key); if !skip_permission_check { - state - .borrow_mut::() - .check_env(&key) - .map_err(OsError::Permission)?; + state.borrow_mut::().check_env(&key)?; } if key.is_empty() { @@ -172,10 +165,7 @@ fn op_delete_env( state: &mut OpState, #[string] key: String, ) -> Result<(), OsError> { - state - .borrow_mut::() - .check_env(&key) - .map_err(OsError::Permission)?; + state.borrow_mut::().check_env(&key)?; if key.is_empty() || key.contains(&['=', '\0'] as &[char]) { return Err(OsError::EnvInvalidKey(key.to_string())); } @@ -240,8 +230,7 @@ fn op_network_interfaces( ) -> Result, OsError> { state .borrow_mut::() - .check_sys("networkInterfaces", "Deno.networkInterfaces()") - .map_err(OsError::Permission)?; + .check_sys("networkInterfaces", "Deno.networkInterfaces()")?; Ok(netif::up()?.map(NetworkInterface::from).collect()) } diff --git a/runtime/ops/permissions.rs b/runtime/ops/permissions.rs index 1dbc852596..9ad963f3bc 100644 --- a/runtime/ops/permissions.rs +++ b/runtime/ops/permissions.rs @@ -2,8 +2,6 @@ use ::deno_permissions::PermissionState; use ::deno_permissions::PermissionsContainer; -use deno_core::error::custom_error; -use deno_core::error::AnyError; use deno_core::op2; use deno_core::OpState; use serde::Deserialize; @@ -47,12 +45,26 @@ impl From for PermissionStatus { } } +#[derive(Debug, thiserror::Error)] +pub enum PermissionError { + #[error("No such permission name: {0}")] + InvalidPermissionName(String), + #[error("{0}")] + PathResolve(#[from] ::deno_permissions::PathResolveError), + #[error("{0}")] + NetDescriptorParse(#[from] ::deno_permissions::NetDescriptorParseError), + #[error("{0}")] + SysDescriptorParse(#[from] ::deno_permissions::SysDescriptorParseError), + #[error("{0}")] + RunDescriptorParse(#[from] ::deno_permissions::RunDescriptorParseError), +} + #[op2] #[serde] pub fn op_query_permission( state: &mut OpState, #[serde] args: PermissionArgs, -) -> Result { +) -> Result { let permissions = state.borrow::(); let perm = match args.name.as_ref() { "read" => permissions.query_read(args.path.as_deref())?, @@ -62,12 +74,7 @@ pub fn op_query_permission( "sys" => permissions.query_sys(args.kind.as_deref())?, "run" => permissions.query_run(args.command.as_deref())?, "ffi" => permissions.query_ffi(args.path.as_deref())?, - n => { - return Err(custom_error( - "ReferenceError", - format!("No such permission name: {n}"), - )) - } + _ => return Err(PermissionError::InvalidPermissionName(args.name)), }; Ok(PermissionStatus::from(perm)) } @@ -77,7 +84,7 @@ pub fn op_query_permission( pub fn op_revoke_permission( state: &mut OpState, #[serde] args: PermissionArgs, -) -> Result { +) -> Result { let permissions = state.borrow::(); let perm = match args.name.as_ref() { "read" => permissions.revoke_read(args.path.as_deref())?, @@ -87,12 +94,7 @@ pub fn op_revoke_permission( "sys" => permissions.revoke_sys(args.kind.as_deref())?, "run" => permissions.revoke_run(args.command.as_deref())?, "ffi" => permissions.revoke_ffi(args.path.as_deref())?, - n => { - return Err(custom_error( - "ReferenceError", - format!("No such permission name: {n}"), - )) - } + _ => return Err(PermissionError::InvalidPermissionName(args.name)), }; Ok(PermissionStatus::from(perm)) } @@ -102,7 +104,7 @@ pub fn op_revoke_permission( pub fn op_request_permission( state: &mut OpState, #[serde] args: PermissionArgs, -) -> Result { +) -> Result { let permissions = state.borrow::(); let perm = match args.name.as_ref() { "read" => permissions.request_read(args.path.as_deref())?, @@ -112,12 +114,7 @@ pub fn op_request_permission( "sys" => permissions.request_sys(args.kind.as_deref())?, "run" => permissions.request_run(args.command.as_deref())?, "ffi" => permissions.request_ffi(args.path.as_deref())?, - n => { - return Err(custom_error( - "ReferenceError", - format!("No such permission name: {n}"), - )) - } + _ => return Err(PermissionError::InvalidPermissionName(args.name)), }; Ok(PermissionStatus::from(perm)) } diff --git a/runtime/ops/process.rs b/runtime/ops/process.rs index 28913f7c16..de3141f1f9 100644 --- a/runtime/ops/process.rs +++ b/runtime/ops/process.rs @@ -206,7 +206,9 @@ pub enum ProcessError { #[error("failed resolving cwd: {0}")] FailedResolvingCwd(#[source] std::io::Error), #[error(transparent)] - Permission(deno_core::error::AnyError), + Permission(#[from] deno_permissions::PermissionCheckError), + #[error(transparent)] + RunPermission(#[from] CheckRunPermissionError), #[error(transparent)] Resource(deno_core::error::AnyError), #[error(transparent)] @@ -653,8 +655,7 @@ fn compute_run_cmd_and_check_permissions( }, &run_env, api_name, - ) - .map_err(ProcessError::Permission)?; + )?; Ok((cmd, run_env)) } @@ -734,12 +735,20 @@ fn resolve_path(path: &str, cwd: &Path) -> PathBuf { deno_path_util::normalize_path(cwd.join(path)) } +#[derive(Debug, thiserror::Error)] +pub enum CheckRunPermissionError { + #[error(transparent)] + Permission(#[from] deno_permissions::PermissionCheckError), + #[error("{0}")] + Other(deno_core::error::AnyError), +} + fn check_run_permission( state: &mut OpState, cmd: &RunQueryDescriptor, run_env: &RunEnv, api_name: &str, -) -> Result<(), deno_core::error::AnyError> { +) -> Result<(), CheckRunPermissionError> { let permissions = state.borrow_mut::(); if !permissions.query_run_all(api_name) { // error the same on all platforms @@ -747,14 +756,14 @@ fn check_run_permission( if !env_var_names.is_empty() { // we don't allow users to launch subprocesses with any LD_ or DYLD_* // env vars set because this allows executing code (ex. LD_PRELOAD) - return Err(deno_core::error::custom_error( + return Err(CheckRunPermissionError::Other(deno_core::error::custom_error( "NotCapable", format!( "Requires --allow-all permissions to spawn subprocess with {} environment variable{}.", env_var_names.join(", "), if env_var_names.len() != 1 { "s" } else { "" } ) - )); + ))); } permissions.check_run(cmd, api_name)?; } @@ -1126,8 +1135,7 @@ mod deprecated { ) -> Result<(), ProcessError> { state .borrow_mut::() - .check_run_all(&api_name) - .map_err(ProcessError::Permission)?; + .check_run_all(&api_name)?; kill(pid, &signal) } } diff --git a/runtime/ops/worker_host.rs b/runtime/ops/worker_host.rs index 82cc949242..521284a6a0 100644 --- a/runtime/ops/worker_host.rs +++ b/runtime/ops/worker_host.rs @@ -123,7 +123,7 @@ pub enum CreateWorkerError { #[error("Classic workers are not supported.")] ClassicWorkers, #[error(transparent)] - Permission(deno_core::error::AnyError), + Permission(deno_permissions::ChildPermissionError), #[error(transparent)] ModuleResolution(#[from] deno_core::ModuleResolutionError), #[error(transparent)] diff --git a/runtime/permissions.rs b/runtime/permissions.rs index fa62227e0d..e8460e03f8 100644 --- a/runtime/permissions.rs +++ b/runtime/permissions.rs @@ -3,9 +3,6 @@ use std::path::Path; use std::path::PathBuf; -use deno_core::anyhow::bail; -use deno_core::anyhow::Context; -use deno_core::error::AnyError; use deno_path_util::normalize_path; use deno_permissions::AllowRunDescriptor; use deno_permissions::AllowRunDescriptorParseResult; @@ -15,9 +12,12 @@ use deno_permissions::FfiDescriptor; use deno_permissions::ImportDescriptor; use deno_permissions::NetDescriptor; use deno_permissions::PathQueryDescriptor; +use deno_permissions::PathResolveError; use deno_permissions::ReadDescriptor; +use deno_permissions::RunDescriptorParseError; use deno_permissions::RunQueryDescriptor; use deno_permissions::SysDescriptor; +use deno_permissions::SysDescriptorParseError; use deno_permissions::WriteDescriptor; #[derive(Debug)] @@ -30,9 +30,9 @@ impl RuntimePermissionDescriptorParser { Self { fs } } - fn resolve_from_cwd(&self, path: &str) -> Result { + fn resolve_from_cwd(&self, path: &str) -> Result { if path.is_empty() { - bail!("Empty path is not allowed"); + return Err(PathResolveError::EmptyPath); } let path = Path::new(path); if path.is_absolute() { @@ -43,12 +43,11 @@ impl RuntimePermissionDescriptorParser { } } - fn resolve_cwd(&self) -> Result { + fn resolve_cwd(&self) -> Result { self .fs .cwd() - .map_err(|e| e.into_io_error()) - .context("failed resolving cwd") + .map_err(|e| PathResolveError::CwdResolve(e.into_io_error())) } } @@ -58,37 +57,37 @@ impl deno_permissions::PermissionDescriptorParser fn parse_read_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { Ok(ReadDescriptor(self.resolve_from_cwd(text)?)) } fn parse_write_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { Ok(WriteDescriptor(self.resolve_from_cwd(text)?)) } fn parse_net_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { NetDescriptor::parse(text) } fn parse_import_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { ImportDescriptor::parse(text) } fn parse_env_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { if text.is_empty() { - Err(AnyError::msg("Empty env not allowed")) + Err(deno_permissions::EnvDescriptorParseError) } else { Ok(EnvDescriptor::new(text)) } @@ -97,9 +96,9 @@ impl deno_permissions::PermissionDescriptorParser fn parse_sys_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { if text.is_empty() { - Err(AnyError::msg("Empty sys not allowed")) + Err(SysDescriptorParseError::Empty) } else { Ok(SysDescriptor::parse(text.to_string())?) } @@ -108,21 +107,21 @@ impl deno_permissions::PermissionDescriptorParser fn parse_allow_run_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { Ok(AllowRunDescriptor::parse(text, &self.resolve_cwd()?)?) } fn parse_deny_run_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { Ok(DenyRunDescriptor::parse(text, &self.resolve_cwd()?)) } fn parse_ffi_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { Ok(FfiDescriptor(self.resolve_from_cwd(text)?)) } @@ -131,7 +130,7 @@ impl deno_permissions::PermissionDescriptorParser fn parse_path_query( &self, path: &str, - ) -> Result { + ) -> Result { Ok(PathQueryDescriptor { resolved: self.resolve_from_cwd(path)?, requested: path.to_string(), @@ -141,11 +140,12 @@ impl deno_permissions::PermissionDescriptorParser fn parse_run_query( &self, requested: &str, - ) -> Result { + ) -> Result { if requested.is_empty() { - bail!("Empty run query is not allowed"); + return Err(RunDescriptorParseError::EmptyRunQuery); } RunQueryDescriptor::parse(requested) + .map_err(RunDescriptorParseError::PathResolve) } } diff --git a/runtime/permissions/Cargo.toml b/runtime/permissions/Cargo.toml index bfa37b4898..f0b2e71b55 100644 --- a/runtime/permissions/Cargo.toml +++ b/runtime/permissions/Cargo.toml @@ -23,6 +23,7 @@ log.workspace = true once_cell.workspace = true percent-encoding = { version = "2.3.1", features = [] } serde.workspace = true +thiserror.workspace = true which.workspace = true [target.'cfg(windows)'.dependencies] diff --git a/runtime/permissions/lib.rs b/runtime/permissions/lib.rs index 84503f025b..6480f4bf58 100644 --- a/runtime/permissions/lib.rs +++ b/runtime/permissions/lib.rs @@ -1,11 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -use deno_core::anyhow::bail; -use deno_core::anyhow::Context; -use deno_core::error::custom_error; -use deno_core::error::type_error; -use deno_core::error::uri_error; -use deno_core::error::AnyError; use deno_core::parking_lot::Mutex; use deno_core::serde::de; use deno_core::serde::Deserialize; @@ -43,6 +37,21 @@ pub use prompter::PermissionPrompter; pub use prompter::PromptCallback; pub use prompter::PromptResponse; +#[derive(Debug, thiserror::Error)] +#[error("Requires {access}, {}", format_permission_error(.name))] +pub struct PermissionDeniedError { + access: String, + name: &'static str, +} + +fn format_permission_error(name: &'static str) -> String { + if is_standalone() { + format!("specify the required permissions during compilation using `deno compile --allow-{name}`") + } else { + format!("run again with the --allow-{name} flag") + } +} + /// Fast exit from permission check routines if this permission /// is in the "fully-granted" state. macro_rules! skip_check_if_is_permission_fully_granted { @@ -104,7 +113,10 @@ impl From for AllowPartial { impl PermissionState { #[inline(always)] - fn log_perm_access(name: &str, info: impl FnOnce() -> Option) { + fn log_perm_access( + name: &'static str, + info: impl FnOnce() -> Option, + ) { // Eliminates log overhead (when logging is disabled), // log_enabled!(Debug) check in a hot path still has overhead // TODO(AaronO): generalize or upstream this optimization @@ -120,53 +132,47 @@ impl PermissionState { } } - fn fmt_access(name: &str, info: impl FnOnce() -> Option) -> String { + fn fmt_access( + name: &'static str, + info: impl FnOnce() -> Option, + ) -> String { format!( "{} access{}", name, - info() - .map(|info| { format!(" to {info}") }) - .unwrap_or_default(), + info().map(|info| format!(" to {info}")).unwrap_or_default(), ) } - fn error(name: &str, info: impl FnOnce() -> Option) -> AnyError { - let msg = if is_standalone() { - format!( - "Requires {}, specify the required permissions during compilation using `deno compile --allow-{}`", - Self::fmt_access(name, info), - name - ) - } else { - format!( - "Requires {}, run again with the --allow-{} flag", - Self::fmt_access(name, info), - name - ) - }; - custom_error("NotCapable", msg) + fn error( + name: &'static str, + info: impl FnOnce() -> Option, + ) -> PermissionDeniedError { + PermissionDeniedError { + access: Self::fmt_access(name, info), + name, + } } /// Check the permission state. bool is whether a prompt was issued. #[inline] fn check( self, - name: &str, + name: &'static str, api_name: Option<&str>, info: Option<&str>, prompt: bool, - ) -> (Result<(), AnyError>, bool, bool) { + ) -> (Result<(), PermissionDeniedError>, bool, bool) { self.check2(name, api_name, || info.map(|s| s.to_string()), prompt) } #[inline] fn check2( self, - name: &str, + name: &'static str, api_name: Option<&str>, info: impl Fn() -> Option, prompt: bool, - ) -> (Result<(), AnyError>, bool, bool) { + ) -> (Result<(), PermissionDeniedError>, bool, bool) { match self { PermissionState::Granted => { Self::log_perm_access(name, info); @@ -246,7 +252,7 @@ impl UnitPermission { self.state } - pub fn check(&mut self) -> Result<(), AnyError> { + pub fn check(&mut self) -> Result<(), PermissionDeniedError> { let (result, prompted, _is_allow_all) = self.state.check(self.name, None, None, self.prompt); if prompted { @@ -262,7 +268,7 @@ impl UnitPermission { fn create_child_permissions( &mut self, flag: ChildUnitPermissionArg, - ) -> Result { + ) -> Result { let mut perm = self.clone(); match flag { ChildUnitPermissionArg::Inherit => { @@ -270,7 +276,7 @@ impl UnitPermission { } ChildUnitPermissionArg::Granted => { if self.check().is_err() { - return Err(escalation_error()); + return Err(ChildPermissionError::Escalation); } perm.state = PermissionState::Granted; } @@ -327,7 +333,7 @@ pub trait QueryDescriptor: Debug { &self, perm: &mut UnaryPermission, api_name: Option<&str>, - ) -> Result<(), AnyError>; + ) -> Result<(), PermissionDeniedError>; fn matches_allow(&self, other: &Self::AllowDesc) -> bool; fn matches_deny(&self, other: &Self::DenyDesc) -> bool; @@ -402,7 +408,7 @@ impl UnaryPermission { pub fn check_all_api( &mut self, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(None, false, api_name) } @@ -412,7 +418,7 @@ impl UnaryPermission { desc: Option<&TQuery>, assert_non_partial: bool, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { let (result, prompted, is_allow_all) = self .query_desc(desc, AllowPartial::from(!assert_non_partial)) .check2( @@ -599,11 +605,14 @@ impl UnaryPermission { } } - fn create_child_permissions( + fn create_child_permissions( &mut self, flag: ChildUnaryPermissionArg, - parse: impl Fn(&str) -> Result, AnyError>, - ) -> Result, AnyError> { + parse: impl Fn(&str) -> Result, E>, + ) -> Result, ChildPermissionError> + where + ChildPermissionError: From, + { let mut perms = Self::default(); match flag { @@ -612,7 +621,7 @@ impl UnaryPermission { } ChildUnaryPermissionArg::Granted => { if self.check_all_api(None).is_err() { - return Err(escalation_error()); + return Err(ChildPermissionError::Escalation); } perms.granted_global = true; } @@ -621,13 +630,13 @@ impl UnaryPermission { perms.granted_list = granted_list .iter() .filter_map(|i| parse(i).transpose()) - .collect::>()?; + .collect::>()?; if !perms.granted_list.iter().all(|desc| { TQuery::from_allow(desc) .check_in_permission(self, None) .is_ok() }) { - return Err(escalation_error()); + return Err(ChildPermissionError::Escalation); } } } @@ -698,7 +707,7 @@ impl QueryDescriptor for ReadQueryDescriptor { &self, perm: &mut UnaryPermission, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(perm); perm.check_desc(Some(self), true, api_name) } @@ -761,7 +770,7 @@ impl QueryDescriptor for WriteQueryDescriptor { &self, perm: &mut UnaryPermission, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(perm); perm.check_desc(Some(self), true, api_name) } @@ -796,22 +805,37 @@ pub enum Host { Ip(IpAddr), } +#[derive(Debug, thiserror::Error)] +pub enum HostParseError { + #[error("invalid IPv6 address: '{0}'")] + InvalidIpv6(String), + #[error("invalid host: '{0}'")] + InvalidHost(String), + #[error("invalid empty host: '{0}'")] + InvalidEmptyHost(String), + #[error("invalid host '{host}': {error}")] + Fqdn { + #[source] + error: fqdn::Error, + host: String, + }, +} + impl Host { - // TODO(bartlomieju): rewrite to not use `AnyError` but a specific error implementations - fn parse(s: &str) -> Result { + fn parse(s: &str) -> Result { if s.starts_with('[') && s.ends_with(']') { let ip = s[1..s.len() - 1] .parse::() - .map_err(|_| uri_error(format!("invalid IPv6 address: '{s}'")))?; + .map_err(|_| HostParseError::InvalidIpv6(s.to_string()))?; return Ok(Host::Ip(IpAddr::V6(ip))); } let (without_trailing_dot, has_trailing_dot) = s.strip_suffix('.').map_or((s, false), |s| (s, true)); if let Ok(ip) = without_trailing_dot.parse::() { if has_trailing_dot { - return Err(uri_error(format!( - "invalid host: '{without_trailing_dot}'" - ))); + return Err(HostParseError::InvalidHost( + without_trailing_dot.to_string(), + )); } Ok(Host::Ip(ip)) } else { @@ -822,11 +846,13 @@ impl Host { }; let fqdn = { use std::str::FromStr; - FQDN::from_str(&lower) - .with_context(|| format!("invalid host: '{s}'"))? + FQDN::from_str(&lower).map_err(|e| HostParseError::Fqdn { + error: e, + host: s.to_string(), + })? }; if fqdn.is_root() { - return Err(uri_error(format!("invalid empty host: '{s}'"))); + return Err(HostParseError::InvalidEmptyHost(s.to_string())); } Ok(Host::Fqdn(fqdn)) } @@ -870,7 +896,7 @@ impl QueryDescriptor for NetDescriptor { &self, perm: &mut UnaryPermission, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(perm); perm.check_desc(Some(self), false, api_name) } @@ -896,39 +922,72 @@ impl QueryDescriptor for NetDescriptor { } } -// TODO(bartlomieju): rewrite to not use `AnyError` but a specific error implementations +#[derive(Debug, thiserror::Error)] +pub enum NetDescriptorParseError { + #[error("invalid value '{0}': URLs are not supported, only domains and ips")] + Url(String), + #[error("invalid IPv6 address in '{hostname}': '{ip}'")] + InvalidIpv6 { hostname: String, ip: String }, + #[error("invalid port in '{hostname}': '{port}'")] + InvalidPort { hostname: String, port: String }, + #[error("invalid host: '{0}'")] + InvalidHost(String), + #[error("invalid empty port in '{0}'")] + EmptyPort(String), + #[error("ipv6 addresses must be enclosed in square brackets: '{0}'")] + Ipv6MissingSquareBrackets(String), + #[error("{0}")] + Host(#[from] HostParseError), +} + +#[derive(Debug, thiserror::Error)] +pub enum NetDescriptorFromUrlParseError { + #[error("Missing host in url: '{0}'")] + MissingHost(Url), + #[error("{0}")] + Host(#[from] HostParseError), +} + impl NetDescriptor { - pub fn parse(hostname: &str) -> Result { + pub fn parse(hostname: &str) -> Result { if hostname.starts_with("http://") || hostname.starts_with("https://") { - return Err(uri_error(format!("invalid value '{hostname}': URLs are not supported, only domains and ips"))); + return Err(NetDescriptorParseError::Url(hostname.to_string())); } // If this is a IPv6 address enclosed in square brackets, parse it as such. if hostname.starts_with('[') { if let Some((ip, after)) = hostname.split_once(']') { let ip = ip[1..].parse::().map_err(|_| { - uri_error(format!("invalid IPv6 address in '{hostname}': '{ip}'")) + NetDescriptorParseError::InvalidIpv6 { + hostname: hostname.to_string(), + ip: ip.to_string(), + } })?; let port = if let Some(port) = after.strip_prefix(':') { let port = port.parse::().map_err(|_| { - uri_error(format!("invalid port in '{hostname}': '{port}'")) + NetDescriptorParseError::InvalidPort { + hostname: hostname.to_string(), + port: port.to_string(), + } })?; Some(port) } else if after.is_empty() { None } else { - return Err(uri_error(format!("invalid host: '{hostname}'"))); + return Err(NetDescriptorParseError::InvalidHost( + hostname.to_string(), + )); }; return Ok(NetDescriptor(Host::Ip(IpAddr::V6(ip)), port)); } else { - return Err(uri_error(format!("invalid host: '{hostname}'"))); + return Err(NetDescriptorParseError::InvalidHost(hostname.to_string())); } } // Otherwise it is an IPv4 address or a FQDN with an optional port. let (host, port) = match hostname.split_once(':') { Some((_, "")) => { - return Err(uri_error(format!("invalid empty port in '{hostname}'"))); + return Err(NetDescriptorParseError::EmptyPort(hostname.to_string())); } Some((host, port)) => (host, port), None => (hostname, ""), @@ -943,11 +1002,14 @@ impl NetDescriptor { // should give them a hint. There are always at least two colons in an // IPv6 address, so this heuristic finds likely a bare IPv6 address. if port.contains(':') { - uri_error(format!( - "ipv6 addresses must be enclosed in square brackets: '{hostname}'" - )) + NetDescriptorParseError::Ipv6MissingSquareBrackets( + hostname.to_string(), + ) } else { - uri_error(format!("invalid port in '{hostname}': '{port}'")) + NetDescriptorParseError::InvalidPort { + hostname: hostname.to_string(), + port: port.to_string(), + } } })?; Some(port) @@ -956,10 +1018,10 @@ impl NetDescriptor { Ok(NetDescriptor(host, port)) } - pub fn from_url(url: &Url) -> Result { - let host = url - .host_str() - .ok_or_else(|| type_error(format!("Missing host in url: '{}'", url)))?; + pub fn from_url(url: &Url) -> Result { + let host = url.host_str().ok_or_else(|| { + NetDescriptorFromUrlParseError::MissingHost(url.clone()) + })?; let host = Host::parse(host)?; let port = url.port_or_known_default(); Ok(NetDescriptor(host, port)) @@ -1011,7 +1073,7 @@ impl QueryDescriptor for ImportDescriptor { &self, perm: &mut UnaryPermission, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(perm); perm.check_desc(Some(self), false, api_name) } @@ -1038,15 +1100,19 @@ impl QueryDescriptor for ImportDescriptor { } impl ImportDescriptor { - pub fn parse(specifier: &str) -> Result { + pub fn parse(specifier: &str) -> Result { Ok(ImportDescriptor(NetDescriptor::parse(specifier)?)) } - pub fn from_url(url: &Url) -> Result { + pub fn from_url(url: &Url) -> Result { Ok(ImportDescriptor(NetDescriptor::from_url(url)?)) } } +#[derive(Debug, thiserror::Error)] +#[error("Empty env not allowed")] +pub struct EnvDescriptorParseError; + #[derive(Clone, Eq, PartialEq, Hash, Debug)] pub struct EnvDescriptor(EnvVarName); @@ -1084,7 +1150,7 @@ impl QueryDescriptor for EnvDescriptor { &self, perm: &mut UnaryPermission, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(perm); perm.check_desc(Some(self), false, api_name) } @@ -1131,14 +1197,25 @@ pub enum RunQueryDescriptor { Name(String), } +#[derive(Debug, thiserror::Error)] +pub enum PathResolveError { + #[error("failed resolving cwd: {0}")] + CwdResolve(#[source] std::io::Error), + #[error("Empty path is not allowed")] + EmptyPath, +} + impl RunQueryDescriptor { - pub fn parse(requested: &str) -> Result { + pub fn parse( + requested: &str, + ) -> Result { if is_path(requested) { let path = PathBuf::from(requested); let resolved = if path.is_absolute() { normalize_path(path) } else { - let cwd = std::env::current_dir().context("failed resolving cwd")?; + let cwd = + std::env::current_dir().map_err(PathResolveError::CwdResolve)?; normalize_path(cwd.join(path)) }; Ok(RunQueryDescriptor::Path { @@ -1210,7 +1287,7 @@ impl QueryDescriptor for RunQueryDescriptor { &self, perm: &mut UnaryPermission, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(perm); perm.check_desc(Some(self), false, api_name) } @@ -1280,6 +1357,16 @@ pub enum AllowRunDescriptorParseResult { Descriptor(AllowRunDescriptor), } +#[derive(Debug, thiserror::Error)] +pub enum RunDescriptorParseError { + #[error("{0}")] + Which(#[from] which::Error), + #[error("{0}")] + PathResolve(#[from] PathResolveError), + #[error("Empty run query is not allowed")] + EmptyRunQuery, +} + #[derive(Debug, Clone, Hash, Eq, PartialEq)] pub struct AllowRunDescriptor(pub PathBuf); @@ -1360,11 +1447,19 @@ fn denies_run_name(name: &str, cmd_path: &Path) -> bool { suffix.is_empty() || suffix.starts_with('.') } +#[derive(Debug, thiserror::Error)] +pub enum SysDescriptorParseError { + #[error("unknown system info kind \"{0}\"")] + InvalidKind(String), // TypeError + #[error("Empty sys not allowed")] + Empty, // Error +} + #[derive(Clone, Eq, PartialEq, Hash, Debug)] pub struct SysDescriptor(String); impl SysDescriptor { - pub fn parse(kind: String) -> Result { + pub fn parse(kind: String) -> Result { match kind.as_str() { "hostname" | "osRelease" | "osUptime" | "loadavg" | "networkInterfaces" | "systemMemoryInfo" | "uid" | "gid" | "cpus" @@ -1374,7 +1469,7 @@ impl SysDescriptor { // the underlying permission check changed to `userInfo` to better match the API, // alias this to avoid breaking existing projects with `--allow-sys=username` "username" => Ok(Self("userInfo".into())), - _ => Err(type_error(format!("unknown system info kind \"{kind}\""))), + _ => Err(SysDescriptorParseError::InvalidKind(kind)), } } @@ -1411,7 +1506,7 @@ impl QueryDescriptor for SysDescriptor { &self, perm: &mut UnaryPermission, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(perm); perm.check_desc(Some(self), false, api_name) } @@ -1472,7 +1567,7 @@ impl QueryDescriptor for FfiQueryDescriptor { &self, perm: &mut UnaryPermission, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(perm); perm.check_desc(Some(self), true, api_name) } @@ -1524,7 +1619,7 @@ impl UnaryPermission { &mut self, desc: &ReadQueryDescriptor, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(Some(desc), true, api_name) } @@ -1534,12 +1629,15 @@ impl UnaryPermission { &mut self, desc: &ReadQueryDescriptor, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(Some(desc), false, api_name) } - pub fn check_all(&mut self, api_name: Option<&str>) -> Result<(), AnyError> { + pub fn check_all( + &mut self, + api_name: Option<&str>, + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(None, false, api_name) } @@ -1568,7 +1666,7 @@ impl UnaryPermission { &mut self, path: &WriteQueryDescriptor, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(Some(path), true, api_name) } @@ -1578,12 +1676,15 @@ impl UnaryPermission { &mut self, path: &WriteQueryDescriptor, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(Some(path), false, api_name) } - pub fn check_all(&mut self, api_name: Option<&str>) -> Result<(), AnyError> { + pub fn check_all( + &mut self, + api_name: Option<&str>, + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(None, false, api_name) } @@ -1606,12 +1707,12 @@ impl UnaryPermission { &mut self, host: &NetDescriptor, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(Some(host), false, api_name) } - pub fn check_all(&mut self) -> Result<(), AnyError> { + pub fn check_all(&mut self) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(None, false, None) } @@ -1637,12 +1738,12 @@ impl UnaryPermission { &mut self, host: &ImportDescriptor, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(Some(host), false, api_name) } - pub fn check_all(&mut self) -> Result<(), AnyError> { + pub fn check_all(&mut self) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(None, false, None) } @@ -1668,12 +1769,12 @@ impl UnaryPermission { &mut self, env: &str, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(Some(&EnvDescriptor::new(env)), false, api_name) } - pub fn check_all(&mut self) -> Result<(), AnyError> { + pub fn check_all(&mut self) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(None, false, None) } @@ -1696,12 +1797,12 @@ impl UnaryPermission { &mut self, kind: &SysDescriptor, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(Some(kind), false, api_name) } - pub fn check_all(&mut self) -> Result<(), AnyError> { + pub fn check_all(&mut self) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(None, false, None) } @@ -1730,11 +1831,14 @@ impl UnaryPermission { &mut self, cmd: &RunQueryDescriptor, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { self.check_desc(Some(cmd), false, api_name) } - pub fn check_all(&mut self, api_name: Option<&str>) -> Result<(), AnyError> { + pub fn check_all( + &mut self, + api_name: Option<&str>, + ) -> Result<(), PermissionDeniedError> { self.check_desc(None, false, api_name) } @@ -1777,7 +1881,7 @@ impl UnaryPermission { &mut self, path: &FfiQueryDescriptor, api_name: Option<&str>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(Some(path), true, api_name) } @@ -1785,12 +1889,12 @@ impl UnaryPermission { pub fn check_partial( &mut self, path: Option<&FfiQueryDescriptor>, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(path, false, None) } - pub fn check_all(&mut self) -> Result<(), AnyError> { + pub fn check_all(&mut self) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); self.check_desc(None, false, Some("all")) } @@ -1830,23 +1934,39 @@ pub struct PermissionsOptions { pub prompt: bool, } +#[derive(Debug, thiserror::Error)] +pub enum PermissionsFromOptionsError { + #[error("{0}")] + PathResolve(#[from] PathResolveError), + #[error("{0}")] + SysDescriptorParse(#[from] SysDescriptorParseError), + #[error("{0}")] + NetDescriptorParse(#[from] NetDescriptorParseError), + #[error("{0}")] + EnvDescriptorParse(#[from] EnvDescriptorParseError), + #[error("{0}")] + RunDescriptorParse(#[from] RunDescriptorParseError), + #[error("Empty command name not allowed in --allow-run=...")] + RunEmptyCommandName, +} + impl Permissions { pub fn new_unary( allow_list: Option>, deny_list: Option>, prompt: bool, - ) -> Result, AnyError> + ) -> UnaryPermission where TQuery: QueryDescriptor, { - Ok(UnaryPermission:: { + UnaryPermission:: { granted_global: global_from_option(allow_list.as_ref()), granted_list: allow_list.unwrap_or_default(), flag_denied_global: global_from_option(deny_list.as_ref()), flag_denied_list: deny_list.unwrap_or_default(), prompt, ..Default::default() - }) + } } pub const fn new_all(allow_state: bool) -> UnitPermission { @@ -1862,15 +1982,15 @@ impl Permissions { pub fn from_options( parser: &dyn PermissionDescriptorParser, opts: &PermissionsOptions, - ) -> Result { + ) -> Result { fn resolve_allow_run( parser: &dyn PermissionDescriptorParser, allow_run: &[String], - ) -> Result, AnyError> { + ) -> Result, PermissionsFromOptionsError> { let mut new_allow_run = HashSet::with_capacity(allow_run.len()); for unresolved in allow_run { if unresolved.is_empty() { - bail!("Empty command name not allowed in --allow-run=...") + return Err(PermissionsFromOptionsError::RunEmptyCommandName); } match parser.parse_allow_run_descriptor(unresolved)? { AllowRunDescriptorParseResult::Descriptor(descriptor) => { @@ -1889,10 +2009,13 @@ impl Permissions { Ok(new_allow_run) } - fn parse_maybe_vec( + fn parse_maybe_vec( items: Option<&[String]>, - parse: impl Fn(&str) -> Result, - ) -> Result>, AnyError> { + parse: impl Fn(&str) -> Result, + ) -> Result>, PermissionsFromOptionsError> + where + PermissionsFromOptionsError: From, + { match items { Some(items) => Ok(Some( items @@ -1944,14 +2067,14 @@ impl Permissions { parser.parse_read_descriptor(item) })?, opts.prompt, - )?, + ), write: Permissions::new_unary( parse_maybe_vec(opts.allow_write.as_deref(), |item| { parser.parse_write_descriptor(item) })?, deny_write, opts.prompt, - )?, + ), net: Permissions::new_unary( parse_maybe_vec(opts.allow_net.as_deref(), |item| { parser.parse_net_descriptor(item) @@ -1960,7 +2083,7 @@ impl Permissions { parser.parse_net_descriptor(item) })?, opts.prompt, - )?, + ), env: Permissions::new_unary( parse_maybe_vec(opts.allow_env.as_deref(), |item| { parser.parse_env_descriptor(item) @@ -1969,7 +2092,7 @@ impl Permissions { parser.parse_env_descriptor(text) })?, opts.prompt, - )?, + ), sys: Permissions::new_unary( parse_maybe_vec(opts.allow_sys.as_deref(), |text| { parser.parse_sys_descriptor(text) @@ -1978,14 +2101,14 @@ impl Permissions { parser.parse_sys_descriptor(text) })?, opts.prompt, - )?, + ), run: Permissions::new_unary( allow_run, parse_maybe_vec(opts.deny_run.as_deref(), |text| { parser.parse_deny_run_descriptor(text) })?, opts.prompt, - )?, + ), ffi: Permissions::new_unary( parse_maybe_vec(opts.allow_ffi.as_deref(), |text| { parser.parse_ffi_descriptor(text) @@ -1994,14 +2117,14 @@ impl Permissions { parser.parse_ffi_descriptor(text) })?, opts.prompt, - )?, + ), import: Permissions::new_unary( parse_maybe_vec(opts.allow_import.as_deref(), |item| { parser.parse_import_descriptor(item) })?, None, opts.prompt, - )?, + ), all: Permissions::new_all(opts.allow_all), }) } @@ -2033,14 +2156,14 @@ impl Permissions { fn none(prompt: bool) -> Self { Self { - read: Permissions::new_unary(None, None, prompt).unwrap(), - write: Permissions::new_unary(None, None, prompt).unwrap(), - net: Permissions::new_unary(None, None, prompt).unwrap(), - env: Permissions::new_unary(None, None, prompt).unwrap(), - sys: Permissions::new_unary(None, None, prompt).unwrap(), - run: Permissions::new_unary(None, None, prompt).unwrap(), - ffi: Permissions::new_unary(None, None, prompt).unwrap(), - import: Permissions::new_unary(None, None, prompt).unwrap(), + read: Permissions::new_unary(None, None, prompt), + write: Permissions::new_unary(None, None, prompt), + net: Permissions::new_unary(None, None, prompt), + env: Permissions::new_unary(None, None, prompt), + sys: Permissions::new_unary(None, None, prompt), + run: Permissions::new_unary(None, None, prompt), + ffi: Permissions::new_unary(None, None, prompt), + import: Permissions::new_unary(None, None, prompt), all: Permissions::new_all(false), } } @@ -2052,6 +2175,38 @@ pub enum CheckSpecifierKind { Dynamic, } +#[derive(Debug, thiserror::Error)] +pub enum ChildPermissionError { + #[error("Can't escalate parent thread permissions")] + Escalation, + #[error("{0}")] + PathResolve(#[from] PathResolveError), + #[error("{0}")] + NetDescriptorParse(#[from] NetDescriptorParseError), + #[error("{0}")] + EnvDescriptorParse(#[from] EnvDescriptorParseError), + #[error("{0}")] + SysDescriptorParse(#[from] SysDescriptorParseError), + #[error("{0}")] + RunDescriptorParse(#[from] RunDescriptorParseError), +} + +#[derive(Debug, thiserror::Error)] +pub enum PermissionCheckError { + #[error(transparent)] + PermissionDenied(#[from] PermissionDeniedError), + #[error("Invalid file path.\n Specifier: {0}")] + InvalidFilePath(Url), + #[error(transparent)] + NetDescriptorForUrlParse(#[from] NetDescriptorFromUrlParseError), + #[error(transparent)] + SysDescriptorParse(#[from] SysDescriptorParseError), + #[error(transparent)] + PathResolve(#[from] PathResolveError), + #[error(transparent)] + HostParse(#[from] HostParseError), +} + /// Wrapper struct for `Permissions` that can be shared across threads. /// /// We need a way to have internal mutability for permissions as they might get @@ -2084,7 +2239,7 @@ impl PermissionsContainer { pub fn create_child_permissions( &self, child_permissions_arg: ChildPermissionsArg, - ) -> Result { + ) -> Result { fn is_granted_unary(arg: &ChildUnaryPermissionArg) -> bool { match arg { ChildUnaryPermissionArg::Inherit | ChildUnaryPermissionArg::Granted => { @@ -2122,48 +2277,71 @@ impl PermissionsContainer { // WARNING: When adding a permission here, ensure it is handled // in the worker_perms.all block above - worker_perms.read = inner - .read - .create_child_permissions(child_permissions_arg.read, |text| { - Ok(Some(self.descriptor_parser.parse_read_descriptor(text)?)) - })?; - worker_perms.write = inner - .write - .create_child_permissions(child_permissions_arg.write, |text| { - Ok(Some(self.descriptor_parser.parse_write_descriptor(text)?)) - })?; - worker_perms.import = inner - .import - .create_child_permissions(child_permissions_arg.import, |text| { - Ok(Some(self.descriptor_parser.parse_import_descriptor(text)?)) - })?; - worker_perms.net = inner - .net - .create_child_permissions(child_permissions_arg.net, |text| { - Ok(Some(self.descriptor_parser.parse_net_descriptor(text)?)) - })?; - worker_perms.env = inner - .env - .create_child_permissions(child_permissions_arg.env, |text| { - Ok(Some(self.descriptor_parser.parse_env_descriptor(text)?)) - })?; - worker_perms.sys = inner - .sys - .create_child_permissions(child_permissions_arg.sys, |text| { - Ok(Some(self.descriptor_parser.parse_sys_descriptor(text)?)) - })?; + worker_perms.read = inner.read.create_child_permissions( + child_permissions_arg.read, + |text| { + Ok::<_, PathResolveError>(Some( + self.descriptor_parser.parse_read_descriptor(text)?, + )) + }, + )?; + worker_perms.write = inner.write.create_child_permissions( + child_permissions_arg.write, + |text| { + Ok::<_, PathResolveError>(Some( + self.descriptor_parser.parse_write_descriptor(text)?, + )) + }, + )?; + worker_perms.import = inner.import.create_child_permissions( + child_permissions_arg.import, + |text| { + Ok::<_, NetDescriptorParseError>(Some( + self.descriptor_parser.parse_import_descriptor(text)?, + )) + }, + )?; + worker_perms.net = inner.net.create_child_permissions( + child_permissions_arg.net, + |text| { + Ok::<_, NetDescriptorParseError>(Some( + self.descriptor_parser.parse_net_descriptor(text)?, + )) + }, + )?; + worker_perms.env = inner.env.create_child_permissions( + child_permissions_arg.env, + |text| { + Ok::<_, EnvDescriptorParseError>(Some( + self.descriptor_parser.parse_env_descriptor(text)?, + )) + }, + )?; + worker_perms.sys = inner.sys.create_child_permissions( + child_permissions_arg.sys, + |text| { + Ok::<_, SysDescriptorParseError>(Some( + self.descriptor_parser.parse_sys_descriptor(text)?, + )) + }, + )?; worker_perms.run = inner.run.create_child_permissions( child_permissions_arg.run, |text| match self.descriptor_parser.parse_allow_run_descriptor(text)? { - AllowRunDescriptorParseResult::Unresolved(_) => Ok(None), + AllowRunDescriptorParseResult::Unresolved(_) => { + Ok::<_, RunDescriptorParseError>(None) + } AllowRunDescriptorParseResult::Descriptor(desc) => Ok(Some(desc)), }, )?; - worker_perms.ffi = inner - .ffi - .create_child_permissions(child_permissions_arg.ffi, |text| { - Ok(Some(self.descriptor_parser.parse_ffi_descriptor(text)?)) - })?; + worker_perms.ffi = inner.ffi.create_child_permissions( + child_permissions_arg.ffi, + |text| { + Ok::<_, PathResolveError>(Some( + self.descriptor_parser.parse_ffi_descriptor(text)?, + )) + }, + )?; Ok(PermissionsContainer::new( self.descriptor_parser.clone(), @@ -2176,7 +2354,7 @@ impl PermissionsContainer { &self, specifier: &ModuleSpecifier, kind: CheckSpecifierKind, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionCheckError> { let mut inner = self.inner.lock(); match specifier.scheme() { "file" => { @@ -2185,17 +2363,20 @@ impl PermissionsContainer { } match url_to_file_path(specifier) { - Ok(path) => inner.read.check( - &PathQueryDescriptor { - requested: path.to_string_lossy().into_owned(), - resolved: path, - } - .into_read(), - Some("import()"), - ), - Err(_) => Err(uri_error(format!( - "Invalid file path.\n Specifier: {specifier}" - ))), + Ok(path) => inner + .read + .check( + &PathQueryDescriptor { + requested: path.to_string_lossy().into_owned(), + resolved: path, + } + .into_read(), + Some("import()"), + ) + .map_err(PermissionCheckError::PermissionDenied), + Err(_) => { + Err(PermissionCheckError::InvalidFilePath(specifier.clone())) + } } } "data" => Ok(()), @@ -2220,7 +2401,7 @@ impl PermissionsContainer { &self, path: &str, api_name: &str, - ) -> Result { + ) -> Result { self.check_read_with_api_name(path, Some(api_name)) } @@ -2230,7 +2411,7 @@ impl PermissionsContainer { &self, path: &str, api_name: Option<&str>, - ) -> Result { + ) -> Result { let mut inner = self.inner.lock(); let inner = &mut inner.read; if inner.is_allow_all() { @@ -2248,7 +2429,7 @@ impl PermissionsContainer { &self, path: &'a Path, api_name: Option<&str>, - ) -> Result, AnyError> { + ) -> Result, PermissionCheckError> { let mut inner = self.inner.lock(); let inner = &mut inner.read; if inner.is_allow_all() { @@ -2272,7 +2453,7 @@ impl PermissionsContainer { path: &Path, display: &str, api_name: &str, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionCheckError> { let mut inner = self.inner.lock(); let inner = &mut inner.read; skip_check_if_is_permission_fully_granted!(inner); @@ -2283,12 +2464,17 @@ impl PermissionsContainer { } .into_read(), Some(api_name), - ) + )?; + Ok(()) } #[inline(always)] - pub fn check_read_all(&self, api_name: &str) -> Result<(), AnyError> { - self.inner.lock().read.check_all(Some(api_name)) + pub fn check_read_all( + &self, + api_name: &str, + ) -> Result<(), PermissionCheckError> { + self.inner.lock().read.check_all(Some(api_name))?; + Ok(()) } #[inline(always)] @@ -2302,7 +2488,7 @@ impl PermissionsContainer { &self, path: &str, api_name: &str, - ) -> Result { + ) -> Result { self.check_write_with_api_name(path, Some(api_name)) } @@ -2312,7 +2498,7 @@ impl PermissionsContainer { &self, path: &str, api_name: Option<&str>, - ) -> Result { + ) -> Result { let mut inner = self.inner.lock(); let inner = &mut inner.write; if inner.is_allow_all() { @@ -2330,7 +2516,7 @@ impl PermissionsContainer { &self, path: &'a Path, api_name: &str, - ) -> Result, AnyError> { + ) -> Result, PermissionCheckError> { let mut inner = self.inner.lock(); let inner = &mut inner.write; if inner.is_allow_all() { @@ -2347,8 +2533,12 @@ impl PermissionsContainer { } #[inline(always)] - pub fn check_write_all(&self, api_name: &str) -> Result<(), AnyError> { - self.inner.lock().write.check_all(Some(api_name)) + pub fn check_write_all( + &self, + api_name: &str, + ) -> Result<(), PermissionCheckError> { + self.inner.lock().write.check_all(Some(api_name))?; + Ok(()) } /// As `check_write()`, but permission error messages will anonymize the path @@ -2359,7 +2549,7 @@ impl PermissionsContainer { path: &Path, display: &str, api_name: &str, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionCheckError> { let mut inner = self.inner.lock(); let inner = &mut inner.write; skip_check_if_is_permission_fully_granted!(inner); @@ -2370,7 +2560,8 @@ impl PermissionsContainer { } .into_write(), Some(api_name), - ) + )?; + Ok(()) } #[inline(always)] @@ -2378,7 +2569,7 @@ impl PermissionsContainer { &mut self, path: &str, api_name: &str, - ) -> Result { + ) -> Result { let mut inner = self.inner.lock(); let inner = &mut inner.write; if inner.is_allow_all() { @@ -2395,13 +2586,18 @@ impl PermissionsContainer { &mut self, cmd: &RunQueryDescriptor, api_name: &str, - ) -> Result<(), AnyError> { - self.inner.lock().run.check(cmd, Some(api_name)) + ) -> Result<(), PermissionCheckError> { + self.inner.lock().run.check(cmd, Some(api_name))?; + Ok(()) } #[inline(always)] - pub fn check_run_all(&mut self, api_name: &str) -> Result<(), AnyError> { - self.inner.lock().run.check_all(Some(api_name)) + pub fn check_run_all( + &mut self, + api_name: &str, + ) -> Result<(), PermissionCheckError> { + self.inner.lock().run.check_all(Some(api_name))?; + Ok(()) } #[inline(always)] @@ -2410,38 +2606,50 @@ impl PermissionsContainer { } #[inline(always)] - pub fn check_sys(&self, kind: &str, api_name: &str) -> Result<(), AnyError> { + pub fn check_sys( + &self, + kind: &str, + api_name: &str, + ) -> Result<(), PermissionCheckError> { self.inner.lock().sys.check( &self.descriptor_parser.parse_sys_descriptor(kind)?, Some(api_name), - ) + )?; + Ok(()) } #[inline(always)] - pub fn check_env(&mut self, var: &str) -> Result<(), AnyError> { - self.inner.lock().env.check(var, None) + pub fn check_env(&mut self, var: &str) -> Result<(), PermissionCheckError> { + self.inner.lock().env.check(var, None)?; + Ok(()) } #[inline(always)] - pub fn check_env_all(&mut self) -> Result<(), AnyError> { - self.inner.lock().env.check_all() + pub fn check_env_all(&mut self) -> Result<(), PermissionCheckError> { + self.inner.lock().env.check_all()?; + Ok(()) } #[inline(always)] - pub fn check_sys_all(&mut self) -> Result<(), AnyError> { - self.inner.lock().sys.check_all() + pub fn check_sys_all(&mut self) -> Result<(), PermissionCheckError> { + self.inner.lock().sys.check_all()?; + Ok(()) } #[inline(always)] - pub fn check_ffi_all(&mut self) -> Result<(), AnyError> { - self.inner.lock().ffi.check_all() + pub fn check_ffi_all(&mut self) -> Result<(), PermissionCheckError> { + self.inner.lock().ffi.check_all()?; + Ok(()) } /// This checks to see if the allow-all flag was passed, not whether all /// permissions are enabled! #[inline(always)] - pub fn check_was_allow_all_flag_passed(&mut self) -> Result<(), AnyError> { - self.inner.lock().all.check() + pub fn check_was_allow_all_flag_passed( + &mut self, + ) -> Result<(), PermissionCheckError> { + self.inner.lock().all.check()?; + Ok(()) } /// Checks special file access, returning the failed permission type if @@ -2553,13 +2761,14 @@ impl PermissionsContainer { &mut self, url: &Url, api_name: &str, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionCheckError> { let mut inner = self.inner.lock(); if inner.net.is_allow_all() { return Ok(()); } let desc = self.descriptor_parser.parse_net_descriptor_from_url(url)?; - inner.net.check(&desc, Some(api_name)) + inner.net.check(&desc, Some(api_name))?; + Ok(()) } #[inline(always)] @@ -2567,17 +2776,21 @@ impl PermissionsContainer { &mut self, host: &(T, Option), api_name: &str, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionCheckError> { let mut inner = self.inner.lock(); let inner = &mut inner.net; skip_check_if_is_permission_fully_granted!(inner); let hostname = Host::parse(host.0.as_ref())?; let descriptor = NetDescriptor(hostname, host.1); - inner.check(&descriptor, Some(api_name)) + inner.check(&descriptor, Some(api_name))?; + Ok(()) } #[inline(always)] - pub fn check_ffi(&mut self, path: &str) -> Result { + pub fn check_ffi( + &mut self, + path: &str, + ) -> Result { let mut inner = self.inner.lock(); let inner = &mut inner.ffi; if inner.is_allow_all() { @@ -2591,14 +2804,15 @@ impl PermissionsContainer { #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] #[inline(always)] - pub fn check_ffi_partial_no_path(&mut self) -> Result<(), AnyError> { + pub fn check_ffi_partial_no_path( + &mut self, + ) -> Result<(), PermissionCheckError> { let mut inner = self.inner.lock(); let inner = &mut inner.ffi; - if inner.is_allow_all() { - Ok(()) - } else { - inner.check_partial(None) + if !inner.is_allow_all() { + inner.check_partial(None)?; } + Ok(()) } #[must_use = "the resolved return value to mitigate time-of-check to time-of-use issues"] @@ -2606,7 +2820,7 @@ impl PermissionsContainer { pub fn check_ffi_partial_with_path( &mut self, path: &str, - ) -> Result { + ) -> Result { let mut inner = self.inner.lock(); let inner = &mut inner.ffi; if inner.is_allow_all() { @@ -2624,7 +2838,7 @@ impl PermissionsContainer { pub fn query_read( &self, path: Option<&str>, - ) -> Result { + ) -> Result { let inner = self.inner.lock(); let permission = &inner.read; if permission.is_allow_all() { @@ -2634,7 +2848,7 @@ impl PermissionsContainer { permission.query( path .map(|path| { - Result::<_, AnyError>::Ok( + Ok::<_, PathResolveError>( self.descriptor_parser.parse_path_query(path)?.into_read(), ) }) @@ -2648,7 +2862,7 @@ impl PermissionsContainer { pub fn query_write( &self, path: Option<&str>, - ) -> Result { + ) -> Result { let inner = self.inner.lock(); let permission = &inner.write; if permission.is_allow_all() { @@ -2658,7 +2872,7 @@ impl PermissionsContainer { permission.query( path .map(|path| { - Result::<_, AnyError>::Ok( + Ok::<_, PathResolveError>( self.descriptor_parser.parse_path_query(path)?.into_write(), ) }) @@ -2672,7 +2886,7 @@ impl PermissionsContainer { pub fn query_net( &self, host: Option<&str>, - ) -> Result { + ) -> Result { let inner = self.inner.lock(); let permission = &inner.net; if permission.is_allow_all() { @@ -2703,7 +2917,7 @@ impl PermissionsContainer { pub fn query_sys( &self, kind: Option<&str>, - ) -> Result { + ) -> Result { let inner = self.inner.lock(); let permission = &inner.sys; if permission.is_allow_all() { @@ -2723,7 +2937,7 @@ impl PermissionsContainer { pub fn query_run( &self, cmd: Option<&str>, - ) -> Result { + ) -> Result { let inner = self.inner.lock(); let permission = &inner.run; if permission.is_allow_all() { @@ -2743,7 +2957,7 @@ impl PermissionsContainer { pub fn query_ffi( &self, path: Option<&str>, - ) -> Result { + ) -> Result { let inner = self.inner.lock(); let permission = &inner.ffi; if permission.is_allow_all() { @@ -2753,7 +2967,7 @@ impl PermissionsContainer { permission.query( path .map(|path| { - Result::<_, AnyError>::Ok( + Ok::<_, PathResolveError>( self.descriptor_parser.parse_path_query(path)?.into_ffi(), ) }) @@ -2769,12 +2983,12 @@ impl PermissionsContainer { pub fn revoke_read( &self, path: Option<&str>, - ) -> Result { + ) -> Result { Ok( self.inner.lock().read.revoke( path .map(|path| { - Result::<_, AnyError>::Ok( + Ok::<_, PathResolveError>( self.descriptor_parser.parse_path_query(path)?.into_read(), ) }) @@ -2788,12 +3002,12 @@ impl PermissionsContainer { pub fn revoke_write( &self, path: Option<&str>, - ) -> Result { + ) -> Result { Ok( self.inner.lock().write.revoke( path .map(|path| { - Result::<_, AnyError>::Ok( + Ok::<_, PathResolveError>( self.descriptor_parser.parse_path_query(path)?.into_write(), ) }) @@ -2807,7 +3021,7 @@ impl PermissionsContainer { pub fn revoke_net( &self, host: Option<&str>, - ) -> Result { + ) -> Result { Ok( self.inner.lock().net.revoke( match host { @@ -2828,7 +3042,7 @@ impl PermissionsContainer { pub fn revoke_sys( &self, kind: Option<&str>, - ) -> Result { + ) -> Result { Ok( self.inner.lock().sys.revoke( kind @@ -2843,7 +3057,7 @@ impl PermissionsContainer { pub fn revoke_run( &self, cmd: Option<&str>, - ) -> Result { + ) -> Result { Ok( self.inner.lock().run.revoke( cmd @@ -2858,12 +3072,12 @@ impl PermissionsContainer { pub fn revoke_ffi( &self, path: Option<&str>, - ) -> Result { + ) -> Result { Ok( self.inner.lock().ffi.revoke( path .map(|path| { - Result::<_, AnyError>::Ok( + Ok::<_, PathResolveError>( self.descriptor_parser.parse_path_query(path)?.into_ffi(), ) }) @@ -2879,12 +3093,12 @@ impl PermissionsContainer { pub fn request_read( &self, path: Option<&str>, - ) -> Result { + ) -> Result { Ok( self.inner.lock().read.request( path .map(|path| { - Result::<_, AnyError>::Ok( + Ok::<_, PathResolveError>( self.descriptor_parser.parse_path_query(path)?.into_read(), ) }) @@ -2898,12 +3112,12 @@ impl PermissionsContainer { pub fn request_write( &self, path: Option<&str>, - ) -> Result { + ) -> Result { Ok( self.inner.lock().write.request( path .map(|path| { - Result::<_, AnyError>::Ok( + Ok::<_, PathResolveError>( self.descriptor_parser.parse_path_query(path)?.into_write(), ) }) @@ -2917,7 +3131,7 @@ impl PermissionsContainer { pub fn request_net( &self, host: Option<&str>, - ) -> Result { + ) -> Result { Ok( self.inner.lock().net.request( match host { @@ -2938,7 +3152,7 @@ impl PermissionsContainer { pub fn request_sys( &self, kind: Option<&str>, - ) -> Result { + ) -> Result { Ok( self.inner.lock().sys.request( kind @@ -2953,7 +3167,7 @@ impl PermissionsContainer { pub fn request_run( &self, cmd: Option<&str>, - ) -> Result { + ) -> Result { Ok( self.inner.lock().run.request( cmd @@ -2968,12 +3182,12 @@ impl PermissionsContainer { pub fn request_ffi( &self, path: Option<&str>, - ) -> Result { + ) -> Result { Ok( self.inner.lock().ffi.request( path .map(|path| { - Result::<_, AnyError>::Ok( + Ok::<_, PathResolveError>( self.descriptor_parser.parse_path_query(path)?.into_ffi(), ) }) @@ -3009,10 +3223,6 @@ fn global_from_option(flag: Option<&HashSet>) -> bool { matches!(flag, Some(v) if v.is_empty()) } -fn escalation_error() -> AnyError { - custom_error("NotCapable", "Can't escalate parent thread permissions") -} - #[derive(Debug, Eq, PartialEq)] pub enum ChildUnitPermissionArg { Inherit, @@ -3273,65 +3483,73 @@ pub trait PermissionDescriptorParser: Debug + Send + Sync { fn parse_read_descriptor( &self, text: &str, - ) -> Result; + ) -> Result; fn parse_write_descriptor( &self, text: &str, - ) -> Result; + ) -> Result; - fn parse_net_descriptor(&self, text: &str) - -> Result; + fn parse_net_descriptor( + &self, + text: &str, + ) -> Result; fn parse_net_descriptor_from_url( &self, url: &Url, - ) -> Result { + ) -> Result { NetDescriptor::from_url(url) } fn parse_import_descriptor( &self, text: &str, - ) -> Result; + ) -> Result; fn parse_import_descriptor_from_url( &self, url: &Url, - ) -> Result { + ) -> Result { ImportDescriptor::from_url(url) } - fn parse_env_descriptor(&self, text: &str) - -> Result; + fn parse_env_descriptor( + &self, + text: &str, + ) -> Result; - fn parse_sys_descriptor(&self, text: &str) - -> Result; + fn parse_sys_descriptor( + &self, + text: &str, + ) -> Result; fn parse_allow_run_descriptor( &self, text: &str, - ) -> Result; + ) -> Result; fn parse_deny_run_descriptor( &self, text: &str, - ) -> Result; + ) -> Result; - fn parse_ffi_descriptor(&self, text: &str) - -> Result; + fn parse_ffi_descriptor( + &self, + text: &str, + ) -> Result; // queries fn parse_path_query( &self, path: &str, - ) -> Result; + ) -> Result; fn parse_run_query( &self, requested: &str, - ) -> Result; + ) -> Result; } static IS_STANDALONE: AtomicFlag = AtomicFlag::lowered(); @@ -3374,49 +3592,49 @@ mod tests { fn parse_read_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { Ok(ReadDescriptor(self.join_path_with_root(text))) } fn parse_write_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { Ok(WriteDescriptor(self.join_path_with_root(text))) } fn parse_net_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { NetDescriptor::parse(text) } fn parse_import_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { ImportDescriptor::parse(text) } fn parse_env_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { Ok(EnvDescriptor::new(text)) } fn parse_sys_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { SysDescriptor::parse(text.to_string()) } fn parse_allow_run_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { Ok(AllowRunDescriptorParseResult::Descriptor( AllowRunDescriptor(self.join_path_with_root(text)), )) @@ -3425,7 +3643,7 @@ mod tests { fn parse_deny_run_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { if text.contains("/") { Ok(DenyRunDescriptor::Path(self.join_path_with_root(text))) } else { @@ -3436,14 +3654,14 @@ mod tests { fn parse_ffi_descriptor( &self, text: &str, - ) -> Result { + ) -> Result { Ok(FfiDescriptor(self.join_path_with_root(text))) } fn parse_path_query( &self, path: &str, - ) -> Result { + ) -> Result { Ok(PathQueryDescriptor { resolved: self.join_path_with_root(path), requested: path.to_string(), @@ -3453,8 +3671,8 @@ mod tests { fn parse_run_query( &self, requested: &str, - ) -> Result { - RunQueryDescriptor::parse(requested) + ) -> Result { + RunQueryDescriptor::parse(requested).map_err(Into::into) } } @@ -4335,7 +4553,6 @@ mod tests { None, false, ) - .unwrap() }; prompt_value.set(true); @@ -4562,13 +4779,12 @@ mod tests { .lock() .clone(), Permissions { - env: Permissions::new_unary(Some(HashSet::new()), None, false).unwrap(), + env: Permissions::new_unary(Some(HashSet::new()), None, false), net: Permissions::new_unary( Some(HashSet::from([NetDescriptor::parse("foo").unwrap()])), None, false - ) - .unwrap(), + ), ..Permissions::none_without_prompt() } ); diff --git a/runtime/permissions/prompter.rs b/runtime/permissions/prompter.rs index b582b4f53e..168a845a29 100644 --- a/runtime/permissions/prompter.rs +++ b/runtime/permissions/prompter.rs @@ -1,6 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -use deno_core::error::AnyError; use deno_core::parking_lot::Mutex; use deno_terminal::colors; use once_cell::sync::Lazy; @@ -101,8 +100,7 @@ pub struct TtyPrompter; fn clear_stdin( _stdin_lock: &mut StdinLock, _stderr_lock: &mut StderrLock, -) -> Result<(), AnyError> { - use deno_core::anyhow::bail; +) -> Result<(), std::io::Error> { use std::mem::MaybeUninit; const STDIN_FD: i32 = 0; @@ -117,7 +115,10 @@ fn clear_stdin( loop { let r = libc::tcflush(STDIN_FD, libc::TCIFLUSH); if r != 0 { - bail!("clear_stdin failed (tcflush)"); + return Err(std::io::Error::new( + std::io::ErrorKind::Other, + "clear_stdin failed (tcflush)", + )); } // Initialize timeout for select to be 100ms @@ -137,7 +138,10 @@ fn clear_stdin( // Check if select returned an error if r < 0 { - bail!("clear_stdin failed (select)"); + return Err(std::io::Error::new( + std::io::ErrorKind::Other, + "clear_stdin failed (select)", + )); } // Check if select returned due to timeout (stdin is quiescent) @@ -156,8 +160,7 @@ fn clear_stdin( fn clear_stdin( stdin_lock: &mut StdinLock, stderr_lock: &mut StderrLock, -) -> Result<(), AnyError> { - use deno_core::anyhow::bail; +) -> Result<(), std::io::Error> { use winapi::shared::minwindef::TRUE; use winapi::shared::minwindef::UINT; use winapi::shared::minwindef::WORD; @@ -194,18 +197,23 @@ fn clear_stdin( return Ok(()); - unsafe fn flush_input_buffer(stdin: HANDLE) -> Result<(), AnyError> { + unsafe fn flush_input_buffer(stdin: HANDLE) -> Result<(), std::io::Error> { let success = FlushConsoleInputBuffer(stdin); if success != TRUE { - bail!( - "Could not flush the console input buffer: {}", - std::io::Error::last_os_error() - ) + return Err(std::io::Error::new( + std::io::ErrorKind::Other, + format!( + "Could not flush the console input buffer: {}", + std::io::Error::last_os_error() + ), + )); } Ok(()) } - unsafe fn emulate_enter_key_press(stdin: HANDLE) -> Result<(), AnyError> { + unsafe fn emulate_enter_key_press( + stdin: HANDLE, + ) -> Result<(), std::io::Error> { // https://github.com/libuv/libuv/blob/a39009a5a9252a566ca0704d02df8dabc4ce328f/src/win/tty.c#L1121-L1131 let mut input_record: INPUT_RECORD = std::mem::zeroed(); input_record.EventType = KEY_EVENT; @@ -220,34 +228,43 @@ fn clear_stdin( let success = WriteConsoleInputW(stdin, &input_record, 1, &mut record_written); if success != TRUE { - bail!( - "Could not emulate enter key press: {}", - std::io::Error::last_os_error() - ); + return Err(std::io::Error::new( + std::io::ErrorKind::Other, + format!( + "Could not emulate enter key press: {}", + std::io::Error::last_os_error() + ), + )); } Ok(()) } - unsafe fn is_input_buffer_empty(stdin: HANDLE) -> Result { + unsafe fn is_input_buffer_empty( + stdin: HANDLE, + ) -> Result { let mut buffer = Vec::with_capacity(1); let mut events_read = 0; let success = PeekConsoleInputW(stdin, buffer.as_mut_ptr(), 1, &mut events_read); if success != TRUE { - bail!( - "Could not peek the console input buffer: {}", - std::io::Error::last_os_error() - ) + return Err(std::io::Error::new( + std::io::ErrorKind::Other, + format!( + "Could not peek the console input buffer: {}", + std::io::Error::last_os_error() + ), + )); } Ok(events_read == 0) } - fn move_cursor_up(stderr_lock: &mut StderrLock) -> Result<(), AnyError> { - write!(stderr_lock, "\x1B[1A")?; - Ok(()) + fn move_cursor_up( + stderr_lock: &mut StderrLock, + ) -> Result<(), std::io::Error> { + write!(stderr_lock, "\x1B[1A") } - fn read_stdin_line(stdin_lock: &mut StdinLock) -> Result<(), AnyError> { + fn read_stdin_line(stdin_lock: &mut StdinLock) -> Result<(), std::io::Error> { let mut input = String::new(); stdin_lock.read_line(&mut input)?; Ok(()) diff --git a/runtime/snapshot.rs b/runtime/snapshot.rs index 041132f971..0d81af6e74 100644 --- a/runtime/snapshot.rs +++ b/runtime/snapshot.rs @@ -5,12 +5,12 @@ use crate::ops::bootstrap::SnapshotOptions; use crate::shared::maybe_transpile_source; use crate::shared::runtime; use deno_cache::SqliteBackedCache; -use deno_core::error::AnyError; use deno_core::snapshot::*; use deno_core::v8; use deno_core::Extension; use deno_http::DefaultHttpPropertyExtractor; use deno_io::fs::FsError; +use deno_permissions::PermissionCheckError; use std::borrow::Cow; use std::io::Write; use std::path::Path; @@ -26,7 +26,7 @@ impl deno_websocket::WebSocketPermissions for Permissions { &mut self, _url: &deno_core::url::Url, _api_name: &str, - ) -> Result<(), deno_core::error::AnyError> { + ) -> Result<(), PermissionCheckError> { unreachable!("snapshotting!") } } @@ -42,7 +42,7 @@ impl deno_fetch::FetchPermissions for Permissions { &mut self, _url: &deno_core::url::Url, _api_name: &str, - ) -> Result<(), deno_core::error::AnyError> { + ) -> Result<(), PermissionCheckError> { unreachable!("snapshotting!") } @@ -50,28 +50,26 @@ impl deno_fetch::FetchPermissions for Permissions { &mut self, _p: &'a Path, _api_name: &str, - ) -> Result, AnyError> { + ) -> Result, PermissionCheckError> { unreachable!("snapshotting!") } } impl deno_ffi::FfiPermissions for Permissions { - fn check_partial_no_path( - &mut self, - ) -> Result<(), deno_core::error::AnyError> { + fn check_partial_no_path(&mut self) -> Result<(), PermissionCheckError> { unreachable!("snapshotting!") } fn check_partial_with_path( &mut self, _path: &str, - ) -> Result { + ) -> Result { unreachable!("snapshotting!") } } impl deno_napi::NapiPermissions for Permissions { - fn check(&mut self, _path: &str) -> std::result::Result { + fn check(&mut self, _path: &str) -> Result { unreachable!("snapshotting!") } } @@ -81,20 +79,20 @@ impl deno_node::NodePermissions for Permissions { &mut self, _url: &deno_core::url::Url, _api_name: &str, - ) -> Result<(), deno_core::error::AnyError> { + ) -> Result<(), PermissionCheckError> { unreachable!("snapshotting!") } fn check_read_path<'a>( &mut self, _path: &'a Path, - ) -> Result, AnyError> { + ) -> Result, PermissionCheckError> { unreachable!("snapshotting!") } fn check_read_with_api_name( &mut self, _p: &str, _api_name: Option<&str>, - ) -> Result { + ) -> Result { unreachable!("snapshotting!") } fn query_read_all(&mut self) -> bool { @@ -104,14 +102,14 @@ impl deno_node::NodePermissions for Permissions { &mut self, _p: &str, _api_name: Option<&str>, - ) -> Result { + ) -> Result { unreachable!("snapshotting!") } fn check_sys( &mut self, _kind: &str, _api_name: &str, - ) -> Result<(), deno_core::error::AnyError> { + ) -> Result<(), PermissionCheckError> { unreachable!("snapshotting!") } } @@ -121,7 +119,7 @@ impl deno_net::NetPermissions for Permissions { &mut self, _host: &(T, Option), _api_name: &str, - ) -> Result<(), deno_core::error::AnyError> { + ) -> Result<(), PermissionCheckError> { unreachable!("snapshotting!") } @@ -129,7 +127,7 @@ impl deno_net::NetPermissions for Permissions { &mut self, _p: &str, _api_name: &str, - ) -> Result { + ) -> Result { unreachable!("snapshotting!") } @@ -137,7 +135,7 @@ impl deno_net::NetPermissions for Permissions { &mut self, _p: &str, _api_name: &str, - ) -> Result { + ) -> Result { unreachable!("snapshotting!") } @@ -145,7 +143,7 @@ impl deno_net::NetPermissions for Permissions { &mut self, _p: &'a Path, _api_name: &str, - ) -> Result, AnyError> { + ) -> Result, PermissionCheckError> { unreachable!("snapshotting!") } } @@ -158,7 +156,7 @@ impl deno_fs::FsPermissions for Permissions { _write: bool, _path: &'a Path, _api_name: &str, - ) -> Result, FsError> { + ) -> Result, FsError> { unreachable!("snapshotting!") } @@ -166,11 +164,14 @@ impl deno_fs::FsPermissions for Permissions { &mut self, _path: &str, _api_name: &str, - ) -> Result { + ) -> Result { unreachable!("snapshotting!") } - fn check_read_all(&mut self, _api_name: &str) -> Result<(), AnyError> { + fn check_read_all( + &mut self, + _api_name: &str, + ) -> Result<(), PermissionCheckError> { unreachable!("snapshotting!") } @@ -179,7 +180,7 @@ impl deno_fs::FsPermissions for Permissions { _path: &Path, _display: &str, _api_name: &str, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionCheckError> { unreachable!("snapshotting!") } @@ -187,7 +188,7 @@ impl deno_fs::FsPermissions for Permissions { &mut self, _path: &str, _api_name: &str, - ) -> Result { + ) -> Result { unreachable!("snapshotting!") } @@ -195,11 +196,14 @@ impl deno_fs::FsPermissions for Permissions { &mut self, _path: &str, _api_name: &str, - ) -> Result { + ) -> Result { unreachable!("snapshotting!") } - fn check_write_all(&mut self, _api_name: &str) -> Result<(), AnyError> { + fn check_write_all( + &mut self, + _api_name: &str, + ) -> Result<(), PermissionCheckError> { unreachable!("snapshotting!") } @@ -208,7 +212,7 @@ impl deno_fs::FsPermissions for Permissions { _path: &Path, _display: &str, _api_name: &str, - ) -> Result<(), AnyError> { + ) -> Result<(), PermissionCheckError> { unreachable!("snapshotting!") } @@ -216,7 +220,7 @@ impl deno_fs::FsPermissions for Permissions { &mut self, _path: &'a Path, _api_name: &str, - ) -> Result, AnyError> { + ) -> Result, PermissionCheckError> { unreachable!("snapshotting!") } @@ -224,7 +228,7 @@ impl deno_fs::FsPermissions for Permissions { &mut self, _path: &'a Path, _api_name: &str, - ) -> Result, AnyError> { + ) -> Result, PermissionCheckError> { unreachable!("snapshotting!") } } @@ -234,7 +238,7 @@ impl deno_kv::sqlite::SqliteDbHandlerPermissions for Permissions { &mut self, _path: &str, _api_name: &str, - ) -> Result { + ) -> Result { unreachable!("snapshotting!") } @@ -242,7 +246,7 @@ impl deno_kv::sqlite::SqliteDbHandlerPermissions for Permissions { &mut self, _path: &'a Path, _api_name: &str, - ) -> Result, AnyError> { + ) -> Result, PermissionCheckError> { unreachable!("snapshotting!") } } From 9a39a98b57de4183e054ab170592c85c97fac183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 4 Nov 2024 17:57:29 +0000 Subject: [PATCH 023/227] fix(fmt): ignore file directive for YAML files (#26717) Closes https://github.com/denoland/deno/issues/26712 Support `# deno-fmt-ignore-file` directive for YAML files. Also added tests for single line ignores. --- cli/tools/fmt.rs | 15 +++++++++++++ tests/specs/fmt/yaml/__test__.jsonc | 24 +++++++++++++++++++++ tests/specs/fmt/yaml/ignore_file.yaml | 2 ++ tests/specs/fmt/yaml/ignore_file2.yaml | 2 ++ tests/specs/fmt/yaml/ignore_file3.yaml | 5 +++++ tests/specs/fmt/yaml/ignore_file4.yaml | 2 ++ tests/specs/fmt/yaml/ignore_line.yml | 2 ++ tests/specs/fmt/yaml/wrong_file_ignore.out | 7 ++++++ tests/specs/fmt/yaml/wrong_file_ignore.yaml | 5 +++++ 9 files changed, 64 insertions(+) create mode 100644 tests/specs/fmt/yaml/ignore_file.yaml create mode 100644 tests/specs/fmt/yaml/ignore_file2.yaml create mode 100644 tests/specs/fmt/yaml/ignore_file3.yaml create mode 100644 tests/specs/fmt/yaml/ignore_file4.yaml create mode 100644 tests/specs/fmt/yaml/ignore_line.yml create mode 100644 tests/specs/fmt/yaml/wrong_file_ignore.out create mode 100644 tests/specs/fmt/yaml/wrong_file_ignore.yaml diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index 81af25c34b..8378835612 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -353,6 +353,21 @@ fn format_yaml( file_text: &str, fmt_options: &FmtOptionsConfig, ) -> Result, AnyError> { + let ignore_file = file_text + .lines() + .take_while(|line| line.starts_with('#')) + .any(|line| { + line + .strip_prefix('#') + .unwrap() + .trim() + .starts_with("deno-fmt-ignore-file") + }); + + if ignore_file { + return Ok(None); + } + let formatted_str = pretty_yaml::format_text(file_text, &get_resolved_yaml_config(fmt_options)) .map_err(AnyError::from)?; diff --git a/tests/specs/fmt/yaml/__test__.jsonc b/tests/specs/fmt/yaml/__test__.jsonc index 499b4144b7..71a2e06827 100644 --- a/tests/specs/fmt/yaml/__test__.jsonc +++ b/tests/specs/fmt/yaml/__test__.jsonc @@ -8,6 +8,30 @@ "well_formatted": { "args": "fmt --check well_formatted.yml", "output": "Checked 1 file\n" + }, + "ignore_line": { + "args": "fmt --check ignore_line.yml", + "output": "Checked 1 file\n" + }, + "ignore_file": { + "args": "fmt ignore_file.yaml", + "output": "Checked 1 file\n" + }, + "ignore_file2": { + "args": "fmt ignore_file2.yaml", + "output": "Checked 1 file\n" + }, + "ignore_file3": { + "args": "fmt ignore_file3.yaml", + "output": "Checked 1 file\n" + }, + "ignore_file4": { + "args": "fmt ignore_file4.yaml", + "output": "Checked 1 file\n" + }, + "wrong_file_ignore": { + "args": "fmt wrong_file_ignore.yaml", + "output": "wrong_file_ignore.out" } } } diff --git a/tests/specs/fmt/yaml/ignore_file.yaml b/tests/specs/fmt/yaml/ignore_file.yaml new file mode 100644 index 0000000000..c724c7bde5 --- /dev/null +++ b/tests/specs/fmt/yaml/ignore_file.yaml @@ -0,0 +1,2 @@ +# deno-fmt-ignore-file +{{something crazy \ No newline at end of file diff --git a/tests/specs/fmt/yaml/ignore_file2.yaml b/tests/specs/fmt/yaml/ignore_file2.yaml new file mode 100644 index 0000000000..a2053533ef --- /dev/null +++ b/tests/specs/fmt/yaml/ignore_file2.yaml @@ -0,0 +1,2 @@ +#deno-fmt-ignore-file +{{something crazy \ No newline at end of file diff --git a/tests/specs/fmt/yaml/ignore_file3.yaml b/tests/specs/fmt/yaml/ignore_file3.yaml new file mode 100644 index 0000000000..a3927a7b19 --- /dev/null +++ b/tests/specs/fmt/yaml/ignore_file3.yaml @@ -0,0 +1,5 @@ +# Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor +# incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, +# quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +# deno-fmt-ignore-file +{{something crazy \ No newline at end of file diff --git a/tests/specs/fmt/yaml/ignore_file4.yaml b/tests/specs/fmt/yaml/ignore_file4.yaml new file mode 100644 index 0000000000..c32fe9f2be --- /dev/null +++ b/tests/specs/fmt/yaml/ignore_file4.yaml @@ -0,0 +1,2 @@ +# deno-fmt-ignore-file Because this is templated yaml file +{{something crazy \ No newline at end of file diff --git a/tests/specs/fmt/yaml/ignore_line.yml b/tests/specs/fmt/yaml/ignore_line.yml new file mode 100644 index 0000000000..490adcb5f7 --- /dev/null +++ b/tests/specs/fmt/yaml/ignore_line.yml @@ -0,0 +1,2 @@ +# deno-fmt-ignore +- Test diff --git a/tests/specs/fmt/yaml/wrong_file_ignore.out b/tests/specs/fmt/yaml/wrong_file_ignore.out new file mode 100644 index 0000000000..065dc98db0 --- /dev/null +++ b/tests/specs/fmt/yaml/wrong_file_ignore.out @@ -0,0 +1,7 @@ +Error formatting: [WILDCARD]wrong_file_ignore.yaml + parse error at line 5, column 1 + | +5 | {{something crazy + | ^ + +Checked 1 file diff --git a/tests/specs/fmt/yaml/wrong_file_ignore.yaml b/tests/specs/fmt/yaml/wrong_file_ignore.yaml new file mode 100644 index 0000000000..8019d989d3 --- /dev/null +++ b/tests/specs/fmt/yaml/wrong_file_ignore.yaml @@ -0,0 +1,5 @@ +# File ignore directive only works if it's in the first cluster +# of comment, ie. there are no empty lines after the first n-leading lines. + +# deno-fmt-ignore-file +{{something crazy \ No newline at end of file From d55e30f41855d40b36019f347a15b6c8984eb3e9 Mon Sep 17 00:00:00 2001 From: Scott Twiname Date: Tue, 5 Nov 2024 07:20:34 +1300 Subject: [PATCH 024/227] fix(types): missing `import` permission on `PermissionOptionsObject` (#26627) --- cli/tsc/dts/lib.deno.ns.d.ts | 37 ++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index 36592e10dc..6e0e84b687 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -556,14 +556,23 @@ declare namespace Deno { */ env?: "inherit" | boolean | string[]; - /** Specifies if the `sys` permission should be requested or revoked. - * If set to `"inherit"`, the current `sys` permission will be inherited. - * If set to `true`, the global `sys` permission will be requested. - * If set to `false`, the global `sys` permission will be revoked. + /** Specifies if the `ffi` permission should be requested or revoked. + * If set to `"inherit"`, the current `ffi` permission will be inherited. + * If set to `true`, the global `ffi` permission will be requested. + * If set to `false`, the global `ffi` permission will be revoked. * * @default {false} */ - sys?: "inherit" | boolean | string[]; + ffi?: "inherit" | boolean | Array; + + /** Specifies if the `import` permission should be requested or revoked. + * If set to `"inherit"` the current `import` permission will be inherited. + * If set to `true`, the global `import` permission will be requested. + * If set to `false`, the global `import` permission will be revoked. + * If set to `Array`, the `import` permissions will be requested with the + * specified domains. + */ + import?: "inherit" | boolean | Array; /** Specifies if the `net` permission should be requested or revoked. * if set to `"inherit"`, the current `net` permission will be inherited. @@ -638,15 +647,6 @@ declare namespace Deno { */ net?: "inherit" | boolean | string[]; - /** Specifies if the `ffi` permission should be requested or revoked. - * If set to `"inherit"`, the current `ffi` permission will be inherited. - * If set to `true`, the global `ffi` permission will be requested. - * If set to `false`, the global `ffi` permission will be revoked. - * - * @default {false} - */ - ffi?: "inherit" | boolean | Array; - /** Specifies if the `read` permission should be requested or revoked. * If set to `"inherit"`, the current `read` permission will be inherited. * If set to `true`, the global `read` permission will be requested. @@ -667,6 +667,15 @@ declare namespace Deno { */ run?: "inherit" | boolean | Array; + /** Specifies if the `sys` permission should be requested or revoked. + * If set to `"inherit"`, the current `sys` permission will be inherited. + * If set to `true`, the global `sys` permission will be requested. + * If set to `false`, the global `sys` permission will be revoked. + * + * @default {false} + */ + sys?: "inherit" | boolean | string[]; + /** Specifies if the `write` permission should be requested or revoked. * If set to `"inherit"`, the current `write` permission will be inherited. * If set to `true`, the global `write` permission will be requested. From d67765b0b48d711cd0878e168ccb1e28178c4006 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Mon, 4 Nov 2024 20:01:31 +0000 Subject: [PATCH 025/227] fix(lsp): scope attribution for lazily loaded assets (#26699) --- cli/tsc/99_main_compiler.js | 17 +++++++++------ tests/integration/lsp_tests.rs | 39 ++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index bdc4340e33..52c9134dad 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -801,13 +801,18 @@ delete Object.prototype.__proto__; if (logDebug) { debug(`host.getScriptSnapshot("${specifier}")`); } - const sourceFile = sourceFileCache.get(specifier); - if (sourceFile) { - if (!assetScopes.has(specifier)) { - assetScopes.set(specifier, lastRequestScope); + if (specifier.startsWith(ASSETS_URL_PREFIX)) { + const sourceFile = this.getSourceFile( + specifier, + ts.ScriptTarget.ESNext, + ); + if (sourceFile) { + if (!assetScopes.has(specifier)) { + assetScopes.set(specifier, lastRequestScope); + } + // This case only occurs for assets. + return ts.ScriptSnapshot.fromString(sourceFile.text); } - // This case only occurs for assets. - return ts.ScriptSnapshot.fromString(sourceFile.text); } let sourceText = sourceTextCache.get(specifier); if (sourceText == undefined) { diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 2376aebd90..56221a0269 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -6396,6 +6396,45 @@ fn lsp_cache_on_save() { client.shutdown(); } +// Regression test for https://github.com/denoland/deno/issues/25999. +#[test] +fn lsp_asset_document_dom_code_action() { + let context = TestContextBuilder::new().use_temp_cwd().build(); + let temp_dir = context.temp_dir(); + temp_dir.write( + "deno.json", + json!({ + "compilerOptions": { + "lib": ["deno.window", "dom"], + }, + }) + .to_string(), + ); + let mut client = context.new_lsp_command().build(); + client.initialize_default(); + client.did_open(json!({ + "textDocument": { + "uri": temp_dir.url().join("file.ts").unwrap(), + "languageId": "typescript", + "version": 1, + "text": r#""#, + }, + })); + let res = client.write_request( + "textDocument/codeAction", + json!({ + "textDocument": { "uri": "asset:///lib.dom.d.ts" }, + "range": { + "start": { "line": 0, "character": 0 }, + "end": { "line": 0, "character": 0 }, + }, + "context": { "diagnostics": [], "only": ["quickfix"] }, + }), + ); + assert_eq!(res, json!(null)); + client.shutdown(); +} + // Regression test for https://github.com/denoland/deno/issues/22122. #[test] fn lsp_cache_then_definition() { From bb3ca84e6d8f4f9f2a30de93bd87e243048a8d74 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 4 Nov 2024 15:40:05 -0500 Subject: [PATCH 026/227] fix(fmt): do not panic for jsx ignore container followed by jsx text (#26723) --- .dprint.json | 2 +- Cargo.lock | 4 ++-- cli/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.dprint.json b/.dprint.json index ea99f2aeda..489a61e571 100644 --- a/.dprint.json +++ b/.dprint.json @@ -68,7 +68,7 @@ "third_party" ], "plugins": [ - "https://plugins.dprint.dev/typescript-0.93.1.wasm", + "https://plugins.dprint.dev/typescript-0.93.2.wasm", "https://plugins.dprint.dev/json-0.19.4.wasm", "https://plugins.dprint.dev/markdown-0.17.8.wasm", "https://plugins.dprint.dev/toml-0.6.3.wasm", diff --git a/Cargo.lock b/Cargo.lock index a8a501716c..40b0bc171b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2609,9 +2609,9 @@ dependencies = [ [[package]] name = "dprint-plugin-typescript" -version = "0.93.1" +version = "0.93.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5abfd78fe3cde4f5a6699d65f760c8d44da130cf446b6f80a7a9bc6580e156ab" +checksum = "3ff29fd136541e59d51946f0d2d353fefc886776f61a799ebfb5838b06cef13b" dependencies = [ "anyhow", "deno_ast", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index a3e2b71f00..b4f2e614f0 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -107,7 +107,7 @@ dotenvy = "0.15.7" dprint-plugin-json = "=0.19.4" dprint-plugin-jupyter = "=0.1.5" dprint-plugin-markdown = "=0.17.8" -dprint-plugin-typescript = "=0.93.1" +dprint-plugin-typescript = "=0.93.2" env_logger = "=0.10.0" fancy-regex = "=0.10.0" faster-hex.workspace = true From 84aee0be9aac53499a757973a8a2054d2a44e479 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:08:29 -0800 Subject: [PATCH 027/227] fix(ext/node): add `findSourceMap` to the default export of `node:module` (#26720) Next.js 15.0.2 tries to use this and errors out --- ext/node/polyfills/01_require.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js index 296d819aa5..d818bb5727 100644 --- a/ext/node/polyfills/01_require.js +++ b/ext/node/polyfills/01_require.js @@ -1312,6 +1312,8 @@ export function findSourceMap(_path) { return undefined; } +Module.findSourceMap = findSourceMap; + /** * @param {string | URL} _specifier * @param {string | URL} _parentUrl From 051552172c07e42bf666d04863bc511667471509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 4 Nov 2024 23:42:18 +0000 Subject: [PATCH 028/227] fix(workspace): support wildcard packages (#26568) This commit adds support for wildcard packages in `workspace` configuration option in `deno.json`. This is now supported: ``` { "workspace": [ "./packages/*" ] } ``` Closes https://github.com/denoland/deno/issues/25783 --- Cargo.lock | 4 ++-- cli/Cargo.toml | 2 +- .../run/workspaces/wildcard/__test__.jsonc | 5 +++++ tests/specs/run/workspaces/wildcard/deno.json | 8 +++++++ tests/specs/run/workspaces/wildcard/main.out | 22 +++++++++++++++++++ tests/specs/run/workspaces/wildcard/main.ts | 5 +++++ .../wildcard/packages/bar/deno.json | 8 +++++++ .../wildcard/packages/bar/fizz/buzz.ts | 1 + .../workspaces/wildcard/packages/bar/mod.ts | 5 +++++ .../wildcard/packages/bar/some_mod/hello.ts | 1 + .../wildcard/packages/foo/bar/hello.ts | 1 + .../wildcard/packages/foo/deno.json | 8 +++++++ .../wildcard/packages/foo/fizz/buzz.ts | 1 + .../workspaces/wildcard/packages/foo/mod.ts | 5 +++++ 14 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 tests/specs/run/workspaces/wildcard/__test__.jsonc create mode 100644 tests/specs/run/workspaces/wildcard/deno.json create mode 100644 tests/specs/run/workspaces/wildcard/main.out create mode 100644 tests/specs/run/workspaces/wildcard/main.ts create mode 100644 tests/specs/run/workspaces/wildcard/packages/bar/deno.json create mode 100644 tests/specs/run/workspaces/wildcard/packages/bar/fizz/buzz.ts create mode 100644 tests/specs/run/workspaces/wildcard/packages/bar/mod.ts create mode 100644 tests/specs/run/workspaces/wildcard/packages/bar/some_mod/hello.ts create mode 100644 tests/specs/run/workspaces/wildcard/packages/foo/bar/hello.ts create mode 100644 tests/specs/run/workspaces/wildcard/packages/foo/deno.json create mode 100644 tests/specs/run/workspaces/wildcard/packages/foo/fizz/buzz.ts create mode 100644 tests/specs/run/workspaces/wildcard/packages/foo/mod.ts diff --git a/Cargo.lock b/Cargo.lock index 40b0bc171b..c22d49c41c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1387,9 +1387,9 @@ dependencies = [ [[package]] name = "deno_config" -version = "0.37.2" +version = "0.38.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5900bfb37538d83b19ba0b157cdc785770e38422ee4632411e3bd3d90ac0f537" +checksum = "966825073480a6ac7e01977a3879d13edc8d6ea2d65ea164b37156a5fb206e9a" dependencies = [ "anyhow", "deno_package_json", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index b4f2e614f0..1fa9692a4d 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -70,7 +70,7 @@ winres.workspace = true [dependencies] deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposal", "react", "sourcemap", "transforms", "typescript", "view", "visit"] } deno_cache_dir = { workspace = true } -deno_config = { version = "=0.37.2", features = ["workspace", "sync"] } +deno_config = { version = "=0.38.2", features = ["workspace", "sync"] } deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_doc = { version = "0.156.0", default-features = false, features = ["rust", "html", "syntect"] } deno_graph = { version = "=0.84.1" } diff --git a/tests/specs/run/workspaces/wildcard/__test__.jsonc b/tests/specs/run/workspaces/wildcard/__test__.jsonc new file mode 100644 index 0000000000..ea467e51b4 --- /dev/null +++ b/tests/specs/run/workspaces/wildcard/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run -L debug -A main.ts", + "output": "main.out", + "tempDir": true +} diff --git a/tests/specs/run/workspaces/wildcard/deno.json b/tests/specs/run/workspaces/wildcard/deno.json new file mode 100644 index 0000000000..8c39ec6564 --- /dev/null +++ b/tests/specs/run/workspaces/wildcard/deno.json @@ -0,0 +1,8 @@ +{ + "workspace": [ + "./packages/*" + ], + "imports": { + "chalk": "npm:chalk" + } +} diff --git a/tests/specs/run/workspaces/wildcard/main.out b/tests/specs/run/workspaces/wildcard/main.out new file mode 100644 index 0000000000..72165dbdea --- /dev/null +++ b/tests/specs/run/workspaces/wildcard/main.out @@ -0,0 +1,22 @@ +[WILDCARD]Workspace config generated this import map { + "imports": { + "chalk": "npm:chalk", + "chalk/": "npm:/chalk/" + }, + "scopes": { + "./packages/bar/": { + "@/": "./packages/bar/", + "secret_mod/": "./packages/bar/some_mod/" + }, + "./packages/foo/": { + "~/": "./packages/foo/", + "foo/": "./packages/foo/bar/" + } + } +} +[WILDCARD] +hello from foo +buzz from foo +hello from bar +buzz from bar +[Function: chalk][WILDCARD] \ No newline at end of file diff --git a/tests/specs/run/workspaces/wildcard/main.ts b/tests/specs/run/workspaces/wildcard/main.ts new file mode 100644 index 0000000000..e69143370d --- /dev/null +++ b/tests/specs/run/workspaces/wildcard/main.ts @@ -0,0 +1,5 @@ +import chalk from "chalk"; +import "./packages/foo/mod.ts"; +import "./packages/bar/mod.ts"; + +console.log(chalk); diff --git a/tests/specs/run/workspaces/wildcard/packages/bar/deno.json b/tests/specs/run/workspaces/wildcard/packages/bar/deno.json new file mode 100644 index 0000000000..ef3bfc37af --- /dev/null +++ b/tests/specs/run/workspaces/wildcard/packages/bar/deno.json @@ -0,0 +1,8 @@ +{ + "name": "asdfasdfasdf", + "version": "0.0.0", + "imports": { + "@/": "./", + "secret_mod/": "./some_mod/" + } +} diff --git a/tests/specs/run/workspaces/wildcard/packages/bar/fizz/buzz.ts b/tests/specs/run/workspaces/wildcard/packages/bar/fizz/buzz.ts new file mode 100644 index 0000000000..f88d62fcc8 --- /dev/null +++ b/tests/specs/run/workspaces/wildcard/packages/bar/fizz/buzz.ts @@ -0,0 +1 @@ +export const buzz = "buzz from bar"; diff --git a/tests/specs/run/workspaces/wildcard/packages/bar/mod.ts b/tests/specs/run/workspaces/wildcard/packages/bar/mod.ts new file mode 100644 index 0000000000..6f898e3898 --- /dev/null +++ b/tests/specs/run/workspaces/wildcard/packages/bar/mod.ts @@ -0,0 +1,5 @@ +import { hello } from "secret_mod/hello.ts"; +import { buzz } from "@/fizz/buzz.ts"; + +console.log(hello); +console.log(buzz); diff --git a/tests/specs/run/workspaces/wildcard/packages/bar/some_mod/hello.ts b/tests/specs/run/workspaces/wildcard/packages/bar/some_mod/hello.ts new file mode 100644 index 0000000000..1013de8d2e --- /dev/null +++ b/tests/specs/run/workspaces/wildcard/packages/bar/some_mod/hello.ts @@ -0,0 +1 @@ +export const hello = "hello from bar"; diff --git a/tests/specs/run/workspaces/wildcard/packages/foo/bar/hello.ts b/tests/specs/run/workspaces/wildcard/packages/foo/bar/hello.ts new file mode 100644 index 0000000000..c8a7e57c4d --- /dev/null +++ b/tests/specs/run/workspaces/wildcard/packages/foo/bar/hello.ts @@ -0,0 +1 @@ +export const hello = "hello from foo"; diff --git a/tests/specs/run/workspaces/wildcard/packages/foo/deno.json b/tests/specs/run/workspaces/wildcard/packages/foo/deno.json new file mode 100644 index 0000000000..46d84f06fa --- /dev/null +++ b/tests/specs/run/workspaces/wildcard/packages/foo/deno.json @@ -0,0 +1,8 @@ +{ + "name": "qwerqwer", + "version": "0.0.0", + "imports": { + "~/": "./", + "foo/": "./bar/" + } +} diff --git a/tests/specs/run/workspaces/wildcard/packages/foo/fizz/buzz.ts b/tests/specs/run/workspaces/wildcard/packages/foo/fizz/buzz.ts new file mode 100644 index 0000000000..4e03777d1b --- /dev/null +++ b/tests/specs/run/workspaces/wildcard/packages/foo/fizz/buzz.ts @@ -0,0 +1 @@ +export const buzz = "buzz from foo"; diff --git a/tests/specs/run/workspaces/wildcard/packages/foo/mod.ts b/tests/specs/run/workspaces/wildcard/packages/foo/mod.ts new file mode 100644 index 0000000000..d7b16dcc05 --- /dev/null +++ b/tests/specs/run/workspaces/wildcard/packages/foo/mod.ts @@ -0,0 +1,5 @@ +import { hello } from "foo/hello.ts"; +import { buzz } from "~/fizz/buzz.ts"; + +console.log(hello); +console.log(buzz); From 25ed90baaec420e6496593406494d3747d9a6db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 4 Nov 2024 23:56:09 +0000 Subject: [PATCH 029/227] ci: use self-hosted mac arm runner for building on tags (#26727) --- .github/workflows/ci.generate.ts | 4 +++- .github/workflows/ci.yml | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts index 49d11107d5..0faf08a1a8 100755 --- a/.github/workflows/ci.generate.ts +++ b/.github/workflows/ci.generate.ts @@ -14,6 +14,7 @@ const windowsX86Runner = "windows-2022"; const windowsX86XlRunner = "windows-2022-xl"; const macosX86Runner = "macos-13"; const macosArmRunner = "macos-14"; +const selfHostedMacosArmRunner = "self-hosted"; const Runners = { linuxX86: { @@ -40,7 +41,8 @@ const Runners = { macosArm: { os: "macos", arch: "aarch64", - runner: macosArmRunner, + runner: + `\${{ github.repository == 'denoland/deno' && startsWith(github.ref, 'refs/tags/') && '${selfHostedMacosArmRunner}' || '${macosArmRunner}' }}`, }, windowsX86: { os: "windows", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9c06de17a..5aafe89d27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,12 +68,12 @@ jobs: skip: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'') }}' - os: macos arch: aarch64 - runner: macos-14 + runner: '${{ github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'') && ''self-hosted'' || ''macos-14'' }}' job: test profile: debug - os: macos arch: aarch64 - runner: '${{ (!contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'')) && ''ubuntu-24.04'' || ''macos-14'' }}' + runner: '${{ (!contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'')) && ''ubuntu-24.04'' || github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'') && ''self-hosted'' || ''macos-14'' }}' job: test profile: release skip: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'') }}' From 44eca0505c35201c6b67ba073834402b7681914f Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:09:17 -0800 Subject: [PATCH 030/227] chore: fix serve_watch_all test (#26725) It's been failing a ton lately, it looks like the test is just incorrectly using TS syntax in a JS file https://github.com/denoland/deno/actions/runs/11672972415/job/32502710624?pr=26724#step:43:2791 I'm not really sure how this ever passes --- tests/integration/watcher_tests.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/integration/watcher_tests.rs b/tests/integration/watcher_tests.rs index d4705b8d53..e8f264632d 100644 --- a/tests/integration/watcher_tests.rs +++ b/tests/integration/watcher_tests.rs @@ -572,16 +572,19 @@ async fn serve_watch_all() { let main_file_to_watch = t.path().join("main_file_to_watch.js"); main_file_to_watch.write( "export default { - fetch(_request: Request) { + fetch(_request) { return new Response(\"aaaaaaqqq!\"); }, };", ); + let another_file = t.path().join("another_file.js"); + another_file.write(""); + let mut child = util::deno_cmd() .current_dir(t.path()) .arg("serve") - .arg("--watch=another_file.js") + .arg(format!("--watch={another_file}")) .arg("-L") .arg("debug") .arg(&main_file_to_watch) @@ -596,7 +599,7 @@ async fn serve_watch_all() { // Change content of the file main_file_to_watch.write( "export default { - fetch(_request: Request) { + fetch(_request) { return new Response(\"aaaaaaqqq123!\"); }, };", @@ -604,18 +607,20 @@ async fn serve_watch_all() { wait_contains("Restarting", &mut stderr_lines).await; wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await; - let another_file = t.path().join("another_file.js"); another_file.write("export const foo = 0;"); // Confirm that the added file is watched as well wait_contains("Restarting", &mut stderr_lines).await; + wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await; main_file_to_watch .write("import { foo } from './another_file.js'; console.log(foo);"); wait_contains("Restarting", &mut stderr_lines).await; + wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await; wait_contains("0", &mut stdout_lines).await; another_file.write("export const foo = 42;"); wait_contains("Restarting", &mut stderr_lines).await; + wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await; wait_contains("42", &mut stdout_lines).await; // Confirm that watch continues even with wrong syntax error @@ -623,10 +628,11 @@ async fn serve_watch_all() { wait_contains("Restarting", &mut stderr_lines).await; wait_contains("error:", &mut stderr_lines).await; + wait_for_watcher("main_file_to_watch.js", &mut stderr_lines).await; main_file_to_watch.write( "export default { - fetch(_request: Request) { + fetch(_request) { return new Response(\"aaaaaaqqq!\"); }, };", From 706b1dfcea8ab6bf7d155893ab795669107516a8 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Mon, 4 Nov 2024 18:45:00 -0800 Subject: [PATCH 031/227] fix(add): better error message when adding package that only has pre-release versions (#26724) Fixes https://github.com/denoland/deno/issues/26597 A small refactor as well to reduce some code duplication --- cli/tools/registry/pm.rs | 205 +++++++++++++----- .../@denotest/unstable/1.0.0-beta.1/mod.ts | 3 + .../@denotest/unstable/1.0.0-beta.1_meta.json | 5 + .../@denotest/unstable/1.0.0-beta.2/mod.ts | 3 + .../@denotest/unstable/1.0.0-beta.2_meta.json | 5 + .../registry/jsr/@denotest/unstable/meta.json | 6 + .../add/only_unstable_versions/__test__.jsonc | 23 +- .../add/only_unstable_versions/add_jsr.out | 1 + 8 files changed, 187 insertions(+), 64 deletions(-) create mode 100644 tests/registry/jsr/@denotest/unstable/1.0.0-beta.1/mod.ts create mode 100644 tests/registry/jsr/@denotest/unstable/1.0.0-beta.1_meta.json create mode 100644 tests/registry/jsr/@denotest/unstable/1.0.0-beta.2/mod.ts create mode 100644 tests/registry/jsr/@denotest/unstable/1.0.0-beta.2_meta.json create mode 100644 tests/registry/jsr/@denotest/unstable/meta.json create mode 100644 tests/specs/add/only_unstable_versions/add_jsr.out diff --git a/cli/tools/registry/pm.rs b/cli/tools/registry/pm.rs index 4e03879983..68913e2591 100644 --- a/cli/tools/registry/pm.rs +++ b/cli/tools/registry/pm.rs @@ -12,7 +12,9 @@ use deno_core::futures::StreamExt; use deno_path_util::url_to_file_path; use deno_semver::jsr::JsrPackageReqReference; use deno_semver::npm::NpmPackageReqReference; +use deno_semver::package::PackageNv; use deno_semver::package::PackageReq; +use deno_semver::Version; use deno_semver::VersionReq; use jsonc_parser::cst::CstObject; use jsonc_parser::cst::CstObjectProp; @@ -455,15 +457,32 @@ pub async fn add( match package_and_version { PackageAndVersion::NotFound { package: package_name, - found_npm_package, + help, package_req, - } => { - if found_npm_package { - bail!("{} was not found, but a matching npm package exists. Did you mean `{}`?", crate::colors::red(package_name), crate::colors::yellow(format!("deno {cmd_name} npm:{package_req}"))); - } else { - bail!("{} was not found.", crate::colors::red(package_name)); + } => match help { + Some(NotFoundHelp::NpmPackage) => { + bail!( + "{} was not found, but a matching npm package exists. Did you mean `{}`?", + crate::colors::red(package_name), + crate::colors::yellow(format!("deno {cmd_name} npm:{package_req}")) + ); } - } + Some(NotFoundHelp::JsrPackage) => { + bail!( + "{} was not found, but a matching jsr package exists. Did you mean `{}`?", + crate::colors::red(package_name), + crate::colors::yellow(format!("deno {cmd_name} jsr:{package_req}")) + ) + } + Some(NotFoundHelp::PreReleaseVersion(version)) => { + bail!( + "{} has only pre-release versions available. Try specifying a version: `{}`", + crate::colors::red(&package_name), + crate::colors::yellow(format!("deno {cmd_name} {package_name}@^{version}")) + ) + } + None => bail!("{} was not found.", crate::colors::red(package_name)), + }, PackageAndVersion::Selected(selected) => { selected_packages.push(selected); } @@ -511,76 +530,144 @@ struct SelectedPackage { selected_version: String, } +enum NotFoundHelp { + NpmPackage, + JsrPackage, + PreReleaseVersion(Version), +} + enum PackageAndVersion { NotFound { package: String, - found_npm_package: bool, package_req: PackageReq, + help: Option, }, Selected(SelectedPackage), } +fn best_version<'a>( + versions: impl Iterator, +) -> Option<&'a Version> { + let mut maybe_best_version: Option<&Version> = None; + for version in versions { + let is_best_version = maybe_best_version + .as_ref() + .map(|best_version| (*best_version).cmp(version).is_lt()) + .unwrap_or(true); + if is_best_version { + maybe_best_version = Some(version); + } + } + maybe_best_version +} + +trait PackageInfoProvider { + const SPECIFIER_PREFIX: &str; + /// The help to return if a package is found by this provider + const HELP: NotFoundHelp; + async fn req_to_nv(&self, req: &PackageReq) -> Option; + async fn latest_version<'a>(&self, req: &PackageReq) -> Option; +} + +impl PackageInfoProvider for Arc { + const HELP: NotFoundHelp = NotFoundHelp::JsrPackage; + const SPECIFIER_PREFIX: &str = "jsr"; + async fn req_to_nv(&self, req: &PackageReq) -> Option { + (**self).req_to_nv(req).await + } + + async fn latest_version<'a>(&self, req: &PackageReq) -> Option { + let info = self.package_info(&req.name).await?; + best_version( + info + .versions + .iter() + .filter(|(_, version_info)| !version_info.yanked) + .map(|(version, _)| version), + ) + .cloned() + } +} + +impl PackageInfoProvider for Arc { + const HELP: NotFoundHelp = NotFoundHelp::NpmPackage; + const SPECIFIER_PREFIX: &str = "npm"; + async fn req_to_nv(&self, req: &PackageReq) -> Option { + (**self).req_to_nv(req).await + } + + async fn latest_version<'a>(&self, req: &PackageReq) -> Option { + let info = self.package_info(&req.name).await?; + best_version(info.versions.keys()).cloned() + } +} + async fn find_package_and_select_version_for_req( jsr_resolver: Arc, npm_resolver: Arc, add_package_req: AddRmPackageReq, ) -> Result { - match add_package_req.value { - AddRmPackageReqValue::Jsr(req) => { - let jsr_prefixed_name = format!("jsr:{}", &req.name); - let Some(nv) = jsr_resolver.req_to_nv(&req).await else { - if npm_resolver.req_to_nv(&req).await.is_some() { + async fn select( + main_resolver: T, + fallback_resolver: S, + add_package_req: AddRmPackageReq, + ) -> Result { + let req = match &add_package_req.value { + AddRmPackageReqValue::Jsr(req) => req, + AddRmPackageReqValue::Npm(req) => req, + }; + let prefixed_name = format!("{}:{}", T::SPECIFIER_PREFIX, req.name); + let help_if_found_in_fallback = S::HELP; + let Some(nv) = main_resolver.req_to_nv(req).await else { + if fallback_resolver.req_to_nv(req).await.is_some() { + // it's in the other registry + return Ok(PackageAndVersion::NotFound { + package: prefixed_name, + help: Some(help_if_found_in_fallback), + package_req: req.clone(), + }); + } + if req.version_req.version_text() == "*" { + if let Some(pre_release_version) = + main_resolver.latest_version(req).await + { return Ok(PackageAndVersion::NotFound { - package: jsr_prefixed_name, - found_npm_package: true, - package_req: req, + package: prefixed_name, + package_req: req.clone(), + help: Some(NotFoundHelp::PreReleaseVersion( + pre_release_version.clone(), + )), }); } + } - return Ok(PackageAndVersion::NotFound { - package: jsr_prefixed_name, - found_npm_package: false, - package_req: req, - }); - }; - let range_symbol = if req.version_req.version_text().starts_with('~') { - "~" - } else if req.version_req.version_text() == nv.version.to_string() { - "" - } else { - "^" - }; - Ok(PackageAndVersion::Selected(SelectedPackage { - import_name: add_package_req.alias, - package_name: jsr_prefixed_name, - version_req: format!("{}{}", range_symbol, &nv.version), - selected_version: nv.version.to_string(), - })) + return Ok(PackageAndVersion::NotFound { + package: prefixed_name, + help: None, + package_req: req.clone(), + }); + }; + let range_symbol = if req.version_req.version_text().starts_with('~') { + "~" + } else if req.version_req.version_text() == nv.version.to_string() { + "" + } else { + "^" + }; + Ok(PackageAndVersion::Selected(SelectedPackage { + import_name: add_package_req.alias, + package_name: prefixed_name, + version_req: format!("{}{}", range_symbol, &nv.version), + selected_version: nv.version.to_string(), + })) + } + + match &add_package_req.value { + AddRmPackageReqValue::Jsr(_) => { + select(jsr_resolver, npm_resolver, add_package_req).await } - AddRmPackageReqValue::Npm(req) => { - let npm_prefixed_name = format!("npm:{}", &req.name); - let Some(nv) = npm_resolver.req_to_nv(&req).await else { - return Ok(PackageAndVersion::NotFound { - package: npm_prefixed_name, - found_npm_package: false, - package_req: req, - }); - }; - - let range_symbol = if req.version_req.version_text().starts_with('~') { - "~" - } else if req.version_req.version_text() == nv.version.to_string() { - "" - } else { - "^" - }; - - Ok(PackageAndVersion::Selected(SelectedPackage { - import_name: add_package_req.alias, - package_name: npm_prefixed_name, - version_req: format!("{}{}", range_symbol, &nv.version), - selected_version: nv.version.to_string(), - })) + AddRmPackageReqValue::Npm(_) => { + select(npm_resolver, jsr_resolver, add_package_req).await } } } diff --git a/tests/registry/jsr/@denotest/unstable/1.0.0-beta.1/mod.ts b/tests/registry/jsr/@denotest/unstable/1.0.0-beta.1/mod.ts new file mode 100644 index 0000000000..de63686189 --- /dev/null +++ b/tests/registry/jsr/@denotest/unstable/1.0.0-beta.1/mod.ts @@ -0,0 +1,3 @@ +export function doThing() { + return "thing"; +} \ No newline at end of file diff --git a/tests/registry/jsr/@denotest/unstable/1.0.0-beta.1_meta.json b/tests/registry/jsr/@denotest/unstable/1.0.0-beta.1_meta.json new file mode 100644 index 0000000000..631a18d0e5 --- /dev/null +++ b/tests/registry/jsr/@denotest/unstable/1.0.0-beta.1_meta.json @@ -0,0 +1,5 @@ +{ + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/registry/jsr/@denotest/unstable/1.0.0-beta.2/mod.ts b/tests/registry/jsr/@denotest/unstable/1.0.0-beta.2/mod.ts new file mode 100644 index 0000000000..4e599641ef --- /dev/null +++ b/tests/registry/jsr/@denotest/unstable/1.0.0-beta.2/mod.ts @@ -0,0 +1,3 @@ +export function doThing() { + return "thing2"; +} \ No newline at end of file diff --git a/tests/registry/jsr/@denotest/unstable/1.0.0-beta.2_meta.json b/tests/registry/jsr/@denotest/unstable/1.0.0-beta.2_meta.json new file mode 100644 index 0000000000..631a18d0e5 --- /dev/null +++ b/tests/registry/jsr/@denotest/unstable/1.0.0-beta.2_meta.json @@ -0,0 +1,5 @@ +{ + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/registry/jsr/@denotest/unstable/meta.json b/tests/registry/jsr/@denotest/unstable/meta.json new file mode 100644 index 0000000000..7c5c9971ef --- /dev/null +++ b/tests/registry/jsr/@denotest/unstable/meta.json @@ -0,0 +1,6 @@ +{ + "versions": { + "1.0.0-beta.1": {}, + "1.0.0-beta.2": {} + } +} diff --git a/tests/specs/add/only_unstable_versions/__test__.jsonc b/tests/specs/add/only_unstable_versions/__test__.jsonc index d05628b6f5..ea5a270b9c 100644 --- a/tests/specs/add/only_unstable_versions/__test__.jsonc +++ b/tests/specs/add/only_unstable_versions/__test__.jsonc @@ -1,9 +1,22 @@ { "tempDir": true, - "steps": [ - { - "args": "add npm:@denotest/unstable", - "output": "add.out" + "tests": { + "npm_package": { + "steps": [ + { + "args": "add npm:@denotest/unstable", + "output": "add.out" + } + ] + }, + "jsr_package": { + "steps": [ + { + "args": "add jsr:@denotest/unstable", + "output": "add_jsr.out", + "exitCode": 1 + } + ] } - ] + } } diff --git a/tests/specs/add/only_unstable_versions/add_jsr.out b/tests/specs/add/only_unstable_versions/add_jsr.out new file mode 100644 index 0000000000..95f0630bf3 --- /dev/null +++ b/tests/specs/add/only_unstable_versions/add_jsr.out @@ -0,0 +1 @@ +error: jsr:@denotest/unstable has only pre-release versions available. Try specifying a version: `deno add jsr:@denotest/unstable@^1.0.0-beta.2` From 383cb85a730e42a2951ead84233ccef0ed3a23e8 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 5 Nov 2024 09:13:54 +0530 Subject: [PATCH 032/227] fix: op_run_microtasks crash (#26718) Upgrade deno_core to 0.318.0 Fixes https://github.com/denoland/deno_core/issues/951 Fixes https://github.com/denoland/deno/issues/26468 --- Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c22d49c41c..73d417baae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1418,9 +1418,9 @@ dependencies = [ [[package]] name = "deno_core" -version = "0.316.0" +version = "0.318.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94f68061c88ced959c6b0417f0f0d0b3dbeaeb18013b55f86c505e9fba705cf8" +checksum = "10cae2393219ff9278123f7b24799cdfab37c7d6561b69ca06ced115cac92111" dependencies = [ "anyhow", "bincode", @@ -1921,9 +1921,9 @@ dependencies = [ [[package]] name = "deno_ops" -version = "0.192.0" +version = "0.194.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb7096887508456349d7e7e09e326d157d4dba46ef1f5849bc544592ea3042a" +checksum = "f760b492bd638c1dc3e992d11672c259fbe9a233162099a8347591c9e22d0391" dependencies = [ "proc-macro-rules", "proc-macro2", @@ -6170,9 +6170,9 @@ dependencies = [ [[package]] name = "serde_v8" -version = "0.225.0" +version = "0.227.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce4b71200ef49a9e629edaea3d13fc98c25ede07e1496558df7f09354e37976f" +checksum = "0a8294c2223c53bed343be8b80564ece4dc0d03b643b06fa86c4ccc0e064eda0" dependencies = [ "num-bigint", "serde", diff --git a/Cargo.toml b/Cargo.toml index f57563e0b8..28ef2829e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ repository = "https://github.com/denoland/deno" [workspace.dependencies] deno_ast = { version = "=0.43.3", features = ["transpiling"] } -deno_core = { version = "0.316.0" } +deno_core = { version = "0.318.0" } deno_bench_util = { version = "0.169.0", path = "./bench_util" } deno_lockfile = "=0.23.1" From f9a05068d6de247574fb764044a446d1d7ed2e9b Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Mon, 4 Nov 2024 20:16:53 -0800 Subject: [PATCH 033/227] fix(install): handle invalid function error, and fallback to junctions regardless of the error (#26730) Fixes #26116. Handle the new error and treat is as lacking permission to make symlinks, but also to make this more robust, just always fall back to junctions no matter what the actual error is. Instead, warn if the error isn't one we've handled, but go on to attempt creating the junction --- cli/npm/managed/resolvers/local.rs | 16 +++++++++++----- cli/util/fs.rs | 4 +++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cli/npm/managed/resolvers/local.rs b/cli/npm/managed/resolvers/local.rs index 0968be8a7e..eddb0dc9b6 100644 --- a/cli/npm/managed/resolvers/local.rs +++ b/cli/npm/managed/resolvers/local.rs @@ -1035,12 +1035,18 @@ fn junction_or_symlink_dir( if symlink_err.kind() == std::io::ErrorKind::PermissionDenied => { USE_JUNCTIONS.store(true, std::sync::atomic::Ordering::Relaxed); - junction::create(old_path, new_path).map_err(Into::into) + junction::create(old_path, new_path) + .context("Failed creating junction in node_modules folder") + } + Err(symlink_err) => { + log::warn!( + "{} Unexpected error symlinking node_modules: {symlink_err}", + colors::yellow("Warning") + ); + USE_JUNCTIONS.store(true, std::sync::atomic::Ordering::Relaxed); + junction::create(old_path, new_path) + .context("Failed creating junction in node_modules folder") } - Err(symlink_err) => Err( - AnyError::from(symlink_err) - .context("Failed creating symlink in node_modules folder"), - ), } } diff --git a/cli/util/fs.rs b/cli/util/fs.rs index 2c34f486ad..d36c02242c 100644 --- a/cli/util/fs.rs +++ b/cli/util/fs.rs @@ -565,7 +565,9 @@ pub fn symlink_dir(oldpath: &Path, newpath: &Path) -> Result<(), Error> { use std::os::windows::fs::symlink_dir; symlink_dir(oldpath, newpath).map_err(|err| { if let Some(code) = err.raw_os_error() { - if code as u32 == winapi::shared::winerror::ERROR_PRIVILEGE_NOT_HELD { + if code as u32 == winapi::shared::winerror::ERROR_PRIVILEGE_NOT_HELD + || code as u32 == winapi::shared::winerror::ERROR_INVALID_FUNCTION + { return err_mapper(err, Some(ErrorKind::PermissionDenied)); } } From 89f0b796bd442ff352c3f93f69156ca6d85bfd5e Mon Sep 17 00:00:00 2001 From: Mohammad Sulaiman Date: Tue, 5 Nov 2024 08:39:05 +0200 Subject: [PATCH 034/227] chore: deprecate run itests (#26444) --- .dprint.json | 6 +- tests/integration/run_tests.rs | 1801 ----------------- tests/specs/run/_001_hello/001_hello.js | 1 + .../run/_001_hello}/001_hello.js.out | 0 tests/specs/run/_001_hello/__test__.jsonc | 4 + tests/specs/run/_002_hello/002_hello.ts | 1 + .../run/_002_hello}/002_hello.ts.out | 0 tests/specs/run/_002_hello/__test__.jsonc | 4 + .../003_relative_import.ts | 3 + .../003_relative_import.ts.out | 0 .../run/_003_relative_import/__test__.jsonc | 4 + .../run/_003_relative_import/print_hello.ts | 3 + .../run/_004_set_timeout}/004_set_timeout.ts | 0 .../_004_set_timeout}/004_set_timeout.ts.out | 0 .../specs/run/_004_set_timeout/__test__.jsonc | 4 + .../_005_more_imports}/005_more_imports.ts | 2 +- .../005_more_imports.ts.out | 0 .../run/_005_more_imports/__test__.jsonc | 4 + tests/specs/run/_005_more_imports/mod1.ts | 17 + .../run/_005_more_imports/print_hello.ts | 3 + .../run/_005_more_imports/subdir2/mod2.ts | 9 + .../run/_006_url_imports/006_url_imports.ts | 3 + .../_006_url_imports/006_url_imports.ts.out | 2 + .../specs/run/_006_url_imports/__test__.jsonc | 4 + .../specs/run/_006_url_imports/print_hello.ts | 3 + .../run/_006_url_imports/subdir2/mod2.ts | 9 + .../run => specs/run/_012_async}/012_async.ts | 0 .../run/_012_async}/012_async.ts.out | 0 tests/specs/run/_012_async/__test__.jsonc | 4 + .../_013_dynamic_import/013_dynamic_import.ts | 15 + .../013_dynamic_import.ts.out | 0 .../run/_013_dynamic_import/__test__.jsonc | 4 + tests/specs/run/_013_dynamic_import/mod1.ts | 17 + .../run/_013_dynamic_import/print_hello.ts | 3 + .../run/_013_dynamic_import/subdir2/mod2.ts | 9 + .../014_duplicate_import.ts | 9 + .../014_duplicate_import.ts.out | 0 .../run/_014_duplicate_import/__test__.jsonc | 4 + .../_014_duplicate_import/auto_print_hello.ts | 2 + .../015_duplicate_parallel_import.js | 2 +- .../015_duplicate_parallel_import.js.out | 0 .../__test__.jsonc | 4 + .../_015_duplicate_parallel_import/mod1.ts | 17 + .../print_hello.ts | 3 + .../subdir2/mod2.ts | 9 + .../_016_double_await}/016_double_await.ts | 0 .../016_double_await.ts.out | 0 .../run/_016_double_await/__test__.jsonc | 4 + .../017_import_redirect.ts | 4 + .../017_import_redirect.ts.out | 0 .../run/_017_import_redirect/__test__.jsonc | 4 + .../017_import_redirect.ts | 4 + .../017_import_redirect.ts.out} | 0 .../_017_import_redirect_check/__test__.jsonc | 4 + .../017_import_redirect.ts | 4 + .../017_import_redirect_info.out | 0 .../_017_import_redirect_info/__test__.jsonc | 4 + .../017_import_redirect.ts | 4 + .../017_import_redirect.ts.out} | 0 .../__test__.jsonc | 4 + .../run/_018_async_catch}/018_async_catch.ts | 0 .../_018_async_catch}/018_async_catch.ts.out | 0 .../specs/run/_018_async_catch/__test__.jsonc | 4 + .../run/_019_media_types/019_media_types.ts | 24 + .../_019_media_types}/019_media_types.ts.out | 0 .../specs/run/_019_media_types/__test__.jsonc | 4 + .../run/_020_json_modules/020_json_modules.ts | 2 + .../020_json_modules.ts.out | 2 +- .../run/_020_json_modules/__test__.jsonc | 5 + tests/specs/run/_020_json_modules/config.json | 6 + .../run/_021_mjs_modules/021_mjs_modules.ts | 2 + .../_021_mjs_modules}/021_mjs_modules.ts.out | 0 .../specs/run/_021_mjs_modules/__test__.jsonc | 4 + tests/specs/run/_021_mjs_modules/mod5.mjs | 1 + .../025_reload_js_type_error.js | 0 .../025_reload_js_type_error.js.out | 0 .../_025_reload_js_type_error/__test__.jsonc | 4 + .../027_redirect_typescript.ts | 0 .../027_redirect_typescript.ts.out | 0 .../_027_redirect_typescript/__test__.jsonc | 4 + .../027_redirect_typescript.ts | 2 + .../027_redirect_typescript.ts.out | 1 + .../__test__.jsonc | 4 + .../subdir/redirects/redirect1.ts | 1 + .../subdir/redirects/redirect4.ts | 2 + .../vendor/manifest.json | 9 + .../run => specs/run/_028_args}/028_args.ts | 0 .../run/_028_args}/028_args.ts.out | 0 tests/specs/run/_028_args/__test__.jsonc | 4 + .../_033_import_map_data_uri/__test__.jsonc | 4 + .../_033_import_map_data_uri/lodash/lodash.ts | 1 + .../lodash/other_file.ts | 1 + .../_033_import_map_data_uri}/test_data.ts | 0 .../test_data.ts.out | 0 .../033_import_map_remote.out | 0 .../run/_033_import_map_remote/__test__.jsonc | 4 + .../import_map_remote.json | 10 + .../_033_import_map_remote/lodash/lodash.ts | 1 + .../lodash/other_file.ts | 1 + .../_033_import_map_remote/moment/moment.ts | 1 + .../moment/other_file.ts | 1 + .../run/_033_import_map_remote/print_hello.ts | 3 + .../run/_033_import_map_remote/test_remote.ts | 5 + tests/specs/run/_033_import_map_remote/vue.ts | 1 + .../033_import_map_remote.out | 5 + .../__test__.jsonc | 4 + .../import_map_remote.json | 10 + .../lodash/lodash.ts | 1 + .../lodash/other_file.ts | 1 + .../moment/moment.ts | 1 + .../moment/other_file.ts | 1 + .../print_hello.ts | 3 + .../test_remote.ts | 5 + .../_033_import_map_vendor_dir_remote/vue.ts | 1 + .../_035_cached_only_flag/019_media_types.ts | 24 + .../035_cached_only_flag.out | 1 + .../run/_035_cached_only_flag/__test__.jsonc | 5 + .../run/_038_checkjs}/038_checkjs.js | 0 .../run/_038_checkjs}/038_checkjs.js.out | 0 tests/specs/run/_038_checkjs/__test__.jsonc | 6 + .../run/_038_checkjs/checkjs.tsconfig.json | 5 + .../042_dyn_import_evalcontext.ts | 2 +- .../042_dyn_import_evalcontext.ts.out | 0 .../__test__.jsonc | 4 + .../run/_042_dyn_import_evalcontext/mod4.js | 1 + .../run/_044_bad_resource/044_bad_resource.ts | 3 + .../044_bad_resource.ts.out | 0 .../run/_044_bad_resource/__test__.jsonc | 5 + .../run/_046_tsx}/046_jsx_test.tsx | 0 .../run/_046_tsx}/046_jsx_test.tsx.out | 0 tests/specs/run/_046_tsx/__test__.jsonc | 4 + .../run/_047_jsx}/047_jsx_test.jsx | 0 .../run/_047_jsx}/047_jsx_test.jsx.out | 0 tests/specs/run/_047_jsx/__test__.jsonc | 4 + .../048_media_types_jsx.ts | 32 + .../048_media_types_jsx.ts.out | 0 .../run/_048_media_types_jsx/__test__.jsonc | 4 + .../_052_no_remote_flag/019_media_types.ts | 24 + .../052_no_remote_flag.out | 2 +- .../run/_052_no_remote_flag/__test__.jsonc | 5 + .../058_tasks_microtasks_close.ts | 0 .../058_tasks_microtasks_close.ts.out | 0 .../__test__.jsonc | 4 + .../059_fs_relative_path_perm.ts | 0 .../059_fs_relative_path_perm.ts.out | 0 .../_059_fs_relative_path_perm/__test__.jsonc | 5 + .../063_permissions_revoke.ts | 0 .../063_permissions_revoke.ts.out | 0 .../_063_permissions_revoke/__test__.jsonc | 4 + .../063_permissions_revoke.ts.out | 3 + .../063_permissions_revoke_sync.ts | 0 .../__test__.jsonc | 4 + .../064_permissions_revoke_global.ts | 0 .../064_permissions_revoke_global.ts.out | 0 .../__test__.jsonc | 4 + .../064_permissions_revoke_global.ts.out | 3 + .../064_permissions_revoke_global_sync.ts | 0 .../__test__.jsonc | 4 + .../065_permissions_revoke_net.ts | 0 .../065_permissions_revoke_net.ts.out | 0 .../__test__.jsonc | 4 + .../run/_070_location}/070_location.ts | 0 .../run/_070_location}/070_location.ts.out | 0 tests/specs/run/_070_location/__test__.jsonc | 4 + .../071_location_unset.ts | 0 .../071_location_unset.ts.out | 0 .../run/_071_location_unset/__test__.jsonc | 4 + .../072_location_relative_fetch.ts | 0 .../072_location_relative_fetch.ts.out | 0 .../__test__.jsonc | 4 + .../fetch/hello.txt | 1 + .../_075_import_local_query_hash/001_hello.js | 1 + .../_075_import_local_query_hash/002_hello.ts | 1 + .../075_import_local_query_hash.ts | 0 .../075_import_local_query_hash.ts.out | 0 .../__test__.jsonc | 4 + .../run/_077_fetch_empty}/077_fetch_empty.ts | 0 .../_077_fetch_empty}/077_fetch_empty.ts.out | 0 .../specs/run/_077_fetch_empty/__test__.jsonc | 5 + .../078_unload_on_exit.ts | 0 .../078_unload_on_exit.ts.out | 0 .../run/_078_unload_on_exit/__test__.jsonc | 5 + .../079_location_authentication.ts | 0 .../079_location_authentication.ts.out | 0 .../__test__.jsonc | 4 + .../081_location_relative_fetch_redirect.ts | 0 ...81_location_relative_fetch_redirect.ts.out | 0 .../__test__.jsonc | 4 + .../082_prepare_stack_trace_throw.js | 0 .../082_prepare_stack_trace_throw.js.out | 0 .../__test__.jsonc | 5 + .../088_dynamic_import_already_evaluating.ts | 0 ...8_dynamic_import_already_evaluating.ts.out | 0 .../088_dynamic_import_target.ts | 3 + .../__test__.jsonc | 4 + .../091_use_define_for_class_fields.ts | 0 .../091_use_define_for_class_fields.ts.out | 0 .../__test__.jsonc | 5 + .../specs/run/aggregate_error/__test__.jsonc | 5 + .../run/aggregate_error}/aggregate_error.out | 0 .../run/aggregate_error}/aggregate_error.ts | 0 tests/specs/run/async_error/__test__.jsonc | 5 + .../run/async_error}/async_error.ts | 0 .../run/async_error}/async_error.ts.out | 0 .../run/beforeunload_event/__test__.jsonc | 4 + .../run/beforeunload_event}/before_unload.js | 0 .../beforeunload_event}/before_unload.js.out | 0 .../run/blob_gc_finalization/__test__.jsonc | 5 + .../blob_gc_finalization.js | 0 .../blob_gc_finalization.js.out | 0 tests/specs/run/byte_order_mark/001_hello.js | 1 + .../specs/run/byte_order_mark/__test__.jsonc | 4 + .../run/byte_order_mark}/byte_order_mark.out | 0 .../run/byte_order_mark}/byte_order_mark.ts | 2 +- .../run/check_js_points_to_ts/__test__.jsonc | 5 + .../check_js_points_to_ts/bar.ts | 0 .../check_js_points_to_ts/foo.d.ts | 0 .../check_js_points_to_ts/foo.js | 0 .../check_js_points_to_ts/test.js | 0 .../check_js_points_to_ts/test.js.out | 0 .../checkjs.tsconfig.json | 5 + tests/specs/run/check_remote/__test__.jsonc | 5 + .../specs/run/check_remote/no_check_remote.ts | 3 + .../no_check_remote.ts.disabled.out | 2 +- tests/specs/run/check_remote/type_error.ts | 1 + .../classic_workers_event_loop/__test__.jsonc | 4 + .../classic_workers_event_loop.js | 0 .../classic_workers_event_loop.js.out | 0 .../colors_without_global_this/__test__.jsonc | 4 + .../colors_without_globalThis.js | 0 tests/specs/run/complex_error/__test__.jsonc | 5 + .../run/complex_error}/complex_error.ts | 0 .../run/complex_error}/complex_error.ts.out | 0 tests/specs/run/config/__test__.jsonc | 4 + .../run => specs/run/config}/config/main.out | 0 .../run => specs/run/config}/config/main.ts | 0 .../run/config}/config/tsconfig.json | 0 .../__test__.jsonc | 4 + .../frontend_work.ts | 0 .../__test__.jsonc | 4 + .../auto_discovery_log.out | 0 .../deno.jsonc | 0 .../frontend_work.ts | 4 + .../run/config_json_import/__test__.jsonc | 4 + .../config_json_import/config_json_import.ts | 2 + .../config_json_import.ts.out | 0 .../run/config_json_import/deno-jsx.json | 6 + .../__test__.jsonc | 4 + .../server_side_work.ts | 0 tests/specs/run/config_types/__test__.jsonc | 4 + .../run/config_types/config_types/deno.lock | 6 + .../run/config_types}/config_types/main.out | 0 .../run/config_types}/config_types/main.ts | 0 .../config_types/remote.tsconfig.json | 0 .../config_types}/config_types/tsconfig.json | 0 .../run/config_types/config_types/types.d.ts | 2 + .../run/config_types_remote/__test__.jsonc | 4 + .../config_types/deno.lock | 6 + .../config_types/main.out} | 0 .../config_types_remote/config_types/main.ts | 1 + .../config_types/remote.tsconfig.json | 7 + .../config_types/tsconfig.json | 7 + .../config_types/types.d.ts | 2 + .../run/custom_inspect_url/__test__.jsonc | 4 + .../custom_inspect_url}/custom_inspect_url.js | 0 .../custom_inspect_url.js.out | 0 .../decorators_tc39_proposal/__test__.jsonc | 4 + .../decorators/experimental/deno.json | 0 .../decorators/experimental/no_check/main.out | 0 .../decorators/experimental/no_check/main.ts | 0 .../decorators/experimental/runtime/main.out | 0 .../decorators/experimental/runtime/main.ts | 0 .../decorators/experimental/ts/main.out | 0 .../decorators/experimental/ts/main.ts | 0 .../decorators/tc39_proposal/main.out | 0 .../decorators/tc39_proposal/main.ts | 0 .../run/deno_exit_tampering/__test__.jsonc | 5 + .../deno_exit_tampering.ts | 0 .../deny_all_permission_args/__test__.jsonc | 4 + .../deny_all_permission_args.js | 0 .../deny_all_permission_args.out | 0 .../deny_some_permission_args/__test__.jsonc | 4 + .../deny_some_permission_args.js | 0 .../deny_some_permission_args.out | 0 .../dom_exception_formatting/__test__.jsonc | 5 + .../dom_exception_formatting.ts | 0 .../dom_exception_formatting.ts.out | 0 .../__test__.jsonc | 4 + .../error_001.ts | 0 .../dynamic_import_already_rejected/main.out | 0 .../dynamic_import_already_rejected/main.ts | 0 .../dynamic_import_async_error/__test__.jsonc | 4 + .../delayed_error.ts | 0 .../dynamic_import_async_error/main.out | 0 .../dynamic_import_async_error/main.ts | 0 .../__test__.jsonc | 4 + .../main.out | 0 .../main.ts | 0 .../mod.ts | 0 .../dynamic_import_conditional/__test__.jsonc | 4 + .../dynamic_import_conditional.js | 0 .../dynamic_import_conditional.js.out | 0 .../__test__.jsonc | 5 + .../permissions_blob_local.ts | 6 + .../permissions_blob_local.ts.out | 5 + .../__test__.jsonc | 5 + .../permissions_blob_remote.ts | 3 + .../permissions_blob_remote.ts.out | 5 + .../__test__.jsonc | 5 + .../permissions_data_local.ts | 5 + .../permissions_data_local.ts.out | 5 + .../__test__.jsonc | 5 + .../permissions_data_remote.ts | 3 + .../permissions_data_remote.ts.out | 5 + .../__test__.jsonc | 5 + .../permissions_remote_remote.ts | 3 + .../permissions_remote_remote.ts.out | 5 + .../static_remote.ts | 2 + .../__test__.jsonc | 4 + .../empty_1.ts} | 0 .../empty_2.ts} | 0 .../static_analysis_no_permissions.ts | 13 + .../static_analysis_no_permissions.ts.out | 2 + .../__test__.jsonc | 5 + .../dynamic_import_syntax_error.js | 0 .../dynamic_import_syntax_error.js.out | 0 .../dynamic_import_syntax_error_import.js | 5 + .../specs/run/empty_typescript/__test__.jsonc | 4 + .../run/empty_typescript/empty.ts} | 0 tests/specs/run/error_001/__test__.jsonc | 5 + tests/specs/run/error_001/error_001.ts | 9 + .../run/error_001}/error_001.ts.out | 0 tests/specs/run/error_002/__test__.jsonc | 5 + tests/specs/run/error_002/error_002.ts | 7 + .../run/error_002}/error_002.ts.out | 2 +- tests/specs/run/error_002/mod1.ts | 17 + tests/specs/run/error_002/print_hello.ts | 3 + tests/specs/run/error_002/subdir2/mod2.ts | 9 + .../run/error_003_typescript/__test__.jsonc | 5 + .../error_003_typescript.ts | 0 .../error_003_typescript.ts.out | 0 .../run/error_003_typescript2/__test__.jsonc | 5 + .../error_003_typescript.ts | 20 + .../error_003_typescript.ts.out | 7 + .../error_004_missing_module/__test__.jsonc | 5 + .../error_004_missing_module.ts | 0 .../error_004_missing_module.ts.out | 0 .../__test__.jsonc | 5 + .../error_005_missing_dynamic_import.ts | 0 .../error_005_missing_dynamic_import.ts.out | 0 .../__test__.jsonc | 5 + .../error_006_import_ext_failure.ts | 0 .../error_006_import_ext_failure.ts.out | 0 tests/specs/run/error_007_any/__test__.jsonc | 5 + .../run/error_007_any}/error_007_any.ts | 0 .../run/error_007_any}/error_007_any.ts.out | 0 .../run/error_008_checkjs/__test__.jsonc | 5 + .../error_008_checkjs}/error_008_checkjs.js | 0 .../error_008_checkjs.js.out | 0 .../error_009_extensions_error/__test__.jsonc | 5 + .../error_009_extensions_error.js | 0 .../error_009_extensions_error.js.out | 0 .../__test__.jsonc | 5 + .../error_011_bad_module_specifier.ts | 0 .../error_011_bad_module_specifier.ts.out | 0 .../__test__.jsonc | 5 + .../error_012_bad_dynamic_import_specifier.ts | 0 ...or_012_bad_dynamic_import_specifier.ts.out | 0 .../__test__.jsonc | 4 + .../error_014_catch_dynamic_import_error.js | 6 +- ...rror_014_catch_dynamic_import_error.js.out | 6 +- .../indirect_import_error.js | 1 + .../indirect_throws.js | 1 + .../throws.js | 6 + .../__test__.jsonc | 5 + .../error_015_dynamic_import_permissions.js | 3 + .../error_015_dynamic_import_permissions.out | 2 +- .../mod4.js | 1 + .../__test__.jsonc | 5 + .../error_017_hide_long_source_ts.ts | 0 .../error_017_hide_long_source_ts.ts.out | 0 .../__test__.jsonc | 5 + .../error_018_hide_long_source_js.js | 0 .../error_018_hide_long_source_js.js.out | 0 .../error_019_stack_function/__test__.jsonc | 5 + .../error_019_stack_function.ts | 0 .../error_019_stack_function.ts.out | 0 .../__test__.jsonc | 5 + .../error_020_stack_constructor.ts | 0 .../error_020_stack_constructor.ts.out | 0 .../run/error_021_stack_method/__test__.jsonc | 5 + .../error_021_stack_method.ts | 0 .../error_021_stack_method.ts.out | 0 .../__test__.jsonc | 5 + .../error_022_stack_custom_error.ts | 0 .../error_022_stack_custom_error.ts.out | 0 .../run/error_023_stack_async/__test__.jsonc | 5 + .../error_023_stack_async.ts | 0 .../error_023_stack_async.ts.out | 0 .../__test__.jsonc | 5 + .../error_024_stack_promise_all.ts | 0 .../error_024_stack_promise_all.ts.out | 0 .../run/error_025_tab_indent/__test__.jsonc | 5 + .../error_025_tab_indent | 0 .../error_025_tab_indent.out | 0 tests/specs/run/error_cause/__test__.jsonc | 5 + .../run/error_cause}/error_cause.ts | 0 .../run/error_cause}/error_cause.ts.out | 0 .../run/error_cause_recursive/__test__.jsonc | 5 + .../error_cause_recursive.ts | 0 .../error_cause_recursive.ts.out | 0 .../__test__.jsonc | 5 + .../error_cause_recursive_aggregate.ts | 0 .../error_cause_recursive_aggregate.ts.out | 0 .../error_cause_recursive_tail/__test__.jsonc | 5 + .../error_cause_recursive_tail.ts | 0 .../error_cause_recursive_tail.ts.out | 0 .../specs/run/error_for_await/__test__.jsonc | 5 + .../run/error_for_await}/error_for_await.ts | 0 .../error_for_await}/error_for_await.ts.out | 0 .../__test__.jsonc | 5 + .../error_import_map_unable_to_load.out | 0 .../import_maps/test_data.ts | 1 + .../import_maps/test_data.ts.out | 1 + .../__test__.jsonc | 5 + .../error_missing_module_named_import.ts | 0 .../error_missing_module_named_import.ts.out | 0 .../run/error_name_non_string/__test__.jsonc | 5 + .../error_name_non_string.js | 0 .../error_name_non_string.js.out | 0 tests/specs/run/error_no_check/__test__.jsonc | 5 + .../run/error_no_check/error_no_check.ts | 1 + .../run/error_no_check/error_no_check.ts.out | 2 + .../specs/run/error_no_check/type_and_code.ts | 7 + tests/specs/run/error_syntax/__test__.jsonc | 5 + .../run/error_syntax}/error_syntax.js | 0 .../run/error_syntax}/error_syntax.js.out | 0 .../__test__.jsonc | 5 + .../error_syntax_empty_trailing_line.mjs | 0 .../error_syntax_empty_trailing_line.mjs.out | 0 .../run/error_type_definitions/__test__.jsonc | 5 + .../error_type_definitions.ts | 5 + .../error_type_definitions.ts.out | 0 .../type_definitions/bar.d.ts | 7 + .../type_definitions/bar.js | 5 + .../type_definitions/fizz.d.ts | 2 + .../type_definitions/fizz.js | 1 + .../type_definitions/foo.d.ts | 2 + .../type_definitions/foo.js | 1 + .../type_definitions/qat.ts | 1 + .../run/error_with_errors_prop/__test__.jsonc | 5 + .../error_with_errors_prop.js | 0 .../error_with_errors_prop.js.out | 0 .../run/es_private_fields/__test__.jsonc | 4 + .../es_private_fields}/es_private_fields.js | 0 .../es_private_fields.js.out | 0 .../__test__.jsonc | 4 + .../eval_context_throw_dom_exception.js | 0 .../eval_context_throw_dom_exception.js.out | 0 .../run/event_listener_error/__test__.jsonc | 5 + .../event_listener_error.ts | 0 .../event_listener_error.ts.out | 0 .../__test__.jsonc | 4 + .../event_listener_error_handled.ts | 0 .../event_listener_error_handled.ts.out | 0 .../__test__.jsonc | 5 + .../event_listener_error_immediate_exit.ts | 0 ...event_listener_error_immediate_exit.ts.out | 0 .../__test__.jsonc | 5 + .../event_listener_error_immediate_exit.ts | 12 + ...nt_listener_error_immediate_exit_worker.ts | 0 ...istener_error_immediate_exit_worker.ts.out | 0 tests/specs/run/exit_error42/__test__.jsonc | 5 + .../run/exit_error42}/exit_error42.ts | 0 .../run/exit_error42}/exit_error42.ts.out | 0 .../__test__.jsonc | 4 + .../explicit_resource_management/main.out | 0 .../explicit_resource_management/main.ts | 0 .../__test__.jsonc | 5 + .../ts_with_js_extension.js | 5 + .../ts_with_js_extension.out | 2 + .../fetch_async_error_stack/__test__.jsonc | 5 + .../fetch_async_error_stack.ts | 0 .../fetch_async_error_stack.ts.out | 0 .../__test__.jsonc | 5 + .../fetch_response_finalization.js | 0 .../fetch_response_finalization.js.out | 0 .../run/finalization_registry/__test__.jsonc | 4 + .../finalization_registry.js | 0 .../finalization_registry.js.out | 0 .../fix_dynamic_import_errors/__test__.jsonc | 4 + .../specs/run/fix_dynamic_import_errors/b.js | 2 + .../specs/run/fix_dynamic_import_errors/c.js | 2 + .../fix_dynamic_import_errors.js | 4 +- .../fix_dynamic_import_errors.js.out | 0 .../run/fix_emittable_skipped/__test__.jsonc | 4 + .../run/fix_emittable_skipped/emittable.d.ts | 1 + .../fix_emittable_skipped.js | 7 + .../fix_emittable_skipped.ts.out | 0 .../run/fix_emittable_skipped/polyfill.ts | 8 + .../specs/run/fix_js_import_js/__test__.jsonc | 4 + .../run/fix_js_import_js/fix_js_import_js.ts | 3 + .../fix_js_import_js}/fix_js_import_js.ts.out | 0 tests/specs/run/fix_js_import_js/mod4.js | 1 + tests/specs/run/fix_js_import_js/mod6.js | 1 + tests/specs/run/fix_js_imports/__test__.jsonc | 4 + tests/specs/run/fix_js_imports/amd_like.js | 3 + .../run/fix_js_imports/fix_js_imports.ts | 3 + .../run/fix_js_imports}/fix_js_imports.ts.out | 0 .../run/fix_tsc_file_exists/__test__.jsonc | 4 + .../fix_tsc_file_exists.out | 0 tests/specs/run/fix_tsc_file_exists/tsc/a.js | 2 + tests/specs/run/fix_tsc_file_exists/tsc/d.ts | 3 + .../fix_tsc_file_exists/tsc/node_modules/b.js | 2 + .../fix_tsc_file_exists/tsc/node_modules/c.js | 1 + .../specs/run/fix_tsc_file_exists/tsc/test.js | 4 + .../fix_worker_dispatchevent/__test__.jsonc | 4 + .../fix_worker_dispatchevent.ts | 0 .../fix_worker_dispatchevent.ts.out | 0 .../__test__.jsonc | 4 + .../followup_dyn_import_resolves/main.ts | 0 .../followup_dyn_import_resolves/main.ts.out | 0 .../followup_dyn_import_resolves/sub1.ts | 2 + .../followup_dyn_import_resolves/sub2.ts | 1 + tests/specs/run/heapstats/__test__.jsonc | 4 + .../run => specs/run/heapstats}/heapstats.js | 0 .../run/heapstats}/heapstats.js.out | 0 tests/specs/run/https_import/RootCA.pem | 19 + tests/specs/run/https_import/__test__.jsonc | 4 + tests/specs/run/https_import/https_import.ts | 3 + .../run/https_import/https_import.ts.out} | 0 tests/specs/run/https_import/print_hello.ts | 3 + tests/specs/run/if_main/__test__.jsonc | 4 + .../run => specs/run/if_main}/if_main.ts | 0 tests/specs/run/if_main/if_main.ts.out | 1 + .../__test__.jsonc | 5 + .../import_attributes_dynamic_error/data.json | 6 + .../dynamic_error.out | 4 + .../dynamic_error.ts | 3 + .../__test__.jsonc | 4 + .../data.json | 6 + .../dynamic_import.out | 2 + .../dynamic_import.ts | 3 + .../__test__.jsonc | 5 + .../import_attributes_static_error/data.json | 6 + .../static_error.out | 3 + .../static_error.ts | 3 + .../__test__.jsonc | 4 + .../import_attributes_static_export/data.json | 6 + .../static_export.out | 1 + .../static_export.ts | 3 + .../static_reexport.ts | 1 + .../__test__.jsonc | 4 + .../import_attributes_static_import/data.json | 6 + .../static_import.out | 2 + .../static_import.ts | 5 + .../__test__.jsonc | 5 + .../import_attributes_type_check/data.json | 6 + .../type_check.out | 12 + .../type_check.ts | 6 + .../specs/run/import_blob_url/__test__.jsonc | 4 + .../run/import_blob_url}/import_blob_url.ts | 0 .../import_blob_url}/import_blob_url.ts.out | 0 .../__test__.jsonc | 5 + .../import_blob_url_error_stack.ts | 0 .../import_blob_url_error_stack.ts.out | 0 .../__test__.jsonc | 5 + .../import_blob_url_import_relative.ts | 0 .../import_blob_url_import_relative.ts.out | 0 .../import_blob_url_imports/__test__.jsonc | 4 + .../import_blob_url_imports.ts | 0 .../import_blob_url_imports.ts.out} | 0 .../run/import_blob_url_jsx/__test__.jsonc | 4 + .../import_blob_url_jsx.ts | 0 .../import_blob_url_jsx.ts.out | 0 .../run/import_compression/__test__.jsonc | 4 + .../import_compression/brotli | 2 + .../import_compression/gziped | Bin 0 -> 39 bytes .../import_compression/main.out | 0 .../import_compression/main.ts | 0 .../specs/run/import_data_url/__test__.jsonc | 4 + .../run/import_data_url}/import_data_url.ts | 0 .../import_data_url}/import_data_url.ts.out | 0 .../__test__.jsonc | 5 + .../import_data_url_error_stack.ts | 0 .../import_data_url_error_stack.ts.out | 0 .../__test__.jsonc | 5 + .../import_data_url_import_relative.ts | 0 .../import_data_url_import_relative.ts.out | 0 .../import_data_url_imports/__test__.jsonc | 4 + .../import_data_url_imports.ts | 0 .../import_data_url_imports.ts.out} | 0 .../run/import_data_url_jsx/__test__.jsonc | 4 + .../import_data_url_jsx.ts | 0 .../import_data_url_jsx.ts.out | 0 .../import_dynamic_data_url/__test__.jsonc | 4 + .../import_dynamic_data_url.ts | 0 .../import_dynamic_data_url.ts.out | 0 .../run/import_extensionless/__test__.jsonc | 4 + .../import_extensionless.ts | 0 .../import_extensionless.ts.out | 1 + .../run/import_file_with_colon/__test__.jsonc | 4 + .../import_file_with_colon.ts | 0 .../import_file_with_colon.ts.out | 0 tests/specs/run/import_type/__test__.jsonc | 4 + tests/specs/run/import_type/export_types.ts | 11 + tests/specs/run/import_type/import_type.ts | 5 + .../run/import_type}/import_type.ts.out | 0 .../run/import_type_no_check/__test__.jsonc | 4 + .../run/import_type_no_check/export_types.ts | 11 + .../run/import_type_no_check/import_type.ts | 5 + .../import_type_no_check/import_type.ts.out | 1 + .../run/inline_js_source_map_2/__test__.jsonc | 5 + .../inline_js_source_map_2.js | 2 +- .../inline_js_source_map_2.js.out | 0 .../__test__.jsonc | 5 + ...ne_js_source_map_2_with_inline_contents.js | 2 +- ...s_source_map_2_with_inline_contents.js.out | 0 .../__test__.jsonc | 5 + ..._js_source_map_with_contents_from_graph.js | 2 +- ...source_map_with_contents_from_graph.js.out | 0 tests/specs/run/issue_13562/__test__.jsonc | 4 + tests/specs/run/issue_13562/issue13562.ts | 3 + tests/specs/run/issue_13562/issue13562.ts.out | 1 + tests/specs/run/issue_13562/mod1.ts | 17 + tests/specs/run/issue_13562/print_hello.ts | 3 + .../run/issue_13562/subdir2/dynamic_import.ts | 4 + tests/specs/run/issue_13562/subdir2/mod2.ts | 9 + .../specs/run/js_import_detect/__test__.jsonc | 5 + .../run/js_import_detect}/js_import_detect.ts | 0 .../js_import_detect}/js_import_detect.ts.out | 0 .../run/js_root_with_ts_check/__test__.jsonc | 5 + .../js_root_with_ts_check.js | 0 .../js_root_with_ts_check.js.out | 0 .../run/js_without_extension/__test__.jsonc | 5 + .../js_without_extension/js_without_extension | 3 + .../js_without_extension.out | 1 + .../run/jsx_import_from_ts/__test__.jsonc | 4 + .../jsx_import_from_ts.App.jsx | 11 + .../jsx_import_from_ts}/jsx_import_from_ts.ts | 0 .../jsx_import_from_ts.ts.out | 0 .../jsx_import_source_error/__test__.jsonc | 5 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx_import_source_error/jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../run/jsx_import_source_error/jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_import_source_error.out | 0 .../jsx_import_source_no_pragma.tsx | 7 + .../__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_import_source_import_map.out | 2 + .../jsx_import_source_no_pragma.tsx | 7 + .../__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_import_source_import_map_dev.out | 2 + .../jsx_import_source_no_pragma.tsx | 7 + .../__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_import_source_import_map.out | 2 + .../jsx_import_source_no_pragma.tsx | 7 + .../__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx_import_source_no_pragma/jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_import_source.out | 0 .../jsx_import_source_no_pragma.tsx | 7 + .../__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_import_source_dev.out | 0 .../jsx_import_source_no_pragma.tsx | 7 + .../__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_import_source.out | 2 + .../jsx_import_source_no_pragma.tsx | 7 + .../jsx_import_source_pragma/__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx_import_source_pragma/jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_import_source.out | 2 + .../jsx_import_source_pragma.tsx | 0 .../__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_import_source_import_map.out | 2 + .../jsx_import_source_pragma_import_map.tsx | 0 .../__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_import_source_import_map_dev.out | 2 + .../jsx_import_source_pragma_import_map.tsx | 9 + .../__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_import_source_import_map.out | 2 + .../jsx_import_source_pragma_import_map.tsx | 9 + .../__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_import_source.out | 2 + .../jsx_import_source_pragma.tsx | 9 + .../__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_import_source.out | 2 + .../jsx_import_source_pragma.tsx | 9 + .../__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_import_source.out | 2 + .../jsx_import_source_pragma.tsx | 9 + .../__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx/#jsx-runtime_62ac8.js | 11 + .../jsx/vendor/manifest.json | 9 + .../jsx_import_source.out | 2 + .../jsx_import_source_pragma.tsx | 9 + .../__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_import_source_dev.out | 2 + .../jsx_import_source_pragma.tsx | 9 + .../__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_precompile/no_pragma.out | 2 +- .../jsx_precompile/no_pragma.tsx | 0 .../jsx_precompile/skip.out | 0 .../jsx_precompile/skip.tsx | 0 .../__test__.jsonc | 4 + .../jsx/deno-jsx-error.jsonc | 6 + .../jsx/deno-jsx-import-map.jsonc | 6 + .../jsx/deno-jsx-precompile-skip.jsonc | 7 + .../jsx/deno-jsx-precompile.jsonc | 6 + .../jsx/deno-jsx.json | 6 + .../jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx/import-map.json | 7 + .../jsx/jsx-dev-runtime/index.ts | 12 + .../jsx/jsx-precompile/index.ts | 23 + .../jsx/jsx-runtime/index.ts | 12 + .../jsx_precompile/no_pragma.out | 3 + .../jsx_precompile/no_pragma.tsx | 3 + .../jsx_precompile/skip.out | 3 + .../jsx_precompile/skip.tsx | 9 + .../run/lock_check_ok/003_relative_import.ts | 3 + .../lock_check_ok/003_relative_import.ts.out | 1 + tests/specs/run/lock_check_ok/__test__.jsonc | 4 + .../run/lock_check_ok/lock_check_ok.json | 4 + tests/specs/run/lock_check_ok/print_hello.ts | 3 + .../run/lock_check_ok2/019_media_types.ts | 24 + .../run/lock_check_ok2/019_media_types.ts.out | 1 + tests/specs/run/lock_check_ok2/__test__.jsonc | 4 + .../run/lock_check_ok2}/lock_check_ok2.json | 0 .../lock_v2_check_ok/003_relative_import.ts | 3 + .../003_relative_import.ts.out | 1 + .../specs/run/lock_v2_check_ok/__test__.jsonc | 4 + .../lock_v2_check_ok/lock_v2_check_ok.json | 7 + .../specs/run/lock_v2_check_ok/print_hello.ts | 3 + .../run/lock_v2_check_ok2/019_media_types.ts | 24 + .../lock_v2_check_ok2/019_media_types.ts.out | 1 + .../run/lock_v2_check_ok2/__test__.jsonc | 4 + .../lock_v2_check_ok2}/lock_v2_check_ok2.json | 0 .../long_data_url_formatting/__test__.jsonc | 5 + .../long_data_url_formatting.ts | 0 .../long_data_url_formatting.ts.out | 0 tests/specs/run/main_module/__test__.jsonc | 4 + .../run/main_module}/main_module/main.out | 0 .../run/main_module}/main_module/main.ts | 0 .../run/main_module}/main_module/other.ts | 0 tests/specs/run/mts_dmts_mjs/__test__.jsonc | 4 + tests/specs/run/mts_dmts_mjs/import.mts | 4 + tests/specs/run/mts_dmts_mjs/mod.mjs | 1 + .../run/mts_dmts_mjs}/mts_dmts_mjs.out | 0 tests/specs/run/mts_dmts_mjs/types.d.mts | 1 + .../run/mts_dmts_mjs_no_check/__test__.jsonc | 4 + .../run/mts_dmts_mjs_no_check/import.mts | 4 + tests/specs/run/mts_dmts_mjs_no_check/mod.mjs | 1 + .../mts_dmts_mjs_no_check/mts_dmts_mjs.out | 1 + .../run/mts_dmts_mjs_no_check/types.d.mts | 1 + tests/specs/run/nested_error/__test__.jsonc | 5 + .../run/nested_error}/nested_error/main.ts | 0 .../nested_error}/nested_error/main.ts.out | 0 tests/specs/run/no_check/006_url_imports.ts | 3 + .../specs/run/no_check/006_url_imports.ts.out | 2 + tests/specs/run/no_check/__test__.jsonc | 4 + tests/specs/run/no_check/mod2.ts | 1 + tests/specs/run/no_check/print_hello.ts | 3 + .../run/no_check_decorators/__test__.jsonc | 4 + .../decorators/experimental/deno.json | 5 + .../decorators/experimental/no_check/main.out | 3 + .../decorators/experimental/no_check/main.ts | 21 + .../decorators/experimental/runtime/main.out | 7 + .../decorators/experimental/runtime/main.ts | 42 + .../decorators/experimental/ts/main.out | 3 + .../decorators/experimental/ts/main.ts | 14 + .../decorators/tc39_proposal/main.out | 3 + .../decorators/tc39_proposal/main.ts | 21 + .../__test__.jsonc | 5 + .../frontend_work.ts | 4 + .../no_auto_discovery.out | 2 +- tests/specs/run/no_lock_flag/__test__.jsonc | 5 + .../run/no_lock_flag}/no_lock_flag/deno.json | 0 .../run/no_lock_flag}/no_lock_flag/deno.lock | 0 .../run/no_lock_flag}/no_lock_flag/main.out | 0 .../run/no_lock_flag}/no_lock_flag/main.ts | 0 tests/specs/run/no_prompt_flag/__test__.jsonc | 4 + tests/specs/run/no_prompt_flag/no_prompt.ts | 10 + .../run/node_env_var_allowlist/__test__.jsonc | 5 + .../node_env_var_allowlist.ts | 0 .../node_env_var_allowlist.ts.out | 0 tests/specs/run/onload/__test__.jsonc | 4 + tests/specs/run/onload/deno.json | 4 + .../run/onload}/onload/imported.ts | 0 .../run => specs/run/onload}/onload/main.out | 0 .../run => specs/run/onload}/onload/main.ts | 0 .../run/onload}/onload/nest_imported.ts | 0 .../__test__.jsonc | 5 + .../op_exit_op_set_exit_code_in_worker.ts | 0 .../op_exit_op_set_exit_code_worker.js | 4 + .../__test__.jsonc | 5 + .../deno.json | 5 + .../main.out | 5 + .../main.ts | 6 + tests/specs/run/permission_args/001_hello.js | 1 + .../specs/run/permission_args/__test__.jsonc | 4 + .../run/permission_args}/permission_args.out | 0 .../run/permission_args_quiet/001_hello.js | 1 + .../permission_args_quiet/001_hello.js.out | 1 + .../run/permission_args_quiet/__test__.jsonc | 4 + .../run/private_field_presence/__test__.jsonc | 4 + .../private_field_presence.ts | 0 .../private_field_presence.ts.out | 0 .../__test__.jsonc | 4 + .../private_field_presence.ts | 20 + .../private_field_presence.ts.out | 2 + tests/specs/run/proto_exploit/__test__.jsonc | 4 + .../run/proto_exploit}/proto_exploit.js | 0 .../run/proto_exploit}/proto_exploit.js.out | 0 .../run/queue_microtask_error/__test__.jsonc | 5 + .../queue_microtask_error.ts | 0 .../queue_microtask_error.ts.out | 0 .../__test__.jsonc | 4 + .../queue_microtask_error_handled.ts | 0 .../queue_microtask_error_handled.ts.out | 0 .../specs/run/reference_types/__test__.jsonc | 4 + .../run/reference_types}/reference_types.ts | 0 .../reference_types/reference_types.ts.out} | 0 .../run/reference_types_error/__test__.jsonc | 5 + .../checkjs.tsconfig.json | 5 + .../reference_types_error.js | 0 .../reference_types_error.js.out | 0 .../__test__.jsonc | 4 + .../reference_types_error.js | 2 + .../__test__.jsonc | 5 + .../checkjs.tsconfig.json | 5 + .../reference_types_error.js | 2 + .../reference_types_error.js.out | 2 + .../references_types_remote/__test__.jsonc | 4 + .../reference_types_remote.ts | 0 .../reference_types_remote.ts.out | 1 + .../run/rejection_handled/__test__.jsonc | 4 + .../rejection_handled}/rejection_handled.out | 0 .../rejection_handled}/rejection_handled.ts | 0 tests/specs/run/replace_self/__test__.jsonc | 4 + .../run/replace_self}/replace_self.js | 0 .../run/replace_self}/replace_self.js.out | 0 tests/specs/run/report_error/__test__.jsonc | 5 + .../run/report_error}/report_error.ts | 0 .../run/report_error}/report_error.ts.out | 0 .../__test__.jsonc | 5 + .../report_error_end_of_program.ts | 0 .../report_error_end_of_program.ts.out | 0 .../run/report_error_handled/__test__.jsonc | 4 + .../report_error_handled.ts | 0 .../report_error_handled.ts.out | 0 .../run/runtime_decorators/__test__.jsonc | 4 + .../decorators/experimental/deno.json | 5 + .../decorators/experimental/no_check/main.out | 3 + .../decorators/experimental/no_check/main.ts | 21 + .../decorators/experimental/runtime/main.out | 7 + .../decorators/experimental/runtime/main.ts | 42 + .../decorators/experimental/ts/main.out | 3 + .../decorators/experimental/ts/main.ts | 14 + .../decorators/tc39_proposal/main.out | 3 + .../decorators/tc39_proposal/main.ts | 21 + tests/specs/run/seed_random/__test__.jsonc | 4 + .../run/seed_random}/seed_random.js | 0 .../run/seed_random}/seed_random.js.out | 0 .../specs/run/set_exit_code_0/__test__.jsonc | 5 + .../run/set_exit_code_0}/set_exit_code_0.ts | 0 .../specs/run/set_exit_code_1/__test__.jsonc | 5 + .../run/set_exit_code_1}/set_exit_code_1.ts | 0 .../specs/run/set_exit_code_2/__test__.jsonc | 5 + .../run/set_exit_code_2}/set_exit_code_2.ts | 0 .../run/set_timeout_error/__test__.jsonc | 5 + .../set_timeout_error}/set_timeout_error.ts | 0 .../set_timeout_error.ts.out | 0 .../set_timeout_error_handled/__test__.jsonc | 4 + .../set_timeout_error_handled.ts | 0 .../set_timeout_error_handled.ts.out | 0 tests/specs/run/shebang_swc/__test__.jsonc | 4 + .../run => specs/run/shebang_swc}/shebang.ts | 0 .../run/shebang_swc}/shebang.ts.out | 0 tests/specs/run/shebang_swc/shebang2.ts | 3 + tests/specs/run/shebang_tsc/__test__.jsonc | 4 + tests/specs/run/shebang_tsc/shebang.ts | 5 + .../run/shebang_tsc/shebang.ts.out} | 0 tests/specs/run/shebang_tsc/shebang2.ts | 3 + .../__test__.jsonc | 5 + .../json_with_shebang.json | 4 + .../json_with_shebang.ts | 3 + .../json_with_shebang.ts.out | 1 + .../__test__.jsonc | 5 + .../json_with_shebang.json | 4 + .../json_with_shebang.ts | 3 + .../json_with_shebang.ts.out | 1 + .../single_compile_with_reload/__test__.jsonc | 4 + .../run/single_compile_with_reload/mod1.ts | 17 + .../single_compile_with_reload/print_hello.ts | 3 + .../single_compile_with_reload.ts | 0 .../single_compile_with_reload.ts.out | 0 .../single_compile_with_reload_dyn.ts | 11 + .../single_compile_with_reload_worker.ts | 3 + .../subdir2/dynamic_import.ts | 4 + .../subdir2/mod2.ts | 9 + .../run/spawn_stdout_inherit/__test__.jsonc | 4 + .../spawn_stdout_inherit.ts | 0 .../spawn_stdout_inherit.ts.out | 0 tests/specs/run/stdin_read_all/__test__.jsonc | 5 + .../run/stdin_read_all}/stdin_read_all.out | 0 .../run/stdin_read_all}/stdin_read_all.ts | 0 .../specs/run/stdout_write_all/__test__.jsonc | 4 + .../stdout_write_all}/stdout_write_all.out | 0 .../run/stdout_write_all}/stdout_write_all.ts | 0 .../stdout_write_sync_async/__test__.jsonc | 4 + .../stdout_write_sync_async.out | 0 .../stdout_write_sync_async.ts | 0 .../specs/run/swc_syntax_error/__test__.jsonc | 5 + .../run/swc_syntax_error}/swc_syntax_error.ts | 0 .../swc_syntax_error}/swc_syntax_error.ts.out | 0 .../__test__.jsonc | 4 + .../test_and_bench_in_run.js | 0 tests/specs/run/tls_connecttls/RootCA.pem | 19 + tests/specs/run/tls_connecttls/__test__.jsonc | 4 + tests/specs/run/tls_connecttls/deno.json | 4 + tests/specs/run/tls_connecttls/localhost.crt | 21 + tests/specs/run/tls_connecttls/localhost.key | 28 + tests/specs/run/tls_connecttls/textproto.ts | 170 ++ .../run => specs/run/tls_connecttls}/tls.out | 0 .../run/tls_connecttls}/tls_connecttls.js | 4 +- tests/specs/run/tls_starttls/RootCA.pem | 19 + tests/specs/run/tls_starttls/__test__.jsonc | 4 + tests/specs/run/tls_starttls/deno.json | 4 + tests/specs/run/tls_starttls/localhost.crt | 21 + tests/specs/run/tls_starttls/localhost.key | 28 + tests/specs/run/tls_starttls/textproto.ts | 170 ++ tests/specs/run/tls_starttls/tls.out | 1 + .../run/tls_starttls}/tls_starttls.js | 4 +- .../specs/run/top_level_await/__test__.jsonc | 4 + tests/specs/run/top_level_await/hello.txt | 1 + .../top_level_await/circular.js | 0 .../top_level_await/circular.out | 0 .../top_level_await/top_level_await/loop.js | 20 + .../top_level_await}/top_level_await/loop.out | 0 .../top_level_await/nested.out | 0 .../top_level_await/nested/a.js | 0 .../top_level_await/nested/b.js | 0 .../top_level_await/nested/main.js | 0 .../top_level_await}/top_level_await/order.js | 0 .../top_level_await/order.out | 0 .../top_level_await/top_level_await/tla/a.js | 3 + .../top_level_await/top_level_await/tla/b.js | 7 + .../top_level_await/top_level_await/tla/c.js | 3 + .../top_level_await/top_level_await/tla/d.js | 8 + .../top_level_await/tla/order.js | 1 + .../top_level_await/tla/parent.js | 9 + .../top_level_await/top_level_await/tla2/a.js | 5 + .../top_level_await/top_level_await/tla2/b.js | 5 + .../top_level_await/top_level_await/tla3/b.js | 7 + .../top_level_await/tla3/timeout_loop.js | 23 + .../top_level_await/top_level_await.js | 3 + .../top_level_await/top_level_await.out | 0 .../top_level_await/top_level_await.ts | 0 .../top_level_await/top_level_for_await.js | 0 .../top_level_await/top_level_for_await.out | 0 .../top_level_await/top_level_for_await.ts | 0 .../top_level_await/unresolved.js | 0 .../top_level_await/unresolved.out | 0 .../top_level_await_circular/__test__.jsonc | 5 + .../top_level_await/circular.js | 8 + .../top_level_await/circular.out | 10 + .../top_level_await/loop.js | 20 + .../top_level_await/loop.out | 5 + .../top_level_await/nested.out | 5 + .../top_level_await/nested/a.js | 3 + .../top_level_await/nested/b.js | 1 + .../top_level_await/nested/main.js | 3 + .../top_level_await/order.js | 21 + .../top_level_await/order.out | 2 + .../top_level_await/tla/a.js | 3 + .../top_level_await/tla/b.js | 7 + .../top_level_await/tla/c.js | 3 + .../top_level_await/tla/d.js | 8 + .../top_level_await/tla/order.js | 1 + .../top_level_await/tla/parent.js | 9 + .../top_level_await/tla2/a.js | 5 + .../top_level_await/tla2/b.js | 5 + .../top_level_await/tla3/b.js | 7 + .../top_level_await/tla3/timeout_loop.js | 23 + .../top_level_await/top_level_await.js | 0 .../top_level_await/top_level_await.out | 3 + .../top_level_await/top_level_await.ts | 3 + .../top_level_await/top_level_for_await.js | 10 + .../top_level_await/top_level_for_await.out | 3 + .../top_level_await/top_level_for_await.ts | 10 + .../top_level_await/unresolved.js | 1 + .../top_level_await/unresolved.out | 4 + .../run/top_level_await_loop/__test__.jsonc | 4 + .../top_level_await/circular.js | 8 + .../top_level_await/circular.out | 10 + .../top_level_await/loop.js | 20 + .../top_level_await/loop.out | 5 + .../top_level_await/nested.out | 5 + .../top_level_await/nested/a.js | 3 + .../top_level_await/nested/b.js | 1 + .../top_level_await/nested/main.js | 3 + .../top_level_await/order.js | 21 + .../top_level_await/order.out | 2 + .../top_level_await/tla/a.js | 3 + .../top_level_await/tla/b.js | 7 + .../top_level_await/tla/c.js | 3 + .../top_level_await/tla/d.js | 8 + .../top_level_await/tla/order.js | 1 + .../top_level_await/tla/parent.js | 9 + .../top_level_await/tla2/a.js | 5 + .../top_level_await/tla2/b.js | 5 + .../top_level_await/tla3/b.js | 7 + .../top_level_await/tla3/timeout_loop.js | 23 + .../top_level_await/top_level_await.js | 3 + .../top_level_await/top_level_await.out | 3 + .../top_level_await/top_level_await.ts | 3 + .../top_level_await/top_level_for_await.js | 10 + .../top_level_await/top_level_for_await.out | 3 + .../top_level_await/top_level_for_await.ts | 10 + .../top_level_await/unresolved.js | 1 + .../top_level_await/unresolved.out | 4 + .../run/top_level_await_nested/__test__.jsonc | 4 + .../top_level_await/circular.js | 8 + .../top_level_await/circular.out | 10 + .../top_level_await/loop.js | 0 .../top_level_await/loop.out | 5 + .../top_level_await/nested.out | 5 + .../top_level_await/nested/a.js | 3 + .../top_level_await/nested/b.js | 1 + .../top_level_await/nested/main.js | 3 + .../top_level_await/order.js | 21 + .../top_level_await/order.out | 2 + .../top_level_await/tla/a.js | 3 + .../top_level_await/tla/b.js | 7 + .../top_level_await/tla/c.js | 3 + .../top_level_await/tla/d.js | 8 + .../top_level_await/tla/order.js | 1 + .../top_level_await/tla/parent.js | 9 + .../top_level_await/tla2/a.js | 5 + .../top_level_await/tla2/b.js | 5 + .../top_level_await/tla3/b.js | 7 + .../top_level_await/tla3/timeout_loop.js | 23 + .../top_level_await/top_level_await.js | 3 + .../top_level_await/top_level_await.out | 3 + .../top_level_await/top_level_await.ts | 3 + .../top_level_await/top_level_for_await.js | 10 + .../top_level_await/top_level_for_await.out | 3 + .../top_level_await/top_level_for_await.ts | 10 + .../top_level_await/unresolved.js | 1 + .../top_level_await/unresolved.out | 4 + .../run/top_level_await_order/__test__.jsonc | 4 + .../top_level_await/circular.js | 8 + .../top_level_await/circular.out | 10 + .../top_level_await/loop.js | 20 + .../top_level_await/loop.out | 5 + .../top_level_await/nested.out | 5 + .../top_level_await/nested/a.js | 3 + .../top_level_await/nested/b.js | 1 + .../top_level_await/nested/main.js | 3 + .../top_level_await/order.js | 21 + .../top_level_await/order.out | 2 + .../top_level_await/tla/a.js | 3 + .../top_level_await/tla/b.js | 7 + .../top_level_await/tla/c.js | 3 + .../top_level_await/tla/d.js | 8 + .../top_level_await/tla/order.js | 1 + .../top_level_await/tla/parent.js | 9 + .../top_level_await/tla2/a.js | 5 + .../top_level_await/tla2/b.js | 5 + .../top_level_await/tla3/b.js | 7 + .../top_level_await/tla3/timeout_loop.js | 23 + .../top_level_await/top_level_await.js | 3 + .../top_level_await/top_level_await.out | 3 + .../top_level_await/top_level_await.ts | 3 + .../top_level_await/top_level_for_await.js | 10 + .../top_level_await/top_level_for_await.out | 3 + .../top_level_await/top_level_for_await.ts | 10 + .../top_level_await/unresolved.js | 1 + .../top_level_await/unresolved.out | 4 + .../run/top_level_await_ts/__test__.jsonc | 4 + tests/specs/run/top_level_await_ts/hello.txt | 1 + .../top_level_await/circular.js | 8 + .../top_level_await/circular.out | 10 + .../top_level_await/loop.js | 20 + .../top_level_await/loop.out | 5 + .../top_level_await/nested.out | 5 + .../top_level_await/nested/a.js | 3 + .../top_level_await/nested/b.js | 1 + .../top_level_await/nested/main.js | 3 + .../top_level_await/order.js | 21 + .../top_level_await/order.out | 2 + .../top_level_await/tla/a.js | 3 + .../top_level_await/tla/b.js | 7 + .../top_level_await/tla/c.js | 3 + .../top_level_await/tla/d.js | 8 + .../top_level_await/tla/order.js | 1 + .../top_level_await/tla/parent.js | 9 + .../top_level_await/tla2/a.js | 5 + .../top_level_await/tla2/b.js | 5 + .../top_level_await/tla3/b.js | 7 + .../top_level_await/tla3/timeout_loop.js | 23 + .../top_level_await/top_level_await.js | 3 + .../top_level_await/top_level_await.out | 3 + .../top_level_await/top_level_await.ts | 3 + .../top_level_await/top_level_for_await.js | 10 + .../top_level_await/top_level_for_await.out | 3 + .../top_level_await/top_level_for_await.ts | 10 + .../top_level_await/unresolved.js | 1 + .../top_level_await/unresolved.out | 4 + .../top_level_await_unresolved/__test__.jsonc | 5 + .../top_level_await/circular.js | 8 + .../top_level_await/circular.out | 10 + .../top_level_await/loop.js | 20 + .../top_level_await/loop.out | 5 + .../top_level_await/nested.out | 5 + .../top_level_await/nested/a.js | 3 + .../top_level_await/nested/b.js | 1 + .../top_level_await/nested/main.js | 3 + .../top_level_await/order.js | 21 + .../top_level_await/order.out | 2 + .../top_level_await/tla/a.js | 3 + .../top_level_await/tla/b.js | 7 + .../top_level_await/tla/c.js | 3 + .../top_level_await/tla/d.js | 8 + .../top_level_await/tla/order.js | 1 + .../top_level_await/tla/parent.js | 9 + .../top_level_await/tla2/a.js | 5 + .../top_level_await/tla2/b.js | 5 + .../top_level_await/tla3/b.js | 7 + .../top_level_await/tla3/timeout_loop.js | 23 + .../top_level_await/top_level_await.js | 3 + .../top_level_await/top_level_await.out | 3 + .../top_level_await/top_level_await.ts | 3 + .../top_level_await/top_level_for_await.js | 10 + .../top_level_await/top_level_for_await.out | 3 + .../top_level_await/top_level_for_await.ts | 10 + .../top_level_await/unresolved.js | 1 + .../top_level_await/unresolved.out | 4 + .../run/top_level_for_await/__test__.jsonc | 4 + .../top_level_await/circular.js | 8 + .../top_level_await/circular.out | 10 + .../top_level_await/loop.js | 20 + .../top_level_await/loop.out | 5 + .../top_level_await/nested.out | 5 + .../top_level_await/nested/a.js | 3 + .../top_level_await/nested/b.js | 1 + .../top_level_await/nested/main.js | 3 + .../top_level_await/order.js | 21 + .../top_level_await/order.out | 2 + .../top_level_await/tla/a.js | 3 + .../top_level_await/tla/b.js | 7 + .../top_level_await/tla/c.js | 3 + .../top_level_await/tla/d.js | 8 + .../top_level_await/tla/order.js | 1 + .../top_level_await/tla/parent.js | 9 + .../top_level_await/tla2/a.js | 5 + .../top_level_await/tla2/b.js | 5 + .../top_level_await/tla3/b.js | 7 + .../top_level_await/tla3/timeout_loop.js | 23 + .../top_level_await/top_level_await.js | 3 + .../top_level_await/top_level_await.out | 3 + .../top_level_await/top_level_await.ts | 3 + .../top_level_await/top_level_for_await.js | 10 + .../top_level_await/top_level_for_await.out | 3 + .../top_level_await/top_level_for_await.ts | 10 + .../top_level_await/unresolved.js | 1 + .../top_level_await/unresolved.out | 4 + .../run/top_level_for_await_ts/__test__.jsonc | 4 + .../top_level_await/circular.js | 8 + .../top_level_await/circular.out | 10 + .../top_level_await/loop.js | 20 + .../top_level_await/loop.out | 5 + .../top_level_await/nested.out | 5 + .../top_level_await/nested/a.js | 3 + .../top_level_await/nested/b.js | 1 + .../top_level_await/nested/main.js | 3 + .../top_level_await/order.js | 21 + .../top_level_await/order.out | 2 + .../top_level_await/tla/a.js | 3 + .../top_level_await/tla/b.js | 7 + .../top_level_await/tla/c.js | 3 + .../top_level_await/tla/d.js | 8 + .../top_level_await/tla/order.js | 1 + .../top_level_await/tla/parent.js | 9 + .../top_level_await/tla2/a.js | 5 + .../top_level_await/tla2/b.js | 5 + .../top_level_await/tla3/b.js | 7 + .../top_level_await/tla3/timeout_loop.js | 23 + .../top_level_await/top_level_await.js | 3 + .../top_level_await/top_level_await.out | 3 + .../top_level_await/top_level_await.ts | 3 + .../top_level_await/top_level_for_await.js | 10 + .../top_level_await/top_level_for_await.out | 3 + .../top_level_await/top_level_for_await.ts | 10 + .../top_level_await/unresolved.js | 1 + .../top_level_await/unresolved.out | 4 + tests/specs/run/ts_decorators/__test__.jsonc | 4 + .../decorators/experimental/deno.json | 5 + .../decorators/experimental/no_check/main.out | 3 + .../decorators/experimental/no_check/main.ts | 21 + .../decorators/experimental/runtime/main.out | 7 + .../decorators/experimental/runtime/main.ts | 42 + .../decorators/experimental/ts/main.out | 3 + .../decorators/experimental/ts/main.ts | 14 + .../decorators/tc39_proposal/main.out | 3 + .../decorators/tc39_proposal/main.ts | 21 + .../run/ts_import_from_js/005_more_imports.ts | 11 + .../run/ts_import_from_js/__test__.jsonc | 4 + tests/specs/run/ts_import_from_js/mod1.ts | 17 + tests/specs/run/ts_import_from_js/mod2.ts | 1 + .../run/ts_import_from_js/print_hello.ts | 3 + .../subdir2/dynamic_import.ts | 4 + .../run/ts_import_from_js/subdir2/mod2.ts | 9 + .../ts_import_from_js/deps.js | 0 .../ts_import_from_js/main.js | 0 .../ts_import_from_js/main.out | 0 .../specs/run/ts_type_imports/__test__.jsonc | 5 + .../run/ts_type_imports}/ts_type_imports.ts | 0 .../ts_type_imports}/ts_type_imports.ts.out | 0 .../ts_type_imports/ts_type_imports_foo.ts | 1 + .../run/ts_type_only_import/__test__.jsonc | 4 + .../ts_type_only_import.d.ts | 3 + .../ts_type_only_import.ts | 0 .../ts_type_only_import.ts.out | 0 .../run/ts_without_extension/__test__.jsonc | 5 + .../ts_without_extension/ts_without_extension | 3 + .../ts_without_extension.out | 2 + tests/specs/run/tsx_imports/046_jsx_test.tsx | 14 + tests/specs/run/tsx_imports/__test__.jsonc | 4 + .../tsx_imports}/tsx_imports/Component.tsx | 0 .../tsx_imports}/tsx_imports/tsx_imports.ts | 0 .../tsx_imports/tsx_imports.ts.out | 0 .../specs/run/type_definitions/__test__.jsonc | 4 + .../run/type_definitions}/type_definitions.ts | 6 +- .../type_definitions}/type_definitions.ts.out | 0 .../type_definitions/bar.d.ts | 7 + .../type_definitions/type_definitions/bar.js | 5 + .../type_definitions/fizz.d.ts | 2 + .../type_definitions/type_definitions/fizz.js | 1 + .../type_definitions/foo.d.ts | 2 + .../type_definitions/type_definitions/foo.js | 1 + .../type_definitions/type_definitions/qat.ts | 1 + .../__test__.jsonc | 5 + .../export_type_def.ts | 2 + .../type_definitions/bar.d.ts | 7 + .../type_definitions/bar.js | 5 + .../type_definitions/fizz.d.ts | 2 + .../type_definitions/fizz.js | 1 + .../type_definitions/foo.d.ts | 2 + .../type_definitions/foo.js | 1 + .../type_definitions/qat.ts | 1 + .../type_definitions_for_export.ts | 0 .../type_definitions_for_export.ts.out | 0 .../run/type_directives_01/__test__.jsonc | 4 + .../type_directives_01}/type_directives_01.ts | 0 .../type_directives_01.ts.out | 0 .../run/type_directives_02/__test__.jsonc | 4 + .../type_directives_02/type_directives_02.ts | 3 + .../type_directives_02.ts.out | 3 + .../type_directives_02/type_reference.d.ts | 1 + .../run/type_directives_02/type_reference.js | 3 + .../type_headers_deno_types/__test__.jsonc | 4 + .../type_headers_deno_types.ts | 0 .../type_headers_deno_types.ts.out | 0 .../run/unbuffered_stderr/__test__.jsonc | 4 + .../unbuffered_stderr}/unbuffered_stderr.ts | 0 .../unbuffered_stderr.ts.out | 0 .../run/unbuffered_stdout/__test__.jsonc | 4 + .../unbuffered_stdout}/unbuffered_stdout.ts | 0 .../unbuffered_stdout.ts.out | 0 .../run/unhandled_rejection/__test__.jsonc | 4 + .../unhandled_rejection.ts | 0 .../unhandled_rejection.ts.out | 9 + .../__test__.jsonc | 5 + .../import.ts | 0 .../main.ts | 0 .../main.ts.out | 0 .../__test__.jsonc | 4 + .../import.ts | 0 .../main.ts | 0 .../main.ts.out | 0 .../__test__.jsonc | 4 + .../unhandled_rejection_sync_error.ts | 0 .../unhandled_rejection_sync_error.ts.out | 6 + tests/specs/run/unsafe_proto/__test__.jsonc | 5 + .../run/unsafe_proto}/unsafe_proto/main.js | 0 .../run/unsafe_proto}/unsafe_proto/main.out | 0 .../main_with_unsafe_proto_flag.out | 0 .../run/unsafe_proto}/unsafe_proto/worker.js | 0 .../run/unsafe_proto_flag/__test__.jsonc | 5 + .../unsafe_proto_flag/unsafe_proto/main.js | 5 + .../unsafe_proto_flag/unsafe_proto/main.out | 2 + .../main_with_unsafe_proto_flag.out | 2 + .../unsafe_proto_flag/unsafe_proto/worker.js | 2 + .../__test__.jsonc | 4 + .../unstable_broadcast_channel.disabled.out | 0 .../unstable_broadcast_channel.js | 0 .../__test__.jsonc | 4 + .../unstable_broadcast_channel.enabled.out | 0 .../unstable_broadcast_channel.js | 10 + .../run/unstable_cron_disabled/__test__.jsonc | 4 + .../unstable_cron.disabled.out | 0 .../unstable_cron_disabled}/unstable_cron.js | 0 .../run/unstable_cron_enabled/__test__.jsonc | 4 + .../unstable_cron.enabled.out | 0 .../unstable_cron_enabled/unstable_cron.js | 10 + .../run/unstable_kv_disabled/__test__.jsonc | 4 + .../unstable_kv.disabled.out | 0 .../run/unstable_kv_disabled}/unstable_kv.js | 0 .../run/unstable_kv_enabled/__test__.jsonc | 4 + .../unstable_kv.enabled.out | 0 .../run/unstable_kv_enabled/unstable_kv.js | 14 + .../run/unstable_net_disabled/__test__.jsonc | 4 + .../unstable_net.disabled.out | 0 .../unstable_net_disabled}/unstable_net.js | 0 .../run/unstable_net_enabled/__test__.jsonc | 4 + .../unstable_net.enabled.out | 0 .../run/unstable_net_enabled/unstable_net.js | 11 + .../specs/run/unstable_worker/__test__.jsonc | 4 + .../run/unstable_worker}/unstable_worker.ts | 2 +- .../unstable_worker}/unstable_worker.ts.out | 0 .../run/unstable_worker/worker_unstable.ts | 5 + .../__test__.jsonc | 5 + .../unstable_worker_options.disabled.out | 0 .../unstable_worker_options.js | 0 .../__test__.jsonc | 4 + .../unstable_worker_options.enabled.out | 0 .../unstable_worker_options.js | 19 + .../__test__.jsonc | 5 + .../unsupported_dynamic_import_scheme.out | 0 .../specs/run/v8_flags_env_run/__test__.jsonc | 7 + .../run/v8_flags_env_run}/v8_flags.js | 0 .../run/v8_flags_env_run}/v8_flags.js.out | 0 tests/specs/run/v8_flags_run/__test__.jsonc | 4 + tests/specs/run/v8_flags_run/v8_flags.js | 1 + tests/specs/run/v8_flags_run/v8_flags.js.out | 1 + .../run/v8_flags_unrecognized/__test__.jsonc | 5 + .../v8_flags_unrecognized.out | 0 tests/specs/run/v8_help/__test__.jsonc | 4 + .../run => specs/run/v8_help}/v8_help.out | 0 tests/specs/run/wasm/__test__.jsonc | 4 + .../{testdata/run => specs/run/wasm}/wasm.ts | 0 tests/specs/run/wasm/wasm.ts.out | 1 + tests/specs/run/wasm_async/__test__.jsonc | 4 + .../run/wasm_async}/wasm_async.js | 0 .../run/wasm_async}/wasm_async.out | 0 tests/specs/run/wasm_shared/__test__.jsonc | 4 + tests/specs/run/wasm_shared/wasm_shared.out | 0 .../run/wasm_shared}/wasm_shared.ts | 0 .../wasm_streaming_panic_test/__test__.jsonc | 5 + .../wasm_streaming_panic_test.js | 0 .../wasm_streaming_panic_test.js.out | 0 .../specs/run/wasm_unreachable/__test__.jsonc | 5 + .../run/wasm_unreachable/unreachable.wasm | Bin 0 -> 42 bytes .../run/wasm_unreachable}/wasm_unreachable.js | 2 +- .../wasm_unreachable}/wasm_unreachable.out | 0 tests/specs/run/wasm_url/__test__.jsonc | 5 + .../run => specs/run/wasm_url}/wasm_url.js | 0 .../run => specs/run/wasm_url}/wasm_url.out | 0 tests/specs/run/weakref/__test__.jsonc | 4 + .../run => specs/run/weakref}/weakref.ts | 0 .../run => specs/run/weakref}/weakref.ts.out | 0 .../webstorage_serialization/__test__.jsonc | 4 + .../webstorage/config_a.jsonc | 3 + .../webstorage/config_b.jsonc | 3 + .../webstorage/fixture.ts | 2 + .../webstorage/logger.ts | 1 + .../webstorage/serialization.ts | 0 .../webstorage/serialization.ts.out | 0 .../webstorage/setter.ts | 1 + .../__test__.jsonc | 4 + .../close_in_wasm_reactions.js | 21 + .../worker_close_in_wasm_reactions.js | 2 +- .../worker_close_in_wasm_reactions.js.out | 0 .../run/worker_close_nested/__test__.jsonc | 4 + .../worker_close_nested/close_nested_child.js | 8 + .../close_nested_parent.js | 13 + .../worker_close_nested.js | 2 +- .../worker_close_nested.js.out | 0 .../run/worker_close_race/__test__.jsonc | 4 + .../worker_close_race/close_race_worker.js | 6 + .../worker_close_race}/worker_close_race.js | 2 +- .../worker_close_race.js.out | 0 .../worker_drop_handle_race/__test__.jsonc | 5 + .../drop_handle_race.js | 3 + .../worker_drop_handle_race.js | 2 +- .../worker_drop_handle_race.js.out | 2 +- .../__test__.jsonc | 4 + .../worker_drop_handle_race_terminate.js | 0 .../worker_drop_handle_race_terminate.js.out | 0 .../worker_event_handler_test/__test__.jsonc | 4 + .../worker_event_handler_test.js | 2 +- .../worker_event_handler_test.js.out | 0 .../worker_event_handlers.js | 26 + .../__test__.jsonc | 4 + .../message_before_close.js | 4 + .../worker_message_before_close.js | 2 +- .../worker_message_before_close.js.out | 0 tests/testdata/run/014_duplicate_import.ts | 9 - tests/testdata/run/020_json_modules.ts | 2 - tests/testdata/run/021_mjs_modules.ts | 2 - tests/testdata/run/035_cached_only_flag.out | 1 - tests/testdata/run/044_bad_resource.ts | 3 - tests/testdata/run/config_json_import.ts | 2 - tests/testdata/run/error_002.ts | 7 - .../error_015_dynamic_import_permissions.js | 3 - tests/testdata/run/error_no_check.ts | 1 - tests/testdata/run/error_no_check.ts.out | 2 - tests/testdata/run/error_type_definitions.ts | 5 - tests/testdata/run/fix_emittable_skipped.js | 7 - tests/testdata/run/fix_js_import_js.ts | 3 - tests/testdata/run/fix_js_imports.ts | 3 - tests/testdata/run/import_type.ts | 5 - tests/testdata/run/issue13562.ts | 3 - tests/testdata/run/lock_check_ok.json | 4 - tests/testdata/run/lock_v2_check_ok.json | 7 - tests/testdata/run/type_directives_02.ts | 3 - tests/testdata/run/type_directives_02.ts.out | 3 - tests/testdata/run/unhandled_rejection.ts.out | 9 - .../run/unhandled_rejection_sync_error.ts.out | 6 - .../run/with_package_json/with_stop/main.out | 5 - tools/lint.js | 2 +- 1656 files changed, 7496 insertions(+), 1936 deletions(-) create mode 100644 tests/specs/run/_001_hello/001_hello.js rename tests/{testdata/run => specs/run/_001_hello}/001_hello.js.out (100%) create mode 100644 tests/specs/run/_001_hello/__test__.jsonc create mode 100644 tests/specs/run/_002_hello/002_hello.ts rename tests/{testdata/run => specs/run/_002_hello}/002_hello.ts.out (100%) create mode 100644 tests/specs/run/_002_hello/__test__.jsonc create mode 100644 tests/specs/run/_003_relative_import/003_relative_import.ts rename tests/{testdata/run => specs/run/_003_relative_import}/003_relative_import.ts.out (100%) create mode 100644 tests/specs/run/_003_relative_import/__test__.jsonc create mode 100644 tests/specs/run/_003_relative_import/print_hello.ts rename tests/{testdata/run => specs/run/_004_set_timeout}/004_set_timeout.ts (100%) rename tests/{testdata/run => specs/run/_004_set_timeout}/004_set_timeout.ts.out (100%) create mode 100644 tests/specs/run/_004_set_timeout/__test__.jsonc rename tests/{testdata/run => specs/run/_005_more_imports}/005_more_imports.ts (65%) rename tests/{testdata/run => specs/run/_005_more_imports}/005_more_imports.ts.out (100%) create mode 100644 tests/specs/run/_005_more_imports/__test__.jsonc create mode 100644 tests/specs/run/_005_more_imports/mod1.ts create mode 100644 tests/specs/run/_005_more_imports/print_hello.ts create mode 100644 tests/specs/run/_005_more_imports/subdir2/mod2.ts create mode 100644 tests/specs/run/_006_url_imports/006_url_imports.ts create mode 100644 tests/specs/run/_006_url_imports/006_url_imports.ts.out create mode 100644 tests/specs/run/_006_url_imports/__test__.jsonc create mode 100644 tests/specs/run/_006_url_imports/print_hello.ts create mode 100644 tests/specs/run/_006_url_imports/subdir2/mod2.ts rename tests/{testdata/run => specs/run/_012_async}/012_async.ts (100%) rename tests/{testdata/run => specs/run/_012_async}/012_async.ts.out (100%) create mode 100644 tests/specs/run/_012_async/__test__.jsonc create mode 100644 tests/specs/run/_013_dynamic_import/013_dynamic_import.ts rename tests/{testdata/run => specs/run/_013_dynamic_import}/013_dynamic_import.ts.out (100%) create mode 100644 tests/specs/run/_013_dynamic_import/__test__.jsonc create mode 100644 tests/specs/run/_013_dynamic_import/mod1.ts create mode 100644 tests/specs/run/_013_dynamic_import/print_hello.ts create mode 100644 tests/specs/run/_013_dynamic_import/subdir2/mod2.ts create mode 100644 tests/specs/run/_014_duplicate_import/014_duplicate_import.ts rename tests/{testdata/run => specs/run/_014_duplicate_import}/014_duplicate_import.ts.out (100%) create mode 100644 tests/specs/run/_014_duplicate_import/__test__.jsonc create mode 100644 tests/specs/run/_014_duplicate_import/auto_print_hello.ts rename tests/{testdata/run => specs/run/_015_duplicate_parallel_import}/015_duplicate_parallel_import.js (91%) rename tests/{testdata/run => specs/run/_015_duplicate_parallel_import}/015_duplicate_parallel_import.js.out (100%) create mode 100644 tests/specs/run/_015_duplicate_parallel_import/__test__.jsonc create mode 100644 tests/specs/run/_015_duplicate_parallel_import/mod1.ts create mode 100644 tests/specs/run/_015_duplicate_parallel_import/print_hello.ts create mode 100644 tests/specs/run/_015_duplicate_parallel_import/subdir2/mod2.ts rename tests/{testdata/run => specs/run/_016_double_await}/016_double_await.ts (100%) rename tests/{testdata/run => specs/run/_016_double_await}/016_double_await.ts.out (100%) create mode 100644 tests/specs/run/_016_double_await/__test__.jsonc create mode 100644 tests/specs/run/_017_import_redirect/017_import_redirect.ts rename tests/{testdata/run => specs/run/_017_import_redirect}/017_import_redirect.ts.out (100%) create mode 100644 tests/specs/run/_017_import_redirect/__test__.jsonc create mode 100644 tests/specs/run/_017_import_redirect_check/017_import_redirect.ts rename tests/{testdata/run/https_import.ts.out => specs/run/_017_import_redirect_check/017_import_redirect.ts.out} (100%) create mode 100644 tests/specs/run/_017_import_redirect_check/__test__.jsonc create mode 100644 tests/specs/run/_017_import_redirect_info/017_import_redirect.ts rename tests/{testdata/run => specs/run/_017_import_redirect_info}/017_import_redirect_info.out (100%) create mode 100644 tests/specs/run/_017_import_redirect_info/__test__.jsonc create mode 100644 tests/specs/run/_017_import_redirect_vendor_dir/017_import_redirect.ts rename tests/{testdata/run/import_blob_url_imports.ts.out => specs/run/_017_import_redirect_vendor_dir/017_import_redirect.ts.out} (100%) create mode 100644 tests/specs/run/_017_import_redirect_vendor_dir/__test__.jsonc rename tests/{testdata/run => specs/run/_018_async_catch}/018_async_catch.ts (100%) rename tests/{testdata/run => specs/run/_018_async_catch}/018_async_catch.ts.out (100%) create mode 100644 tests/specs/run/_018_async_catch/__test__.jsonc create mode 100644 tests/specs/run/_019_media_types/019_media_types.ts rename tests/{testdata/run => specs/run/_019_media_types}/019_media_types.ts.out (100%) create mode 100644 tests/specs/run/_019_media_types/__test__.jsonc create mode 100644 tests/specs/run/_020_json_modules/020_json_modules.ts rename tests/{testdata/run => specs/run/_020_json_modules}/020_json_modules.ts.out (80%) create mode 100644 tests/specs/run/_020_json_modules/__test__.jsonc create mode 100644 tests/specs/run/_020_json_modules/config.json create mode 100644 tests/specs/run/_021_mjs_modules/021_mjs_modules.ts rename tests/{testdata/run => specs/run/_021_mjs_modules}/021_mjs_modules.ts.out (100%) create mode 100644 tests/specs/run/_021_mjs_modules/__test__.jsonc create mode 100644 tests/specs/run/_021_mjs_modules/mod5.mjs rename tests/{testdata/run => specs/run/_025_reload_js_type_error}/025_reload_js_type_error.js (100%) rename tests/{testdata/run => specs/run/_025_reload_js_type_error}/025_reload_js_type_error.js.out (100%) create mode 100644 tests/specs/run/_025_reload_js_type_error/__test__.jsonc rename tests/{testdata/run => specs/run/_027_redirect_typescript}/027_redirect_typescript.ts (100%) rename tests/{testdata/run => specs/run/_027_redirect_typescript}/027_redirect_typescript.ts.out (100%) create mode 100644 tests/specs/run/_027_redirect_typescript/__test__.jsonc create mode 100644 tests/specs/run/_027_redirect_typescript_vendor_dir/027_redirect_typescript.ts create mode 100644 tests/specs/run/_027_redirect_typescript_vendor_dir/027_redirect_typescript.ts.out create mode 100644 tests/specs/run/_027_redirect_typescript_vendor_dir/__test__.jsonc create mode 100644 tests/specs/run/_027_redirect_typescript_vendor_dir/vendor/http_localhost_4545/subdir/redirects/redirect1.ts create mode 100644 tests/specs/run/_027_redirect_typescript_vendor_dir/vendor/http_localhost_4545/subdir/redirects/redirect4.ts create mode 100644 tests/specs/run/_027_redirect_typescript_vendor_dir/vendor/manifest.json rename tests/{testdata/run => specs/run/_028_args}/028_args.ts (100%) rename tests/{testdata/run => specs/run/_028_args}/028_args.ts.out (100%) create mode 100644 tests/specs/run/_028_args/__test__.jsonc create mode 100644 tests/specs/run/_033_import_map_data_uri/__test__.jsonc create mode 100644 tests/specs/run/_033_import_map_data_uri/lodash/lodash.ts create mode 100644 tests/specs/run/_033_import_map_data_uri/lodash/other_file.ts rename tests/{testdata/run/import_maps => specs/run/_033_import_map_data_uri}/test_data.ts (100%) rename tests/{testdata/run/import_maps => specs/run/_033_import_map_data_uri}/test_data.ts.out (100%) rename tests/{testdata/run => specs/run/_033_import_map_remote}/033_import_map_remote.out (100%) create mode 100644 tests/specs/run/_033_import_map_remote/__test__.jsonc create mode 100644 tests/specs/run/_033_import_map_remote/import_map_remote.json create mode 100644 tests/specs/run/_033_import_map_remote/lodash/lodash.ts create mode 100644 tests/specs/run/_033_import_map_remote/lodash/other_file.ts create mode 100644 tests/specs/run/_033_import_map_remote/moment/moment.ts create mode 100644 tests/specs/run/_033_import_map_remote/moment/other_file.ts create mode 100644 tests/specs/run/_033_import_map_remote/print_hello.ts create mode 100644 tests/specs/run/_033_import_map_remote/test_remote.ts create mode 100644 tests/specs/run/_033_import_map_remote/vue.ts create mode 100644 tests/specs/run/_033_import_map_vendor_dir_remote/033_import_map_remote.out create mode 100644 tests/specs/run/_033_import_map_vendor_dir_remote/__test__.jsonc create mode 100644 tests/specs/run/_033_import_map_vendor_dir_remote/import_map_remote.json create mode 100644 tests/specs/run/_033_import_map_vendor_dir_remote/lodash/lodash.ts create mode 100644 tests/specs/run/_033_import_map_vendor_dir_remote/lodash/other_file.ts create mode 100644 tests/specs/run/_033_import_map_vendor_dir_remote/moment/moment.ts create mode 100644 tests/specs/run/_033_import_map_vendor_dir_remote/moment/other_file.ts create mode 100644 tests/specs/run/_033_import_map_vendor_dir_remote/print_hello.ts create mode 100644 tests/specs/run/_033_import_map_vendor_dir_remote/test_remote.ts create mode 100644 tests/specs/run/_033_import_map_vendor_dir_remote/vue.ts create mode 100644 tests/specs/run/_035_cached_only_flag/019_media_types.ts create mode 100644 tests/specs/run/_035_cached_only_flag/035_cached_only_flag.out create mode 100644 tests/specs/run/_035_cached_only_flag/__test__.jsonc rename tests/{testdata/run => specs/run/_038_checkjs}/038_checkjs.js (100%) rename tests/{testdata/run => specs/run/_038_checkjs}/038_checkjs.js.out (100%) create mode 100644 tests/specs/run/_038_checkjs/__test__.jsonc create mode 100644 tests/specs/run/_038_checkjs/checkjs.tsconfig.json rename tests/{testdata/run => specs/run/_042_dyn_import_evalcontext}/042_dyn_import_evalcontext.ts (63%) rename tests/{testdata/run => specs/run/_042_dyn_import_evalcontext}/042_dyn_import_evalcontext.ts.out (100%) create mode 100644 tests/specs/run/_042_dyn_import_evalcontext/__test__.jsonc create mode 100644 tests/specs/run/_042_dyn_import_evalcontext/mod4.js create mode 100644 tests/specs/run/_044_bad_resource/044_bad_resource.ts rename tests/{testdata/run => specs/run/_044_bad_resource}/044_bad_resource.ts.out (100%) create mode 100644 tests/specs/run/_044_bad_resource/__test__.jsonc rename tests/{testdata/run => specs/run/_046_tsx}/046_jsx_test.tsx (100%) rename tests/{testdata/run => specs/run/_046_tsx}/046_jsx_test.tsx.out (100%) create mode 100644 tests/specs/run/_046_tsx/__test__.jsonc rename tests/{testdata/run => specs/run/_047_jsx}/047_jsx_test.jsx (100%) rename tests/{testdata/run => specs/run/_047_jsx}/047_jsx_test.jsx.out (100%) create mode 100644 tests/specs/run/_047_jsx/__test__.jsonc create mode 100644 tests/specs/run/_048_media_types_jsx/048_media_types_jsx.ts rename tests/{testdata/run => specs/run/_048_media_types_jsx}/048_media_types_jsx.ts.out (100%) create mode 100644 tests/specs/run/_048_media_types_jsx/__test__.jsonc create mode 100644 tests/specs/run/_052_no_remote_flag/019_media_types.ts rename tests/{testdata/run => specs/run/_052_no_remote_flag}/052_no_remote_flag.out (53%) create mode 100644 tests/specs/run/_052_no_remote_flag/__test__.jsonc rename tests/{testdata/run => specs/run/_058_tasks_microtasks_close}/058_tasks_microtasks_close.ts (100%) rename tests/{testdata/run => specs/run/_058_tasks_microtasks_close}/058_tasks_microtasks_close.ts.out (100%) create mode 100644 tests/specs/run/_058_tasks_microtasks_close/__test__.jsonc rename tests/{testdata/run => specs/run/_059_fs_relative_path_perm}/059_fs_relative_path_perm.ts (100%) rename tests/{testdata/run => specs/run/_059_fs_relative_path_perm}/059_fs_relative_path_perm.ts.out (100%) create mode 100644 tests/specs/run/_059_fs_relative_path_perm/__test__.jsonc rename tests/{testdata/run => specs/run/_063_permissions_revoke}/063_permissions_revoke.ts (100%) rename tests/{testdata/run => specs/run/_063_permissions_revoke}/063_permissions_revoke.ts.out (100%) create mode 100644 tests/specs/run/_063_permissions_revoke/__test__.jsonc create mode 100644 tests/specs/run/_063_permissions_revoke_sync/063_permissions_revoke.ts.out rename tests/{testdata/run => specs/run/_063_permissions_revoke_sync}/063_permissions_revoke_sync.ts (100%) create mode 100644 tests/specs/run/_063_permissions_revoke_sync/__test__.jsonc rename tests/{testdata/run => specs/run/_064_permissions_revoke_global}/064_permissions_revoke_global.ts (100%) rename tests/{testdata/run => specs/run/_064_permissions_revoke_global}/064_permissions_revoke_global.ts.out (100%) create mode 100644 tests/specs/run/_064_permissions_revoke_global/__test__.jsonc create mode 100644 tests/specs/run/_064_permissions_revoke_global_sync/064_permissions_revoke_global.ts.out rename tests/{testdata/run => specs/run/_064_permissions_revoke_global_sync}/064_permissions_revoke_global_sync.ts (100%) create mode 100644 tests/specs/run/_064_permissions_revoke_global_sync/__test__.jsonc rename tests/{testdata/run => specs/run/_065_permissions_revoke_net}/065_permissions_revoke_net.ts (100%) rename tests/{testdata/run => specs/run/_065_permissions_revoke_net}/065_permissions_revoke_net.ts.out (100%) create mode 100644 tests/specs/run/_065_permissions_revoke_net/__test__.jsonc rename tests/{testdata/run => specs/run/_070_location}/070_location.ts (100%) rename tests/{testdata/run => specs/run/_070_location}/070_location.ts.out (100%) create mode 100644 tests/specs/run/_070_location/__test__.jsonc rename tests/{testdata/run => specs/run/_071_location_unset}/071_location_unset.ts (100%) rename tests/{testdata/run => specs/run/_071_location_unset}/071_location_unset.ts.out (100%) create mode 100644 tests/specs/run/_071_location_unset/__test__.jsonc rename tests/{testdata/run => specs/run/_072_location_relative_fetch}/072_location_relative_fetch.ts (100%) rename tests/{testdata/run => specs/run/_072_location_relative_fetch}/072_location_relative_fetch.ts.out (100%) create mode 100644 tests/specs/run/_072_location_relative_fetch/__test__.jsonc create mode 100644 tests/specs/run/_072_location_relative_fetch/fetch/hello.txt create mode 100644 tests/specs/run/_075_import_local_query_hash/001_hello.js create mode 100644 tests/specs/run/_075_import_local_query_hash/002_hello.ts rename tests/{testdata/run => specs/run/_075_import_local_query_hash}/075_import_local_query_hash.ts (100%) rename tests/{testdata/run => specs/run/_075_import_local_query_hash}/075_import_local_query_hash.ts.out (100%) create mode 100644 tests/specs/run/_075_import_local_query_hash/__test__.jsonc rename tests/{testdata/run => specs/run/_077_fetch_empty}/077_fetch_empty.ts (100%) rename tests/{testdata/run => specs/run/_077_fetch_empty}/077_fetch_empty.ts.out (100%) create mode 100644 tests/specs/run/_077_fetch_empty/__test__.jsonc rename tests/{testdata/run => specs/run/_078_unload_on_exit}/078_unload_on_exit.ts (100%) rename tests/{testdata/run => specs/run/_078_unload_on_exit}/078_unload_on_exit.ts.out (100%) create mode 100644 tests/specs/run/_078_unload_on_exit/__test__.jsonc rename tests/{testdata/run => specs/run/_079_location_authentication}/079_location_authentication.ts (100%) rename tests/{testdata/run => specs/run/_079_location_authentication}/079_location_authentication.ts.out (100%) create mode 100644 tests/specs/run/_079_location_authentication/__test__.jsonc rename tests/{testdata/run => specs/run/_081_location_relative_fetch_redirect}/081_location_relative_fetch_redirect.ts (100%) rename tests/{testdata/run => specs/run/_081_location_relative_fetch_redirect}/081_location_relative_fetch_redirect.ts.out (100%) create mode 100644 tests/specs/run/_081_location_relative_fetch_redirect/__test__.jsonc rename tests/{testdata/run => specs/run/_082_prepare_stack_trace_throw}/082_prepare_stack_trace_throw.js (100%) rename tests/{testdata/run => specs/run/_082_prepare_stack_trace_throw}/082_prepare_stack_trace_throw.js.out (100%) create mode 100644 tests/specs/run/_082_prepare_stack_trace_throw/__test__.jsonc rename tests/{testdata/run => specs/run/_088_dynamic_import_already_evaluating}/088_dynamic_import_already_evaluating.ts (100%) rename tests/{testdata/run => specs/run/_088_dynamic_import_already_evaluating}/088_dynamic_import_already_evaluating.ts.out (100%) create mode 100644 tests/specs/run/_088_dynamic_import_already_evaluating/088_dynamic_import_target.ts create mode 100644 tests/specs/run/_088_dynamic_import_already_evaluating/__test__.jsonc rename tests/{testdata/run => specs/run/_091_use_define_for_class_fields}/091_use_define_for_class_fields.ts (100%) rename tests/{testdata/run => specs/run/_091_use_define_for_class_fields}/091_use_define_for_class_fields.ts.out (100%) create mode 100644 tests/specs/run/_091_use_define_for_class_fields/__test__.jsonc create mode 100644 tests/specs/run/aggregate_error/__test__.jsonc rename tests/{testdata/run => specs/run/aggregate_error}/aggregate_error.out (100%) rename tests/{testdata/run => specs/run/aggregate_error}/aggregate_error.ts (100%) create mode 100644 tests/specs/run/async_error/__test__.jsonc rename tests/{testdata/run => specs/run/async_error}/async_error.ts (100%) rename tests/{testdata/run => specs/run/async_error}/async_error.ts.out (100%) create mode 100644 tests/specs/run/beforeunload_event/__test__.jsonc rename tests/{testdata/run => specs/run/beforeunload_event}/before_unload.js (100%) rename tests/{testdata/run => specs/run/beforeunload_event}/before_unload.js.out (100%) create mode 100644 tests/specs/run/blob_gc_finalization/__test__.jsonc rename tests/{testdata/run => specs/run/blob_gc_finalization}/blob_gc_finalization.js (100%) rename tests/{testdata/run => specs/run/blob_gc_finalization}/blob_gc_finalization.js.out (100%) create mode 100644 tests/specs/run/byte_order_mark/001_hello.js create mode 100644 tests/specs/run/byte_order_mark/__test__.jsonc rename tests/{testdata/run => specs/run/byte_order_mark}/byte_order_mark.out (100%) rename tests/{testdata/run => specs/run/byte_order_mark}/byte_order_mark.ts (86%) create mode 100644 tests/specs/run/check_js_points_to_ts/__test__.jsonc rename tests/{testdata/run => specs/run/check_js_points_to_ts}/check_js_points_to_ts/bar.ts (100%) rename tests/{testdata/run => specs/run/check_js_points_to_ts}/check_js_points_to_ts/foo.d.ts (100%) rename tests/{testdata/run => specs/run/check_js_points_to_ts}/check_js_points_to_ts/foo.js (100%) rename tests/{testdata/run => specs/run/check_js_points_to_ts}/check_js_points_to_ts/test.js (100%) rename tests/{testdata/run => specs/run/check_js_points_to_ts}/check_js_points_to_ts/test.js.out (100%) create mode 100644 tests/specs/run/check_js_points_to_ts/checkjs.tsconfig.json create mode 100644 tests/specs/run/check_remote/__test__.jsonc create mode 100644 tests/specs/run/check_remote/no_check_remote.ts rename tests/{testdata/run => specs/run/check_remote}/no_check_remote.ts.disabled.out (66%) create mode 100644 tests/specs/run/check_remote/type_error.ts create mode 100644 tests/specs/run/classic_workers_event_loop/__test__.jsonc rename tests/{testdata/run => specs/run/classic_workers_event_loop}/classic_workers_event_loop.js (100%) rename tests/{testdata/run => specs/run/classic_workers_event_loop}/classic_workers_event_loop.js.out (100%) create mode 100644 tests/specs/run/colors_without_global_this/__test__.jsonc rename tests/{testdata/run => specs/run/colors_without_global_this}/colors_without_globalThis.js (100%) create mode 100644 tests/specs/run/complex_error/__test__.jsonc rename tests/{testdata/run => specs/run/complex_error}/complex_error.ts (100%) rename tests/{testdata/run => specs/run/complex_error}/complex_error.ts.out (100%) create mode 100644 tests/specs/run/config/__test__.jsonc rename tests/{testdata/run => specs/run/config}/config/main.out (100%) rename tests/{testdata/run => specs/run/config}/config/main.ts (100%) rename tests/{testdata/run => specs/run/config}/config/tsconfig.json (100%) create mode 100644 tests/specs/run/config_auto_discovered_for_local_script/__test__.jsonc rename tests/{testdata/run/with_config => specs/run/config_auto_discovered_for_local_script}/frontend_work.ts (100%) create mode 100644 tests/specs/run/config_auto_discovered_for_local_script_log/__test__.jsonc rename tests/{testdata/run/with_config => specs/run/config_auto_discovered_for_local_script_log}/auto_discovery_log.out (100%) rename tests/{testdata/run/with_config => specs/run/config_auto_discovered_for_local_script_log}/deno.jsonc (100%) create mode 100644 tests/specs/run/config_auto_discovered_for_local_script_log/frontend_work.ts create mode 100644 tests/specs/run/config_json_import/__test__.jsonc create mode 100644 tests/specs/run/config_json_import/config_json_import.ts rename tests/{testdata/run => specs/run/config_json_import}/config_json_import.ts.out (100%) create mode 100644 tests/specs/run/config_json_import/deno-jsx.json create mode 100644 tests/specs/run/config_not_auto_discovered_for_remote_script/__test__.jsonc rename tests/{testdata/run/with_config => specs/run/config_not_auto_discovered_for_remote_script}/server_side_work.ts (100%) create mode 100644 tests/specs/run/config_types/__test__.jsonc create mode 100644 tests/specs/run/config_types/config_types/deno.lock rename tests/{testdata/run => specs/run/config_types}/config_types/main.out (100%) rename tests/{testdata/run => specs/run/config_types}/config_types/main.ts (100%) rename tests/{testdata/run => specs/run/config_types}/config_types/remote.tsconfig.json (100%) rename tests/{testdata/run => specs/run/config_types}/config_types/tsconfig.json (100%) create mode 100644 tests/specs/run/config_types/config_types/types.d.ts create mode 100644 tests/specs/run/config_types_remote/__test__.jsonc create mode 100644 tests/specs/run/config_types_remote/config_types/deno.lock rename tests/{testdata/run/reference_types.ts.out => specs/run/config_types_remote/config_types/main.out} (100%) create mode 100644 tests/specs/run/config_types_remote/config_types/main.ts create mode 100644 tests/specs/run/config_types_remote/config_types/remote.tsconfig.json create mode 100644 tests/specs/run/config_types_remote/config_types/tsconfig.json create mode 100644 tests/specs/run/config_types_remote/config_types/types.d.ts create mode 100644 tests/specs/run/custom_inspect_url/__test__.jsonc rename tests/{testdata/run => specs/run/custom_inspect_url}/custom_inspect_url.js (100%) rename tests/{testdata/run => specs/run/custom_inspect_url}/custom_inspect_url.js.out (100%) create mode 100644 tests/specs/run/decorators_tc39_proposal/__test__.jsonc rename tests/{testdata/run => specs/run/decorators_tc39_proposal}/decorators/experimental/deno.json (100%) rename tests/{testdata/run => specs/run/decorators_tc39_proposal}/decorators/experimental/no_check/main.out (100%) rename tests/{testdata/run => specs/run/decorators_tc39_proposal}/decorators/experimental/no_check/main.ts (100%) rename tests/{testdata/run => specs/run/decorators_tc39_proposal}/decorators/experimental/runtime/main.out (100%) rename tests/{testdata/run => specs/run/decorators_tc39_proposal}/decorators/experimental/runtime/main.ts (100%) rename tests/{testdata/run => specs/run/decorators_tc39_proposal}/decorators/experimental/ts/main.out (100%) rename tests/{testdata/run => specs/run/decorators_tc39_proposal}/decorators/experimental/ts/main.ts (100%) rename tests/{testdata/run => specs/run/decorators_tc39_proposal}/decorators/tc39_proposal/main.out (100%) rename tests/{testdata/run => specs/run/decorators_tc39_proposal}/decorators/tc39_proposal/main.ts (100%) create mode 100644 tests/specs/run/deno_exit_tampering/__test__.jsonc rename tests/{testdata/run => specs/run/deno_exit_tampering}/deno_exit_tampering.ts (100%) create mode 100644 tests/specs/run/deny_all_permission_args/__test__.jsonc rename tests/{testdata/run => specs/run/deny_all_permission_args}/deny_all_permission_args.js (100%) rename tests/{testdata/run => specs/run/deny_all_permission_args}/deny_all_permission_args.out (100%) create mode 100644 tests/specs/run/deny_some_permission_args/__test__.jsonc rename tests/{testdata/run => specs/run/deny_some_permission_args}/deny_some_permission_args.js (100%) rename tests/{testdata/run => specs/run/deny_some_permission_args}/deny_some_permission_args.out (100%) create mode 100644 tests/specs/run/dom_exception_formatting/__test__.jsonc rename tests/{testdata/run => specs/run/dom_exception_formatting}/dom_exception_formatting.ts (100%) rename tests/{testdata/run => specs/run/dom_exception_formatting}/dom_exception_formatting.ts.out (100%) create mode 100644 tests/specs/run/dynamic_import_already_rejected/__test__.jsonc rename tests/{testdata/run => specs/run/dynamic_import_already_rejected}/dynamic_import_already_rejected/error_001.ts (100%) rename tests/{testdata/run => specs/run/dynamic_import_already_rejected}/dynamic_import_already_rejected/main.out (100%) rename tests/{testdata/run => specs/run/dynamic_import_already_rejected}/dynamic_import_already_rejected/main.ts (100%) create mode 100644 tests/specs/run/dynamic_import_async_error/__test__.jsonc rename tests/{testdata/run => specs/run/dynamic_import_async_error}/dynamic_import_async_error/delayed_error.ts (100%) rename tests/{testdata/run => specs/run/dynamic_import_async_error}/dynamic_import_async_error/main.out (100%) rename tests/{testdata/run => specs/run/dynamic_import_async_error}/dynamic_import_async_error/main.ts (100%) create mode 100644 tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/__test__.jsonc rename tests/{testdata/run => specs/run/dynamic_import_concurrent_non_statically_analyzable}/dynamic_import_concurrent_non_statically_analyzable/main.out (100%) rename tests/{testdata/run => specs/run/dynamic_import_concurrent_non_statically_analyzable}/dynamic_import_concurrent_non_statically_analyzable/main.ts (100%) rename tests/{testdata/run => specs/run/dynamic_import_concurrent_non_statically_analyzable}/dynamic_import_concurrent_non_statically_analyzable/mod.ts (100%) create mode 100644 tests/specs/run/dynamic_import_conditional/__test__.jsonc rename tests/{testdata/run => specs/run/dynamic_import_conditional}/dynamic_import_conditional.js (100%) rename tests/{testdata/run => specs/run/dynamic_import_conditional}/dynamic_import_conditional.js.out (100%) create mode 100644 tests/specs/run/dynamic_import_permissions_blob_local/__test__.jsonc create mode 100644 tests/specs/run/dynamic_import_permissions_blob_local/permissions_blob_local.ts create mode 100644 tests/specs/run/dynamic_import_permissions_blob_local/permissions_blob_local.ts.out create mode 100644 tests/specs/run/dynamic_import_permissions_blob_remote/__test__.jsonc create mode 100644 tests/specs/run/dynamic_import_permissions_blob_remote/permissions_blob_remote.ts create mode 100644 tests/specs/run/dynamic_import_permissions_blob_remote/permissions_blob_remote.ts.out create mode 100644 tests/specs/run/dynamic_import_permissions_data_local/__test__.jsonc create mode 100644 tests/specs/run/dynamic_import_permissions_data_local/permissions_data_local.ts create mode 100644 tests/specs/run/dynamic_import_permissions_data_local/permissions_data_local.ts.out create mode 100644 tests/specs/run/dynamic_import_permissions_data_remote/__test__.jsonc create mode 100644 tests/specs/run/dynamic_import_permissions_data_remote/permissions_data_remote.ts create mode 100644 tests/specs/run/dynamic_import_permissions_data_remote/permissions_data_remote.ts.out create mode 100644 tests/specs/run/dynamic_import_permissions_remote_remote/__test__.jsonc create mode 100644 tests/specs/run/dynamic_import_permissions_remote_remote/permissions_remote_remote.ts create mode 100644 tests/specs/run/dynamic_import_permissions_remote_remote/permissions_remote_remote.ts.out create mode 100644 tests/specs/run/dynamic_import_permissions_remote_remote/static_remote.ts create mode 100644 tests/specs/run/dynamic_import_static_analysis_no_permissions/__test__.jsonc rename tests/{testdata/run/empty.ts => specs/run/dynamic_import_static_analysis_no_permissions/empty_1.ts} (100%) rename tests/{testdata/run/wasm_shared.out => specs/run/dynamic_import_static_analysis_no_permissions/empty_2.ts} (100%) create mode 100644 tests/specs/run/dynamic_import_static_analysis_no_permissions/static_analysis_no_permissions.ts create mode 100644 tests/specs/run/dynamic_import_static_analysis_no_permissions/static_analysis_no_permissions.ts.out create mode 100644 tests/specs/run/dynamic_import_syntax_error/__test__.jsonc rename tests/{testdata/run => specs/run/dynamic_import_syntax_error}/dynamic_import_syntax_error.js (100%) rename tests/{testdata/run => specs/run/dynamic_import_syntax_error}/dynamic_import_syntax_error.js.out (100%) create mode 100644 tests/specs/run/dynamic_import_syntax_error/dynamic_import_syntax_error_import.js create mode 100644 tests/specs/run/empty_typescript/__test__.jsonc rename tests/{testdata/run/worker_close_race.js.out => specs/run/empty_typescript/empty.ts} (100%) create mode 100644 tests/specs/run/error_001/__test__.jsonc create mode 100644 tests/specs/run/error_001/error_001.ts rename tests/{testdata/run => specs/run/error_001}/error_001.ts.out (100%) create mode 100644 tests/specs/run/error_002/__test__.jsonc create mode 100644 tests/specs/run/error_002/error_002.ts rename tests/{testdata/run => specs/run/error_002}/error_002.ts.out (78%) create mode 100644 tests/specs/run/error_002/mod1.ts create mode 100644 tests/specs/run/error_002/print_hello.ts create mode 100644 tests/specs/run/error_002/subdir2/mod2.ts create mode 100644 tests/specs/run/error_003_typescript/__test__.jsonc rename tests/{testdata/run => specs/run/error_003_typescript}/error_003_typescript.ts (100%) rename tests/{testdata/run => specs/run/error_003_typescript}/error_003_typescript.ts.out (100%) create mode 100644 tests/specs/run/error_003_typescript2/__test__.jsonc create mode 100644 tests/specs/run/error_003_typescript2/error_003_typescript.ts create mode 100644 tests/specs/run/error_003_typescript2/error_003_typescript.ts.out create mode 100644 tests/specs/run/error_004_missing_module/__test__.jsonc rename tests/{testdata/run => specs/run/error_004_missing_module}/error_004_missing_module.ts (100%) rename tests/{testdata/run => specs/run/error_004_missing_module}/error_004_missing_module.ts.out (100%) create mode 100644 tests/specs/run/error_005_missing_dynamic_import/__test__.jsonc rename tests/{testdata/run => specs/run/error_005_missing_dynamic_import}/error_005_missing_dynamic_import.ts (100%) rename tests/{testdata/run => specs/run/error_005_missing_dynamic_import}/error_005_missing_dynamic_import.ts.out (100%) create mode 100644 tests/specs/run/error_006_import_ext_failure/__test__.jsonc rename tests/{testdata/run => specs/run/error_006_import_ext_failure}/error_006_import_ext_failure.ts (100%) rename tests/{testdata/run => specs/run/error_006_import_ext_failure}/error_006_import_ext_failure.ts.out (100%) create mode 100644 tests/specs/run/error_007_any/__test__.jsonc rename tests/{testdata/run => specs/run/error_007_any}/error_007_any.ts (100%) rename tests/{testdata/run => specs/run/error_007_any}/error_007_any.ts.out (100%) create mode 100644 tests/specs/run/error_008_checkjs/__test__.jsonc rename tests/{testdata/run => specs/run/error_008_checkjs}/error_008_checkjs.js (100%) rename tests/{testdata/run => specs/run/error_008_checkjs}/error_008_checkjs.js.out (100%) create mode 100644 tests/specs/run/error_009_extensions_error/__test__.jsonc rename tests/{testdata/run => specs/run/error_009_extensions_error}/error_009_extensions_error.js (100%) rename tests/{testdata/run => specs/run/error_009_extensions_error}/error_009_extensions_error.js.out (100%) create mode 100644 tests/specs/run/error_011_bad_module_specifier/__test__.jsonc rename tests/{testdata/run => specs/run/error_011_bad_module_specifier}/error_011_bad_module_specifier.ts (100%) rename tests/{testdata/run => specs/run/error_011_bad_module_specifier}/error_011_bad_module_specifier.ts.out (100%) create mode 100644 tests/specs/run/error_012_bad_dynamic_import_specifier/__test__.jsonc rename tests/{testdata/run => specs/run/error_012_bad_dynamic_import_specifier}/error_012_bad_dynamic_import_specifier.ts (100%) rename tests/{testdata/run => specs/run/error_012_bad_dynamic_import_specifier}/error_012_bad_dynamic_import_specifier.ts.out (100%) create mode 100644 tests/specs/run/error_014_catch_dynamic_import_error/__test__.jsonc rename tests/{testdata/run => specs/run/error_014_catch_dynamic_import_error}/error_014_catch_dynamic_import_error.js (79%) rename tests/{testdata/run => specs/run/error_014_catch_dynamic_import_error}/error_014_catch_dynamic_import_error.js.out (83%) create mode 100644 tests/specs/run/error_014_catch_dynamic_import_error/indirect_import_error.js create mode 100644 tests/specs/run/error_014_catch_dynamic_import_error/indirect_throws.js create mode 100644 tests/specs/run/error_014_catch_dynamic_import_error/throws.js create mode 100644 tests/specs/run/error_015_dynamic_import_permissions/__test__.jsonc create mode 100644 tests/specs/run/error_015_dynamic_import_permissions/error_015_dynamic_import_permissions.js rename tests/{testdata/run => specs/run/error_015_dynamic_import_permissions}/error_015_dynamic_import_permissions.out (77%) create mode 100644 tests/specs/run/error_015_dynamic_import_permissions/mod4.js create mode 100644 tests/specs/run/error_017_hide_long_source_ts/__test__.jsonc rename tests/{testdata/run => specs/run/error_017_hide_long_source_ts}/error_017_hide_long_source_ts.ts (100%) rename tests/{testdata/run => specs/run/error_017_hide_long_source_ts}/error_017_hide_long_source_ts.ts.out (100%) create mode 100644 tests/specs/run/error_018_hide_long_source_js/__test__.jsonc rename tests/{testdata/run => specs/run/error_018_hide_long_source_js}/error_018_hide_long_source_js.js (100%) rename tests/{testdata/run => specs/run/error_018_hide_long_source_js}/error_018_hide_long_source_js.js.out (100%) create mode 100644 tests/specs/run/error_019_stack_function/__test__.jsonc rename tests/{testdata/run => specs/run/error_019_stack_function}/error_019_stack_function.ts (100%) rename tests/{testdata/run => specs/run/error_019_stack_function}/error_019_stack_function.ts.out (100%) create mode 100644 tests/specs/run/error_020_stack_constructor/__test__.jsonc rename tests/{testdata/run => specs/run/error_020_stack_constructor}/error_020_stack_constructor.ts (100%) rename tests/{testdata/run => specs/run/error_020_stack_constructor}/error_020_stack_constructor.ts.out (100%) create mode 100644 tests/specs/run/error_021_stack_method/__test__.jsonc rename tests/{testdata/run => specs/run/error_021_stack_method}/error_021_stack_method.ts (100%) rename tests/{testdata/run => specs/run/error_021_stack_method}/error_021_stack_method.ts.out (100%) create mode 100644 tests/specs/run/error_022_stack_custom_error/__test__.jsonc rename tests/{testdata/run => specs/run/error_022_stack_custom_error}/error_022_stack_custom_error.ts (100%) rename tests/{testdata/run => specs/run/error_022_stack_custom_error}/error_022_stack_custom_error.ts.out (100%) create mode 100644 tests/specs/run/error_023_stack_async/__test__.jsonc rename tests/{testdata/run => specs/run/error_023_stack_async}/error_023_stack_async.ts (100%) rename tests/{testdata/run => specs/run/error_023_stack_async}/error_023_stack_async.ts.out (100%) create mode 100644 tests/specs/run/error_024_stack_promise_all/__test__.jsonc rename tests/{testdata/run => specs/run/error_024_stack_promise_all}/error_024_stack_promise_all.ts (100%) rename tests/{testdata/run => specs/run/error_024_stack_promise_all}/error_024_stack_promise_all.ts.out (100%) create mode 100644 tests/specs/run/error_025_tab_indent/__test__.jsonc rename tests/{testdata/run => specs/run/error_025_tab_indent}/error_025_tab_indent (100%) rename tests/{testdata/run => specs/run/error_025_tab_indent}/error_025_tab_indent.out (100%) create mode 100644 tests/specs/run/error_cause/__test__.jsonc rename tests/{testdata/run => specs/run/error_cause}/error_cause.ts (100%) rename tests/{testdata/run => specs/run/error_cause}/error_cause.ts.out (100%) create mode 100644 tests/specs/run/error_cause_recursive/__test__.jsonc rename tests/{testdata/run => specs/run/error_cause_recursive}/error_cause_recursive.ts (100%) rename tests/{testdata/run => specs/run/error_cause_recursive}/error_cause_recursive.ts.out (100%) create mode 100644 tests/specs/run/error_cause_recursive_aggregate/__test__.jsonc rename tests/{testdata => specs/run/error_cause_recursive_aggregate}/error_cause_recursive_aggregate.ts (100%) rename tests/{testdata => specs/run/error_cause_recursive_aggregate}/error_cause_recursive_aggregate.ts.out (100%) create mode 100644 tests/specs/run/error_cause_recursive_tail/__test__.jsonc rename tests/{testdata => specs/run/error_cause_recursive_tail}/error_cause_recursive_tail.ts (100%) rename tests/{testdata => specs/run/error_cause_recursive_tail}/error_cause_recursive_tail.ts.out (100%) create mode 100644 tests/specs/run/error_for_await/__test__.jsonc rename tests/{testdata/run => specs/run/error_for_await}/error_for_await.ts (100%) rename tests/{testdata/run => specs/run/error_for_await}/error_for_await.ts.out (100%) create mode 100644 tests/specs/run/error_import_map_unable_to_load/__test__.jsonc rename tests/{testdata/run => specs/run/error_import_map_unable_to_load}/error_import_map_unable_to_load.out (100%) create mode 100644 tests/specs/run/error_import_map_unable_to_load/import_maps/test_data.ts create mode 100644 tests/specs/run/error_import_map_unable_to_load/import_maps/test_data.ts.out create mode 100644 tests/specs/run/error_missing_module_named_import/__test__.jsonc rename tests/{testdata/run => specs/run/error_missing_module_named_import}/error_missing_module_named_import.ts (100%) rename tests/{testdata/run => specs/run/error_missing_module_named_import}/error_missing_module_named_import.ts.out (100%) create mode 100644 tests/specs/run/error_name_non_string/__test__.jsonc rename tests/{testdata/run => specs/run/error_name_non_string}/error_name_non_string.js (100%) rename tests/{testdata/run => specs/run/error_name_non_string}/error_name_non_string.js.out (100%) create mode 100644 tests/specs/run/error_no_check/__test__.jsonc create mode 100644 tests/specs/run/error_no_check/error_no_check.ts create mode 100644 tests/specs/run/error_no_check/error_no_check.ts.out create mode 100644 tests/specs/run/error_no_check/type_and_code.ts create mode 100644 tests/specs/run/error_syntax/__test__.jsonc rename tests/{testdata/run => specs/run/error_syntax}/error_syntax.js (100%) rename tests/{testdata/run => specs/run/error_syntax}/error_syntax.js.out (100%) create mode 100644 tests/specs/run/error_syntax_empty_trailing_line/__test__.jsonc rename tests/{testdata/run => specs/run/error_syntax_empty_trailing_line}/error_syntax_empty_trailing_line.mjs (100%) rename tests/{testdata/run => specs/run/error_syntax_empty_trailing_line}/error_syntax_empty_trailing_line.mjs.out (100%) create mode 100644 tests/specs/run/error_type_definitions/__test__.jsonc create mode 100644 tests/specs/run/error_type_definitions/error_type_definitions.ts rename tests/{testdata/run => specs/run/error_type_definitions}/error_type_definitions.ts.out (100%) create mode 100644 tests/specs/run/error_type_definitions/type_definitions/bar.d.ts create mode 100644 tests/specs/run/error_type_definitions/type_definitions/bar.js create mode 100644 tests/specs/run/error_type_definitions/type_definitions/fizz.d.ts create mode 100644 tests/specs/run/error_type_definitions/type_definitions/fizz.js create mode 100644 tests/specs/run/error_type_definitions/type_definitions/foo.d.ts create mode 100644 tests/specs/run/error_type_definitions/type_definitions/foo.js create mode 100644 tests/specs/run/error_type_definitions/type_definitions/qat.ts create mode 100644 tests/specs/run/error_with_errors_prop/__test__.jsonc rename tests/{testdata/run => specs/run/error_with_errors_prop}/error_with_errors_prop.js (100%) rename tests/{testdata/run => specs/run/error_with_errors_prop}/error_with_errors_prop.js.out (100%) create mode 100644 tests/specs/run/es_private_fields/__test__.jsonc rename tests/{testdata/run => specs/run/es_private_fields}/es_private_fields.js (100%) rename tests/{testdata/run => specs/run/es_private_fields}/es_private_fields.js.out (100%) create mode 100644 tests/specs/run/eval_context_throw_dom_exception/__test__.jsonc rename tests/{testdata/run => specs/run/eval_context_throw_dom_exception}/eval_context_throw_dom_exception.js (100%) rename tests/{testdata/run => specs/run/eval_context_throw_dom_exception}/eval_context_throw_dom_exception.js.out (100%) create mode 100644 tests/specs/run/event_listener_error/__test__.jsonc rename tests/{testdata/run => specs/run/event_listener_error}/event_listener_error.ts (100%) rename tests/{testdata/run => specs/run/event_listener_error}/event_listener_error.ts.out (100%) create mode 100644 tests/specs/run/event_listener_error_handled/__test__.jsonc rename tests/{testdata/run => specs/run/event_listener_error_handled}/event_listener_error_handled.ts (100%) rename tests/{testdata/run => specs/run/event_listener_error_handled}/event_listener_error_handled.ts.out (100%) create mode 100644 tests/specs/run/event_listener_error_immediate_exit/__test__.jsonc rename tests/{testdata/run => specs/run/event_listener_error_immediate_exit}/event_listener_error_immediate_exit.ts (100%) rename tests/{testdata/run => specs/run/event_listener_error_immediate_exit}/event_listener_error_immediate_exit.ts.out (100%) create mode 100644 tests/specs/run/event_listener_error_immediate_exit_worker/__test__.jsonc create mode 100644 tests/specs/run/event_listener_error_immediate_exit_worker/event_listener_error_immediate_exit.ts rename tests/{testdata/run => specs/run/event_listener_error_immediate_exit_worker}/event_listener_error_immediate_exit_worker.ts (100%) rename tests/{testdata/run => specs/run/event_listener_error_immediate_exit_worker}/event_listener_error_immediate_exit_worker.ts.out (100%) create mode 100644 tests/specs/run/exit_error42/__test__.jsonc rename tests/{testdata/run => specs/run/exit_error42}/exit_error42.ts (100%) rename tests/{testdata/run => specs/run/exit_error42}/exit_error42.ts.out (100%) create mode 100644 tests/specs/run/explicit_resource_management/__test__.jsonc rename tests/{testdata/run => specs/run/explicit_resource_management}/explicit_resource_management/main.out (100%) rename tests/{testdata/run => specs/run/explicit_resource_management}/explicit_resource_management/main.ts (100%) create mode 100644 tests/specs/run/ext_flag_takes_precedence_over_extension/__test__.jsonc create mode 100644 tests/specs/run/ext_flag_takes_precedence_over_extension/ts_with_js_extension.js create mode 100644 tests/specs/run/ext_flag_takes_precedence_over_extension/ts_with_js_extension.out create mode 100644 tests/specs/run/fetch_async_error_stack/__test__.jsonc rename tests/{testdata/run => specs/run/fetch_async_error_stack}/fetch_async_error_stack.ts (100%) rename tests/{testdata/run => specs/run/fetch_async_error_stack}/fetch_async_error_stack.ts.out (100%) create mode 100644 tests/specs/run/fetch_response_finalization/__test__.jsonc rename tests/{testdata/run => specs/run/fetch_response_finalization}/fetch_response_finalization.js (100%) rename tests/{testdata/run => specs/run/fetch_response_finalization}/fetch_response_finalization.js.out (100%) create mode 100644 tests/specs/run/finalization_registry/__test__.jsonc rename tests/{testdata/run => specs/run/finalization_registry}/finalization_registry.js (100%) rename tests/{testdata/run => specs/run/finalization_registry}/finalization_registry.js.out (100%) create mode 100644 tests/specs/run/fix_dynamic_import_errors/__test__.jsonc create mode 100644 tests/specs/run/fix_dynamic_import_errors/b.js create mode 100644 tests/specs/run/fix_dynamic_import_errors/c.js rename tests/{testdata/run => specs/run/fix_dynamic_import_errors}/fix_dynamic_import_errors.js (52%) rename tests/{testdata/run => specs/run/fix_dynamic_import_errors}/fix_dynamic_import_errors.js.out (100%) create mode 100644 tests/specs/run/fix_emittable_skipped/__test__.jsonc create mode 100644 tests/specs/run/fix_emittable_skipped/emittable.d.ts create mode 100644 tests/specs/run/fix_emittable_skipped/fix_emittable_skipped.js rename tests/{testdata/run => specs/run/fix_emittable_skipped}/fix_emittable_skipped.ts.out (100%) create mode 100644 tests/specs/run/fix_emittable_skipped/polyfill.ts create mode 100644 tests/specs/run/fix_js_import_js/__test__.jsonc create mode 100644 tests/specs/run/fix_js_import_js/fix_js_import_js.ts rename tests/{testdata/run => specs/run/fix_js_import_js}/fix_js_import_js.ts.out (100%) create mode 100644 tests/specs/run/fix_js_import_js/mod4.js create mode 100644 tests/specs/run/fix_js_import_js/mod6.js create mode 100644 tests/specs/run/fix_js_imports/__test__.jsonc create mode 100644 tests/specs/run/fix_js_imports/amd_like.js create mode 100644 tests/specs/run/fix_js_imports/fix_js_imports.ts rename tests/{testdata/run => specs/run/fix_js_imports}/fix_js_imports.ts.out (100%) create mode 100644 tests/specs/run/fix_tsc_file_exists/__test__.jsonc rename tests/{testdata/run => specs/run/fix_tsc_file_exists}/fix_tsc_file_exists.out (100%) create mode 100644 tests/specs/run/fix_tsc_file_exists/tsc/a.js create mode 100644 tests/specs/run/fix_tsc_file_exists/tsc/d.ts create mode 100644 tests/specs/run/fix_tsc_file_exists/tsc/node_modules/b.js create mode 100644 tests/specs/run/fix_tsc_file_exists/tsc/node_modules/c.js create mode 100644 tests/specs/run/fix_tsc_file_exists/tsc/test.js create mode 100644 tests/specs/run/fix_worker_dispatchevent/__test__.jsonc rename tests/{testdata/run => specs/run/fix_worker_dispatchevent}/fix_worker_dispatchevent.ts (100%) rename tests/{testdata/run => specs/run/fix_worker_dispatchevent}/fix_worker_dispatchevent.ts.out (100%) create mode 100644 tests/specs/run/followup_dyn_import_resolved/__test__.jsonc rename tests/{testdata/run => specs/run/followup_dyn_import_resolved}/followup_dyn_import_resolves/main.ts (100%) rename tests/{testdata/run => specs/run/followup_dyn_import_resolved}/followup_dyn_import_resolves/main.ts.out (100%) create mode 100644 tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/sub1.ts create mode 100644 tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/sub2.ts create mode 100644 tests/specs/run/heapstats/__test__.jsonc rename tests/{testdata/run => specs/run/heapstats}/heapstats.js (100%) rename tests/{testdata/run => specs/run/heapstats}/heapstats.js.out (100%) create mode 100644 tests/specs/run/https_import/RootCA.pem create mode 100644 tests/specs/run/https_import/__test__.jsonc create mode 100644 tests/specs/run/https_import/https_import.ts rename tests/{testdata/run/import_data_url_imports.ts.out => specs/run/https_import/https_import.ts.out} (100%) create mode 100644 tests/specs/run/https_import/print_hello.ts create mode 100644 tests/specs/run/if_main/__test__.jsonc rename tests/{testdata/run => specs/run/if_main}/if_main.ts (100%) create mode 100644 tests/specs/run/if_main/if_main.ts.out create mode 100644 tests/specs/run/import_attributes_dynamic_error/__test__.jsonc create mode 100644 tests/specs/run/import_attributes_dynamic_error/data.json create mode 100644 tests/specs/run/import_attributes_dynamic_error/dynamic_error.out create mode 100644 tests/specs/run/import_attributes_dynamic_error/dynamic_error.ts create mode 100644 tests/specs/run/import_attributes_dynamic_import/__test__.jsonc create mode 100644 tests/specs/run/import_attributes_dynamic_import/data.json create mode 100644 tests/specs/run/import_attributes_dynamic_import/dynamic_import.out create mode 100644 tests/specs/run/import_attributes_dynamic_import/dynamic_import.ts create mode 100644 tests/specs/run/import_attributes_static_error/__test__.jsonc create mode 100644 tests/specs/run/import_attributes_static_error/data.json create mode 100644 tests/specs/run/import_attributes_static_error/static_error.out create mode 100644 tests/specs/run/import_attributes_static_error/static_error.ts create mode 100644 tests/specs/run/import_attributes_static_export/__test__.jsonc create mode 100644 tests/specs/run/import_attributes_static_export/data.json create mode 100644 tests/specs/run/import_attributes_static_export/static_export.out create mode 100644 tests/specs/run/import_attributes_static_export/static_export.ts create mode 100644 tests/specs/run/import_attributes_static_export/static_reexport.ts create mode 100644 tests/specs/run/import_attributes_static_import/__test__.jsonc create mode 100644 tests/specs/run/import_attributes_static_import/data.json create mode 100644 tests/specs/run/import_attributes_static_import/static_import.out create mode 100644 tests/specs/run/import_attributes_static_import/static_import.ts create mode 100644 tests/specs/run/import_attributes_type_check/__test__.jsonc create mode 100644 tests/specs/run/import_attributes_type_check/data.json create mode 100644 tests/specs/run/import_attributes_type_check/type_check.out create mode 100644 tests/specs/run/import_attributes_type_check/type_check.ts create mode 100644 tests/specs/run/import_blob_url/__test__.jsonc rename tests/{testdata/run => specs/run/import_blob_url}/import_blob_url.ts (100%) rename tests/{testdata/run => specs/run/import_blob_url}/import_blob_url.ts.out (100%) create mode 100644 tests/specs/run/import_blob_url_error_stack/__test__.jsonc rename tests/{testdata/run => specs/run/import_blob_url_error_stack}/import_blob_url_error_stack.ts (100%) rename tests/{testdata/run => specs/run/import_blob_url_error_stack}/import_blob_url_error_stack.ts.out (100%) create mode 100644 tests/specs/run/import_blob_url_import_relative/__test__.jsonc rename tests/{testdata/run => specs/run/import_blob_url_import_relative}/import_blob_url_import_relative.ts (100%) rename tests/{testdata/run => specs/run/import_blob_url_import_relative}/import_blob_url_import_relative.ts.out (100%) create mode 100644 tests/specs/run/import_blob_url_imports/__test__.jsonc rename tests/{testdata/run => specs/run/import_blob_url_imports}/import_blob_url_imports.ts (100%) rename tests/{testdata/run/import_extensionless.ts.out => specs/run/import_blob_url_imports/import_blob_url_imports.ts.out} (100%) create mode 100644 tests/specs/run/import_blob_url_jsx/__test__.jsonc rename tests/{testdata/run => specs/run/import_blob_url_jsx}/import_blob_url_jsx.ts (100%) rename tests/{testdata/run => specs/run/import_blob_url_jsx}/import_blob_url_jsx.ts.out (100%) create mode 100644 tests/specs/run/import_compression/__test__.jsonc create mode 100644 tests/specs/run/import_compression/import_compression/brotli create mode 100644 tests/specs/run/import_compression/import_compression/gziped rename tests/{testdata/run => specs/run/import_compression}/import_compression/main.out (100%) rename tests/{testdata/run => specs/run/import_compression}/import_compression/main.ts (100%) create mode 100644 tests/specs/run/import_data_url/__test__.jsonc rename tests/{testdata/run => specs/run/import_data_url}/import_data_url.ts (100%) rename tests/{testdata/run => specs/run/import_data_url}/import_data_url.ts.out (100%) create mode 100644 tests/specs/run/import_data_url_error_stack/__test__.jsonc rename tests/{testdata/run => specs/run/import_data_url_error_stack}/import_data_url_error_stack.ts (100%) rename tests/{testdata/run => specs/run/import_data_url_error_stack}/import_data_url_error_stack.ts.out (100%) create mode 100644 tests/specs/run/import_data_url_import_relative/__test__.jsonc rename tests/{testdata/run => specs/run/import_data_url_import_relative}/import_data_url_import_relative.ts (100%) rename tests/{testdata/run => specs/run/import_data_url_import_relative}/import_data_url_import_relative.ts.out (100%) create mode 100644 tests/specs/run/import_data_url_imports/__test__.jsonc rename tests/{testdata/run => specs/run/import_data_url_imports}/import_data_url_imports.ts (100%) rename tests/{testdata/run/issue13562.ts.out => specs/run/import_data_url_imports/import_data_url_imports.ts.out} (100%) create mode 100644 tests/specs/run/import_data_url_jsx/__test__.jsonc rename tests/{testdata/run => specs/run/import_data_url_jsx}/import_data_url_jsx.ts (100%) rename tests/{testdata/run => specs/run/import_data_url_jsx}/import_data_url_jsx.ts.out (100%) create mode 100644 tests/specs/run/import_dynamic_data_url/__test__.jsonc rename tests/{testdata/run => specs/run/import_dynamic_data_url}/import_dynamic_data_url.ts (100%) rename tests/{testdata/run => specs/run/import_dynamic_data_url}/import_dynamic_data_url.ts.out (100%) create mode 100644 tests/specs/run/import_extensionless/__test__.jsonc rename tests/{testdata/run => specs/run/import_extensionless}/import_extensionless.ts (100%) create mode 100644 tests/specs/run/import_extensionless/import_extensionless.ts.out create mode 100644 tests/specs/run/import_file_with_colon/__test__.jsonc rename tests/{testdata/run => specs/run/import_file_with_colon}/import_file_with_colon.ts (100%) rename tests/{testdata/run => specs/run/import_file_with_colon}/import_file_with_colon.ts.out (100%) create mode 100644 tests/specs/run/import_type/__test__.jsonc create mode 100644 tests/specs/run/import_type/export_types.ts create mode 100644 tests/specs/run/import_type/import_type.ts rename tests/{testdata/run => specs/run/import_type}/import_type.ts.out (100%) create mode 100644 tests/specs/run/import_type_no_check/__test__.jsonc create mode 100644 tests/specs/run/import_type_no_check/export_types.ts create mode 100644 tests/specs/run/import_type_no_check/import_type.ts create mode 100644 tests/specs/run/import_type_no_check/import_type.ts.out create mode 100644 tests/specs/run/inline_js_source_map_2/__test__.jsonc rename tests/{testdata/run => specs/run/inline_js_source_map_2}/inline_js_source_map_2.js (84%) rename tests/{testdata/run => specs/run/inline_js_source_map_2}/inline_js_source_map_2.js.out (100%) create mode 100644 tests/specs/run/inline_js_source_map_2_with_inline_contents/__test__.jsonc rename tests/{testdata/run => specs/run/inline_js_source_map_2_with_inline_contents}/inline_js_source_map_2_with_inline_contents.js (93%) rename tests/{testdata/run => specs/run/inline_js_source_map_2_with_inline_contents}/inline_js_source_map_2_with_inline_contents.js.out (100%) create mode 100644 tests/specs/run/inline_js_source_map_with_contents_from_graph/__test__.jsonc rename tests/{testdata/run => specs/run/inline_js_source_map_with_contents_from_graph}/inline_js_source_map_with_contents_from_graph.js (86%) rename tests/{testdata/run => specs/run/inline_js_source_map_with_contents_from_graph}/inline_js_source_map_with_contents_from_graph.js.out (100%) create mode 100644 tests/specs/run/issue_13562/__test__.jsonc create mode 100644 tests/specs/run/issue_13562/issue13562.ts create mode 100644 tests/specs/run/issue_13562/issue13562.ts.out create mode 100644 tests/specs/run/issue_13562/mod1.ts create mode 100644 tests/specs/run/issue_13562/print_hello.ts create mode 100644 tests/specs/run/issue_13562/subdir2/dynamic_import.ts create mode 100644 tests/specs/run/issue_13562/subdir2/mod2.ts create mode 100644 tests/specs/run/js_import_detect/__test__.jsonc rename tests/{testdata/run => specs/run/js_import_detect}/js_import_detect.ts (100%) rename tests/{testdata/run => specs/run/js_import_detect}/js_import_detect.ts.out (100%) create mode 100644 tests/specs/run/js_root_with_ts_check/__test__.jsonc rename tests/{testdata/run => specs/run/js_root_with_ts_check}/js_root_with_ts_check.js (100%) rename tests/{testdata/run => specs/run/js_root_with_ts_check}/js_root_with_ts_check.js.out (100%) create mode 100644 tests/specs/run/js_without_extension/__test__.jsonc create mode 100644 tests/specs/run/js_without_extension/js_without_extension create mode 100644 tests/specs/run/js_without_extension/js_without_extension.out create mode 100644 tests/specs/run/jsx_import_from_ts/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_from_ts/jsx_import_from_ts.App.jsx rename tests/{testdata/run => specs/run/jsx_import_from_ts}/jsx_import_from_ts.ts (100%) rename tests/{testdata/run => specs/run/jsx_import_from_ts}/jsx_import_from_ts.ts.out (100%) create mode 100644 tests/specs/run/jsx_import_source_error/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_error/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_error/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_error/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_error/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_error/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_error/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_error/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_error/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_error/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_error/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_error/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_error/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_error/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_error/jsx/jsx-runtime/index.ts rename tests/{testdata/run => specs/run/jsx_import_source_error}/jsx_import_source_error.out (100%) create mode 100644 tests/specs/run/jsx_import_source_error/jsx_import_source_no_pragma.tsx create mode 100644 tests/specs/run/jsx_import_source_import_map/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/jsx-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_import_map/jsx_import_source_import_map.out create mode 100644 tests/specs/run/jsx_import_source_import_map/jsx_import_source_no_pragma.tsx create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx_import_source_import_map_dev.out create mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx_import_source_no_pragma.tsx create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx_import_source_import_map.out create mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx_import_source_no_pragma.tsx create mode 100644 tests/specs/run/jsx_import_source_no_pragma/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-runtime/index.ts rename tests/{testdata/run => specs/run/jsx_import_source_no_pragma}/jsx_import_source.out (100%) create mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx_import_source_no_pragma.tsx create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-runtime/index.ts rename tests/{testdata/run => specs/run/jsx_import_source_no_pragma_dev}/jsx_import_source_dev.out (100%) create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx_import_source_no_pragma.tsx create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx_import_source.out create mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx_import_source_no_pragma.tsx create mode 100644 tests/specs/run/jsx_import_source_pragma/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/jsx-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma/jsx_import_source.out rename tests/{testdata/run => specs/run/jsx_import_source_pragma}/jsx_import_source_pragma.tsx (100%) create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx_import_source_import_map.out rename tests/{testdata/run => specs/run/jsx_import_source_pragma_import_map}/jsx_import_source_pragma_import_map.tsx (100%) create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx_import_source_import_map_dev.out create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx_import_source_pragma_import_map.tsx create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx_import_source_import_map.out create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx_import_source_pragma_import_map.tsx create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx_import_source.out create mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx_import_source_pragma.tsx create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx_import_source.out create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx_import_source_pragma.tsx create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx_import_source.out create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx_import_source_pragma.tsx create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/vendor/http_localhost_4545/jsx/#jsx-runtime_62ac8.js create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/vendor/manifest.json create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx_import_source.out create mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx_import_source_pragma.tsx create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx_import_source_dev.out create mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx_import_source_pragma.tsx create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-runtime/index.ts rename tests/{testdata/run => specs/run/jsx_import_source_precompile_import_map}/jsx_precompile/no_pragma.out (67%) rename tests/{testdata/run => specs/run/jsx_import_source_precompile_import_map}/jsx_precompile/no_pragma.tsx (100%) rename tests/{testdata/run => specs/run/jsx_import_source_precompile_import_map}/jsx_precompile/skip.out (100%) rename tests/{testdata/run => specs/run/jsx_import_source_precompile_import_map}/jsx_precompile/skip.tsx (100%) create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/__test__.jsonc create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-error.jsonc create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-precompile-skip.jsonc create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-precompile.jsonc create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx.json create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx.jsonc create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsxdev-import-map.jsonc create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsxdev.jsonc create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno.lock create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/import-map-scoped.json create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/import-map.json create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-dev-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-precompile/index.ts create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-runtime/index.ts create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/no_pragma.out create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/no_pragma.tsx create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/skip.out create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/skip.tsx create mode 100644 tests/specs/run/lock_check_ok/003_relative_import.ts create mode 100644 tests/specs/run/lock_check_ok/003_relative_import.ts.out create mode 100644 tests/specs/run/lock_check_ok/__test__.jsonc create mode 100644 tests/specs/run/lock_check_ok/lock_check_ok.json create mode 100644 tests/specs/run/lock_check_ok/print_hello.ts create mode 100644 tests/specs/run/lock_check_ok2/019_media_types.ts create mode 100644 tests/specs/run/lock_check_ok2/019_media_types.ts.out create mode 100644 tests/specs/run/lock_check_ok2/__test__.jsonc rename tests/{testdata/run => specs/run/lock_check_ok2}/lock_check_ok2.json (100%) create mode 100644 tests/specs/run/lock_v2_check_ok/003_relative_import.ts create mode 100644 tests/specs/run/lock_v2_check_ok/003_relative_import.ts.out create mode 100644 tests/specs/run/lock_v2_check_ok/__test__.jsonc create mode 100644 tests/specs/run/lock_v2_check_ok/lock_v2_check_ok.json create mode 100644 tests/specs/run/lock_v2_check_ok/print_hello.ts create mode 100644 tests/specs/run/lock_v2_check_ok2/019_media_types.ts create mode 100644 tests/specs/run/lock_v2_check_ok2/019_media_types.ts.out create mode 100644 tests/specs/run/lock_v2_check_ok2/__test__.jsonc rename tests/{testdata/run => specs/run/lock_v2_check_ok2}/lock_v2_check_ok2.json (100%) create mode 100644 tests/specs/run/long_data_url_formatting/__test__.jsonc rename tests/{testdata/run => specs/run/long_data_url_formatting}/long_data_url_formatting.ts (100%) rename tests/{testdata/run => specs/run/long_data_url_formatting}/long_data_url_formatting.ts.out (100%) create mode 100644 tests/specs/run/main_module/__test__.jsonc rename tests/{testdata/run => specs/run/main_module}/main_module/main.out (100%) rename tests/{testdata/run => specs/run/main_module}/main_module/main.ts (100%) rename tests/{testdata/run => specs/run/main_module}/main_module/other.ts (100%) create mode 100644 tests/specs/run/mts_dmts_mjs/__test__.jsonc create mode 100644 tests/specs/run/mts_dmts_mjs/import.mts create mode 100644 tests/specs/run/mts_dmts_mjs/mod.mjs rename tests/{testdata/run => specs/run/mts_dmts_mjs}/mts_dmts_mjs.out (100%) create mode 100644 tests/specs/run/mts_dmts_mjs/types.d.mts create mode 100644 tests/specs/run/mts_dmts_mjs_no_check/__test__.jsonc create mode 100644 tests/specs/run/mts_dmts_mjs_no_check/import.mts create mode 100644 tests/specs/run/mts_dmts_mjs_no_check/mod.mjs create mode 100644 tests/specs/run/mts_dmts_mjs_no_check/mts_dmts_mjs.out create mode 100644 tests/specs/run/mts_dmts_mjs_no_check/types.d.mts create mode 100644 tests/specs/run/nested_error/__test__.jsonc rename tests/{testdata/run => specs/run/nested_error}/nested_error/main.ts (100%) rename tests/{testdata/run => specs/run/nested_error}/nested_error/main.ts.out (100%) create mode 100644 tests/specs/run/no_check/006_url_imports.ts create mode 100644 tests/specs/run/no_check/006_url_imports.ts.out create mode 100644 tests/specs/run/no_check/__test__.jsonc create mode 100644 tests/specs/run/no_check/mod2.ts create mode 100644 tests/specs/run/no_check/print_hello.ts create mode 100644 tests/specs/run/no_check_decorators/__test__.jsonc create mode 100644 tests/specs/run/no_check_decorators/decorators/experimental/deno.json create mode 100644 tests/specs/run/no_check_decorators/decorators/experimental/no_check/main.out create mode 100644 tests/specs/run/no_check_decorators/decorators/experimental/no_check/main.ts create mode 100644 tests/specs/run/no_check_decorators/decorators/experimental/runtime/main.out create mode 100644 tests/specs/run/no_check_decorators/decorators/experimental/runtime/main.ts create mode 100644 tests/specs/run/no_check_decorators/decorators/experimental/ts/main.out create mode 100644 tests/specs/run/no_check_decorators/decorators/experimental/ts/main.ts create mode 100644 tests/specs/run/no_check_decorators/decorators/tc39_proposal/main.out create mode 100644 tests/specs/run/no_check_decorators/decorators/tc39_proposal/main.ts create mode 100644 tests/specs/run/no_config_auto_discovery_for_local_script/__test__.jsonc create mode 100644 tests/specs/run/no_config_auto_discovery_for_local_script/frontend_work.ts rename tests/{testdata/run/with_config => specs/run/no_config_auto_discovery_for_local_script}/no_auto_discovery.out (78%) create mode 100644 tests/specs/run/no_lock_flag/__test__.jsonc rename tests/{testdata/run => specs/run/no_lock_flag}/no_lock_flag/deno.json (100%) rename tests/{testdata/run => specs/run/no_lock_flag}/no_lock_flag/deno.lock (100%) rename tests/{testdata/run => specs/run/no_lock_flag}/no_lock_flag/main.out (100%) rename tests/{testdata/run => specs/run/no_lock_flag}/no_lock_flag/main.ts (100%) create mode 100644 tests/specs/run/no_prompt_flag/__test__.jsonc create mode 100644 tests/specs/run/no_prompt_flag/no_prompt.ts create mode 100644 tests/specs/run/node_env_var_allowlist/__test__.jsonc rename tests/{testdata/run => specs/run/node_env_var_allowlist}/node_env_var_allowlist.ts (100%) rename tests/{testdata/run => specs/run/node_env_var_allowlist}/node_env_var_allowlist.ts.out (100%) create mode 100644 tests/specs/run/onload/__test__.jsonc create mode 100644 tests/specs/run/onload/deno.json rename tests/{testdata/run => specs/run/onload}/onload/imported.ts (100%) rename tests/{testdata/run => specs/run/onload}/onload/main.out (100%) rename tests/{testdata/run => specs/run/onload}/onload/main.ts (100%) rename tests/{testdata/run => specs/run/onload}/onload/nest_imported.ts (100%) create mode 100644 tests/specs/run/op_exit_op_set_exit_code_in_worker/__test__.jsonc rename tests/{testdata/run => specs/run/op_exit_op_set_exit_code_in_worker}/op_exit_op_set_exit_code_in_worker.ts (100%) create mode 100644 tests/specs/run/op_exit_op_set_exit_code_in_worker/op_exit_op_set_exit_code_worker.js create mode 100644 tests/specs/run/package_json_auto_discovered_for_local_script_arg_with_stop/__test__.jsonc create mode 100644 tests/specs/run/package_json_auto_discovered_for_local_script_arg_with_stop/deno.json create mode 100644 tests/specs/run/package_json_auto_discovered_for_local_script_arg_with_stop/main.out create mode 100644 tests/specs/run/package_json_auto_discovered_for_local_script_arg_with_stop/main.ts create mode 100644 tests/specs/run/permission_args/001_hello.js create mode 100644 tests/specs/run/permission_args/__test__.jsonc rename tests/{testdata/run => specs/run/permission_args}/permission_args.out (100%) create mode 100644 tests/specs/run/permission_args_quiet/001_hello.js create mode 100644 tests/specs/run/permission_args_quiet/001_hello.js.out create mode 100644 tests/specs/run/permission_args_quiet/__test__.jsonc create mode 100644 tests/specs/run/private_field_presence/__test__.jsonc rename tests/{testdata/run => specs/run/private_field_presence}/private_field_presence.ts (100%) rename tests/{testdata/run => specs/run/private_field_presence}/private_field_presence.ts.out (100%) create mode 100644 tests/specs/run/private_field_presence_no_check/__test__.jsonc create mode 100644 tests/specs/run/private_field_presence_no_check/private_field_presence.ts create mode 100644 tests/specs/run/private_field_presence_no_check/private_field_presence.ts.out create mode 100644 tests/specs/run/proto_exploit/__test__.jsonc rename tests/{testdata/run => specs/run/proto_exploit}/proto_exploit.js (100%) rename tests/{testdata/run => specs/run/proto_exploit}/proto_exploit.js.out (100%) create mode 100644 tests/specs/run/queue_microtask_error/__test__.jsonc rename tests/{testdata/run => specs/run/queue_microtask_error}/queue_microtask_error.ts (100%) rename tests/{testdata/run => specs/run/queue_microtask_error}/queue_microtask_error.ts.out (100%) create mode 100644 tests/specs/run/queue_microtask_error_handled/__test__.jsonc rename tests/{testdata/run => specs/run/queue_microtask_error_handled}/queue_microtask_error_handled.ts (100%) rename tests/{testdata/run => specs/run/queue_microtask_error_handled}/queue_microtask_error_handled.ts.out (100%) create mode 100644 tests/specs/run/reference_types/__test__.jsonc rename tests/{testdata/run => specs/run/reference_types}/reference_types.ts (100%) rename tests/{testdata/run/reference_types_remote.ts.out => specs/run/reference_types/reference_types.ts.out} (100%) create mode 100644 tests/specs/run/reference_types_error/__test__.jsonc create mode 100644 tests/specs/run/reference_types_error/checkjs.tsconfig.json rename tests/{testdata/run => specs/run/reference_types_error}/reference_types_error.js (100%) rename tests/{testdata/run => specs/run/reference_types_error}/reference_types_error.js.out (100%) create mode 100644 tests/specs/run/reference_types_error_no_check/__test__.jsonc create mode 100644 tests/specs/run/reference_types_error_no_check/reference_types_error.js create mode 100644 tests/specs/run/reference_types_error_vendor_dir/__test__.jsonc create mode 100644 tests/specs/run/reference_types_error_vendor_dir/checkjs.tsconfig.json create mode 100644 tests/specs/run/reference_types_error_vendor_dir/reference_types_error.js create mode 100644 tests/specs/run/reference_types_error_vendor_dir/reference_types_error.js.out create mode 100644 tests/specs/run/references_types_remote/__test__.jsonc rename tests/{testdata/run => specs/run/references_types_remote}/reference_types_remote.ts (100%) create mode 100644 tests/specs/run/references_types_remote/reference_types_remote.ts.out create mode 100644 tests/specs/run/rejection_handled/__test__.jsonc rename tests/{testdata/run => specs/run/rejection_handled}/rejection_handled.out (100%) rename tests/{testdata/run => specs/run/rejection_handled}/rejection_handled.ts (100%) create mode 100644 tests/specs/run/replace_self/__test__.jsonc rename tests/{testdata/run => specs/run/replace_self}/replace_self.js (100%) rename tests/{testdata/run => specs/run/replace_self}/replace_self.js.out (100%) create mode 100644 tests/specs/run/report_error/__test__.jsonc rename tests/{testdata/run => specs/run/report_error}/report_error.ts (100%) rename tests/{testdata/run => specs/run/report_error}/report_error.ts.out (100%) create mode 100644 tests/specs/run/report_error_end_of_program/__test__.jsonc rename tests/{testdata/run => specs/run/report_error_end_of_program}/report_error_end_of_program.ts (100%) rename tests/{testdata/run => specs/run/report_error_end_of_program}/report_error_end_of_program.ts.out (100%) create mode 100644 tests/specs/run/report_error_handled/__test__.jsonc rename tests/{testdata/run => specs/run/report_error_handled}/report_error_handled.ts (100%) rename tests/{testdata/run => specs/run/report_error_handled}/report_error_handled.ts.out (100%) create mode 100644 tests/specs/run/runtime_decorators/__test__.jsonc create mode 100644 tests/specs/run/runtime_decorators/decorators/experimental/deno.json create mode 100644 tests/specs/run/runtime_decorators/decorators/experimental/no_check/main.out create mode 100644 tests/specs/run/runtime_decorators/decorators/experimental/no_check/main.ts create mode 100644 tests/specs/run/runtime_decorators/decorators/experimental/runtime/main.out create mode 100644 tests/specs/run/runtime_decorators/decorators/experimental/runtime/main.ts create mode 100644 tests/specs/run/runtime_decorators/decorators/experimental/ts/main.out create mode 100644 tests/specs/run/runtime_decorators/decorators/experimental/ts/main.ts create mode 100644 tests/specs/run/runtime_decorators/decorators/tc39_proposal/main.out create mode 100644 tests/specs/run/runtime_decorators/decorators/tc39_proposal/main.ts create mode 100644 tests/specs/run/seed_random/__test__.jsonc rename tests/{testdata/run => specs/run/seed_random}/seed_random.js (100%) rename tests/{testdata/run => specs/run/seed_random}/seed_random.js.out (100%) create mode 100644 tests/specs/run/set_exit_code_0/__test__.jsonc rename tests/{testdata/run => specs/run/set_exit_code_0}/set_exit_code_0.ts (100%) create mode 100644 tests/specs/run/set_exit_code_1/__test__.jsonc rename tests/{testdata/run => specs/run/set_exit_code_1}/set_exit_code_1.ts (100%) create mode 100644 tests/specs/run/set_exit_code_2/__test__.jsonc rename tests/{testdata/run => specs/run/set_exit_code_2}/set_exit_code_2.ts (100%) create mode 100644 tests/specs/run/set_timeout_error/__test__.jsonc rename tests/{testdata/run => specs/run/set_timeout_error}/set_timeout_error.ts (100%) rename tests/{testdata/run => specs/run/set_timeout_error}/set_timeout_error.ts.out (100%) create mode 100644 tests/specs/run/set_timeout_error_handled/__test__.jsonc rename tests/{testdata/run => specs/run/set_timeout_error_handled}/set_timeout_error_handled.ts (100%) rename tests/{testdata/run => specs/run/set_timeout_error_handled}/set_timeout_error_handled.ts.out (100%) create mode 100644 tests/specs/run/shebang_swc/__test__.jsonc rename tests/{testdata/run => specs/run/shebang_swc}/shebang.ts (100%) rename tests/{testdata/run => specs/run/shebang_swc}/shebang.ts.out (100%) create mode 100644 tests/specs/run/shebang_swc/shebang2.ts create mode 100644 tests/specs/run/shebang_tsc/__test__.jsonc create mode 100644 tests/specs/run/shebang_tsc/shebang.ts rename tests/{testdata/run/wasm.ts.out => specs/run/shebang_tsc/shebang.ts.out} (100%) create mode 100644 tests/specs/run/shebang_tsc/shebang2.ts create mode 100644 tests/specs/run/shebang_with_json_imports_swc/__test__.jsonc create mode 100644 tests/specs/run/shebang_with_json_imports_swc/json_with_shebang.json create mode 100644 tests/specs/run/shebang_with_json_imports_swc/json_with_shebang.ts create mode 100644 tests/specs/run/shebang_with_json_imports_swc/json_with_shebang.ts.out create mode 100644 tests/specs/run/shebang_with_json_imports_tsc/__test__.jsonc create mode 100644 tests/specs/run/shebang_with_json_imports_tsc/json_with_shebang.json create mode 100644 tests/specs/run/shebang_with_json_imports_tsc/json_with_shebang.ts create mode 100644 tests/specs/run/shebang_with_json_imports_tsc/json_with_shebang.ts.out create mode 100644 tests/specs/run/single_compile_with_reload/__test__.jsonc create mode 100644 tests/specs/run/single_compile_with_reload/mod1.ts create mode 100644 tests/specs/run/single_compile_with_reload/print_hello.ts rename tests/{testdata/run => specs/run/single_compile_with_reload}/single_compile_with_reload.ts (100%) rename tests/{testdata/run => specs/run/single_compile_with_reload}/single_compile_with_reload.ts.out (100%) create mode 100644 tests/specs/run/single_compile_with_reload/single_compile_with_reload_dyn.ts create mode 100644 tests/specs/run/single_compile_with_reload/single_compile_with_reload_worker.ts create mode 100644 tests/specs/run/single_compile_with_reload/subdir2/dynamic_import.ts create mode 100644 tests/specs/run/single_compile_with_reload/subdir2/mod2.ts create mode 100644 tests/specs/run/spawn_stdout_inherit/__test__.jsonc rename tests/{testdata/run => specs/run/spawn_stdout_inherit}/spawn_stdout_inherit.ts (100%) rename tests/{testdata/run => specs/run/spawn_stdout_inherit}/spawn_stdout_inherit.ts.out (100%) create mode 100644 tests/specs/run/stdin_read_all/__test__.jsonc rename tests/{testdata/run => specs/run/stdin_read_all}/stdin_read_all.out (100%) rename tests/{testdata/run => specs/run/stdin_read_all}/stdin_read_all.ts (100%) create mode 100644 tests/specs/run/stdout_write_all/__test__.jsonc rename tests/{testdata/run => specs/run/stdout_write_all}/stdout_write_all.out (100%) rename tests/{testdata/run => specs/run/stdout_write_all}/stdout_write_all.ts (100%) create mode 100644 tests/specs/run/stdout_write_sync_async/__test__.jsonc rename tests/{testdata/run => specs/run/stdout_write_sync_async}/stdout_write_sync_async.out (100%) rename tests/{testdata/run => specs/run/stdout_write_sync_async}/stdout_write_sync_async.ts (100%) create mode 100644 tests/specs/run/swc_syntax_error/__test__.jsonc rename tests/{testdata/run => specs/run/swc_syntax_error}/swc_syntax_error.ts (100%) rename tests/{testdata/run => specs/run/swc_syntax_error}/swc_syntax_error.ts.out (100%) create mode 100644 tests/specs/run/test_and_bench_are_noops_in_run/__test__.jsonc rename tests/{testdata/run => specs/run/test_and_bench_are_noops_in_run}/test_and_bench_in_run.js (100%) create mode 100644 tests/specs/run/tls_connecttls/RootCA.pem create mode 100644 tests/specs/run/tls_connecttls/__test__.jsonc create mode 100644 tests/specs/run/tls_connecttls/deno.json create mode 100644 tests/specs/run/tls_connecttls/localhost.crt create mode 100644 tests/specs/run/tls_connecttls/localhost.key create mode 100644 tests/specs/run/tls_connecttls/textproto.ts rename tests/{testdata/run => specs/run/tls_connecttls}/tls.out (100%) rename tests/{testdata/run => specs/run/tls_connecttls}/tls_connecttls.js (94%) create mode 100644 tests/specs/run/tls_starttls/RootCA.pem create mode 100644 tests/specs/run/tls_starttls/__test__.jsonc create mode 100644 tests/specs/run/tls_starttls/deno.json create mode 100644 tests/specs/run/tls_starttls/localhost.crt create mode 100644 tests/specs/run/tls_starttls/localhost.key create mode 100644 tests/specs/run/tls_starttls/textproto.ts create mode 100644 tests/specs/run/tls_starttls/tls.out rename tests/{testdata/run => specs/run/tls_starttls}/tls_starttls.js (94%) create mode 100644 tests/specs/run/top_level_await/__test__.jsonc create mode 100644 tests/specs/run/top_level_await/hello.txt rename tests/{testdata/run => specs/run/top_level_await}/top_level_await/circular.js (100%) rename tests/{testdata/run => specs/run/top_level_await}/top_level_await/circular.out (100%) create mode 100644 tests/specs/run/top_level_await/top_level_await/loop.js rename tests/{testdata/run => specs/run/top_level_await}/top_level_await/loop.out (100%) rename tests/{testdata/run => specs/run/top_level_await}/top_level_await/nested.out (100%) rename tests/{testdata/run => specs/run/top_level_await}/top_level_await/nested/a.js (100%) rename tests/{testdata/run => specs/run/top_level_await}/top_level_await/nested/b.js (100%) rename tests/{testdata/run => specs/run/top_level_await}/top_level_await/nested/main.js (100%) rename tests/{testdata/run => specs/run/top_level_await}/top_level_await/order.js (100%) rename tests/{testdata/run => specs/run/top_level_await}/top_level_await/order.out (100%) create mode 100644 tests/specs/run/top_level_await/top_level_await/tla/a.js create mode 100644 tests/specs/run/top_level_await/top_level_await/tla/b.js create mode 100644 tests/specs/run/top_level_await/top_level_await/tla/c.js create mode 100644 tests/specs/run/top_level_await/top_level_await/tla/d.js create mode 100644 tests/specs/run/top_level_await/top_level_await/tla/order.js create mode 100644 tests/specs/run/top_level_await/top_level_await/tla/parent.js create mode 100644 tests/specs/run/top_level_await/top_level_await/tla2/a.js create mode 100644 tests/specs/run/top_level_await/top_level_await/tla2/b.js create mode 100644 tests/specs/run/top_level_await/top_level_await/tla3/b.js create mode 100644 tests/specs/run/top_level_await/top_level_await/tla3/timeout_loop.js create mode 100644 tests/specs/run/top_level_await/top_level_await/top_level_await.js rename tests/{testdata/run => specs/run/top_level_await}/top_level_await/top_level_await.out (100%) rename tests/{testdata/run => specs/run/top_level_await}/top_level_await/top_level_await.ts (100%) rename tests/{testdata/run => specs/run/top_level_await}/top_level_await/top_level_for_await.js (100%) rename tests/{testdata/run => specs/run/top_level_await}/top_level_await/top_level_for_await.out (100%) rename tests/{testdata/run => specs/run/top_level_await}/top_level_await/top_level_for_await.ts (100%) rename tests/{testdata/run => specs/run/top_level_await}/top_level_await/unresolved.js (100%) rename tests/{testdata/run => specs/run/top_level_await}/top_level_await/unresolved.out (100%) create mode 100644 tests/specs/run/top_level_await_circular/__test__.jsonc create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/circular.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/circular.out create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/loop.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/loop.out create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/nested.out create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/nested/a.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/nested/b.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/nested/main.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/order.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/order.out create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla/a.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla/b.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla/c.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla/d.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla/order.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla/parent.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla2/a.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla2/b.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla3/b.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla3/timeout_loop.js rename tests/{testdata/run => specs/run/top_level_await_circular}/top_level_await/top_level_await.js (100%) create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/top_level_await.out create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/top_level_await.ts create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.out create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.ts create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/unresolved.js create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/unresolved.out create mode 100644 tests/specs/run/top_level_await_loop/__test__.jsonc create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/circular.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/circular.out create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/loop.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/loop.out create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/nested.out create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/nested/a.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/nested/b.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/nested/main.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/order.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/order.out create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla/a.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla/b.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla/c.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla/d.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla/order.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla/parent.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla2/a.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla2/b.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla3/b.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla3/timeout_loop.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/top_level_await.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/top_level_await.out create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/top_level_await.ts create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.out create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.ts create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/unresolved.js create mode 100644 tests/specs/run/top_level_await_loop/top_level_await/unresolved.out create mode 100644 tests/specs/run/top_level_await_nested/__test__.jsonc create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/circular.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/circular.out rename tests/{testdata/run => specs/run/top_level_await_nested}/top_level_await/loop.js (100%) create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/loop.out create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/nested.out create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/nested/a.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/nested/b.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/nested/main.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/order.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/order.out create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla/a.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla/b.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla/c.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla/d.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla/order.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla/parent.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla2/a.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla2/b.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla3/b.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla3/timeout_loop.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/top_level_await.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/top_level_await.out create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/top_level_await.ts create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.out create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.ts create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/unresolved.js create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/unresolved.out create mode 100644 tests/specs/run/top_level_await_order/__test__.jsonc create mode 100644 tests/specs/run/top_level_await_order/top_level_await/circular.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/circular.out create mode 100644 tests/specs/run/top_level_await_order/top_level_await/loop.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/loop.out create mode 100644 tests/specs/run/top_level_await_order/top_level_await/nested.out create mode 100644 tests/specs/run/top_level_await_order/top_level_await/nested/a.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/nested/b.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/nested/main.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/order.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/order.out create mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla/a.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla/b.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla/c.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla/d.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla/order.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla/parent.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla2/a.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla2/b.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla3/b.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla3/timeout_loop.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/top_level_await.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/top_level_await.out create mode 100644 tests/specs/run/top_level_await_order/top_level_await/top_level_await.ts create mode 100644 tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.out create mode 100644 tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.ts create mode 100644 tests/specs/run/top_level_await_order/top_level_await/unresolved.js create mode 100644 tests/specs/run/top_level_await_order/top_level_await/unresolved.out create mode 100644 tests/specs/run/top_level_await_ts/__test__.jsonc create mode 100644 tests/specs/run/top_level_await_ts/hello.txt create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/circular.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/circular.out create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/loop.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/loop.out create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/nested.out create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/nested/a.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/nested/b.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/nested/main.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/order.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/order.out create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla/a.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla/b.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla/c.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla/d.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla/order.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla/parent.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla2/a.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla2/b.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla3/b.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla3/timeout_loop.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/top_level_await.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/top_level_await.out create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/top_level_await.ts create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.out create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.ts create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/unresolved.js create mode 100644 tests/specs/run/top_level_await_ts/top_level_await/unresolved.out create mode 100644 tests/specs/run/top_level_await_unresolved/__test__.jsonc create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/circular.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/circular.out create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/loop.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/loop.out create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/nested.out create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/nested/a.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/nested/b.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/nested/main.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/order.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/order.out create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla/a.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla/b.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla/c.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla/d.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla/order.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla/parent.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla2/a.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla2/b.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla3/b.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla3/timeout_loop.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.out create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.ts create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.out create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.ts create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/unresolved.js create mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/unresolved.out create mode 100644 tests/specs/run/top_level_for_await/__test__.jsonc create mode 100644 tests/specs/run/top_level_for_await/top_level_await/circular.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/circular.out create mode 100644 tests/specs/run/top_level_for_await/top_level_await/loop.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/loop.out create mode 100644 tests/specs/run/top_level_for_await/top_level_await/nested.out create mode 100644 tests/specs/run/top_level_for_await/top_level_await/nested/a.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/nested/b.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/nested/main.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/order.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/order.out create mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla/a.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla/b.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla/c.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla/d.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla/order.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla/parent.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla2/a.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla2/b.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla3/b.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla3/timeout_loop.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/top_level_await.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/top_level_await.out create mode 100644 tests/specs/run/top_level_for_await/top_level_await/top_level_await.ts create mode 100644 tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.out create mode 100644 tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.ts create mode 100644 tests/specs/run/top_level_for_await/top_level_await/unresolved.js create mode 100644 tests/specs/run/top_level_for_await/top_level_await/unresolved.out create mode 100644 tests/specs/run/top_level_for_await_ts/__test__.jsonc create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/circular.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/circular.out create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/loop.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/loop.out create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/nested.out create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/nested/a.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/nested/b.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/nested/main.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/order.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/order.out create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla/a.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla/b.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla/c.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla/d.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla/order.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla/parent.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla2/a.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla2/b.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla3/b.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla3/timeout_loop.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.out create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.ts create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.out create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.ts create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/unresolved.js create mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/unresolved.out create mode 100644 tests/specs/run/ts_decorators/__test__.jsonc create mode 100644 tests/specs/run/ts_decorators/decorators/experimental/deno.json create mode 100644 tests/specs/run/ts_decorators/decorators/experimental/no_check/main.out create mode 100644 tests/specs/run/ts_decorators/decorators/experimental/no_check/main.ts create mode 100644 tests/specs/run/ts_decorators/decorators/experimental/runtime/main.out create mode 100644 tests/specs/run/ts_decorators/decorators/experimental/runtime/main.ts create mode 100644 tests/specs/run/ts_decorators/decorators/experimental/ts/main.out create mode 100644 tests/specs/run/ts_decorators/decorators/experimental/ts/main.ts create mode 100644 tests/specs/run/ts_decorators/decorators/tc39_proposal/main.out create mode 100644 tests/specs/run/ts_decorators/decorators/tc39_proposal/main.ts create mode 100644 tests/specs/run/ts_import_from_js/005_more_imports.ts create mode 100644 tests/specs/run/ts_import_from_js/__test__.jsonc create mode 100644 tests/specs/run/ts_import_from_js/mod1.ts create mode 100644 tests/specs/run/ts_import_from_js/mod2.ts create mode 100644 tests/specs/run/ts_import_from_js/print_hello.ts create mode 100644 tests/specs/run/ts_import_from_js/subdir2/dynamic_import.ts create mode 100644 tests/specs/run/ts_import_from_js/subdir2/mod2.ts rename tests/{testdata/run => specs/run/ts_import_from_js}/ts_import_from_js/deps.js (100%) rename tests/{testdata/run => specs/run/ts_import_from_js}/ts_import_from_js/main.js (100%) rename tests/{testdata/run => specs/run/ts_import_from_js}/ts_import_from_js/main.out (100%) create mode 100644 tests/specs/run/ts_type_imports/__test__.jsonc rename tests/{testdata/run => specs/run/ts_type_imports}/ts_type_imports.ts (100%) rename tests/{testdata/run => specs/run/ts_type_imports}/ts_type_imports.ts.out (100%) create mode 100644 tests/specs/run/ts_type_imports/ts_type_imports_foo.ts create mode 100644 tests/specs/run/ts_type_only_import/__test__.jsonc create mode 100644 tests/specs/run/ts_type_only_import/ts_type_only_import.d.ts rename tests/{testdata/run => specs/run/ts_type_only_import}/ts_type_only_import.ts (100%) rename tests/{testdata/run => specs/run/ts_type_only_import}/ts_type_only_import.ts.out (100%) create mode 100644 tests/specs/run/ts_without_extension/__test__.jsonc create mode 100644 tests/specs/run/ts_without_extension/ts_without_extension create mode 100644 tests/specs/run/ts_without_extension/ts_without_extension.out create mode 100644 tests/specs/run/tsx_imports/046_jsx_test.tsx create mode 100644 tests/specs/run/tsx_imports/__test__.jsonc rename tests/{testdata/run => specs/run/tsx_imports}/tsx_imports/Component.tsx (100%) rename tests/{testdata/run => specs/run/tsx_imports}/tsx_imports/tsx_imports.ts (100%) rename tests/{testdata/run => specs/run/tsx_imports}/tsx_imports/tsx_imports.ts.out (100%) create mode 100644 tests/specs/run/type_definitions/__test__.jsonc rename tests/{testdata/run => specs/run/type_definitions}/type_definitions.ts (56%) rename tests/{testdata/run => specs/run/type_definitions}/type_definitions.ts.out (100%) create mode 100644 tests/specs/run/type_definitions/type_definitions/bar.d.ts create mode 100644 tests/specs/run/type_definitions/type_definitions/bar.js create mode 100644 tests/specs/run/type_definitions/type_definitions/fizz.d.ts create mode 100644 tests/specs/run/type_definitions/type_definitions/fizz.js create mode 100644 tests/specs/run/type_definitions/type_definitions/foo.d.ts create mode 100644 tests/specs/run/type_definitions/type_definitions/foo.js create mode 100644 tests/specs/run/type_definitions/type_definitions/qat.ts create mode 100644 tests/specs/run/type_definitions_for_export/__test__.jsonc create mode 100644 tests/specs/run/type_definitions_for_export/export_type_def.ts create mode 100644 tests/specs/run/type_definitions_for_export/type_definitions/bar.d.ts create mode 100644 tests/specs/run/type_definitions_for_export/type_definitions/bar.js create mode 100644 tests/specs/run/type_definitions_for_export/type_definitions/fizz.d.ts create mode 100644 tests/specs/run/type_definitions_for_export/type_definitions/fizz.js create mode 100644 tests/specs/run/type_definitions_for_export/type_definitions/foo.d.ts create mode 100644 tests/specs/run/type_definitions_for_export/type_definitions/foo.js create mode 100644 tests/specs/run/type_definitions_for_export/type_definitions/qat.ts rename tests/{testdata/run => specs/run/type_definitions_for_export}/type_definitions_for_export.ts (100%) rename tests/{testdata/run => specs/run/type_definitions_for_export}/type_definitions_for_export.ts.out (100%) create mode 100644 tests/specs/run/type_directives_01/__test__.jsonc rename tests/{testdata/run => specs/run/type_directives_01}/type_directives_01.ts (100%) rename tests/{testdata/run => specs/run/type_directives_01}/type_directives_01.ts.out (100%) create mode 100644 tests/specs/run/type_directives_02/__test__.jsonc create mode 100644 tests/specs/run/type_directives_02/type_directives_02.ts create mode 100644 tests/specs/run/type_directives_02/type_directives_02.ts.out create mode 100644 tests/specs/run/type_directives_02/type_reference.d.ts create mode 100644 tests/specs/run/type_directives_02/type_reference.js create mode 100644 tests/specs/run/type_headers_deno_types/__test__.jsonc rename tests/{testdata/run => specs/run/type_headers_deno_types}/type_headers_deno_types.ts (100%) rename tests/{testdata/run => specs/run/type_headers_deno_types}/type_headers_deno_types.ts.out (100%) create mode 100644 tests/specs/run/unbuffered_stderr/__test__.jsonc rename tests/{testdata/run => specs/run/unbuffered_stderr}/unbuffered_stderr.ts (100%) rename tests/{testdata/run => specs/run/unbuffered_stderr}/unbuffered_stderr.ts.out (100%) create mode 100644 tests/specs/run/unbuffered_stdout/__test__.jsonc rename tests/{testdata/run => specs/run/unbuffered_stdout}/unbuffered_stdout.ts (100%) rename tests/{testdata/run => specs/run/unbuffered_stdout}/unbuffered_stdout.ts.out (100%) create mode 100644 tests/specs/run/unhandled_rejection/__test__.jsonc rename tests/{testdata/run => specs/run/unhandled_rejection}/unhandled_rejection.ts (100%) create mode 100644 tests/specs/run/unhandled_rejection/unhandled_rejection.ts.out create mode 100644 tests/specs/run/unhandled_rejection_dynamic_import/__test__.jsonc rename tests/{testdata/run => specs/run/unhandled_rejection_dynamic_import}/unhandled_rejection_dynamic_import/import.ts (100%) rename tests/{testdata/run => specs/run/unhandled_rejection_dynamic_import}/unhandled_rejection_dynamic_import/main.ts (100%) rename tests/{testdata/run => specs/run/unhandled_rejection_dynamic_import}/unhandled_rejection_dynamic_import/main.ts.out (100%) create mode 100644 tests/specs/run/unhandled_rejection_dynamic_import2/__test__.jsonc rename tests/{testdata/run => specs/run/unhandled_rejection_dynamic_import2}/unhandled_rejection_dynamic_import2/import.ts (100%) rename tests/{testdata/run => specs/run/unhandled_rejection_dynamic_import2}/unhandled_rejection_dynamic_import2/main.ts (100%) rename tests/{testdata/run => specs/run/unhandled_rejection_dynamic_import2}/unhandled_rejection_dynamic_import2/main.ts.out (100%) create mode 100644 tests/specs/run/unhandled_rejection_sync_error/__test__.jsonc rename tests/{testdata/run => specs/run/unhandled_rejection_sync_error}/unhandled_rejection_sync_error.ts (100%) create mode 100644 tests/specs/run/unhandled_rejection_sync_error/unhandled_rejection_sync_error.ts.out create mode 100644 tests/specs/run/unsafe_proto/__test__.jsonc rename tests/{testdata/run => specs/run/unsafe_proto}/unsafe_proto/main.js (100%) rename tests/{testdata/run => specs/run/unsafe_proto}/unsafe_proto/main.out (100%) rename tests/{testdata/run => specs/run/unsafe_proto}/unsafe_proto/main_with_unsafe_proto_flag.out (100%) rename tests/{testdata/run => specs/run/unsafe_proto}/unsafe_proto/worker.js (100%) create mode 100644 tests/specs/run/unsafe_proto_flag/__test__.jsonc create mode 100644 tests/specs/run/unsafe_proto_flag/unsafe_proto/main.js create mode 100644 tests/specs/run/unsafe_proto_flag/unsafe_proto/main.out create mode 100644 tests/specs/run/unsafe_proto_flag/unsafe_proto/main_with_unsafe_proto_flag.out create mode 100644 tests/specs/run/unsafe_proto_flag/unsafe_proto/worker.js create mode 100644 tests/specs/run/unstable_broadcast_channel_disabled/__test__.jsonc rename tests/{testdata/run => specs/run/unstable_broadcast_channel_disabled}/unstable_broadcast_channel.disabled.out (100%) rename tests/{testdata/run => specs/run/unstable_broadcast_channel_disabled}/unstable_broadcast_channel.js (100%) create mode 100644 tests/specs/run/unstable_broadcast_channel_enabled/__test__.jsonc rename tests/{testdata/run => specs/run/unstable_broadcast_channel_enabled}/unstable_broadcast_channel.enabled.out (100%) create mode 100644 tests/specs/run/unstable_broadcast_channel_enabled/unstable_broadcast_channel.js create mode 100644 tests/specs/run/unstable_cron_disabled/__test__.jsonc rename tests/{testdata/run => specs/run/unstable_cron_disabled}/unstable_cron.disabled.out (100%) rename tests/{testdata/run => specs/run/unstable_cron_disabled}/unstable_cron.js (100%) create mode 100644 tests/specs/run/unstable_cron_enabled/__test__.jsonc rename tests/{testdata/run => specs/run/unstable_cron_enabled}/unstable_cron.enabled.out (100%) create mode 100644 tests/specs/run/unstable_cron_enabled/unstable_cron.js create mode 100644 tests/specs/run/unstable_kv_disabled/__test__.jsonc rename tests/{testdata/run => specs/run/unstable_kv_disabled}/unstable_kv.disabled.out (100%) rename tests/{testdata/run => specs/run/unstable_kv_disabled}/unstable_kv.js (100%) create mode 100644 tests/specs/run/unstable_kv_enabled/__test__.jsonc rename tests/{testdata/run => specs/run/unstable_kv_enabled}/unstable_kv.enabled.out (100%) create mode 100644 tests/specs/run/unstable_kv_enabled/unstable_kv.js create mode 100644 tests/specs/run/unstable_net_disabled/__test__.jsonc rename tests/{testdata/run => specs/run/unstable_net_disabled}/unstable_net.disabled.out (100%) rename tests/{testdata/run => specs/run/unstable_net_disabled}/unstable_net.js (100%) create mode 100644 tests/specs/run/unstable_net_enabled/__test__.jsonc rename tests/{testdata/run => specs/run/unstable_net_enabled}/unstable_net.enabled.out (100%) create mode 100644 tests/specs/run/unstable_net_enabled/unstable_net.js create mode 100644 tests/specs/run/unstable_worker/__test__.jsonc rename tests/{testdata/run => specs/run/unstable_worker}/unstable_worker.ts (62%) rename tests/{testdata/run => specs/run/unstable_worker}/unstable_worker.ts.out (100%) create mode 100644 tests/specs/run/unstable_worker/worker_unstable.ts create mode 100644 tests/specs/run/unstable_worker_options_disabled/__test__.jsonc rename tests/{testdata/run => specs/run/unstable_worker_options_disabled}/unstable_worker_options.disabled.out (100%) rename tests/{testdata/run => specs/run/unstable_worker_options_disabled}/unstable_worker_options.js (100%) create mode 100644 tests/specs/run/unstable_worker_options_enabled/__test__.jsonc rename tests/{testdata/run => specs/run/unstable_worker_options_enabled}/unstable_worker_options.enabled.out (100%) create mode 100644 tests/specs/run/unstable_worker_options_enabled/unstable_worker_options.js create mode 100644 tests/specs/run/unsupported_dynamic_import_scheme/__test__.jsonc rename tests/{testdata/run => specs/run/unsupported_dynamic_import_scheme}/unsupported_dynamic_import_scheme.out (100%) create mode 100644 tests/specs/run/v8_flags_env_run/__test__.jsonc rename tests/{testdata/run => specs/run/v8_flags_env_run}/v8_flags.js (100%) rename tests/{testdata/run => specs/run/v8_flags_env_run}/v8_flags.js.out (100%) create mode 100644 tests/specs/run/v8_flags_run/__test__.jsonc create mode 100644 tests/specs/run/v8_flags_run/v8_flags.js create mode 100644 tests/specs/run/v8_flags_run/v8_flags.js.out create mode 100644 tests/specs/run/v8_flags_unrecognized/__test__.jsonc rename tests/{testdata/run => specs/run/v8_flags_unrecognized}/v8_flags_unrecognized.out (100%) create mode 100644 tests/specs/run/v8_help/__test__.jsonc rename tests/{testdata/run => specs/run/v8_help}/v8_help.out (100%) create mode 100644 tests/specs/run/wasm/__test__.jsonc rename tests/{testdata/run => specs/run/wasm}/wasm.ts (100%) create mode 100644 tests/specs/run/wasm/wasm.ts.out create mode 100644 tests/specs/run/wasm_async/__test__.jsonc rename tests/{testdata/run => specs/run/wasm_async}/wasm_async.js (100%) rename tests/{testdata/run => specs/run/wasm_async}/wasm_async.out (100%) create mode 100644 tests/specs/run/wasm_shared/__test__.jsonc create mode 100644 tests/specs/run/wasm_shared/wasm_shared.out rename tests/{testdata/run => specs/run/wasm_shared}/wasm_shared.ts (100%) create mode 100644 tests/specs/run/wasm_streaming_panic_test/__test__.jsonc rename tests/{testdata/run => specs/run/wasm_streaming_panic_test}/wasm_streaming_panic_test.js (100%) rename tests/{testdata/run => specs/run/wasm_streaming_panic_test}/wasm_streaming_panic_test.js.out (100%) create mode 100644 tests/specs/run/wasm_unreachable/__test__.jsonc create mode 100644 tests/specs/run/wasm_unreachable/unreachable.wasm rename tests/{testdata/run => specs/run/wasm_unreachable}/wasm_unreachable.js (82%) rename tests/{testdata/run => specs/run/wasm_unreachable}/wasm_unreachable.out (100%) create mode 100644 tests/specs/run/wasm_url/__test__.jsonc rename tests/{testdata/run => specs/run/wasm_url}/wasm_url.js (100%) rename tests/{testdata/run => specs/run/wasm_url}/wasm_url.out (100%) create mode 100644 tests/specs/run/weakref/__test__.jsonc rename tests/{testdata/run => specs/run/weakref}/weakref.ts (100%) rename tests/{testdata/run => specs/run/weakref}/weakref.ts.out (100%) create mode 100644 tests/specs/run/webstorage_serialization/__test__.jsonc create mode 100644 tests/specs/run/webstorage_serialization/webstorage/config_a.jsonc create mode 100644 tests/specs/run/webstorage_serialization/webstorage/config_b.jsonc create mode 100644 tests/specs/run/webstorage_serialization/webstorage/fixture.ts create mode 100644 tests/specs/run/webstorage_serialization/webstorage/logger.ts rename tests/{testdata/run => specs/run/webstorage_serialization}/webstorage/serialization.ts (100%) rename tests/{testdata/run => specs/run/webstorage_serialization}/webstorage/serialization.ts.out (100%) create mode 100644 tests/specs/run/webstorage_serialization/webstorage/setter.ts create mode 100644 tests/specs/run/worker_close_in_wasm_reactions/__test__.jsonc create mode 100644 tests/specs/run/worker_close_in_wasm_reactions/close_in_wasm_reactions.js rename tests/{testdata/run => specs/run/worker_close_in_wasm_reactions}/worker_close_in_wasm_reactions.js (80%) rename tests/{testdata/run => specs/run/worker_close_in_wasm_reactions}/worker_close_in_wasm_reactions.js.out (100%) create mode 100644 tests/specs/run/worker_close_nested/__test__.jsonc create mode 100644 tests/specs/run/worker_close_nested/close_nested_child.js create mode 100644 tests/specs/run/worker_close_nested/close_nested_parent.js rename tests/{testdata/run => specs/run/worker_close_nested}/worker_close_nested.js (89%) rename tests/{testdata/run => specs/run/worker_close_nested}/worker_close_nested.js.out (100%) create mode 100644 tests/specs/run/worker_close_race/__test__.jsonc create mode 100644 tests/specs/run/worker_close_race/close_race_worker.js rename tests/{testdata/run => specs/run/worker_close_race}/worker_close_race.js (85%) create mode 100644 tests/specs/run/worker_close_race/worker_close_race.js.out create mode 100644 tests/specs/run/worker_drop_handle_race/__test__.jsonc create mode 100644 tests/specs/run/worker_drop_handle_race/drop_handle_race.js rename tests/{testdata/run => specs/run/worker_drop_handle_race}/worker_drop_handle_race.js (88%) rename tests/{testdata/run => specs/run/worker_drop_handle_race}/worker_drop_handle_race.js.out (79%) create mode 100644 tests/specs/run/worker_drop_handle_race_terminate/__test__.jsonc rename tests/{testdata/run => specs/run/worker_drop_handle_race_terminate}/worker_drop_handle_race_terminate.js (100%) rename tests/{testdata/run => specs/run/worker_drop_handle_race_terminate}/worker_drop_handle_race_terminate.js.out (100%) create mode 100644 tests/specs/run/worker_event_handler_test/__test__.jsonc rename tests/{testdata/run => specs/run/worker_event_handler_test}/worker_event_handler_test.js (51%) rename tests/{testdata/run => specs/run/worker_event_handler_test}/worker_event_handler_test.js.out (100%) create mode 100644 tests/specs/run/worker_event_handler_test/worker_event_handlers.js create mode 100644 tests/specs/run/worker_message_before_close/__test__.jsonc create mode 100644 tests/specs/run/worker_message_before_close/message_before_close.js rename tests/{testdata/run => specs/run/worker_message_before_close}/worker_message_before_close.js (89%) rename tests/{testdata/run => specs/run/worker_message_before_close}/worker_message_before_close.js.out (100%) delete mode 100644 tests/testdata/run/014_duplicate_import.ts delete mode 100644 tests/testdata/run/020_json_modules.ts delete mode 100644 tests/testdata/run/021_mjs_modules.ts delete mode 100644 tests/testdata/run/035_cached_only_flag.out delete mode 100644 tests/testdata/run/044_bad_resource.ts delete mode 100644 tests/testdata/run/config_json_import.ts delete mode 100644 tests/testdata/run/error_002.ts delete mode 100644 tests/testdata/run/error_015_dynamic_import_permissions.js delete mode 100644 tests/testdata/run/error_no_check.ts delete mode 100644 tests/testdata/run/error_no_check.ts.out delete mode 100644 tests/testdata/run/error_type_definitions.ts delete mode 100644 tests/testdata/run/fix_emittable_skipped.js delete mode 100644 tests/testdata/run/fix_js_import_js.ts delete mode 100644 tests/testdata/run/fix_js_imports.ts delete mode 100644 tests/testdata/run/import_type.ts delete mode 100644 tests/testdata/run/issue13562.ts delete mode 100644 tests/testdata/run/lock_check_ok.json delete mode 100644 tests/testdata/run/lock_v2_check_ok.json delete mode 100644 tests/testdata/run/type_directives_02.ts delete mode 100644 tests/testdata/run/type_directives_02.ts.out delete mode 100644 tests/testdata/run/unhandled_rejection.ts.out delete mode 100644 tests/testdata/run/unhandled_rejection_sync_error.ts.out delete mode 100644 tests/testdata/run/with_package_json/with_stop/main.out diff --git a/.dprint.json b/.dprint.json index 489a61e571..3b2376f786 100644 --- a/.dprint.json +++ b/.dprint.json @@ -65,7 +65,11 @@ "tests/wpt/runner/expectation.json", "tests/wpt/runner/manifest.json", "tests/wpt/suite", - "third_party" + "third_party", + "tests/specs/run/shebang_with_json_imports_tsc", + "tests/specs/run/shebang_with_json_imports_swc", + "tests/specs/run/ext_flag_takes_precedence_over_extension", + "tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs" ], "plugins": [ "https://plugins.dprint.dev/typescript-0.93.2.wasm", diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs index a07dd56c83..686fbabcf6 100644 --- a/tests/integration/run_tests.rs +++ b/tests/integration/run_tests.rs @@ -24,272 +24,12 @@ use trust_dns_client::serialize::txt::Lexer; use trust_dns_client::serialize::txt::Parser; use util::assert_contains; use util::assert_not_contains; -use util::env_vars_for_npm_tests; use util::PathRef; use util::TestContext; use util::TestContextBuilder; const CODE_CACHE_DB_FILE_NAME: &str = "v8_code_cache_v2"; -itest!(stdout_write_all { - args: "run --quiet run/stdout_write_all.ts", - output: "run/stdout_write_all.out", -}); - -itest!(stdin_read_all { - args: "run --quiet run/stdin_read_all.ts", - output: "run/stdin_read_all.out", - input: Some("01234567890123456789012345678901234567890123456789"), -}); - -itest!(stdout_write_sync_async { - args: "run --quiet run/stdout_write_sync_async.ts", - output: "run/stdout_write_sync_async.out", -}); - -itest!(_001_hello { - args: "run --reload run/001_hello.js", - output: "run/001_hello.js.out", -}); - -itest!(_002_hello { - args: "run --quiet --reload run/002_hello.ts", - output: "run/002_hello.ts.out", -}); - -itest!(_003_relative_import { - args: "run --quiet --reload run/003_relative_import.ts", - output: "run/003_relative_import.ts.out", -}); - -itest!(_004_set_timeout { - args: "run --quiet --reload run/004_set_timeout.ts", - output: "run/004_set_timeout.ts.out", -}); - -itest!(_005_more_imports { - args: "run --quiet --reload run/005_more_imports.ts", - output: "run/005_more_imports.ts.out", -}); - -itest!(_006_url_imports { - args: "run --quiet --reload --allow-import run/006_url_imports.ts", - output: "run/006_url_imports.ts.out", - http_server: true, -}); - -itest!(_012_async { - args: "run --quiet --reload run/012_async.ts", - output: "run/012_async.ts.out", -}); - -itest!(_013_dynamic_import { - args: "run --quiet --reload --allow-read run/013_dynamic_import.ts", - output: "run/013_dynamic_import.ts.out", -}); - -itest!(_014_duplicate_import { - args: "run --quiet --reload --allow-read run/014_duplicate_import.ts ", - output: "run/014_duplicate_import.ts.out", -}); - -itest!(_015_duplicate_parallel_import { - args: - "run --quiet --reload --allow-read run/015_duplicate_parallel_import.js", - output: "run/015_duplicate_parallel_import.js.out", -}); - -itest!(_016_double_await { - args: "run --quiet --allow-read --reload run/016_double_await.ts", - output: "run/016_double_await.ts.out", -}); - -itest!(_017_import_redirect { - args: "run --quiet --allow-import --reload run/017_import_redirect.ts", - output: "run/017_import_redirect.ts.out", -}); - -itest!(_017_import_redirect_check { - args: - "run --quiet --allow-import --reload --check run/017_import_redirect.ts", - output: "run/017_import_redirect.ts.out", -}); - -itest!(_017_import_redirect_vendor_dir { - args: - "run --quiet --allow-import --reload --vendor --check $TESTDATA/run/017_import_redirect.ts", - output: "run/017_import_redirect.ts.out", - temp_cwd: true, -}); - -itest!(_017_import_redirect_info { - args: "info --quiet --allow-import --reload run/017_import_redirect.ts", - output: "run/017_import_redirect_info.out", -}); - -itest!(_018_async_catch { - args: "run --quiet --reload run/018_async_catch.ts", - output: "run/018_async_catch.ts.out", -}); - -itest!(_019_media_types { - args: "run --reload --allow-import run/019_media_types.ts", - output: "run/019_media_types.ts.out", - http_server: true, -}); - -itest!(_020_json_modules { - args: "run --reload run/020_json_modules.ts", - output: "run/020_json_modules.ts.out", - exit_code: 1, -}); - -itest!(_021_mjs_modules { - args: "run --quiet --reload run/021_mjs_modules.ts", - output: "run/021_mjs_modules.ts.out", -}); - -itest!(_025_reload_js_type_error { - args: "run --quiet --reload run/025_reload_js_type_error.js", - output: "run/025_reload_js_type_error.js.out", -}); - -itest!(_027_redirect_typescript { - args: "run --quiet --reload --allow-import run/027_redirect_typescript.ts", - output: "run/027_redirect_typescript.ts.out", - http_server: true, -}); - -itest!(_027_redirect_typescript_vendor_dir { - args: - "run --quiet --reload --vendor --allow-import $TESTDATA/run/027_redirect_typescript.ts", - output: "run/027_redirect_typescript.ts.out", - http_server: true, - temp_cwd: true, -}); - -itest!(_028_args { - args: - "run --quiet --reload run/028_args.ts --arg1 val1 --arg2=val2 -- arg3 arg4", - output: "run/028_args.ts.out", -}); - -itest!(_033_import_map_remote { - args: - "run --quiet --reload --allow-import --import-map=http://127.0.0.1:4545/import_maps/import_map_remote.json import_maps/test_remote.ts", - output: "run/033_import_map_remote.out", - http_server: true, -}); - -itest!(_033_import_map_vendor_dir_remote { - args: - "run --quiet --reload --allow-import --import-map=http://127.0.0.1:4545/import_maps/import_map_remote.json --vendor $TESTDATA/import_maps/test_remote.ts", - output: "run/033_import_map_remote.out", - http_server: true, - temp_cwd: true, -}); - -itest!(_033_import_map_data_uri { - args: - "run --quiet --reload --allow-import --import-map=data:application/json;charset=utf-8;base64,ewogICJpbXBvcnRzIjogewogICAgInRlc3Rfc2VydmVyLyI6ICJodHRwOi8vbG9jYWxob3N0OjQ1NDUvIgogIH0KfQ== run/import_maps/test_data.ts", - output: "run/import_maps/test_data.ts.out", - http_server: true, -}); - -itest!(onload { - args: "run --quiet --reload --config ../config/deno.json run/onload/main.ts", - output: "run/onload/main.out", -}); - -itest!(_035_cached_only_flag { - args: "run --reload --check --allow-import --cached-only http://127.0.0.1:4545/run/019_media_types.ts", - output: "run/035_cached_only_flag.out", - exit_code: 1, - http_server: true, -}); - -itest!(_038_checkjs { - // checking if JS file is run through TS compiler - args: - "run --reload --config run/checkjs.tsconfig.json --check run/038_checkjs.js", - exit_code: 1, - output: "run/038_checkjs.js.out", -}); - -itest!(_042_dyn_import_evalcontext { - args: "run --quiet --allow-read --reload run/042_dyn_import_evalcontext.ts", - output: "run/042_dyn_import_evalcontext.ts.out", -}); - -itest!(_044_bad_resource { - args: "run --quiet --reload --allow-read run/044_bad_resource.ts", - output: "run/044_bad_resource.ts.out", - exit_code: 1, -}); - -itest!(_046_tsx { - args: "run --quiet --reload run/046_jsx_test.tsx", - output: "run/046_jsx_test.tsx.out", -}); - -itest!(_047_jsx { - args: "run --quiet --reload run/047_jsx_test.jsx", - output: "run/047_jsx_test.jsx.out", -}); - -itest!(_048_media_types_jsx { - args: "run --reload --allow-import run/048_media_types_jsx.ts", - output: "run/048_media_types_jsx.ts.out", - http_server: true, -}); - -itest!(_052_no_remote_flag { - args: - "run --reload --check --allow-import --no-remote http://127.0.0.1:4545/run/019_media_types.ts", - output: "run/052_no_remote_flag.out", - exit_code: 1, - http_server: true, -}); - -itest!(_058_tasks_microtasks_close { - args: "run --quiet run/058_tasks_microtasks_close.ts", - output: "run/058_tasks_microtasks_close.ts.out", -}); - -itest!(_059_fs_relative_path_perm { - args: "run run/059_fs_relative_path_perm.ts", - output: "run/059_fs_relative_path_perm.ts.out", - exit_code: 1, -}); - -itest!(_070_location { - args: "run --location https://foo/bar?baz#bat run/070_location.ts", - output: "run/070_location.ts.out", -}); - -itest!(_071_location_unset { - args: "run run/071_location_unset.ts", - output: "run/071_location_unset.ts.out", -}); - -itest!(_072_location_relative_fetch { - args: "run --location http://127.0.0.1:4545/ --allow-net run/072_location_relative_fetch.ts", - output: "run/072_location_relative_fetch.ts.out", - http_server: true, -}); - -// tests the beforeunload event -itest!(beforeunload_event { - args: "run run/before_unload.js", - output: "run/before_unload.js.out", -}); - -// tests the serialization of webstorage (both localStorage and sessionStorage) -itest!(webstorage_serialization { - args: "run run/webstorage/serialization.ts", - output: "run/webstorage/serialization.ts.out", -}); - // tests to ensure that when `--location` is set, all code shares the same // localStorage cache based on the origin of the location URL. #[test] @@ -394,41 +134,6 @@ fn webstorage_main_module() { .assert_matches_text("Storage { hello: \"deno\", length: 1 }\n"); } -itest!(_075_import_local_query_hash { - args: "run run/075_import_local_query_hash.ts", - output: "run/075_import_local_query_hash.ts.out", -}); - -itest!(_077_fetch_empty { - args: "run -A run/077_fetch_empty.ts", - output: "run/077_fetch_empty.ts.out", - exit_code: 1, -}); - -itest!(_078_unload_on_exit { - args: "run run/078_unload_on_exit.ts", - output: "run/078_unload_on_exit.ts.out", - exit_code: 1, -}); - -itest!(_079_location_authentication { - args: - "run --location https://foo:bar@baz/qux run/079_location_authentication.ts", - output: "run/079_location_authentication.ts.out", -}); - -itest!(_081_location_relative_fetch_redirect { - args: "run --location http://127.0.0.1:4546/ --allow-net run/081_location_relative_fetch_redirect.ts", - output: "run/081_location_relative_fetch_redirect.ts.out", - http_server: true, - }); - -itest!(_082_prepare_stack_trace_throw { - args: "run run/082_prepare_stack_trace_throw.js", - output: "run/082_prepare_stack_trace_throw.js.out", - exit_code: 1, -}); - #[test] fn _083_legacy_external_source_map() { let _g = util::http_server(); @@ -457,27 +162,6 @@ fn _083_legacy_external_source_map() { assert_eq!(out, ""); } -itest!(dynamic_import_async_error { - args: "run --allow-read run/dynamic_import_async_error/main.ts", - output: "run/dynamic_import_async_error/main.out", -}); - -itest!(dynamic_import_already_rejected { - args: "run --allow-read run/dynamic_import_already_rejected/main.ts", - output: "run/dynamic_import_already_rejected/main.out", -}); - -itest!(dynamic_import_concurrent_non_statically_analyzable { - args: "run --allow-import --allow-read --allow-net --quiet run/dynamic_import_concurrent_non_statically_analyzable/main.ts", - output: "run/dynamic_import_concurrent_non_statically_analyzable/main.out", - http_server: true, -}); - -itest!(_088_dynamic_import_already_evaluating { - args: "run --allow-read run/088_dynamic_import_already_evaluating.ts", - output: "run/088_dynamic_import_already_evaluating.ts.out", -}); - itest!(_089_run_allow_list { args: "run --allow-run=curl run/089_run_allow_list.ts", envs: vec![ @@ -713,16 +397,6 @@ fn permission_request_long() { }); } -itest!(deny_all_permission_args { - args: "run --deny-env --deny-read --deny-write --deny-ffi --deny-run --deny-sys --deny-net run/deny_all_permission_args.js", - output: "run/deny_all_permission_args.out", -}); - -itest!(deny_some_permission_args { - args: "run --allow-env --deny-env=FOO --allow-read --deny-read=/foo --allow-write --deny-write=/foo --allow-ffi --deny-ffi=/foo --allow-run --deny-run=foo --allow-sys --deny-sys=hostname --allow-net --deny-net=127.0.0.1 run/deny_some_permission_args.js", - output: "run/deny_some_permission_args.out", -}); - #[test] fn permissions_cache() { TestContext::default() @@ -755,52 +429,6 @@ itest!(env_file_missing { output: "run/env_file_missing.out", }); -itest!(_091_use_define_for_class_fields { - args: "run --check run/091_use_define_for_class_fields.ts", - output: "run/091_use_define_for_class_fields.ts.out", - exit_code: 1, -}); - -itest!(js_import_detect { - args: "run --quiet --reload run/js_import_detect.ts", - output: "run/js_import_detect.ts.out", - exit_code: 0, -}); - -itest!(blob_gc_finalization { - args: "run run/blob_gc_finalization.js", - output: "run/blob_gc_finalization.js.out", - exit_code: 0, -}); - -itest!(fetch_response_finalization { - args: - "run --v8-flags=--expose-gc --allow-net run/fetch_response_finalization.js", - output: "run/fetch_response_finalization.js.out", - http_server: true, - exit_code: 0, -}); - -itest!(import_type { - args: "run --reload run/import_type.ts", - output: "run/import_type.ts.out", -}); - -itest!(import_type_no_check { - args: "run --reload --no-check run/import_type.ts", - output: "run/import_type.ts.out", -}); - -itest!(private_field_presence { - args: "run --reload run/private_field_presence.ts", - output: "run/private_field_presence.ts.out", -}); - -itest!(private_field_presence_no_check { - args: "run --reload --no-check run/private_field_presence.ts", - output: "run/private_field_presence.ts.out", -}); - itest!(lock_write_fetch { args: "run --quiet --allow-import --allow-read --allow-write --allow-env --allow-run run/lock_write_fetch/main.ts", @@ -809,33 +437,6 @@ itest!(lock_write_fetch { exit_code: 0, }); -itest!(lock_check_ok { - args: - "run --quiet --allow-import --lock=run/lock_check_ok.json http://127.0.0.1:4545/run/003_relative_import.ts", - output: "run/003_relative_import.ts.out", - http_server: true, -}); - -itest!(lock_check_ok2 { - args: - "run --allow-import --lock=run/lock_check_ok2.json run/019_media_types.ts", - output: "run/019_media_types.ts.out", - http_server: true, -}); - -itest!(lock_v2_check_ok { - args: - "run --allow-import --quiet --lock=run/lock_v2_check_ok.json http://127.0.0.1:4545/run/003_relative_import.ts", - output: "run/003_relative_import.ts.out", - http_server: true, -}); - -itest!(lock_v2_check_ok2 { - args: "run --allow-import --lock=run/lock_v2_check_ok2.json run/019_media_types.ts", - output: "run/019_media_types.ts.out", - http_server: true, -}); - #[test] fn lock_redirects() { let context = TestContextBuilder::new() @@ -1234,141 +835,12 @@ fn get_lockfile_npm_package_integrity( .to_string() } -itest!(mts_dmts_mjs { - args: "run subdir/import.mts", - output: "run/mts_dmts_mjs.out", -}); - -itest!(mts_dmts_mjs_no_check { - args: "run --no-check subdir/import.mts", - output: "run/mts_dmts_mjs.out", -}); - -itest!(async_error { - exit_code: 1, - args: "run --reload run/async_error.ts", - output: "run/async_error.ts.out", -}); - -itest!(config { - args: - "run --reload --config run/config/tsconfig.json --check run/config/main.ts", - output: "run/config/main.out", -}); - -itest!(config_types { - args: - "run --reload --quiet --check=all --config run/config_types/tsconfig.json run/config_types/main.ts", - output: "run/config_types/main.out", -}); - -itest!(config_types_remote { - http_server: true, - args: "run --allow-import --reload --quiet --check=all --config run/config_types/remote.tsconfig.json run/config_types/main.ts", - output: "run/config_types/main.out", -}); - -itest!(empty_typescript { - args: "run --reload --check run/empty.ts", - output_str: Some("Check file:[WILDCARD]/run/empty.ts\n"), -}); - -itest!(error_001 { - args: "run --reload run/error_001.ts", - exit_code: 1, - output: "run/error_001.ts.out", -}); - -itest!(error_002 { - args: "run --reload run/error_002.ts", - exit_code: 1, - output: "run/error_002.ts.out", -}); - -itest!(error_003_typescript { - args: "run --reload --check run/error_003_typescript.ts", - exit_code: 1, - output: "run/error_003_typescript.ts.out", -}); - -// Supposing that we've already attempted to run error_003_typescript.ts -// we want to make sure that JS wasn't emitted. Running again without reload flag -// should result in the same output. -// https://github.com/denoland/deno/issues/2436 -itest!(error_003_typescript2 { - args: "run --check run/error_003_typescript.ts", - exit_code: 1, - output: "run/error_003_typescript.ts.out", -}); - -itest!(error_004_missing_module { - args: "run --reload run/error_004_missing_module.ts", - exit_code: 1, - output: "run/error_004_missing_module.ts.out", -}); - -itest!(error_005_missing_dynamic_import { - args: - "run --reload --allow-read --quiet run/error_005_missing_dynamic_import.ts", - exit_code: 1, - output: "run/error_005_missing_dynamic_import.ts.out", -}); - -itest!(error_006_import_ext_failure { - args: "run --reload run/error_006_import_ext_failure.ts", - exit_code: 1, - output: "run/error_006_import_ext_failure.ts.out", -}); - -itest!(error_007_any { - args: "run --reload run/error_007_any.ts", - exit_code: 1, - output: "run/error_007_any.ts.out", -}); - -itest!(error_008_checkjs { - args: "run --reload run/error_008_checkjs.js", - exit_code: 1, - output: "run/error_008_checkjs.js.out", -}); - -itest!(error_009_extensions_error { - args: "run run/error_009_extensions_error.js", - output: "run/error_009_extensions_error.js.out", - exit_code: 1, -}); - -itest!(error_011_bad_module_specifier { - args: "run --reload run/error_011_bad_module_specifier.ts", - exit_code: 1, - output: "run/error_011_bad_module_specifier.ts.out", -}); - -itest!(error_012_bad_dynamic_import_specifier { - args: "run --reload --check run/error_012_bad_dynamic_import_specifier.ts", - exit_code: 1, - output: "run/error_012_bad_dynamic_import_specifier.ts.out", -}); - itest!(error_013_missing_script { args: "run --reload missing_file_name", exit_code: 1, output: "run/error_013_missing_script.out", }); -itest!(error_014_catch_dynamic_import_error { - args: - "run --reload --allow-read run/error_014_catch_dynamic_import_error.js", - output: "run/error_014_catch_dynamic_import_error.js.out", -}); - -itest!(error_015_dynamic_import_permissions { - args: "run --reload --quiet run/error_015_dynamic_import_permissions.js", - output: "run/error_015_dynamic_import_permissions.out", - exit_code: 1, - http_server: true, -}); - // We have an allow-import flag but not allow-read, it should still result in error. itest!(error_016_dynamic_import_permissions2 { args: @@ -1378,60 +850,6 @@ itest!(error_016_dynamic_import_permissions2 { http_server: true, }); -itest!(error_017_hide_long_source_ts { - args: "run --reload --check run/error_017_hide_long_source_ts.ts", - output: "run/error_017_hide_long_source_ts.ts.out", - exit_code: 1, -}); - -itest!(error_018_hide_long_source_js { - args: "run run/error_018_hide_long_source_js.js", - output: "run/error_018_hide_long_source_js.js.out", - exit_code: 1, -}); - -itest!(error_019_stack_function { - args: "run run/error_019_stack_function.ts", - output: "run/error_019_stack_function.ts.out", - exit_code: 1, -}); - -itest!(error_020_stack_constructor { - args: "run run/error_020_stack_constructor.ts", - output: "run/error_020_stack_constructor.ts.out", - exit_code: 1, -}); - -itest!(error_021_stack_method { - args: "run run/error_021_stack_method.ts", - output: "run/error_021_stack_method.ts.out", - exit_code: 1, -}); - -itest!(error_022_stack_custom_error { - args: "run run/error_022_stack_custom_error.ts", - output: "run/error_022_stack_custom_error.ts.out", - exit_code: 1, -}); - -itest!(error_023_stack_async { - args: "run run/error_023_stack_async.ts", - output: "run/error_023_stack_async.ts.out", - exit_code: 1, -}); - -itest!(error_024_stack_promise_all { - args: "run run/error_024_stack_promise_all.ts", - output: "run/error_024_stack_promise_all.ts.out", - exit_code: 1, -}); - -itest!(error_025_tab_indent { - args: "run run/error_025_tab_indent", - output: "run/error_025_tab_indent.out", - exit_code: 1, -}); - itest!(error_026_remote_import_error { args: "run --allow-import run/error_026_remote_import_error.ts", output: "run/error_026_remote_import_error.ts.out", @@ -1439,42 +857,6 @@ itest!(error_026_remote_import_error { http_server: true, }); -itest!(error_for_await { - args: "run --reload --check run/error_for_await.ts", - output: "run/error_for_await.ts.out", - exit_code: 1, -}); - -itest!(error_missing_module_named_import { - args: "run --reload run/error_missing_module_named_import.ts", - output: "run/error_missing_module_named_import.ts.out", - exit_code: 1, -}); - -itest!(error_no_check { - args: "run --reload --no-check run/error_no_check.ts", - output: "run/error_no_check.ts.out", - exit_code: 1, -}); - -itest!(error_syntax { - args: "run --reload run/error_syntax.js", - exit_code: 1, - output: "run/error_syntax.js.out", -}); - -itest!(error_syntax_empty_trailing_line { - args: "run --reload run/error_syntax_empty_trailing_line.mjs", - exit_code: 1, - output: "run/error_syntax_empty_trailing_line.mjs.out", -}); - -itest!(error_type_definitions { - args: "run --reload --check run/error_type_definitions.ts", - exit_code: 1, - output: "run/error_type_definitions.ts.out", -}); - itest!(error_local_static_import_from_remote_ts { args: "run --allow-import --reload http://localhost:4545/run/error_local_static_import_from_remote.ts", exit_code: 1, @@ -1489,138 +871,18 @@ itest!(error_local_static_import_from_remote_js { output: "run/error_local_static_import_from_remote.js.out", }); -itest!(exit_error42 { - exit_code: 42, - args: "run --quiet --reload run/exit_error42.ts", - output: "run/exit_error42.ts.out", -}); - -itest!(set_exit_code_0 { - args: "run --no-check run/set_exit_code_0.ts", - output_str: Some(""), - exit_code: 0, -}); - -itest!(set_exit_code_1 { - args: "run --no-check run/set_exit_code_1.ts", - output_str: Some(""), - exit_code: 42, -}); - -itest!(set_exit_code_2 { - args: "run --no-check run/set_exit_code_2.ts", - output_str: Some(""), - exit_code: 42, -}); - -itest!(op_exit_op_set_exit_code_in_worker { - args: "run --no-check --allow-read run/op_exit_op_set_exit_code_in_worker.ts", - exit_code: 21, - output_str: Some(""), -}); - -itest!(deno_exit_tampering { - args: "run --no-check run/deno_exit_tampering.ts", - output_str: Some(""), - exit_code: 42, -}); - -itest!(heapstats { - args: "run --quiet --v8-flags=--expose-gc run/heapstats.js", - output: "run/heapstats.js.out", -}); - -itest!(finalization_registry { - args: "run --quiet --v8-flags=--expose-gc run/finalization_registry.js", - output: "run/finalization_registry.js.out", -}); - -itest!(https_import { - args: "run --allow-import --quiet --reload --cert tls/RootCA.pem run/https_import.ts", - output: "run/https_import.ts.out", - http_server: true, -}); - -itest!(if_main { - args: "run --quiet --reload run/if_main.ts", - output: "run/if_main.ts.out", -}); - itest!(import_meta { args: "run --allow-import --quiet --reload --import-map=run/import_meta/importmap.json run/import_meta/main.ts", output: "run/import_meta/main.out", http_server: true, }); -itest!(main_module { - args: "run --quiet --reload run/main_module/main.ts", - output: "run/main_module/main.out", -}); - -itest!(no_check { - args: "run --allow-import --quiet --reload --no-check run/006_url_imports.ts", - output: "run/006_url_imports.ts.out", - http_server: true, -}); - -itest!(no_check_decorators { - args: "run --quiet --reload --no-check run/decorators/experimental/no_check/main.ts", - output: "run/decorators/experimental/no_check/main.out", -}); - -itest!(decorators_tc39_proposal { - args: "run --quiet --reload --check run/decorators/tc39_proposal/main.ts", - output: "run/decorators/tc39_proposal/main.out", -}); - -itest!(check_remote { - args: - "run --quiet --allow-import --reload --check=all run/no_check_remote.ts", - output: "run/no_check_remote.ts.disabled.out", - exit_code: 1, - http_server: true, -}); - itest!(no_check_remote { args: "run --allow-import --quiet --reload --no-check=remote run/no_check_remote.ts", output: "run/no_check_remote.ts.enabled.out", http_server: true, }); -itest!(runtime_decorators { - args: "run --quiet --reload --no-check run/decorators/experimental/runtime/main.ts", - output: "run/decorators/experimental/runtime/main.out", -}); - -itest!(seed_random { - args: "run --seed=100 run/seed_random.js", - output: "run/seed_random.js.out", -}); - -itest!(type_definitions { - args: "run --reload run/type_definitions.ts", - output: "run/type_definitions.ts.out", -}); - -itest!(type_definitions_for_export { - args: "run --reload --check run/type_definitions_for_export.ts", - output: "run/type_definitions_for_export.ts.out", - exit_code: 1, -}); - -itest!(type_directives_01 { - args: - "run --allow-import --reload --check=all -L debug run/type_directives_01.ts", - output: "run/type_directives_01.ts.out", - http_server: true, -}); - -itest!(type_directives_02 { - args: - "run --allow-import --reload --check=all -L debug run/type_directives_02.ts", - output: "run/type_directives_02.ts.out", -}); - #[test] fn type_directives_js_main() { let context = TestContext::default(); @@ -1642,216 +904,6 @@ itest!(type_directives_redirect { http_server: true, }); -itest!(type_headers_deno_types { - args: "run --allow-import --reload --check run/type_headers_deno_types.ts", - output: "run/type_headers_deno_types.ts.out", - http_server: true, -}); - -itest!(ts_type_imports { - args: "run --reload --check run/ts_type_imports.ts", - output: "run/ts_type_imports.ts.out", - exit_code: 1, -}); - -itest!(ts_decorators { - args: "run --reload --check run/decorators/experimental/ts/main.ts", - output: "run/decorators/experimental/ts/main.out", -}); - -itest!(ts_type_only_import { - args: "run --reload --check run/ts_type_only_import.ts", - output: "run/ts_type_only_import.ts.out", -}); - -itest!(swc_syntax_error { - args: "run --reload --check run/swc_syntax_error.ts", - output: "run/swc_syntax_error.ts.out", - exit_code: 1, -}); - -itest!(unbuffered_stderr { - args: "run --reload run/unbuffered_stderr.ts", - output: "run/unbuffered_stderr.ts.out", -}); - -itest!(unbuffered_stdout { - args: "run --quiet --reload run/unbuffered_stdout.ts", - output: "run/unbuffered_stdout.ts.out", -}); - -itest!(v8_flags_run { - args: "run --v8-flags=--expose-gc run/v8_flags.js", - output: "run/v8_flags.js.out", -}); - -itest!(v8_flags_env_run { - envs: vec![("DENO_V8_FLAGS".to_string(), "--expose-gc".to_string())], - args: "run run/v8_flags.js", - output: "run/v8_flags.js.out", -}); - -itest!(v8_flags_unrecognized { - args: "repl --v8-flags=--foo,bar,--trace-gc,-baz", - output: "run/v8_flags_unrecognized.out", - exit_code: 1, -}); - -itest!(v8_help { - args: "repl --v8-flags=--help", - output: "run/v8_help.out", -}); - -itest!(unsupported_dynamic_import_scheme { - args: "eval import('xxx:')", - output: "run/unsupported_dynamic_import_scheme.out", - exit_code: 1, -}); - -itest!(wasm { - args: "run --quiet run/wasm.ts", - output: "run/wasm.ts.out", -}); - -itest!(wasm_shared { - args: "run --quiet run/wasm_shared.ts", - output: "run/wasm_shared.out", -}); - -itest!(wasm_async { - args: "run run/wasm_async.js", - output: "run/wasm_async.out", -}); - -itest!(wasm_unreachable { - args: "run --allow-read run/wasm_unreachable.js", - output: "run/wasm_unreachable.out", - exit_code: 1, -}); - -itest!(wasm_url { - args: "run --quiet --allow-net=localhost:4545 run/wasm_url.js", - output: "run/wasm_url.out", - exit_code: 1, - http_server: true, -}); - -itest!(weakref { - args: "run --quiet --reload run/weakref.ts", - output: "run/weakref.ts.out", -}); - -itest!(top_level_await_order { - args: "run --allow-read run/top_level_await/order.js", - output: "run/top_level_await/order.out", -}); - -itest!(top_level_await_loop { - args: "run --allow-read run/top_level_await/loop.js", - output: "run/top_level_await/loop.out", -}); - -itest!(top_level_await_circular { - args: "run --allow-read run/top_level_await/circular.js", - output: "run/top_level_await/circular.out", - exit_code: 1, -}); - -// Regression test for https://github.com/denoland/deno/issues/11238. -itest!(top_level_await_nested { - args: "run --allow-read run/top_level_await/nested/main.js", - output: "run/top_level_await/nested.out", -}); - -itest!(top_level_await_unresolved { - args: "run run/top_level_await/unresolved.js", - output: "run/top_level_await/unresolved.out", - exit_code: 1, -}); - -itest!(top_level_await { - args: "run --allow-read run/top_level_await/top_level_await.js", - output: "run/top_level_await/top_level_await.out", -}); - -itest!(top_level_await_ts { - args: "run --quiet --allow-read run/top_level_await/top_level_await.ts", - output: "run/top_level_await/top_level_await.out", -}); - -itest!(top_level_for_await { - args: "run --quiet run/top_level_await/top_level_for_await.js", - output: "run/top_level_await/top_level_for_await.out", -}); - -itest!(top_level_for_await_ts { - args: "run --quiet run/top_level_await/top_level_for_await.ts", - output: "run/top_level_await/top_level_for_await.out", -}); - -itest!(unstable_worker { - args: "run --reload --quiet --allow-read run/unstable_worker.ts", - output: "run/unstable_worker.ts.out", -}); - -itest!(unstable_worker_options_disabled { - args: "run --quiet --reload --allow-read run/unstable_worker_options.js", - output: "run/unstable_worker_options.disabled.out", - exit_code: 70, -}); - -itest!(unstable_worker_options_enabled { - args: "run --quiet --reload --allow-read --unstable-worker-options run/unstable_worker_options.js", - output: "run/unstable_worker_options.enabled.out", -}); - -itest!(unstable_broadcast_channel_disabled { - args: "run --quiet --reload --allow-read run/unstable_broadcast_channel.js", - output: "run/unstable_broadcast_channel.disabled.out", -}); - -itest!(unstable_broadcast_channel_enabled { - args: "run --quiet --reload --allow-read --unstable-broadcast-channel run/unstable_broadcast_channel.js", - output: "run/unstable_broadcast_channel.enabled.out", -}); - -itest!(unstable_cron_disabled { - args: "run --quiet --reload --allow-read run/unstable_cron.js", - output: "run/unstable_cron.disabled.out", -}); - -itest!(unstable_cron_enabled { - args: - "run --quiet --reload --allow-read --unstable-cron run/unstable_cron.js", - output: "run/unstable_cron.enabled.out", -}); - -itest!(unstable_net_disabled { - args: "run --quiet --reload --allow-read run/unstable_net.js", - output: "run/unstable_net.disabled.out", -}); - -itest!(unstable_net_enabled { - args: "run --quiet --reload --allow-read --unstable-net run/unstable_net.js", - output: "run/unstable_net.enabled.out", -}); - -itest!(unstable_kv_disabled { - args: "run --quiet --reload --allow-read run/unstable_kv.js", - output: "run/unstable_kv.disabled.out", -}); - -itest!(unstable_kv_enabled { - args: "run --quiet --reload --allow-read --unstable-kv run/unstable_kv.js", - output: "run/unstable_kv.enabled.out", -}); - -itest!(import_compression { - args: "run --allow-import --quiet --reload --allow-net run/import_compression/main.ts", - output: "run/import_compression/main.out", - http_server: true, -}); - itest!(disallow_http_from_https_js { args: "run --allow-import --quiet --reload --cert tls/RootCA.pem https://localhost:5545/run/disallow_http_from_https.js", output: "run/disallow_http_from_https_js.out", @@ -1866,131 +918,6 @@ itest!(disallow_http_from_https_ts { exit_code: 1, }); -itest!(dynamic_import_conditional { - args: "run --quiet --reload run/dynamic_import_conditional.js", - output: "run/dynamic_import_conditional.js.out", -}); - -itest!(tsx_imports { - args: "run --reload --check run/tsx_imports/tsx_imports.ts", - output: "run/tsx_imports/tsx_imports.ts.out", -}); - -itest!(fix_dynamic_import_errors { - args: "run --reload run/fix_dynamic_import_errors.js", - output: "run/fix_dynamic_import_errors.js.out", -}); - -itest!(fix_emittable_skipped { - args: "run --reload run/fix_emittable_skipped.js", - output: "run/fix_emittable_skipped.ts.out", -}); - -itest!(fix_js_import_js { - args: "run --quiet --reload run/fix_js_import_js.ts", - output: "run/fix_js_import_js.ts.out", -}); - -itest!(fix_js_imports { - args: "run --quiet --reload run/fix_js_imports.ts", - output: "run/fix_js_imports.ts.out", -}); - -itest!(fix_tsc_file_exists { - args: "run --quiet --reload tsc/test.js", - output: "run/fix_tsc_file_exists.out", -}); - -itest!(fix_worker_dispatchevent { - args: "run --quiet --reload run/fix_worker_dispatchevent.ts", - output: "run/fix_worker_dispatchevent.ts.out", -}); - -itest!(es_private_fields { - args: "run --quiet --reload run/es_private_fields.js", - output: "run/es_private_fields.js.out", -}); - -itest!(ts_import_from_js { - args: "run --allow-import --quiet --reload run/ts_import_from_js/main.js", - output: "run/ts_import_from_js/main.out", - http_server: true, -}); - -itest!(jsx_import_from_ts { - args: "run --quiet --reload run/jsx_import_from_ts.ts", - output: "run/jsx_import_from_ts.ts.out", -}); - -itest!(jsx_import_source_pragma { - args: "run --reload --allow-import run/jsx_import_source_pragma.tsx", - output: "run/jsx_import_source.out", - http_server: true, -}); - -itest!(jsx_import_source_pragma_with_config { - args: - "run --reload --allow-import --config jsx/deno-jsx.jsonc --no-lock run/jsx_import_source_pragma.tsx", - output: "run/jsx_import_source.out", - http_server: true, -}); - -itest!(jsx_import_source_pragma_with_dev_config { - args: - "run --reload --allow-import --config jsx/deno-jsxdev.jsonc --no-lock run/jsx_import_source_pragma.tsx", - output: "run/jsx_import_source_dev.out", - http_server: true, -}); - -itest!(jsx_import_source_no_pragma { - args: - "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock run/jsx_import_source_no_pragma.tsx", - output: "run/jsx_import_source.out", - http_server: true, -}); - -itest!(jsx_import_source_no_pragma_dev { - args: "run --allow-import --reload --config jsx/deno-jsxdev.jsonc --no-lock run/jsx_import_source_no_pragma.tsx", - output: "run/jsx_import_source_dev.out", - http_server: true, -}); - -itest!(jsx_import_source_pragma_import_map { - args: "run --allow-import --reload --import-map jsx/import-map.json run/jsx_import_source_pragma_import_map.tsx", - output: "run/jsx_import_source_import_map.out", - http_server: true, -}); - -itest!(jsx_import_source_pragma_import_map_dev { - args: "run --allow-import --reload --import-map jsx/import-map.json --config jsx/deno-jsxdev-import-map.jsonc run/jsx_import_source_pragma_import_map.tsx", - output: "run/jsx_import_source_import_map_dev.out", - http_server: true, -}); - -itest!(jsx_import_source_precompile_import_map { - args: "run --allow-import --reload --check --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-precompile.jsonc run/jsx_precompile/no_pragma.tsx", - output: "run/jsx_precompile/no_pragma.out", - http_server: true, -}); - -itest!(jsx_import_source_precompile_import_map_skip_element { - args: "run --allow-import --reload --check --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-precompile-skip.jsonc run/jsx_precompile/skip.tsx", - output: "run/jsx_precompile/skip.out", - http_server: true, -}); - -itest!(jsx_import_source_import_map { - args: "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-import-map.jsonc run/jsx_import_source_no_pragma.tsx", - output: "run/jsx_import_source_import_map.out", - http_server: true, -}); - -itest!(jsx_import_source_import_map_dev { - args: "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsxdev-import-map.jsonc run/jsx_import_source_no_pragma.tsx", - output: "run/jsx_import_source_import_map_dev.out", - http_server: true, -}); - itest!(jsx_import_source_import_map_scoped { args: "run --allow-import --reload --import-map jsx/import-map-scoped.json --no-lock --config jsx/deno-jsx-import-map.jsonc subdir/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source_import_map.out", @@ -2003,289 +930,12 @@ itest!(jsx_import_source_import_map_scoped_dev { http_server: true, }); -itest!(jsx_import_source_pragma_no_check { - args: - "run --allow-import --reload --no-check run/jsx_import_source_pragma.tsx", - output: "run/jsx_import_source.out", - http_server: true, -}); - -itest!(jsx_import_source_pragma_with_config_no_check { - args: "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --no-check run/jsx_import_source_pragma.tsx", - output: "run/jsx_import_source.out", - http_server: true, -}); - -itest!(jsx_import_source_pragma_with_config_vendor_dir { - args: "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --vendor $TESTDATA/run/jsx_import_source_pragma.tsx", - output: "run/jsx_import_source.out", - http_server: true, - temp_cwd: true, - copy_temp_dir: Some("jsx/"), -}); - -itest!(jsx_import_source_no_pragma_no_check { - args: - "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --no-check run/jsx_import_source_no_pragma.tsx", - output: "run/jsx_import_source.out", - http_server: true, -}); - -itest!(jsx_import_source_pragma_import_map_no_check { - args: "run --allow-import --reload --import-map jsx/import-map.json --no-check run/jsx_import_source_pragma_import_map.tsx", - output: "run/jsx_import_source_import_map.out", - http_server: true, -}); - -itest!(jsx_import_source_import_map_no_check { - args: "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-import-map.jsonc --no-check run/jsx_import_source_no_pragma.tsx", - output: "run/jsx_import_source_import_map.out", - http_server: true, -}); - -itest!(jsx_import_source_error { - args: "run --config jsx/deno-jsx-error.jsonc --check run/jsx_import_source_no_pragma.tsx", - output: "run/jsx_import_source_error.out", - exit_code: 1, -}); - -itest!(single_compile_with_reload { - args: "run --reload --allow-read run/single_compile_with_reload.ts", - output: "run/single_compile_with_reload.ts.out", -}); - -itest!(proto_exploit { - args: "run run/proto_exploit.js", - output: "run/proto_exploit.js.out", -}); - -itest!(reference_types { - args: "run --reload --quiet run/reference_types.ts", - output: "run/reference_types.ts.out", -}); - -itest!(references_types_remote { - http_server: true, - args: "run --reload --quiet run/reference_types_remote.ts", - output: "run/reference_types_remote.ts.out", -}); - -itest!(reference_types_error { - args: - "run --config run/checkjs.tsconfig.json --check run/reference_types_error.js", - output: "run/reference_types_error.js.out", - exit_code: 1, -}); - -itest!(reference_types_error_vendor_dir { - args: - "run --config run/checkjs.tsconfig.json --check --vendor $TESTDATA/run/reference_types_error.js", - output: "run/reference_types_error.js.out", - exit_code: 1, -}); - -itest!(reference_types_error_no_check { - args: "run --no-check run/reference_types_error.js", - output_str: Some(""), -}); - -itest!(import_data_url_error_stack { - args: "run --quiet --reload run/import_data_url_error_stack.ts", - output: "run/import_data_url_error_stack.ts.out", - exit_code: 1, -}); - -itest!(import_data_url_import_relative { - args: "run --quiet --reload run/import_data_url_import_relative.ts", - output: "run/import_data_url_import_relative.ts.out", - exit_code: 1, -}); - -itest!(import_data_url_imports { - args: "run --allow-import --quiet --reload run/import_data_url_imports.ts", - output: "run/import_data_url_imports.ts.out", - http_server: true, -}); - -itest!(import_data_url_jsx { - args: "run --quiet --reload run/import_data_url_jsx.ts", - output: "run/import_data_url_jsx.ts.out", -}); - -itest!(import_data_url { - args: "run --quiet --reload run/import_data_url.ts", - output: "run/import_data_url.ts.out", -}); - -itest!(import_dynamic_data_url { - args: "run --quiet --reload run/import_dynamic_data_url.ts", - output: "run/import_dynamic_data_url.ts.out", -}); - -itest!(import_blob_url_error_stack { - args: "run --quiet --reload run/import_blob_url_error_stack.ts", - output: "run/import_blob_url_error_stack.ts.out", - exit_code: 1, -}); - -itest!(import_blob_url_import_relative { - args: "run --quiet --reload run/import_blob_url_import_relative.ts", - output: "run/import_blob_url_import_relative.ts.out", - exit_code: 1, -}); - -itest!(import_blob_url_imports { - args: - "run --allow-import --quiet --reload --allow-net=localhost:4545 run/import_blob_url_imports.ts", - output: "run/import_blob_url_imports.ts.out", - http_server: true, -}); - -itest!(import_blob_url_jsx { - args: "run --quiet --reload run/import_blob_url_jsx.ts", - output: "run/import_blob_url_jsx.ts.out", -}); - -itest!(import_blob_url { - args: "run --quiet --reload run/import_blob_url.ts", - output: "run/import_blob_url.ts.out", -}); - -itest!(import_file_with_colon { - args: "run --allow-import --quiet --reload run/import_file_with_colon.ts", - output: "run/import_file_with_colon.ts.out", - http_server: true, -}); - -itest!(import_extensionless { - args: "run --allow-import --quiet --reload run/import_extensionless.ts", - output: "run/import_extensionless.ts.out", - http_server: true, -}); - -itest!(classic_workers_event_loop { - args: - "run --enable-testing-features-do-not-use run/classic_workers_event_loop.js", - output: "run/classic_workers_event_loop.js.out", -}); - // FIXME(bartlomieju): disabled, because this test is very flaky on CI // itest!(local_sources_not_cached_in_memory { // args: "run --allow-read --allow-write run/no_mem_cache.js", // output: "run/no_mem_cache.js.out", // }); -// This test checks that inline source map data is used. It uses a hand crafted -// source map that maps to a file that exists, but is not loaded into the module -// graph (inline_js_source_map_2.ts) (because there are no direct dependencies). -// Source line is not remapped because no inline source contents are included in -// the sourcemap and the file is not present in the dependency graph. -itest!(inline_js_source_map_2 { - args: "run --quiet run/inline_js_source_map_2.js", - output: "run/inline_js_source_map_2.js.out", - exit_code: 1, -}); - -// This test checks that inline source map data is used. It uses a hand crafted -// source map that maps to a file that exists, but is not loaded into the module -// graph (inline_js_source_map_2.ts) (because there are no direct dependencies). -// Source line remapped using th inline source contents that are included in the -// inline source map. -itest!(inline_js_source_map_2_with_inline_contents { - args: "run --quiet run/inline_js_source_map_2_with_inline_contents.js", - output: "run/inline_js_source_map_2_with_inline_contents.js.out", - exit_code: 1, -}); - -// This test checks that inline source map data is used. It uses a hand crafted -// source map that maps to a file that exists, and is loaded into the module -// graph because of a direct import statement (inline_js_source_map.ts). The -// source map was generated from an earlier version of this file, where the throw -// was not commented out. The source line is remapped using source contents that -// from the module graph. -itest!(inline_js_source_map_with_contents_from_graph { - args: "run --allow-import --quiet run/inline_js_source_map_with_contents_from_graph.js", - output: "run/inline_js_source_map_with_contents_from_graph.js.out", - exit_code: 1, - http_server: true, -}); - -// This test ensures that a descriptive error is shown when we're unable to load -// the import map. Even though this tests only the `run` subcommand, we can be sure -// that the error message is similar for other subcommands as they all use -// `program_state.maybe_import_map` to access the import map underneath. -itest!(error_import_map_unable_to_load { - args: "run --import-map=import_maps/does_not_exist.json import_maps/test.ts", - output: "run/error_import_map_unable_to_load.out", - exit_code: 1, -}); - -// Test that setting `self` in the main thread to some other value doesn't break -// the world. -itest!(replace_self { - args: "run run/replace_self.js", - output: "run/replace_self.js.out", -}); - -itest!(worker_event_handler_test { - args: "run --quiet --reload --allow-read run/worker_event_handler_test.js", - output: "run/worker_event_handler_test.js.out", -}); - -itest!(worker_close_race { - args: "run --quiet --reload --allow-read run/worker_close_race.js", - output: "run/worker_close_race.js.out", -}); - -itest!(worker_drop_handle_race { - args: "run --quiet --reload --allow-read run/worker_drop_handle_race.js", - output: "run/worker_drop_handle_race.js.out", - exit_code: 1, -}); - -itest!(worker_drop_handle_race_terminate { - args: "run run/worker_drop_handle_race_terminate.js", - output: "run/worker_drop_handle_race_terminate.js.out", -}); - -itest!(worker_close_nested { - args: "run --quiet --reload --allow-read run/worker_close_nested.js", - output: "run/worker_close_nested.js.out", -}); - -itest!(worker_message_before_close { - args: "run --quiet --reload --allow-read run/worker_message_before_close.js", - output: "run/worker_message_before_close.js.out", -}); - -itest!(worker_close_in_wasm_reactions { - args: - "run --quiet --reload --allow-read run/worker_close_in_wasm_reactions.js", - output: "run/worker_close_in_wasm_reactions.js.out", -}); - -itest!(shebang_tsc { - args: "run --quiet --check run/shebang.ts", - output: "run/shebang.ts.out", -}); - -itest!(shebang_swc { - args: "run --quiet run/shebang.ts", - output: "run/shebang.ts.out", -}); - -itest!(shebang_with_json_imports_tsc { - args: "run --quiet import_attributes/json_with_shebang.ts", - output: "import_attributes/json_with_shebang.ts.out", - exit_code: 1, -}); - -itest!(shebang_with_json_imports_swc { - args: "run --quiet --no-check import_attributes/json_with_shebang.ts", - output: "import_attributes/json_with_shebang.ts.out", - exit_code: 1, -}); - #[test] fn no_validate_asm() { let output = util::deno_cmd() @@ -2523,7 +1173,6 @@ fn dont_cache_on_check_fail() { mod permissions { use test_util as util; - use test_util::itest; use util::TestContext; #[test] @@ -2973,31 +1622,6 @@ mod permissions { }); } - itest!(_063_permissions_revoke { - args: "run --allow-read=foo,bar run/063_permissions_revoke.ts", - output: "run/063_permissions_revoke.ts.out", - }); - - itest!(_063_permissions_revoke_sync { - args: "run --allow-read=foo,bar run/063_permissions_revoke_sync.ts", - output: "run/063_permissions_revoke.ts.out", - }); - - itest!(_064_permissions_revoke_global { - args: "run --allow-read=foo,bar run/064_permissions_revoke_global.ts", - output: "run/064_permissions_revoke_global.ts.out", - }); - - itest!(_064_permissions_revoke_global_sync { - args: "run --allow-read=foo,bar run/064_permissions_revoke_global_sync.ts", - output: "run/064_permissions_revoke_global.ts.out", - }); - - itest!(_065_permissions_revoke_net { - args: "run --allow-net run/065_permissions_revoke_net.ts", - output: "run/065_permissions_revoke_net.ts.out", - }); - #[test] fn _066_prompt() { TestContext::default() @@ -3033,63 +1657,8 @@ mod permissions { console.expect("The end of test"); }); } - - itest!(dynamic_import_static_analysis_no_permissions { - args: "run --quiet --reload --no-prompt dynamic_import/static_analysis_no_permissions.ts", - output: "dynamic_import/static_analysis_no_permissions.ts.out", - }); - - itest!(dynamic_import_permissions_remote_remote { - args: "run --quiet --reload --allow-import=localhost:4545 dynamic_import/permissions_remote_remote.ts", - output: "dynamic_import/permissions_remote_remote.ts.out", - http_server: true, - exit_code: 1, - }); - - itest!(dynamic_import_permissions_data_remote { - args: "run --quiet --reload --allow-import=localhost:4545 dynamic_import/permissions_data_remote.ts", - output: "dynamic_import/permissions_data_remote.ts.out", - http_server: true, - exit_code: 1, - }); - - itest!(dynamic_import_permissions_blob_remote { - args: "run --quiet --reload --allow-net=localhost:4545 dynamic_import/permissions_blob_remote.ts", - output: "dynamic_import/permissions_blob_remote.ts.out", - http_server: true, - exit_code: 1, - }); - - itest!(dynamic_import_permissions_data_local { - args: "run --quiet --reload --allow-net=localhost:4545 dynamic_import/permissions_data_local.ts", - output: "dynamic_import/permissions_data_local.ts.out", - http_server: true, - exit_code: 1, - }); - - itest!(dynamic_import_permissions_blob_local { - args: "run --quiet --reload --allow-net=localhost:4545 dynamic_import/permissions_blob_local.ts", - output: "dynamic_import/permissions_blob_local.ts.out", - http_server: true, - exit_code: 1, - }); } -itest!(tls_starttls { - args: "run --quiet --reload --allow-net --allow-read --cert tls/RootCA.pem --config ../config/deno.json run/tls_starttls.js", - output: "run/tls.out", -}); - -itest!(tls_connecttls { - args: "run --quiet --reload --allow-net --allow-read --cert tls/RootCA.pem --config ../config/deno.json run/tls_connecttls.js", - output: "run/tls.out", -}); - -itest!(byte_order_mark { - args: "run --no-check run/byte_order_mark.ts", - output: "run/byte_order_mark.out", -}); - #[test] #[cfg(windows)] fn process_stdin_read_unblock() { @@ -3137,24 +1706,6 @@ fn issue9750() { }); } -// Regression test for https://github.com/denoland/deno/issues/11451. -itest!(dom_exception_formatting { - args: "run run/dom_exception_formatting.ts", - output: "run/dom_exception_formatting.ts.out", - exit_code: 1, -}); - -itest!(long_data_url_formatting { - args: "run run/long_data_url_formatting.ts", - output: "run/long_data_url_formatting.ts.out", - exit_code: 1, -}); - -itest!(eval_context_throw_dom_exception { - args: "run run/eval_context_throw_dom_exception.js", - output: "run/eval_context_throw_dom_exception.js.out", -}); - #[test] #[cfg(unix)] fn navigator_language_unix() { @@ -3278,85 +1829,6 @@ fn issue12807() { assert!(status.success()); } -itest!(issue_13562 { - args: "run run/issue13562.ts", - output: "run/issue13562.ts.out", -}); - -itest!(import_attributes_static_import { - args: "run --allow-read import_attributes/static_import.ts", - output: "import_attributes/static_import.out", -}); - -itest!(import_attributes_static_export { - args: "run --allow-read import_attributes/static_export.ts", - output: "import_attributes/static_export.out", -}); - -itest!(import_attributes_static_error { - args: "run --allow-read import_attributes/static_error.ts", - output: "import_attributes/static_error.out", - exit_code: 1, -}); - -itest!(import_attributes_dynamic_import { - args: "run --allow-read --check import_attributes/dynamic_import.ts", - output: "import_attributes/dynamic_import.out", -}); - -itest!(import_attributes_dynamic_error { - args: "run --allow-read import_attributes/dynamic_error.ts", - output: "import_attributes/dynamic_error.out", - exit_code: 1, -}); - -itest!(import_attributes_type_check { - args: "run --allow-read --check import_attributes/type_check.ts", - output: "import_attributes/type_check.out", - exit_code: 1, -}); - -itest!(colors_without_global_this { - args: "run run/colors_without_globalThis.js", - output_str: Some("true\n"), -}); - -itest!(config_auto_discovered_for_local_script { - args: "run --quiet run/with_config/frontend_work.ts", - output_str: Some("ok\n"), -}); - -itest!(config_auto_discovered_for_local_script_log { - args: "run -L debug run/with_config/frontend_work.ts", - output: "run/with_config/auto_discovery_log.out", -}); - -itest!(no_config_auto_discovery_for_local_script { - args: "run --quiet --no-config --check run/with_config/frontend_work.ts", - output: "run/with_config/no_auto_discovery.out", - exit_code: 1, -}); - -itest!(config_not_auto_discovered_for_remote_script { - args: "run --allow-import --quiet http://127.0.0.1:4545/run/with_config/server_side_work.ts", - output_str: Some("ok\n"), - http_server: true, -}); - -// In this case we shouldn't discover `package.json` file, because it's in a -// directory that is above the directory containing `deno.json` file. -itest!( - package_json_auto_discovered_for_local_script_arg_with_stop { - args: "run -L debug with_stop/some/nested/dir/main.ts", - output: "run/with_package_json/with_stop/main.out", - cwd: Some("run/with_package_json/"), - copy_temp_dir: Some("run/with_package_json/"), - envs: env_vars_for_npm_tests(), - http_server: true, - exit_code: 1, - } -); - #[test] fn package_json_no_node_modules_dir_created() { // it should not create a node_modules directory @@ -3395,81 +1867,6 @@ fn node_modules_dir_no_npm_specifiers_no_dir_created() { assert!(!temp_dir.path().join("node_modules").exists()); } -itest!(wasm_streaming_panic_test { - args: "run run/wasm_streaming_panic_test.js", - output: "run/wasm_streaming_panic_test.js.out", - exit_code: 1, -}); - -// Regression test for https://github.com/denoland/deno/issues/13897. -itest!(fetch_async_error_stack { - args: "run --quiet -A run/fetch_async_error_stack.ts", - output: "run/fetch_async_error_stack.ts.out", - exit_code: 1, -}); - -itest!(event_listener_error { - args: "run --quiet run/event_listener_error.ts", - output: "run/event_listener_error.ts.out", - exit_code: 1, -}); - -itest!(event_listener_error_handled { - args: "run --quiet run/event_listener_error_handled.ts", - output: "run/event_listener_error_handled.ts.out", -}); - -// https://github.com/denoland/deno/pull/14159#issuecomment-1092285446 -itest!(event_listener_error_immediate_exit { - args: "run --quiet run/event_listener_error_immediate_exit.ts", - output: "run/event_listener_error_immediate_exit.ts.out", - exit_code: 1, -}); - -// https://github.com/denoland/deno/pull/14159#issuecomment-1092285446 -itest!(event_listener_error_immediate_exit_worker { - args: "run --quiet -A run/event_listener_error_immediate_exit_worker.ts", - output: "run/event_listener_error_immediate_exit_worker.ts.out", - exit_code: 1, -}); - -itest!(set_timeout_error { - args: "run --quiet run/set_timeout_error.ts", - output: "run/set_timeout_error.ts.out", - exit_code: 1, -}); - -itest!(set_timeout_error_handled { - args: "run --quiet run/set_timeout_error_handled.ts", - output: "run/set_timeout_error_handled.ts.out", -}); - -itest!(aggregate_error { - args: "run --quiet run/aggregate_error.ts", - output: "run/aggregate_error.out", - exit_code: 1, -}); - -itest!(complex_error { - args: "run --quiet run/complex_error.ts", - output: "run/complex_error.ts.out", - exit_code: 1, -}); - -// Regression test for https://github.com/denoland/deno/issues/16340. -itest!(error_with_errors_prop { - args: "run --quiet run/error_with_errors_prop.js", - output: "run/error_with_errors_prop.js.out", - exit_code: 1, -}); - -// Regression test for https://github.com/denoland/deno/issues/12143. -itest!(js_root_with_ts_check { - args: "run --quiet --check run/js_root_with_ts_check.js", - output: "run/js_root_with_ts_check.js.out", - exit_code: 1, -}); - #[test] fn check_local_then_remote() { let _http_guard = util::http_server(); @@ -3502,18 +1899,6 @@ fn check_local_then_remote() { assert_contains!(stderr, "Type 'string' is not assignable to type 'number'."); } -// Regression test for https://github.com/denoland/deno/issues/15163 -itest!(check_js_points_to_ts { - args: "run --quiet --check --config run/checkjs.tsconfig.json run/check_js_points_to_ts/test.js", - output: "run/check_js_points_to_ts/test.js.out", - exit_code: 1, -}); - -itest!(no_prompt_flag { - args: "run --quiet --no-prompt run/no_prompt.ts", - output_str: Some(""), -}); - #[test] fn permission_request_with_no_prompt() { TestContext::default() @@ -3544,57 +1929,6 @@ fn deno_no_prompt_environment_variable() { assert!(output.status.success()); } -itest!(report_error { - args: "run --quiet run/report_error.ts", - output: "run/report_error.ts.out", - exit_code: 1, -}); - -itest!(report_error_handled { - args: "run --quiet run/report_error_handled.ts", - output: "run/report_error_handled.ts.out", -}); - -// Regression test for https://github.com/denoland/deno/issues/15513. -itest!(report_error_end_of_program { - args: "run --quiet run/report_error_end_of_program.ts", - output: "run/report_error_end_of_program.ts.out", - exit_code: 1, -}); - -itest!(queue_microtask_error { - args: "run --quiet run/queue_microtask_error.ts", - output: "run/queue_microtask_error.ts.out", - exit_code: 1, -}); - -itest!(queue_microtask_error_handled { - args: "run --quiet run/queue_microtask_error_handled.ts", - output: "run/queue_microtask_error_handled.ts.out", -}); - -itest!(spawn_stdout_inherit { - args: "run --quiet -A run/spawn_stdout_inherit.ts", - output: "run/spawn_stdout_inherit.ts.out", -}); - -itest!(error_name_non_string { - args: "run --quiet run/error_name_non_string.js", - output: "run/error_name_non_string.js.out", - exit_code: 1, -}); - -itest!(custom_inspect_url { - args: "run run/custom_inspect_url.js", - output: "run/custom_inspect_url.js.out", -}); - -itest!(config_json_import { - args: "run --quiet -c jsx/deno-jsx.json run/config_json_import.ts", - output: "run/config_json_import.ts.out", - http_server: true, -}); - #[test] fn running_declaration_files() { let context = TestContextBuilder::new().use_temp_cwd().build(); @@ -3613,11 +1947,6 @@ fn running_declaration_files() { } } -itest!(test_and_bench_are_noops_in_run { - args: "run run/test_and_bench_in_run.js", - output_str: Some(""), -}); - #[cfg(not(target_os = "windows"))] itest!(spawn_kill_permissions { args: "run --quiet --allow-run=cat spawn_kill_permissions.ts", @@ -3628,51 +1957,6 @@ itest!(spawn_kill_permissions { output_str: Some(""), }); -itest!(followup_dyn_import_resolved { - args: "run --allow-read run/followup_dyn_import_resolves/main.ts", - output: "run/followup_dyn_import_resolves/main.ts.out", -}); - -itest!(unhandled_rejection { - args: "run --check run/unhandled_rejection.ts", - output: "run/unhandled_rejection.ts.out", -}); - -itest!(unhandled_rejection_sync_error { - args: "run --check run/unhandled_rejection_sync_error.ts", - output: "run/unhandled_rejection_sync_error.ts.out", -}); - -// Regression test for https://github.com/denoland/deno/issues/15661 -itest!(unhandled_rejection_dynamic_import { - args: "run --allow-read run/unhandled_rejection_dynamic_import/main.ts", - output: "run/unhandled_rejection_dynamic_import/main.ts.out", - exit_code: 1, -}); - -// Regression test for https://github.com/denoland/deno/issues/16909 -itest!(unhandled_rejection_dynamic_import2 { - args: "run --allow-read run/unhandled_rejection_dynamic_import2/main.ts", - output: "run/unhandled_rejection_dynamic_import2/main.ts.out", -}); - -itest!(rejection_handled { - args: "run --check run/rejection_handled.ts", - output: "run/rejection_handled.out", -}); - -itest!(nested_error { - args: "run run/nested_error/main.ts", - output: "run/nested_error/main.ts.out", - exit_code: 1, -}); - -itest!(node_env_var_allowlist { - args: "run --no-prompt run/node_env_var_allowlist.ts", - output: "run/node_env_var_allowlist.ts.out", - exit_code: 1, -}); - #[test] fn cache_test() { let _g = util::http_server(); @@ -4212,48 +2496,6 @@ fn broken_stdout_repl() { assert_not_contains!(stderr, "panic"); } -itest!(error_cause { - args: "run run/error_cause.ts", - output: "run/error_cause.ts.out", - exit_code: 1, -}); - -itest!(error_cause_recursive_aggregate { - args: "run error_cause_recursive_aggregate.ts", - output: "error_cause_recursive_aggregate.ts.out", - exit_code: 1, -}); - -itest!(error_cause_recursive_tail { - args: "run error_cause_recursive_tail.ts", - output: "error_cause_recursive_tail.ts.out", - exit_code: 1, -}); - -itest!(error_cause_recursive { - args: "run run/error_cause_recursive.ts", - output: "run/error_cause_recursive.ts.out", - exit_code: 1, -}); - -itest!(js_without_extension { - args: "run --ext js --check file_extensions/js_without_extension", - output: "file_extensions/js_without_extension.out", - exit_code: 0, -}); - -itest!(ts_without_extension { - args: "run --ext ts --check file_extensions/ts_without_extension", - output: "file_extensions/ts_without_extension.out", - exit_code: 0, -}); - -itest!(ext_flag_takes_precedence_over_extension { - args: "run --ext ts --check file_extensions/ts_with_js_extension.js", - output: "file_extensions/ts_with_js_extension.out", - exit_code: 0, -}); - #[tokio::test(flavor = "multi_thread")] async fn websocketstream_ping() { let _g = util::http_server(); @@ -4435,24 +2677,6 @@ async fn websocket_server_idletimeout() { assert_eq!(child.wait().unwrap().code(), Some(123)); } -itest!(no_lock_flag { - args: "run --allow-import --no-lock run/no_lock_flag/main.ts", - output: "run/no_lock_flag/main.out", - http_server: true, - exit_code: 0, -}); - -itest!(permission_args { - args: "run run/001_hello.js --allow-net", - output: "run/permission_args.out", - envs: vec![("NO_COLOR".to_string(), "1".to_string())], -}); - -itest!(permission_args_quiet { - args: "run --quiet run/001_hello.js --allow-net", - output: "run/001_hello.js.out", -}); - // Regression test for https://github.com/denoland/deno/issues/16772 #[test] fn file_fetcher_preserves_permissions() { @@ -4560,12 +2784,6 @@ fn permission_prompt_escapes_ansi_codes_and_control_chars() { } } -itest!(dynamic_import_syntax_error { - args: "run -A run/dynamic_import_syntax_error.js", - output: "run/dynamic_import_syntax_error.js.out", - exit_code: 1, -}); - itest!(extension_import { args: "run run/extension_import.ts", output: "run/extension_import.ts.out", @@ -4679,25 +2897,6 @@ console.log(returnsHi());"#, .assert_exit_code(1); } -itest!(explicit_resource_management { - args: "run --quiet --check run/explicit_resource_management/main.ts", - output: "run/explicit_resource_management/main.out", -}); - -itest!(unsafe_proto { - args: "run -A run/unsafe_proto/main.js", - output: "run/unsafe_proto/main.out", - http_server: false, - exit_code: 0, -}); - -itest!(unsafe_proto_flag { - args: "run -A --unstable-unsafe-proto run/unsafe_proto/main.js", - output: "run/unsafe_proto/main_with_unsafe_proto_flag.out", - http_server: false, - exit_code: 0, -}); - // TODO(bartlomieju): temporary disabled // itest!(warn_on_deprecated_api { // args: "run -A run/warn_on_deprecated_api/main.js", diff --git a/tests/specs/run/_001_hello/001_hello.js b/tests/specs/run/_001_hello/001_hello.js new file mode 100644 index 0000000000..accefceba6 --- /dev/null +++ b/tests/specs/run/_001_hello/001_hello.js @@ -0,0 +1 @@ +console.log("Hello World"); diff --git a/tests/testdata/run/001_hello.js.out b/tests/specs/run/_001_hello/001_hello.js.out similarity index 100% rename from tests/testdata/run/001_hello.js.out rename to tests/specs/run/_001_hello/001_hello.js.out diff --git a/tests/specs/run/_001_hello/__test__.jsonc b/tests/specs/run/_001_hello/__test__.jsonc new file mode 100644 index 0000000000..4fd8126f0c --- /dev/null +++ b/tests/specs/run/_001_hello/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload 001_hello.js", + "output": "001_hello.js.out" +} diff --git a/tests/specs/run/_002_hello/002_hello.ts b/tests/specs/run/_002_hello/002_hello.ts new file mode 100644 index 0000000000..accefceba6 --- /dev/null +++ b/tests/specs/run/_002_hello/002_hello.ts @@ -0,0 +1 @@ +console.log("Hello World"); diff --git a/tests/testdata/run/002_hello.ts.out b/tests/specs/run/_002_hello/002_hello.ts.out similarity index 100% rename from tests/testdata/run/002_hello.ts.out rename to tests/specs/run/_002_hello/002_hello.ts.out diff --git a/tests/specs/run/_002_hello/__test__.jsonc b/tests/specs/run/_002_hello/__test__.jsonc new file mode 100644 index 0000000000..dde74d27cb --- /dev/null +++ b/tests/specs/run/_002_hello/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload 002_hello.ts", + "output": "002_hello.ts.out" +} diff --git a/tests/specs/run/_003_relative_import/003_relative_import.ts b/tests/specs/run/_003_relative_import/003_relative_import.ts new file mode 100644 index 0000000000..d392f4a5d1 --- /dev/null +++ b/tests/specs/run/_003_relative_import/003_relative_import.ts @@ -0,0 +1,3 @@ +import { printHello } from "./print_hello.ts"; + +printHello(); diff --git a/tests/testdata/run/003_relative_import.ts.out b/tests/specs/run/_003_relative_import/003_relative_import.ts.out similarity index 100% rename from tests/testdata/run/003_relative_import.ts.out rename to tests/specs/run/_003_relative_import/003_relative_import.ts.out diff --git a/tests/specs/run/_003_relative_import/__test__.jsonc b/tests/specs/run/_003_relative_import/__test__.jsonc new file mode 100644 index 0000000000..7bed2c00af --- /dev/null +++ b/tests/specs/run/_003_relative_import/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload 003_relative_import.ts", + "output": "003_relative_import.ts.out" +} diff --git a/tests/specs/run/_003_relative_import/print_hello.ts b/tests/specs/run/_003_relative_import/print_hello.ts new file mode 100644 index 0000000000..b9c0ad5275 --- /dev/null +++ b/tests/specs/run/_003_relative_import/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/testdata/run/004_set_timeout.ts b/tests/specs/run/_004_set_timeout/004_set_timeout.ts similarity index 100% rename from tests/testdata/run/004_set_timeout.ts rename to tests/specs/run/_004_set_timeout/004_set_timeout.ts diff --git a/tests/testdata/run/004_set_timeout.ts.out b/tests/specs/run/_004_set_timeout/004_set_timeout.ts.out similarity index 100% rename from tests/testdata/run/004_set_timeout.ts.out rename to tests/specs/run/_004_set_timeout/004_set_timeout.ts.out diff --git a/tests/specs/run/_004_set_timeout/__test__.jsonc b/tests/specs/run/_004_set_timeout/__test__.jsonc new file mode 100644 index 0000000000..6904dc0935 --- /dev/null +++ b/tests/specs/run/_004_set_timeout/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload 004_set_timeout.ts", + "output": "004_set_timeout.ts.out" +} diff --git a/tests/testdata/run/005_more_imports.ts b/tests/specs/run/_005_more_imports/005_more_imports.ts similarity index 65% rename from tests/testdata/run/005_more_imports.ts rename to tests/specs/run/_005_more_imports/005_more_imports.ts index 6c96fac64c..c69556be15 100644 --- a/tests/testdata/run/005_more_imports.ts +++ b/tests/specs/run/_005_more_imports/005_more_imports.ts @@ -1,4 +1,4 @@ -import { printHello3, returnsFoo2, returnsHi } from "../subdir/mod1.ts"; +import { printHello3, returnsFoo2, returnsHi } from "./mod1.ts"; printHello3(); diff --git a/tests/testdata/run/005_more_imports.ts.out b/tests/specs/run/_005_more_imports/005_more_imports.ts.out similarity index 100% rename from tests/testdata/run/005_more_imports.ts.out rename to tests/specs/run/_005_more_imports/005_more_imports.ts.out diff --git a/tests/specs/run/_005_more_imports/__test__.jsonc b/tests/specs/run/_005_more_imports/__test__.jsonc new file mode 100644 index 0000000000..159a0265a8 --- /dev/null +++ b/tests/specs/run/_005_more_imports/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload 005_more_imports.ts", + "output": "005_more_imports.ts.out" +} diff --git a/tests/specs/run/_005_more_imports/mod1.ts b/tests/specs/run/_005_more_imports/mod1.ts new file mode 100644 index 0000000000..5e58f432ed --- /dev/null +++ b/tests/specs/run/_005_more_imports/mod1.ts @@ -0,0 +1,17 @@ +import { printHello2, returnsFoo } from "./subdir2/mod2.ts"; + +export function returnsHi(): string { + return "Hi"; +} + +export function returnsFoo2(): string { + return returnsFoo(); +} + +export function printHello3() { + printHello2(); +} + +export function throwsError() { + throw Error("exception from mod1"); +} diff --git a/tests/specs/run/_005_more_imports/print_hello.ts b/tests/specs/run/_005_more_imports/print_hello.ts new file mode 100644 index 0000000000..b9c0ad5275 --- /dev/null +++ b/tests/specs/run/_005_more_imports/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/specs/run/_005_more_imports/subdir2/mod2.ts b/tests/specs/run/_005_more_imports/subdir2/mod2.ts new file mode 100644 index 0000000000..9071d0aeb4 --- /dev/null +++ b/tests/specs/run/_005_more_imports/subdir2/mod2.ts @@ -0,0 +1,9 @@ +import { printHello } from "../print_hello.ts"; + +export function returnsFoo(): string { + return "Foo"; +} + +export function printHello2() { + printHello(); +} diff --git a/tests/specs/run/_006_url_imports/006_url_imports.ts b/tests/specs/run/_006_url_imports/006_url_imports.ts new file mode 100644 index 0000000000..4036f27ed8 --- /dev/null +++ b/tests/specs/run/_006_url_imports/006_url_imports.ts @@ -0,0 +1,3 @@ +import { printHello } from "http://localhost:4545/subdir/mod2.ts"; +printHello(); +console.log("success"); diff --git a/tests/specs/run/_006_url_imports/006_url_imports.ts.out b/tests/specs/run/_006_url_imports/006_url_imports.ts.out new file mode 100644 index 0000000000..989ce33e93 --- /dev/null +++ b/tests/specs/run/_006_url_imports/006_url_imports.ts.out @@ -0,0 +1,2 @@ +Hello +success diff --git a/tests/specs/run/_006_url_imports/__test__.jsonc b/tests/specs/run/_006_url_imports/__test__.jsonc new file mode 100644 index 0000000000..50c0379ab9 --- /dev/null +++ b/tests/specs/run/_006_url_imports/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-import 006_url_imports.ts", + "output": "006_url_imports.ts.out" +} diff --git a/tests/specs/run/_006_url_imports/print_hello.ts b/tests/specs/run/_006_url_imports/print_hello.ts new file mode 100644 index 0000000000..b9c0ad5275 --- /dev/null +++ b/tests/specs/run/_006_url_imports/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/specs/run/_006_url_imports/subdir2/mod2.ts b/tests/specs/run/_006_url_imports/subdir2/mod2.ts new file mode 100644 index 0000000000..9071d0aeb4 --- /dev/null +++ b/tests/specs/run/_006_url_imports/subdir2/mod2.ts @@ -0,0 +1,9 @@ +import { printHello } from "../print_hello.ts"; + +export function returnsFoo(): string { + return "Foo"; +} + +export function printHello2() { + printHello(); +} diff --git a/tests/testdata/run/012_async.ts b/tests/specs/run/_012_async/012_async.ts similarity index 100% rename from tests/testdata/run/012_async.ts rename to tests/specs/run/_012_async/012_async.ts diff --git a/tests/testdata/run/012_async.ts.out b/tests/specs/run/_012_async/012_async.ts.out similarity index 100% rename from tests/testdata/run/012_async.ts.out rename to tests/specs/run/_012_async/012_async.ts.out diff --git a/tests/specs/run/_012_async/__test__.jsonc b/tests/specs/run/_012_async/__test__.jsonc new file mode 100644 index 0000000000..2778f04847 --- /dev/null +++ b/tests/specs/run/_012_async/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload 012_async.ts", + "output": "012_async.ts.out" +} diff --git a/tests/specs/run/_013_dynamic_import/013_dynamic_import.ts b/tests/specs/run/_013_dynamic_import/013_dynamic_import.ts new file mode 100644 index 0000000000..5e73b6eb79 --- /dev/null +++ b/tests/specs/run/_013_dynamic_import/013_dynamic_import.ts @@ -0,0 +1,15 @@ +(async () => { + const { returnsHi, returnsFoo2, printHello3 } = await import( + "./mod1.ts" + ); + + printHello3(); + + if (returnsHi() !== "Hi") { + throw Error("Unexpected"); + } + + if (returnsFoo2() !== "Foo") { + throw Error("Unexpected"); + } +})(); diff --git a/tests/testdata/run/013_dynamic_import.ts.out b/tests/specs/run/_013_dynamic_import/013_dynamic_import.ts.out similarity index 100% rename from tests/testdata/run/013_dynamic_import.ts.out rename to tests/specs/run/_013_dynamic_import/013_dynamic_import.ts.out diff --git a/tests/specs/run/_013_dynamic_import/__test__.jsonc b/tests/specs/run/_013_dynamic_import/__test__.jsonc new file mode 100644 index 0000000000..8be2c975bd --- /dev/null +++ b/tests/specs/run/_013_dynamic_import/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read 013_dynamic_import.ts", + "output": "013_dynamic_import.ts.out" +} diff --git a/tests/specs/run/_013_dynamic_import/mod1.ts b/tests/specs/run/_013_dynamic_import/mod1.ts new file mode 100644 index 0000000000..5e58f432ed --- /dev/null +++ b/tests/specs/run/_013_dynamic_import/mod1.ts @@ -0,0 +1,17 @@ +import { printHello2, returnsFoo } from "./subdir2/mod2.ts"; + +export function returnsHi(): string { + return "Hi"; +} + +export function returnsFoo2(): string { + return returnsFoo(); +} + +export function printHello3() { + printHello2(); +} + +export function throwsError() { + throw Error("exception from mod1"); +} diff --git a/tests/specs/run/_013_dynamic_import/print_hello.ts b/tests/specs/run/_013_dynamic_import/print_hello.ts new file mode 100644 index 0000000000..b9c0ad5275 --- /dev/null +++ b/tests/specs/run/_013_dynamic_import/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/specs/run/_013_dynamic_import/subdir2/mod2.ts b/tests/specs/run/_013_dynamic_import/subdir2/mod2.ts new file mode 100644 index 0000000000..9071d0aeb4 --- /dev/null +++ b/tests/specs/run/_013_dynamic_import/subdir2/mod2.ts @@ -0,0 +1,9 @@ +import { printHello } from "../print_hello.ts"; + +export function returnsFoo(): string { + return "Foo"; +} + +export function printHello2() { + printHello(); +} diff --git a/tests/specs/run/_014_duplicate_import/014_duplicate_import.ts b/tests/specs/run/_014_duplicate_import/014_duplicate_import.ts new file mode 100644 index 0000000000..b996ca8aef --- /dev/null +++ b/tests/specs/run/_014_duplicate_import/014_duplicate_import.ts @@ -0,0 +1,9 @@ +// with all the imports of the same module, the module should only be +// instantiated once +import "./auto_print_hello.ts"; + +import "./auto_print_hello.ts"; + +(async () => { + await import("./auto_print_hello.ts"); +})(); diff --git a/tests/testdata/run/014_duplicate_import.ts.out b/tests/specs/run/_014_duplicate_import/014_duplicate_import.ts.out similarity index 100% rename from tests/testdata/run/014_duplicate_import.ts.out rename to tests/specs/run/_014_duplicate_import/014_duplicate_import.ts.out diff --git a/tests/specs/run/_014_duplicate_import/__test__.jsonc b/tests/specs/run/_014_duplicate_import/__test__.jsonc new file mode 100644 index 0000000000..7172fc1833 --- /dev/null +++ b/tests/specs/run/_014_duplicate_import/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read 014_duplicate_import.ts ", + "output": "014_duplicate_import.ts.out" +} diff --git a/tests/specs/run/_014_duplicate_import/auto_print_hello.ts b/tests/specs/run/_014_duplicate_import/auto_print_hello.ts new file mode 100644 index 0000000000..5efa72e03f --- /dev/null +++ b/tests/specs/run/_014_duplicate_import/auto_print_hello.ts @@ -0,0 +1,2 @@ +console.log("hello!"); +export default {}; diff --git a/tests/testdata/run/015_duplicate_parallel_import.js b/tests/specs/run/_015_duplicate_parallel_import/015_duplicate_parallel_import.js similarity index 91% rename from tests/testdata/run/015_duplicate_parallel_import.js rename to tests/specs/run/_015_duplicate_parallel_import/015_duplicate_parallel_import.js index 2fbe2c732e..136d80f462 100644 --- a/tests/testdata/run/015_duplicate_parallel_import.js +++ b/tests/specs/run/_015_duplicate_parallel_import/015_duplicate_parallel_import.js @@ -3,7 +3,7 @@ const promises = new Array(100) .fill(null) - .map(() => import("../subdir/mod1.ts")); + .map(() => import("./mod1.ts")); Promise.all(promises).then((imports) => { const mod = imports.reduce((first, cur) => { diff --git a/tests/testdata/run/015_duplicate_parallel_import.js.out b/tests/specs/run/_015_duplicate_parallel_import/015_duplicate_parallel_import.js.out similarity index 100% rename from tests/testdata/run/015_duplicate_parallel_import.js.out rename to tests/specs/run/_015_duplicate_parallel_import/015_duplicate_parallel_import.js.out diff --git a/tests/specs/run/_015_duplicate_parallel_import/__test__.jsonc b/tests/specs/run/_015_duplicate_parallel_import/__test__.jsonc new file mode 100644 index 0000000000..44fe479e29 --- /dev/null +++ b/tests/specs/run/_015_duplicate_parallel_import/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read 015_duplicate_parallel_import.js", + "output": "015_duplicate_parallel_import.js.out" +} diff --git a/tests/specs/run/_015_duplicate_parallel_import/mod1.ts b/tests/specs/run/_015_duplicate_parallel_import/mod1.ts new file mode 100644 index 0000000000..5e58f432ed --- /dev/null +++ b/tests/specs/run/_015_duplicate_parallel_import/mod1.ts @@ -0,0 +1,17 @@ +import { printHello2, returnsFoo } from "./subdir2/mod2.ts"; + +export function returnsHi(): string { + return "Hi"; +} + +export function returnsFoo2(): string { + return returnsFoo(); +} + +export function printHello3() { + printHello2(); +} + +export function throwsError() { + throw Error("exception from mod1"); +} diff --git a/tests/specs/run/_015_duplicate_parallel_import/print_hello.ts b/tests/specs/run/_015_duplicate_parallel_import/print_hello.ts new file mode 100644 index 0000000000..b9c0ad5275 --- /dev/null +++ b/tests/specs/run/_015_duplicate_parallel_import/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/specs/run/_015_duplicate_parallel_import/subdir2/mod2.ts b/tests/specs/run/_015_duplicate_parallel_import/subdir2/mod2.ts new file mode 100644 index 0000000000..9071d0aeb4 --- /dev/null +++ b/tests/specs/run/_015_duplicate_parallel_import/subdir2/mod2.ts @@ -0,0 +1,9 @@ +import { printHello } from "../print_hello.ts"; + +export function returnsFoo(): string { + return "Foo"; +} + +export function printHello2() { + printHello(); +} diff --git a/tests/testdata/run/016_double_await.ts b/tests/specs/run/_016_double_await/016_double_await.ts similarity index 100% rename from tests/testdata/run/016_double_await.ts rename to tests/specs/run/_016_double_await/016_double_await.ts diff --git a/tests/testdata/run/016_double_await.ts.out b/tests/specs/run/_016_double_await/016_double_await.ts.out similarity index 100% rename from tests/testdata/run/016_double_await.ts.out rename to tests/specs/run/_016_double_await/016_double_await.ts.out diff --git a/tests/specs/run/_016_double_await/__test__.jsonc b/tests/specs/run/_016_double_await/__test__.jsonc new file mode 100644 index 0000000000..9ff2027168 --- /dev/null +++ b/tests/specs/run/_016_double_await/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --allow-read --reload 016_double_await.ts", + "output": "016_double_await.ts.out" +} diff --git a/tests/specs/run/_017_import_redirect/017_import_redirect.ts b/tests/specs/run/_017_import_redirect/017_import_redirect.ts new file mode 100644 index 0000000000..1265dd4edc --- /dev/null +++ b/tests/specs/run/_017_import_redirect/017_import_redirect.ts @@ -0,0 +1,4 @@ +// http -> https redirect would happen: +import { printHello } from "http://gist.githubusercontent.com/ry/f12b2aa3409e6b52645bc346a9e22929/raw/79318f239f51d764384a8bded8d7c6a833610dde/print_hello.ts"; + +printHello(); diff --git a/tests/testdata/run/017_import_redirect.ts.out b/tests/specs/run/_017_import_redirect/017_import_redirect.ts.out similarity index 100% rename from tests/testdata/run/017_import_redirect.ts.out rename to tests/specs/run/_017_import_redirect/017_import_redirect.ts.out diff --git a/tests/specs/run/_017_import_redirect/__test__.jsonc b/tests/specs/run/_017_import_redirect/__test__.jsonc new file mode 100644 index 0000000000..dd5442dcd1 --- /dev/null +++ b/tests/specs/run/_017_import_redirect/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --allow-import --reload --check 017_import_redirect.ts", + "output": "017_import_redirect.ts.out" +} diff --git a/tests/specs/run/_017_import_redirect_check/017_import_redirect.ts b/tests/specs/run/_017_import_redirect_check/017_import_redirect.ts new file mode 100644 index 0000000000..1265dd4edc --- /dev/null +++ b/tests/specs/run/_017_import_redirect_check/017_import_redirect.ts @@ -0,0 +1,4 @@ +// http -> https redirect would happen: +import { printHello } from "http://gist.githubusercontent.com/ry/f12b2aa3409e6b52645bc346a9e22929/raw/79318f239f51d764384a8bded8d7c6a833610dde/print_hello.ts"; + +printHello(); diff --git a/tests/testdata/run/https_import.ts.out b/tests/specs/run/_017_import_redirect_check/017_import_redirect.ts.out similarity index 100% rename from tests/testdata/run/https_import.ts.out rename to tests/specs/run/_017_import_redirect_check/017_import_redirect.ts.out diff --git a/tests/specs/run/_017_import_redirect_check/__test__.jsonc b/tests/specs/run/_017_import_redirect_check/__test__.jsonc new file mode 100644 index 0000000000..dd5442dcd1 --- /dev/null +++ b/tests/specs/run/_017_import_redirect_check/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --allow-import --reload --check 017_import_redirect.ts", + "output": "017_import_redirect.ts.out" +} diff --git a/tests/specs/run/_017_import_redirect_info/017_import_redirect.ts b/tests/specs/run/_017_import_redirect_info/017_import_redirect.ts new file mode 100644 index 0000000000..1265dd4edc --- /dev/null +++ b/tests/specs/run/_017_import_redirect_info/017_import_redirect.ts @@ -0,0 +1,4 @@ +// http -> https redirect would happen: +import { printHello } from "http://gist.githubusercontent.com/ry/f12b2aa3409e6b52645bc346a9e22929/raw/79318f239f51d764384a8bded8d7c6a833610dde/print_hello.ts"; + +printHello(); diff --git a/tests/testdata/run/017_import_redirect_info.out b/tests/specs/run/_017_import_redirect_info/017_import_redirect_info.out similarity index 100% rename from tests/testdata/run/017_import_redirect_info.out rename to tests/specs/run/_017_import_redirect_info/017_import_redirect_info.out diff --git a/tests/specs/run/_017_import_redirect_info/__test__.jsonc b/tests/specs/run/_017_import_redirect_info/__test__.jsonc new file mode 100644 index 0000000000..d23e8dd998 --- /dev/null +++ b/tests/specs/run/_017_import_redirect_info/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info --quiet --allow-import --reload 017_import_redirect.ts", + "output": "017_import_redirect_info.out" +} diff --git a/tests/specs/run/_017_import_redirect_vendor_dir/017_import_redirect.ts b/tests/specs/run/_017_import_redirect_vendor_dir/017_import_redirect.ts new file mode 100644 index 0000000000..1265dd4edc --- /dev/null +++ b/tests/specs/run/_017_import_redirect_vendor_dir/017_import_redirect.ts @@ -0,0 +1,4 @@ +// http -> https redirect would happen: +import { printHello } from "http://gist.githubusercontent.com/ry/f12b2aa3409e6b52645bc346a9e22929/raw/79318f239f51d764384a8bded8d7c6a833610dde/print_hello.ts"; + +printHello(); diff --git a/tests/testdata/run/import_blob_url_imports.ts.out b/tests/specs/run/_017_import_redirect_vendor_dir/017_import_redirect.ts.out similarity index 100% rename from tests/testdata/run/import_blob_url_imports.ts.out rename to tests/specs/run/_017_import_redirect_vendor_dir/017_import_redirect.ts.out diff --git a/tests/specs/run/_017_import_redirect_vendor_dir/__test__.jsonc b/tests/specs/run/_017_import_redirect_vendor_dir/__test__.jsonc new file mode 100644 index 0000000000..dd5442dcd1 --- /dev/null +++ b/tests/specs/run/_017_import_redirect_vendor_dir/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --allow-import --reload --check 017_import_redirect.ts", + "output": "017_import_redirect.ts.out" +} diff --git a/tests/testdata/run/018_async_catch.ts b/tests/specs/run/_018_async_catch/018_async_catch.ts similarity index 100% rename from tests/testdata/run/018_async_catch.ts rename to tests/specs/run/_018_async_catch/018_async_catch.ts diff --git a/tests/testdata/run/018_async_catch.ts.out b/tests/specs/run/_018_async_catch/018_async_catch.ts.out similarity index 100% rename from tests/testdata/run/018_async_catch.ts.out rename to tests/specs/run/_018_async_catch/018_async_catch.ts.out diff --git a/tests/specs/run/_018_async_catch/__test__.jsonc b/tests/specs/run/_018_async_catch/__test__.jsonc new file mode 100644 index 0000000000..7995c79fdb --- /dev/null +++ b/tests/specs/run/_018_async_catch/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload 018_async_catch.ts", + "output": "018_async_catch.ts.out" +} diff --git a/tests/specs/run/_019_media_types/019_media_types.ts b/tests/specs/run/_019_media_types/019_media_types.ts new file mode 100644 index 0000000000..d985bd2496 --- /dev/null +++ b/tests/specs/run/_019_media_types/019_media_types.ts @@ -0,0 +1,24 @@ +// When run against the test HTTP server, it will serve different media types +// based on the URL containing `.t#.` strings, which exercises the different +// mapping of media types end to end. + +import { loaded as loadedTs1 } from "http://localhost:4545/subdir/mt_text_typescript.t1.ts"; +import { loaded as loadedTs2 } from "http://localhost:4545/subdir/mt_video_vdn.t2.ts"; +import { loaded as loadedTs3 } from "http://localhost:4545/subdir/mt_video_mp2t.t3.ts"; +import { loaded as loadedTs4 } from "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts"; +import { loaded as loadedJs1 } from "http://localhost:4545/subdir/mt_text_javascript.j1.js"; +import { loaded as loadedJs2 } from "http://localhost:4545/subdir/mt_application_ecmascript.j2.js"; +import { loaded as loadedJs3 } from "http://localhost:4545/subdir/mt_text_ecmascript.j3.js"; +import { loaded as loadedJs4 } from "http://localhost:4545/subdir/mt_application_x_javascript.j4.js"; + +console.log( + "success", + loadedTs1, + loadedTs2, + loadedTs3, + loadedTs4, + loadedJs1, + loadedJs2, + loadedJs3, + loadedJs4, +); diff --git a/tests/testdata/run/019_media_types.ts.out b/tests/specs/run/_019_media_types/019_media_types.ts.out similarity index 100% rename from tests/testdata/run/019_media_types.ts.out rename to tests/specs/run/_019_media_types/019_media_types.ts.out diff --git a/tests/specs/run/_019_media_types/__test__.jsonc b/tests/specs/run/_019_media_types/__test__.jsonc new file mode 100644 index 0000000000..b741a0bf22 --- /dev/null +++ b/tests/specs/run/_019_media_types/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --allow-import 019_media_types.ts", + "output": "019_media_types.ts.out" +} diff --git a/tests/specs/run/_020_json_modules/020_json_modules.ts b/tests/specs/run/_020_json_modules/020_json_modules.ts new file mode 100644 index 0000000000..bde024cf86 --- /dev/null +++ b/tests/specs/run/_020_json_modules/020_json_modules.ts @@ -0,0 +1,2 @@ +import config from "./config.json"; +console.log(JSON.stringify(config)); diff --git a/tests/testdata/run/020_json_modules.ts.out b/tests/specs/run/_020_json_modules/020_json_modules.ts.out similarity index 80% rename from tests/testdata/run/020_json_modules.ts.out rename to tests/specs/run/_020_json_modules/020_json_modules.ts.out index 948901724a..8bf0b41465 100644 --- a/tests/testdata/run/020_json_modules.ts.out +++ b/tests/specs/run/_020_json_modules/020_json_modules.ts.out @@ -1,3 +1,3 @@ error: Expected a JavaScript or TypeScript module, but identified a Json module. Consider importing Json modules with an import attribute with the type of "json". - Specifier: [WILDCARD]/subdir/config.json + Specifier: [WILDCARD]/config.json [WILDCARD] \ No newline at end of file diff --git a/tests/specs/run/_020_json_modules/__test__.jsonc b/tests/specs/run/_020_json_modules/__test__.jsonc new file mode 100644 index 0000000000..618616438a --- /dev/null +++ b/tests/specs/run/_020_json_modules/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload 020_json_modules.ts", + "output": "020_json_modules.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/_020_json_modules/config.json b/tests/specs/run/_020_json_modules/config.json new file mode 100644 index 0000000000..01c3b5e79a --- /dev/null +++ b/tests/specs/run/_020_json_modules/config.json @@ -0,0 +1,6 @@ +{ + "foo": { + "bar": true, + "baz": ["qat", 1] + } +} diff --git a/tests/specs/run/_021_mjs_modules/021_mjs_modules.ts b/tests/specs/run/_021_mjs_modules/021_mjs_modules.ts new file mode 100644 index 0000000000..326fce3e51 --- /dev/null +++ b/tests/specs/run/_021_mjs_modules/021_mjs_modules.ts @@ -0,0 +1,2 @@ +import { isMod5 } from "./mod5.mjs"; +console.log(isMod5); diff --git a/tests/testdata/run/021_mjs_modules.ts.out b/tests/specs/run/_021_mjs_modules/021_mjs_modules.ts.out similarity index 100% rename from tests/testdata/run/021_mjs_modules.ts.out rename to tests/specs/run/_021_mjs_modules/021_mjs_modules.ts.out diff --git a/tests/specs/run/_021_mjs_modules/__test__.jsonc b/tests/specs/run/_021_mjs_modules/__test__.jsonc new file mode 100644 index 0000000000..f029658862 --- /dev/null +++ b/tests/specs/run/_021_mjs_modules/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload 021_mjs_modules.ts", + "output": "021_mjs_modules.ts.out" +} diff --git a/tests/specs/run/_021_mjs_modules/mod5.mjs b/tests/specs/run/_021_mjs_modules/mod5.mjs new file mode 100644 index 0000000000..f21d8862b1 --- /dev/null +++ b/tests/specs/run/_021_mjs_modules/mod5.mjs @@ -0,0 +1 @@ +export const isMod5 = true; diff --git a/tests/testdata/run/025_reload_js_type_error.js b/tests/specs/run/_025_reload_js_type_error/025_reload_js_type_error.js similarity index 100% rename from tests/testdata/run/025_reload_js_type_error.js rename to tests/specs/run/_025_reload_js_type_error/025_reload_js_type_error.js diff --git a/tests/testdata/run/025_reload_js_type_error.js.out b/tests/specs/run/_025_reload_js_type_error/025_reload_js_type_error.js.out similarity index 100% rename from tests/testdata/run/025_reload_js_type_error.js.out rename to tests/specs/run/_025_reload_js_type_error/025_reload_js_type_error.js.out diff --git a/tests/specs/run/_025_reload_js_type_error/__test__.jsonc b/tests/specs/run/_025_reload_js_type_error/__test__.jsonc new file mode 100644 index 0000000000..ce098f9097 --- /dev/null +++ b/tests/specs/run/_025_reload_js_type_error/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload 025_reload_js_type_error.js", + "output": "025_reload_js_type_error.js.out" +} diff --git a/tests/testdata/run/027_redirect_typescript.ts b/tests/specs/run/_027_redirect_typescript/027_redirect_typescript.ts similarity index 100% rename from tests/testdata/run/027_redirect_typescript.ts rename to tests/specs/run/_027_redirect_typescript/027_redirect_typescript.ts diff --git a/tests/testdata/run/027_redirect_typescript.ts.out b/tests/specs/run/_027_redirect_typescript/027_redirect_typescript.ts.out similarity index 100% rename from tests/testdata/run/027_redirect_typescript.ts.out rename to tests/specs/run/_027_redirect_typescript/027_redirect_typescript.ts.out diff --git a/tests/specs/run/_027_redirect_typescript/__test__.jsonc b/tests/specs/run/_027_redirect_typescript/__test__.jsonc new file mode 100644 index 0000000000..fca55c9f8e --- /dev/null +++ b/tests/specs/run/_027_redirect_typescript/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-import 027_redirect_typescript.ts", + "output": "027_redirect_typescript.ts.out" +} diff --git a/tests/specs/run/_027_redirect_typescript_vendor_dir/027_redirect_typescript.ts b/tests/specs/run/_027_redirect_typescript_vendor_dir/027_redirect_typescript.ts new file mode 100644 index 0000000000..584341975f --- /dev/null +++ b/tests/specs/run/_027_redirect_typescript_vendor_dir/027_redirect_typescript.ts @@ -0,0 +1,2 @@ +import { value } from "http://localhost:4547/redirects/redirect4.ts"; +console.log(value); diff --git a/tests/specs/run/_027_redirect_typescript_vendor_dir/027_redirect_typescript.ts.out b/tests/specs/run/_027_redirect_typescript_vendor_dir/027_redirect_typescript.ts.out new file mode 100644 index 0000000000..480d4e8ca0 --- /dev/null +++ b/tests/specs/run/_027_redirect_typescript_vendor_dir/027_redirect_typescript.ts.out @@ -0,0 +1 @@ +4 imports 1 diff --git a/tests/specs/run/_027_redirect_typescript_vendor_dir/__test__.jsonc b/tests/specs/run/_027_redirect_typescript_vendor_dir/__test__.jsonc new file mode 100644 index 0000000000..f35557907b --- /dev/null +++ b/tests/specs/run/_027_redirect_typescript_vendor_dir/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --vendor --allow-import 027_redirect_typescript.ts", + "output": "027_redirect_typescript.ts.out" +} diff --git a/tests/specs/run/_027_redirect_typescript_vendor_dir/vendor/http_localhost_4545/subdir/redirects/redirect1.ts b/tests/specs/run/_027_redirect_typescript_vendor_dir/vendor/http_localhost_4545/subdir/redirects/redirect1.ts new file mode 100644 index 0000000000..d674be88c3 --- /dev/null +++ b/tests/specs/run/_027_redirect_typescript_vendor_dir/vendor/http_localhost_4545/subdir/redirects/redirect1.ts @@ -0,0 +1 @@ +export const redirect = 1; diff --git a/tests/specs/run/_027_redirect_typescript_vendor_dir/vendor/http_localhost_4545/subdir/redirects/redirect4.ts b/tests/specs/run/_027_redirect_typescript_vendor_dir/vendor/http_localhost_4545/subdir/redirects/redirect4.ts new file mode 100644 index 0000000000..45c65c5eb3 --- /dev/null +++ b/tests/specs/run/_027_redirect_typescript_vendor_dir/vendor/http_localhost_4545/subdir/redirects/redirect4.ts @@ -0,0 +1,2 @@ +import { redirect } from "./redirect1.ts"; +export const value = `4 imports ${redirect}`; diff --git a/tests/specs/run/_027_redirect_typescript_vendor_dir/vendor/manifest.json b/tests/specs/run/_027_redirect_typescript_vendor_dir/vendor/manifest.json new file mode 100644 index 0000000000..49cc42e8cc --- /dev/null +++ b/tests/specs/run/_027_redirect_typescript_vendor_dir/vendor/manifest.json @@ -0,0 +1,9 @@ +{ + "modules": { + "http://localhost:4547/redirects/redirect4.ts": { + "headers": { + "location": "http://localhost:4545/subdir/redirects/redirect4.ts" + } + } + } +} diff --git a/tests/testdata/run/028_args.ts b/tests/specs/run/_028_args/028_args.ts similarity index 100% rename from tests/testdata/run/028_args.ts rename to tests/specs/run/_028_args/028_args.ts diff --git a/tests/testdata/run/028_args.ts.out b/tests/specs/run/_028_args/028_args.ts.out similarity index 100% rename from tests/testdata/run/028_args.ts.out rename to tests/specs/run/_028_args/028_args.ts.out diff --git a/tests/specs/run/_028_args/__test__.jsonc b/tests/specs/run/_028_args/__test__.jsonc new file mode 100644 index 0000000000..6ab81bf21d --- /dev/null +++ b/tests/specs/run/_028_args/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload 028_args.ts --arg1 val1 --arg2=val2 -- arg3 arg4", + "output": "028_args.ts.out" +} diff --git a/tests/specs/run/_033_import_map_data_uri/__test__.jsonc b/tests/specs/run/_033_import_map_data_uri/__test__.jsonc new file mode 100644 index 0000000000..400269c751 --- /dev/null +++ b/tests/specs/run/_033_import_map_data_uri/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-import --import-map=data:application/json;charset=utf-8;base64,ewogICJpbXBvcnRzIjogewogICAgInRlc3Rfc2VydmVyLyI6ICJodHRwOi8vbG9jYWxob3N0OjQ1NDUvIgogIH0KfQ== test_data.ts", + "output": "test_data.ts.out" +} diff --git a/tests/specs/run/_033_import_map_data_uri/lodash/lodash.ts b/tests/specs/run/_033_import_map_data_uri/lodash/lodash.ts new file mode 100644 index 0000000000..2ec04ed3cf --- /dev/null +++ b/tests/specs/run/_033_import_map_data_uri/lodash/lodash.ts @@ -0,0 +1 @@ +console.log("Hello from remapped lodash!"); diff --git a/tests/specs/run/_033_import_map_data_uri/lodash/other_file.ts b/tests/specs/run/_033_import_map_data_uri/lodash/other_file.ts new file mode 100644 index 0000000000..714adae3fb --- /dev/null +++ b/tests/specs/run/_033_import_map_data_uri/lodash/other_file.ts @@ -0,0 +1 @@ +console.log("Hello from remapped lodash dir!"); diff --git a/tests/testdata/run/import_maps/test_data.ts b/tests/specs/run/_033_import_map_data_uri/test_data.ts similarity index 100% rename from tests/testdata/run/import_maps/test_data.ts rename to tests/specs/run/_033_import_map_data_uri/test_data.ts diff --git a/tests/testdata/run/import_maps/test_data.ts.out b/tests/specs/run/_033_import_map_data_uri/test_data.ts.out similarity index 100% rename from tests/testdata/run/import_maps/test_data.ts.out rename to tests/specs/run/_033_import_map_data_uri/test_data.ts.out diff --git a/tests/testdata/run/033_import_map_remote.out b/tests/specs/run/_033_import_map_remote/033_import_map_remote.out similarity index 100% rename from tests/testdata/run/033_import_map_remote.out rename to tests/specs/run/_033_import_map_remote/033_import_map_remote.out diff --git a/tests/specs/run/_033_import_map_remote/__test__.jsonc b/tests/specs/run/_033_import_map_remote/__test__.jsonc new file mode 100644 index 0000000000..20c848d492 --- /dev/null +++ b/tests/specs/run/_033_import_map_remote/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-import --import-map=import_map_remote.json test_remote.ts", + "output": "033_import_map_remote.out" +} diff --git a/tests/specs/run/_033_import_map_remote/import_map_remote.json b/tests/specs/run/_033_import_map_remote/import_map_remote.json new file mode 100644 index 0000000000..190fc4f55a --- /dev/null +++ b/tests/specs/run/_033_import_map_remote/import_map_remote.json @@ -0,0 +1,10 @@ +{ + "imports": { + "moment": "./moment/moment.ts", + "moment/": "./moment/", + "lodash": "./lodash/lodash.ts", + "lodash/": "./lodash/", + "https://www.unpkg.com/vue/dist/vue.runtime.esm.js": "./vue.ts", + "print_hello": "./print_hello.ts" + } +} diff --git a/tests/specs/run/_033_import_map_remote/lodash/lodash.ts b/tests/specs/run/_033_import_map_remote/lodash/lodash.ts new file mode 100644 index 0000000000..2ec04ed3cf --- /dev/null +++ b/tests/specs/run/_033_import_map_remote/lodash/lodash.ts @@ -0,0 +1 @@ +console.log("Hello from remapped lodash!"); diff --git a/tests/specs/run/_033_import_map_remote/lodash/other_file.ts b/tests/specs/run/_033_import_map_remote/lodash/other_file.ts new file mode 100644 index 0000000000..714adae3fb --- /dev/null +++ b/tests/specs/run/_033_import_map_remote/lodash/other_file.ts @@ -0,0 +1 @@ +console.log("Hello from remapped lodash dir!"); diff --git a/tests/specs/run/_033_import_map_remote/moment/moment.ts b/tests/specs/run/_033_import_map_remote/moment/moment.ts new file mode 100644 index 0000000000..2b54a431e7 --- /dev/null +++ b/tests/specs/run/_033_import_map_remote/moment/moment.ts @@ -0,0 +1 @@ +console.log("Hello from remapped moment!"); diff --git a/tests/specs/run/_033_import_map_remote/moment/other_file.ts b/tests/specs/run/_033_import_map_remote/moment/other_file.ts new file mode 100644 index 0000000000..24f3a0226d --- /dev/null +++ b/tests/specs/run/_033_import_map_remote/moment/other_file.ts @@ -0,0 +1 @@ +console.log("Hello from remapped moment dir!"); diff --git a/tests/specs/run/_033_import_map_remote/print_hello.ts b/tests/specs/run/_033_import_map_remote/print_hello.ts new file mode 100644 index 0000000000..7942573905 --- /dev/null +++ b/tests/specs/run/_033_import_map_remote/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello, world!"); +} diff --git a/tests/specs/run/_033_import_map_remote/test_remote.ts b/tests/specs/run/_033_import_map_remote/test_remote.ts new file mode 100644 index 0000000000..206bdbd5ff --- /dev/null +++ b/tests/specs/run/_033_import_map_remote/test_remote.ts @@ -0,0 +1,5 @@ +import "moment"; +import "moment/other_file.ts"; +import "lodash"; +import "lodash/other_file.ts"; +import "https://www.unpkg.com/vue/dist/vue.runtime.esm.js"; diff --git a/tests/specs/run/_033_import_map_remote/vue.ts b/tests/specs/run/_033_import_map_remote/vue.ts new file mode 100644 index 0000000000..76dbe19179 --- /dev/null +++ b/tests/specs/run/_033_import_map_remote/vue.ts @@ -0,0 +1 @@ +console.log("Hello from remapped Vue!"); diff --git a/tests/specs/run/_033_import_map_vendor_dir_remote/033_import_map_remote.out b/tests/specs/run/_033_import_map_vendor_dir_remote/033_import_map_remote.out new file mode 100644 index 0000000000..804fa0d57e --- /dev/null +++ b/tests/specs/run/_033_import_map_vendor_dir_remote/033_import_map_remote.out @@ -0,0 +1,5 @@ +Hello from remapped moment! +Hello from remapped moment dir! +Hello from remapped lodash! +Hello from remapped lodash dir! +Hello from remapped Vue! diff --git a/tests/specs/run/_033_import_map_vendor_dir_remote/__test__.jsonc b/tests/specs/run/_033_import_map_vendor_dir_remote/__test__.jsonc new file mode 100644 index 0000000000..4eb3a22c50 --- /dev/null +++ b/tests/specs/run/_033_import_map_vendor_dir_remote/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-import --import-map=import_map_remote.json --vendor test_remote.ts", + "output": "033_import_map_remote.out" +} diff --git a/tests/specs/run/_033_import_map_vendor_dir_remote/import_map_remote.json b/tests/specs/run/_033_import_map_vendor_dir_remote/import_map_remote.json new file mode 100644 index 0000000000..190fc4f55a --- /dev/null +++ b/tests/specs/run/_033_import_map_vendor_dir_remote/import_map_remote.json @@ -0,0 +1,10 @@ +{ + "imports": { + "moment": "./moment/moment.ts", + "moment/": "./moment/", + "lodash": "./lodash/lodash.ts", + "lodash/": "./lodash/", + "https://www.unpkg.com/vue/dist/vue.runtime.esm.js": "./vue.ts", + "print_hello": "./print_hello.ts" + } +} diff --git a/tests/specs/run/_033_import_map_vendor_dir_remote/lodash/lodash.ts b/tests/specs/run/_033_import_map_vendor_dir_remote/lodash/lodash.ts new file mode 100644 index 0000000000..2ec04ed3cf --- /dev/null +++ b/tests/specs/run/_033_import_map_vendor_dir_remote/lodash/lodash.ts @@ -0,0 +1 @@ +console.log("Hello from remapped lodash!"); diff --git a/tests/specs/run/_033_import_map_vendor_dir_remote/lodash/other_file.ts b/tests/specs/run/_033_import_map_vendor_dir_remote/lodash/other_file.ts new file mode 100644 index 0000000000..714adae3fb --- /dev/null +++ b/tests/specs/run/_033_import_map_vendor_dir_remote/lodash/other_file.ts @@ -0,0 +1 @@ +console.log("Hello from remapped lodash dir!"); diff --git a/tests/specs/run/_033_import_map_vendor_dir_remote/moment/moment.ts b/tests/specs/run/_033_import_map_vendor_dir_remote/moment/moment.ts new file mode 100644 index 0000000000..2b54a431e7 --- /dev/null +++ b/tests/specs/run/_033_import_map_vendor_dir_remote/moment/moment.ts @@ -0,0 +1 @@ +console.log("Hello from remapped moment!"); diff --git a/tests/specs/run/_033_import_map_vendor_dir_remote/moment/other_file.ts b/tests/specs/run/_033_import_map_vendor_dir_remote/moment/other_file.ts new file mode 100644 index 0000000000..24f3a0226d --- /dev/null +++ b/tests/specs/run/_033_import_map_vendor_dir_remote/moment/other_file.ts @@ -0,0 +1 @@ +console.log("Hello from remapped moment dir!"); diff --git a/tests/specs/run/_033_import_map_vendor_dir_remote/print_hello.ts b/tests/specs/run/_033_import_map_vendor_dir_remote/print_hello.ts new file mode 100644 index 0000000000..7942573905 --- /dev/null +++ b/tests/specs/run/_033_import_map_vendor_dir_remote/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello, world!"); +} diff --git a/tests/specs/run/_033_import_map_vendor_dir_remote/test_remote.ts b/tests/specs/run/_033_import_map_vendor_dir_remote/test_remote.ts new file mode 100644 index 0000000000..206bdbd5ff --- /dev/null +++ b/tests/specs/run/_033_import_map_vendor_dir_remote/test_remote.ts @@ -0,0 +1,5 @@ +import "moment"; +import "moment/other_file.ts"; +import "lodash"; +import "lodash/other_file.ts"; +import "https://www.unpkg.com/vue/dist/vue.runtime.esm.js"; diff --git a/tests/specs/run/_033_import_map_vendor_dir_remote/vue.ts b/tests/specs/run/_033_import_map_vendor_dir_remote/vue.ts new file mode 100644 index 0000000000..76dbe19179 --- /dev/null +++ b/tests/specs/run/_033_import_map_vendor_dir_remote/vue.ts @@ -0,0 +1 @@ +console.log("Hello from remapped Vue!"); diff --git a/tests/specs/run/_035_cached_only_flag/019_media_types.ts b/tests/specs/run/_035_cached_only_flag/019_media_types.ts new file mode 100644 index 0000000000..d985bd2496 --- /dev/null +++ b/tests/specs/run/_035_cached_only_flag/019_media_types.ts @@ -0,0 +1,24 @@ +// When run against the test HTTP server, it will serve different media types +// based on the URL containing `.t#.` strings, which exercises the different +// mapping of media types end to end. + +import { loaded as loadedTs1 } from "http://localhost:4545/subdir/mt_text_typescript.t1.ts"; +import { loaded as loadedTs2 } from "http://localhost:4545/subdir/mt_video_vdn.t2.ts"; +import { loaded as loadedTs3 } from "http://localhost:4545/subdir/mt_video_mp2t.t3.ts"; +import { loaded as loadedTs4 } from "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts"; +import { loaded as loadedJs1 } from "http://localhost:4545/subdir/mt_text_javascript.j1.js"; +import { loaded as loadedJs2 } from "http://localhost:4545/subdir/mt_application_ecmascript.j2.js"; +import { loaded as loadedJs3 } from "http://localhost:4545/subdir/mt_text_ecmascript.j3.js"; +import { loaded as loadedJs4 } from "http://localhost:4545/subdir/mt_application_x_javascript.j4.js"; + +console.log( + "success", + loadedTs1, + loadedTs2, + loadedTs3, + loadedTs4, + loadedJs1, + loadedJs2, + loadedJs3, + loadedJs4, +); diff --git a/tests/specs/run/_035_cached_only_flag/035_cached_only_flag.out b/tests/specs/run/_035_cached_only_flag/035_cached_only_flag.out new file mode 100644 index 0000000000..aad3f2fbc1 --- /dev/null +++ b/tests/specs/run/_035_cached_only_flag/035_cached_only_flag.out @@ -0,0 +1 @@ +error: Specifier not found in cache: "http://127.0.0.1:4545/019_media_types.ts", --cached-only is specified. diff --git a/tests/specs/run/_035_cached_only_flag/__test__.jsonc b/tests/specs/run/_035_cached_only_flag/__test__.jsonc new file mode 100644 index 0000000000..ac9d01cdd0 --- /dev/null +++ b/tests/specs/run/_035_cached_only_flag/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload --check --allow-import --cached-only http://127.0.0.1:4545/019_media_types.ts", + "output": "035_cached_only_flag.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/038_checkjs.js b/tests/specs/run/_038_checkjs/038_checkjs.js similarity index 100% rename from tests/testdata/run/038_checkjs.js rename to tests/specs/run/_038_checkjs/038_checkjs.js diff --git a/tests/testdata/run/038_checkjs.js.out b/tests/specs/run/_038_checkjs/038_checkjs.js.out similarity index 100% rename from tests/testdata/run/038_checkjs.js.out rename to tests/specs/run/_038_checkjs/038_checkjs.js.out diff --git a/tests/specs/run/_038_checkjs/__test__.jsonc b/tests/specs/run/_038_checkjs/__test__.jsonc new file mode 100644 index 0000000000..6915787d2d --- /dev/null +++ b/tests/specs/run/_038_checkjs/__test__.jsonc @@ -0,0 +1,6 @@ +{ + // checking if JS file is run through TS compiler + "args": "run --reload --config checkjs.tsconfig.json --check 038_checkjs.js", + "exitCode": 1, + "output": "038_checkjs.js.out" +} diff --git a/tests/specs/run/_038_checkjs/checkjs.tsconfig.json b/tests/specs/run/_038_checkjs/checkjs.tsconfig.json new file mode 100644 index 0000000000..08ac60b6cd --- /dev/null +++ b/tests/specs/run/_038_checkjs/checkjs.tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "checkJs": true + } +} diff --git a/tests/testdata/run/042_dyn_import_evalcontext.ts b/tests/specs/run/_042_dyn_import_evalcontext/042_dyn_import_evalcontext.ts similarity index 63% rename from tests/testdata/run/042_dyn_import_evalcontext.ts rename to tests/specs/run/_042_dyn_import_evalcontext/042_dyn_import_evalcontext.ts index 386ae48ec7..f39ae24685 100644 --- a/tests/testdata/run/042_dyn_import_evalcontext.ts +++ b/tests/specs/run/_042_dyn_import_evalcontext/042_dyn_import_evalcontext.ts @@ -1,5 +1,5 @@ // @ts-expect-error "Deno[Deno.internal].core" is not a public interface Deno[Deno.internal].core.evalContext( - "(async () => console.log(await import('./subdir/mod4.js')))()", + "(async () => console.log(await import('./_042_dyn_import_evalcontext/mod4.js')))()", new URL("..", import.meta.url).href, ); diff --git a/tests/testdata/run/042_dyn_import_evalcontext.ts.out b/tests/specs/run/_042_dyn_import_evalcontext/042_dyn_import_evalcontext.ts.out similarity index 100% rename from tests/testdata/run/042_dyn_import_evalcontext.ts.out rename to tests/specs/run/_042_dyn_import_evalcontext/042_dyn_import_evalcontext.ts.out diff --git a/tests/specs/run/_042_dyn_import_evalcontext/__test__.jsonc b/tests/specs/run/_042_dyn_import_evalcontext/__test__.jsonc new file mode 100644 index 0000000000..e3cb0d1844 --- /dev/null +++ b/tests/specs/run/_042_dyn_import_evalcontext/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --allow-read --reload 042_dyn_import_evalcontext.ts", + "output": "042_dyn_import_evalcontext.ts.out" +} diff --git a/tests/specs/run/_042_dyn_import_evalcontext/mod4.js b/tests/specs/run/_042_dyn_import_evalcontext/mod4.js new file mode 100644 index 0000000000..71332dbc42 --- /dev/null +++ b/tests/specs/run/_042_dyn_import_evalcontext/mod4.js @@ -0,0 +1 @@ +export const isMod4 = true; diff --git a/tests/specs/run/_044_bad_resource/044_bad_resource.ts b/tests/specs/run/_044_bad_resource/044_bad_resource.ts new file mode 100644 index 0000000000..c76a11eff9 --- /dev/null +++ b/tests/specs/run/_044_bad_resource/044_bad_resource.ts @@ -0,0 +1,3 @@ +const file = await Deno.open("./044_bad_resource.ts", { read: true }); +file.close(); +await file.seek(10, 0); diff --git a/tests/testdata/run/044_bad_resource.ts.out b/tests/specs/run/_044_bad_resource/044_bad_resource.ts.out similarity index 100% rename from tests/testdata/run/044_bad_resource.ts.out rename to tests/specs/run/_044_bad_resource/044_bad_resource.ts.out diff --git a/tests/specs/run/_044_bad_resource/__test__.jsonc b/tests/specs/run/_044_bad_resource/__test__.jsonc new file mode 100644 index 0000000000..cb7832e74a --- /dev/null +++ b/tests/specs/run/_044_bad_resource/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --reload --allow-read 044_bad_resource.ts", + "output": "044_bad_resource.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/046_jsx_test.tsx b/tests/specs/run/_046_tsx/046_jsx_test.tsx similarity index 100% rename from tests/testdata/run/046_jsx_test.tsx rename to tests/specs/run/_046_tsx/046_jsx_test.tsx diff --git a/tests/testdata/run/046_jsx_test.tsx.out b/tests/specs/run/_046_tsx/046_jsx_test.tsx.out similarity index 100% rename from tests/testdata/run/046_jsx_test.tsx.out rename to tests/specs/run/_046_tsx/046_jsx_test.tsx.out diff --git a/tests/specs/run/_046_tsx/__test__.jsonc b/tests/specs/run/_046_tsx/__test__.jsonc new file mode 100644 index 0000000000..28a48ececc --- /dev/null +++ b/tests/specs/run/_046_tsx/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload 046_jsx_test.tsx", + "output": "046_jsx_test.tsx.out" +} diff --git a/tests/testdata/run/047_jsx_test.jsx b/tests/specs/run/_047_jsx/047_jsx_test.jsx similarity index 100% rename from tests/testdata/run/047_jsx_test.jsx rename to tests/specs/run/_047_jsx/047_jsx_test.jsx diff --git a/tests/testdata/run/047_jsx_test.jsx.out b/tests/specs/run/_047_jsx/047_jsx_test.jsx.out similarity index 100% rename from tests/testdata/run/047_jsx_test.jsx.out rename to tests/specs/run/_047_jsx/047_jsx_test.jsx.out diff --git a/tests/specs/run/_047_jsx/__test__.jsonc b/tests/specs/run/_047_jsx/__test__.jsonc new file mode 100644 index 0000000000..bb89db0177 --- /dev/null +++ b/tests/specs/run/_047_jsx/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload 047_jsx_test.jsx", + "output": "047_jsx_test.jsx.out" +} diff --git a/tests/specs/run/_048_media_types_jsx/048_media_types_jsx.ts b/tests/specs/run/_048_media_types_jsx/048_media_types_jsx.ts new file mode 100644 index 0000000000..8dcd0ad687 --- /dev/null +++ b/tests/specs/run/_048_media_types_jsx/048_media_types_jsx.ts @@ -0,0 +1,32 @@ +// When run against the test HTTP server, it will serve different media types +// based on the URL containing `.t#.` strings, which exercises the different +// mapping of media types end to end. +import { loaded as loadedTsx1 } from "http://localhost:4545/subdir/mt_text_typescript_tsx.t1.tsx"; +import { loaded as loadedTsx2 } from "http://localhost:4545/subdir/mt_video_vdn_tsx.t2.tsx"; +import { loaded as loadedTsx3 } from "http://localhost:4545/subdir/mt_video_mp2t_tsx.t3.tsx"; +import { loaded as loadedTsx4 } from "http://localhost:4545/subdir/mt_application_x_typescript_tsx.t4.tsx"; +import { loaded as loadedJsx1 } from "http://localhost:4545/subdir/mt_text_javascript_jsx.j1.jsx"; +import { loaded as loadedJsx2 } from "http://localhost:4545/subdir/mt_application_ecmascript_jsx.j2.jsx"; +import { loaded as loadedJsx3 } from "http://localhost:4545/subdir/mt_text_ecmascript_jsx.j3.jsx"; +import { loaded as loadedJsx4 } from "http://localhost:4545/subdir/mt_application_x_javascript_jsx.j4.jsx"; + +declare global { + namespace JSX { + interface IntrinsicElements { + // deno-lint-ignore no-explicit-any + [elemName: string]: any; + } + } +} + +console.log( + "success", + loadedTsx1, + loadedTsx2, + loadedTsx3, + loadedTsx4, + loadedJsx1, + loadedJsx2, + loadedJsx3, + loadedJsx4, +); diff --git a/tests/testdata/run/048_media_types_jsx.ts.out b/tests/specs/run/_048_media_types_jsx/048_media_types_jsx.ts.out similarity index 100% rename from tests/testdata/run/048_media_types_jsx.ts.out rename to tests/specs/run/_048_media_types_jsx/048_media_types_jsx.ts.out diff --git a/tests/specs/run/_048_media_types_jsx/__test__.jsonc b/tests/specs/run/_048_media_types_jsx/__test__.jsonc new file mode 100644 index 0000000000..0dec930b09 --- /dev/null +++ b/tests/specs/run/_048_media_types_jsx/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --allow-import 048_media_types_jsx.ts", + "output": "048_media_types_jsx.ts.out" +} diff --git a/tests/specs/run/_052_no_remote_flag/019_media_types.ts b/tests/specs/run/_052_no_remote_flag/019_media_types.ts new file mode 100644 index 0000000000..d985bd2496 --- /dev/null +++ b/tests/specs/run/_052_no_remote_flag/019_media_types.ts @@ -0,0 +1,24 @@ +// When run against the test HTTP server, it will serve different media types +// based on the URL containing `.t#.` strings, which exercises the different +// mapping of media types end to end. + +import { loaded as loadedTs1 } from "http://localhost:4545/subdir/mt_text_typescript.t1.ts"; +import { loaded as loadedTs2 } from "http://localhost:4545/subdir/mt_video_vdn.t2.ts"; +import { loaded as loadedTs3 } from "http://localhost:4545/subdir/mt_video_mp2t.t3.ts"; +import { loaded as loadedTs4 } from "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts"; +import { loaded as loadedJs1 } from "http://localhost:4545/subdir/mt_text_javascript.j1.js"; +import { loaded as loadedJs2 } from "http://localhost:4545/subdir/mt_application_ecmascript.j2.js"; +import { loaded as loadedJs3 } from "http://localhost:4545/subdir/mt_text_ecmascript.j3.js"; +import { loaded as loadedJs4 } from "http://localhost:4545/subdir/mt_application_x_javascript.j4.js"; + +console.log( + "success", + loadedTs1, + loadedTs2, + loadedTs3, + loadedTs4, + loadedJs1, + loadedJs2, + loadedJs3, + loadedJs4, +); diff --git a/tests/testdata/run/052_no_remote_flag.out b/tests/specs/run/_052_no_remote_flag/052_no_remote_flag.out similarity index 53% rename from tests/testdata/run/052_no_remote_flag.out rename to tests/specs/run/_052_no_remote_flag/052_no_remote_flag.out index 2f5950ee89..c1f9f4e131 100644 --- a/tests/testdata/run/052_no_remote_flag.out +++ b/tests/specs/run/_052_no_remote_flag/052_no_remote_flag.out @@ -1 +1 @@ -error: A remote specifier was requested: "http://127.0.0.1:4545/run/019_media_types.ts", but --no-remote is specified. +error: A remote specifier was requested: "http://127.0.0.1:4545/019_media_types.ts", but --no-remote is specified. diff --git a/tests/specs/run/_052_no_remote_flag/__test__.jsonc b/tests/specs/run/_052_no_remote_flag/__test__.jsonc new file mode 100644 index 0000000000..c8ac477c66 --- /dev/null +++ b/tests/specs/run/_052_no_remote_flag/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload --check --allow-import --no-remote http://127.0.0.1:4545/019_media_types.ts", + "output": "052_no_remote_flag.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/058_tasks_microtasks_close.ts b/tests/specs/run/_058_tasks_microtasks_close/058_tasks_microtasks_close.ts similarity index 100% rename from tests/testdata/run/058_tasks_microtasks_close.ts rename to tests/specs/run/_058_tasks_microtasks_close/058_tasks_microtasks_close.ts diff --git a/tests/testdata/run/058_tasks_microtasks_close.ts.out b/tests/specs/run/_058_tasks_microtasks_close/058_tasks_microtasks_close.ts.out similarity index 100% rename from tests/testdata/run/058_tasks_microtasks_close.ts.out rename to tests/specs/run/_058_tasks_microtasks_close/058_tasks_microtasks_close.ts.out diff --git a/tests/specs/run/_058_tasks_microtasks_close/__test__.jsonc b/tests/specs/run/_058_tasks_microtasks_close/__test__.jsonc new file mode 100644 index 0000000000..9eec8f53cb --- /dev/null +++ b/tests/specs/run/_058_tasks_microtasks_close/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet 058_tasks_microtasks_close.ts", + "output": "058_tasks_microtasks_close.ts.out" +} diff --git a/tests/testdata/run/059_fs_relative_path_perm.ts b/tests/specs/run/_059_fs_relative_path_perm/059_fs_relative_path_perm.ts similarity index 100% rename from tests/testdata/run/059_fs_relative_path_perm.ts rename to tests/specs/run/_059_fs_relative_path_perm/059_fs_relative_path_perm.ts diff --git a/tests/testdata/run/059_fs_relative_path_perm.ts.out b/tests/specs/run/_059_fs_relative_path_perm/059_fs_relative_path_perm.ts.out similarity index 100% rename from tests/testdata/run/059_fs_relative_path_perm.ts.out rename to tests/specs/run/_059_fs_relative_path_perm/059_fs_relative_path_perm.ts.out diff --git a/tests/specs/run/_059_fs_relative_path_perm/__test__.jsonc b/tests/specs/run/_059_fs_relative_path_perm/__test__.jsonc new file mode 100644 index 0000000000..04a7b8aa4f --- /dev/null +++ b/tests/specs/run/_059_fs_relative_path_perm/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run 059_fs_relative_path_perm.ts", + "output": "059_fs_relative_path_perm.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/063_permissions_revoke.ts b/tests/specs/run/_063_permissions_revoke/063_permissions_revoke.ts similarity index 100% rename from tests/testdata/run/063_permissions_revoke.ts rename to tests/specs/run/_063_permissions_revoke/063_permissions_revoke.ts diff --git a/tests/testdata/run/063_permissions_revoke.ts.out b/tests/specs/run/_063_permissions_revoke/063_permissions_revoke.ts.out similarity index 100% rename from tests/testdata/run/063_permissions_revoke.ts.out rename to tests/specs/run/_063_permissions_revoke/063_permissions_revoke.ts.out diff --git a/tests/specs/run/_063_permissions_revoke/__test__.jsonc b/tests/specs/run/_063_permissions_revoke/__test__.jsonc new file mode 100644 index 0000000000..1dd5ed747f --- /dev/null +++ b/tests/specs/run/_063_permissions_revoke/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read=foo,bar 063_permissions_revoke.ts", + "output": "063_permissions_revoke.ts.out" +} diff --git a/tests/specs/run/_063_permissions_revoke_sync/063_permissions_revoke.ts.out b/tests/specs/run/_063_permissions_revoke_sync/063_permissions_revoke.ts.out new file mode 100644 index 0000000000..bbd64c557b --- /dev/null +++ b/tests/specs/run/_063_permissions_revoke_sync/063_permissions_revoke.ts.out @@ -0,0 +1,3 @@ +[WILDCARD]PermissionStatus { state: "prompt", onchange: null } +PermissionStatus { state: "granted", onchange: null } +PermissionStatus { state: "prompt", onchange: null } diff --git a/tests/testdata/run/063_permissions_revoke_sync.ts b/tests/specs/run/_063_permissions_revoke_sync/063_permissions_revoke_sync.ts similarity index 100% rename from tests/testdata/run/063_permissions_revoke_sync.ts rename to tests/specs/run/_063_permissions_revoke_sync/063_permissions_revoke_sync.ts diff --git a/tests/specs/run/_063_permissions_revoke_sync/__test__.jsonc b/tests/specs/run/_063_permissions_revoke_sync/__test__.jsonc new file mode 100644 index 0000000000..8dd9384e3d --- /dev/null +++ b/tests/specs/run/_063_permissions_revoke_sync/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read=foo,bar 063_permissions_revoke_sync.ts", + "output": "063_permissions_revoke.ts.out" +} diff --git a/tests/testdata/run/064_permissions_revoke_global.ts b/tests/specs/run/_064_permissions_revoke_global/064_permissions_revoke_global.ts similarity index 100% rename from tests/testdata/run/064_permissions_revoke_global.ts rename to tests/specs/run/_064_permissions_revoke_global/064_permissions_revoke_global.ts diff --git a/tests/testdata/run/064_permissions_revoke_global.ts.out b/tests/specs/run/_064_permissions_revoke_global/064_permissions_revoke_global.ts.out similarity index 100% rename from tests/testdata/run/064_permissions_revoke_global.ts.out rename to tests/specs/run/_064_permissions_revoke_global/064_permissions_revoke_global.ts.out diff --git a/tests/specs/run/_064_permissions_revoke_global/__test__.jsonc b/tests/specs/run/_064_permissions_revoke_global/__test__.jsonc new file mode 100644 index 0000000000..929e48ee8d --- /dev/null +++ b/tests/specs/run/_064_permissions_revoke_global/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read=foo,bar 064_permissions_revoke_global.ts", + "output": "064_permissions_revoke_global.ts.out" +} diff --git a/tests/specs/run/_064_permissions_revoke_global_sync/064_permissions_revoke_global.ts.out b/tests/specs/run/_064_permissions_revoke_global_sync/064_permissions_revoke_global.ts.out new file mode 100644 index 0000000000..f7e389a76b --- /dev/null +++ b/tests/specs/run/_064_permissions_revoke_global_sync/064_permissions_revoke_global.ts.out @@ -0,0 +1,3 @@ +[WILDCARD]PermissionStatus { state: "prompt", onchange: null } +PermissionStatus { state: "prompt", onchange: null } +PermissionStatus { state: "prompt", onchange: null } diff --git a/tests/testdata/run/064_permissions_revoke_global_sync.ts b/tests/specs/run/_064_permissions_revoke_global_sync/064_permissions_revoke_global_sync.ts similarity index 100% rename from tests/testdata/run/064_permissions_revoke_global_sync.ts rename to tests/specs/run/_064_permissions_revoke_global_sync/064_permissions_revoke_global_sync.ts diff --git a/tests/specs/run/_064_permissions_revoke_global_sync/__test__.jsonc b/tests/specs/run/_064_permissions_revoke_global_sync/__test__.jsonc new file mode 100644 index 0000000000..8d6f8079d3 --- /dev/null +++ b/tests/specs/run/_064_permissions_revoke_global_sync/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read=foo,bar 064_permissions_revoke_global_sync.ts", + "output": "064_permissions_revoke_global.ts.out" +} diff --git a/tests/testdata/run/065_permissions_revoke_net.ts b/tests/specs/run/_065_permissions_revoke_net/065_permissions_revoke_net.ts similarity index 100% rename from tests/testdata/run/065_permissions_revoke_net.ts rename to tests/specs/run/_065_permissions_revoke_net/065_permissions_revoke_net.ts diff --git a/tests/testdata/run/065_permissions_revoke_net.ts.out b/tests/specs/run/_065_permissions_revoke_net/065_permissions_revoke_net.ts.out similarity index 100% rename from tests/testdata/run/065_permissions_revoke_net.ts.out rename to tests/specs/run/_065_permissions_revoke_net/065_permissions_revoke_net.ts.out diff --git a/tests/specs/run/_065_permissions_revoke_net/__test__.jsonc b/tests/specs/run/_065_permissions_revoke_net/__test__.jsonc new file mode 100644 index 0000000000..ab66835fdb --- /dev/null +++ b/tests/specs/run/_065_permissions_revoke_net/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-net 065_permissions_revoke_net.ts", + "output": "065_permissions_revoke_net.ts.out" +} diff --git a/tests/testdata/run/070_location.ts b/tests/specs/run/_070_location/070_location.ts similarity index 100% rename from tests/testdata/run/070_location.ts rename to tests/specs/run/_070_location/070_location.ts diff --git a/tests/testdata/run/070_location.ts.out b/tests/specs/run/_070_location/070_location.ts.out similarity index 100% rename from tests/testdata/run/070_location.ts.out rename to tests/specs/run/_070_location/070_location.ts.out diff --git a/tests/specs/run/_070_location/__test__.jsonc b/tests/specs/run/_070_location/__test__.jsonc new file mode 100644 index 0000000000..ad92752ea0 --- /dev/null +++ b/tests/specs/run/_070_location/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --location https://foo/bar?baz#bat 070_location.ts", + "output": "070_location.ts.out" +} diff --git a/tests/testdata/run/071_location_unset.ts b/tests/specs/run/_071_location_unset/071_location_unset.ts similarity index 100% rename from tests/testdata/run/071_location_unset.ts rename to tests/specs/run/_071_location_unset/071_location_unset.ts diff --git a/tests/testdata/run/071_location_unset.ts.out b/tests/specs/run/_071_location_unset/071_location_unset.ts.out similarity index 100% rename from tests/testdata/run/071_location_unset.ts.out rename to tests/specs/run/_071_location_unset/071_location_unset.ts.out diff --git a/tests/specs/run/_071_location_unset/__test__.jsonc b/tests/specs/run/_071_location_unset/__test__.jsonc new file mode 100644 index 0000000000..946755cf5a --- /dev/null +++ b/tests/specs/run/_071_location_unset/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run 071_location_unset.ts", + "output": "071_location_unset.ts.out" +} diff --git a/tests/testdata/run/072_location_relative_fetch.ts b/tests/specs/run/_072_location_relative_fetch/072_location_relative_fetch.ts similarity index 100% rename from tests/testdata/run/072_location_relative_fetch.ts rename to tests/specs/run/_072_location_relative_fetch/072_location_relative_fetch.ts diff --git a/tests/testdata/run/072_location_relative_fetch.ts.out b/tests/specs/run/_072_location_relative_fetch/072_location_relative_fetch.ts.out similarity index 100% rename from tests/testdata/run/072_location_relative_fetch.ts.out rename to tests/specs/run/_072_location_relative_fetch/072_location_relative_fetch.ts.out diff --git a/tests/specs/run/_072_location_relative_fetch/__test__.jsonc b/tests/specs/run/_072_location_relative_fetch/__test__.jsonc new file mode 100644 index 0000000000..e6e9e48996 --- /dev/null +++ b/tests/specs/run/_072_location_relative_fetch/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --location http://127.0.0.1:4545/ --allow-net 072_location_relative_fetch.ts", + "output": "072_location_relative_fetch.ts.out" +} diff --git a/tests/specs/run/_072_location_relative_fetch/fetch/hello.txt b/tests/specs/run/_072_location_relative_fetch/fetch/hello.txt new file mode 100644 index 0000000000..af5626b4a1 --- /dev/null +++ b/tests/specs/run/_072_location_relative_fetch/fetch/hello.txt @@ -0,0 +1 @@ +Hello, world! diff --git a/tests/specs/run/_075_import_local_query_hash/001_hello.js b/tests/specs/run/_075_import_local_query_hash/001_hello.js new file mode 100644 index 0000000000..accefceba6 --- /dev/null +++ b/tests/specs/run/_075_import_local_query_hash/001_hello.js @@ -0,0 +1 @@ +console.log("Hello World"); diff --git a/tests/specs/run/_075_import_local_query_hash/002_hello.ts b/tests/specs/run/_075_import_local_query_hash/002_hello.ts new file mode 100644 index 0000000000..accefceba6 --- /dev/null +++ b/tests/specs/run/_075_import_local_query_hash/002_hello.ts @@ -0,0 +1 @@ +console.log("Hello World"); diff --git a/tests/testdata/run/075_import_local_query_hash.ts b/tests/specs/run/_075_import_local_query_hash/075_import_local_query_hash.ts similarity index 100% rename from tests/testdata/run/075_import_local_query_hash.ts rename to tests/specs/run/_075_import_local_query_hash/075_import_local_query_hash.ts diff --git a/tests/testdata/run/075_import_local_query_hash.ts.out b/tests/specs/run/_075_import_local_query_hash/075_import_local_query_hash.ts.out similarity index 100% rename from tests/testdata/run/075_import_local_query_hash.ts.out rename to tests/specs/run/_075_import_local_query_hash/075_import_local_query_hash.ts.out diff --git a/tests/specs/run/_075_import_local_query_hash/__test__.jsonc b/tests/specs/run/_075_import_local_query_hash/__test__.jsonc new file mode 100644 index 0000000000..521cd3ea8a --- /dev/null +++ b/tests/specs/run/_075_import_local_query_hash/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run 075_import_local_query_hash.ts", + "output": "075_import_local_query_hash.ts.out" +} diff --git a/tests/testdata/run/077_fetch_empty.ts b/tests/specs/run/_077_fetch_empty/077_fetch_empty.ts similarity index 100% rename from tests/testdata/run/077_fetch_empty.ts rename to tests/specs/run/_077_fetch_empty/077_fetch_empty.ts diff --git a/tests/testdata/run/077_fetch_empty.ts.out b/tests/specs/run/_077_fetch_empty/077_fetch_empty.ts.out similarity index 100% rename from tests/testdata/run/077_fetch_empty.ts.out rename to tests/specs/run/_077_fetch_empty/077_fetch_empty.ts.out diff --git a/tests/specs/run/_077_fetch_empty/__test__.jsonc b/tests/specs/run/_077_fetch_empty/__test__.jsonc new file mode 100644 index 0000000000..654b109380 --- /dev/null +++ b/tests/specs/run/_077_fetch_empty/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run -A 077_fetch_empty.ts", + "output": "077_fetch_empty.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/078_unload_on_exit.ts b/tests/specs/run/_078_unload_on_exit/078_unload_on_exit.ts similarity index 100% rename from tests/testdata/run/078_unload_on_exit.ts rename to tests/specs/run/_078_unload_on_exit/078_unload_on_exit.ts diff --git a/tests/testdata/run/078_unload_on_exit.ts.out b/tests/specs/run/_078_unload_on_exit/078_unload_on_exit.ts.out similarity index 100% rename from tests/testdata/run/078_unload_on_exit.ts.out rename to tests/specs/run/_078_unload_on_exit/078_unload_on_exit.ts.out diff --git a/tests/specs/run/_078_unload_on_exit/__test__.jsonc b/tests/specs/run/_078_unload_on_exit/__test__.jsonc new file mode 100644 index 0000000000..4091b7dc99 --- /dev/null +++ b/tests/specs/run/_078_unload_on_exit/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run 078_unload_on_exit.ts", + "output": "078_unload_on_exit.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/079_location_authentication.ts b/tests/specs/run/_079_location_authentication/079_location_authentication.ts similarity index 100% rename from tests/testdata/run/079_location_authentication.ts rename to tests/specs/run/_079_location_authentication/079_location_authentication.ts diff --git a/tests/testdata/run/079_location_authentication.ts.out b/tests/specs/run/_079_location_authentication/079_location_authentication.ts.out similarity index 100% rename from tests/testdata/run/079_location_authentication.ts.out rename to tests/specs/run/_079_location_authentication/079_location_authentication.ts.out diff --git a/tests/specs/run/_079_location_authentication/__test__.jsonc b/tests/specs/run/_079_location_authentication/__test__.jsonc new file mode 100644 index 0000000000..30ba279490 --- /dev/null +++ b/tests/specs/run/_079_location_authentication/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --location https://foo:bar@baz/qux 079_location_authentication.ts", + "output": "079_location_authentication.ts.out" +} diff --git a/tests/testdata/run/081_location_relative_fetch_redirect.ts b/tests/specs/run/_081_location_relative_fetch_redirect/081_location_relative_fetch_redirect.ts similarity index 100% rename from tests/testdata/run/081_location_relative_fetch_redirect.ts rename to tests/specs/run/_081_location_relative_fetch_redirect/081_location_relative_fetch_redirect.ts diff --git a/tests/testdata/run/081_location_relative_fetch_redirect.ts.out b/tests/specs/run/_081_location_relative_fetch_redirect/081_location_relative_fetch_redirect.ts.out similarity index 100% rename from tests/testdata/run/081_location_relative_fetch_redirect.ts.out rename to tests/specs/run/_081_location_relative_fetch_redirect/081_location_relative_fetch_redirect.ts.out diff --git a/tests/specs/run/_081_location_relative_fetch_redirect/__test__.jsonc b/tests/specs/run/_081_location_relative_fetch_redirect/__test__.jsonc new file mode 100644 index 0000000000..6756bf6d1f --- /dev/null +++ b/tests/specs/run/_081_location_relative_fetch_redirect/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --location http://127.0.0.1:4546/ --allow-net 081_location_relative_fetch_redirect.ts", + "output": "081_location_relative_fetch_redirect.ts.out" +} diff --git a/tests/testdata/run/082_prepare_stack_trace_throw.js b/tests/specs/run/_082_prepare_stack_trace_throw/082_prepare_stack_trace_throw.js similarity index 100% rename from tests/testdata/run/082_prepare_stack_trace_throw.js rename to tests/specs/run/_082_prepare_stack_trace_throw/082_prepare_stack_trace_throw.js diff --git a/tests/testdata/run/082_prepare_stack_trace_throw.js.out b/tests/specs/run/_082_prepare_stack_trace_throw/082_prepare_stack_trace_throw.js.out similarity index 100% rename from tests/testdata/run/082_prepare_stack_trace_throw.js.out rename to tests/specs/run/_082_prepare_stack_trace_throw/082_prepare_stack_trace_throw.js.out diff --git a/tests/specs/run/_082_prepare_stack_trace_throw/__test__.jsonc b/tests/specs/run/_082_prepare_stack_trace_throw/__test__.jsonc new file mode 100644 index 0000000000..41b27e3bdd --- /dev/null +++ b/tests/specs/run/_082_prepare_stack_trace_throw/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run 082_prepare_stack_trace_throw.js", + "output": "082_prepare_stack_trace_throw.js.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/088_dynamic_import_already_evaluating.ts b/tests/specs/run/_088_dynamic_import_already_evaluating/088_dynamic_import_already_evaluating.ts similarity index 100% rename from tests/testdata/run/088_dynamic_import_already_evaluating.ts rename to tests/specs/run/_088_dynamic_import_already_evaluating/088_dynamic_import_already_evaluating.ts diff --git a/tests/testdata/run/088_dynamic_import_already_evaluating.ts.out b/tests/specs/run/_088_dynamic_import_already_evaluating/088_dynamic_import_already_evaluating.ts.out similarity index 100% rename from tests/testdata/run/088_dynamic_import_already_evaluating.ts.out rename to tests/specs/run/_088_dynamic_import_already_evaluating/088_dynamic_import_already_evaluating.ts.out diff --git a/tests/specs/run/_088_dynamic_import_already_evaluating/088_dynamic_import_target.ts b/tests/specs/run/_088_dynamic_import_already_evaluating/088_dynamic_import_target.ts new file mode 100644 index 0000000000..226f1851a6 --- /dev/null +++ b/tests/specs/run/_088_dynamic_import_already_evaluating/088_dynamic_import_target.ts @@ -0,0 +1,3 @@ +console.log(1); +await new Promise((r) => setTimeout(r, 100)); +console.log(2); diff --git a/tests/specs/run/_088_dynamic_import_already_evaluating/__test__.jsonc b/tests/specs/run/_088_dynamic_import_already_evaluating/__test__.jsonc new file mode 100644 index 0000000000..4ce912bf86 --- /dev/null +++ b/tests/specs/run/_088_dynamic_import_already_evaluating/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read 088_dynamic_import_already_evaluating.ts", + "output": "088_dynamic_import_already_evaluating.ts.out" +} diff --git a/tests/testdata/run/091_use_define_for_class_fields.ts b/tests/specs/run/_091_use_define_for_class_fields/091_use_define_for_class_fields.ts similarity index 100% rename from tests/testdata/run/091_use_define_for_class_fields.ts rename to tests/specs/run/_091_use_define_for_class_fields/091_use_define_for_class_fields.ts diff --git a/tests/testdata/run/091_use_define_for_class_fields.ts.out b/tests/specs/run/_091_use_define_for_class_fields/091_use_define_for_class_fields.ts.out similarity index 100% rename from tests/testdata/run/091_use_define_for_class_fields.ts.out rename to tests/specs/run/_091_use_define_for_class_fields/091_use_define_for_class_fields.ts.out diff --git a/tests/specs/run/_091_use_define_for_class_fields/__test__.jsonc b/tests/specs/run/_091_use_define_for_class_fields/__test__.jsonc new file mode 100644 index 0000000000..100db44aa8 --- /dev/null +++ b/tests/specs/run/_091_use_define_for_class_fields/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --check 091_use_define_for_class_fields.ts", + "output": "091_use_define_for_class_fields.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/aggregate_error/__test__.jsonc b/tests/specs/run/aggregate_error/__test__.jsonc new file mode 100644 index 0000000000..e9bd82481c --- /dev/null +++ b/tests/specs/run/aggregate_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet aggregate_error.ts", + "output": "aggregate_error.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/aggregate_error.out b/tests/specs/run/aggregate_error/aggregate_error.out similarity index 100% rename from tests/testdata/run/aggregate_error.out rename to tests/specs/run/aggregate_error/aggregate_error.out diff --git a/tests/testdata/run/aggregate_error.ts b/tests/specs/run/aggregate_error/aggregate_error.ts similarity index 100% rename from tests/testdata/run/aggregate_error.ts rename to tests/specs/run/aggregate_error/aggregate_error.ts diff --git a/tests/specs/run/async_error/__test__.jsonc b/tests/specs/run/async_error/__test__.jsonc new file mode 100644 index 0000000000..86c31adac7 --- /dev/null +++ b/tests/specs/run/async_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload async_error.ts", + "output": "async_error.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/async_error.ts b/tests/specs/run/async_error/async_error.ts similarity index 100% rename from tests/testdata/run/async_error.ts rename to tests/specs/run/async_error/async_error.ts diff --git a/tests/testdata/run/async_error.ts.out b/tests/specs/run/async_error/async_error.ts.out similarity index 100% rename from tests/testdata/run/async_error.ts.out rename to tests/specs/run/async_error/async_error.ts.out diff --git a/tests/specs/run/beforeunload_event/__test__.jsonc b/tests/specs/run/beforeunload_event/__test__.jsonc new file mode 100644 index 0000000000..01c7e70077 --- /dev/null +++ b/tests/specs/run/beforeunload_event/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run before_unload.js", + "output": "before_unload.js.out" +} diff --git a/tests/testdata/run/before_unload.js b/tests/specs/run/beforeunload_event/before_unload.js similarity index 100% rename from tests/testdata/run/before_unload.js rename to tests/specs/run/beforeunload_event/before_unload.js diff --git a/tests/testdata/run/before_unload.js.out b/tests/specs/run/beforeunload_event/before_unload.js.out similarity index 100% rename from tests/testdata/run/before_unload.js.out rename to tests/specs/run/beforeunload_event/before_unload.js.out diff --git a/tests/specs/run/blob_gc_finalization/__test__.jsonc b/tests/specs/run/blob_gc_finalization/__test__.jsonc new file mode 100644 index 0000000000..20a8128fce --- /dev/null +++ b/tests/specs/run/blob_gc_finalization/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run blob_gc_finalization.js", + "output": "blob_gc_finalization.js.out", + "exitCode": 0 +} diff --git a/tests/testdata/run/blob_gc_finalization.js b/tests/specs/run/blob_gc_finalization/blob_gc_finalization.js similarity index 100% rename from tests/testdata/run/blob_gc_finalization.js rename to tests/specs/run/blob_gc_finalization/blob_gc_finalization.js diff --git a/tests/testdata/run/blob_gc_finalization.js.out b/tests/specs/run/blob_gc_finalization/blob_gc_finalization.js.out similarity index 100% rename from tests/testdata/run/blob_gc_finalization.js.out rename to tests/specs/run/blob_gc_finalization/blob_gc_finalization.js.out diff --git a/tests/specs/run/byte_order_mark/001_hello.js b/tests/specs/run/byte_order_mark/001_hello.js new file mode 100644 index 0000000000..accefceba6 --- /dev/null +++ b/tests/specs/run/byte_order_mark/001_hello.js @@ -0,0 +1 @@ +console.log("Hello World"); diff --git a/tests/specs/run/byte_order_mark/__test__.jsonc b/tests/specs/run/byte_order_mark/__test__.jsonc new file mode 100644 index 0000000000..f47cb7d025 --- /dev/null +++ b/tests/specs/run/byte_order_mark/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --no-check byte_order_mark.ts", + "output": "byte_order_mark.out" +} diff --git a/tests/testdata/run/byte_order_mark.out b/tests/specs/run/byte_order_mark/byte_order_mark.out similarity index 100% rename from tests/testdata/run/byte_order_mark.out rename to tests/specs/run/byte_order_mark/byte_order_mark.out diff --git a/tests/testdata/run/byte_order_mark.ts b/tests/specs/run/byte_order_mark/byte_order_mark.ts similarity index 86% rename from tests/testdata/run/byte_order_mark.ts rename to tests/specs/run/byte_order_mark/byte_order_mark.ts index 40eb23c1d0..71da3e1e9c 100644 --- a/tests/testdata/run/byte_order_mark.ts +++ b/tests/specs/run/byte_order_mark/byte_order_mark.ts @@ -1,4 +1,4 @@ -import "./001_hello.js"; +import "./001_hello.js"; // Note this file starts with special byte order mark // it's important that this file is a .ts typescript file which is passed to // deno through `--no-check` mode. diff --git a/tests/specs/run/check_js_points_to_ts/__test__.jsonc b/tests/specs/run/check_js_points_to_ts/__test__.jsonc new file mode 100644 index 0000000000..a63b9e5a46 --- /dev/null +++ b/tests/specs/run/check_js_points_to_ts/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --check --config checkjs.tsconfig.json check_js_points_to_ts/test.js", + "output": "check_js_points_to_ts/test.js.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/check_js_points_to_ts/bar.ts b/tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/bar.ts similarity index 100% rename from tests/testdata/run/check_js_points_to_ts/bar.ts rename to tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/bar.ts diff --git a/tests/testdata/run/check_js_points_to_ts/foo.d.ts b/tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/foo.d.ts similarity index 100% rename from tests/testdata/run/check_js_points_to_ts/foo.d.ts rename to tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/foo.d.ts diff --git a/tests/testdata/run/check_js_points_to_ts/foo.js b/tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/foo.js similarity index 100% rename from tests/testdata/run/check_js_points_to_ts/foo.js rename to tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/foo.js diff --git a/tests/testdata/run/check_js_points_to_ts/test.js b/tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/test.js similarity index 100% rename from tests/testdata/run/check_js_points_to_ts/test.js rename to tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/test.js diff --git a/tests/testdata/run/check_js_points_to_ts/test.js.out b/tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/test.js.out similarity index 100% rename from tests/testdata/run/check_js_points_to_ts/test.js.out rename to tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/test.js.out diff --git a/tests/specs/run/check_js_points_to_ts/checkjs.tsconfig.json b/tests/specs/run/check_js_points_to_ts/checkjs.tsconfig.json new file mode 100644 index 0000000000..08ac60b6cd --- /dev/null +++ b/tests/specs/run/check_js_points_to_ts/checkjs.tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "checkJs": true + } +} diff --git a/tests/specs/run/check_remote/__test__.jsonc b/tests/specs/run/check_remote/__test__.jsonc new file mode 100644 index 0000000000..6543e61b3f --- /dev/null +++ b/tests/specs/run/check_remote/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --allow-import --reload --check=all no_check_remote.ts", + "output": "no_check_remote.ts.disabled.out", + "exitCode": 1 +} diff --git a/tests/specs/run/check_remote/no_check_remote.ts b/tests/specs/run/check_remote/no_check_remote.ts new file mode 100644 index 0000000000..f42dadf8a7 --- /dev/null +++ b/tests/specs/run/check_remote/no_check_remote.ts @@ -0,0 +1,3 @@ +import * as a from "./type_error.ts"; + +console.log(a.a); diff --git a/tests/testdata/run/no_check_remote.ts.disabled.out b/tests/specs/run/check_remote/no_check_remote.ts.disabled.out similarity index 66% rename from tests/testdata/run/no_check_remote.ts.disabled.out rename to tests/specs/run/check_remote/no_check_remote.ts.disabled.out index 3442646348..06c046072d 100644 --- a/tests/testdata/run/no_check_remote.ts.disabled.out +++ b/tests/specs/run/check_remote/no_check_remote.ts.disabled.out @@ -1,4 +1,4 @@ error: TS2322 [ERROR]: Type '12' is not assignable to type '"a"'. export const a: "a" = 12; ^ - at http://localhost:4545/subdir/type_error.ts:1:14 + at [WILDCARD]/type_error.ts:1:14 diff --git a/tests/specs/run/check_remote/type_error.ts b/tests/specs/run/check_remote/type_error.ts new file mode 100644 index 0000000000..cc3c1d29d8 --- /dev/null +++ b/tests/specs/run/check_remote/type_error.ts @@ -0,0 +1 @@ +export const a: "a" = 12; diff --git a/tests/specs/run/classic_workers_event_loop/__test__.jsonc b/tests/specs/run/classic_workers_event_loop/__test__.jsonc new file mode 100644 index 0000000000..44ea36bdc0 --- /dev/null +++ b/tests/specs/run/classic_workers_event_loop/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --enable-testing-features-do-not-use classic_workers_event_loop.js", + "output": "classic_workers_event_loop.js.out" +} diff --git a/tests/testdata/run/classic_workers_event_loop.js b/tests/specs/run/classic_workers_event_loop/classic_workers_event_loop.js similarity index 100% rename from tests/testdata/run/classic_workers_event_loop.js rename to tests/specs/run/classic_workers_event_loop/classic_workers_event_loop.js diff --git a/tests/testdata/run/classic_workers_event_loop.js.out b/tests/specs/run/classic_workers_event_loop/classic_workers_event_loop.js.out similarity index 100% rename from tests/testdata/run/classic_workers_event_loop.js.out rename to tests/specs/run/classic_workers_event_loop/classic_workers_event_loop.js.out diff --git a/tests/specs/run/colors_without_global_this/__test__.jsonc b/tests/specs/run/colors_without_global_this/__test__.jsonc new file mode 100644 index 0000000000..1d2f1c1cfe --- /dev/null +++ b/tests/specs/run/colors_without_global_this/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run colors_without_globalThis.js", + "output": "true\n" +} diff --git a/tests/testdata/run/colors_without_globalThis.js b/tests/specs/run/colors_without_global_this/colors_without_globalThis.js similarity index 100% rename from tests/testdata/run/colors_without_globalThis.js rename to tests/specs/run/colors_without_global_this/colors_without_globalThis.js diff --git a/tests/specs/run/complex_error/__test__.jsonc b/tests/specs/run/complex_error/__test__.jsonc new file mode 100644 index 0000000000..2f7274be49 --- /dev/null +++ b/tests/specs/run/complex_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet complex_error.ts", + "output": "complex_error.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/complex_error.ts b/tests/specs/run/complex_error/complex_error.ts similarity index 100% rename from tests/testdata/run/complex_error.ts rename to tests/specs/run/complex_error/complex_error.ts diff --git a/tests/testdata/run/complex_error.ts.out b/tests/specs/run/complex_error/complex_error.ts.out similarity index 100% rename from tests/testdata/run/complex_error.ts.out rename to tests/specs/run/complex_error/complex_error.ts.out diff --git a/tests/specs/run/config/__test__.jsonc b/tests/specs/run/config/__test__.jsonc new file mode 100644 index 0000000000..59d3ae5fcc --- /dev/null +++ b/tests/specs/run/config/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --config config/tsconfig.json --check config/main.ts", + "output": "config/main.out" +} diff --git a/tests/testdata/run/config/main.out b/tests/specs/run/config/config/main.out similarity index 100% rename from tests/testdata/run/config/main.out rename to tests/specs/run/config/config/main.out diff --git a/tests/testdata/run/config/main.ts b/tests/specs/run/config/config/main.ts similarity index 100% rename from tests/testdata/run/config/main.ts rename to tests/specs/run/config/config/main.ts diff --git a/tests/testdata/run/config/tsconfig.json b/tests/specs/run/config/config/tsconfig.json similarity index 100% rename from tests/testdata/run/config/tsconfig.json rename to tests/specs/run/config/config/tsconfig.json diff --git a/tests/specs/run/config_auto_discovered_for_local_script/__test__.jsonc b/tests/specs/run/config_auto_discovered_for_local_script/__test__.jsonc new file mode 100644 index 0000000000..bd2a77ab1a --- /dev/null +++ b/tests/specs/run/config_auto_discovered_for_local_script/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet frontend_work.ts", + "output": "ok\n" +} diff --git a/tests/testdata/run/with_config/frontend_work.ts b/tests/specs/run/config_auto_discovered_for_local_script/frontend_work.ts similarity index 100% rename from tests/testdata/run/with_config/frontend_work.ts rename to tests/specs/run/config_auto_discovered_for_local_script/frontend_work.ts diff --git a/tests/specs/run/config_auto_discovered_for_local_script_log/__test__.jsonc b/tests/specs/run/config_auto_discovered_for_local_script_log/__test__.jsonc new file mode 100644 index 0000000000..5182cc9589 --- /dev/null +++ b/tests/specs/run/config_auto_discovered_for_local_script_log/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run -L debug frontend_work.ts", + "output": "auto_discovery_log.out" +} diff --git a/tests/testdata/run/with_config/auto_discovery_log.out b/tests/specs/run/config_auto_discovered_for_local_script_log/auto_discovery_log.out similarity index 100% rename from tests/testdata/run/with_config/auto_discovery_log.out rename to tests/specs/run/config_auto_discovered_for_local_script_log/auto_discovery_log.out diff --git a/tests/testdata/run/with_config/deno.jsonc b/tests/specs/run/config_auto_discovered_for_local_script_log/deno.jsonc similarity index 100% rename from tests/testdata/run/with_config/deno.jsonc rename to tests/specs/run/config_auto_discovered_for_local_script_log/deno.jsonc diff --git a/tests/specs/run/config_auto_discovered_for_local_script_log/frontend_work.ts b/tests/specs/run/config_auto_discovered_for_local_script_log/frontend_work.ts new file mode 100644 index 0000000000..783af44e4c --- /dev/null +++ b/tests/specs/run/config_auto_discovered_for_local_script_log/frontend_work.ts @@ -0,0 +1,4 @@ +function _main() { + console.log(document); +} +console.log("ok"); diff --git a/tests/specs/run/config_json_import/__test__.jsonc b/tests/specs/run/config_json_import/__test__.jsonc new file mode 100644 index 0000000000..6ef632ff8d --- /dev/null +++ b/tests/specs/run/config_json_import/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet -c deno-jsx.json config_json_import.ts", + "output": "config_json_import.ts.out" +} diff --git a/tests/specs/run/config_json_import/config_json_import.ts b/tests/specs/run/config_json_import/config_json_import.ts new file mode 100644 index 0000000000..4a772fac3f --- /dev/null +++ b/tests/specs/run/config_json_import/config_json_import.ts @@ -0,0 +1,2 @@ +import config from "./deno-jsx.json" with { type: "json" }; +console.log(config); diff --git a/tests/testdata/run/config_json_import.ts.out b/tests/specs/run/config_json_import/config_json_import.ts.out similarity index 100% rename from tests/testdata/run/config_json_import.ts.out rename to tests/specs/run/config_json_import/config_json_import.ts.out diff --git a/tests/specs/run/config_json_import/deno-jsx.json b/tests/specs/run/config_json_import/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/config_json_import/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/config_not_auto_discovered_for_remote_script/__test__.jsonc b/tests/specs/run/config_not_auto_discovered_for_remote_script/__test__.jsonc new file mode 100644 index 0000000000..e6ccc02aca --- /dev/null +++ b/tests/specs/run/config_not_auto_discovered_for_remote_script/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --quiet server_side_work.ts", + "output": "ok\n" +} diff --git a/tests/testdata/run/with_config/server_side_work.ts b/tests/specs/run/config_not_auto_discovered_for_remote_script/server_side_work.ts similarity index 100% rename from tests/testdata/run/with_config/server_side_work.ts rename to tests/specs/run/config_not_auto_discovered_for_remote_script/server_side_work.ts diff --git a/tests/specs/run/config_types/__test__.jsonc b/tests/specs/run/config_types/__test__.jsonc new file mode 100644 index 0000000000..d803915c73 --- /dev/null +++ b/tests/specs/run/config_types/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --quiet --check=all --config config_types/tsconfig.json config_types/main.ts", + "output": "config_types/main.out" +} diff --git a/tests/specs/run/config_types/config_types/deno.lock b/tests/specs/run/config_types/config_types/deno.lock new file mode 100644 index 0000000000..157bd98a2e --- /dev/null +++ b/tests/specs/run/config_types/config_types/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/run/config_types/types.d.ts": "741c39165e37de0c12acc5c081841f4362487e3f17dc4cad7017b70af72c4605" + } +} diff --git a/tests/testdata/run/config_types/main.out b/tests/specs/run/config_types/config_types/main.out similarity index 100% rename from tests/testdata/run/config_types/main.out rename to tests/specs/run/config_types/config_types/main.out diff --git a/tests/testdata/run/config_types/main.ts b/tests/specs/run/config_types/config_types/main.ts similarity index 100% rename from tests/testdata/run/config_types/main.ts rename to tests/specs/run/config_types/config_types/main.ts diff --git a/tests/testdata/run/config_types/remote.tsconfig.json b/tests/specs/run/config_types/config_types/remote.tsconfig.json similarity index 100% rename from tests/testdata/run/config_types/remote.tsconfig.json rename to tests/specs/run/config_types/config_types/remote.tsconfig.json diff --git a/tests/testdata/run/config_types/tsconfig.json b/tests/specs/run/config_types/config_types/tsconfig.json similarity index 100% rename from tests/testdata/run/config_types/tsconfig.json rename to tests/specs/run/config_types/config_types/tsconfig.json diff --git a/tests/specs/run/config_types/config_types/types.d.ts b/tests/specs/run/config_types/config_types/types.d.ts new file mode 100644 index 0000000000..536a6d0a69 --- /dev/null +++ b/tests/specs/run/config_types/config_types/types.d.ts @@ -0,0 +1,2 @@ +// deno-lint-ignore-file no-var +declare var a: string; diff --git a/tests/specs/run/config_types_remote/__test__.jsonc b/tests/specs/run/config_types_remote/__test__.jsonc new file mode 100644 index 0000000000..87457ace21 --- /dev/null +++ b/tests/specs/run/config_types_remote/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --quiet --check=all --config config_types/remote.tsconfig.json config_types/main.ts", + "output": "config_types/main.out" +} diff --git a/tests/specs/run/config_types_remote/config_types/deno.lock b/tests/specs/run/config_types_remote/config_types/deno.lock new file mode 100644 index 0000000000..157bd98a2e --- /dev/null +++ b/tests/specs/run/config_types_remote/config_types/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/run/config_types/types.d.ts": "741c39165e37de0c12acc5c081841f4362487e3f17dc4cad7017b70af72c4605" + } +} diff --git a/tests/testdata/run/reference_types.ts.out b/tests/specs/run/config_types_remote/config_types/main.out similarity index 100% rename from tests/testdata/run/reference_types.ts.out rename to tests/specs/run/config_types_remote/config_types/main.out diff --git a/tests/specs/run/config_types_remote/config_types/main.ts b/tests/specs/run/config_types_remote/config_types/main.ts new file mode 100644 index 0000000000..f1a8d65831 --- /dev/null +++ b/tests/specs/run/config_types_remote/config_types/main.ts @@ -0,0 +1 @@ +console.log(globalThis.a); diff --git a/tests/specs/run/config_types_remote/config_types/remote.tsconfig.json b/tests/specs/run/config_types_remote/config_types/remote.tsconfig.json new file mode 100644 index 0000000000..255ff5def0 --- /dev/null +++ b/tests/specs/run/config_types_remote/config_types/remote.tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "types": [ + "http://localhost:4545/run/config_types/types.d.ts" + ] + } +} diff --git a/tests/specs/run/config_types_remote/config_types/tsconfig.json b/tests/specs/run/config_types_remote/config_types/tsconfig.json new file mode 100644 index 0000000000..85f1549e0d --- /dev/null +++ b/tests/specs/run/config_types_remote/config_types/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "types": [ + "./types.d.ts" + ] + } +} diff --git a/tests/specs/run/config_types_remote/config_types/types.d.ts b/tests/specs/run/config_types_remote/config_types/types.d.ts new file mode 100644 index 0000000000..536a6d0a69 --- /dev/null +++ b/tests/specs/run/config_types_remote/config_types/types.d.ts @@ -0,0 +1,2 @@ +// deno-lint-ignore-file no-var +declare var a: string; diff --git a/tests/specs/run/custom_inspect_url/__test__.jsonc b/tests/specs/run/custom_inspect_url/__test__.jsonc new file mode 100644 index 0000000000..1c1c2b9c47 --- /dev/null +++ b/tests/specs/run/custom_inspect_url/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run custom_inspect_url.js", + "output": "custom_inspect_url.js.out" +} diff --git a/tests/testdata/run/custom_inspect_url.js b/tests/specs/run/custom_inspect_url/custom_inspect_url.js similarity index 100% rename from tests/testdata/run/custom_inspect_url.js rename to tests/specs/run/custom_inspect_url/custom_inspect_url.js diff --git a/tests/testdata/run/custom_inspect_url.js.out b/tests/specs/run/custom_inspect_url/custom_inspect_url.js.out similarity index 100% rename from tests/testdata/run/custom_inspect_url.js.out rename to tests/specs/run/custom_inspect_url/custom_inspect_url.js.out diff --git a/tests/specs/run/decorators_tc39_proposal/__test__.jsonc b/tests/specs/run/decorators_tc39_proposal/__test__.jsonc new file mode 100644 index 0000000000..8e529695d9 --- /dev/null +++ b/tests/specs/run/decorators_tc39_proposal/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --check decorators/tc39_proposal/main.ts", + "output": "decorators/tc39_proposal/main.out" +} diff --git a/tests/testdata/run/decorators/experimental/deno.json b/tests/specs/run/decorators_tc39_proposal/decorators/experimental/deno.json similarity index 100% rename from tests/testdata/run/decorators/experimental/deno.json rename to tests/specs/run/decorators_tc39_proposal/decorators/experimental/deno.json diff --git a/tests/testdata/run/decorators/experimental/no_check/main.out b/tests/specs/run/decorators_tc39_proposal/decorators/experimental/no_check/main.out similarity index 100% rename from tests/testdata/run/decorators/experimental/no_check/main.out rename to tests/specs/run/decorators_tc39_proposal/decorators/experimental/no_check/main.out diff --git a/tests/testdata/run/decorators/experimental/no_check/main.ts b/tests/specs/run/decorators_tc39_proposal/decorators/experimental/no_check/main.ts similarity index 100% rename from tests/testdata/run/decorators/experimental/no_check/main.ts rename to tests/specs/run/decorators_tc39_proposal/decorators/experimental/no_check/main.ts diff --git a/tests/testdata/run/decorators/experimental/runtime/main.out b/tests/specs/run/decorators_tc39_proposal/decorators/experimental/runtime/main.out similarity index 100% rename from tests/testdata/run/decorators/experimental/runtime/main.out rename to tests/specs/run/decorators_tc39_proposal/decorators/experimental/runtime/main.out diff --git a/tests/testdata/run/decorators/experimental/runtime/main.ts b/tests/specs/run/decorators_tc39_proposal/decorators/experimental/runtime/main.ts similarity index 100% rename from tests/testdata/run/decorators/experimental/runtime/main.ts rename to tests/specs/run/decorators_tc39_proposal/decorators/experimental/runtime/main.ts diff --git a/tests/testdata/run/decorators/experimental/ts/main.out b/tests/specs/run/decorators_tc39_proposal/decorators/experimental/ts/main.out similarity index 100% rename from tests/testdata/run/decorators/experimental/ts/main.out rename to tests/specs/run/decorators_tc39_proposal/decorators/experimental/ts/main.out diff --git a/tests/testdata/run/decorators/experimental/ts/main.ts b/tests/specs/run/decorators_tc39_proposal/decorators/experimental/ts/main.ts similarity index 100% rename from tests/testdata/run/decorators/experimental/ts/main.ts rename to tests/specs/run/decorators_tc39_proposal/decorators/experimental/ts/main.ts diff --git a/tests/testdata/run/decorators/tc39_proposal/main.out b/tests/specs/run/decorators_tc39_proposal/decorators/tc39_proposal/main.out similarity index 100% rename from tests/testdata/run/decorators/tc39_proposal/main.out rename to tests/specs/run/decorators_tc39_proposal/decorators/tc39_proposal/main.out diff --git a/tests/testdata/run/decorators/tc39_proposal/main.ts b/tests/specs/run/decorators_tc39_proposal/decorators/tc39_proposal/main.ts similarity index 100% rename from tests/testdata/run/decorators/tc39_proposal/main.ts rename to tests/specs/run/decorators_tc39_proposal/decorators/tc39_proposal/main.ts diff --git a/tests/specs/run/deno_exit_tampering/__test__.jsonc b/tests/specs/run/deno_exit_tampering/__test__.jsonc new file mode 100644 index 0000000000..1666fbacb3 --- /dev/null +++ b/tests/specs/run/deno_exit_tampering/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --no-check deno_exit_tampering.ts", + "output": "", + "exitCode": 42 +} diff --git a/tests/testdata/run/deno_exit_tampering.ts b/tests/specs/run/deno_exit_tampering/deno_exit_tampering.ts similarity index 100% rename from tests/testdata/run/deno_exit_tampering.ts rename to tests/specs/run/deno_exit_tampering/deno_exit_tampering.ts diff --git a/tests/specs/run/deny_all_permission_args/__test__.jsonc b/tests/specs/run/deny_all_permission_args/__test__.jsonc new file mode 100644 index 0000000000..1d6b286822 --- /dev/null +++ b/tests/specs/run/deny_all_permission_args/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --deny-env --deny-read --deny-write --deny-ffi --deny-run --deny-sys --deny-net deny_all_permission_args.js", + "output": "deny_all_permission_args.out" +} diff --git a/tests/testdata/run/deny_all_permission_args.js b/tests/specs/run/deny_all_permission_args/deny_all_permission_args.js similarity index 100% rename from tests/testdata/run/deny_all_permission_args.js rename to tests/specs/run/deny_all_permission_args/deny_all_permission_args.js diff --git a/tests/testdata/run/deny_all_permission_args.out b/tests/specs/run/deny_all_permission_args/deny_all_permission_args.out similarity index 100% rename from tests/testdata/run/deny_all_permission_args.out rename to tests/specs/run/deny_all_permission_args/deny_all_permission_args.out diff --git a/tests/specs/run/deny_some_permission_args/__test__.jsonc b/tests/specs/run/deny_some_permission_args/__test__.jsonc new file mode 100644 index 0000000000..a55ee57e48 --- /dev/null +++ b/tests/specs/run/deny_some_permission_args/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-env --deny-env=FOO --allow-read --deny-read=/foo --allow-write --deny-write=/foo --allow-ffi --deny-ffi=/foo --allow-run --deny-run=foo --allow-sys --deny-sys=hostname --allow-net --deny-net=127.0.0.1 deny_some_permission_args.js", + "output": "deny_some_permission_args.out" +} diff --git a/tests/testdata/run/deny_some_permission_args.js b/tests/specs/run/deny_some_permission_args/deny_some_permission_args.js similarity index 100% rename from tests/testdata/run/deny_some_permission_args.js rename to tests/specs/run/deny_some_permission_args/deny_some_permission_args.js diff --git a/tests/testdata/run/deny_some_permission_args.out b/tests/specs/run/deny_some_permission_args/deny_some_permission_args.out similarity index 100% rename from tests/testdata/run/deny_some_permission_args.out rename to tests/specs/run/deny_some_permission_args/deny_some_permission_args.out diff --git a/tests/specs/run/dom_exception_formatting/__test__.jsonc b/tests/specs/run/dom_exception_formatting/__test__.jsonc new file mode 100644 index 0000000000..5b1505b57b --- /dev/null +++ b/tests/specs/run/dom_exception_formatting/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run dom_exception_formatting.ts", + "output": "dom_exception_formatting.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/dom_exception_formatting.ts b/tests/specs/run/dom_exception_formatting/dom_exception_formatting.ts similarity index 100% rename from tests/testdata/run/dom_exception_formatting.ts rename to tests/specs/run/dom_exception_formatting/dom_exception_formatting.ts diff --git a/tests/testdata/run/dom_exception_formatting.ts.out b/tests/specs/run/dom_exception_formatting/dom_exception_formatting.ts.out similarity index 100% rename from tests/testdata/run/dom_exception_formatting.ts.out rename to tests/specs/run/dom_exception_formatting/dom_exception_formatting.ts.out diff --git a/tests/specs/run/dynamic_import_already_rejected/__test__.jsonc b/tests/specs/run/dynamic_import_already_rejected/__test__.jsonc new file mode 100644 index 0000000000..0cd1201309 --- /dev/null +++ b/tests/specs/run/dynamic_import_already_rejected/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read dynamic_import_already_rejected/main.ts", + "output": "dynamic_import_already_rejected/main.out" +} diff --git a/tests/testdata/run/dynamic_import_already_rejected/error_001.ts b/tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/error_001.ts similarity index 100% rename from tests/testdata/run/dynamic_import_already_rejected/error_001.ts rename to tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/error_001.ts diff --git a/tests/testdata/run/dynamic_import_already_rejected/main.out b/tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/main.out similarity index 100% rename from tests/testdata/run/dynamic_import_already_rejected/main.out rename to tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/main.out diff --git a/tests/testdata/run/dynamic_import_already_rejected/main.ts b/tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/main.ts similarity index 100% rename from tests/testdata/run/dynamic_import_already_rejected/main.ts rename to tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/main.ts diff --git a/tests/specs/run/dynamic_import_async_error/__test__.jsonc b/tests/specs/run/dynamic_import_async_error/__test__.jsonc new file mode 100644 index 0000000000..9824c34508 --- /dev/null +++ b/tests/specs/run/dynamic_import_async_error/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read dynamic_import_async_error/main.ts", + "output": "dynamic_import_async_error/main.out" +} diff --git a/tests/testdata/run/dynamic_import_async_error/delayed_error.ts b/tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/delayed_error.ts similarity index 100% rename from tests/testdata/run/dynamic_import_async_error/delayed_error.ts rename to tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/delayed_error.ts diff --git a/tests/testdata/run/dynamic_import_async_error/main.out b/tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/main.out similarity index 100% rename from tests/testdata/run/dynamic_import_async_error/main.out rename to tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/main.out diff --git a/tests/testdata/run/dynamic_import_async_error/main.ts b/tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/main.ts similarity index 100% rename from tests/testdata/run/dynamic_import_async_error/main.ts rename to tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/main.ts diff --git a/tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/__test__.jsonc b/tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/__test__.jsonc new file mode 100644 index 0000000000..c4c30ca5d4 --- /dev/null +++ b/tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --allow-read --allow-net --quiet dynamic_import_concurrent_non_statically_analyzable/main.ts", + "output": "dynamic_import_concurrent_non_statically_analyzable/main.out" +} diff --git a/tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/main.out b/tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/dynamic_import_concurrent_non_statically_analyzable/main.out similarity index 100% rename from tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/main.out rename to tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/dynamic_import_concurrent_non_statically_analyzable/main.out diff --git a/tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/main.ts b/tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/dynamic_import_concurrent_non_statically_analyzable/main.ts similarity index 100% rename from tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/main.ts rename to tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/dynamic_import_concurrent_non_statically_analyzable/main.ts diff --git a/tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/mod.ts b/tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/dynamic_import_concurrent_non_statically_analyzable/mod.ts similarity index 100% rename from tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/mod.ts rename to tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/dynamic_import_concurrent_non_statically_analyzable/mod.ts diff --git a/tests/specs/run/dynamic_import_conditional/__test__.jsonc b/tests/specs/run/dynamic_import_conditional/__test__.jsonc new file mode 100644 index 0000000000..8adff3a16d --- /dev/null +++ b/tests/specs/run/dynamic_import_conditional/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload dynamic_import_conditional.js", + "output": "dynamic_import_conditional.js.out" +} diff --git a/tests/testdata/run/dynamic_import_conditional.js b/tests/specs/run/dynamic_import_conditional/dynamic_import_conditional.js similarity index 100% rename from tests/testdata/run/dynamic_import_conditional.js rename to tests/specs/run/dynamic_import_conditional/dynamic_import_conditional.js diff --git a/tests/testdata/run/dynamic_import_conditional.js.out b/tests/specs/run/dynamic_import_conditional/dynamic_import_conditional.js.out similarity index 100% rename from tests/testdata/run/dynamic_import_conditional.js.out rename to tests/specs/run/dynamic_import_conditional/dynamic_import_conditional.js.out diff --git a/tests/specs/run/dynamic_import_permissions_blob_local/__test__.jsonc b/tests/specs/run/dynamic_import_permissions_blob_local/__test__.jsonc new file mode 100644 index 0000000000..27a747b3a5 --- /dev/null +++ b/tests/specs/run/dynamic_import_permissions_blob_local/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --reload --allow-net=localhost:4545 permissions_blob_local.ts", + "output": "permissions_blob_local.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/dynamic_import_permissions_blob_local/permissions_blob_local.ts b/tests/specs/run/dynamic_import_permissions_blob_local/permissions_blob_local.ts new file mode 100644 index 0000000000..865c1777a9 --- /dev/null +++ b/tests/specs/run/dynamic_import_permissions_blob_local/permissions_blob_local.ts @@ -0,0 +1,6 @@ +// This file doesn't really exist, but it doesn't matter, a "NotCapable" error should be thrown. +const code = `import "file:///${ + Deno.build.os == "windows" ? "C:/" : "" +}local_file.ts";`; +const blob = new Blob([code]); +await import(URL.createObjectURL(blob)); diff --git a/tests/specs/run/dynamic_import_permissions_blob_local/permissions_blob_local.ts.out b/tests/specs/run/dynamic_import_permissions_blob_local/permissions_blob_local.ts.out new file mode 100644 index 0000000000..b7b246ba2b --- /dev/null +++ b/tests/specs/run/dynamic_import_permissions_blob_local/permissions_blob_local.ts.out @@ -0,0 +1,5 @@ +error: Uncaught (in promise) TypeError: Requires read access to "[WILDCARD]local_file.ts", run again with the --allow-read flag + at blob:null/[WILDCARD]:1:8 +await import(URL.createObjectURL(blob)); +^ + at async file://[WILDCARD]/permissions_blob_local.ts:6:1 diff --git a/tests/specs/run/dynamic_import_permissions_blob_remote/__test__.jsonc b/tests/specs/run/dynamic_import_permissions_blob_remote/__test__.jsonc new file mode 100644 index 0000000000..f9d66b6b38 --- /dev/null +++ b/tests/specs/run/dynamic_import_permissions_blob_remote/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --reload --allow-net=localhost:4545 permissions_blob_remote.ts", + "output": "permissions_blob_remote.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/dynamic_import_permissions_blob_remote/permissions_blob_remote.ts b/tests/specs/run/dynamic_import_permissions_blob_remote/permissions_blob_remote.ts new file mode 100644 index 0000000000..569b1f84c5 --- /dev/null +++ b/tests/specs/run/dynamic_import_permissions_blob_remote/permissions_blob_remote.ts @@ -0,0 +1,3 @@ +const code = `import "https://example.com/some/file.ts";`; +const blob = new Blob([code]); +await import(URL.createObjectURL(blob)); diff --git a/tests/specs/run/dynamic_import_permissions_blob_remote/permissions_blob_remote.ts.out b/tests/specs/run/dynamic_import_permissions_blob_remote/permissions_blob_remote.ts.out new file mode 100644 index 0000000000..287cf99985 --- /dev/null +++ b/tests/specs/run/dynamic_import_permissions_blob_remote/permissions_blob_remote.ts.out @@ -0,0 +1,5 @@ +error: Uncaught (in promise) TypeError: Requires import access to "example.com:443", run again with the --allow-import flag + at blob:null/[WILDCARD]:1:8 +await import(URL.createObjectURL(blob)); +^ + at async file:///[WILDCARD]/permissions_blob_remote.ts:3:1 diff --git a/tests/specs/run/dynamic_import_permissions_data_local/__test__.jsonc b/tests/specs/run/dynamic_import_permissions_data_local/__test__.jsonc new file mode 100644 index 0000000000..8f118d8be3 --- /dev/null +++ b/tests/specs/run/dynamic_import_permissions_data_local/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --reload --allow-net=localhost:4545 permissions_data_local.ts", + "output": "permissions_data_local.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/dynamic_import_permissions_data_local/permissions_data_local.ts b/tests/specs/run/dynamic_import_permissions_data_local/permissions_data_local.ts new file mode 100644 index 0000000000..01bff7d7a2 --- /dev/null +++ b/tests/specs/run/dynamic_import_permissions_data_local/permissions_data_local.ts @@ -0,0 +1,5 @@ +// This file doesn't really exist, but it doesn't matter, a "NotCapable" error should be thrown. +const code = `import "file:///${ + Deno.build.os == "windows" ? "C:/" : "" +}local_file.ts";`; +await import(`data:application/javascript;base64,${btoa(code)}`); diff --git a/tests/specs/run/dynamic_import_permissions_data_local/permissions_data_local.ts.out b/tests/specs/run/dynamic_import_permissions_data_local/permissions_data_local.ts.out new file mode 100644 index 0000000000..bf8c1948e6 --- /dev/null +++ b/tests/specs/run/dynamic_import_permissions_data_local/permissions_data_local.ts.out @@ -0,0 +1,5 @@ +error: Uncaught (in promise) TypeError: Requires read access to "[WILDCARD]local_file.ts", run again with the --allow-read flag + at data:application/javascript;base64,[WILDCARD]:1:8 +await import(`data:application/javascript;base64,${btoa(code)}`); +^ + at async file:///[WILDCARD]/permissions_data_local.ts:5:1 diff --git a/tests/specs/run/dynamic_import_permissions_data_remote/__test__.jsonc b/tests/specs/run/dynamic_import_permissions_data_remote/__test__.jsonc new file mode 100644 index 0000000000..5b2c0c568f --- /dev/null +++ b/tests/specs/run/dynamic_import_permissions_data_remote/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --reload --allow-import=localhost:4545 permissions_data_remote.ts", + "output": "permissions_data_remote.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/dynamic_import_permissions_data_remote/permissions_data_remote.ts b/tests/specs/run/dynamic_import_permissions_data_remote/permissions_data_remote.ts new file mode 100644 index 0000000000..b0a9540c32 --- /dev/null +++ b/tests/specs/run/dynamic_import_permissions_data_remote/permissions_data_remote.ts @@ -0,0 +1,3 @@ +// This file doesn't really exist, but it doesn't matter, a "PermissionsDenied" error should be thrown. +const code = `import "https://example.com/some/file.ts";`; +await import(`data:application/javascript;base64,${btoa(code)}`); diff --git a/tests/specs/run/dynamic_import_permissions_data_remote/permissions_data_remote.ts.out b/tests/specs/run/dynamic_import_permissions_data_remote/permissions_data_remote.ts.out new file mode 100644 index 0000000000..c8de9382a5 --- /dev/null +++ b/tests/specs/run/dynamic_import_permissions_data_remote/permissions_data_remote.ts.out @@ -0,0 +1,5 @@ +error: Uncaught (in promise) TypeError: Requires import access to "example.com:443", run again with the --allow-import flag + at data:application/javascript;base64,aW1wb3J0ICJodHRwczovL2V4YW1wbGUuY29tL3NvbWUvZmlsZS50cyI7:1:8 +await import(`data:application/javascript;base64,${btoa(code)}`); +^ + at async file:///[WILDCARD]/permissions_data_remote.ts:3:1 diff --git a/tests/specs/run/dynamic_import_permissions_remote_remote/__test__.jsonc b/tests/specs/run/dynamic_import_permissions_remote_remote/__test__.jsonc new file mode 100644 index 0000000000..00fd2a6e4c --- /dev/null +++ b/tests/specs/run/dynamic_import_permissions_remote_remote/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --reload --allow-import=localhost:4545 permissions_remote_remote.ts", + "output": "permissions_remote_remote.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/dynamic_import_permissions_remote_remote/permissions_remote_remote.ts b/tests/specs/run/dynamic_import_permissions_remote_remote/permissions_remote_remote.ts new file mode 100644 index 0000000000..65a2541910 --- /dev/null +++ b/tests/specs/run/dynamic_import_permissions_remote_remote/permissions_remote_remote.ts @@ -0,0 +1,3 @@ +await import( + "" + "http://localhost:4545/dynamic_import/static_remote.ts" +); diff --git a/tests/specs/run/dynamic_import_permissions_remote_remote/permissions_remote_remote.ts.out b/tests/specs/run/dynamic_import_permissions_remote_remote/permissions_remote_remote.ts.out new file mode 100644 index 0000000000..16fe3bbdd6 --- /dev/null +++ b/tests/specs/run/dynamic_import_permissions_remote_remote/permissions_remote_remote.ts.out @@ -0,0 +1,5 @@ +error: Uncaught (in promise) TypeError: Requires import access to "example.com:443", run again with the --allow-import flag + at http://localhost:4545/dynamic_import/static_remote.ts:2:8 +await import( +^ + at async file:///[WILDCARD]/permissions_remote_remote.ts:1:1 diff --git a/tests/specs/run/dynamic_import_permissions_remote_remote/static_remote.ts b/tests/specs/run/dynamic_import_permissions_remote_remote/static_remote.ts new file mode 100644 index 0000000000..2d6e820fd6 --- /dev/null +++ b/tests/specs/run/dynamic_import_permissions_remote_remote/static_remote.ts @@ -0,0 +1,2 @@ +// This file doesn't really exist, but it doesn't matter, a "PermissionsDenied" error should be thrown. +import "https://example.com/some/file.ts"; diff --git a/tests/specs/run/dynamic_import_static_analysis_no_permissions/__test__.jsonc b/tests/specs/run/dynamic_import_static_analysis_no_permissions/__test__.jsonc new file mode 100644 index 0000000000..9379748691 --- /dev/null +++ b/tests/specs/run/dynamic_import_static_analysis_no_permissions/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --no-prompt static_analysis_no_permissions.ts", + "output": "static_analysis_no_permissions.ts.out" +} diff --git a/tests/testdata/run/empty.ts b/tests/specs/run/dynamic_import_static_analysis_no_permissions/empty_1.ts similarity index 100% rename from tests/testdata/run/empty.ts rename to tests/specs/run/dynamic_import_static_analysis_no_permissions/empty_1.ts diff --git a/tests/testdata/run/wasm_shared.out b/tests/specs/run/dynamic_import_static_analysis_no_permissions/empty_2.ts similarity index 100% rename from tests/testdata/run/wasm_shared.out rename to tests/specs/run/dynamic_import_static_analysis_no_permissions/empty_2.ts diff --git a/tests/specs/run/dynamic_import_static_analysis_no_permissions/static_analysis_no_permissions.ts b/tests/specs/run/dynamic_import_static_analysis_no_permissions/static_analysis_no_permissions.ts new file mode 100644 index 0000000000..de75ba87b6 --- /dev/null +++ b/tests/specs/run/dynamic_import_static_analysis_no_permissions/static_analysis_no_permissions.ts @@ -0,0 +1,13 @@ +try { + await import("./empty_1.ts"); + console.log("✅ Succeeded importing statically analyzable specifier"); +} catch { + console.log("❌ Failed importing statically analyzable specifier"); +} + +try { + await import("" + "./empty_2.ts"); + console.log("❌ Succeeded importing non-statically analyzable specifier"); +} catch { + console.log("✅ Failed importing non-statically analyzable specifier"); +} diff --git a/tests/specs/run/dynamic_import_static_analysis_no_permissions/static_analysis_no_permissions.ts.out b/tests/specs/run/dynamic_import_static_analysis_no_permissions/static_analysis_no_permissions.ts.out new file mode 100644 index 0000000000..ba9249ab0b --- /dev/null +++ b/tests/specs/run/dynamic_import_static_analysis_no_permissions/static_analysis_no_permissions.ts.out @@ -0,0 +1,2 @@ +✅ Succeeded importing statically analyzable specifier +✅ Failed importing non-statically analyzable specifier diff --git a/tests/specs/run/dynamic_import_syntax_error/__test__.jsonc b/tests/specs/run/dynamic_import_syntax_error/__test__.jsonc new file mode 100644 index 0000000000..1971d3184c --- /dev/null +++ b/tests/specs/run/dynamic_import_syntax_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run -A dynamic_import_syntax_error.js", + "output": "dynamic_import_syntax_error.js.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/dynamic_import_syntax_error.js b/tests/specs/run/dynamic_import_syntax_error/dynamic_import_syntax_error.js similarity index 100% rename from tests/testdata/run/dynamic_import_syntax_error.js rename to tests/specs/run/dynamic_import_syntax_error/dynamic_import_syntax_error.js diff --git a/tests/testdata/run/dynamic_import_syntax_error.js.out b/tests/specs/run/dynamic_import_syntax_error/dynamic_import_syntax_error.js.out similarity index 100% rename from tests/testdata/run/dynamic_import_syntax_error.js.out rename to tests/specs/run/dynamic_import_syntax_error/dynamic_import_syntax_error.js.out diff --git a/tests/specs/run/dynamic_import_syntax_error/dynamic_import_syntax_error_import.js b/tests/specs/run/dynamic_import_syntax_error/dynamic_import_syntax_error_import.js new file mode 100644 index 0000000000..bcf0756385 --- /dev/null +++ b/tests/specs/run/dynamic_import_syntax_error/dynamic_import_syntax_error_import.js @@ -0,0 +1,5 @@ +// deno-lint-ignore-file +function foo() { + await Promise.resolve(); +} +foo(); diff --git a/tests/specs/run/empty_typescript/__test__.jsonc b/tests/specs/run/empty_typescript/__test__.jsonc new file mode 100644 index 0000000000..8090c50f68 --- /dev/null +++ b/tests/specs/run/empty_typescript/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --check empty.ts", + "output": "Check file:[WILDCARD]/empty.ts\n" +} diff --git a/tests/testdata/run/worker_close_race.js.out b/tests/specs/run/empty_typescript/empty.ts similarity index 100% rename from tests/testdata/run/worker_close_race.js.out rename to tests/specs/run/empty_typescript/empty.ts diff --git a/tests/specs/run/error_001/__test__.jsonc b/tests/specs/run/error_001/__test__.jsonc new file mode 100644 index 0000000000..7b9158e4f5 --- /dev/null +++ b/tests/specs/run/error_001/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload error_001.ts", + "output": "error_001.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/error_001/error_001.ts b/tests/specs/run/error_001/error_001.ts new file mode 100644 index 0000000000..b01068bc01 --- /dev/null +++ b/tests/specs/run/error_001/error_001.ts @@ -0,0 +1,9 @@ +function foo(): never { + throw Error("bad"); +} + +function bar() { + foo(); +} + +bar(); diff --git a/tests/testdata/run/error_001.ts.out b/tests/specs/run/error_001/error_001.ts.out similarity index 100% rename from tests/testdata/run/error_001.ts.out rename to tests/specs/run/error_001/error_001.ts.out diff --git a/tests/specs/run/error_002/__test__.jsonc b/tests/specs/run/error_002/__test__.jsonc new file mode 100644 index 0000000000..3a68a86751 --- /dev/null +++ b/tests/specs/run/error_002/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload error_002.ts", + "output": "error_002.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/error_002/error_002.ts b/tests/specs/run/error_002/error_002.ts new file mode 100644 index 0000000000..ac712fbf71 --- /dev/null +++ b/tests/specs/run/error_002/error_002.ts @@ -0,0 +1,7 @@ +import { throwsError } from "./mod1.ts"; + +function foo() { + throwsError(); +} + +foo(); diff --git a/tests/testdata/run/error_002.ts.out b/tests/specs/run/error_002/error_002.ts.out similarity index 78% rename from tests/testdata/run/error_002.ts.out rename to tests/specs/run/error_002/error_002.ts.out index 9fec5d968a..1051e7360c 100644 --- a/tests/testdata/run/error_002.ts.out +++ b/tests/specs/run/error_002/error_002.ts.out @@ -1,6 +1,6 @@ [WILDCARD]error: Uncaught (in promise) Error: exception from mod1 throw Error("exception from mod1"); ^ - at throwsError ([WILDCARD]/subdir/mod1.ts:16:9) + at throwsError ([WILDCARD]/mod1.ts:16:9) at foo ([WILDCARD]/error_002.ts:4:3) at [WILDCARD]/error_002.ts:7:1 diff --git a/tests/specs/run/error_002/mod1.ts b/tests/specs/run/error_002/mod1.ts new file mode 100644 index 0000000000..5e58f432ed --- /dev/null +++ b/tests/specs/run/error_002/mod1.ts @@ -0,0 +1,17 @@ +import { printHello2, returnsFoo } from "./subdir2/mod2.ts"; + +export function returnsHi(): string { + return "Hi"; +} + +export function returnsFoo2(): string { + return returnsFoo(); +} + +export function printHello3() { + printHello2(); +} + +export function throwsError() { + throw Error("exception from mod1"); +} diff --git a/tests/specs/run/error_002/print_hello.ts b/tests/specs/run/error_002/print_hello.ts new file mode 100644 index 0000000000..b9c0ad5275 --- /dev/null +++ b/tests/specs/run/error_002/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/specs/run/error_002/subdir2/mod2.ts b/tests/specs/run/error_002/subdir2/mod2.ts new file mode 100644 index 0000000000..9071d0aeb4 --- /dev/null +++ b/tests/specs/run/error_002/subdir2/mod2.ts @@ -0,0 +1,9 @@ +import { printHello } from "../print_hello.ts"; + +export function returnsFoo(): string { + return "Foo"; +} + +export function printHello2() { + printHello(); +} diff --git a/tests/specs/run/error_003_typescript/__test__.jsonc b/tests/specs/run/error_003_typescript/__test__.jsonc new file mode 100644 index 0000000000..f7ef69b268 --- /dev/null +++ b/tests/specs/run/error_003_typescript/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload --check error_003_typescript.ts", + "output": "error_003_typescript.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_003_typescript.ts b/tests/specs/run/error_003_typescript/error_003_typescript.ts similarity index 100% rename from tests/testdata/run/error_003_typescript.ts rename to tests/specs/run/error_003_typescript/error_003_typescript.ts diff --git a/tests/testdata/run/error_003_typescript.ts.out b/tests/specs/run/error_003_typescript/error_003_typescript.ts.out similarity index 100% rename from tests/testdata/run/error_003_typescript.ts.out rename to tests/specs/run/error_003_typescript/error_003_typescript.ts.out diff --git a/tests/specs/run/error_003_typescript2/__test__.jsonc b/tests/specs/run/error_003_typescript2/__test__.jsonc new file mode 100644 index 0000000000..ceeb6e7d94 --- /dev/null +++ b/tests/specs/run/error_003_typescript2/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --check error_003_typescript.ts", + "output": "error_003_typescript.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/error_003_typescript2/error_003_typescript.ts b/tests/specs/run/error_003_typescript2/error_003_typescript.ts new file mode 100644 index 0000000000..e1f882123c --- /dev/null +++ b/tests/specs/run/error_003_typescript2/error_003_typescript.ts @@ -0,0 +1,20 @@ +// deno-lint-ignore-file +let x = { + a: { + b: { + c() { + return { d: "hello" }; + }, + }, + }, +}; +let y = { + a: { + b: { + c() { + return { d: 1234 }; + }, + }, + }, +}; +x = y; diff --git a/tests/specs/run/error_003_typescript2/error_003_typescript.ts.out b/tests/specs/run/error_003_typescript2/error_003_typescript.ts.out new file mode 100644 index 0000000000..bbb2ec4708 --- /dev/null +++ b/tests/specs/run/error_003_typescript2/error_003_typescript.ts.out @@ -0,0 +1,7 @@ +[WILDCARD] +error: TS2322 [ERROR]: Type '{ a: { b: { c(): { d: number; }; }; }; }' is not assignable to type '{ a: { b: { c(): { d: string; }; }; }; }'. + The types of 'a.b.c().d' are incompatible between these types. + Type 'number' is not assignable to type 'string'. +x = y; +^ + at [WILDCARD]/error_003_typescript.ts:20:1 diff --git a/tests/specs/run/error_004_missing_module/__test__.jsonc b/tests/specs/run/error_004_missing_module/__test__.jsonc new file mode 100644 index 0000000000..824b9d8c9c --- /dev/null +++ b/tests/specs/run/error_004_missing_module/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload error_004_missing_module.ts", + "output": "error_004_missing_module.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_004_missing_module.ts b/tests/specs/run/error_004_missing_module/error_004_missing_module.ts similarity index 100% rename from tests/testdata/run/error_004_missing_module.ts rename to tests/specs/run/error_004_missing_module/error_004_missing_module.ts diff --git a/tests/testdata/run/error_004_missing_module.ts.out b/tests/specs/run/error_004_missing_module/error_004_missing_module.ts.out similarity index 100% rename from tests/testdata/run/error_004_missing_module.ts.out rename to tests/specs/run/error_004_missing_module/error_004_missing_module.ts.out diff --git a/tests/specs/run/error_005_missing_dynamic_import/__test__.jsonc b/tests/specs/run/error_005_missing_dynamic_import/__test__.jsonc new file mode 100644 index 0000000000..b9f6a1b747 --- /dev/null +++ b/tests/specs/run/error_005_missing_dynamic_import/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload --allow-read --quiet error_005_missing_dynamic_import.ts", + "output": "error_005_missing_dynamic_import.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_005_missing_dynamic_import.ts b/tests/specs/run/error_005_missing_dynamic_import/error_005_missing_dynamic_import.ts similarity index 100% rename from tests/testdata/run/error_005_missing_dynamic_import.ts rename to tests/specs/run/error_005_missing_dynamic_import/error_005_missing_dynamic_import.ts diff --git a/tests/testdata/run/error_005_missing_dynamic_import.ts.out b/tests/specs/run/error_005_missing_dynamic_import/error_005_missing_dynamic_import.ts.out similarity index 100% rename from tests/testdata/run/error_005_missing_dynamic_import.ts.out rename to tests/specs/run/error_005_missing_dynamic_import/error_005_missing_dynamic_import.ts.out diff --git a/tests/specs/run/error_006_import_ext_failure/__test__.jsonc b/tests/specs/run/error_006_import_ext_failure/__test__.jsonc new file mode 100644 index 0000000000..0e70bdcaf6 --- /dev/null +++ b/tests/specs/run/error_006_import_ext_failure/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload error_006_import_ext_failure.ts", + "output": "error_006_import_ext_failure.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_006_import_ext_failure.ts b/tests/specs/run/error_006_import_ext_failure/error_006_import_ext_failure.ts similarity index 100% rename from tests/testdata/run/error_006_import_ext_failure.ts rename to tests/specs/run/error_006_import_ext_failure/error_006_import_ext_failure.ts diff --git a/tests/testdata/run/error_006_import_ext_failure.ts.out b/tests/specs/run/error_006_import_ext_failure/error_006_import_ext_failure.ts.out similarity index 100% rename from tests/testdata/run/error_006_import_ext_failure.ts.out rename to tests/specs/run/error_006_import_ext_failure/error_006_import_ext_failure.ts.out diff --git a/tests/specs/run/error_007_any/__test__.jsonc b/tests/specs/run/error_007_any/__test__.jsonc new file mode 100644 index 0000000000..8a1c0d27e6 --- /dev/null +++ b/tests/specs/run/error_007_any/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload error_007_any.ts", + "output": "error_007_any.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_007_any.ts b/tests/specs/run/error_007_any/error_007_any.ts similarity index 100% rename from tests/testdata/run/error_007_any.ts rename to tests/specs/run/error_007_any/error_007_any.ts diff --git a/tests/testdata/run/error_007_any.ts.out b/tests/specs/run/error_007_any/error_007_any.ts.out similarity index 100% rename from tests/testdata/run/error_007_any.ts.out rename to tests/specs/run/error_007_any/error_007_any.ts.out diff --git a/tests/specs/run/error_008_checkjs/__test__.jsonc b/tests/specs/run/error_008_checkjs/__test__.jsonc new file mode 100644 index 0000000000..f735be953c --- /dev/null +++ b/tests/specs/run/error_008_checkjs/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload error_008_checkjs.js", + "output": "error_008_checkjs.js.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_008_checkjs.js b/tests/specs/run/error_008_checkjs/error_008_checkjs.js similarity index 100% rename from tests/testdata/run/error_008_checkjs.js rename to tests/specs/run/error_008_checkjs/error_008_checkjs.js diff --git a/tests/testdata/run/error_008_checkjs.js.out b/tests/specs/run/error_008_checkjs/error_008_checkjs.js.out similarity index 100% rename from tests/testdata/run/error_008_checkjs.js.out rename to tests/specs/run/error_008_checkjs/error_008_checkjs.js.out diff --git a/tests/specs/run/error_009_extensions_error/__test__.jsonc b/tests/specs/run/error_009_extensions_error/__test__.jsonc new file mode 100644 index 0000000000..740d5119f5 --- /dev/null +++ b/tests/specs/run/error_009_extensions_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run error_009_extensions_error.js", + "output": "error_009_extensions_error.js.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_009_extensions_error.js b/tests/specs/run/error_009_extensions_error/error_009_extensions_error.js similarity index 100% rename from tests/testdata/run/error_009_extensions_error.js rename to tests/specs/run/error_009_extensions_error/error_009_extensions_error.js diff --git a/tests/testdata/run/error_009_extensions_error.js.out b/tests/specs/run/error_009_extensions_error/error_009_extensions_error.js.out similarity index 100% rename from tests/testdata/run/error_009_extensions_error.js.out rename to tests/specs/run/error_009_extensions_error/error_009_extensions_error.js.out diff --git a/tests/specs/run/error_011_bad_module_specifier/__test__.jsonc b/tests/specs/run/error_011_bad_module_specifier/__test__.jsonc new file mode 100644 index 0000000000..5ca5146bec --- /dev/null +++ b/tests/specs/run/error_011_bad_module_specifier/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload error_011_bad_module_specifier.ts", + "output": "error_011_bad_module_specifier.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_011_bad_module_specifier.ts b/tests/specs/run/error_011_bad_module_specifier/error_011_bad_module_specifier.ts similarity index 100% rename from tests/testdata/run/error_011_bad_module_specifier.ts rename to tests/specs/run/error_011_bad_module_specifier/error_011_bad_module_specifier.ts diff --git a/tests/testdata/run/error_011_bad_module_specifier.ts.out b/tests/specs/run/error_011_bad_module_specifier/error_011_bad_module_specifier.ts.out similarity index 100% rename from tests/testdata/run/error_011_bad_module_specifier.ts.out rename to tests/specs/run/error_011_bad_module_specifier/error_011_bad_module_specifier.ts.out diff --git a/tests/specs/run/error_012_bad_dynamic_import_specifier/__test__.jsonc b/tests/specs/run/error_012_bad_dynamic_import_specifier/__test__.jsonc new file mode 100644 index 0000000000..9344f730dc --- /dev/null +++ b/tests/specs/run/error_012_bad_dynamic_import_specifier/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload --check error_012_bad_dynamic_import_specifier.ts", + "output": "error_012_bad_dynamic_import_specifier.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_012_bad_dynamic_import_specifier.ts b/tests/specs/run/error_012_bad_dynamic_import_specifier/error_012_bad_dynamic_import_specifier.ts similarity index 100% rename from tests/testdata/run/error_012_bad_dynamic_import_specifier.ts rename to tests/specs/run/error_012_bad_dynamic_import_specifier/error_012_bad_dynamic_import_specifier.ts diff --git a/tests/testdata/run/error_012_bad_dynamic_import_specifier.ts.out b/tests/specs/run/error_012_bad_dynamic_import_specifier/error_012_bad_dynamic_import_specifier.ts.out similarity index 100% rename from tests/testdata/run/error_012_bad_dynamic_import_specifier.ts.out rename to tests/specs/run/error_012_bad_dynamic_import_specifier/error_012_bad_dynamic_import_specifier.ts.out diff --git a/tests/specs/run/error_014_catch_dynamic_import_error/__test__.jsonc b/tests/specs/run/error_014_catch_dynamic_import_error/__test__.jsonc new file mode 100644 index 0000000000..94957dc659 --- /dev/null +++ b/tests/specs/run/error_014_catch_dynamic_import_error/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --allow-read error_014_catch_dynamic_import_error.js", + "output": "error_014_catch_dynamic_import_error.js.out" +} diff --git a/tests/testdata/run/error_014_catch_dynamic_import_error.js b/tests/specs/run/error_014_catch_dynamic_import_error/error_014_catch_dynamic_import_error.js similarity index 79% rename from tests/testdata/run/error_014_catch_dynamic_import_error.js rename to tests/specs/run/error_014_catch_dynamic_import_error/error_014_catch_dynamic_import_error.js index c58e54dcbb..05b021d15d 100644 --- a/tests/testdata/run/error_014_catch_dynamic_import_error.js +++ b/tests/specs/run/error_014_catch_dynamic_import_error/error_014_catch_dynamic_import_error.js @@ -7,21 +7,21 @@ } try { - await import("../subdir/indirect_import_error.js"); + await import("./indirect_import_error.js"); } catch (err) { console.log("Caught indirect direct dynamic import error."); console.log(err); } try { - await import("../subdir/throws.js"); + await import("./throws.js"); } catch (err) { console.log("Caught error thrown by dynamically imported module."); console.log(err); } try { - await import("../subdir/indirect_throws.js"); + await import("./indirect_throws.js"); } catch (err) { console.log( "Caught error thrown indirectly by dynamically imported module.", diff --git a/tests/testdata/run/error_014_catch_dynamic_import_error.js.out b/tests/specs/run/error_014_catch_dynamic_import_error/error_014_catch_dynamic_import_error.js.out similarity index 83% rename from tests/testdata/run/error_014_catch_dynamic_import_error.js.out rename to tests/specs/run/error_014_catch_dynamic_import_error/error_014_catch_dynamic_import_error.js.out index 868c971940..71feaa55bf 100644 --- a/tests/testdata/run/error_014_catch_dynamic_import_error.js.out +++ b/tests/specs/run/error_014_catch_dynamic_import_error/error_014_catch_dynamic_import_error.js.out @@ -7,13 +7,13 @@ TypeError: Relative import path "does not exist" not prefixed with / or ./ or .. } Caught indirect direct dynamic import error. TypeError: Relative import path "does not exist either" not prefixed with / or ./ or ../ - at [WILDCARD]/subdir/indirect_import_error.js:1:15 + at [WILDCARD]/indirect_import_error.js:1:15 at async [WILDCARD]/error_014_catch_dynamic_import_error.js:10:5 { code: "ERR_MODULE_NOT_FOUND" } Caught error thrown by dynamically imported module. Error: An error - at [WILDCARD]/subdir/throws.js:6:7 + at [WILDCARD]/throws.js:6:7 Caught error thrown indirectly by dynamically imported module. Error: An error - at [WILDCARD]/subdir/throws.js:6:7 + at [WILDCARD]/throws.js:6:7 diff --git a/tests/specs/run/error_014_catch_dynamic_import_error/indirect_import_error.js b/tests/specs/run/error_014_catch_dynamic_import_error/indirect_import_error.js new file mode 100644 index 0000000000..84011d2913 --- /dev/null +++ b/tests/specs/run/error_014_catch_dynamic_import_error/indirect_import_error.js @@ -0,0 +1 @@ +export * from "does not exist either"; diff --git a/tests/specs/run/error_014_catch_dynamic_import_error/indirect_throws.js b/tests/specs/run/error_014_catch_dynamic_import_error/indirect_throws.js new file mode 100644 index 0000000000..e1810a66cb --- /dev/null +++ b/tests/specs/run/error_014_catch_dynamic_import_error/indirect_throws.js @@ -0,0 +1 @@ +export * from "./throws.js"; diff --git a/tests/specs/run/error_014_catch_dynamic_import_error/throws.js b/tests/specs/run/error_014_catch_dynamic_import_error/throws.js new file mode 100644 index 0000000000..abdf291568 --- /dev/null +++ b/tests/specs/run/error_014_catch_dynamic_import_error/throws.js @@ -0,0 +1,6 @@ +// deno-lint-ignore-file +export function boo() { + console.log("Boo!"); +} + +throw new Error("An error"); diff --git a/tests/specs/run/error_015_dynamic_import_permissions/__test__.jsonc b/tests/specs/run/error_015_dynamic_import_permissions/__test__.jsonc new file mode 100644 index 0000000000..3ab25f1a52 --- /dev/null +++ b/tests/specs/run/error_015_dynamic_import_permissions/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload --quiet error_015_dynamic_import_permissions.js", + "output": "error_015_dynamic_import_permissions.out", + "exitCode": 1 +} diff --git a/tests/specs/run/error_015_dynamic_import_permissions/error_015_dynamic_import_permissions.js b/tests/specs/run/error_015_dynamic_import_permissions/error_015_dynamic_import_permissions.js new file mode 100644 index 0000000000..6e7daf5d01 --- /dev/null +++ b/tests/specs/run/error_015_dynamic_import_permissions/error_015_dynamic_import_permissions.js @@ -0,0 +1,3 @@ +(async () => { + await import("" + "http://example.com/mod4.js"); +})(); diff --git a/tests/testdata/run/error_015_dynamic_import_permissions.out b/tests/specs/run/error_015_dynamic_import_permissions/error_015_dynamic_import_permissions.out similarity index 77% rename from tests/testdata/run/error_015_dynamic_import_permissions.out rename to tests/specs/run/error_015_dynamic_import_permissions/error_015_dynamic_import_permissions.out index 15c26b4251..8ef2f6f1e4 100644 --- a/tests/testdata/run/error_015_dynamic_import_permissions.out +++ b/tests/specs/run/error_015_dynamic_import_permissions/error_015_dynamic_import_permissions.out @@ -1,4 +1,4 @@ error: Uncaught (in promise) TypeError: Requires import access to "example.com:80", run again with the --allow-import flag - await import("" + "http://example.com/subdir/mod4.js"); + await import("" + "http://example.com/mod4.js"); ^ at async file://[WILDCARD]/error_015_dynamic_import_permissions.js:2:3 diff --git a/tests/specs/run/error_015_dynamic_import_permissions/mod4.js b/tests/specs/run/error_015_dynamic_import_permissions/mod4.js new file mode 100644 index 0000000000..71332dbc42 --- /dev/null +++ b/tests/specs/run/error_015_dynamic_import_permissions/mod4.js @@ -0,0 +1 @@ +export const isMod4 = true; diff --git a/tests/specs/run/error_017_hide_long_source_ts/__test__.jsonc b/tests/specs/run/error_017_hide_long_source_ts/__test__.jsonc new file mode 100644 index 0000000000..382d560391 --- /dev/null +++ b/tests/specs/run/error_017_hide_long_source_ts/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload --check error_017_hide_long_source_ts.ts", + "output": "error_017_hide_long_source_ts.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_017_hide_long_source_ts.ts b/tests/specs/run/error_017_hide_long_source_ts/error_017_hide_long_source_ts.ts similarity index 100% rename from tests/testdata/run/error_017_hide_long_source_ts.ts rename to tests/specs/run/error_017_hide_long_source_ts/error_017_hide_long_source_ts.ts diff --git a/tests/testdata/run/error_017_hide_long_source_ts.ts.out b/tests/specs/run/error_017_hide_long_source_ts/error_017_hide_long_source_ts.ts.out similarity index 100% rename from tests/testdata/run/error_017_hide_long_source_ts.ts.out rename to tests/specs/run/error_017_hide_long_source_ts/error_017_hide_long_source_ts.ts.out diff --git a/tests/specs/run/error_018_hide_long_source_js/__test__.jsonc b/tests/specs/run/error_018_hide_long_source_js/__test__.jsonc new file mode 100644 index 0000000000..4e91a820df --- /dev/null +++ b/tests/specs/run/error_018_hide_long_source_js/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run error_018_hide_long_source_js.js", + "output": "error_018_hide_long_source_js.js.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_018_hide_long_source_js.js b/tests/specs/run/error_018_hide_long_source_js/error_018_hide_long_source_js.js similarity index 100% rename from tests/testdata/run/error_018_hide_long_source_js.js rename to tests/specs/run/error_018_hide_long_source_js/error_018_hide_long_source_js.js diff --git a/tests/testdata/run/error_018_hide_long_source_js.js.out b/tests/specs/run/error_018_hide_long_source_js/error_018_hide_long_source_js.js.out similarity index 100% rename from tests/testdata/run/error_018_hide_long_source_js.js.out rename to tests/specs/run/error_018_hide_long_source_js/error_018_hide_long_source_js.js.out diff --git a/tests/specs/run/error_019_stack_function/__test__.jsonc b/tests/specs/run/error_019_stack_function/__test__.jsonc new file mode 100644 index 0000000000..5e272ee492 --- /dev/null +++ b/tests/specs/run/error_019_stack_function/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run error_019_stack_function.ts", + "output": "error_019_stack_function.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_019_stack_function.ts b/tests/specs/run/error_019_stack_function/error_019_stack_function.ts similarity index 100% rename from tests/testdata/run/error_019_stack_function.ts rename to tests/specs/run/error_019_stack_function/error_019_stack_function.ts diff --git a/tests/testdata/run/error_019_stack_function.ts.out b/tests/specs/run/error_019_stack_function/error_019_stack_function.ts.out similarity index 100% rename from tests/testdata/run/error_019_stack_function.ts.out rename to tests/specs/run/error_019_stack_function/error_019_stack_function.ts.out diff --git a/tests/specs/run/error_020_stack_constructor/__test__.jsonc b/tests/specs/run/error_020_stack_constructor/__test__.jsonc new file mode 100644 index 0000000000..2dd574565e --- /dev/null +++ b/tests/specs/run/error_020_stack_constructor/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run error_020_stack_constructor.ts", + "output": "error_020_stack_constructor.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_020_stack_constructor.ts b/tests/specs/run/error_020_stack_constructor/error_020_stack_constructor.ts similarity index 100% rename from tests/testdata/run/error_020_stack_constructor.ts rename to tests/specs/run/error_020_stack_constructor/error_020_stack_constructor.ts diff --git a/tests/testdata/run/error_020_stack_constructor.ts.out b/tests/specs/run/error_020_stack_constructor/error_020_stack_constructor.ts.out similarity index 100% rename from tests/testdata/run/error_020_stack_constructor.ts.out rename to tests/specs/run/error_020_stack_constructor/error_020_stack_constructor.ts.out diff --git a/tests/specs/run/error_021_stack_method/__test__.jsonc b/tests/specs/run/error_021_stack_method/__test__.jsonc new file mode 100644 index 0000000000..db78cac094 --- /dev/null +++ b/tests/specs/run/error_021_stack_method/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run error_021_stack_method.ts", + "output": "error_021_stack_method.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_021_stack_method.ts b/tests/specs/run/error_021_stack_method/error_021_stack_method.ts similarity index 100% rename from tests/testdata/run/error_021_stack_method.ts rename to tests/specs/run/error_021_stack_method/error_021_stack_method.ts diff --git a/tests/testdata/run/error_021_stack_method.ts.out b/tests/specs/run/error_021_stack_method/error_021_stack_method.ts.out similarity index 100% rename from tests/testdata/run/error_021_stack_method.ts.out rename to tests/specs/run/error_021_stack_method/error_021_stack_method.ts.out diff --git a/tests/specs/run/error_022_stack_custom_error/__test__.jsonc b/tests/specs/run/error_022_stack_custom_error/__test__.jsonc new file mode 100644 index 0000000000..f315058338 --- /dev/null +++ b/tests/specs/run/error_022_stack_custom_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run error_022_stack_custom_error.ts", + "output": "error_022_stack_custom_error.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_022_stack_custom_error.ts b/tests/specs/run/error_022_stack_custom_error/error_022_stack_custom_error.ts similarity index 100% rename from tests/testdata/run/error_022_stack_custom_error.ts rename to tests/specs/run/error_022_stack_custom_error/error_022_stack_custom_error.ts diff --git a/tests/testdata/run/error_022_stack_custom_error.ts.out b/tests/specs/run/error_022_stack_custom_error/error_022_stack_custom_error.ts.out similarity index 100% rename from tests/testdata/run/error_022_stack_custom_error.ts.out rename to tests/specs/run/error_022_stack_custom_error/error_022_stack_custom_error.ts.out diff --git a/tests/specs/run/error_023_stack_async/__test__.jsonc b/tests/specs/run/error_023_stack_async/__test__.jsonc new file mode 100644 index 0000000000..76cdff013d --- /dev/null +++ b/tests/specs/run/error_023_stack_async/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run error_023_stack_async.ts", + "output": "error_023_stack_async.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_023_stack_async.ts b/tests/specs/run/error_023_stack_async/error_023_stack_async.ts similarity index 100% rename from tests/testdata/run/error_023_stack_async.ts rename to tests/specs/run/error_023_stack_async/error_023_stack_async.ts diff --git a/tests/testdata/run/error_023_stack_async.ts.out b/tests/specs/run/error_023_stack_async/error_023_stack_async.ts.out similarity index 100% rename from tests/testdata/run/error_023_stack_async.ts.out rename to tests/specs/run/error_023_stack_async/error_023_stack_async.ts.out diff --git a/tests/specs/run/error_024_stack_promise_all/__test__.jsonc b/tests/specs/run/error_024_stack_promise_all/__test__.jsonc new file mode 100644 index 0000000000..7c733f9711 --- /dev/null +++ b/tests/specs/run/error_024_stack_promise_all/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run error_024_stack_promise_all.ts", + "output": "error_024_stack_promise_all.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_024_stack_promise_all.ts b/tests/specs/run/error_024_stack_promise_all/error_024_stack_promise_all.ts similarity index 100% rename from tests/testdata/run/error_024_stack_promise_all.ts rename to tests/specs/run/error_024_stack_promise_all/error_024_stack_promise_all.ts diff --git a/tests/testdata/run/error_024_stack_promise_all.ts.out b/tests/specs/run/error_024_stack_promise_all/error_024_stack_promise_all.ts.out similarity index 100% rename from tests/testdata/run/error_024_stack_promise_all.ts.out rename to tests/specs/run/error_024_stack_promise_all/error_024_stack_promise_all.ts.out diff --git a/tests/specs/run/error_025_tab_indent/__test__.jsonc b/tests/specs/run/error_025_tab_indent/__test__.jsonc new file mode 100644 index 0000000000..23c49458e5 --- /dev/null +++ b/tests/specs/run/error_025_tab_indent/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run error_025_tab_indent", + "output": "error_025_tab_indent.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_025_tab_indent b/tests/specs/run/error_025_tab_indent/error_025_tab_indent similarity index 100% rename from tests/testdata/run/error_025_tab_indent rename to tests/specs/run/error_025_tab_indent/error_025_tab_indent diff --git a/tests/testdata/run/error_025_tab_indent.out b/tests/specs/run/error_025_tab_indent/error_025_tab_indent.out similarity index 100% rename from tests/testdata/run/error_025_tab_indent.out rename to tests/specs/run/error_025_tab_indent/error_025_tab_indent.out diff --git a/tests/specs/run/error_cause/__test__.jsonc b/tests/specs/run/error_cause/__test__.jsonc new file mode 100644 index 0000000000..ccbf71dea7 --- /dev/null +++ b/tests/specs/run/error_cause/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run error_cause.ts", + "output": "error_cause.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_cause.ts b/tests/specs/run/error_cause/error_cause.ts similarity index 100% rename from tests/testdata/run/error_cause.ts rename to tests/specs/run/error_cause/error_cause.ts diff --git a/tests/testdata/run/error_cause.ts.out b/tests/specs/run/error_cause/error_cause.ts.out similarity index 100% rename from tests/testdata/run/error_cause.ts.out rename to tests/specs/run/error_cause/error_cause.ts.out diff --git a/tests/specs/run/error_cause_recursive/__test__.jsonc b/tests/specs/run/error_cause_recursive/__test__.jsonc new file mode 100644 index 0000000000..71c4cf3cc1 --- /dev/null +++ b/tests/specs/run/error_cause_recursive/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run error_cause_recursive.ts", + "output": "error_cause_recursive.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_cause_recursive.ts b/tests/specs/run/error_cause_recursive/error_cause_recursive.ts similarity index 100% rename from tests/testdata/run/error_cause_recursive.ts rename to tests/specs/run/error_cause_recursive/error_cause_recursive.ts diff --git a/tests/testdata/run/error_cause_recursive.ts.out b/tests/specs/run/error_cause_recursive/error_cause_recursive.ts.out similarity index 100% rename from tests/testdata/run/error_cause_recursive.ts.out rename to tests/specs/run/error_cause_recursive/error_cause_recursive.ts.out diff --git a/tests/specs/run/error_cause_recursive_aggregate/__test__.jsonc b/tests/specs/run/error_cause_recursive_aggregate/__test__.jsonc new file mode 100644 index 0000000000..2aabee0ecb --- /dev/null +++ b/tests/specs/run/error_cause_recursive_aggregate/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run error_cause_recursive_aggregate.ts", + "output": "error_cause_recursive_aggregate.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/error_cause_recursive_aggregate.ts b/tests/specs/run/error_cause_recursive_aggregate/error_cause_recursive_aggregate.ts similarity index 100% rename from tests/testdata/error_cause_recursive_aggregate.ts rename to tests/specs/run/error_cause_recursive_aggregate/error_cause_recursive_aggregate.ts diff --git a/tests/testdata/error_cause_recursive_aggregate.ts.out b/tests/specs/run/error_cause_recursive_aggregate/error_cause_recursive_aggregate.ts.out similarity index 100% rename from tests/testdata/error_cause_recursive_aggregate.ts.out rename to tests/specs/run/error_cause_recursive_aggregate/error_cause_recursive_aggregate.ts.out diff --git a/tests/specs/run/error_cause_recursive_tail/__test__.jsonc b/tests/specs/run/error_cause_recursive_tail/__test__.jsonc new file mode 100644 index 0000000000..249ccac483 --- /dev/null +++ b/tests/specs/run/error_cause_recursive_tail/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run error_cause_recursive_tail.ts", + "output": "error_cause_recursive_tail.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/error_cause_recursive_tail.ts b/tests/specs/run/error_cause_recursive_tail/error_cause_recursive_tail.ts similarity index 100% rename from tests/testdata/error_cause_recursive_tail.ts rename to tests/specs/run/error_cause_recursive_tail/error_cause_recursive_tail.ts diff --git a/tests/testdata/error_cause_recursive_tail.ts.out b/tests/specs/run/error_cause_recursive_tail/error_cause_recursive_tail.ts.out similarity index 100% rename from tests/testdata/error_cause_recursive_tail.ts.out rename to tests/specs/run/error_cause_recursive_tail/error_cause_recursive_tail.ts.out diff --git a/tests/specs/run/error_for_await/__test__.jsonc b/tests/specs/run/error_for_await/__test__.jsonc new file mode 100644 index 0000000000..b67f67ecee --- /dev/null +++ b/tests/specs/run/error_for_await/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload --check error_for_await.ts", + "output": "error_for_await.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_for_await.ts b/tests/specs/run/error_for_await/error_for_await.ts similarity index 100% rename from tests/testdata/run/error_for_await.ts rename to tests/specs/run/error_for_await/error_for_await.ts diff --git a/tests/testdata/run/error_for_await.ts.out b/tests/specs/run/error_for_await/error_for_await.ts.out similarity index 100% rename from tests/testdata/run/error_for_await.ts.out rename to tests/specs/run/error_for_await/error_for_await.ts.out diff --git a/tests/specs/run/error_import_map_unable_to_load/__test__.jsonc b/tests/specs/run/error_import_map_unable_to_load/__test__.jsonc new file mode 100644 index 0000000000..c7dd939a45 --- /dev/null +++ b/tests/specs/run/error_import_map_unable_to_load/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --import-map=import_maps/does_not_exist.json import_maps/test.ts", + "output": "error_import_map_unable_to_load.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_import_map_unable_to_load.out b/tests/specs/run/error_import_map_unable_to_load/error_import_map_unable_to_load.out similarity index 100% rename from tests/testdata/run/error_import_map_unable_to_load.out rename to tests/specs/run/error_import_map_unable_to_load/error_import_map_unable_to_load.out diff --git a/tests/specs/run/error_import_map_unable_to_load/import_maps/test_data.ts b/tests/specs/run/error_import_map_unable_to_load/import_maps/test_data.ts new file mode 100644 index 0000000000..5e8efea69b --- /dev/null +++ b/tests/specs/run/error_import_map_unable_to_load/import_maps/test_data.ts @@ -0,0 +1 @@ +import "test_server/import_maps/lodash/lodash.ts"; diff --git a/tests/specs/run/error_import_map_unable_to_load/import_maps/test_data.ts.out b/tests/specs/run/error_import_map_unable_to_load/import_maps/test_data.ts.out new file mode 100644 index 0000000000..da996dc0d9 --- /dev/null +++ b/tests/specs/run/error_import_map_unable_to_load/import_maps/test_data.ts.out @@ -0,0 +1 @@ +Hello from remapped lodash! diff --git a/tests/specs/run/error_missing_module_named_import/__test__.jsonc b/tests/specs/run/error_missing_module_named_import/__test__.jsonc new file mode 100644 index 0000000000..9f5780d2a9 --- /dev/null +++ b/tests/specs/run/error_missing_module_named_import/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload error_missing_module_named_import.ts", + "output": "error_missing_module_named_import.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_missing_module_named_import.ts b/tests/specs/run/error_missing_module_named_import/error_missing_module_named_import.ts similarity index 100% rename from tests/testdata/run/error_missing_module_named_import.ts rename to tests/specs/run/error_missing_module_named_import/error_missing_module_named_import.ts diff --git a/tests/testdata/run/error_missing_module_named_import.ts.out b/tests/specs/run/error_missing_module_named_import/error_missing_module_named_import.ts.out similarity index 100% rename from tests/testdata/run/error_missing_module_named_import.ts.out rename to tests/specs/run/error_missing_module_named_import/error_missing_module_named_import.ts.out diff --git a/tests/specs/run/error_name_non_string/__test__.jsonc b/tests/specs/run/error_name_non_string/__test__.jsonc new file mode 100644 index 0000000000..a6748b56a2 --- /dev/null +++ b/tests/specs/run/error_name_non_string/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet error_name_non_string.js", + "output": "error_name_non_string.js.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_name_non_string.js b/tests/specs/run/error_name_non_string/error_name_non_string.js similarity index 100% rename from tests/testdata/run/error_name_non_string.js rename to tests/specs/run/error_name_non_string/error_name_non_string.js diff --git a/tests/testdata/run/error_name_non_string.js.out b/tests/specs/run/error_name_non_string/error_name_non_string.js.out similarity index 100% rename from tests/testdata/run/error_name_non_string.js.out rename to tests/specs/run/error_name_non_string/error_name_non_string.js.out diff --git a/tests/specs/run/error_no_check/__test__.jsonc b/tests/specs/run/error_no_check/__test__.jsonc new file mode 100644 index 0000000000..439dc5615d --- /dev/null +++ b/tests/specs/run/error_no_check/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload --no-check error_no_check.ts", + "output": "error_no_check.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/error_no_check/error_no_check.ts b/tests/specs/run/error_no_check/error_no_check.ts new file mode 100644 index 0000000000..95ebff0282 --- /dev/null +++ b/tests/specs/run/error_no_check/error_no_check.ts @@ -0,0 +1 @@ +export { AnInterface, isAnInterface } from "./type_and_code.ts"; diff --git a/tests/specs/run/error_no_check/error_no_check.ts.out b/tests/specs/run/error_no_check/error_no_check.ts.out new file mode 100644 index 0000000000..c4e85332d1 --- /dev/null +++ b/tests/specs/run/error_no_check/error_no_check.ts.out @@ -0,0 +1,2 @@ +error: Uncaught SyntaxError: The requested module './type_and_code.ts' does not provide an export named 'AnInterface' +[WILDCARD] \ No newline at end of file diff --git a/tests/specs/run/error_no_check/type_and_code.ts b/tests/specs/run/error_no_check/type_and_code.ts new file mode 100644 index 0000000000..b147134195 --- /dev/null +++ b/tests/specs/run/error_no_check/type_and_code.ts @@ -0,0 +1,7 @@ +export interface AnInterface { + a: string; +} + +export function isAnInterface(value: unknown): value is AnInterface { + return value && typeof value === "object" && "a" in value; +} diff --git a/tests/specs/run/error_syntax/__test__.jsonc b/tests/specs/run/error_syntax/__test__.jsonc new file mode 100644 index 0000000000..7a60f2c732 --- /dev/null +++ b/tests/specs/run/error_syntax/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload error_syntax.js", + "output": "error_syntax.js.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_syntax.js b/tests/specs/run/error_syntax/error_syntax.js similarity index 100% rename from tests/testdata/run/error_syntax.js rename to tests/specs/run/error_syntax/error_syntax.js diff --git a/tests/testdata/run/error_syntax.js.out b/tests/specs/run/error_syntax/error_syntax.js.out similarity index 100% rename from tests/testdata/run/error_syntax.js.out rename to tests/specs/run/error_syntax/error_syntax.js.out diff --git a/tests/specs/run/error_syntax_empty_trailing_line/__test__.jsonc b/tests/specs/run/error_syntax_empty_trailing_line/__test__.jsonc new file mode 100644 index 0000000000..72f1de1f7a --- /dev/null +++ b/tests/specs/run/error_syntax_empty_trailing_line/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload error_syntax_empty_trailing_line.mjs", + "output": "error_syntax_empty_trailing_line.mjs.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_syntax_empty_trailing_line.mjs b/tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs similarity index 100% rename from tests/testdata/run/error_syntax_empty_trailing_line.mjs rename to tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs diff --git a/tests/testdata/run/error_syntax_empty_trailing_line.mjs.out b/tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs.out similarity index 100% rename from tests/testdata/run/error_syntax_empty_trailing_line.mjs.out rename to tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs.out diff --git a/tests/specs/run/error_type_definitions/__test__.jsonc b/tests/specs/run/error_type_definitions/__test__.jsonc new file mode 100644 index 0000000000..0ea9bc0164 --- /dev/null +++ b/tests/specs/run/error_type_definitions/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload --check error_type_definitions.ts", + "output": "error_type_definitions.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/error_type_definitions/error_type_definitions.ts b/tests/specs/run/error_type_definitions/error_type_definitions.ts new file mode 100644 index 0000000000..ceb11787e5 --- /dev/null +++ b/tests/specs/run/error_type_definitions/error_type_definitions.ts @@ -0,0 +1,5 @@ +// @deno-types="./type_definitions/bar.d.ts" +import { Bar } from "./type_definitions/bar.js"; + +const bar = new Bar(); +console.log(bar); diff --git a/tests/testdata/run/error_type_definitions.ts.out b/tests/specs/run/error_type_definitions/error_type_definitions.ts.out similarity index 100% rename from tests/testdata/run/error_type_definitions.ts.out rename to tests/specs/run/error_type_definitions/error_type_definitions.ts.out diff --git a/tests/specs/run/error_type_definitions/type_definitions/bar.d.ts b/tests/specs/run/error_type_definitions/type_definitions/bar.d.ts new file mode 100644 index 0000000000..d43335dbb5 --- /dev/null +++ b/tests/specs/run/error_type_definitions/type_definitions/bar.d.ts @@ -0,0 +1,7 @@ +/// + +declare namespace bar { + export class Bar { + baz: string; + } +} diff --git a/tests/specs/run/error_type_definitions/type_definitions/bar.js b/tests/specs/run/error_type_definitions/type_definitions/bar.js new file mode 100644 index 0000000000..e9c2e5193c --- /dev/null +++ b/tests/specs/run/error_type_definitions/type_definitions/bar.js @@ -0,0 +1,5 @@ +export class Bar { + constructor() { + this.baz = "baz"; + } +} diff --git a/tests/specs/run/error_type_definitions/type_definitions/fizz.d.ts b/tests/specs/run/error_type_definitions/type_definitions/fizz.d.ts new file mode 100644 index 0000000000..34eb41b960 --- /dev/null +++ b/tests/specs/run/error_type_definitions/type_definitions/fizz.d.ts @@ -0,0 +1,2 @@ +/** A global value. */ +declare const fizz: string; diff --git a/tests/specs/run/error_type_definitions/type_definitions/fizz.js b/tests/specs/run/error_type_definitions/type_definitions/fizz.js new file mode 100644 index 0000000000..852162c940 --- /dev/null +++ b/tests/specs/run/error_type_definitions/type_definitions/fizz.js @@ -0,0 +1 @@ +globalThis.fizz = "fizz"; diff --git a/tests/specs/run/error_type_definitions/type_definitions/foo.d.ts b/tests/specs/run/error_type_definitions/type_definitions/foo.d.ts new file mode 100644 index 0000000000..ce39201e1b --- /dev/null +++ b/tests/specs/run/error_type_definitions/type_definitions/foo.d.ts @@ -0,0 +1,2 @@ +/** An exported value. */ +export const foo: string; diff --git a/tests/specs/run/error_type_definitions/type_definitions/foo.js b/tests/specs/run/error_type_definitions/type_definitions/foo.js new file mode 100644 index 0000000000..61d366eb25 --- /dev/null +++ b/tests/specs/run/error_type_definitions/type_definitions/foo.js @@ -0,0 +1 @@ +export const foo = "foo"; diff --git a/tests/specs/run/error_type_definitions/type_definitions/qat.ts b/tests/specs/run/error_type_definitions/type_definitions/qat.ts new file mode 100644 index 0000000000..6196c9d387 --- /dev/null +++ b/tests/specs/run/error_type_definitions/type_definitions/qat.ts @@ -0,0 +1 @@ +export const qat = "qat"; diff --git a/tests/specs/run/error_with_errors_prop/__test__.jsonc b/tests/specs/run/error_with_errors_prop/__test__.jsonc new file mode 100644 index 0000000000..afbfd24cfe --- /dev/null +++ b/tests/specs/run/error_with_errors_prop/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet error_with_errors_prop.js", + "output": "error_with_errors_prop.js.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/error_with_errors_prop.js b/tests/specs/run/error_with_errors_prop/error_with_errors_prop.js similarity index 100% rename from tests/testdata/run/error_with_errors_prop.js rename to tests/specs/run/error_with_errors_prop/error_with_errors_prop.js diff --git a/tests/testdata/run/error_with_errors_prop.js.out b/tests/specs/run/error_with_errors_prop/error_with_errors_prop.js.out similarity index 100% rename from tests/testdata/run/error_with_errors_prop.js.out rename to tests/specs/run/error_with_errors_prop/error_with_errors_prop.js.out diff --git a/tests/specs/run/es_private_fields/__test__.jsonc b/tests/specs/run/es_private_fields/__test__.jsonc new file mode 100644 index 0000000000..817efd67e3 --- /dev/null +++ b/tests/specs/run/es_private_fields/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload es_private_fields.js", + "output": "es_private_fields.js.out" +} diff --git a/tests/testdata/run/es_private_fields.js b/tests/specs/run/es_private_fields/es_private_fields.js similarity index 100% rename from tests/testdata/run/es_private_fields.js rename to tests/specs/run/es_private_fields/es_private_fields.js diff --git a/tests/testdata/run/es_private_fields.js.out b/tests/specs/run/es_private_fields/es_private_fields.js.out similarity index 100% rename from tests/testdata/run/es_private_fields.js.out rename to tests/specs/run/es_private_fields/es_private_fields.js.out diff --git a/tests/specs/run/eval_context_throw_dom_exception/__test__.jsonc b/tests/specs/run/eval_context_throw_dom_exception/__test__.jsonc new file mode 100644 index 0000000000..6ad302b03a --- /dev/null +++ b/tests/specs/run/eval_context_throw_dom_exception/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run eval_context_throw_dom_exception.js", + "output": "eval_context_throw_dom_exception.js.out" +} diff --git a/tests/testdata/run/eval_context_throw_dom_exception.js b/tests/specs/run/eval_context_throw_dom_exception/eval_context_throw_dom_exception.js similarity index 100% rename from tests/testdata/run/eval_context_throw_dom_exception.js rename to tests/specs/run/eval_context_throw_dom_exception/eval_context_throw_dom_exception.js diff --git a/tests/testdata/run/eval_context_throw_dom_exception.js.out b/tests/specs/run/eval_context_throw_dom_exception/eval_context_throw_dom_exception.js.out similarity index 100% rename from tests/testdata/run/eval_context_throw_dom_exception.js.out rename to tests/specs/run/eval_context_throw_dom_exception/eval_context_throw_dom_exception.js.out diff --git a/tests/specs/run/event_listener_error/__test__.jsonc b/tests/specs/run/event_listener_error/__test__.jsonc new file mode 100644 index 0000000000..b2540e03dc --- /dev/null +++ b/tests/specs/run/event_listener_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet event_listener_error.ts", + "output": "event_listener_error.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/event_listener_error.ts b/tests/specs/run/event_listener_error/event_listener_error.ts similarity index 100% rename from tests/testdata/run/event_listener_error.ts rename to tests/specs/run/event_listener_error/event_listener_error.ts diff --git a/tests/testdata/run/event_listener_error.ts.out b/tests/specs/run/event_listener_error/event_listener_error.ts.out similarity index 100% rename from tests/testdata/run/event_listener_error.ts.out rename to tests/specs/run/event_listener_error/event_listener_error.ts.out diff --git a/tests/specs/run/event_listener_error_handled/__test__.jsonc b/tests/specs/run/event_listener_error_handled/__test__.jsonc new file mode 100644 index 0000000000..f1fdcd5dba --- /dev/null +++ b/tests/specs/run/event_listener_error_handled/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet event_listener_error_handled.ts", + "output": "event_listener_error_handled.ts.out" +} diff --git a/tests/testdata/run/event_listener_error_handled.ts b/tests/specs/run/event_listener_error_handled/event_listener_error_handled.ts similarity index 100% rename from tests/testdata/run/event_listener_error_handled.ts rename to tests/specs/run/event_listener_error_handled/event_listener_error_handled.ts diff --git a/tests/testdata/run/event_listener_error_handled.ts.out b/tests/specs/run/event_listener_error_handled/event_listener_error_handled.ts.out similarity index 100% rename from tests/testdata/run/event_listener_error_handled.ts.out rename to tests/specs/run/event_listener_error_handled/event_listener_error_handled.ts.out diff --git a/tests/specs/run/event_listener_error_immediate_exit/__test__.jsonc b/tests/specs/run/event_listener_error_immediate_exit/__test__.jsonc new file mode 100644 index 0000000000..2974c0e422 --- /dev/null +++ b/tests/specs/run/event_listener_error_immediate_exit/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet event_listener_error_immediate_exit.ts", + "output": "event_listener_error_immediate_exit.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/event_listener_error_immediate_exit.ts b/tests/specs/run/event_listener_error_immediate_exit/event_listener_error_immediate_exit.ts similarity index 100% rename from tests/testdata/run/event_listener_error_immediate_exit.ts rename to tests/specs/run/event_listener_error_immediate_exit/event_listener_error_immediate_exit.ts diff --git a/tests/testdata/run/event_listener_error_immediate_exit.ts.out b/tests/specs/run/event_listener_error_immediate_exit/event_listener_error_immediate_exit.ts.out similarity index 100% rename from tests/testdata/run/event_listener_error_immediate_exit.ts.out rename to tests/specs/run/event_listener_error_immediate_exit/event_listener_error_immediate_exit.ts.out diff --git a/tests/specs/run/event_listener_error_immediate_exit_worker/__test__.jsonc b/tests/specs/run/event_listener_error_immediate_exit_worker/__test__.jsonc new file mode 100644 index 0000000000..6ef3ef2ed1 --- /dev/null +++ b/tests/specs/run/event_listener_error_immediate_exit_worker/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet -A event_listener_error_immediate_exit_worker.ts", + "output": "event_listener_error_immediate_exit_worker.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/event_listener_error_immediate_exit_worker/event_listener_error_immediate_exit.ts b/tests/specs/run/event_listener_error_immediate_exit_worker/event_listener_error_immediate_exit.ts new file mode 100644 index 0000000000..292a0df007 --- /dev/null +++ b/tests/specs/run/event_listener_error_immediate_exit_worker/event_listener_error_immediate_exit.ts @@ -0,0 +1,12 @@ +addEventListener("foo", () => { + queueMicrotask(() => console.log("queueMicrotask")); + setTimeout(() => console.log("timer"), 0); + throw new Error("bar"); +}); +console.log(1); +// @ts-ignore Deno[Deno.internal].core +Deno[Deno.internal].core.setNextTickCallback(() => console.log("nextTick")); +// @ts-ignore Deno[Deno.internal].core +Deno[Deno.internal].core.setHasTickScheduled(true); +dispatchEvent(new CustomEvent("foo")); +console.log(2); diff --git a/tests/testdata/run/event_listener_error_immediate_exit_worker.ts b/tests/specs/run/event_listener_error_immediate_exit_worker/event_listener_error_immediate_exit_worker.ts similarity index 100% rename from tests/testdata/run/event_listener_error_immediate_exit_worker.ts rename to tests/specs/run/event_listener_error_immediate_exit_worker/event_listener_error_immediate_exit_worker.ts diff --git a/tests/testdata/run/event_listener_error_immediate_exit_worker.ts.out b/tests/specs/run/event_listener_error_immediate_exit_worker/event_listener_error_immediate_exit_worker.ts.out similarity index 100% rename from tests/testdata/run/event_listener_error_immediate_exit_worker.ts.out rename to tests/specs/run/event_listener_error_immediate_exit_worker/event_listener_error_immediate_exit_worker.ts.out diff --git a/tests/specs/run/exit_error42/__test__.jsonc b/tests/specs/run/exit_error42/__test__.jsonc new file mode 100644 index 0000000000..43d3089566 --- /dev/null +++ b/tests/specs/run/exit_error42/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --reload exit_error42.ts", + "output": "exit_error42.ts.out", + "exitCode": 42 +} diff --git a/tests/testdata/run/exit_error42.ts b/tests/specs/run/exit_error42/exit_error42.ts similarity index 100% rename from tests/testdata/run/exit_error42.ts rename to tests/specs/run/exit_error42/exit_error42.ts diff --git a/tests/testdata/run/exit_error42.ts.out b/tests/specs/run/exit_error42/exit_error42.ts.out similarity index 100% rename from tests/testdata/run/exit_error42.ts.out rename to tests/specs/run/exit_error42/exit_error42.ts.out diff --git a/tests/specs/run/explicit_resource_management/__test__.jsonc b/tests/specs/run/explicit_resource_management/__test__.jsonc new file mode 100644 index 0000000000..7062e6f36f --- /dev/null +++ b/tests/specs/run/explicit_resource_management/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --check explicit_resource_management/main.ts", + "output": "explicit_resource_management/main.out" +} diff --git a/tests/testdata/run/explicit_resource_management/main.out b/tests/specs/run/explicit_resource_management/explicit_resource_management/main.out similarity index 100% rename from tests/testdata/run/explicit_resource_management/main.out rename to tests/specs/run/explicit_resource_management/explicit_resource_management/main.out diff --git a/tests/testdata/run/explicit_resource_management/main.ts b/tests/specs/run/explicit_resource_management/explicit_resource_management/main.ts similarity index 100% rename from tests/testdata/run/explicit_resource_management/main.ts rename to tests/specs/run/explicit_resource_management/explicit_resource_management/main.ts diff --git a/tests/specs/run/ext_flag_takes_precedence_over_extension/__test__.jsonc b/tests/specs/run/ext_flag_takes_precedence_over_extension/__test__.jsonc new file mode 100644 index 0000000000..0806088b4e --- /dev/null +++ b/tests/specs/run/ext_flag_takes_precedence_over_extension/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --ext ts --check ts_with_js_extension.js", + "output": "ts_with_js_extension.out", + "exitCode": 0 +} diff --git a/tests/specs/run/ext_flag_takes_precedence_over_extension/ts_with_js_extension.js b/tests/specs/run/ext_flag_takes_precedence_over_extension/ts_with_js_extension.js new file mode 100644 index 0000000000..3c49f74846 --- /dev/null +++ b/tests/specs/run/ext_flag_takes_precedence_over_extension/ts_with_js_extension.js @@ -0,0 +1,5 @@ +interface Lollipop { + _: number; +} + +console.log("executing typescript with extension"); diff --git a/tests/specs/run/ext_flag_takes_precedence_over_extension/ts_with_js_extension.out b/tests/specs/run/ext_flag_takes_precedence_over_extension/ts_with_js_extension.out new file mode 100644 index 0000000000..7ae7b9168f --- /dev/null +++ b/tests/specs/run/ext_flag_takes_precedence_over_extension/ts_with_js_extension.out @@ -0,0 +1,2 @@ +Check [WILDCARD]/ts_with_js_extension.js +executing typescript with extension diff --git a/tests/specs/run/fetch_async_error_stack/__test__.jsonc b/tests/specs/run/fetch_async_error_stack/__test__.jsonc new file mode 100644 index 0000000000..152f57807c --- /dev/null +++ b/tests/specs/run/fetch_async_error_stack/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet -A fetch_async_error_stack.ts", + "output": "fetch_async_error_stack.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/fetch_async_error_stack.ts b/tests/specs/run/fetch_async_error_stack/fetch_async_error_stack.ts similarity index 100% rename from tests/testdata/run/fetch_async_error_stack.ts rename to tests/specs/run/fetch_async_error_stack/fetch_async_error_stack.ts diff --git a/tests/testdata/run/fetch_async_error_stack.ts.out b/tests/specs/run/fetch_async_error_stack/fetch_async_error_stack.ts.out similarity index 100% rename from tests/testdata/run/fetch_async_error_stack.ts.out rename to tests/specs/run/fetch_async_error_stack/fetch_async_error_stack.ts.out diff --git a/tests/specs/run/fetch_response_finalization/__test__.jsonc b/tests/specs/run/fetch_response_finalization/__test__.jsonc new file mode 100644 index 0000000000..51a7e2b045 --- /dev/null +++ b/tests/specs/run/fetch_response_finalization/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --v8-flags=--expose-gc --allow-net fetch_response_finalization.js", + "output": "fetch_response_finalization.js.out", + "exitCode": 0 +} diff --git a/tests/testdata/run/fetch_response_finalization.js b/tests/specs/run/fetch_response_finalization/fetch_response_finalization.js similarity index 100% rename from tests/testdata/run/fetch_response_finalization.js rename to tests/specs/run/fetch_response_finalization/fetch_response_finalization.js diff --git a/tests/testdata/run/fetch_response_finalization.js.out b/tests/specs/run/fetch_response_finalization/fetch_response_finalization.js.out similarity index 100% rename from tests/testdata/run/fetch_response_finalization.js.out rename to tests/specs/run/fetch_response_finalization/fetch_response_finalization.js.out diff --git a/tests/specs/run/finalization_registry/__test__.jsonc b/tests/specs/run/finalization_registry/__test__.jsonc new file mode 100644 index 0000000000..f7526506c5 --- /dev/null +++ b/tests/specs/run/finalization_registry/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --v8-flags=--expose-gc finalization_registry.js", + "output": "finalization_registry.js.out" +} diff --git a/tests/testdata/run/finalization_registry.js b/tests/specs/run/finalization_registry/finalization_registry.js similarity index 100% rename from tests/testdata/run/finalization_registry.js rename to tests/specs/run/finalization_registry/finalization_registry.js diff --git a/tests/testdata/run/finalization_registry.js.out b/tests/specs/run/finalization_registry/finalization_registry.js.out similarity index 100% rename from tests/testdata/run/finalization_registry.js.out rename to tests/specs/run/finalization_registry/finalization_registry.js.out diff --git a/tests/specs/run/fix_dynamic_import_errors/__test__.jsonc b/tests/specs/run/fix_dynamic_import_errors/__test__.jsonc new file mode 100644 index 0000000000..d9302d2cae --- /dev/null +++ b/tests/specs/run/fix_dynamic_import_errors/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload fix_dynamic_import_errors.js", + "output": "fix_dynamic_import_errors.js.out" +} diff --git a/tests/specs/run/fix_dynamic_import_errors/b.js b/tests/specs/run/fix_dynamic_import_errors/b.js new file mode 100644 index 0000000000..6ea50d3608 --- /dev/null +++ b/tests/specs/run/fix_dynamic_import_errors/b.js @@ -0,0 +1,2 @@ +import "./bad.mjs"; +export default () => "error"; diff --git a/tests/specs/run/fix_dynamic_import_errors/c.js b/tests/specs/run/fix_dynamic_import_errors/c.js new file mode 100644 index 0000000000..20546455ea --- /dev/null +++ b/tests/specs/run/fix_dynamic_import_errors/c.js @@ -0,0 +1,2 @@ +await import("./bad2.mjs"); +export default () => "error"; diff --git a/tests/testdata/run/fix_dynamic_import_errors.js b/tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js similarity index 52% rename from tests/testdata/run/fix_dynamic_import_errors.js rename to tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js index 1d7be37e06..e105cbada6 100644 --- a/tests/testdata/run/fix_dynamic_import_errors.js +++ b/tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js @@ -1,7 +1,7 @@ -import("../dynamic_import/b.js").catch(() => { +import("./b.js").catch(() => { console.log("caught import error from b.js"); }); -import("../dynamic_import/c.js").catch(() => { +import("./c.js").catch(() => { console.log("caught import error from c.js"); }); diff --git a/tests/testdata/run/fix_dynamic_import_errors.js.out b/tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js.out similarity index 100% rename from tests/testdata/run/fix_dynamic_import_errors.js.out rename to tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js.out diff --git a/tests/specs/run/fix_emittable_skipped/__test__.jsonc b/tests/specs/run/fix_emittable_skipped/__test__.jsonc new file mode 100644 index 0000000000..ef1445e0e3 --- /dev/null +++ b/tests/specs/run/fix_emittable_skipped/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload fix_emittable_skipped.js", + "output": "fix_emittable_skipped.ts.out" +} diff --git a/tests/specs/run/fix_emittable_skipped/emittable.d.ts b/tests/specs/run/fix_emittable_skipped/emittable.d.ts new file mode 100644 index 0000000000..425b80f244 --- /dev/null +++ b/tests/specs/run/fix_emittable_skipped/emittable.d.ts @@ -0,0 +1 @@ +export const a: string; diff --git a/tests/specs/run/fix_emittable_skipped/fix_emittable_skipped.js b/tests/specs/run/fix_emittable_skipped/fix_emittable_skipped.js new file mode 100644 index 0000000000..b94af2730f --- /dev/null +++ b/tests/specs/run/fix_emittable_skipped/fix_emittable_skipped.js @@ -0,0 +1,7 @@ +/// + +import "./polyfill.ts"; + +export const a = "a"; + +console.log(globalThis.polyfill); diff --git a/tests/testdata/run/fix_emittable_skipped.ts.out b/tests/specs/run/fix_emittable_skipped/fix_emittable_skipped.ts.out similarity index 100% rename from tests/testdata/run/fix_emittable_skipped.ts.out rename to tests/specs/run/fix_emittable_skipped/fix_emittable_skipped.ts.out diff --git a/tests/specs/run/fix_emittable_skipped/polyfill.ts b/tests/specs/run/fix_emittable_skipped/polyfill.ts new file mode 100644 index 0000000000..7af67c4c03 --- /dev/null +++ b/tests/specs/run/fix_emittable_skipped/polyfill.ts @@ -0,0 +1,8 @@ +declare global { + const polyfill: () => void; +} + +// deno-lint-ignore no-explicit-any +(globalThis as any).polyfill = () => { + console.log("polyfill"); +}; diff --git a/tests/specs/run/fix_js_import_js/__test__.jsonc b/tests/specs/run/fix_js_import_js/__test__.jsonc new file mode 100644 index 0000000000..94b1df540a --- /dev/null +++ b/tests/specs/run/fix_js_import_js/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload fix_js_import_js.ts", + "output": "fix_js_import_js.ts.out" +} diff --git a/tests/specs/run/fix_js_import_js/fix_js_import_js.ts b/tests/specs/run/fix_js_import_js/fix_js_import_js.ts new file mode 100644 index 0000000000..4862f03e10 --- /dev/null +++ b/tests/specs/run/fix_js_import_js/fix_js_import_js.ts @@ -0,0 +1,3 @@ +import { isMod4 } from "./mod6.js"; + +console.log(isMod4); diff --git a/tests/testdata/run/fix_js_import_js.ts.out b/tests/specs/run/fix_js_import_js/fix_js_import_js.ts.out similarity index 100% rename from tests/testdata/run/fix_js_import_js.ts.out rename to tests/specs/run/fix_js_import_js/fix_js_import_js.ts.out diff --git a/tests/specs/run/fix_js_import_js/mod4.js b/tests/specs/run/fix_js_import_js/mod4.js new file mode 100644 index 0000000000..71332dbc42 --- /dev/null +++ b/tests/specs/run/fix_js_import_js/mod4.js @@ -0,0 +1 @@ +export const isMod4 = true; diff --git a/tests/specs/run/fix_js_import_js/mod6.js b/tests/specs/run/fix_js_import_js/mod6.js new file mode 100644 index 0000000000..5e17c9ee02 --- /dev/null +++ b/tests/specs/run/fix_js_import_js/mod6.js @@ -0,0 +1 @@ +export { isMod4 } from "./mod4.js"; diff --git a/tests/specs/run/fix_js_imports/__test__.jsonc b/tests/specs/run/fix_js_imports/__test__.jsonc new file mode 100644 index 0000000000..a3635d18c9 --- /dev/null +++ b/tests/specs/run/fix_js_imports/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload fix_js_imports.ts", + "output": "fix_js_imports.ts.out" +} diff --git a/tests/specs/run/fix_js_imports/amd_like.js b/tests/specs/run/fix_js_imports/amd_like.js new file mode 100644 index 0000000000..f27e505e4a --- /dev/null +++ b/tests/specs/run/fix_js_imports/amd_like.js @@ -0,0 +1,3 @@ +// looks like an AMD module, but isn't +const define = () => {}; +define(["fake_module"], () => {}); diff --git a/tests/specs/run/fix_js_imports/fix_js_imports.ts b/tests/specs/run/fix_js_imports/fix_js_imports.ts new file mode 100644 index 0000000000..07e68a1356 --- /dev/null +++ b/tests/specs/run/fix_js_imports/fix_js_imports.ts @@ -0,0 +1,3 @@ +import * as amdLike from "./amd_like.js"; + +console.log(amdLike); diff --git a/tests/testdata/run/fix_js_imports.ts.out b/tests/specs/run/fix_js_imports/fix_js_imports.ts.out similarity index 100% rename from tests/testdata/run/fix_js_imports.ts.out rename to tests/specs/run/fix_js_imports/fix_js_imports.ts.out diff --git a/tests/specs/run/fix_tsc_file_exists/__test__.jsonc b/tests/specs/run/fix_tsc_file_exists/__test__.jsonc new file mode 100644 index 0000000000..d2b0bda29f --- /dev/null +++ b/tests/specs/run/fix_tsc_file_exists/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload tsc/test.js", + "output": "fix_tsc_file_exists.out" +} diff --git a/tests/testdata/run/fix_tsc_file_exists.out b/tests/specs/run/fix_tsc_file_exists/fix_tsc_file_exists.out similarity index 100% rename from tests/testdata/run/fix_tsc_file_exists.out rename to tests/specs/run/fix_tsc_file_exists/fix_tsc_file_exists.out diff --git a/tests/specs/run/fix_tsc_file_exists/tsc/a.js b/tests/specs/run/fix_tsc_file_exists/tsc/a.js new file mode 100644 index 0000000000..5a7b3ff93c --- /dev/null +++ b/tests/specs/run/fix_tsc_file_exists/tsc/a.js @@ -0,0 +1,2 @@ +import { v4 } from "./d.ts"; +export function a() {} diff --git a/tests/specs/run/fix_tsc_file_exists/tsc/d.ts b/tests/specs/run/fix_tsc_file_exists/tsc/d.ts new file mode 100644 index 0000000000..3c74b8c836 --- /dev/null +++ b/tests/specs/run/fix_tsc_file_exists/tsc/d.ts @@ -0,0 +1,3 @@ +export function v4() { + return "hello"; +} diff --git a/tests/specs/run/fix_tsc_file_exists/tsc/node_modules/b.js b/tests/specs/run/fix_tsc_file_exists/tsc/node_modules/b.js new file mode 100644 index 0000000000..1916609355 --- /dev/null +++ b/tests/specs/run/fix_tsc_file_exists/tsc/node_modules/b.js @@ -0,0 +1,2 @@ +import c from "./c.js"; +export { c }; diff --git a/tests/specs/run/fix_tsc_file_exists/tsc/node_modules/c.js b/tests/specs/run/fix_tsc_file_exists/tsc/node_modules/c.js new file mode 100644 index 0000000000..cff71c44a0 --- /dev/null +++ b/tests/specs/run/fix_tsc_file_exists/tsc/node_modules/c.js @@ -0,0 +1 @@ +export default function c() {} diff --git a/tests/specs/run/fix_tsc_file_exists/tsc/test.js b/tests/specs/run/fix_tsc_file_exists/tsc/test.js new file mode 100644 index 0000000000..b7f46b351f --- /dev/null +++ b/tests/specs/run/fix_tsc_file_exists/tsc/test.js @@ -0,0 +1,4 @@ +import { a } from "./a.js"; +import { c } from "./node_modules/b.js"; + +console.log("hello"); diff --git a/tests/specs/run/fix_worker_dispatchevent/__test__.jsonc b/tests/specs/run/fix_worker_dispatchevent/__test__.jsonc new file mode 100644 index 0000000000..45e49b87f9 --- /dev/null +++ b/tests/specs/run/fix_worker_dispatchevent/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload fix_worker_dispatchevent.ts", + "output": "fix_worker_dispatchevent.ts.out" +} diff --git a/tests/testdata/run/fix_worker_dispatchevent.ts b/tests/specs/run/fix_worker_dispatchevent/fix_worker_dispatchevent.ts similarity index 100% rename from tests/testdata/run/fix_worker_dispatchevent.ts rename to tests/specs/run/fix_worker_dispatchevent/fix_worker_dispatchevent.ts diff --git a/tests/testdata/run/fix_worker_dispatchevent.ts.out b/tests/specs/run/fix_worker_dispatchevent/fix_worker_dispatchevent.ts.out similarity index 100% rename from tests/testdata/run/fix_worker_dispatchevent.ts.out rename to tests/specs/run/fix_worker_dispatchevent/fix_worker_dispatchevent.ts.out diff --git a/tests/specs/run/followup_dyn_import_resolved/__test__.jsonc b/tests/specs/run/followup_dyn_import_resolved/__test__.jsonc new file mode 100644 index 0000000000..b94e3d8c91 --- /dev/null +++ b/tests/specs/run/followup_dyn_import_resolved/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read followup_dyn_import_resolves/main.ts", + "output": "followup_dyn_import_resolves/main.ts.out" +} diff --git a/tests/testdata/run/followup_dyn_import_resolves/main.ts b/tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/main.ts similarity index 100% rename from tests/testdata/run/followup_dyn_import_resolves/main.ts rename to tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/main.ts diff --git a/tests/testdata/run/followup_dyn_import_resolves/main.ts.out b/tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/main.ts.out similarity index 100% rename from tests/testdata/run/followup_dyn_import_resolves/main.ts.out rename to tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/main.ts.out diff --git a/tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/sub1.ts b/tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/sub1.ts new file mode 100644 index 0000000000..d06c30221b --- /dev/null +++ b/tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/sub1.ts @@ -0,0 +1,2 @@ +await import("./sub2.ts"); +console.log("sub1"); diff --git a/tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/sub2.ts b/tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/sub2.ts new file mode 100644 index 0000000000..cce2b524cd --- /dev/null +++ b/tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/sub2.ts @@ -0,0 +1 @@ +console.log("sub2"); diff --git a/tests/specs/run/heapstats/__test__.jsonc b/tests/specs/run/heapstats/__test__.jsonc new file mode 100644 index 0000000000..6429d7cf5f --- /dev/null +++ b/tests/specs/run/heapstats/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --v8-flags=--expose-gc heapstats.js", + "output": "heapstats.js.out" +} diff --git a/tests/testdata/run/heapstats.js b/tests/specs/run/heapstats/heapstats.js similarity index 100% rename from tests/testdata/run/heapstats.js rename to tests/specs/run/heapstats/heapstats.js diff --git a/tests/testdata/run/heapstats.js.out b/tests/specs/run/heapstats/heapstats.js.out similarity index 100% rename from tests/testdata/run/heapstats.js.out rename to tests/specs/run/heapstats/heapstats.js.out diff --git a/tests/specs/run/https_import/RootCA.pem b/tests/specs/run/https_import/RootCA.pem new file mode 100644 index 0000000000..c2f84ceebc --- /dev/null +++ b/tests/specs/run/https_import/RootCA.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDIzCCAgugAwIBAgIJAMKPPW4tsOymMA0GCSqGSIb3DQEBCwUAMCcxCzAJBgNV +BAYTAlVTMRgwFgYDVQQDDA9FeGFtcGxlLVJvb3QtQ0EwIBcNMTkxMDIxMTYyODIy +WhgPMjExODA5MjcxNjI4MjJaMCcxCzAJBgNVBAYTAlVTMRgwFgYDVQQDDA9FeGFt +cGxlLVJvb3QtQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDMH/IO +2qtHfyBKwANNPB4K0q5JVSg8XxZdRpTTlz0CwU0oRO3uHrI52raCCfVeiQutyZop +eFZTDWeXGudGAFA2B5m3orWt0s+touPi8MzjsG2TQ+WSI66QgbXTNDitDDBtTVcV +5G3Ic+3SppQAYiHSekLISnYWgXLl+k5CnEfTowg6cjqjVr0KjL03cTN3H7b+6+0S +ws4rYbW1j4ExR7K6BFNH6572yq5qR20E6GqlY+EcOZpw4CbCk9lS8/CWuXze/vMs +OfDcc6K+B625d27wyEGZHedBomT2vAD7sBjvO8hn/DP1Qb46a8uCHR6NSfnJ7bXO +G1igaIbgY1zXirNdAgMBAAGjUDBOMB0GA1UdDgQWBBTzut+pwwDfqmMYcI9KNWRD +hxcIpTAfBgNVHSMEGDAWgBTzut+pwwDfqmMYcI9KNWRDhxcIpTAMBgNVHRMEBTAD +AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQB9AqSbZ+hEglAgSHxAMCqRFdhVu7MvaQM0 +P090mhGlOCt3yB7kdGfsIrUW6nQcTz7PPQFRaJMrFHPvFvPootkBUpTYR4hTkdce +H6RCRu2Jxl4Y9bY/uezd9YhGCYfUtfjA6/TH9FcuZfttmOOlxOt01XfNvVMIR6RM +z/AYhd+DeOXjr35F/VHeVpnk+55L0PYJsm1CdEbOs5Hy1ecR7ACuDkXnbM4fpz9I +kyIWJwk2zJReKcJMgi1aIinDM9ao/dca1G99PHOw8dnr4oyoTiv8ao6PWiSRHHMi +MNf4EgWfK+tZMnuqfpfO9740KzfcVoMNo4QJD4yn5YxroUOO/Azi +-----END CERTIFICATE----- diff --git a/tests/specs/run/https_import/__test__.jsonc b/tests/specs/run/https_import/__test__.jsonc new file mode 100644 index 0000000000..9a37230f27 --- /dev/null +++ b/tests/specs/run/https_import/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --quiet --reload --cert RootCA.pem https_import.ts", + "output": "https_import.ts.out" +} diff --git a/tests/specs/run/https_import/https_import.ts b/tests/specs/run/https_import/https_import.ts new file mode 100644 index 0000000000..d392f4a5d1 --- /dev/null +++ b/tests/specs/run/https_import/https_import.ts @@ -0,0 +1,3 @@ +import { printHello } from "./print_hello.ts"; + +printHello(); diff --git a/tests/testdata/run/import_data_url_imports.ts.out b/tests/specs/run/https_import/https_import.ts.out similarity index 100% rename from tests/testdata/run/import_data_url_imports.ts.out rename to tests/specs/run/https_import/https_import.ts.out diff --git a/tests/specs/run/https_import/print_hello.ts b/tests/specs/run/https_import/print_hello.ts new file mode 100644 index 0000000000..b9c0ad5275 --- /dev/null +++ b/tests/specs/run/https_import/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/specs/run/if_main/__test__.jsonc b/tests/specs/run/if_main/__test__.jsonc new file mode 100644 index 0000000000..f6e2dbf273 --- /dev/null +++ b/tests/specs/run/if_main/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload if_main.ts", + "output": "if_main.ts.out" +} diff --git a/tests/testdata/run/if_main.ts b/tests/specs/run/if_main/if_main.ts similarity index 100% rename from tests/testdata/run/if_main.ts rename to tests/specs/run/if_main/if_main.ts diff --git a/tests/specs/run/if_main/if_main.ts.out b/tests/specs/run/if_main/if_main.ts.out new file mode 100644 index 0000000000..ba2906d066 --- /dev/null +++ b/tests/specs/run/if_main/if_main.ts.out @@ -0,0 +1 @@ +main diff --git a/tests/specs/run/import_attributes_dynamic_error/__test__.jsonc b/tests/specs/run/import_attributes_dynamic_error/__test__.jsonc new file mode 100644 index 0000000000..0a6137a2b5 --- /dev/null +++ b/tests/specs/run/import_attributes_dynamic_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --allow-read dynamic_error.ts", + "output": "dynamic_error.out", + "exitCode": 1 +} diff --git a/tests/specs/run/import_attributes_dynamic_error/data.json b/tests/specs/run/import_attributes_dynamic_error/data.json new file mode 100644 index 0000000000..37b3ee1e0a --- /dev/null +++ b/tests/specs/run/import_attributes_dynamic_error/data.json @@ -0,0 +1,6 @@ +{ + "a": "b", + "c": { + "d": 10 + } +} diff --git a/tests/specs/run/import_attributes_dynamic_error/dynamic_error.out b/tests/specs/run/import_attributes_dynamic_error/dynamic_error.out new file mode 100644 index 0000000000..24f29de72d --- /dev/null +++ b/tests/specs/run/import_attributes_dynamic_error/dynamic_error.out @@ -0,0 +1,4 @@ +error: Uncaught (in promise) TypeError: Attempted to load JSON module without specifying "type": "json" attribute in the import statement. +const data = await import("./data.json"); + ^ + at async [WILDCARD]dynamic_error.ts:1:14 diff --git a/tests/specs/run/import_attributes_dynamic_error/dynamic_error.ts b/tests/specs/run/import_attributes_dynamic_error/dynamic_error.ts new file mode 100644 index 0000000000..2d9c6757f6 --- /dev/null +++ b/tests/specs/run/import_attributes_dynamic_error/dynamic_error.ts @@ -0,0 +1,3 @@ +const data = await import("./data.json"); + +console.log(data); diff --git a/tests/specs/run/import_attributes_dynamic_import/__test__.jsonc b/tests/specs/run/import_attributes_dynamic_import/__test__.jsonc new file mode 100644 index 0000000000..75962e88db --- /dev/null +++ b/tests/specs/run/import_attributes_dynamic_import/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read --check dynamic_import.ts", + "output": "dynamic_import.out" +} diff --git a/tests/specs/run/import_attributes_dynamic_import/data.json b/tests/specs/run/import_attributes_dynamic_import/data.json new file mode 100644 index 0000000000..37b3ee1e0a --- /dev/null +++ b/tests/specs/run/import_attributes_dynamic_import/data.json @@ -0,0 +1,6 @@ +{ + "a": "b", + "c": { + "d": 10 + } +} diff --git a/tests/specs/run/import_attributes_dynamic_import/dynamic_import.out b/tests/specs/run/import_attributes_dynamic_import/dynamic_import.out new file mode 100644 index 0000000000..7a7b4c91fe --- /dev/null +++ b/tests/specs/run/import_attributes_dynamic_import/dynamic_import.out @@ -0,0 +1,2 @@ +[WILDCARD] +[Module: null prototype] { default: { a: "b", c: { d: 10 } } } diff --git a/tests/specs/run/import_attributes_dynamic_import/dynamic_import.ts b/tests/specs/run/import_attributes_dynamic_import/dynamic_import.ts new file mode 100644 index 0000000000..093136fb07 --- /dev/null +++ b/tests/specs/run/import_attributes_dynamic_import/dynamic_import.ts @@ -0,0 +1,3 @@ +const data1 = await import("./data.json", { with: { type: "json" } }); + +console.log(data1); diff --git a/tests/specs/run/import_attributes_static_error/__test__.jsonc b/tests/specs/run/import_attributes_static_error/__test__.jsonc new file mode 100644 index 0000000000..2d08c66d35 --- /dev/null +++ b/tests/specs/run/import_attributes_static_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --allow-read static_error.ts", + "output": "static_error.out", + "exitCode": 1 +} diff --git a/tests/specs/run/import_attributes_static_error/data.json b/tests/specs/run/import_attributes_static_error/data.json new file mode 100644 index 0000000000..37b3ee1e0a --- /dev/null +++ b/tests/specs/run/import_attributes_static_error/data.json @@ -0,0 +1,6 @@ +{ + "a": "b", + "c": { + "d": 10 + } +} diff --git a/tests/specs/run/import_attributes_static_error/static_error.out b/tests/specs/run/import_attributes_static_error/static_error.out new file mode 100644 index 0000000000..29b24b965a --- /dev/null +++ b/tests/specs/run/import_attributes_static_error/static_error.out @@ -0,0 +1,3 @@ +error: Expected a JavaScript or TypeScript module, but identified a Json module. Consider importing Json modules with an import attribute with the type of "json". + Specifier: [WILDCARD]/data.json + at [WILDCARD]static_error.ts:1:18 diff --git a/tests/specs/run/import_attributes_static_error/static_error.ts b/tests/specs/run/import_attributes_static_error/static_error.ts new file mode 100644 index 0000000000..0bc3a93f88 --- /dev/null +++ b/tests/specs/run/import_attributes_static_error/static_error.ts @@ -0,0 +1,3 @@ +import data from "./data.json"; + +console.log(data); diff --git a/tests/specs/run/import_attributes_static_export/__test__.jsonc b/tests/specs/run/import_attributes_static_export/__test__.jsonc new file mode 100644 index 0000000000..05a64aab53 --- /dev/null +++ b/tests/specs/run/import_attributes_static_export/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read static_export.ts", + "output": "static_export.out" +} diff --git a/tests/specs/run/import_attributes_static_export/data.json b/tests/specs/run/import_attributes_static_export/data.json new file mode 100644 index 0000000000..37b3ee1e0a --- /dev/null +++ b/tests/specs/run/import_attributes_static_export/data.json @@ -0,0 +1,6 @@ +{ + "a": "b", + "c": { + "d": 10 + } +} diff --git a/tests/specs/run/import_attributes_static_export/static_export.out b/tests/specs/run/import_attributes_static_export/static_export.out new file mode 100644 index 0000000000..41af79d7c8 --- /dev/null +++ b/tests/specs/run/import_attributes_static_export/static_export.out @@ -0,0 +1 @@ +{ a: "b", c: { d: 10 } } diff --git a/tests/specs/run/import_attributes_static_export/static_export.ts b/tests/specs/run/import_attributes_static_export/static_export.ts new file mode 100644 index 0000000000..ac3ee694f5 --- /dev/null +++ b/tests/specs/run/import_attributes_static_export/static_export.ts @@ -0,0 +1,3 @@ +import data from "./static_reexport.ts"; + +console.log(data); diff --git a/tests/specs/run/import_attributes_static_export/static_reexport.ts b/tests/specs/run/import_attributes_static_export/static_reexport.ts new file mode 100644 index 0000000000..e6175691c6 --- /dev/null +++ b/tests/specs/run/import_attributes_static_export/static_reexport.ts @@ -0,0 +1 @@ +export { default } from "./data.json" with { type: "json" }; diff --git a/tests/specs/run/import_attributes_static_import/__test__.jsonc b/tests/specs/run/import_attributes_static_import/__test__.jsonc new file mode 100644 index 0000000000..4ea39e6d32 --- /dev/null +++ b/tests/specs/run/import_attributes_static_import/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read static_import.ts", + "output": "static_import.out" +} diff --git a/tests/specs/run/import_attributes_static_import/data.json b/tests/specs/run/import_attributes_static_import/data.json new file mode 100644 index 0000000000..37b3ee1e0a --- /dev/null +++ b/tests/specs/run/import_attributes_static_import/data.json @@ -0,0 +1,6 @@ +{ + "a": "b", + "c": { + "d": 10 + } +} diff --git a/tests/specs/run/import_attributes_static_import/static_import.out b/tests/specs/run/import_attributes_static_import/static_import.out new file mode 100644 index 0000000000..e57dffa992 --- /dev/null +++ b/tests/specs/run/import_attributes_static_import/static_import.out @@ -0,0 +1,2 @@ +{ a: "b", c: { d: 10 } } +{ a: "b", c: { d: 10 } } diff --git a/tests/specs/run/import_attributes_static_import/static_import.ts b/tests/specs/run/import_attributes_static_import/static_import.ts new file mode 100644 index 0000000000..f585b893f3 --- /dev/null +++ b/tests/specs/run/import_attributes_static_import/static_import.ts @@ -0,0 +1,5 @@ +import data1 from "./data.json" with { type: "json" }; +import data2 from "./data.json" with { type: "json" }; + +console.log(data1); +console.log(data2); diff --git a/tests/specs/run/import_attributes_type_check/__test__.jsonc b/tests/specs/run/import_attributes_type_check/__test__.jsonc new file mode 100644 index 0000000000..89f6e0a79e --- /dev/null +++ b/tests/specs/run/import_attributes_type_check/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --allow-read --check type_check.ts", + "output": "type_check.out", + "exitCode": 1 +} diff --git a/tests/specs/run/import_attributes_type_check/data.json b/tests/specs/run/import_attributes_type_check/data.json new file mode 100644 index 0000000000..37b3ee1e0a --- /dev/null +++ b/tests/specs/run/import_attributes_type_check/data.json @@ -0,0 +1,6 @@ +{ + "a": "b", + "c": { + "d": 10 + } +} diff --git a/tests/specs/run/import_attributes_type_check/type_check.out b/tests/specs/run/import_attributes_type_check/type_check.out new file mode 100644 index 0000000000..2fc26dae36 --- /dev/null +++ b/tests/specs/run/import_attributes_type_check/type_check.out @@ -0,0 +1,12 @@ +Check file:///[WILDCARD]/type_check.ts +error: TS2339 [ERROR]: Property 'foo' does not exist on type '{ a: string; c: { d: number; }; }'. +console.log(data1.foo); + ~~~ + at [WILDCARD]type_check.ts:5:19 + +TS2339 [ERROR]: Property 'foo' does not exist on type '{ a: string; c: { d: number; }; }'. +console.log(data2.foo); + ~~~ + at [WILDCARD]type_check.ts:6:19 + +Found 2 errors. diff --git a/tests/specs/run/import_attributes_type_check/type_check.ts b/tests/specs/run/import_attributes_type_check/type_check.ts new file mode 100644 index 0000000000..36e47bd5b8 --- /dev/null +++ b/tests/specs/run/import_attributes_type_check/type_check.ts @@ -0,0 +1,6 @@ +import data1 from "./data.json" with { type: "json" }; +// deno-lint-ignore no-import-assertions +import data2 from "./data.json" assert { type: "json" }; + +console.log(data1.foo); +console.log(data2.foo); diff --git a/tests/specs/run/import_blob_url/__test__.jsonc b/tests/specs/run/import_blob_url/__test__.jsonc new file mode 100644 index 0000000000..9ae6b5a423 --- /dev/null +++ b/tests/specs/run/import_blob_url/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload import_blob_url.ts", + "output": "import_blob_url.ts.out" +} diff --git a/tests/testdata/run/import_blob_url.ts b/tests/specs/run/import_blob_url/import_blob_url.ts similarity index 100% rename from tests/testdata/run/import_blob_url.ts rename to tests/specs/run/import_blob_url/import_blob_url.ts diff --git a/tests/testdata/run/import_blob_url.ts.out b/tests/specs/run/import_blob_url/import_blob_url.ts.out similarity index 100% rename from tests/testdata/run/import_blob_url.ts.out rename to tests/specs/run/import_blob_url/import_blob_url.ts.out diff --git a/tests/specs/run/import_blob_url_error_stack/__test__.jsonc b/tests/specs/run/import_blob_url_error_stack/__test__.jsonc new file mode 100644 index 0000000000..56a1489cd7 --- /dev/null +++ b/tests/specs/run/import_blob_url_error_stack/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --reload import_blob_url_error_stack.ts", + "output": "import_blob_url_error_stack.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/import_blob_url_error_stack.ts b/tests/specs/run/import_blob_url_error_stack/import_blob_url_error_stack.ts similarity index 100% rename from tests/testdata/run/import_blob_url_error_stack.ts rename to tests/specs/run/import_blob_url_error_stack/import_blob_url_error_stack.ts diff --git a/tests/testdata/run/import_blob_url_error_stack.ts.out b/tests/specs/run/import_blob_url_error_stack/import_blob_url_error_stack.ts.out similarity index 100% rename from tests/testdata/run/import_blob_url_error_stack.ts.out rename to tests/specs/run/import_blob_url_error_stack/import_blob_url_error_stack.ts.out diff --git a/tests/specs/run/import_blob_url_import_relative/__test__.jsonc b/tests/specs/run/import_blob_url_import_relative/__test__.jsonc new file mode 100644 index 0000000000..4fda81b311 --- /dev/null +++ b/tests/specs/run/import_blob_url_import_relative/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --reload import_blob_url_import_relative.ts", + "output": "import_blob_url_import_relative.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/import_blob_url_import_relative.ts b/tests/specs/run/import_blob_url_import_relative/import_blob_url_import_relative.ts similarity index 100% rename from tests/testdata/run/import_blob_url_import_relative.ts rename to tests/specs/run/import_blob_url_import_relative/import_blob_url_import_relative.ts diff --git a/tests/testdata/run/import_blob_url_import_relative.ts.out b/tests/specs/run/import_blob_url_import_relative/import_blob_url_import_relative.ts.out similarity index 100% rename from tests/testdata/run/import_blob_url_import_relative.ts.out rename to tests/specs/run/import_blob_url_import_relative/import_blob_url_import_relative.ts.out diff --git a/tests/specs/run/import_blob_url_imports/__test__.jsonc b/tests/specs/run/import_blob_url_imports/__test__.jsonc new file mode 100644 index 0000000000..511d22a593 --- /dev/null +++ b/tests/specs/run/import_blob_url_imports/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --quiet --reload --allow-net=localhost:4545 import_blob_url_imports.ts", + "output": "import_blob_url_imports.ts.out" +} diff --git a/tests/testdata/run/import_blob_url_imports.ts b/tests/specs/run/import_blob_url_imports/import_blob_url_imports.ts similarity index 100% rename from tests/testdata/run/import_blob_url_imports.ts rename to tests/specs/run/import_blob_url_imports/import_blob_url_imports.ts diff --git a/tests/testdata/run/import_extensionless.ts.out b/tests/specs/run/import_blob_url_imports/import_blob_url_imports.ts.out similarity index 100% rename from tests/testdata/run/import_extensionless.ts.out rename to tests/specs/run/import_blob_url_imports/import_blob_url_imports.ts.out diff --git a/tests/specs/run/import_blob_url_jsx/__test__.jsonc b/tests/specs/run/import_blob_url_jsx/__test__.jsonc new file mode 100644 index 0000000000..985c6f8421 --- /dev/null +++ b/tests/specs/run/import_blob_url_jsx/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload import_blob_url_jsx.ts", + "output": "import_blob_url_jsx.ts.out" +} diff --git a/tests/testdata/run/import_blob_url_jsx.ts b/tests/specs/run/import_blob_url_jsx/import_blob_url_jsx.ts similarity index 100% rename from tests/testdata/run/import_blob_url_jsx.ts rename to tests/specs/run/import_blob_url_jsx/import_blob_url_jsx.ts diff --git a/tests/testdata/run/import_blob_url_jsx.ts.out b/tests/specs/run/import_blob_url_jsx/import_blob_url_jsx.ts.out similarity index 100% rename from tests/testdata/run/import_blob_url_jsx.ts.out rename to tests/specs/run/import_blob_url_jsx/import_blob_url_jsx.ts.out diff --git a/tests/specs/run/import_compression/__test__.jsonc b/tests/specs/run/import_compression/__test__.jsonc new file mode 100644 index 0000000000..c8f7af9e1c --- /dev/null +++ b/tests/specs/run/import_compression/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --quiet --reload --allow-net import_compression/main.ts", + "output": "import_compression/main.out" +} diff --git a/tests/specs/run/import_compression/import_compression/brotli b/tests/specs/run/import_compression/import_compression/brotli new file mode 100644 index 0000000000..65f679d571 --- /dev/null +++ b/tests/specs/run/import_compression/import_compression/brotli @@ -0,0 +1,2 @@ + +console.log('brotli'); \ No newline at end of file diff --git a/tests/specs/run/import_compression/import_compression/gziped b/tests/specs/run/import_compression/import_compression/gziped new file mode 100644 index 0000000000000000000000000000000000000000..9f9a7bc690b13f0c181a00031193b0302e9dda5a GIT binary patch literal 39 scmb2|=3oE;mjB-8&TF4L?|Jp~N&o8s{_9Wa1YBofSR`}vwlGi{048-0G5`Po literal 0 HcmV?d00001 diff --git a/tests/testdata/run/import_compression/main.out b/tests/specs/run/import_compression/import_compression/main.out similarity index 100% rename from tests/testdata/run/import_compression/main.out rename to tests/specs/run/import_compression/import_compression/main.out diff --git a/tests/testdata/run/import_compression/main.ts b/tests/specs/run/import_compression/import_compression/main.ts similarity index 100% rename from tests/testdata/run/import_compression/main.ts rename to tests/specs/run/import_compression/import_compression/main.ts diff --git a/tests/specs/run/import_data_url/__test__.jsonc b/tests/specs/run/import_data_url/__test__.jsonc new file mode 100644 index 0000000000..95d1c94a34 --- /dev/null +++ b/tests/specs/run/import_data_url/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload import_data_url.ts", + "output": "import_data_url.ts.out" +} diff --git a/tests/testdata/run/import_data_url.ts b/tests/specs/run/import_data_url/import_data_url.ts similarity index 100% rename from tests/testdata/run/import_data_url.ts rename to tests/specs/run/import_data_url/import_data_url.ts diff --git a/tests/testdata/run/import_data_url.ts.out b/tests/specs/run/import_data_url/import_data_url.ts.out similarity index 100% rename from tests/testdata/run/import_data_url.ts.out rename to tests/specs/run/import_data_url/import_data_url.ts.out diff --git a/tests/specs/run/import_data_url_error_stack/__test__.jsonc b/tests/specs/run/import_data_url_error_stack/__test__.jsonc new file mode 100644 index 0000000000..851aae191d --- /dev/null +++ b/tests/specs/run/import_data_url_error_stack/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --reload import_data_url_error_stack.ts", + "output": "import_data_url_error_stack.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/import_data_url_error_stack.ts b/tests/specs/run/import_data_url_error_stack/import_data_url_error_stack.ts similarity index 100% rename from tests/testdata/run/import_data_url_error_stack.ts rename to tests/specs/run/import_data_url_error_stack/import_data_url_error_stack.ts diff --git a/tests/testdata/run/import_data_url_error_stack.ts.out b/tests/specs/run/import_data_url_error_stack/import_data_url_error_stack.ts.out similarity index 100% rename from tests/testdata/run/import_data_url_error_stack.ts.out rename to tests/specs/run/import_data_url_error_stack/import_data_url_error_stack.ts.out diff --git a/tests/specs/run/import_data_url_import_relative/__test__.jsonc b/tests/specs/run/import_data_url_import_relative/__test__.jsonc new file mode 100644 index 0000000000..b241bc917c --- /dev/null +++ b/tests/specs/run/import_data_url_import_relative/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --reload import_data_url_import_relative.ts", + "output": "import_data_url_import_relative.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/import_data_url_import_relative.ts b/tests/specs/run/import_data_url_import_relative/import_data_url_import_relative.ts similarity index 100% rename from tests/testdata/run/import_data_url_import_relative.ts rename to tests/specs/run/import_data_url_import_relative/import_data_url_import_relative.ts diff --git a/tests/testdata/run/import_data_url_import_relative.ts.out b/tests/specs/run/import_data_url_import_relative/import_data_url_import_relative.ts.out similarity index 100% rename from tests/testdata/run/import_data_url_import_relative.ts.out rename to tests/specs/run/import_data_url_import_relative/import_data_url_import_relative.ts.out diff --git a/tests/specs/run/import_data_url_imports/__test__.jsonc b/tests/specs/run/import_data_url_imports/__test__.jsonc new file mode 100644 index 0000000000..7fc8df315c --- /dev/null +++ b/tests/specs/run/import_data_url_imports/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --quiet --reload import_data_url_imports.ts", + "output": "import_data_url_imports.ts.out" +} diff --git a/tests/testdata/run/import_data_url_imports.ts b/tests/specs/run/import_data_url_imports/import_data_url_imports.ts similarity index 100% rename from tests/testdata/run/import_data_url_imports.ts rename to tests/specs/run/import_data_url_imports/import_data_url_imports.ts diff --git a/tests/testdata/run/issue13562.ts.out b/tests/specs/run/import_data_url_imports/import_data_url_imports.ts.out similarity index 100% rename from tests/testdata/run/issue13562.ts.out rename to tests/specs/run/import_data_url_imports/import_data_url_imports.ts.out diff --git a/tests/specs/run/import_data_url_jsx/__test__.jsonc b/tests/specs/run/import_data_url_jsx/__test__.jsonc new file mode 100644 index 0000000000..8fb1f9a1d9 --- /dev/null +++ b/tests/specs/run/import_data_url_jsx/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload import_data_url_jsx.ts", + "output": "import_data_url_jsx.ts.out" +} diff --git a/tests/testdata/run/import_data_url_jsx.ts b/tests/specs/run/import_data_url_jsx/import_data_url_jsx.ts similarity index 100% rename from tests/testdata/run/import_data_url_jsx.ts rename to tests/specs/run/import_data_url_jsx/import_data_url_jsx.ts diff --git a/tests/testdata/run/import_data_url_jsx.ts.out b/tests/specs/run/import_data_url_jsx/import_data_url_jsx.ts.out similarity index 100% rename from tests/testdata/run/import_data_url_jsx.ts.out rename to tests/specs/run/import_data_url_jsx/import_data_url_jsx.ts.out diff --git a/tests/specs/run/import_dynamic_data_url/__test__.jsonc b/tests/specs/run/import_dynamic_data_url/__test__.jsonc new file mode 100644 index 0000000000..09ff77f419 --- /dev/null +++ b/tests/specs/run/import_dynamic_data_url/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload import_dynamic_data_url.ts", + "output": "import_dynamic_data_url.ts.out" +} diff --git a/tests/testdata/run/import_dynamic_data_url.ts b/tests/specs/run/import_dynamic_data_url/import_dynamic_data_url.ts similarity index 100% rename from tests/testdata/run/import_dynamic_data_url.ts rename to tests/specs/run/import_dynamic_data_url/import_dynamic_data_url.ts diff --git a/tests/testdata/run/import_dynamic_data_url.ts.out b/tests/specs/run/import_dynamic_data_url/import_dynamic_data_url.ts.out similarity index 100% rename from tests/testdata/run/import_dynamic_data_url.ts.out rename to tests/specs/run/import_dynamic_data_url/import_dynamic_data_url.ts.out diff --git a/tests/specs/run/import_extensionless/__test__.jsonc b/tests/specs/run/import_extensionless/__test__.jsonc new file mode 100644 index 0000000000..cde59b5e22 --- /dev/null +++ b/tests/specs/run/import_extensionless/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --quiet --reload import_extensionless.ts", + "output": "import_extensionless.ts.out" +} diff --git a/tests/testdata/run/import_extensionless.ts b/tests/specs/run/import_extensionless/import_extensionless.ts similarity index 100% rename from tests/testdata/run/import_extensionless.ts rename to tests/specs/run/import_extensionless/import_extensionless.ts diff --git a/tests/specs/run/import_extensionless/import_extensionless.ts.out b/tests/specs/run/import_extensionless/import_extensionless.ts.out new file mode 100644 index 0000000000..e965047ad7 --- /dev/null +++ b/tests/specs/run/import_extensionless/import_extensionless.ts.out @@ -0,0 +1 @@ +Hello diff --git a/tests/specs/run/import_file_with_colon/__test__.jsonc b/tests/specs/run/import_file_with_colon/__test__.jsonc new file mode 100644 index 0000000000..5e6602ab3e --- /dev/null +++ b/tests/specs/run/import_file_with_colon/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --quiet --reload import_file_with_colon.ts", + "output": "import_file_with_colon.ts.out" +} diff --git a/tests/testdata/run/import_file_with_colon.ts b/tests/specs/run/import_file_with_colon/import_file_with_colon.ts similarity index 100% rename from tests/testdata/run/import_file_with_colon.ts rename to tests/specs/run/import_file_with_colon/import_file_with_colon.ts diff --git a/tests/testdata/run/import_file_with_colon.ts.out b/tests/specs/run/import_file_with_colon/import_file_with_colon.ts.out similarity index 100% rename from tests/testdata/run/import_file_with_colon.ts.out rename to tests/specs/run/import_file_with_colon/import_file_with_colon.ts.out diff --git a/tests/specs/run/import_type/__test__.jsonc b/tests/specs/run/import_type/__test__.jsonc new file mode 100644 index 0000000000..2958483d00 --- /dev/null +++ b/tests/specs/run/import_type/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload import_type.ts", + "output": "import_type.ts.out" +} diff --git a/tests/specs/run/import_type/export_types.ts b/tests/specs/run/import_type/export_types.ts new file mode 100644 index 0000000000..18c8ed8810 --- /dev/null +++ b/tests/specs/run/import_type/export_types.ts @@ -0,0 +1,11 @@ +export interface A { + a: string; +} + +export class B implements A { + a = "a"; +} + +export function create(): B { + return new B(); +} diff --git a/tests/specs/run/import_type/import_type.ts b/tests/specs/run/import_type/import_type.ts new file mode 100644 index 0000000000..91baba19aa --- /dev/null +++ b/tests/specs/run/import_type/import_type.ts @@ -0,0 +1,5 @@ +import { type B, create } from "./export_types.ts"; + +const b: B = create(); + +console.log(b); diff --git a/tests/testdata/run/import_type.ts.out b/tests/specs/run/import_type/import_type.ts.out similarity index 100% rename from tests/testdata/run/import_type.ts.out rename to tests/specs/run/import_type/import_type.ts.out diff --git a/tests/specs/run/import_type_no_check/__test__.jsonc b/tests/specs/run/import_type_no_check/__test__.jsonc new file mode 100644 index 0000000000..d858f5fa10 --- /dev/null +++ b/tests/specs/run/import_type_no_check/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --no-check import_type.ts", + "output": "import_type.ts.out" +} diff --git a/tests/specs/run/import_type_no_check/export_types.ts b/tests/specs/run/import_type_no_check/export_types.ts new file mode 100644 index 0000000000..18c8ed8810 --- /dev/null +++ b/tests/specs/run/import_type_no_check/export_types.ts @@ -0,0 +1,11 @@ +export interface A { + a: string; +} + +export class B implements A { + a = "a"; +} + +export function create(): B { + return new B(); +} diff --git a/tests/specs/run/import_type_no_check/import_type.ts b/tests/specs/run/import_type_no_check/import_type.ts new file mode 100644 index 0000000000..91baba19aa --- /dev/null +++ b/tests/specs/run/import_type_no_check/import_type.ts @@ -0,0 +1,5 @@ +import { type B, create } from "./export_types.ts"; + +const b: B = create(); + +console.log(b); diff --git a/tests/specs/run/import_type_no_check/import_type.ts.out b/tests/specs/run/import_type_no_check/import_type.ts.out new file mode 100644 index 0000000000..e35539e352 --- /dev/null +++ b/tests/specs/run/import_type_no_check/import_type.ts.out @@ -0,0 +1 @@ +B { a: "a" } diff --git a/tests/specs/run/inline_js_source_map_2/__test__.jsonc b/tests/specs/run/inline_js_source_map_2/__test__.jsonc new file mode 100644 index 0000000000..99ca6c1aed --- /dev/null +++ b/tests/specs/run/inline_js_source_map_2/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet inline_js_source_map_2.js", + "output": "inline_js_source_map_2.js.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/inline_js_source_map_2.js b/tests/specs/run/inline_js_source_map_2/inline_js_source_map_2.js similarity index 84% rename from tests/testdata/run/inline_js_source_map_2.js rename to tests/specs/run/inline_js_source_map_2/inline_js_source_map_2.js index d14d906b80..87132ee6a7 100644 --- a/tests/testdata/run/inline_js_source_map_2.js +++ b/tests/specs/run/inline_js_source_map_2/inline_js_source_map_2.js @@ -1,4 +1,4 @@ "use strict"; 1 + 1; throw new Error("Hello world!"); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L3J1bi9pbmxpbmVfanNfc291cmNlX21hcF8yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxDQUFDLEdBQUMsQ0FBQyxDQUFDO0FBS0osTUFBTSxJQUFJLEtBQUssQ0FBQyxjQUErQixDQUFDLENBQUMifQ== \ No newline at end of file +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L3J1bi9pbmxpbmVfanNfc291cmNlX21hcF8yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxDQUFDLEdBQUMsQ0FBQyxDQUFDO0FBS0osTUFBTSxJQUFJLEtBQUssQ0FBQyxjQUErQixDQUFDLENBQUMifQ== diff --git a/tests/testdata/run/inline_js_source_map_2.js.out b/tests/specs/run/inline_js_source_map_2/inline_js_source_map_2.js.out similarity index 100% rename from tests/testdata/run/inline_js_source_map_2.js.out rename to tests/specs/run/inline_js_source_map_2/inline_js_source_map_2.js.out diff --git a/tests/specs/run/inline_js_source_map_2_with_inline_contents/__test__.jsonc b/tests/specs/run/inline_js_source_map_2_with_inline_contents/__test__.jsonc new file mode 100644 index 0000000000..45fe6eba6d --- /dev/null +++ b/tests/specs/run/inline_js_source_map_2_with_inline_contents/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet inline_js_source_map_2_with_inline_contents.js", + "output": "inline_js_source_map_2_with_inline_contents.js.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/inline_js_source_map_2_with_inline_contents.js b/tests/specs/run/inline_js_source_map_2_with_inline_contents/inline_js_source_map_2_with_inline_contents.js similarity index 93% rename from tests/testdata/run/inline_js_source_map_2_with_inline_contents.js rename to tests/specs/run/inline_js_source_map_2_with_inline_contents/inline_js_source_map_2_with_inline_contents.js index 7660cc229b..41bee7fe4d 100644 --- a/tests/testdata/run/inline_js_source_map_2_with_inline_contents.js +++ b/tests/specs/run/inline_js_source_map_2_with_inline_contents/inline_js_source_map_2_with_inline_contents.js @@ -1,4 +1,4 @@ "use strict"; throw new Error("Hello world!"); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L3J1bi9pbmxpbmVfanNfc291cmNlX21hcF8yLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIjErMTtcbmludGVyZmFjZSBUZXN0IHtcbiAgaGVsbG86IHN0cmluZztcbn1cblxudGhyb3cgbmV3IEVycm9yKFwiSGVsbG8gd29ybGQhXCIgYXMgdW5rbm93biBhcyBzdHJpbmcpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxDQUFDLEdBQUMsQ0FBQyxDQUFDO0FBS0osTUFBTSxJQUFJLEtBQUssQ0FBQyxjQUErQixDQUFDLENBQUMifQ== \ No newline at end of file +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L3J1bi9pbmxpbmVfanNfc291cmNlX21hcF8yLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIjErMTtcbmludGVyZmFjZSBUZXN0IHtcbiAgaGVsbG86IHN0cmluZztcbn1cblxudGhyb3cgbmV3IEVycm9yKFwiSGVsbG8gd29ybGQhXCIgYXMgdW5rbm93biBhcyBzdHJpbmcpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxDQUFDLEdBQUMsQ0FBQyxDQUFDO0FBS0osTUFBTSxJQUFJLEtBQUssQ0FBQyxjQUErQixDQUFDLENBQUMifQ== diff --git a/tests/testdata/run/inline_js_source_map_2_with_inline_contents.js.out b/tests/specs/run/inline_js_source_map_2_with_inline_contents/inline_js_source_map_2_with_inline_contents.js.out similarity index 100% rename from tests/testdata/run/inline_js_source_map_2_with_inline_contents.js.out rename to tests/specs/run/inline_js_source_map_2_with_inline_contents/inline_js_source_map_2_with_inline_contents.js.out diff --git a/tests/specs/run/inline_js_source_map_with_contents_from_graph/__test__.jsonc b/tests/specs/run/inline_js_source_map_with_contents_from_graph/__test__.jsonc new file mode 100644 index 0000000000..71dc4d509d --- /dev/null +++ b/tests/specs/run/inline_js_source_map_with_contents_from_graph/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --allow-import --quiet inline_js_source_map_with_contents_from_graph.js", + "output": "inline_js_source_map_with_contents_from_graph.js.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/inline_js_source_map_with_contents_from_graph.js b/tests/specs/run/inline_js_source_map_with_contents_from_graph/inline_js_source_map_with_contents_from_graph.js similarity index 86% rename from tests/testdata/run/inline_js_source_map_with_contents_from_graph.js rename to tests/specs/run/inline_js_source_map_with_contents_from_graph/inline_js_source_map_with_contents_from_graph.js index 887f023209..12fa1644df 100644 --- a/tests/testdata/run/inline_js_source_map_with_contents_from_graph.js +++ b/tests/specs/run/inline_js_source_map_with_contents_from_graph/inline_js_source_map_with_contents_from_graph.js @@ -1,4 +1,4 @@ "use strict"; import "http://localhost:4545/run/inline_js_source_map.ts"; throw new Error("Hello world!"); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L3J1bi9pbmxpbmVfanNfc291cmNlX21hcC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsQ0FBQyxHQUFDLENBQUMsQ0FBQztBQUtKLE1BQU0sSUFBSSxLQUFLLENBQUMsY0FBK0IsQ0FBQyxDQUFDIn0= \ No newline at end of file +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L3J1bi9pbmxpbmVfanNfc291cmNlX21hcC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsQ0FBQyxHQUFDLENBQUMsQ0FBQztBQUtKLE1BQU0sSUFBSSxLQUFLLENBQUMsY0FBK0IsQ0FBQyxDQUFDIn0= diff --git a/tests/testdata/run/inline_js_source_map_with_contents_from_graph.js.out b/tests/specs/run/inline_js_source_map_with_contents_from_graph/inline_js_source_map_with_contents_from_graph.js.out similarity index 100% rename from tests/testdata/run/inline_js_source_map_with_contents_from_graph.js.out rename to tests/specs/run/inline_js_source_map_with_contents_from_graph/inline_js_source_map_with_contents_from_graph.js.out diff --git a/tests/specs/run/issue_13562/__test__.jsonc b/tests/specs/run/issue_13562/__test__.jsonc new file mode 100644 index 0000000000..1971d552b6 --- /dev/null +++ b/tests/specs/run/issue_13562/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run issue13562.ts", + "output": "issue13562.ts.out" +} diff --git a/tests/specs/run/issue_13562/issue13562.ts b/tests/specs/run/issue_13562/issue13562.ts new file mode 100644 index 0000000000..51e97629b6 --- /dev/null +++ b/tests/specs/run/issue_13562/issue13562.ts @@ -0,0 +1,3 @@ +import { printHello3 } from "./mod1.ts?q=.json"; + +printHello3(); diff --git a/tests/specs/run/issue_13562/issue13562.ts.out b/tests/specs/run/issue_13562/issue13562.ts.out new file mode 100644 index 0000000000..e965047ad7 --- /dev/null +++ b/tests/specs/run/issue_13562/issue13562.ts.out @@ -0,0 +1 @@ +Hello diff --git a/tests/specs/run/issue_13562/mod1.ts b/tests/specs/run/issue_13562/mod1.ts new file mode 100644 index 0000000000..5e58f432ed --- /dev/null +++ b/tests/specs/run/issue_13562/mod1.ts @@ -0,0 +1,17 @@ +import { printHello2, returnsFoo } from "./subdir2/mod2.ts"; + +export function returnsHi(): string { + return "Hi"; +} + +export function returnsFoo2(): string { + return returnsFoo(); +} + +export function printHello3() { + printHello2(); +} + +export function throwsError() { + throw Error("exception from mod1"); +} diff --git a/tests/specs/run/issue_13562/print_hello.ts b/tests/specs/run/issue_13562/print_hello.ts new file mode 100644 index 0000000000..b9c0ad5275 --- /dev/null +++ b/tests/specs/run/issue_13562/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/specs/run/issue_13562/subdir2/dynamic_import.ts b/tests/specs/run/issue_13562/subdir2/dynamic_import.ts new file mode 100644 index 0000000000..59beb64c33 --- /dev/null +++ b/tests/specs/run/issue_13562/subdir2/dynamic_import.ts @@ -0,0 +1,4 @@ +(async () => { + const { printHello } = await import("../mod2.ts"); + printHello(); +})(); diff --git a/tests/specs/run/issue_13562/subdir2/mod2.ts b/tests/specs/run/issue_13562/subdir2/mod2.ts new file mode 100644 index 0000000000..9071d0aeb4 --- /dev/null +++ b/tests/specs/run/issue_13562/subdir2/mod2.ts @@ -0,0 +1,9 @@ +import { printHello } from "../print_hello.ts"; + +export function returnsFoo(): string { + return "Foo"; +} + +export function printHello2() { + printHello(); +} diff --git a/tests/specs/run/js_import_detect/__test__.jsonc b/tests/specs/run/js_import_detect/__test__.jsonc new file mode 100644 index 0000000000..6a648f4763 --- /dev/null +++ b/tests/specs/run/js_import_detect/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --reload js_import_detect.ts", + "output": "js_import_detect.ts.out", + "exitCode": 0 +} diff --git a/tests/testdata/run/js_import_detect.ts b/tests/specs/run/js_import_detect/js_import_detect.ts similarity index 100% rename from tests/testdata/run/js_import_detect.ts rename to tests/specs/run/js_import_detect/js_import_detect.ts diff --git a/tests/testdata/run/js_import_detect.ts.out b/tests/specs/run/js_import_detect/js_import_detect.ts.out similarity index 100% rename from tests/testdata/run/js_import_detect.ts.out rename to tests/specs/run/js_import_detect/js_import_detect.ts.out diff --git a/tests/specs/run/js_root_with_ts_check/__test__.jsonc b/tests/specs/run/js_root_with_ts_check/__test__.jsonc new file mode 100644 index 0000000000..ebc4d75987 --- /dev/null +++ b/tests/specs/run/js_root_with_ts_check/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --check js_root_with_ts_check.js", + "output": "js_root_with_ts_check.js.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/js_root_with_ts_check.js b/tests/specs/run/js_root_with_ts_check/js_root_with_ts_check.js similarity index 100% rename from tests/testdata/run/js_root_with_ts_check.js rename to tests/specs/run/js_root_with_ts_check/js_root_with_ts_check.js diff --git a/tests/testdata/run/js_root_with_ts_check.js.out b/tests/specs/run/js_root_with_ts_check/js_root_with_ts_check.js.out similarity index 100% rename from tests/testdata/run/js_root_with_ts_check.js.out rename to tests/specs/run/js_root_with_ts_check/js_root_with_ts_check.js.out diff --git a/tests/specs/run/js_without_extension/__test__.jsonc b/tests/specs/run/js_without_extension/__test__.jsonc new file mode 100644 index 0000000000..0d2aac73b4 --- /dev/null +++ b/tests/specs/run/js_without_extension/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --ext js --check js_without_extension", + "output": "js_without_extension.out", + "exitCode": 0 +} diff --git a/tests/specs/run/js_without_extension/js_without_extension b/tests/specs/run/js_without_extension/js_without_extension new file mode 100644 index 0000000000..4774be3263 --- /dev/null +++ b/tests/specs/run/js_without_extension/js_without_extension @@ -0,0 +1,3 @@ +let i = 123; +i = "hello" +console.log("executing javascript with no extension"); diff --git a/tests/specs/run/js_without_extension/js_without_extension.out b/tests/specs/run/js_without_extension/js_without_extension.out new file mode 100644 index 0000000000..1236c1e534 --- /dev/null +++ b/tests/specs/run/js_without_extension/js_without_extension.out @@ -0,0 +1 @@ +executing javascript with no extension diff --git a/tests/specs/run/jsx_import_from_ts/__test__.jsonc b/tests/specs/run/jsx_import_from_ts/__test__.jsonc new file mode 100644 index 0000000000..0f89205dc1 --- /dev/null +++ b/tests/specs/run/jsx_import_from_ts/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload jsx_import_from_ts.ts", + "output": "jsx_import_from_ts.ts.out" +} diff --git a/tests/specs/run/jsx_import_from_ts/jsx_import_from_ts.App.jsx b/tests/specs/run/jsx_import_from_ts/jsx_import_from_ts.App.jsx new file mode 100644 index 0000000000..649230613c --- /dev/null +++ b/tests/specs/run/jsx_import_from_ts/jsx_import_from_ts.App.jsx @@ -0,0 +1,11 @@ +const React = { + createElement() {}, +}; + +export default function app() { + return ( +

+

asdf

+
+ ); +} diff --git a/tests/testdata/run/jsx_import_from_ts.ts b/tests/specs/run/jsx_import_from_ts/jsx_import_from_ts.ts similarity index 100% rename from tests/testdata/run/jsx_import_from_ts.ts rename to tests/specs/run/jsx_import_from_ts/jsx_import_from_ts.ts diff --git a/tests/testdata/run/jsx_import_from_ts.ts.out b/tests/specs/run/jsx_import_from_ts/jsx_import_from_ts.ts.out similarity index 100% rename from tests/testdata/run/jsx_import_from_ts.ts.out rename to tests/specs/run/jsx_import_from_ts/jsx_import_from_ts.ts.out diff --git a/tests/specs/run/jsx_import_source_error/__test__.jsonc b/tests/specs/run/jsx_import_source_error/__test__.jsonc new file mode 100644 index 0000000000..22b1d29cab --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --config jsx/deno-jsx-error.jsonc --check jsx_import_source_no_pragma.tsx", + "output": "jsx_import_source_error.out", + "exitCode": 1 +} diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_error/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_error/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_error/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_error/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_error/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_error/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_error/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_error/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno.lock b/tests/specs/run/jsx_import_source_error/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_error/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_error/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_error/jsx/import-map.json b/tests/specs/run/jsx_import_source_error/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_error/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_error/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_error/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_error/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_error/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_error/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/testdata/run/jsx_import_source_error.out b/tests/specs/run/jsx_import_source_error/jsx_import_source_error.out similarity index 100% rename from tests/testdata/run/jsx_import_source_error.out rename to tests/specs/run/jsx_import_source_error/jsx_import_source_error.out diff --git a/tests/specs/run/jsx_import_source_error/jsx_import_source_no_pragma.tsx b/tests/specs/run/jsx_import_source_error/jsx_import_source_no_pragma.tsx new file mode 100644 index 0000000000..2c756054fb --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/jsx_import_source_no_pragma.tsx @@ -0,0 +1,7 @@ +function A() { + return "hello"; +} + +export function B() { + return ; +} diff --git a/tests/specs/run/jsx_import_source_import_map/__test__.jsonc b/tests/specs/run/jsx_import_source_import_map/__test__.jsonc new file mode 100644 index 0000000000..8a62c5243b --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-import-map.jsonc jsx_import_source_no_pragma.tsx", + "output": "jsx_import_source_import_map.out" +} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno.lock b/tests/specs/run/jsx_import_source_import_map/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_import_map/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/import-map.json b/tests/specs/run/jsx_import_source_import_map/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_import_map/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_import_map/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_import_map/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_import_map/jsx_import_source_import_map.out b/tests/specs/run/jsx_import_source_import_map/jsx_import_source_import_map.out new file mode 100644 index 0000000000..0d32389677 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/jsx_import_source_import_map.out @@ -0,0 +1,2 @@ +[WILDCARD] +imported http://localhost:4545/jsx/jsx-runtime/index.ts diff --git a/tests/specs/run/jsx_import_source_import_map/jsx_import_source_no_pragma.tsx b/tests/specs/run/jsx_import_source_import_map/jsx_import_source_no_pragma.tsx new file mode 100644 index 0000000000..2c756054fb --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map/jsx_import_source_no_pragma.tsx @@ -0,0 +1,7 @@ +function A() { + return "hello"; +} + +export function B() { + return ; +} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/__test__.jsonc b/tests/specs/run/jsx_import_source_import_map_dev/__test__.jsonc new file mode 100644 index 0000000000..b62e7cb6f3 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsxdev-import-map.jsonc jsx_import_source_no_pragma.tsx", + "output": "jsx_import_source_import_map_dev.out" +} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno.lock b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_import_map_dev/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/import-map.json b/tests/specs/run/jsx_import_source_import_map_dev/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx_import_source_import_map_dev.out b/tests/specs/run/jsx_import_source_import_map_dev/jsx_import_source_import_map_dev.out new file mode 100644 index 0000000000..56f514d90c --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/jsx_import_source_import_map_dev.out @@ -0,0 +1,2 @@ +[WILDCARD] +imported http://localhost:4545/jsx/jsx-dev-runtime/index.ts diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx_import_source_no_pragma.tsx b/tests/specs/run/jsx_import_source_import_map_dev/jsx_import_source_no_pragma.tsx new file mode 100644 index 0000000000..2c756054fb --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_dev/jsx_import_source_no_pragma.tsx @@ -0,0 +1,7 @@ +function A() { + return "hello"; +} + +export function B() { + return ; +} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/__test__.jsonc b/tests/specs/run/jsx_import_source_import_map_no_check/__test__.jsonc new file mode 100644 index 0000000000..ea42654848 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-import-map.jsonc --no-check jsx_import_source_no_pragma.tsx", + "output": "jsx_import_source_import_map.out" +} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno.lock b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/import-map.json b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx_import_source_import_map.out b/tests/specs/run/jsx_import_source_import_map_no_check/jsx_import_source_import_map.out new file mode 100644 index 0000000000..0d32389677 --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/jsx_import_source_import_map.out @@ -0,0 +1,2 @@ +[WILDCARD] +imported http://localhost:4545/jsx/jsx-runtime/index.ts diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx_import_source_no_pragma.tsx b/tests/specs/run/jsx_import_source_import_map_no_check/jsx_import_source_no_pragma.tsx new file mode 100644 index 0000000000..2c756054fb --- /dev/null +++ b/tests/specs/run/jsx_import_source_import_map_no_check/jsx_import_source_no_pragma.tsx @@ -0,0 +1,7 @@ +function A() { + return "hello"; +} + +export function B() { + return ; +} diff --git a/tests/specs/run/jsx_import_source_no_pragma/__test__.jsonc b/tests/specs/run/jsx_import_source_no_pragma/__test__.jsonc new file mode 100644 index 0000000000..7678e18f46 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock jsx_import_source_no_pragma.tsx", + "output": "jsx_import_source.out" +} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno.lock b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_no_pragma/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/import-map.json b/tests/specs/run/jsx_import_source_no_pragma/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/testdata/run/jsx_import_source.out b/tests/specs/run/jsx_import_source_no_pragma/jsx_import_source.out similarity index 100% rename from tests/testdata/run/jsx_import_source.out rename to tests/specs/run/jsx_import_source_no_pragma/jsx_import_source.out diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx_import_source_no_pragma.tsx b/tests/specs/run/jsx_import_source_no_pragma/jsx_import_source_no_pragma.tsx new file mode 100644 index 0000000000..2c756054fb --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/jsx_import_source_no_pragma.tsx @@ -0,0 +1,7 @@ +function A() { + return "hello"; +} + +export function B() { + return ; +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/__test__.jsonc b/tests/specs/run/jsx_import_source_no_pragma_dev/__test__.jsonc new file mode 100644 index 0000000000..8f9ee81f69 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --config jsx/deno-jsxdev.jsonc --no-lock jsx_import_source_no_pragma.tsx", + "output": "jsx_import_source_dev.out" +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno.lock b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/import-map.json b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/testdata/run/jsx_import_source_dev.out b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx_import_source_dev.out similarity index 100% rename from tests/testdata/run/jsx_import_source_dev.out rename to tests/specs/run/jsx_import_source_no_pragma_dev/jsx_import_source_dev.out diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx_import_source_no_pragma.tsx b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx_import_source_no_pragma.tsx new file mode 100644 index 0000000000..2c756054fb --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx_import_source_no_pragma.tsx @@ -0,0 +1,7 @@ +function A() { + return "hello"; +} + +export function B() { + return ; +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/__test__.jsonc b/tests/specs/run/jsx_import_source_no_pragma_no_check/__test__.jsonc new file mode 100644 index 0000000000..12cc9b0764 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --no-check jsx_import_source_no_pragma.tsx", + "output": "jsx_import_source.out" +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno.lock b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/import-map.json b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx_import_source.out b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx_import_source.out new file mode 100644 index 0000000000..b9555987a6 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx_import_source.out @@ -0,0 +1,2 @@ +[WILDCARD] +imported http://localhost:4545/jsx/jsx-runtime diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx_import_source_no_pragma.tsx b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx_import_source_no_pragma.tsx new file mode 100644 index 0000000000..2c756054fb --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx_import_source_no_pragma.tsx @@ -0,0 +1,7 @@ +function A() { + return "hello"; +} + +export function B() { + return ; +} diff --git a/tests/specs/run/jsx_import_source_pragma/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma/__test__.jsonc new file mode 100644 index 0000000000..9d704c0650 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --allow-import jsx_import_source_pragma.tsx", + "output": "jsx_import_source.out" +} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma/jsx_import_source.out b/tests/specs/run/jsx_import_source_pragma/jsx_import_source.out new file mode 100644 index 0000000000..b9555987a6 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/jsx_import_source.out @@ -0,0 +1,2 @@ +[WILDCARD] +imported http://localhost:4545/jsx/jsx-runtime diff --git a/tests/testdata/run/jsx_import_source_pragma.tsx b/tests/specs/run/jsx_import_source_pragma/jsx_import_source_pragma.tsx similarity index 100% rename from tests/testdata/run/jsx_import_source_pragma.tsx rename to tests/specs/run/jsx_import_source_pragma/jsx_import_source_pragma.tsx diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/__test__.jsonc new file mode 100644 index 0000000000..9eafe51968 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --import-map jsx/import-map.json jsx_import_source_pragma_import_map.tsx", + "output": "jsx_import_source_import_map.out" +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx_import_source_import_map.out b/tests/specs/run/jsx_import_source_pragma_import_map/jsx_import_source_import_map.out new file mode 100644 index 0000000000..0d32389677 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/jsx_import_source_import_map.out @@ -0,0 +1,2 @@ +[WILDCARD] +imported http://localhost:4545/jsx/jsx-runtime/index.ts diff --git a/tests/testdata/run/jsx_import_source_pragma_import_map.tsx b/tests/specs/run/jsx_import_source_pragma_import_map/jsx_import_source_pragma_import_map.tsx similarity index 100% rename from tests/testdata/run/jsx_import_source_pragma_import_map.tsx rename to tests/specs/run/jsx_import_source_pragma_import_map/jsx_import_source_pragma_import_map.tsx diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/__test__.jsonc new file mode 100644 index 0000000000..bb271c0eef --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --import-map jsx/import-map.json --config jsx/deno-jsxdev-import-map.jsonc jsx_import_source_pragma_import_map.tsx", + "output": "jsx_import_source_import_map_dev.out" +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx_import_source_import_map_dev.out b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx_import_source_import_map_dev.out new file mode 100644 index 0000000000..56f514d90c --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx_import_source_import_map_dev.out @@ -0,0 +1,2 @@ +[WILDCARD] +imported http://localhost:4545/jsx/jsx-dev-runtime/index.ts diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx_import_source_pragma_import_map.tsx b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx_import_source_pragma_import_map.tsx new file mode 100644 index 0000000000..548365f182 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx_import_source_pragma_import_map.tsx @@ -0,0 +1,9 @@ +/** @jsxImportSource jsx */ + +function A() { + return "hello"; +} + +export function B() { + return ; +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/__test__.jsonc new file mode 100644 index 0000000000..dd42b71fda --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --import-map jsx/import-map.json --no-check jsx_import_source_pragma_import_map.tsx", + "output": "jsx_import_source_import_map.out" +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx_import_source_import_map.out b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx_import_source_import_map.out new file mode 100644 index 0000000000..0d32389677 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx_import_source_import_map.out @@ -0,0 +1,2 @@ +[WILDCARD] +imported http://localhost:4545/jsx/jsx-runtime/index.ts diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx_import_source_pragma_import_map.tsx b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx_import_source_pragma_import_map.tsx new file mode 100644 index 0000000000..548365f182 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx_import_source_pragma_import_map.tsx @@ -0,0 +1,9 @@ +/** @jsxImportSource jsx */ + +function A() { + return "hello"; +} + +export function B() { + return ; +} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_no_check/__test__.jsonc new file mode 100644 index 0000000000..0956b94a76 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --no-check jsx_import_source_pragma.tsx", + "output": "jsx_import_source.out" +} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx_import_source.out b/tests/specs/run/jsx_import_source_pragma_no_check/jsx_import_source.out new file mode 100644 index 0000000000..b9555987a6 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/jsx_import_source.out @@ -0,0 +1,2 @@ +[WILDCARD] +imported http://localhost:4545/jsx/jsx-runtime diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx_import_source_pragma.tsx b/tests/specs/run/jsx_import_source_pragma_no_check/jsx_import_source_pragma.tsx new file mode 100644 index 0000000000..c19e53d4ff --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_no_check/jsx_import_source_pragma.tsx @@ -0,0 +1,9 @@ +/** @jsxImportSource http://localhost:4545/jsx */ + +function A() { + return "hello"; +} + +export function B() { + return ; +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config/__test__.jsonc new file mode 100644 index 0000000000..aeaf209c3a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --allow-import --config jsx/deno-jsx.jsonc --no-lock jsx_import_source_pragma.tsx", + "output": "jsx_import_source.out" +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx_import_source.out b/tests/specs/run/jsx_import_source_pragma_with_config/jsx_import_source.out new file mode 100644 index 0000000000..b9555987a6 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/jsx_import_source.out @@ -0,0 +1,2 @@ +[WILDCARD] +imported http://localhost:4545/jsx/jsx-runtime diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx_import_source_pragma.tsx b/tests/specs/run/jsx_import_source_pragma_with_config/jsx_import_source_pragma.tsx new file mode 100644 index 0000000000..c19e53d4ff --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config/jsx_import_source_pragma.tsx @@ -0,0 +1,9 @@ +/** @jsxImportSource http://localhost:4545/jsx */ + +function A() { + return "hello"; +} + +export function B() { + return ; +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/__test__.jsonc new file mode 100644 index 0000000000..3e8089fd2c --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --no-check jsx_import_source_pragma.tsx", + "output": "jsx_import_source.out" +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx_import_source.out b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx_import_source.out new file mode 100644 index 0000000000..b9555987a6 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx_import_source.out @@ -0,0 +1,2 @@ +[WILDCARD] +imported http://localhost:4545/jsx/jsx-runtime diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx_import_source_pragma.tsx b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx_import_source_pragma.tsx new file mode 100644 index 0000000000..c19e53d4ff --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx_import_source_pragma.tsx @@ -0,0 +1,9 @@ +/** @jsxImportSource http://localhost:4545/jsx */ + +function A() { + return "hello"; +} + +export function B() { + return ; +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/__test__.jsonc new file mode 100644 index 0000000000..03ed1af1b6 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --vendor jsx_import_source_pragma.tsx", + "output": "jsx_import_source.out" +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/vendor/http_localhost_4545/jsx/#jsx-runtime_62ac8.js b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/vendor/http_localhost_4545/jsx/#jsx-runtime_62ac8.js new file mode 100644 index 0000000000..c8f0a908db --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/vendor/http_localhost_4545/jsx/#jsx-runtime_62ac8.js @@ -0,0 +1,11 @@ +export function jsx( + _type, + _props, + _key, + _source, + _self, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/vendor/manifest.json b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/vendor/manifest.json new file mode 100644 index 0000000000..a770c33669 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/vendor/manifest.json @@ -0,0 +1,9 @@ +{ + "modules": { + "http://localhost:4545/jsx/jsx-runtime": { + "headers": { + "content-type": "application/javascript" + } + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx_import_source.out b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx_import_source.out new file mode 100644 index 0000000000..b9555987a6 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx_import_source.out @@ -0,0 +1,2 @@ +[WILDCARD] +imported http://localhost:4545/jsx/jsx-runtime diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx_import_source_pragma.tsx b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx_import_source_pragma.tsx new file mode 100644 index 0000000000..c19e53d4ff --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx_import_source_pragma.tsx @@ -0,0 +1,9 @@ +/** @jsxImportSource http://localhost:4545/jsx */ + +function A() { + return "hello"; +} + +export function B() { + return ; +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_with_dev_config/__test__.jsonc new file mode 100644 index 0000000000..56734e4678 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --allow-import --config jsx/deno-jsxdev.jsonc --no-lock jsx_import_source_pragma.tsx", + "output": "jsx_import_source_dev.out" +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx_import_source_dev.out b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx_import_source_dev.out new file mode 100644 index 0000000000..38d7a12f05 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx_import_source_dev.out @@ -0,0 +1,2 @@ +[WILDCARD] +imported http://localhost:4545/jsx/jsx-dev-runtime diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx_import_source_pragma.tsx b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx_import_source_pragma.tsx new file mode 100644 index 0000000000..c19e53d4ff --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx_import_source_pragma.tsx @@ -0,0 +1,9 @@ +/** @jsxImportSource http://localhost:4545/jsx */ + +function A() { + return "hello"; +} + +export function B() { + return ; +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/__test__.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map/__test__.jsonc new file mode 100644 index 0000000000..c795a9d8e6 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --check --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-precompile.jsonc jsx_precompile/no_pragma.tsx", + "output": "jsx_precompile/no_pragma.out" +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno.lock b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/import-map.json b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/testdata/run/jsx_precompile/no_pragma.out b/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/no_pragma.out similarity index 67% rename from tests/testdata/run/jsx_precompile/no_pragma.out rename to tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/no_pragma.out index 4379959230..f26984258c 100644 --- a/tests/testdata/run/jsx_precompile/no_pragma.out +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/no_pragma.out @@ -1,3 +1,3 @@ Download http://localhost:4545/jsx/jsx-precompile/index.ts -Check file:///[WILDCARD]/run/jsx_precompile/no_pragma.tsx +Check file:///[WILDCARD]/jsx_precompile/no_pragma.tsx imported http://localhost:4545/jsx/jsx-precompile/index.ts diff --git a/tests/testdata/run/jsx_precompile/no_pragma.tsx b/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/no_pragma.tsx similarity index 100% rename from tests/testdata/run/jsx_precompile/no_pragma.tsx rename to tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/no_pragma.tsx diff --git a/tests/testdata/run/jsx_precompile/skip.out b/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/skip.out similarity index 100% rename from tests/testdata/run/jsx_precompile/skip.out rename to tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/skip.out diff --git a/tests/testdata/run/jsx_precompile/skip.tsx b/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/skip.tsx similarity index 100% rename from tests/testdata/run/jsx_precompile/skip.tsx rename to tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/skip.tsx diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/__test__.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/__test__.jsonc new file mode 100644 index 0000000000..7163c83d00 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --check --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-precompile-skip.jsonc jsx_precompile/skip.tsx", + "output": "jsx_precompile/skip.out" +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-error.jsonc new file mode 100644 index 0000000000..37cb4dd912 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-import-map.jsonc new file mode 100644 index 0000000000..5adbfa8b5a --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-precompile-skip.jsonc new file mode 100644 index 0000000000..3c9e4fa1f8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-precompile-skip.jsonc @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile", + "jsxPrecompileSkipElements": ["a", "img"] + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-precompile.jsonc new file mode 100644 index 0000000000..95ae1b9f31 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-precompile.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "precompile", + "jsxImportSource": "jsx-precompile" + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx.json new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx.jsonc new file mode 100644 index 0000000000..311409ea37 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsxdev-import-map.jsonc new file mode 100644 index 0000000000..7481d5a2d8 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsxdev-import-map.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsxdev.jsonc new file mode 100644 index 0000000000..ae5bdf9f16 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsxdev.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsxdev", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno.lock b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno.lock new file mode 100644 index 0000000000..011e8fe108 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" + } +} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/import-map-scoped.json new file mode 100644 index 0000000000..9b2005128f --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/import-map-scoped.json @@ -0,0 +1,8 @@ +{ + "scopes": { + "../subdir/": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" + } + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/import-map.json b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/import-map.json new file mode 100644 index 0000000000..1bfa04e2f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/import-map.json @@ -0,0 +1,7 @@ +{ + "imports": { + "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", + "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", + "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-dev-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-dev-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-precompile/index.ts new file mode 100644 index 0000000000..0d56095e0b --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-precompile/index.ts @@ -0,0 +1,23 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +// deno-lint-ignore-file no-explicit-any +export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; +// deno-lint-ignore-file no-explicit-any +export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; +// deno-lint-ignore-file no-explicit-any +export const jsxEscape = (_value: any) => ""; +console.log("imported", import.meta.url); + +declare global { + namespace JSX { + interface IntrinsicElements { + [tagName: string]: Record; + } + } +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-runtime/index.ts new file mode 100644 index 0000000000..15e2029c8a --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-runtime/index.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file no-explicit-any +export function jsx( + _type: any, + _props: any, + _key: any, + _source: any, + _self: any, +) {} +export const jsxs = jsx; +export const jsxDEV = jsx; +export const Fragment = Symbol("Fragment"); +console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/no_pragma.out b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/no_pragma.out new file mode 100644 index 0000000000..f26984258c --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/no_pragma.out @@ -0,0 +1,3 @@ +Download http://localhost:4545/jsx/jsx-precompile/index.ts +Check file:///[WILDCARD]/jsx_precompile/no_pragma.tsx +imported http://localhost:4545/jsx/jsx-precompile/index.ts diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/no_pragma.tsx b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/no_pragma.tsx new file mode 100644 index 0000000000..7ba21d80d2 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/no_pragma.tsx @@ -0,0 +1,3 @@ +export function A() { + return

hello

; +} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/skip.out b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/skip.out new file mode 100644 index 0000000000..6696c550ca --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/skip.out @@ -0,0 +1,3 @@ +Download http://localhost:4545/jsx/jsx-precompile/index.ts +Check file:///[WILDCARD]/jsx_precompile/skip.tsx +imported http://localhost:4545/jsx/jsx-precompile/index.ts diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/skip.tsx b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/skip.tsx new file mode 100644 index 0000000000..49bc4e2b7a --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/skip.tsx @@ -0,0 +1,9 @@ +export function A() { + return ( +
+ foo +

hello

+ +
+ ); +} diff --git a/tests/specs/run/lock_check_ok/003_relative_import.ts b/tests/specs/run/lock_check_ok/003_relative_import.ts new file mode 100644 index 0000000000..d392f4a5d1 --- /dev/null +++ b/tests/specs/run/lock_check_ok/003_relative_import.ts @@ -0,0 +1,3 @@ +import { printHello } from "./print_hello.ts"; + +printHello(); diff --git a/tests/specs/run/lock_check_ok/003_relative_import.ts.out b/tests/specs/run/lock_check_ok/003_relative_import.ts.out new file mode 100644 index 0000000000..e965047ad7 --- /dev/null +++ b/tests/specs/run/lock_check_ok/003_relative_import.ts.out @@ -0,0 +1 @@ +Hello diff --git a/tests/specs/run/lock_check_ok/__test__.jsonc b/tests/specs/run/lock_check_ok/__test__.jsonc new file mode 100644 index 0000000000..e8ce4572e4 --- /dev/null +++ b/tests/specs/run/lock_check_ok/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --allow-import --lock=lock_check_ok.json 003_relative_import.ts", + "output": "003_relative_import.ts.out" +} diff --git a/tests/specs/run/lock_check_ok/lock_check_ok.json b/tests/specs/run/lock_check_ok/lock_check_ok.json new file mode 100644 index 0000000000..20f7e20005 --- /dev/null +++ b/tests/specs/run/lock_check_ok/lock_check_ok.json @@ -0,0 +1,4 @@ +{ + "http://127.0.0.1:4545/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", + "http://127.0.0.1:4545/003_relative_import.ts": "a1572e8fd2c2712b33f04aed2561505b5feb2c8696f1f2cded3de7127931b97e" +} diff --git a/tests/specs/run/lock_check_ok/print_hello.ts b/tests/specs/run/lock_check_ok/print_hello.ts new file mode 100644 index 0000000000..b9c0ad5275 --- /dev/null +++ b/tests/specs/run/lock_check_ok/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/specs/run/lock_check_ok2/019_media_types.ts b/tests/specs/run/lock_check_ok2/019_media_types.ts new file mode 100644 index 0000000000..d985bd2496 --- /dev/null +++ b/tests/specs/run/lock_check_ok2/019_media_types.ts @@ -0,0 +1,24 @@ +// When run against the test HTTP server, it will serve different media types +// based on the URL containing `.t#.` strings, which exercises the different +// mapping of media types end to end. + +import { loaded as loadedTs1 } from "http://localhost:4545/subdir/mt_text_typescript.t1.ts"; +import { loaded as loadedTs2 } from "http://localhost:4545/subdir/mt_video_vdn.t2.ts"; +import { loaded as loadedTs3 } from "http://localhost:4545/subdir/mt_video_mp2t.t3.ts"; +import { loaded as loadedTs4 } from "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts"; +import { loaded as loadedJs1 } from "http://localhost:4545/subdir/mt_text_javascript.j1.js"; +import { loaded as loadedJs2 } from "http://localhost:4545/subdir/mt_application_ecmascript.j2.js"; +import { loaded as loadedJs3 } from "http://localhost:4545/subdir/mt_text_ecmascript.j3.js"; +import { loaded as loadedJs4 } from "http://localhost:4545/subdir/mt_application_x_javascript.j4.js"; + +console.log( + "success", + loadedTs1, + loadedTs2, + loadedTs3, + loadedTs4, + loadedJs1, + loadedJs2, + loadedJs3, + loadedJs4, +); diff --git a/tests/specs/run/lock_check_ok2/019_media_types.ts.out b/tests/specs/run/lock_check_ok2/019_media_types.ts.out new file mode 100644 index 0000000000..b3e94678c5 --- /dev/null +++ b/tests/specs/run/lock_check_ok2/019_media_types.ts.out @@ -0,0 +1 @@ +[WILDCARD]success true true true true true true true true diff --git a/tests/specs/run/lock_check_ok2/__test__.jsonc b/tests/specs/run/lock_check_ok2/__test__.jsonc new file mode 100644 index 0000000000..dc790528a2 --- /dev/null +++ b/tests/specs/run/lock_check_ok2/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --lock=lock_check_ok2.json 019_media_types.ts", + "output": "019_media_types.ts.out" +} diff --git a/tests/testdata/run/lock_check_ok2.json b/tests/specs/run/lock_check_ok2/lock_check_ok2.json similarity index 100% rename from tests/testdata/run/lock_check_ok2.json rename to tests/specs/run/lock_check_ok2/lock_check_ok2.json diff --git a/tests/specs/run/lock_v2_check_ok/003_relative_import.ts b/tests/specs/run/lock_v2_check_ok/003_relative_import.ts new file mode 100644 index 0000000000..d392f4a5d1 --- /dev/null +++ b/tests/specs/run/lock_v2_check_ok/003_relative_import.ts @@ -0,0 +1,3 @@ +import { printHello } from "./print_hello.ts"; + +printHello(); diff --git a/tests/specs/run/lock_v2_check_ok/003_relative_import.ts.out b/tests/specs/run/lock_v2_check_ok/003_relative_import.ts.out new file mode 100644 index 0000000000..e965047ad7 --- /dev/null +++ b/tests/specs/run/lock_v2_check_ok/003_relative_import.ts.out @@ -0,0 +1 @@ +Hello diff --git a/tests/specs/run/lock_v2_check_ok/__test__.jsonc b/tests/specs/run/lock_v2_check_ok/__test__.jsonc new file mode 100644 index 0000000000..d7b819d569 --- /dev/null +++ b/tests/specs/run/lock_v2_check_ok/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --quiet --lock=lock_v2_check_ok.json 003_relative_import.ts", + "output": "003_relative_import.ts.out" +} diff --git a/tests/specs/run/lock_v2_check_ok/lock_v2_check_ok.json b/tests/specs/run/lock_v2_check_ok/lock_v2_check_ok.json new file mode 100644 index 0000000000..47a761fbdb --- /dev/null +++ b/tests/specs/run/lock_v2_check_ok/lock_v2_check_ok.json @@ -0,0 +1,7 @@ +{ + "version": "2", + "remote": { + "http://127.0.0.1:4545/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", + "http://127.0.0.1:4545/003_relative_import.ts": "a1572e8fd2c2712b33f04aed2561505b5feb2c8696f1f2cded3de7127931b97e" + } +} diff --git a/tests/specs/run/lock_v2_check_ok/print_hello.ts b/tests/specs/run/lock_v2_check_ok/print_hello.ts new file mode 100644 index 0000000000..b9c0ad5275 --- /dev/null +++ b/tests/specs/run/lock_v2_check_ok/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/specs/run/lock_v2_check_ok2/019_media_types.ts b/tests/specs/run/lock_v2_check_ok2/019_media_types.ts new file mode 100644 index 0000000000..d985bd2496 --- /dev/null +++ b/tests/specs/run/lock_v2_check_ok2/019_media_types.ts @@ -0,0 +1,24 @@ +// When run against the test HTTP server, it will serve different media types +// based on the URL containing `.t#.` strings, which exercises the different +// mapping of media types end to end. + +import { loaded as loadedTs1 } from "http://localhost:4545/subdir/mt_text_typescript.t1.ts"; +import { loaded as loadedTs2 } from "http://localhost:4545/subdir/mt_video_vdn.t2.ts"; +import { loaded as loadedTs3 } from "http://localhost:4545/subdir/mt_video_mp2t.t3.ts"; +import { loaded as loadedTs4 } from "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts"; +import { loaded as loadedJs1 } from "http://localhost:4545/subdir/mt_text_javascript.j1.js"; +import { loaded as loadedJs2 } from "http://localhost:4545/subdir/mt_application_ecmascript.j2.js"; +import { loaded as loadedJs3 } from "http://localhost:4545/subdir/mt_text_ecmascript.j3.js"; +import { loaded as loadedJs4 } from "http://localhost:4545/subdir/mt_application_x_javascript.j4.js"; + +console.log( + "success", + loadedTs1, + loadedTs2, + loadedTs3, + loadedTs4, + loadedJs1, + loadedJs2, + loadedJs3, + loadedJs4, +); diff --git a/tests/specs/run/lock_v2_check_ok2/019_media_types.ts.out b/tests/specs/run/lock_v2_check_ok2/019_media_types.ts.out new file mode 100644 index 0000000000..b3e94678c5 --- /dev/null +++ b/tests/specs/run/lock_v2_check_ok2/019_media_types.ts.out @@ -0,0 +1 @@ +[WILDCARD]success true true true true true true true true diff --git a/tests/specs/run/lock_v2_check_ok2/__test__.jsonc b/tests/specs/run/lock_v2_check_ok2/__test__.jsonc new file mode 100644 index 0000000000..a9430b4bcd --- /dev/null +++ b/tests/specs/run/lock_v2_check_ok2/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --lock=lock_v2_check_ok2.json 019_media_types.ts", + "output": "019_media_types.ts.out" +} diff --git a/tests/testdata/run/lock_v2_check_ok2.json b/tests/specs/run/lock_v2_check_ok2/lock_v2_check_ok2.json similarity index 100% rename from tests/testdata/run/lock_v2_check_ok2.json rename to tests/specs/run/lock_v2_check_ok2/lock_v2_check_ok2.json diff --git a/tests/specs/run/long_data_url_formatting/__test__.jsonc b/tests/specs/run/long_data_url_formatting/__test__.jsonc new file mode 100644 index 0000000000..f7ae56c635 --- /dev/null +++ b/tests/specs/run/long_data_url_formatting/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run long_data_url_formatting.ts", + "output": "long_data_url_formatting.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/long_data_url_formatting.ts b/tests/specs/run/long_data_url_formatting/long_data_url_formatting.ts similarity index 100% rename from tests/testdata/run/long_data_url_formatting.ts rename to tests/specs/run/long_data_url_formatting/long_data_url_formatting.ts diff --git a/tests/testdata/run/long_data_url_formatting.ts.out b/tests/specs/run/long_data_url_formatting/long_data_url_formatting.ts.out similarity index 100% rename from tests/testdata/run/long_data_url_formatting.ts.out rename to tests/specs/run/long_data_url_formatting/long_data_url_formatting.ts.out diff --git a/tests/specs/run/main_module/__test__.jsonc b/tests/specs/run/main_module/__test__.jsonc new file mode 100644 index 0000000000..0d70eddbd9 --- /dev/null +++ b/tests/specs/run/main_module/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload main_module/main.ts", + "output": "main_module/main.out" +} diff --git a/tests/testdata/run/main_module/main.out b/tests/specs/run/main_module/main_module/main.out similarity index 100% rename from tests/testdata/run/main_module/main.out rename to tests/specs/run/main_module/main_module/main.out diff --git a/tests/testdata/run/main_module/main.ts b/tests/specs/run/main_module/main_module/main.ts similarity index 100% rename from tests/testdata/run/main_module/main.ts rename to tests/specs/run/main_module/main_module/main.ts diff --git a/tests/testdata/run/main_module/other.ts b/tests/specs/run/main_module/main_module/other.ts similarity index 100% rename from tests/testdata/run/main_module/other.ts rename to tests/specs/run/main_module/main_module/other.ts diff --git a/tests/specs/run/mts_dmts_mjs/__test__.jsonc b/tests/specs/run/mts_dmts_mjs/__test__.jsonc new file mode 100644 index 0000000000..b50bb4b19b --- /dev/null +++ b/tests/specs/run/mts_dmts_mjs/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run import.mts", + "output": "mts_dmts_mjs.out" +} diff --git a/tests/specs/run/mts_dmts_mjs/import.mts b/tests/specs/run/mts_dmts_mjs/import.mts new file mode 100644 index 0000000000..eeb200f598 --- /dev/null +++ b/tests/specs/run/mts_dmts_mjs/import.mts @@ -0,0 +1,4 @@ +import * as a from "./mod.mjs"; +import { type A } from "./types.d.mts"; + +console.log(a.a as A); diff --git a/tests/specs/run/mts_dmts_mjs/mod.mjs b/tests/specs/run/mts_dmts_mjs/mod.mjs new file mode 100644 index 0000000000..9233cce2f0 --- /dev/null +++ b/tests/specs/run/mts_dmts_mjs/mod.mjs @@ -0,0 +1 @@ +export const a = "a"; diff --git a/tests/testdata/run/mts_dmts_mjs.out b/tests/specs/run/mts_dmts_mjs/mts_dmts_mjs.out similarity index 100% rename from tests/testdata/run/mts_dmts_mjs.out rename to tests/specs/run/mts_dmts_mjs/mts_dmts_mjs.out diff --git a/tests/specs/run/mts_dmts_mjs/types.d.mts b/tests/specs/run/mts_dmts_mjs/types.d.mts new file mode 100644 index 0000000000..28c2821466 --- /dev/null +++ b/tests/specs/run/mts_dmts_mjs/types.d.mts @@ -0,0 +1 @@ +export type A = "a"; diff --git a/tests/specs/run/mts_dmts_mjs_no_check/__test__.jsonc b/tests/specs/run/mts_dmts_mjs_no_check/__test__.jsonc new file mode 100644 index 0000000000..0d36517bc1 --- /dev/null +++ b/tests/specs/run/mts_dmts_mjs_no_check/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --no-check import.mts", + "output": "mts_dmts_mjs.out" +} diff --git a/tests/specs/run/mts_dmts_mjs_no_check/import.mts b/tests/specs/run/mts_dmts_mjs_no_check/import.mts new file mode 100644 index 0000000000..eeb200f598 --- /dev/null +++ b/tests/specs/run/mts_dmts_mjs_no_check/import.mts @@ -0,0 +1,4 @@ +import * as a from "./mod.mjs"; +import { type A } from "./types.d.mts"; + +console.log(a.a as A); diff --git a/tests/specs/run/mts_dmts_mjs_no_check/mod.mjs b/tests/specs/run/mts_dmts_mjs_no_check/mod.mjs new file mode 100644 index 0000000000..9233cce2f0 --- /dev/null +++ b/tests/specs/run/mts_dmts_mjs_no_check/mod.mjs @@ -0,0 +1 @@ +export const a = "a"; diff --git a/tests/specs/run/mts_dmts_mjs_no_check/mts_dmts_mjs.out b/tests/specs/run/mts_dmts_mjs_no_check/mts_dmts_mjs.out new file mode 100644 index 0000000000..7898192261 --- /dev/null +++ b/tests/specs/run/mts_dmts_mjs_no_check/mts_dmts_mjs.out @@ -0,0 +1 @@ +a diff --git a/tests/specs/run/mts_dmts_mjs_no_check/types.d.mts b/tests/specs/run/mts_dmts_mjs_no_check/types.d.mts new file mode 100644 index 0000000000..28c2821466 --- /dev/null +++ b/tests/specs/run/mts_dmts_mjs_no_check/types.d.mts @@ -0,0 +1 @@ +export type A = "a"; diff --git a/tests/specs/run/nested_error/__test__.jsonc b/tests/specs/run/nested_error/__test__.jsonc new file mode 100644 index 0000000000..d167832bae --- /dev/null +++ b/tests/specs/run/nested_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run nested_error/main.ts", + "output": "nested_error/main.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/nested_error/main.ts b/tests/specs/run/nested_error/nested_error/main.ts similarity index 100% rename from tests/testdata/run/nested_error/main.ts rename to tests/specs/run/nested_error/nested_error/main.ts diff --git a/tests/testdata/run/nested_error/main.ts.out b/tests/specs/run/nested_error/nested_error/main.ts.out similarity index 100% rename from tests/testdata/run/nested_error/main.ts.out rename to tests/specs/run/nested_error/nested_error/main.ts.out diff --git a/tests/specs/run/no_check/006_url_imports.ts b/tests/specs/run/no_check/006_url_imports.ts new file mode 100644 index 0000000000..ad2d259156 --- /dev/null +++ b/tests/specs/run/no_check/006_url_imports.ts @@ -0,0 +1,3 @@ +import { printHello } from "./mod2.ts"; +printHello(); +console.log("success"); diff --git a/tests/specs/run/no_check/006_url_imports.ts.out b/tests/specs/run/no_check/006_url_imports.ts.out new file mode 100644 index 0000000000..989ce33e93 --- /dev/null +++ b/tests/specs/run/no_check/006_url_imports.ts.out @@ -0,0 +1,2 @@ +Hello +success diff --git a/tests/specs/run/no_check/__test__.jsonc b/tests/specs/run/no_check/__test__.jsonc new file mode 100644 index 0000000000..696e08e2ad --- /dev/null +++ b/tests/specs/run/no_check/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --quiet --reload --no-check 006_url_imports.ts", + "output": "006_url_imports.ts.out" +} diff --git a/tests/specs/run/no_check/mod2.ts b/tests/specs/run/no_check/mod2.ts new file mode 100644 index 0000000000..ce1adc0e81 --- /dev/null +++ b/tests/specs/run/no_check/mod2.ts @@ -0,0 +1 @@ +export { printHello } from "./print_hello.ts"; diff --git a/tests/specs/run/no_check/print_hello.ts b/tests/specs/run/no_check/print_hello.ts new file mode 100644 index 0000000000..b9c0ad5275 --- /dev/null +++ b/tests/specs/run/no_check/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/specs/run/no_check_decorators/__test__.jsonc b/tests/specs/run/no_check_decorators/__test__.jsonc new file mode 100644 index 0000000000..da50d30a05 --- /dev/null +++ b/tests/specs/run/no_check_decorators/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --no-check decorators/experimental/no_check/main.ts", + "output": "decorators/experimental/no_check/main.out" +} diff --git a/tests/specs/run/no_check_decorators/decorators/experimental/deno.json b/tests/specs/run/no_check_decorators/decorators/experimental/deno.json new file mode 100644 index 0000000000..504cd646e1 --- /dev/null +++ b/tests/specs/run/no_check_decorators/decorators/experimental/deno.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "experimentalDecorators": true + } +} diff --git a/tests/specs/run/no_check_decorators/decorators/experimental/no_check/main.out b/tests/specs/run/no_check_decorators/decorators/experimental/no_check/main.out new file mode 100644 index 0000000000..015f7076e8 --- /dev/null +++ b/tests/specs/run/no_check_decorators/decorators/experimental/no_check/main.out @@ -0,0 +1,3 @@ +a(): evaluated +a(): called +method diff --git a/tests/specs/run/no_check_decorators/decorators/experimental/no_check/main.ts b/tests/specs/run/no_check_decorators/decorators/experimental/no_check/main.ts new file mode 100644 index 0000000000..9f7ec550d5 --- /dev/null +++ b/tests/specs/run/no_check_decorators/decorators/experimental/no_check/main.ts @@ -0,0 +1,21 @@ +// deno-lint-ignore-file +function a() { + console.log("a(): evaluated"); + return ( + _target: any, + _propertyKey: string, + _descriptor: PropertyDescriptor, + ) => { + console.log("a(): called"); + }; +} + +class B { + @a() + method() { + console.log("method"); + } +} + +const b = new B(); +b.method(); diff --git a/tests/specs/run/no_check_decorators/decorators/experimental/runtime/main.out b/tests/specs/run/no_check_decorators/decorators/experimental/runtime/main.out new file mode 100644 index 0000000000..0fc1d4590e --- /dev/null +++ b/tests/specs/run/no_check_decorators/decorators/experimental/runtime/main.out @@ -0,0 +1,7 @@ +@A evaluated +@B evaluated +@B called +@A called +fn() called from @A +fn() called from @B +C.test() called diff --git a/tests/specs/run/no_check_decorators/decorators/experimental/runtime/main.ts b/tests/specs/run/no_check_decorators/decorators/experimental/runtime/main.ts new file mode 100644 index 0000000000..40a26bbd4d --- /dev/null +++ b/tests/specs/run/no_check_decorators/decorators/experimental/runtime/main.ts @@ -0,0 +1,42 @@ +// deno-lint-ignore-file +function a() { + console.log("@A evaluated"); + return function ( + target: any, + propertyKey: string, + descriptor: PropertyDescriptor, + ) { + console.log("@A called"); + const fn = descriptor.value; + descriptor.value = function () { + console.log("fn() called from @A"); + fn(); + }; + }; +} + +function b() { + console.log("@B evaluated"); + return function ( + target: any, + propertyKey: string, + descriptor: PropertyDescriptor, + ) { + console.log("@B called"); + const fn = descriptor.value; + descriptor.value = function () { + console.log("fn() called from @B"); + fn(); + }; + }; +} + +class C { + @a() + @b() + static test() { + console.log("C.test() called"); + } +} + +C.test(); diff --git a/tests/specs/run/no_check_decorators/decorators/experimental/ts/main.out b/tests/specs/run/no_check_decorators/decorators/experimental/ts/main.out new file mode 100644 index 0000000000..ea64fbaa63 --- /dev/null +++ b/tests/specs/run/no_check_decorators/decorators/experimental/ts/main.out @@ -0,0 +1,3 @@ +Warning experimentalDecorators compiler option is deprecated and may be removed at any time +Check [WILDCARD] +SomeClass { someField: "asdf" } diff --git a/tests/specs/run/no_check_decorators/decorators/experimental/ts/main.ts b/tests/specs/run/no_check_decorators/decorators/experimental/ts/main.ts new file mode 100644 index 0000000000..95fba6cd48 --- /dev/null +++ b/tests/specs/run/no_check_decorators/decorators/experimental/ts/main.ts @@ -0,0 +1,14 @@ +// deno-lint-ignore-file + +function Decorate() { + return function (constructor: any): any { + return class extends constructor { + protected someField: string = "asdf"; + }; + }; +} + +@Decorate() +class SomeClass {} + +console.log(new SomeClass()); diff --git a/tests/specs/run/no_check_decorators/decorators/tc39_proposal/main.out b/tests/specs/run/no_check_decorators/decorators/tc39_proposal/main.out new file mode 100644 index 0000000000..39394952e8 --- /dev/null +++ b/tests/specs/run/no_check_decorators/decorators/tc39_proposal/main.out @@ -0,0 +1,3 @@ +starting m with arguments 1 +C.m 1 +ending m diff --git a/tests/specs/run/no_check_decorators/decorators/tc39_proposal/main.ts b/tests/specs/run/no_check_decorators/decorators/tc39_proposal/main.ts new file mode 100644 index 0000000000..00c8a85025 --- /dev/null +++ b/tests/specs/run/no_check_decorators/decorators/tc39_proposal/main.ts @@ -0,0 +1,21 @@ +// deno-lint-ignore no-explicit-any +function logged(value: any, { kind, name }: { kind: string; name: string }) { + if (kind === "method") { + return function (...args: unknown[]) { + console.log(`starting ${name} with arguments ${args.join(", ")}`); + // @ts-ignore this has implicit any type + const ret = value.call(this, ...args); + console.log(`ending ${name}`); + return ret; + }; + } +} + +class C { + @logged + m(arg: number) { + console.log("C.m", arg); + } +} + +new C().m(1); diff --git a/tests/specs/run/no_config_auto_discovery_for_local_script/__test__.jsonc b/tests/specs/run/no_config_auto_discovery_for_local_script/__test__.jsonc new file mode 100644 index 0000000000..0a03dbc228 --- /dev/null +++ b/tests/specs/run/no_config_auto_discovery_for_local_script/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --no-config --check frontend_work.ts", + "output": "no_auto_discovery.out", + "exitCode": 1 +} diff --git a/tests/specs/run/no_config_auto_discovery_for_local_script/frontend_work.ts b/tests/specs/run/no_config_auto_discovery_for_local_script/frontend_work.ts new file mode 100644 index 0000000000..783af44e4c --- /dev/null +++ b/tests/specs/run/no_config_auto_discovery_for_local_script/frontend_work.ts @@ -0,0 +1,4 @@ +function _main() { + console.log(document); +} +console.log("ok"); diff --git a/tests/testdata/run/with_config/no_auto_discovery.out b/tests/specs/run/no_config_auto_discovery_for_local_script/no_auto_discovery.out similarity index 78% rename from tests/testdata/run/with_config/no_auto_discovery.out rename to tests/specs/run/no_config_auto_discovery_for_local_script/no_auto_discovery.out index 59339ebe5f..f45a1097c7 100644 --- a/tests/testdata/run/with_config/no_auto_discovery.out +++ b/tests/specs/run/no_config_auto_discovery_for_local_script/no_auto_discovery.out @@ -1,4 +1,4 @@ error: TS2584 [ERROR]: Cannot find name 'document'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'. console.log(document); ~~~~~~~~ - at [WILDCARD]run/with_config/frontend_work.ts:2:15 + at [WILDCARD]frontend_work.ts:2:15 diff --git a/tests/specs/run/no_lock_flag/__test__.jsonc b/tests/specs/run/no_lock_flag/__test__.jsonc new file mode 100644 index 0000000000..b8485c8459 --- /dev/null +++ b/tests/specs/run/no_lock_flag/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --allow-import --no-lock no_lock_flag/main.ts", + "output": "no_lock_flag/main.out", + "exitCode": 0 +} diff --git a/tests/testdata/run/no_lock_flag/deno.json b/tests/specs/run/no_lock_flag/no_lock_flag/deno.json similarity index 100% rename from tests/testdata/run/no_lock_flag/deno.json rename to tests/specs/run/no_lock_flag/no_lock_flag/deno.json diff --git a/tests/testdata/run/no_lock_flag/deno.lock b/tests/specs/run/no_lock_flag/no_lock_flag/deno.lock similarity index 100% rename from tests/testdata/run/no_lock_flag/deno.lock rename to tests/specs/run/no_lock_flag/no_lock_flag/deno.lock diff --git a/tests/testdata/run/no_lock_flag/main.out b/tests/specs/run/no_lock_flag/no_lock_flag/main.out similarity index 100% rename from tests/testdata/run/no_lock_flag/main.out rename to tests/specs/run/no_lock_flag/no_lock_flag/main.out diff --git a/tests/testdata/run/no_lock_flag/main.ts b/tests/specs/run/no_lock_flag/no_lock_flag/main.ts similarity index 100% rename from tests/testdata/run/no_lock_flag/main.ts rename to tests/specs/run/no_lock_flag/no_lock_flag/main.ts diff --git a/tests/specs/run/no_prompt_flag/__test__.jsonc b/tests/specs/run/no_prompt_flag/__test__.jsonc new file mode 100644 index 0000000000..2342a63e80 --- /dev/null +++ b/tests/specs/run/no_prompt_flag/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --no-prompt no_prompt.ts", + "output": "" +} diff --git a/tests/specs/run/no_prompt_flag/no_prompt.ts b/tests/specs/run/no_prompt_flag/no_prompt.ts new file mode 100644 index 0000000000..17d54b92c1 --- /dev/null +++ b/tests/specs/run/no_prompt_flag/no_prompt.ts @@ -0,0 +1,10 @@ +new Worker("data:,setTimeout(() => Deno.exit(2), 200)", { type: "module" }); + +try { + await new Deno.Command("ps", { + stdout: "inherit", + stderr: "inherit", + }).output(); +} catch { + Deno.exit(0); +} diff --git a/tests/specs/run/node_env_var_allowlist/__test__.jsonc b/tests/specs/run/node_env_var_allowlist/__test__.jsonc new file mode 100644 index 0000000000..055ac62e89 --- /dev/null +++ b/tests/specs/run/node_env_var_allowlist/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --no-prompt node_env_var_allowlist.ts", + "output": "node_env_var_allowlist.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/node_env_var_allowlist.ts b/tests/specs/run/node_env_var_allowlist/node_env_var_allowlist.ts similarity index 100% rename from tests/testdata/run/node_env_var_allowlist.ts rename to tests/specs/run/node_env_var_allowlist/node_env_var_allowlist.ts diff --git a/tests/testdata/run/node_env_var_allowlist.ts.out b/tests/specs/run/node_env_var_allowlist/node_env_var_allowlist.ts.out similarity index 100% rename from tests/testdata/run/node_env_var_allowlist.ts.out rename to tests/specs/run/node_env_var_allowlist/node_env_var_allowlist.ts.out diff --git a/tests/specs/run/onload/__test__.jsonc b/tests/specs/run/onload/__test__.jsonc new file mode 100644 index 0000000000..b17dc665d1 --- /dev/null +++ b/tests/specs/run/onload/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --config deno.json onload/main.ts", + "output": "onload/main.out" +} diff --git a/tests/specs/run/onload/deno.json b/tests/specs/run/onload/deno.json new file mode 100644 index 0000000000..105514e133 --- /dev/null +++ b/tests/specs/run/onload/deno.json @@ -0,0 +1,4 @@ +{ + "lock": false, + "importMap": "../../../../import_map.json" +} diff --git a/tests/testdata/run/onload/imported.ts b/tests/specs/run/onload/onload/imported.ts similarity index 100% rename from tests/testdata/run/onload/imported.ts rename to tests/specs/run/onload/onload/imported.ts diff --git a/tests/testdata/run/onload/main.out b/tests/specs/run/onload/onload/main.out similarity index 100% rename from tests/testdata/run/onload/main.out rename to tests/specs/run/onload/onload/main.out diff --git a/tests/testdata/run/onload/main.ts b/tests/specs/run/onload/onload/main.ts similarity index 100% rename from tests/testdata/run/onload/main.ts rename to tests/specs/run/onload/onload/main.ts diff --git a/tests/testdata/run/onload/nest_imported.ts b/tests/specs/run/onload/onload/nest_imported.ts similarity index 100% rename from tests/testdata/run/onload/nest_imported.ts rename to tests/specs/run/onload/onload/nest_imported.ts diff --git a/tests/specs/run/op_exit_op_set_exit_code_in_worker/__test__.jsonc b/tests/specs/run/op_exit_op_set_exit_code_in_worker/__test__.jsonc new file mode 100644 index 0000000000..664fcb5c15 --- /dev/null +++ b/tests/specs/run/op_exit_op_set_exit_code_in_worker/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --no-check --allow-read op_exit_op_set_exit_code_in_worker.ts", + "output": "", + "exitCode": 21 +} diff --git a/tests/testdata/run/op_exit_op_set_exit_code_in_worker.ts b/tests/specs/run/op_exit_op_set_exit_code_in_worker/op_exit_op_set_exit_code_in_worker.ts similarity index 100% rename from tests/testdata/run/op_exit_op_set_exit_code_in_worker.ts rename to tests/specs/run/op_exit_op_set_exit_code_in_worker/op_exit_op_set_exit_code_in_worker.ts diff --git a/tests/specs/run/op_exit_op_set_exit_code_in_worker/op_exit_op_set_exit_code_worker.js b/tests/specs/run/op_exit_op_set_exit_code_in_worker/op_exit_op_set_exit_code_worker.js new file mode 100644 index 0000000000..9b284c37df --- /dev/null +++ b/tests/specs/run/op_exit_op_set_exit_code_in_worker/op_exit_op_set_exit_code_worker.js @@ -0,0 +1,4 @@ +self.onmessage = () => { + Deno[Deno.internal].core.ops.op_set_exit_code(42); + Deno.exit(); +}; diff --git a/tests/specs/run/package_json_auto_discovered_for_local_script_arg_with_stop/__test__.jsonc b/tests/specs/run/package_json_auto_discovered_for_local_script_arg_with_stop/__test__.jsonc new file mode 100644 index 0000000000..ac66ccdf14 --- /dev/null +++ b/tests/specs/run/package_json_auto_discovered_for_local_script_arg_with_stop/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run -L debug main.ts", + "output": "main.out", + "exitCode": 1 +} diff --git a/tests/specs/run/package_json_auto_discovered_for_local_script_arg_with_stop/deno.json b/tests/specs/run/package_json_auto_discovered_for_local_script_arg_with_stop/deno.json new file mode 100644 index 0000000000..36e1765d1a --- /dev/null +++ b/tests/specs/run/package_json_auto_discovered_for_local_script_arg_with_stop/deno.json @@ -0,0 +1,5 @@ +{ + "tasks": { + "dev": "deno run main.ts" + } +} diff --git a/tests/specs/run/package_json_auto_discovered_for_local_script_arg_with_stop/main.out b/tests/specs/run/package_json_auto_discovered_for_local_script_arg_with_stop/main.out new file mode 100644 index 0000000000..5ab43ac470 --- /dev/null +++ b/tests/specs/run/package_json_auto_discovered_for_local_script_arg_with_stop/main.out @@ -0,0 +1,5 @@ +[WILDCARD]Config file found at '[WILDCARD]deno.json' +[WILDCARD] +error: Relative import path "chalk" not prefixed with / or ./ or ../ + hint: If you want to use a JSR or npm package, try running `deno add jsr:chalk` or `deno add npm:chalk` + at file:///[WILDCARD]/main.ts:3:19 diff --git a/tests/specs/run/package_json_auto_discovered_for_local_script_arg_with_stop/main.ts b/tests/specs/run/package_json_auto_discovered_for_local_script_arg_with_stop/main.ts new file mode 100644 index 0000000000..6016470a10 --- /dev/null +++ b/tests/specs/run/package_json_auto_discovered_for_local_script_arg_with_stop/main.ts @@ -0,0 +1,6 @@ +// This import should fail, because `package.json` is not discovered, as we're +// stopping the discovery when encountering `deno.json`. +import chalk from "chalk"; + +console.log("ok"); +console.log(chalk); diff --git a/tests/specs/run/permission_args/001_hello.js b/tests/specs/run/permission_args/001_hello.js new file mode 100644 index 0000000000..accefceba6 --- /dev/null +++ b/tests/specs/run/permission_args/001_hello.js @@ -0,0 +1 @@ +console.log("Hello World"); diff --git a/tests/specs/run/permission_args/__test__.jsonc b/tests/specs/run/permission_args/__test__.jsonc new file mode 100644 index 0000000000..2843ee3955 --- /dev/null +++ b/tests/specs/run/permission_args/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run 001_hello.js --allow-net", + "output": "permission_args.out" +} diff --git a/tests/testdata/run/permission_args.out b/tests/specs/run/permission_args/permission_args.out similarity index 100% rename from tests/testdata/run/permission_args.out rename to tests/specs/run/permission_args/permission_args.out diff --git a/tests/specs/run/permission_args_quiet/001_hello.js b/tests/specs/run/permission_args_quiet/001_hello.js new file mode 100644 index 0000000000..accefceba6 --- /dev/null +++ b/tests/specs/run/permission_args_quiet/001_hello.js @@ -0,0 +1 @@ +console.log("Hello World"); diff --git a/tests/specs/run/permission_args_quiet/001_hello.js.out b/tests/specs/run/permission_args_quiet/001_hello.js.out new file mode 100644 index 0000000000..557db03de9 --- /dev/null +++ b/tests/specs/run/permission_args_quiet/001_hello.js.out @@ -0,0 +1 @@ +Hello World diff --git a/tests/specs/run/permission_args_quiet/__test__.jsonc b/tests/specs/run/permission_args_quiet/__test__.jsonc new file mode 100644 index 0000000000..2b98b963e3 --- /dev/null +++ b/tests/specs/run/permission_args_quiet/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet 001_hello.js --allow-net", + "output": "001_hello.js.out" +} diff --git a/tests/specs/run/private_field_presence/__test__.jsonc b/tests/specs/run/private_field_presence/__test__.jsonc new file mode 100644 index 0000000000..982b882896 --- /dev/null +++ b/tests/specs/run/private_field_presence/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload private_field_presence.ts", + "output": "private_field_presence.ts.out" +} diff --git a/tests/testdata/run/private_field_presence.ts b/tests/specs/run/private_field_presence/private_field_presence.ts similarity index 100% rename from tests/testdata/run/private_field_presence.ts rename to tests/specs/run/private_field_presence/private_field_presence.ts diff --git a/tests/testdata/run/private_field_presence.ts.out b/tests/specs/run/private_field_presence/private_field_presence.ts.out similarity index 100% rename from tests/testdata/run/private_field_presence.ts.out rename to tests/specs/run/private_field_presence/private_field_presence.ts.out diff --git a/tests/specs/run/private_field_presence_no_check/__test__.jsonc b/tests/specs/run/private_field_presence_no_check/__test__.jsonc new file mode 100644 index 0000000000..b7a26db256 --- /dev/null +++ b/tests/specs/run/private_field_presence_no_check/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --no-check private_field_presence.ts", + "output": "private_field_presence.ts.out" +} diff --git a/tests/specs/run/private_field_presence_no_check/private_field_presence.ts b/tests/specs/run/private_field_presence_no_check/private_field_presence.ts new file mode 100644 index 0000000000..7ce2840d8e --- /dev/null +++ b/tests/specs/run/private_field_presence_no_check/private_field_presence.ts @@ -0,0 +1,20 @@ +export class Person { + #name: string; + constructor(name: string) { + this.#name = name; + } + + equals(other: unknown) { + return other && + typeof other === "object" && + #name in other && + this.#name === other.#name; + } +} + +const a = new Person("alice"); +const b = new Person("bob"); +const c = new Person("alice"); + +console.log(a.equals(b)); +console.log(a.equals(c)); diff --git a/tests/specs/run/private_field_presence_no_check/private_field_presence.ts.out b/tests/specs/run/private_field_presence_no_check/private_field_presence.ts.out new file mode 100644 index 0000000000..1d474d5255 --- /dev/null +++ b/tests/specs/run/private_field_presence_no_check/private_field_presence.ts.out @@ -0,0 +1,2 @@ +false +true diff --git a/tests/specs/run/proto_exploit/__test__.jsonc b/tests/specs/run/proto_exploit/__test__.jsonc new file mode 100644 index 0000000000..218f38654a --- /dev/null +++ b/tests/specs/run/proto_exploit/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run proto_exploit.js", + "output": "proto_exploit.js.out" +} diff --git a/tests/testdata/run/proto_exploit.js b/tests/specs/run/proto_exploit/proto_exploit.js similarity index 100% rename from tests/testdata/run/proto_exploit.js rename to tests/specs/run/proto_exploit/proto_exploit.js diff --git a/tests/testdata/run/proto_exploit.js.out b/tests/specs/run/proto_exploit/proto_exploit.js.out similarity index 100% rename from tests/testdata/run/proto_exploit.js.out rename to tests/specs/run/proto_exploit/proto_exploit.js.out diff --git a/tests/specs/run/queue_microtask_error/__test__.jsonc b/tests/specs/run/queue_microtask_error/__test__.jsonc new file mode 100644 index 0000000000..30821d67f6 --- /dev/null +++ b/tests/specs/run/queue_microtask_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet queue_microtask_error.ts", + "output": "queue_microtask_error.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/queue_microtask_error.ts b/tests/specs/run/queue_microtask_error/queue_microtask_error.ts similarity index 100% rename from tests/testdata/run/queue_microtask_error.ts rename to tests/specs/run/queue_microtask_error/queue_microtask_error.ts diff --git a/tests/testdata/run/queue_microtask_error.ts.out b/tests/specs/run/queue_microtask_error/queue_microtask_error.ts.out similarity index 100% rename from tests/testdata/run/queue_microtask_error.ts.out rename to tests/specs/run/queue_microtask_error/queue_microtask_error.ts.out diff --git a/tests/specs/run/queue_microtask_error_handled/__test__.jsonc b/tests/specs/run/queue_microtask_error_handled/__test__.jsonc new file mode 100644 index 0000000000..c343acfb41 --- /dev/null +++ b/tests/specs/run/queue_microtask_error_handled/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet queue_microtask_error_handled.ts", + "output": "queue_microtask_error_handled.ts.out" +} diff --git a/tests/testdata/run/queue_microtask_error_handled.ts b/tests/specs/run/queue_microtask_error_handled/queue_microtask_error_handled.ts similarity index 100% rename from tests/testdata/run/queue_microtask_error_handled.ts rename to tests/specs/run/queue_microtask_error_handled/queue_microtask_error_handled.ts diff --git a/tests/testdata/run/queue_microtask_error_handled.ts.out b/tests/specs/run/queue_microtask_error_handled/queue_microtask_error_handled.ts.out similarity index 100% rename from tests/testdata/run/queue_microtask_error_handled.ts.out rename to tests/specs/run/queue_microtask_error_handled/queue_microtask_error_handled.ts.out diff --git a/tests/specs/run/reference_types/__test__.jsonc b/tests/specs/run/reference_types/__test__.jsonc new file mode 100644 index 0000000000..4e4bd08b89 --- /dev/null +++ b/tests/specs/run/reference_types/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --quiet reference_types.ts", + "output": "reference_types.ts.out" +} diff --git a/tests/testdata/run/reference_types.ts b/tests/specs/run/reference_types/reference_types.ts similarity index 100% rename from tests/testdata/run/reference_types.ts rename to tests/specs/run/reference_types/reference_types.ts diff --git a/tests/testdata/run/reference_types_remote.ts.out b/tests/specs/run/reference_types/reference_types.ts.out similarity index 100% rename from tests/testdata/run/reference_types_remote.ts.out rename to tests/specs/run/reference_types/reference_types.ts.out diff --git a/tests/specs/run/reference_types_error/__test__.jsonc b/tests/specs/run/reference_types_error/__test__.jsonc new file mode 100644 index 0000000000..08450acc10 --- /dev/null +++ b/tests/specs/run/reference_types_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --config checkjs.tsconfig.json --check reference_types_error.js", + "output": "reference_types_error.js.out", + "exitCode": 1 +} diff --git a/tests/specs/run/reference_types_error/checkjs.tsconfig.json b/tests/specs/run/reference_types_error/checkjs.tsconfig.json new file mode 100644 index 0000000000..08ac60b6cd --- /dev/null +++ b/tests/specs/run/reference_types_error/checkjs.tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "checkJs": true + } +} diff --git a/tests/testdata/run/reference_types_error.js b/tests/specs/run/reference_types_error/reference_types_error.js similarity index 100% rename from tests/testdata/run/reference_types_error.js rename to tests/specs/run/reference_types_error/reference_types_error.js diff --git a/tests/testdata/run/reference_types_error.js.out b/tests/specs/run/reference_types_error/reference_types_error.js.out similarity index 100% rename from tests/testdata/run/reference_types_error.js.out rename to tests/specs/run/reference_types_error/reference_types_error.js.out diff --git a/tests/specs/run/reference_types_error_no_check/__test__.jsonc b/tests/specs/run/reference_types_error_no_check/__test__.jsonc new file mode 100644 index 0000000000..78744759d1 --- /dev/null +++ b/tests/specs/run/reference_types_error_no_check/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --no-check reference_types_error.js", + "output": "" +} diff --git a/tests/specs/run/reference_types_error_no_check/reference_types_error.js b/tests/specs/run/reference_types_error_no_check/reference_types_error.js new file mode 100644 index 0000000000..68b6c21364 --- /dev/null +++ b/tests/specs/run/reference_types_error_no_check/reference_types_error.js @@ -0,0 +1,2 @@ +/// +export const a = 1; diff --git a/tests/specs/run/reference_types_error_vendor_dir/__test__.jsonc b/tests/specs/run/reference_types_error_vendor_dir/__test__.jsonc new file mode 100644 index 0000000000..c48dd1d5e1 --- /dev/null +++ b/tests/specs/run/reference_types_error_vendor_dir/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --config checkjs.tsconfig.json --check --vendor reference_types_error.js", + "output": "reference_types_error.js.out", + "exitCode": 1 +} diff --git a/tests/specs/run/reference_types_error_vendor_dir/checkjs.tsconfig.json b/tests/specs/run/reference_types_error_vendor_dir/checkjs.tsconfig.json new file mode 100644 index 0000000000..08ac60b6cd --- /dev/null +++ b/tests/specs/run/reference_types_error_vendor_dir/checkjs.tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "checkJs": true + } +} diff --git a/tests/specs/run/reference_types_error_vendor_dir/reference_types_error.js b/tests/specs/run/reference_types_error_vendor_dir/reference_types_error.js new file mode 100644 index 0000000000..68b6c21364 --- /dev/null +++ b/tests/specs/run/reference_types_error_vendor_dir/reference_types_error.js @@ -0,0 +1,2 @@ +/// +export const a = 1; diff --git a/tests/specs/run/reference_types_error_vendor_dir/reference_types_error.js.out b/tests/specs/run/reference_types_error_vendor_dir/reference_types_error.js.out new file mode 100644 index 0000000000..86055f3ac3 --- /dev/null +++ b/tests/specs/run/reference_types_error_vendor_dir/reference_types_error.js.out @@ -0,0 +1,2 @@ +error: Module not found "file:///[WILDCARD]/nonexistent.d.ts". + at file:///[WILDCARD]/reference_types_error.js:1:22 diff --git a/tests/specs/run/references_types_remote/__test__.jsonc b/tests/specs/run/references_types_remote/__test__.jsonc new file mode 100644 index 0000000000..3f7f27c268 --- /dev/null +++ b/tests/specs/run/references_types_remote/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --quiet reference_types_remote.ts", + "output": "reference_types_remote.ts.out" +} diff --git a/tests/testdata/run/reference_types_remote.ts b/tests/specs/run/references_types_remote/reference_types_remote.ts similarity index 100% rename from tests/testdata/run/reference_types_remote.ts rename to tests/specs/run/references_types_remote/reference_types_remote.ts diff --git a/tests/specs/run/references_types_remote/reference_types_remote.ts.out b/tests/specs/run/references_types_remote/reference_types_remote.ts.out new file mode 100644 index 0000000000..417b7b5370 --- /dev/null +++ b/tests/specs/run/references_types_remote/reference_types_remote.ts.out @@ -0,0 +1 @@ +undefined diff --git a/tests/specs/run/rejection_handled/__test__.jsonc b/tests/specs/run/rejection_handled/__test__.jsonc new file mode 100644 index 0000000000..7565a7dd10 --- /dev/null +++ b/tests/specs/run/rejection_handled/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --check rejection_handled.ts", + "output": "rejection_handled.out" +} diff --git a/tests/testdata/run/rejection_handled.out b/tests/specs/run/rejection_handled/rejection_handled.out similarity index 100% rename from tests/testdata/run/rejection_handled.out rename to tests/specs/run/rejection_handled/rejection_handled.out diff --git a/tests/testdata/run/rejection_handled.ts b/tests/specs/run/rejection_handled/rejection_handled.ts similarity index 100% rename from tests/testdata/run/rejection_handled.ts rename to tests/specs/run/rejection_handled/rejection_handled.ts diff --git a/tests/specs/run/replace_self/__test__.jsonc b/tests/specs/run/replace_self/__test__.jsonc new file mode 100644 index 0000000000..cfadbf7918 --- /dev/null +++ b/tests/specs/run/replace_self/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run replace_self.js", + "output": "replace_self.js.out" +} diff --git a/tests/testdata/run/replace_self.js b/tests/specs/run/replace_self/replace_self.js similarity index 100% rename from tests/testdata/run/replace_self.js rename to tests/specs/run/replace_self/replace_self.js diff --git a/tests/testdata/run/replace_self.js.out b/tests/specs/run/replace_self/replace_self.js.out similarity index 100% rename from tests/testdata/run/replace_self.js.out rename to tests/specs/run/replace_self/replace_self.js.out diff --git a/tests/specs/run/report_error/__test__.jsonc b/tests/specs/run/report_error/__test__.jsonc new file mode 100644 index 0000000000..0577ad2450 --- /dev/null +++ b/tests/specs/run/report_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet report_error.ts", + "output": "report_error.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/report_error.ts b/tests/specs/run/report_error/report_error.ts similarity index 100% rename from tests/testdata/run/report_error.ts rename to tests/specs/run/report_error/report_error.ts diff --git a/tests/testdata/run/report_error.ts.out b/tests/specs/run/report_error/report_error.ts.out similarity index 100% rename from tests/testdata/run/report_error.ts.out rename to tests/specs/run/report_error/report_error.ts.out diff --git a/tests/specs/run/report_error_end_of_program/__test__.jsonc b/tests/specs/run/report_error_end_of_program/__test__.jsonc new file mode 100644 index 0000000000..c34956b74a --- /dev/null +++ b/tests/specs/run/report_error_end_of_program/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet report_error_end_of_program.ts", + "output": "report_error_end_of_program.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/report_error_end_of_program.ts b/tests/specs/run/report_error_end_of_program/report_error_end_of_program.ts similarity index 100% rename from tests/testdata/run/report_error_end_of_program.ts rename to tests/specs/run/report_error_end_of_program/report_error_end_of_program.ts diff --git a/tests/testdata/run/report_error_end_of_program.ts.out b/tests/specs/run/report_error_end_of_program/report_error_end_of_program.ts.out similarity index 100% rename from tests/testdata/run/report_error_end_of_program.ts.out rename to tests/specs/run/report_error_end_of_program/report_error_end_of_program.ts.out diff --git a/tests/specs/run/report_error_handled/__test__.jsonc b/tests/specs/run/report_error_handled/__test__.jsonc new file mode 100644 index 0000000000..126687b95e --- /dev/null +++ b/tests/specs/run/report_error_handled/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet report_error_handled.ts", + "output": "report_error_handled.ts.out" +} diff --git a/tests/testdata/run/report_error_handled.ts b/tests/specs/run/report_error_handled/report_error_handled.ts similarity index 100% rename from tests/testdata/run/report_error_handled.ts rename to tests/specs/run/report_error_handled/report_error_handled.ts diff --git a/tests/testdata/run/report_error_handled.ts.out b/tests/specs/run/report_error_handled/report_error_handled.ts.out similarity index 100% rename from tests/testdata/run/report_error_handled.ts.out rename to tests/specs/run/report_error_handled/report_error_handled.ts.out diff --git a/tests/specs/run/runtime_decorators/__test__.jsonc b/tests/specs/run/runtime_decorators/__test__.jsonc new file mode 100644 index 0000000000..286fd377d8 --- /dev/null +++ b/tests/specs/run/runtime_decorators/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --no-check decorators/experimental/runtime/main.ts", + "output": "decorators/experimental/runtime/main.out" +} diff --git a/tests/specs/run/runtime_decorators/decorators/experimental/deno.json b/tests/specs/run/runtime_decorators/decorators/experimental/deno.json new file mode 100644 index 0000000000..504cd646e1 --- /dev/null +++ b/tests/specs/run/runtime_decorators/decorators/experimental/deno.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "experimentalDecorators": true + } +} diff --git a/tests/specs/run/runtime_decorators/decorators/experimental/no_check/main.out b/tests/specs/run/runtime_decorators/decorators/experimental/no_check/main.out new file mode 100644 index 0000000000..015f7076e8 --- /dev/null +++ b/tests/specs/run/runtime_decorators/decorators/experimental/no_check/main.out @@ -0,0 +1,3 @@ +a(): evaluated +a(): called +method diff --git a/tests/specs/run/runtime_decorators/decorators/experimental/no_check/main.ts b/tests/specs/run/runtime_decorators/decorators/experimental/no_check/main.ts new file mode 100644 index 0000000000..9f7ec550d5 --- /dev/null +++ b/tests/specs/run/runtime_decorators/decorators/experimental/no_check/main.ts @@ -0,0 +1,21 @@ +// deno-lint-ignore-file +function a() { + console.log("a(): evaluated"); + return ( + _target: any, + _propertyKey: string, + _descriptor: PropertyDescriptor, + ) => { + console.log("a(): called"); + }; +} + +class B { + @a() + method() { + console.log("method"); + } +} + +const b = new B(); +b.method(); diff --git a/tests/specs/run/runtime_decorators/decorators/experimental/runtime/main.out b/tests/specs/run/runtime_decorators/decorators/experimental/runtime/main.out new file mode 100644 index 0000000000..0fc1d4590e --- /dev/null +++ b/tests/specs/run/runtime_decorators/decorators/experimental/runtime/main.out @@ -0,0 +1,7 @@ +@A evaluated +@B evaluated +@B called +@A called +fn() called from @A +fn() called from @B +C.test() called diff --git a/tests/specs/run/runtime_decorators/decorators/experimental/runtime/main.ts b/tests/specs/run/runtime_decorators/decorators/experimental/runtime/main.ts new file mode 100644 index 0000000000..40a26bbd4d --- /dev/null +++ b/tests/specs/run/runtime_decorators/decorators/experimental/runtime/main.ts @@ -0,0 +1,42 @@ +// deno-lint-ignore-file +function a() { + console.log("@A evaluated"); + return function ( + target: any, + propertyKey: string, + descriptor: PropertyDescriptor, + ) { + console.log("@A called"); + const fn = descriptor.value; + descriptor.value = function () { + console.log("fn() called from @A"); + fn(); + }; + }; +} + +function b() { + console.log("@B evaluated"); + return function ( + target: any, + propertyKey: string, + descriptor: PropertyDescriptor, + ) { + console.log("@B called"); + const fn = descriptor.value; + descriptor.value = function () { + console.log("fn() called from @B"); + fn(); + }; + }; +} + +class C { + @a() + @b() + static test() { + console.log("C.test() called"); + } +} + +C.test(); diff --git a/tests/specs/run/runtime_decorators/decorators/experimental/ts/main.out b/tests/specs/run/runtime_decorators/decorators/experimental/ts/main.out new file mode 100644 index 0000000000..ea64fbaa63 --- /dev/null +++ b/tests/specs/run/runtime_decorators/decorators/experimental/ts/main.out @@ -0,0 +1,3 @@ +Warning experimentalDecorators compiler option is deprecated and may be removed at any time +Check [WILDCARD] +SomeClass { someField: "asdf" } diff --git a/tests/specs/run/runtime_decorators/decorators/experimental/ts/main.ts b/tests/specs/run/runtime_decorators/decorators/experimental/ts/main.ts new file mode 100644 index 0000000000..95fba6cd48 --- /dev/null +++ b/tests/specs/run/runtime_decorators/decorators/experimental/ts/main.ts @@ -0,0 +1,14 @@ +// deno-lint-ignore-file + +function Decorate() { + return function (constructor: any): any { + return class extends constructor { + protected someField: string = "asdf"; + }; + }; +} + +@Decorate() +class SomeClass {} + +console.log(new SomeClass()); diff --git a/tests/specs/run/runtime_decorators/decorators/tc39_proposal/main.out b/tests/specs/run/runtime_decorators/decorators/tc39_proposal/main.out new file mode 100644 index 0000000000..39394952e8 --- /dev/null +++ b/tests/specs/run/runtime_decorators/decorators/tc39_proposal/main.out @@ -0,0 +1,3 @@ +starting m with arguments 1 +C.m 1 +ending m diff --git a/tests/specs/run/runtime_decorators/decorators/tc39_proposal/main.ts b/tests/specs/run/runtime_decorators/decorators/tc39_proposal/main.ts new file mode 100644 index 0000000000..00c8a85025 --- /dev/null +++ b/tests/specs/run/runtime_decorators/decorators/tc39_proposal/main.ts @@ -0,0 +1,21 @@ +// deno-lint-ignore no-explicit-any +function logged(value: any, { kind, name }: { kind: string; name: string }) { + if (kind === "method") { + return function (...args: unknown[]) { + console.log(`starting ${name} with arguments ${args.join(", ")}`); + // @ts-ignore this has implicit any type + const ret = value.call(this, ...args); + console.log(`ending ${name}`); + return ret; + }; + } +} + +class C { + @logged + m(arg: number) { + console.log("C.m", arg); + } +} + +new C().m(1); diff --git a/tests/specs/run/seed_random/__test__.jsonc b/tests/specs/run/seed_random/__test__.jsonc new file mode 100644 index 0000000000..5a1876d6c3 --- /dev/null +++ b/tests/specs/run/seed_random/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --seed=100 seed_random.js", + "output": "seed_random.js.out" +} diff --git a/tests/testdata/run/seed_random.js b/tests/specs/run/seed_random/seed_random.js similarity index 100% rename from tests/testdata/run/seed_random.js rename to tests/specs/run/seed_random/seed_random.js diff --git a/tests/testdata/run/seed_random.js.out b/tests/specs/run/seed_random/seed_random.js.out similarity index 100% rename from tests/testdata/run/seed_random.js.out rename to tests/specs/run/seed_random/seed_random.js.out diff --git a/tests/specs/run/set_exit_code_0/__test__.jsonc b/tests/specs/run/set_exit_code_0/__test__.jsonc new file mode 100644 index 0000000000..a5866e8c69 --- /dev/null +++ b/tests/specs/run/set_exit_code_0/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --no-check set_exit_code_0.ts", + "output": "", + "exitCode": 0 +} diff --git a/tests/testdata/run/set_exit_code_0.ts b/tests/specs/run/set_exit_code_0/set_exit_code_0.ts similarity index 100% rename from tests/testdata/run/set_exit_code_0.ts rename to tests/specs/run/set_exit_code_0/set_exit_code_0.ts diff --git a/tests/specs/run/set_exit_code_1/__test__.jsonc b/tests/specs/run/set_exit_code_1/__test__.jsonc new file mode 100644 index 0000000000..1ca50c9827 --- /dev/null +++ b/tests/specs/run/set_exit_code_1/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --no-check set_exit_code_1.ts", + "output": "", + "exitCode": 42 +} diff --git a/tests/testdata/run/set_exit_code_1.ts b/tests/specs/run/set_exit_code_1/set_exit_code_1.ts similarity index 100% rename from tests/testdata/run/set_exit_code_1.ts rename to tests/specs/run/set_exit_code_1/set_exit_code_1.ts diff --git a/tests/specs/run/set_exit_code_2/__test__.jsonc b/tests/specs/run/set_exit_code_2/__test__.jsonc new file mode 100644 index 0000000000..af7411f7cb --- /dev/null +++ b/tests/specs/run/set_exit_code_2/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --no-check set_exit_code_2.ts", + "output": "", + "exitCode": 42 +} diff --git a/tests/testdata/run/set_exit_code_2.ts b/tests/specs/run/set_exit_code_2/set_exit_code_2.ts similarity index 100% rename from tests/testdata/run/set_exit_code_2.ts rename to tests/specs/run/set_exit_code_2/set_exit_code_2.ts diff --git a/tests/specs/run/set_timeout_error/__test__.jsonc b/tests/specs/run/set_timeout_error/__test__.jsonc new file mode 100644 index 0000000000..eea730fd87 --- /dev/null +++ b/tests/specs/run/set_timeout_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet set_timeout_error.ts", + "output": "set_timeout_error.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/set_timeout_error.ts b/tests/specs/run/set_timeout_error/set_timeout_error.ts similarity index 100% rename from tests/testdata/run/set_timeout_error.ts rename to tests/specs/run/set_timeout_error/set_timeout_error.ts diff --git a/tests/testdata/run/set_timeout_error.ts.out b/tests/specs/run/set_timeout_error/set_timeout_error.ts.out similarity index 100% rename from tests/testdata/run/set_timeout_error.ts.out rename to tests/specs/run/set_timeout_error/set_timeout_error.ts.out diff --git a/tests/specs/run/set_timeout_error_handled/__test__.jsonc b/tests/specs/run/set_timeout_error_handled/__test__.jsonc new file mode 100644 index 0000000000..39a9424bbc --- /dev/null +++ b/tests/specs/run/set_timeout_error_handled/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet set_timeout_error_handled.ts", + "output": "set_timeout_error_handled.ts.out" +} diff --git a/tests/testdata/run/set_timeout_error_handled.ts b/tests/specs/run/set_timeout_error_handled/set_timeout_error_handled.ts similarity index 100% rename from tests/testdata/run/set_timeout_error_handled.ts rename to tests/specs/run/set_timeout_error_handled/set_timeout_error_handled.ts diff --git a/tests/testdata/run/set_timeout_error_handled.ts.out b/tests/specs/run/set_timeout_error_handled/set_timeout_error_handled.ts.out similarity index 100% rename from tests/testdata/run/set_timeout_error_handled.ts.out rename to tests/specs/run/set_timeout_error_handled/set_timeout_error_handled.ts.out diff --git a/tests/specs/run/shebang_swc/__test__.jsonc b/tests/specs/run/shebang_swc/__test__.jsonc new file mode 100644 index 0000000000..65e0b5c9b1 --- /dev/null +++ b/tests/specs/run/shebang_swc/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet shebang.ts", + "output": "shebang.ts.out" +} diff --git a/tests/testdata/run/shebang.ts b/tests/specs/run/shebang_swc/shebang.ts similarity index 100% rename from tests/testdata/run/shebang.ts rename to tests/specs/run/shebang_swc/shebang.ts diff --git a/tests/testdata/run/shebang.ts.out b/tests/specs/run/shebang_swc/shebang.ts.out similarity index 100% rename from tests/testdata/run/shebang.ts.out rename to tests/specs/run/shebang_swc/shebang.ts.out diff --git a/tests/specs/run/shebang_swc/shebang2.ts b/tests/specs/run/shebang_swc/shebang2.ts new file mode 100644 index 0000000000..da0d7bf0c9 --- /dev/null +++ b/tests/specs/run/shebang_swc/shebang2.ts @@ -0,0 +1,3 @@ +#!/usr/bin/env -S deno run + +export default 42; diff --git a/tests/specs/run/shebang_tsc/__test__.jsonc b/tests/specs/run/shebang_tsc/__test__.jsonc new file mode 100644 index 0000000000..f78971d57d --- /dev/null +++ b/tests/specs/run/shebang_tsc/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --check shebang.ts", + "output": "shebang.ts.out" +} diff --git a/tests/specs/run/shebang_tsc/shebang.ts b/tests/specs/run/shebang_tsc/shebang.ts new file mode 100644 index 0000000000..00feb2da0a --- /dev/null +++ b/tests/specs/run/shebang_tsc/shebang.ts @@ -0,0 +1,5 @@ +#!/usr/bin/env -S deno run + +import test from "./shebang2.ts"; + +console.log(test as number); diff --git a/tests/testdata/run/wasm.ts.out b/tests/specs/run/shebang_tsc/shebang.ts.out similarity index 100% rename from tests/testdata/run/wasm.ts.out rename to tests/specs/run/shebang_tsc/shebang.ts.out diff --git a/tests/specs/run/shebang_tsc/shebang2.ts b/tests/specs/run/shebang_tsc/shebang2.ts new file mode 100644 index 0000000000..da0d7bf0c9 --- /dev/null +++ b/tests/specs/run/shebang_tsc/shebang2.ts @@ -0,0 +1,3 @@ +#!/usr/bin/env -S deno run + +export default 42; diff --git a/tests/specs/run/shebang_with_json_imports_swc/__test__.jsonc b/tests/specs/run/shebang_with_json_imports_swc/__test__.jsonc new file mode 100644 index 0000000000..90592757fe --- /dev/null +++ b/tests/specs/run/shebang_with_json_imports_swc/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --no-check json_with_shebang.ts", + "output": "json_with_shebang.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/shebang_with_json_imports_swc/json_with_shebang.json b/tests/specs/run/shebang_with_json_imports_swc/json_with_shebang.json new file mode 100644 index 0000000000..b695e44571 --- /dev/null +++ b/tests/specs/run/shebang_with_json_imports_swc/json_with_shebang.json @@ -0,0 +1,4 @@ +#!/usr/env -S deno run +{ + "test": null +} diff --git a/tests/specs/run/shebang_with_json_imports_swc/json_with_shebang.ts b/tests/specs/run/shebang_with_json_imports_swc/json_with_shebang.ts new file mode 100644 index 0000000000..9524026bce --- /dev/null +++ b/tests/specs/run/shebang_with_json_imports_swc/json_with_shebang.ts @@ -0,0 +1,3 @@ +import json from "./json_with_shebang.json" with { type: "json" }; + +console.log(json); diff --git a/tests/specs/run/shebang_with_json_imports_swc/json_with_shebang.ts.out b/tests/specs/run/shebang_with_json_imports_swc/json_with_shebang.ts.out new file mode 100644 index 0000000000..23eb03720e --- /dev/null +++ b/tests/specs/run/shebang_with_json_imports_swc/json_with_shebang.ts.out @@ -0,0 +1 @@ +error: Uncaught SyntaxError: Unexpected token '#', "#!/usr/env"... is not valid JSON diff --git a/tests/specs/run/shebang_with_json_imports_tsc/__test__.jsonc b/tests/specs/run/shebang_with_json_imports_tsc/__test__.jsonc new file mode 100644 index 0000000000..7fbb8a5d35 --- /dev/null +++ b/tests/specs/run/shebang_with_json_imports_tsc/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet json_with_shebang.ts", + "output": "json_with_shebang.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/shebang_with_json_imports_tsc/json_with_shebang.json b/tests/specs/run/shebang_with_json_imports_tsc/json_with_shebang.json new file mode 100644 index 0000000000..b695e44571 --- /dev/null +++ b/tests/specs/run/shebang_with_json_imports_tsc/json_with_shebang.json @@ -0,0 +1,4 @@ +#!/usr/env -S deno run +{ + "test": null +} diff --git a/tests/specs/run/shebang_with_json_imports_tsc/json_with_shebang.ts b/tests/specs/run/shebang_with_json_imports_tsc/json_with_shebang.ts new file mode 100644 index 0000000000..9524026bce --- /dev/null +++ b/tests/specs/run/shebang_with_json_imports_tsc/json_with_shebang.ts @@ -0,0 +1,3 @@ +import json from "./json_with_shebang.json" with { type: "json" }; + +console.log(json); diff --git a/tests/specs/run/shebang_with_json_imports_tsc/json_with_shebang.ts.out b/tests/specs/run/shebang_with_json_imports_tsc/json_with_shebang.ts.out new file mode 100644 index 0000000000..23eb03720e --- /dev/null +++ b/tests/specs/run/shebang_with_json_imports_tsc/json_with_shebang.ts.out @@ -0,0 +1 @@ +error: Uncaught SyntaxError: Unexpected token '#', "#!/usr/env"... is not valid JSON diff --git a/tests/specs/run/single_compile_with_reload/__test__.jsonc b/tests/specs/run/single_compile_with_reload/__test__.jsonc new file mode 100644 index 0000000000..3e2e043790 --- /dev/null +++ b/tests/specs/run/single_compile_with_reload/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --allow-read single_compile_with_reload.ts", + "output": "single_compile_with_reload.ts.out" +} diff --git a/tests/specs/run/single_compile_with_reload/mod1.ts b/tests/specs/run/single_compile_with_reload/mod1.ts new file mode 100644 index 0000000000..5e58f432ed --- /dev/null +++ b/tests/specs/run/single_compile_with_reload/mod1.ts @@ -0,0 +1,17 @@ +import { printHello2, returnsFoo } from "./subdir2/mod2.ts"; + +export function returnsHi(): string { + return "Hi"; +} + +export function returnsFoo2(): string { + return returnsFoo(); +} + +export function printHello3() { + printHello2(); +} + +export function throwsError() { + throw Error("exception from mod1"); +} diff --git a/tests/specs/run/single_compile_with_reload/print_hello.ts b/tests/specs/run/single_compile_with_reload/print_hello.ts new file mode 100644 index 0000000000..b9c0ad5275 --- /dev/null +++ b/tests/specs/run/single_compile_with_reload/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/testdata/run/single_compile_with_reload.ts b/tests/specs/run/single_compile_with_reload/single_compile_with_reload.ts similarity index 100% rename from tests/testdata/run/single_compile_with_reload.ts rename to tests/specs/run/single_compile_with_reload/single_compile_with_reload.ts diff --git a/tests/testdata/run/single_compile_with_reload.ts.out b/tests/specs/run/single_compile_with_reload/single_compile_with_reload.ts.out similarity index 100% rename from tests/testdata/run/single_compile_with_reload.ts.out rename to tests/specs/run/single_compile_with_reload/single_compile_with_reload.ts.out diff --git a/tests/specs/run/single_compile_with_reload/single_compile_with_reload_dyn.ts b/tests/specs/run/single_compile_with_reload/single_compile_with_reload_dyn.ts new file mode 100644 index 0000000000..c69556be15 --- /dev/null +++ b/tests/specs/run/single_compile_with_reload/single_compile_with_reload_dyn.ts @@ -0,0 +1,11 @@ +import { printHello3, returnsFoo2, returnsHi } from "./mod1.ts"; + +printHello3(); + +if (returnsHi() !== "Hi") { + throw Error("Unexpected"); +} + +if (returnsFoo2() !== "Foo") { + throw Error("Unexpected"); +} diff --git a/tests/specs/run/single_compile_with_reload/single_compile_with_reload_worker.ts b/tests/specs/run/single_compile_with_reload/single_compile_with_reload_worker.ts new file mode 100644 index 0000000000..103cafe20c --- /dev/null +++ b/tests/specs/run/single_compile_with_reload/single_compile_with_reload_worker.ts @@ -0,0 +1,3 @@ +console.log("Hello from worker"); +postMessage(null); +close(); diff --git a/tests/specs/run/single_compile_with_reload/subdir2/dynamic_import.ts b/tests/specs/run/single_compile_with_reload/subdir2/dynamic_import.ts new file mode 100644 index 0000000000..59beb64c33 --- /dev/null +++ b/tests/specs/run/single_compile_with_reload/subdir2/dynamic_import.ts @@ -0,0 +1,4 @@ +(async () => { + const { printHello } = await import("../mod2.ts"); + printHello(); +})(); diff --git a/tests/specs/run/single_compile_with_reload/subdir2/mod2.ts b/tests/specs/run/single_compile_with_reload/subdir2/mod2.ts new file mode 100644 index 0000000000..9071d0aeb4 --- /dev/null +++ b/tests/specs/run/single_compile_with_reload/subdir2/mod2.ts @@ -0,0 +1,9 @@ +import { printHello } from "../print_hello.ts"; + +export function returnsFoo(): string { + return "Foo"; +} + +export function printHello2() { + printHello(); +} diff --git a/tests/specs/run/spawn_stdout_inherit/__test__.jsonc b/tests/specs/run/spawn_stdout_inherit/__test__.jsonc new file mode 100644 index 0000000000..4dd5fe54ce --- /dev/null +++ b/tests/specs/run/spawn_stdout_inherit/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet -A spawn_stdout_inherit.ts", + "output": "spawn_stdout_inherit.ts.out" +} diff --git a/tests/testdata/run/spawn_stdout_inherit.ts b/tests/specs/run/spawn_stdout_inherit/spawn_stdout_inherit.ts similarity index 100% rename from tests/testdata/run/spawn_stdout_inherit.ts rename to tests/specs/run/spawn_stdout_inherit/spawn_stdout_inherit.ts diff --git a/tests/testdata/run/spawn_stdout_inherit.ts.out b/tests/specs/run/spawn_stdout_inherit/spawn_stdout_inherit.ts.out similarity index 100% rename from tests/testdata/run/spawn_stdout_inherit.ts.out rename to tests/specs/run/spawn_stdout_inherit/spawn_stdout_inherit.ts.out diff --git a/tests/specs/run/stdin_read_all/__test__.jsonc b/tests/specs/run/stdin_read_all/__test__.jsonc new file mode 100644 index 0000000000..6fc035aabd --- /dev/null +++ b/tests/specs/run/stdin_read_all/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet stdin_read_all.ts", + "output": "stdin_read_all.out", + "input": "01234567890123456789012345678901234567890123456789" +} diff --git a/tests/testdata/run/stdin_read_all.out b/tests/specs/run/stdin_read_all/stdin_read_all.out similarity index 100% rename from tests/testdata/run/stdin_read_all.out rename to tests/specs/run/stdin_read_all/stdin_read_all.out diff --git a/tests/testdata/run/stdin_read_all.ts b/tests/specs/run/stdin_read_all/stdin_read_all.ts similarity index 100% rename from tests/testdata/run/stdin_read_all.ts rename to tests/specs/run/stdin_read_all/stdin_read_all.ts diff --git a/tests/specs/run/stdout_write_all/__test__.jsonc b/tests/specs/run/stdout_write_all/__test__.jsonc new file mode 100644 index 0000000000..2057f4a115 --- /dev/null +++ b/tests/specs/run/stdout_write_all/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet stdout_write_all.ts", + "output": "stdout_write_all.out" +} diff --git a/tests/testdata/run/stdout_write_all.out b/tests/specs/run/stdout_write_all/stdout_write_all.out similarity index 100% rename from tests/testdata/run/stdout_write_all.out rename to tests/specs/run/stdout_write_all/stdout_write_all.out diff --git a/tests/testdata/run/stdout_write_all.ts b/tests/specs/run/stdout_write_all/stdout_write_all.ts similarity index 100% rename from tests/testdata/run/stdout_write_all.ts rename to tests/specs/run/stdout_write_all/stdout_write_all.ts diff --git a/tests/specs/run/stdout_write_sync_async/__test__.jsonc b/tests/specs/run/stdout_write_sync_async/__test__.jsonc new file mode 100644 index 0000000000..5032ca015f --- /dev/null +++ b/tests/specs/run/stdout_write_sync_async/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet stdout_write_sync_async.ts", + "output": "stdout_write_sync_async.out" +} diff --git a/tests/testdata/run/stdout_write_sync_async.out b/tests/specs/run/stdout_write_sync_async/stdout_write_sync_async.out similarity index 100% rename from tests/testdata/run/stdout_write_sync_async.out rename to tests/specs/run/stdout_write_sync_async/stdout_write_sync_async.out diff --git a/tests/testdata/run/stdout_write_sync_async.ts b/tests/specs/run/stdout_write_sync_async/stdout_write_sync_async.ts similarity index 100% rename from tests/testdata/run/stdout_write_sync_async.ts rename to tests/specs/run/stdout_write_sync_async/stdout_write_sync_async.ts diff --git a/tests/specs/run/swc_syntax_error/__test__.jsonc b/tests/specs/run/swc_syntax_error/__test__.jsonc new file mode 100644 index 0000000000..842a4fcf8e --- /dev/null +++ b/tests/specs/run/swc_syntax_error/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload --check swc_syntax_error.ts", + "output": "swc_syntax_error.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/swc_syntax_error.ts b/tests/specs/run/swc_syntax_error/swc_syntax_error.ts similarity index 100% rename from tests/testdata/run/swc_syntax_error.ts rename to tests/specs/run/swc_syntax_error/swc_syntax_error.ts diff --git a/tests/testdata/run/swc_syntax_error.ts.out b/tests/specs/run/swc_syntax_error/swc_syntax_error.ts.out similarity index 100% rename from tests/testdata/run/swc_syntax_error.ts.out rename to tests/specs/run/swc_syntax_error/swc_syntax_error.ts.out diff --git a/tests/specs/run/test_and_bench_are_noops_in_run/__test__.jsonc b/tests/specs/run/test_and_bench_are_noops_in_run/__test__.jsonc new file mode 100644 index 0000000000..3d8d2ba56e --- /dev/null +++ b/tests/specs/run/test_and_bench_are_noops_in_run/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run test_and_bench_in_run.js", + "output": "" +} diff --git a/tests/testdata/run/test_and_bench_in_run.js b/tests/specs/run/test_and_bench_are_noops_in_run/test_and_bench_in_run.js similarity index 100% rename from tests/testdata/run/test_and_bench_in_run.js rename to tests/specs/run/test_and_bench_are_noops_in_run/test_and_bench_in_run.js diff --git a/tests/specs/run/tls_connecttls/RootCA.pem b/tests/specs/run/tls_connecttls/RootCA.pem new file mode 100644 index 0000000000..c2f84ceebc --- /dev/null +++ b/tests/specs/run/tls_connecttls/RootCA.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDIzCCAgugAwIBAgIJAMKPPW4tsOymMA0GCSqGSIb3DQEBCwUAMCcxCzAJBgNV +BAYTAlVTMRgwFgYDVQQDDA9FeGFtcGxlLVJvb3QtQ0EwIBcNMTkxMDIxMTYyODIy +WhgPMjExODA5MjcxNjI4MjJaMCcxCzAJBgNVBAYTAlVTMRgwFgYDVQQDDA9FeGFt +cGxlLVJvb3QtQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDMH/IO +2qtHfyBKwANNPB4K0q5JVSg8XxZdRpTTlz0CwU0oRO3uHrI52raCCfVeiQutyZop +eFZTDWeXGudGAFA2B5m3orWt0s+touPi8MzjsG2TQ+WSI66QgbXTNDitDDBtTVcV +5G3Ic+3SppQAYiHSekLISnYWgXLl+k5CnEfTowg6cjqjVr0KjL03cTN3H7b+6+0S +ws4rYbW1j4ExR7K6BFNH6572yq5qR20E6GqlY+EcOZpw4CbCk9lS8/CWuXze/vMs +OfDcc6K+B625d27wyEGZHedBomT2vAD7sBjvO8hn/DP1Qb46a8uCHR6NSfnJ7bXO +G1igaIbgY1zXirNdAgMBAAGjUDBOMB0GA1UdDgQWBBTzut+pwwDfqmMYcI9KNWRD +hxcIpTAfBgNVHSMEGDAWgBTzut+pwwDfqmMYcI9KNWRDhxcIpTAMBgNVHRMEBTAD +AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQB9AqSbZ+hEglAgSHxAMCqRFdhVu7MvaQM0 +P090mhGlOCt3yB7kdGfsIrUW6nQcTz7PPQFRaJMrFHPvFvPootkBUpTYR4hTkdce +H6RCRu2Jxl4Y9bY/uezd9YhGCYfUtfjA6/TH9FcuZfttmOOlxOt01XfNvVMIR6RM +z/AYhd+DeOXjr35F/VHeVpnk+55L0PYJsm1CdEbOs5Hy1ecR7ACuDkXnbM4fpz9I +kyIWJwk2zJReKcJMgi1aIinDM9ao/dca1G99PHOw8dnr4oyoTiv8ao6PWiSRHHMi +MNf4EgWfK+tZMnuqfpfO9740KzfcVoMNo4QJD4yn5YxroUOO/Azi +-----END CERTIFICATE----- diff --git a/tests/specs/run/tls_connecttls/__test__.jsonc b/tests/specs/run/tls_connecttls/__test__.jsonc new file mode 100644 index 0000000000..2e8f88339d --- /dev/null +++ b/tests/specs/run/tls_connecttls/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-net --allow-read --cert RootCA.pem --config deno.json tls_connecttls.js", + "output": "tls.out" +} diff --git a/tests/specs/run/tls_connecttls/deno.json b/tests/specs/run/tls_connecttls/deno.json new file mode 100644 index 0000000000..105514e133 --- /dev/null +++ b/tests/specs/run/tls_connecttls/deno.json @@ -0,0 +1,4 @@ +{ + "lock": false, + "importMap": "../../../../import_map.json" +} diff --git a/tests/specs/run/tls_connecttls/localhost.crt b/tests/specs/run/tls_connecttls/localhost.crt new file mode 100644 index 0000000000..a71ae9050f --- /dev/null +++ b/tests/specs/run/tls_connecttls/localhost.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDajCCAlKgAwIBAgIJAOPyQVdy/UpPMA0GCSqGSIb3DQEBCwUAMCcxCzAJBgNV +BAYTAlVTMRgwFgYDVQQDDA9FeGFtcGxlLVJvb3QtQ0EwIBcNMTkxMDIxMTYyODU4 +WhgPMjExODA5MjcxNjI4NThaMG0xCzAJBgNVBAYTAlVTMRIwEAYDVQQIDAlZb3Vy +U3RhdGUxETAPBgNVBAcMCFlvdXJDaXR5MR0wGwYDVQQKDBRFeGFtcGxlLUNlcnRp +ZmljYXRlczEYMBYGA1UEAwwPbG9jYWxob3N0LmxvY2FsMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEAz9svjVdf5jihUBtofd84XKdb8dEHQRJfDNKaJ4Ar +baqMHAdnqi/fWtlqEEMn8gweZ7+4hshECY5mnx4Hhy7IAbePDsTTbSm01dChhlxF +uvd9QuvzvrqSjSq+v4Jlau+pQIhUzzV12dF5bFvrIrGWxCZp+W7lLDZI6Pd6Su+y +ZIeiwrUaPMzdUePNf2hZI/IvWCUMCIyoqrrKHdHoPuvQCW17IyxsnFQJNbmN+Rtp +BQilhtwvBbggCBWhHxEdiqBaZHDw6Zl+bU7ejx1mu9A95wpQ9SCL2cRkAlz2LDOy +wznrTAwGcvqvFKxlV+3HsaD7rba4kCA1Ihp5mm/dS2k94QIDAQABo1EwTzAfBgNV +HSMEGDAWgBTzut+pwwDfqmMYcI9KNWRDhxcIpTAJBgNVHRMEAjAAMAsGA1UdDwQE +AwIE8DAUBgNVHREEDTALgglsb2NhbGhvc3QwDQYJKoZIhvcNAQELBQADggEBAKVu +vVpu5nPGAGn1SX4FQUcbn9Z5wgBkjnZxfJHJQX4sYIRlcirZviPHCZGPWex4VHC+ +lFMm+70YEN2uoe5jGrdgcugzx2Amc7/mLrsvvpMsaS0PlxNMcqhdM1WHbGjjdNln +XICVITSKnB1fSGH6uo9CMCWw5kgPS9o4QWrLLkxnds3hoz7gVEUyi/6V65mcfFNA +lof9iKcK9JsSHdBs35vpv7UKLX+96RM7Nm2Mu0yue5JiS79/zuMA/Kryxot4jv5z +ecdWFl0eIyQBZmBzMw2zPUqkxEnXLiKjV8jutEg/4qovTOB6YiA41qbARXdzNA2V +FYuchcTcWmnmVVRFyyU= +-----END CERTIFICATE----- diff --git a/tests/specs/run/tls_connecttls/localhost.key b/tests/specs/run/tls_connecttls/localhost.key new file mode 100644 index 0000000000..42774c9771 --- /dev/null +++ b/tests/specs/run/tls_connecttls/localhost.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDP2y+NV1/mOKFQ +G2h93zhcp1vx0QdBEl8M0pongCttqowcB2eqL99a2WoQQyfyDB5nv7iGyEQJjmaf +HgeHLsgBt48OxNNtKbTV0KGGXEW6931C6/O+upKNKr6/gmVq76lAiFTPNXXZ0Xls +W+sisZbEJmn5buUsNkjo93pK77Jkh6LCtRo8zN1R481/aFkj8i9YJQwIjKiqusod +0eg+69AJbXsjLGycVAk1uY35G2kFCKWG3C8FuCAIFaEfER2KoFpkcPDpmX5tTt6P +HWa70D3nClD1IIvZxGQCXPYsM7LDOetMDAZy+q8UrGVX7cexoPuttriQIDUiGnma +b91LaT3hAgMBAAECggEBAJABfn+BQorBP1m9s3ZJmcXvmW7+7/SwYrQCkRS+4te2 +6h1dMAAj7K4HpUkhDeLPbJ1aoeCXjTPFuemRp4uL6Lvvzahgy059L7FXOyFYemMf +pmQgDx5cKr6tF7yc/eDJrExuZ7urgTvouiRNxqmhuh+psZBDuXkZHwhwtQSH7uNg +KBDKu0qWO73vFLcLckdGEU3+H9oIWs5xcvvOkWzyvHbRGFJSihgcRpPPHodF5xB9 +T/gZIoJHMmCbUMlWaSasUyNXTuvCnkvBDol8vXrMJCVzKZj9GpPDcIFdc08GSn4I +pTdSNwzUcHbdERzdVU28Xt+t6W5rvp/4FWrssi4IzkUCgYEA//ZcEcBguRD4OFrx +6wbSjzCcUW1NWhzA8uTOORZi4SvndcH1cU4S2wznuHNubU1XlrGwJX6PUGebmY/l +53B5PJvStbVtZCVIxllR+ZVzRuL8wLodRHzlYH8GOzHwoa4ivSupkzl72ij1u/tI +NMLGfYEKVdNd8zXIESUY88NszvsCgYEAz+MDp3xOhFaCe+CPv80A592cJcfzc8Al ++rahEOu+VdN2QBZf86PIf2Bfv/t0QvnRvs1z648TuH6h83YSggOAbmfHyd789jkq +UWlktIaXbVn+VaHmPTcBWTg3ZTlvG+fiFCbZXiYhm+UUf1MDqZHdiifAoyVIjV/Z +YhCNJo3q39MCgYEAknrpK5t9fstwUcfyA/9OhnVaL9suVjB4V0iLn+3ovlXCywgp +ryLv9X3IKi2c9144jtu3I23vFCOGz3WjKzSZnQ7LogNmy9XudNxu5jcZ1mpWHPEl +iKk1F2j6Juwoek5OQRX4oHFYKHwiTOa75r3Em9Q6Fu20KVgQ24bwZafj3/sCgYAy +k0AoVw2jFIjaKl/Ogclen4OFjYek+XJD9Hpq62964d866Dafx5DXrFKfGkXGpZBp +owI4pK5fjC9KU8dc6g0szwLEEgPowy+QbtuZL8VXTTWbD7A75E3nrs2LStXFLDzM +OkdXqF801h6Oe1vAvUPwgItVJZTpEBCK0wwD/TLPEQKBgQDRkhlTtAoHW7W6STd0 +A/OWc0dxhzMurpxg0bLgCqUjw1ESGrSCGhffFn0IWa8sv19VWsZuBhTgjNatZsYB +AhDs/6OosT/3nJoh2/t0hYDj1FBI0lPXWYD4pesuZ5yIMrmSaAOtIzp4BGY7ui8N +wOqcq/jdiHj/MKEdqOXy3YAJrA== +-----END PRIVATE KEY----- diff --git a/tests/specs/run/tls_connecttls/textproto.ts b/tests/specs/run/tls_connecttls/textproto.ts new file mode 100644 index 0000000000..9e0f5f5f0a --- /dev/null +++ b/tests/specs/run/tls_connecttls/textproto.ts @@ -0,0 +1,170 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/** **Deprecated**. Use `TextLineStream` from `std/steams` for line-by-line text reading instead. + * + * A reader for dealing with low level text based protocols. + * + * Based on + * [net/textproto](https://github.com/golang/go/tree/master/src/net/textproto). + * + * @deprecated (will be removed after 0.159.0) Use `TextLineStream` from `std/steams` for line-by-line text reading instead. + * @module + */ + +import type { BufReader, ReadLineResult } from "@std/io/buf-reader"; +import { concat } from "@std/bytes/concat"; + +// Constants created for DRY +const CHAR_SPACE: number = " ".charCodeAt(0); +const CHAR_TAB: number = "\t".charCodeAt(0); +const CHAR_COLON: number = ":".charCodeAt(0); + +const WHITESPACES: Array = [CHAR_SPACE, CHAR_TAB]; + +const decoder = new TextDecoder(); + +// FROM https://github.com/denoland/deno/blob/b34628a26ab0187a827aa4ebe256e23178e25d39/cli/js/web/headers.ts#L9 +const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/g; + +function str(buf: Uint8Array | null | undefined): string { + return !buf ? "" : decoder.decode(buf); +} + +/** + * @deprecated (will be removed after 0.159.0) Use `TextLineStream` from `std/steams` for line-by-line text reading instead. + */ +export class TextProtoReader { + constructor(readonly r: BufReader) {} + + /** readLine() reads a single line from the TextProtoReader, + * eliding the final \n or \r\n from the returned string. + */ + async readLine(): Promise { + const s = await this.readLineSlice(); + return s === null ? null : str(s); + } + + /** ReadMimeHeader reads a MIME-style header from r. + * The header is a sequence of possibly continued Key: Value lines + * ending in a blank line. + * The returned map m maps CanonicalMIMEHeaderKey(key) to a + * sequence of values in the same order encountered in the input. + * + * For example, consider this input: + * + * My-Key: Value 1 + * Long-Key: Even + * Longer Value + * My-Key: Value 2 + * + * Given that input, ReadMIMEHeader returns the map: + * + * map[string][]string{ + * "My-Key": {"Value 1", "Value 2"}, + * "Long-Key": {"Even Longer Value"}, + * } + */ + async readMimeHeader(): Promise { + const m = new Headers(); + let line: Uint8Array | undefined; + + // The first line cannot start with a leading space. + let buf = await this.r.peek(1); + if (buf === null) { + return null; + } else if (WHITESPACES.includes(buf[0])) { + line = (await this.readLineSlice()) as Uint8Array; + } + + buf = await this.r.peek(1); + if (buf === null) { + throw new Deno.errors.UnexpectedEof(); + } else if (WHITESPACES.includes(buf[0])) { + throw new Deno.errors.InvalidData( + `malformed MIME header initial line: ${str(line)}`, + ); + } + + while (true) { + const kv = await this.readLineSlice(); // readContinuedLineSlice + if (kv === null) throw new Deno.errors.UnexpectedEof(); + if (kv.byteLength === 0) return m; + + // Key ends at first colon + let i = kv.indexOf(CHAR_COLON); + if (i < 0) { + throw new Deno.errors.InvalidData( + `malformed MIME header line: ${str(kv)}`, + ); + } + + //let key = canonicalMIMEHeaderKey(kv.subarray(0, endKey)); + const key = str(kv.subarray(0, i)); + + // As per RFC 7230 field-name is a token, + // tokens consist of one or more chars. + // We could throw `Deno.errors.InvalidData` here, + // but better to be liberal in what we + // accept, so if we get an empty key, skip it. + if (key == "") { + continue; + } + + // Skip initial spaces in value. + i++; // skip colon + while ( + i < kv.byteLength && + (WHITESPACES.includes(kv[i])) + ) { + i++; + } + const value = str(kv.subarray(i)).replace( + invalidHeaderCharRegex, + encodeURI, + ); + + // In case of invalid header we swallow the error + // example: "Audio Mode" => invalid due to space in the key + try { + m.append(key, value); + } catch { + // Pass + } + } + } + + async readLineSlice(): Promise { + let line = new Uint8Array(0); + let r: ReadLineResult | null = null; + + do { + r = await this.r.readLine(); + // TODO(ry): + // This skipSpace() is definitely misplaced, but I don't know where it + // comes from nor how to fix it. + + //TODO(SmashingQuasar): Kept skipSpace to preserve behavior but it should be looked into to check if it makes sense when this is used. + + if (r !== null && this.skipSpace(r.line) !== 0) { + line = concat([line, r.line]); + } + } while (r !== null && r.more); + + return r === null ? null : line; + } + + skipSpace(l: Uint8Array): number { + let n = 0; + + for (const val of l) { + if (!WHITESPACES.includes(val)) { + n++; + } + } + + return n; + } +} diff --git a/tests/testdata/run/tls.out b/tests/specs/run/tls_connecttls/tls.out similarity index 100% rename from tests/testdata/run/tls.out rename to tests/specs/run/tls_connecttls/tls.out diff --git a/tests/testdata/run/tls_connecttls.js b/tests/specs/run/tls_connecttls/tls_connecttls.js similarity index 94% rename from tests/testdata/run/tls_connecttls.js rename to tests/specs/run/tls_connecttls/tls_connecttls.js index 07b361f9ce..686b13aea3 100644 --- a/tests/testdata/run/tls_connecttls.js +++ b/tests/specs/run/tls_connecttls/tls_connecttls.js @@ -12,8 +12,8 @@ const port = 3505; const listener = Deno.listenTls({ hostname, port, - cert: Deno.readTextFileSync("./tls/localhost.crt"), - key: Deno.readTextFileSync("./tls/localhost.key"), + cert: Deno.readTextFileSync("./localhost.crt"), + key: Deno.readTextFileSync("./localhost.key"), }); const response = encoder.encode( diff --git a/tests/specs/run/tls_starttls/RootCA.pem b/tests/specs/run/tls_starttls/RootCA.pem new file mode 100644 index 0000000000..c2f84ceebc --- /dev/null +++ b/tests/specs/run/tls_starttls/RootCA.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDIzCCAgugAwIBAgIJAMKPPW4tsOymMA0GCSqGSIb3DQEBCwUAMCcxCzAJBgNV +BAYTAlVTMRgwFgYDVQQDDA9FeGFtcGxlLVJvb3QtQ0EwIBcNMTkxMDIxMTYyODIy +WhgPMjExODA5MjcxNjI4MjJaMCcxCzAJBgNVBAYTAlVTMRgwFgYDVQQDDA9FeGFt +cGxlLVJvb3QtQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDMH/IO +2qtHfyBKwANNPB4K0q5JVSg8XxZdRpTTlz0CwU0oRO3uHrI52raCCfVeiQutyZop +eFZTDWeXGudGAFA2B5m3orWt0s+touPi8MzjsG2TQ+WSI66QgbXTNDitDDBtTVcV +5G3Ic+3SppQAYiHSekLISnYWgXLl+k5CnEfTowg6cjqjVr0KjL03cTN3H7b+6+0S +ws4rYbW1j4ExR7K6BFNH6572yq5qR20E6GqlY+EcOZpw4CbCk9lS8/CWuXze/vMs +OfDcc6K+B625d27wyEGZHedBomT2vAD7sBjvO8hn/DP1Qb46a8uCHR6NSfnJ7bXO +G1igaIbgY1zXirNdAgMBAAGjUDBOMB0GA1UdDgQWBBTzut+pwwDfqmMYcI9KNWRD +hxcIpTAfBgNVHSMEGDAWgBTzut+pwwDfqmMYcI9KNWRDhxcIpTAMBgNVHRMEBTAD +AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQB9AqSbZ+hEglAgSHxAMCqRFdhVu7MvaQM0 +P090mhGlOCt3yB7kdGfsIrUW6nQcTz7PPQFRaJMrFHPvFvPootkBUpTYR4hTkdce +H6RCRu2Jxl4Y9bY/uezd9YhGCYfUtfjA6/TH9FcuZfttmOOlxOt01XfNvVMIR6RM +z/AYhd+DeOXjr35F/VHeVpnk+55L0PYJsm1CdEbOs5Hy1ecR7ACuDkXnbM4fpz9I +kyIWJwk2zJReKcJMgi1aIinDM9ao/dca1G99PHOw8dnr4oyoTiv8ao6PWiSRHHMi +MNf4EgWfK+tZMnuqfpfO9740KzfcVoMNo4QJD4yn5YxroUOO/Azi +-----END CERTIFICATE----- diff --git a/tests/specs/run/tls_starttls/__test__.jsonc b/tests/specs/run/tls_starttls/__test__.jsonc new file mode 100644 index 0000000000..4c1fe6324d --- /dev/null +++ b/tests/specs/run/tls_starttls/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-net --allow-read --cert RootCA.pem --config deno.json tls_starttls.js", + "output": "tls.out" +} diff --git a/tests/specs/run/tls_starttls/deno.json b/tests/specs/run/tls_starttls/deno.json new file mode 100644 index 0000000000..105514e133 --- /dev/null +++ b/tests/specs/run/tls_starttls/deno.json @@ -0,0 +1,4 @@ +{ + "lock": false, + "importMap": "../../../../import_map.json" +} diff --git a/tests/specs/run/tls_starttls/localhost.crt b/tests/specs/run/tls_starttls/localhost.crt new file mode 100644 index 0000000000..a71ae9050f --- /dev/null +++ b/tests/specs/run/tls_starttls/localhost.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDajCCAlKgAwIBAgIJAOPyQVdy/UpPMA0GCSqGSIb3DQEBCwUAMCcxCzAJBgNV +BAYTAlVTMRgwFgYDVQQDDA9FeGFtcGxlLVJvb3QtQ0EwIBcNMTkxMDIxMTYyODU4 +WhgPMjExODA5MjcxNjI4NThaMG0xCzAJBgNVBAYTAlVTMRIwEAYDVQQIDAlZb3Vy +U3RhdGUxETAPBgNVBAcMCFlvdXJDaXR5MR0wGwYDVQQKDBRFeGFtcGxlLUNlcnRp +ZmljYXRlczEYMBYGA1UEAwwPbG9jYWxob3N0LmxvY2FsMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEAz9svjVdf5jihUBtofd84XKdb8dEHQRJfDNKaJ4Ar +baqMHAdnqi/fWtlqEEMn8gweZ7+4hshECY5mnx4Hhy7IAbePDsTTbSm01dChhlxF +uvd9QuvzvrqSjSq+v4Jlau+pQIhUzzV12dF5bFvrIrGWxCZp+W7lLDZI6Pd6Su+y +ZIeiwrUaPMzdUePNf2hZI/IvWCUMCIyoqrrKHdHoPuvQCW17IyxsnFQJNbmN+Rtp +BQilhtwvBbggCBWhHxEdiqBaZHDw6Zl+bU7ejx1mu9A95wpQ9SCL2cRkAlz2LDOy +wznrTAwGcvqvFKxlV+3HsaD7rba4kCA1Ihp5mm/dS2k94QIDAQABo1EwTzAfBgNV +HSMEGDAWgBTzut+pwwDfqmMYcI9KNWRDhxcIpTAJBgNVHRMEAjAAMAsGA1UdDwQE +AwIE8DAUBgNVHREEDTALgglsb2NhbGhvc3QwDQYJKoZIhvcNAQELBQADggEBAKVu +vVpu5nPGAGn1SX4FQUcbn9Z5wgBkjnZxfJHJQX4sYIRlcirZviPHCZGPWex4VHC+ +lFMm+70YEN2uoe5jGrdgcugzx2Amc7/mLrsvvpMsaS0PlxNMcqhdM1WHbGjjdNln +XICVITSKnB1fSGH6uo9CMCWw5kgPS9o4QWrLLkxnds3hoz7gVEUyi/6V65mcfFNA +lof9iKcK9JsSHdBs35vpv7UKLX+96RM7Nm2Mu0yue5JiS79/zuMA/Kryxot4jv5z +ecdWFl0eIyQBZmBzMw2zPUqkxEnXLiKjV8jutEg/4qovTOB6YiA41qbARXdzNA2V +FYuchcTcWmnmVVRFyyU= +-----END CERTIFICATE----- diff --git a/tests/specs/run/tls_starttls/localhost.key b/tests/specs/run/tls_starttls/localhost.key new file mode 100644 index 0000000000..42774c9771 --- /dev/null +++ b/tests/specs/run/tls_starttls/localhost.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDP2y+NV1/mOKFQ +G2h93zhcp1vx0QdBEl8M0pongCttqowcB2eqL99a2WoQQyfyDB5nv7iGyEQJjmaf +HgeHLsgBt48OxNNtKbTV0KGGXEW6931C6/O+upKNKr6/gmVq76lAiFTPNXXZ0Xls +W+sisZbEJmn5buUsNkjo93pK77Jkh6LCtRo8zN1R481/aFkj8i9YJQwIjKiqusod +0eg+69AJbXsjLGycVAk1uY35G2kFCKWG3C8FuCAIFaEfER2KoFpkcPDpmX5tTt6P +HWa70D3nClD1IIvZxGQCXPYsM7LDOetMDAZy+q8UrGVX7cexoPuttriQIDUiGnma +b91LaT3hAgMBAAECggEBAJABfn+BQorBP1m9s3ZJmcXvmW7+7/SwYrQCkRS+4te2 +6h1dMAAj7K4HpUkhDeLPbJ1aoeCXjTPFuemRp4uL6Lvvzahgy059L7FXOyFYemMf +pmQgDx5cKr6tF7yc/eDJrExuZ7urgTvouiRNxqmhuh+psZBDuXkZHwhwtQSH7uNg +KBDKu0qWO73vFLcLckdGEU3+H9oIWs5xcvvOkWzyvHbRGFJSihgcRpPPHodF5xB9 +T/gZIoJHMmCbUMlWaSasUyNXTuvCnkvBDol8vXrMJCVzKZj9GpPDcIFdc08GSn4I +pTdSNwzUcHbdERzdVU28Xt+t6W5rvp/4FWrssi4IzkUCgYEA//ZcEcBguRD4OFrx +6wbSjzCcUW1NWhzA8uTOORZi4SvndcH1cU4S2wznuHNubU1XlrGwJX6PUGebmY/l +53B5PJvStbVtZCVIxllR+ZVzRuL8wLodRHzlYH8GOzHwoa4ivSupkzl72ij1u/tI +NMLGfYEKVdNd8zXIESUY88NszvsCgYEAz+MDp3xOhFaCe+CPv80A592cJcfzc8Al ++rahEOu+VdN2QBZf86PIf2Bfv/t0QvnRvs1z648TuH6h83YSggOAbmfHyd789jkq +UWlktIaXbVn+VaHmPTcBWTg3ZTlvG+fiFCbZXiYhm+UUf1MDqZHdiifAoyVIjV/Z +YhCNJo3q39MCgYEAknrpK5t9fstwUcfyA/9OhnVaL9suVjB4V0iLn+3ovlXCywgp +ryLv9X3IKi2c9144jtu3I23vFCOGz3WjKzSZnQ7LogNmy9XudNxu5jcZ1mpWHPEl +iKk1F2j6Juwoek5OQRX4oHFYKHwiTOa75r3Em9Q6Fu20KVgQ24bwZafj3/sCgYAy +k0AoVw2jFIjaKl/Ogclen4OFjYek+XJD9Hpq62964d866Dafx5DXrFKfGkXGpZBp +owI4pK5fjC9KU8dc6g0szwLEEgPowy+QbtuZL8VXTTWbD7A75E3nrs2LStXFLDzM +OkdXqF801h6Oe1vAvUPwgItVJZTpEBCK0wwD/TLPEQKBgQDRkhlTtAoHW7W6STd0 +A/OWc0dxhzMurpxg0bLgCqUjw1ESGrSCGhffFn0IWa8sv19VWsZuBhTgjNatZsYB +AhDs/6OosT/3nJoh2/t0hYDj1FBI0lPXWYD4pesuZ5yIMrmSaAOtIzp4BGY7ui8N +wOqcq/jdiHj/MKEdqOXy3YAJrA== +-----END PRIVATE KEY----- diff --git a/tests/specs/run/tls_starttls/textproto.ts b/tests/specs/run/tls_starttls/textproto.ts new file mode 100644 index 0000000000..9e0f5f5f0a --- /dev/null +++ b/tests/specs/run/tls_starttls/textproto.ts @@ -0,0 +1,170 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/** **Deprecated**. Use `TextLineStream` from `std/steams` for line-by-line text reading instead. + * + * A reader for dealing with low level text based protocols. + * + * Based on + * [net/textproto](https://github.com/golang/go/tree/master/src/net/textproto). + * + * @deprecated (will be removed after 0.159.0) Use `TextLineStream` from `std/steams` for line-by-line text reading instead. + * @module + */ + +import type { BufReader, ReadLineResult } from "@std/io/buf-reader"; +import { concat } from "@std/bytes/concat"; + +// Constants created for DRY +const CHAR_SPACE: number = " ".charCodeAt(0); +const CHAR_TAB: number = "\t".charCodeAt(0); +const CHAR_COLON: number = ":".charCodeAt(0); + +const WHITESPACES: Array = [CHAR_SPACE, CHAR_TAB]; + +const decoder = new TextDecoder(); + +// FROM https://github.com/denoland/deno/blob/b34628a26ab0187a827aa4ebe256e23178e25d39/cli/js/web/headers.ts#L9 +const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/g; + +function str(buf: Uint8Array | null | undefined): string { + return !buf ? "" : decoder.decode(buf); +} + +/** + * @deprecated (will be removed after 0.159.0) Use `TextLineStream` from `std/steams` for line-by-line text reading instead. + */ +export class TextProtoReader { + constructor(readonly r: BufReader) {} + + /** readLine() reads a single line from the TextProtoReader, + * eliding the final \n or \r\n from the returned string. + */ + async readLine(): Promise { + const s = await this.readLineSlice(); + return s === null ? null : str(s); + } + + /** ReadMimeHeader reads a MIME-style header from r. + * The header is a sequence of possibly continued Key: Value lines + * ending in a blank line. + * The returned map m maps CanonicalMIMEHeaderKey(key) to a + * sequence of values in the same order encountered in the input. + * + * For example, consider this input: + * + * My-Key: Value 1 + * Long-Key: Even + * Longer Value + * My-Key: Value 2 + * + * Given that input, ReadMIMEHeader returns the map: + * + * map[string][]string{ + * "My-Key": {"Value 1", "Value 2"}, + * "Long-Key": {"Even Longer Value"}, + * } + */ + async readMimeHeader(): Promise { + const m = new Headers(); + let line: Uint8Array | undefined; + + // The first line cannot start with a leading space. + let buf = await this.r.peek(1); + if (buf === null) { + return null; + } else if (WHITESPACES.includes(buf[0])) { + line = (await this.readLineSlice()) as Uint8Array; + } + + buf = await this.r.peek(1); + if (buf === null) { + throw new Deno.errors.UnexpectedEof(); + } else if (WHITESPACES.includes(buf[0])) { + throw new Deno.errors.InvalidData( + `malformed MIME header initial line: ${str(line)}`, + ); + } + + while (true) { + const kv = await this.readLineSlice(); // readContinuedLineSlice + if (kv === null) throw new Deno.errors.UnexpectedEof(); + if (kv.byteLength === 0) return m; + + // Key ends at first colon + let i = kv.indexOf(CHAR_COLON); + if (i < 0) { + throw new Deno.errors.InvalidData( + `malformed MIME header line: ${str(kv)}`, + ); + } + + //let key = canonicalMIMEHeaderKey(kv.subarray(0, endKey)); + const key = str(kv.subarray(0, i)); + + // As per RFC 7230 field-name is a token, + // tokens consist of one or more chars. + // We could throw `Deno.errors.InvalidData` here, + // but better to be liberal in what we + // accept, so if we get an empty key, skip it. + if (key == "") { + continue; + } + + // Skip initial spaces in value. + i++; // skip colon + while ( + i < kv.byteLength && + (WHITESPACES.includes(kv[i])) + ) { + i++; + } + const value = str(kv.subarray(i)).replace( + invalidHeaderCharRegex, + encodeURI, + ); + + // In case of invalid header we swallow the error + // example: "Audio Mode" => invalid due to space in the key + try { + m.append(key, value); + } catch { + // Pass + } + } + } + + async readLineSlice(): Promise { + let line = new Uint8Array(0); + let r: ReadLineResult | null = null; + + do { + r = await this.r.readLine(); + // TODO(ry): + // This skipSpace() is definitely misplaced, but I don't know where it + // comes from nor how to fix it. + + //TODO(SmashingQuasar): Kept skipSpace to preserve behavior but it should be looked into to check if it makes sense when this is used. + + if (r !== null && this.skipSpace(r.line) !== 0) { + line = concat([line, r.line]); + } + } while (r !== null && r.more); + + return r === null ? null : line; + } + + skipSpace(l: Uint8Array): number { + let n = 0; + + for (const val of l) { + if (!WHITESPACES.includes(val)) { + n++; + } + } + + return n; + } +} diff --git a/tests/specs/run/tls_starttls/tls.out b/tests/specs/run/tls_starttls/tls.out new file mode 100644 index 0000000000..c8e8a135c9 --- /dev/null +++ b/tests/specs/run/tls_starttls/tls.out @@ -0,0 +1 @@ +DONE diff --git a/tests/testdata/run/tls_starttls.js b/tests/specs/run/tls_starttls/tls_starttls.js similarity index 94% rename from tests/testdata/run/tls_starttls.js rename to tests/specs/run/tls_starttls/tls_starttls.js index 8e7ac03ee6..cd5718ff5a 100644 --- a/tests/testdata/run/tls_starttls.js +++ b/tests/specs/run/tls_starttls/tls_starttls.js @@ -13,8 +13,8 @@ const port = 3504; const listener = Deno.listenTls({ hostname, port, - cert: Deno.readTextFileSync("./tls/localhost.crt"), - key: Deno.readTextFileSync("./tls/localhost.key"), + cert: Deno.readTextFileSync("./localhost.crt"), + key: Deno.readTextFileSync("./localhost.key"), }); const response = encoder.encode( diff --git a/tests/specs/run/top_level_await/__test__.jsonc b/tests/specs/run/top_level_await/__test__.jsonc new file mode 100644 index 0000000000..25537db5f4 --- /dev/null +++ b/tests/specs/run/top_level_await/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read top_level_await/top_level_await.js", + "output": "top_level_await/top_level_await.out" +} diff --git a/tests/specs/run/top_level_await/hello.txt b/tests/specs/run/top_level_await/hello.txt new file mode 100644 index 0000000000..6769dd60bd --- /dev/null +++ b/tests/specs/run/top_level_await/hello.txt @@ -0,0 +1 @@ +Hello world! \ No newline at end of file diff --git a/tests/testdata/run/top_level_await/circular.js b/tests/specs/run/top_level_await/top_level_await/circular.js similarity index 100% rename from tests/testdata/run/top_level_await/circular.js rename to tests/specs/run/top_level_await/top_level_await/circular.js diff --git a/tests/testdata/run/top_level_await/circular.out b/tests/specs/run/top_level_await/top_level_await/circular.out similarity index 100% rename from tests/testdata/run/top_level_await/circular.out rename to tests/specs/run/top_level_await/top_level_await/circular.out diff --git a/tests/specs/run/top_level_await/top_level_await/loop.js b/tests/specs/run/top_level_await/top_level_await/loop.js new file mode 100644 index 0000000000..f229e03f61 --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/loop.js @@ -0,0 +1,20 @@ +const importsDir = Deno.readDirSync( + Deno.realPathSync("./top_level_await/tla2"), +); + +const resolvedPaths = []; + +for (const { name } of importsDir) { + const filePath = Deno.realPathSync(`./top_level_await/tla2/${name}`); + resolvedPaths.push(filePath); +} + +resolvedPaths.sort(); + +for (const filePath of resolvedPaths) { + console.log("loading", filePath); + const mod = await import(`file://${filePath}`); + console.log("loaded", mod); +} + +console.log("all loaded"); diff --git a/tests/testdata/run/top_level_await/loop.out b/tests/specs/run/top_level_await/top_level_await/loop.out similarity index 100% rename from tests/testdata/run/top_level_await/loop.out rename to tests/specs/run/top_level_await/top_level_await/loop.out diff --git a/tests/testdata/run/top_level_await/nested.out b/tests/specs/run/top_level_await/top_level_await/nested.out similarity index 100% rename from tests/testdata/run/top_level_await/nested.out rename to tests/specs/run/top_level_await/top_level_await/nested.out diff --git a/tests/testdata/run/top_level_await/nested/a.js b/tests/specs/run/top_level_await/top_level_await/nested/a.js similarity index 100% rename from tests/testdata/run/top_level_await/nested/a.js rename to tests/specs/run/top_level_await/top_level_await/nested/a.js diff --git a/tests/testdata/run/top_level_await/nested/b.js b/tests/specs/run/top_level_await/top_level_await/nested/b.js similarity index 100% rename from tests/testdata/run/top_level_await/nested/b.js rename to tests/specs/run/top_level_await/top_level_await/nested/b.js diff --git a/tests/testdata/run/top_level_await/nested/main.js b/tests/specs/run/top_level_await/top_level_await/nested/main.js similarity index 100% rename from tests/testdata/run/top_level_await/nested/main.js rename to tests/specs/run/top_level_await/top_level_await/nested/main.js diff --git a/tests/testdata/run/top_level_await/order.js b/tests/specs/run/top_level_await/top_level_await/order.js similarity index 100% rename from tests/testdata/run/top_level_await/order.js rename to tests/specs/run/top_level_await/top_level_await/order.js diff --git a/tests/testdata/run/top_level_await/order.out b/tests/specs/run/top_level_await/top_level_await/order.out similarity index 100% rename from tests/testdata/run/top_level_await/order.out rename to tests/specs/run/top_level_await/top_level_await/order.out diff --git a/tests/specs/run/top_level_await/top_level_await/tla/a.js b/tests/specs/run/top_level_await/top_level_await/tla/a.js new file mode 100644 index 0000000000..c3ef3f7dbc --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/tla/a.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("b"); diff --git a/tests/specs/run/top_level_await/top_level_await/tla/b.js b/tests/specs/run/top_level_await/top_level_await/tla/b.js new file mode 100644 index 0000000000..3271c92d8f --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/tla/b.js @@ -0,0 +1,7 @@ +import order from "./order.js"; + +await new Promise((resolve) => { + setTimeout(resolve, 200); +}); + +order.push("a"); diff --git a/tests/specs/run/top_level_await/top_level_await/tla/c.js b/tests/specs/run/top_level_await/top_level_await/tla/c.js new file mode 100644 index 0000000000..806eb0a8be --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/tla/c.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("c"); diff --git a/tests/specs/run/top_level_await/top_level_await/tla/d.js b/tests/specs/run/top_level_await/top_level_await/tla/d.js new file mode 100644 index 0000000000..283ebf817f --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/tla/d.js @@ -0,0 +1,8 @@ +import order from "./order.js"; + +const end = Date.now() + 500; +while (end < Date.now()) { + // pass +} + +order.push("d"); diff --git a/tests/specs/run/top_level_await/top_level_await/tla/order.js b/tests/specs/run/top_level_await/top_level_await/tla/order.js new file mode 100644 index 0000000000..f213a562ce --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/tla/order.js @@ -0,0 +1 @@ +export default ["order"]; diff --git a/tests/specs/run/top_level_await/top_level_await/tla/parent.js b/tests/specs/run/top_level_await/top_level_await/tla/parent.js new file mode 100644 index 0000000000..1ecc154634 --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/tla/parent.js @@ -0,0 +1,9 @@ +import order from "./order.js"; +import "./a.js"; +import "./b.js"; +import "./c.js"; +import "./d.js"; + +order.push("parent"); + +export default order; diff --git a/tests/specs/run/top_level_await/top_level_await/tla2/a.js b/tests/specs/run/top_level_await/top_level_await/tla2/a.js new file mode 100644 index 0000000000..d07bcb94db --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/tla2/a.js @@ -0,0 +1,5 @@ +export default class Foo { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_await/top_level_await/tla2/b.js b/tests/specs/run/top_level_await/top_level_await/tla2/b.js new file mode 100644 index 0000000000..68e357c1e9 --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/tla2/b.js @@ -0,0 +1,5 @@ +export default class Bar { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_await/top_level_await/tla3/b.js b/tests/specs/run/top_level_await/top_level_await/tla3/b.js new file mode 100644 index 0000000000..d0349545e9 --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/tla3/b.js @@ -0,0 +1,7 @@ +import { foo } from "./timeout_loop.js"; +import { collection } from "../circular.js"; + +console.log("collection in b", collection); +console.log("foo in b", foo); + +export const a = "a"; diff --git a/tests/specs/run/top_level_await/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_await/top_level_await/tla3/timeout_loop.js new file mode 100644 index 0000000000..860e6cd2ae --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/tla3/timeout_loop.js @@ -0,0 +1,23 @@ +export const foo = "foo"; + +export function delay(ms) { + return new Promise((res) => + setTimeout(() => { + res(); + }, ms) + ); +} + +let i = 0; + +async function timeoutLoop() { + await delay(1000); + console.log("timeout loop", i); + i++; + if (i > 5) { + return; + } + timeoutLoop(); +} + +timeoutLoop(); diff --git a/tests/specs/run/top_level_await/top_level_await/top_level_await.js b/tests/specs/run/top_level_await/top_level_await/top_level_await.js new file mode 100644 index 0000000000..31c83caedc --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/top_level_await.js @@ -0,0 +1,3 @@ +const buf = await Deno.readFile("./hello.txt"); +const n = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/tests/testdata/run/top_level_await/top_level_await.out b/tests/specs/run/top_level_await/top_level_await/top_level_await.out similarity index 100% rename from tests/testdata/run/top_level_await/top_level_await.out rename to tests/specs/run/top_level_await/top_level_await/top_level_await.out diff --git a/tests/testdata/run/top_level_await/top_level_await.ts b/tests/specs/run/top_level_await/top_level_await/top_level_await.ts similarity index 100% rename from tests/testdata/run/top_level_await/top_level_await.ts rename to tests/specs/run/top_level_await/top_level_await/top_level_await.ts diff --git a/tests/testdata/run/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_await/top_level_await/top_level_for_await.js similarity index 100% rename from tests/testdata/run/top_level_await/top_level_for_await.js rename to tests/specs/run/top_level_await/top_level_await/top_level_for_await.js diff --git a/tests/testdata/run/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_await/top_level_await/top_level_for_await.out similarity index 100% rename from tests/testdata/run/top_level_await/top_level_for_await.out rename to tests/specs/run/top_level_await/top_level_await/top_level_for_await.out diff --git a/tests/testdata/run/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_await/top_level_await/top_level_for_await.ts similarity index 100% rename from tests/testdata/run/top_level_await/top_level_for_await.ts rename to tests/specs/run/top_level_await/top_level_await/top_level_for_await.ts diff --git a/tests/testdata/run/top_level_await/unresolved.js b/tests/specs/run/top_level_await/top_level_await/unresolved.js similarity index 100% rename from tests/testdata/run/top_level_await/unresolved.js rename to tests/specs/run/top_level_await/top_level_await/unresolved.js diff --git a/tests/testdata/run/top_level_await/unresolved.out b/tests/specs/run/top_level_await/top_level_await/unresolved.out similarity index 100% rename from tests/testdata/run/top_level_await/unresolved.out rename to tests/specs/run/top_level_await/top_level_await/unresolved.out diff --git a/tests/specs/run/top_level_await_circular/__test__.jsonc b/tests/specs/run/top_level_await_circular/__test__.jsonc new file mode 100644 index 0000000000..3e236b2107 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --allow-read top_level_await/circular.js", + "output": "top_level_await/circular.out", + "exitCode": 1 +} diff --git a/tests/specs/run/top_level_await_circular/top_level_await/circular.js b/tests/specs/run/top_level_await_circular/top_level_await/circular.js new file mode 100644 index 0000000000..ff2964b6a5 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/circular.js @@ -0,0 +1,8 @@ +import { foo } from "./tla3/timeout_loop.js"; + +export const collection = []; + +const mod = await import("./tla3/b.js"); + +console.log("foo in main", foo); +console.log("mod", mod); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/circular.out b/tests/specs/run/top_level_await_circular/top_level_await/circular.out new file mode 100644 index 0000000000..c889789613 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/circular.out @@ -0,0 +1,10 @@ +timeout loop 0 +timeout loop 1 +timeout loop 2 +timeout loop 3 +timeout loop 4 +timeout loop 5 +error: Top-level await promise never resolved +const mod = await import("./tla3/b.js"); + ^ + at ([WILDCARD]/top_level_await/circular.js:5:13) diff --git a/tests/specs/run/top_level_await_circular/top_level_await/loop.js b/tests/specs/run/top_level_await_circular/top_level_await/loop.js new file mode 100644 index 0000000000..f229e03f61 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/loop.js @@ -0,0 +1,20 @@ +const importsDir = Deno.readDirSync( + Deno.realPathSync("./top_level_await/tla2"), +); + +const resolvedPaths = []; + +for (const { name } of importsDir) { + const filePath = Deno.realPathSync(`./top_level_await/tla2/${name}`); + resolvedPaths.push(filePath); +} + +resolvedPaths.sort(); + +for (const filePath of resolvedPaths) { + console.log("loading", filePath); + const mod = await import(`file://${filePath}`); + console.log("loaded", mod); +} + +console.log("all loaded"); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/loop.out b/tests/specs/run/top_level_await_circular/top_level_await/loop.out new file mode 100644 index 0000000000..1bdffbf660 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/loop.out @@ -0,0 +1,5 @@ +loading [WILDCARD]a.js +loaded [Module: null prototype] { default: [class Foo] } +loading [WILDCARD]b.js +loaded [Module: null prototype] { default: [class Bar] } +all loaded diff --git a/tests/specs/run/top_level_await_circular/top_level_await/nested.out b/tests/specs/run/top_level_await_circular/top_level_await/nested.out new file mode 100644 index 0000000000..8a1218a102 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/nested.out @@ -0,0 +1,5 @@ +1 +2 +3 +4 +5 diff --git a/tests/specs/run/top_level_await_circular/top_level_await/nested/a.js b/tests/specs/run/top_level_await_circular/top_level_await/nested/a.js new file mode 100644 index 0000000000..74837d4ba1 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/nested/a.js @@ -0,0 +1,3 @@ +console.log(2); +await import("./b.js"); +console.log(4); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/nested/b.js b/tests/specs/run/top_level_await_circular/top_level_await/nested/b.js new file mode 100644 index 0000000000..3bd241b50e --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/nested/b.js @@ -0,0 +1 @@ +console.log(3); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/nested/main.js b/tests/specs/run/top_level_await_circular/top_level_await/nested/main.js new file mode 100644 index 0000000000..ed46a47175 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/nested/main.js @@ -0,0 +1,3 @@ +console.log(1); +await import("./a.js"); +console.log(5); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/order.js b/tests/specs/run/top_level_await_circular/top_level_await/order.js new file mode 100644 index 0000000000..30659cdfbf --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/order.js @@ -0,0 +1,21 @@ +// Ported from Node +// https://github.com/nodejs/node/blob/54746bb763ebea0dc7e99d88ff4b379bcd680964/test/es-module/test-esm-tla.mjs + +const { default: order } = await import("./tla/parent.js"); + +console.log("order", JSON.stringify(order)); + +if ( + !( + order[0] === "order" && + order[1] === "b" && + order[2] === "c" && + order[3] === "d" && + order[4] === "a" && + order[5] === "parent" + ) +) { + throw new Error("TLA wrong order"); +} + +console.log("TLA order correct"); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/order.out b/tests/specs/run/top_level_await_circular/top_level_await/order.out new file mode 100644 index 0000000000..4cc27858cf --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/order.out @@ -0,0 +1,2 @@ +order ["order","b","c","d","a","parent"] +TLA order correct diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla/a.js b/tests/specs/run/top_level_await_circular/top_level_await/tla/a.js new file mode 100644 index 0000000000..c3ef3f7dbc --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/tla/a.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("b"); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla/b.js b/tests/specs/run/top_level_await_circular/top_level_await/tla/b.js new file mode 100644 index 0000000000..3271c92d8f --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/tla/b.js @@ -0,0 +1,7 @@ +import order from "./order.js"; + +await new Promise((resolve) => { + setTimeout(resolve, 200); +}); + +order.push("a"); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla/c.js b/tests/specs/run/top_level_await_circular/top_level_await/tla/c.js new file mode 100644 index 0000000000..806eb0a8be --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/tla/c.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("c"); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla/d.js b/tests/specs/run/top_level_await_circular/top_level_await/tla/d.js new file mode 100644 index 0000000000..283ebf817f --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/tla/d.js @@ -0,0 +1,8 @@ +import order from "./order.js"; + +const end = Date.now() + 500; +while (end < Date.now()) { + // pass +} + +order.push("d"); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla/order.js b/tests/specs/run/top_level_await_circular/top_level_await/tla/order.js new file mode 100644 index 0000000000..f213a562ce --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/tla/order.js @@ -0,0 +1 @@ +export default ["order"]; diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla/parent.js b/tests/specs/run/top_level_await_circular/top_level_await/tla/parent.js new file mode 100644 index 0000000000..1ecc154634 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/tla/parent.js @@ -0,0 +1,9 @@ +import order from "./order.js"; +import "./a.js"; +import "./b.js"; +import "./c.js"; +import "./d.js"; + +order.push("parent"); + +export default order; diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla2/a.js b/tests/specs/run/top_level_await_circular/top_level_await/tla2/a.js new file mode 100644 index 0000000000..d07bcb94db --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/tla2/a.js @@ -0,0 +1,5 @@ +export default class Foo { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla2/b.js b/tests/specs/run/top_level_await_circular/top_level_await/tla2/b.js new file mode 100644 index 0000000000..68e357c1e9 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/tla2/b.js @@ -0,0 +1,5 @@ +export default class Bar { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla3/b.js b/tests/specs/run/top_level_await_circular/top_level_await/tla3/b.js new file mode 100644 index 0000000000..d0349545e9 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/tla3/b.js @@ -0,0 +1,7 @@ +import { foo } from "./timeout_loop.js"; +import { collection } from "../circular.js"; + +console.log("collection in b", collection); +console.log("foo in b", foo); + +export const a = "a"; diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_await_circular/top_level_await/tla3/timeout_loop.js new file mode 100644 index 0000000000..860e6cd2ae --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/tla3/timeout_loop.js @@ -0,0 +1,23 @@ +export const foo = "foo"; + +export function delay(ms) { + return new Promise((res) => + setTimeout(() => { + res(); + }, ms) + ); +} + +let i = 0; + +async function timeoutLoop() { + await delay(1000); + console.log("timeout loop", i); + i++; + if (i > 5) { + return; + } + timeoutLoop(); +} + +timeoutLoop(); diff --git a/tests/testdata/run/top_level_await/top_level_await.js b/tests/specs/run/top_level_await_circular/top_level_await/top_level_await.js similarity index 100% rename from tests/testdata/run/top_level_await/top_level_await.js rename to tests/specs/run/top_level_await_circular/top_level_await/top_level_await.js diff --git a/tests/specs/run/top_level_await_circular/top_level_await/top_level_await.out b/tests/specs/run/top_level_await_circular/top_level_await/top_level_await.out new file mode 100644 index 0000000000..4b65d15fe3 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/top_level_await.out @@ -0,0 +1,3 @@ +Hello world! + +write 12 diff --git a/tests/specs/run/top_level_await_circular/top_level_await/top_level_await.ts b/tests/specs/run/top_level_await_circular/top_level_await/top_level_await.ts new file mode 100644 index 0000000000..8d47ceb21e --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/top_level_await.ts @@ -0,0 +1,3 @@ +const buf: Uint8Array = await Deno.readFile("./assets/hello.txt"); +const n: number = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.js new file mode 100644 index 0000000000..a330f6c711 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.js @@ -0,0 +1,10 @@ +function* asyncGenerator() { + let i = 0; + while (i < 3) { + yield i++; + } +} + +for await (const num of asyncGenerator()) { + console.log(num); +} diff --git a/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.out new file mode 100644 index 0000000000..4539bbf2d2 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.out @@ -0,0 +1,3 @@ +0 +1 +2 diff --git a/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.ts new file mode 100644 index 0000000000..9179322d78 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.ts @@ -0,0 +1,10 @@ +async function* asyncGenerator(): AsyncIterableIterator { + let i = 0; + while (i < 3) { + yield i++; + } +} + +for await (const num of asyncGenerator()) { + console.log(num); +} diff --git a/tests/specs/run/top_level_await_circular/top_level_await/unresolved.js b/tests/specs/run/top_level_await_circular/top_level_await/unresolved.js new file mode 100644 index 0000000000..231a8cd634 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/unresolved.js @@ -0,0 +1 @@ +await new Promise(() => {}); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/unresolved.out b/tests/specs/run/top_level_await_circular/top_level_await/unresolved.out new file mode 100644 index 0000000000..1f4ea5d382 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/top_level_await/unresolved.out @@ -0,0 +1,4 @@ +error: Top-level await promise never resolved +await new Promise(() => {}); +^ + at ([WILDCARD]top_level_await/unresolved.js:1:1) diff --git a/tests/specs/run/top_level_await_loop/__test__.jsonc b/tests/specs/run/top_level_await_loop/__test__.jsonc new file mode 100644 index 0000000000..b2f5c84c03 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read top_level_await/loop.js", + "output": "top_level_await/loop.out" +} diff --git a/tests/specs/run/top_level_await_loop/top_level_await/circular.js b/tests/specs/run/top_level_await_loop/top_level_await/circular.js new file mode 100644 index 0000000000..ff2964b6a5 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/circular.js @@ -0,0 +1,8 @@ +import { foo } from "./tla3/timeout_loop.js"; + +export const collection = []; + +const mod = await import("./tla3/b.js"); + +console.log("foo in main", foo); +console.log("mod", mod); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/circular.out b/tests/specs/run/top_level_await_loop/top_level_await/circular.out new file mode 100644 index 0000000000..c889789613 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/circular.out @@ -0,0 +1,10 @@ +timeout loop 0 +timeout loop 1 +timeout loop 2 +timeout loop 3 +timeout loop 4 +timeout loop 5 +error: Top-level await promise never resolved +const mod = await import("./tla3/b.js"); + ^ + at ([WILDCARD]/top_level_await/circular.js:5:13) diff --git a/tests/specs/run/top_level_await_loop/top_level_await/loop.js b/tests/specs/run/top_level_await_loop/top_level_await/loop.js new file mode 100644 index 0000000000..f229e03f61 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/loop.js @@ -0,0 +1,20 @@ +const importsDir = Deno.readDirSync( + Deno.realPathSync("./top_level_await/tla2"), +); + +const resolvedPaths = []; + +for (const { name } of importsDir) { + const filePath = Deno.realPathSync(`./top_level_await/tla2/${name}`); + resolvedPaths.push(filePath); +} + +resolvedPaths.sort(); + +for (const filePath of resolvedPaths) { + console.log("loading", filePath); + const mod = await import(`file://${filePath}`); + console.log("loaded", mod); +} + +console.log("all loaded"); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/loop.out b/tests/specs/run/top_level_await_loop/top_level_await/loop.out new file mode 100644 index 0000000000..1bdffbf660 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/loop.out @@ -0,0 +1,5 @@ +loading [WILDCARD]a.js +loaded [Module: null prototype] { default: [class Foo] } +loading [WILDCARD]b.js +loaded [Module: null prototype] { default: [class Bar] } +all loaded diff --git a/tests/specs/run/top_level_await_loop/top_level_await/nested.out b/tests/specs/run/top_level_await_loop/top_level_await/nested.out new file mode 100644 index 0000000000..8a1218a102 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/nested.out @@ -0,0 +1,5 @@ +1 +2 +3 +4 +5 diff --git a/tests/specs/run/top_level_await_loop/top_level_await/nested/a.js b/tests/specs/run/top_level_await_loop/top_level_await/nested/a.js new file mode 100644 index 0000000000..74837d4ba1 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/nested/a.js @@ -0,0 +1,3 @@ +console.log(2); +await import("./b.js"); +console.log(4); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/nested/b.js b/tests/specs/run/top_level_await_loop/top_level_await/nested/b.js new file mode 100644 index 0000000000..3bd241b50e --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/nested/b.js @@ -0,0 +1 @@ +console.log(3); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/nested/main.js b/tests/specs/run/top_level_await_loop/top_level_await/nested/main.js new file mode 100644 index 0000000000..ed46a47175 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/nested/main.js @@ -0,0 +1,3 @@ +console.log(1); +await import("./a.js"); +console.log(5); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/order.js b/tests/specs/run/top_level_await_loop/top_level_await/order.js new file mode 100644 index 0000000000..30659cdfbf --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/order.js @@ -0,0 +1,21 @@ +// Ported from Node +// https://github.com/nodejs/node/blob/54746bb763ebea0dc7e99d88ff4b379bcd680964/test/es-module/test-esm-tla.mjs + +const { default: order } = await import("./tla/parent.js"); + +console.log("order", JSON.stringify(order)); + +if ( + !( + order[0] === "order" && + order[1] === "b" && + order[2] === "c" && + order[3] === "d" && + order[4] === "a" && + order[5] === "parent" + ) +) { + throw new Error("TLA wrong order"); +} + +console.log("TLA order correct"); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/order.out b/tests/specs/run/top_level_await_loop/top_level_await/order.out new file mode 100644 index 0000000000..4cc27858cf --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/order.out @@ -0,0 +1,2 @@ +order ["order","b","c","d","a","parent"] +TLA order correct diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla/a.js b/tests/specs/run/top_level_await_loop/top_level_await/tla/a.js new file mode 100644 index 0000000000..c3ef3f7dbc --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/tla/a.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("b"); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla/b.js b/tests/specs/run/top_level_await_loop/top_level_await/tla/b.js new file mode 100644 index 0000000000..3271c92d8f --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/tla/b.js @@ -0,0 +1,7 @@ +import order from "./order.js"; + +await new Promise((resolve) => { + setTimeout(resolve, 200); +}); + +order.push("a"); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla/c.js b/tests/specs/run/top_level_await_loop/top_level_await/tla/c.js new file mode 100644 index 0000000000..806eb0a8be --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/tla/c.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("c"); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla/d.js b/tests/specs/run/top_level_await_loop/top_level_await/tla/d.js new file mode 100644 index 0000000000..283ebf817f --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/tla/d.js @@ -0,0 +1,8 @@ +import order from "./order.js"; + +const end = Date.now() + 500; +while (end < Date.now()) { + // pass +} + +order.push("d"); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla/order.js b/tests/specs/run/top_level_await_loop/top_level_await/tla/order.js new file mode 100644 index 0000000000..f213a562ce --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/tla/order.js @@ -0,0 +1 @@ +export default ["order"]; diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla/parent.js b/tests/specs/run/top_level_await_loop/top_level_await/tla/parent.js new file mode 100644 index 0000000000..1ecc154634 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/tla/parent.js @@ -0,0 +1,9 @@ +import order from "./order.js"; +import "./a.js"; +import "./b.js"; +import "./c.js"; +import "./d.js"; + +order.push("parent"); + +export default order; diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla2/a.js b/tests/specs/run/top_level_await_loop/top_level_await/tla2/a.js new file mode 100644 index 0000000000..d07bcb94db --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/tla2/a.js @@ -0,0 +1,5 @@ +export default class Foo { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla2/b.js b/tests/specs/run/top_level_await_loop/top_level_await/tla2/b.js new file mode 100644 index 0000000000..68e357c1e9 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/tla2/b.js @@ -0,0 +1,5 @@ +export default class Bar { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla3/b.js b/tests/specs/run/top_level_await_loop/top_level_await/tla3/b.js new file mode 100644 index 0000000000..d0349545e9 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/tla3/b.js @@ -0,0 +1,7 @@ +import { foo } from "./timeout_loop.js"; +import { collection } from "../circular.js"; + +console.log("collection in b", collection); +console.log("foo in b", foo); + +export const a = "a"; diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_await_loop/top_level_await/tla3/timeout_loop.js new file mode 100644 index 0000000000..860e6cd2ae --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/tla3/timeout_loop.js @@ -0,0 +1,23 @@ +export const foo = "foo"; + +export function delay(ms) { + return new Promise((res) => + setTimeout(() => { + res(); + }, ms) + ); +} + +let i = 0; + +async function timeoutLoop() { + await delay(1000); + console.log("timeout loop", i); + i++; + if (i > 5) { + return; + } + timeoutLoop(); +} + +timeoutLoop(); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.js b/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.js new file mode 100644 index 0000000000..ea319ea124 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.js @@ -0,0 +1,3 @@ +const buf = await Deno.readFile("./assets/hello.txt"); +const n = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.out b/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.out new file mode 100644 index 0000000000..4b65d15fe3 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.out @@ -0,0 +1,3 @@ +Hello world! + +write 12 diff --git a/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.ts b/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.ts new file mode 100644 index 0000000000..8d47ceb21e --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.ts @@ -0,0 +1,3 @@ +const buf: Uint8Array = await Deno.readFile("./assets/hello.txt"); +const n: number = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.js new file mode 100644 index 0000000000..a330f6c711 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.js @@ -0,0 +1,10 @@ +function* asyncGenerator() { + let i = 0; + while (i < 3) { + yield i++; + } +} + +for await (const num of asyncGenerator()) { + console.log(num); +} diff --git a/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.out new file mode 100644 index 0000000000..4539bbf2d2 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.out @@ -0,0 +1,3 @@ +0 +1 +2 diff --git a/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.ts new file mode 100644 index 0000000000..9179322d78 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.ts @@ -0,0 +1,10 @@ +async function* asyncGenerator(): AsyncIterableIterator { + let i = 0; + while (i < 3) { + yield i++; + } +} + +for await (const num of asyncGenerator()) { + console.log(num); +} diff --git a/tests/specs/run/top_level_await_loop/top_level_await/unresolved.js b/tests/specs/run/top_level_await_loop/top_level_await/unresolved.js new file mode 100644 index 0000000000..231a8cd634 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/unresolved.js @@ -0,0 +1 @@ +await new Promise(() => {}); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/unresolved.out b/tests/specs/run/top_level_await_loop/top_level_await/unresolved.out new file mode 100644 index 0000000000..1f4ea5d382 --- /dev/null +++ b/tests/specs/run/top_level_await_loop/top_level_await/unresolved.out @@ -0,0 +1,4 @@ +error: Top-level await promise never resolved +await new Promise(() => {}); +^ + at ([WILDCARD]top_level_await/unresolved.js:1:1) diff --git a/tests/specs/run/top_level_await_nested/__test__.jsonc b/tests/specs/run/top_level_await_nested/__test__.jsonc new file mode 100644 index 0000000000..376180ecdc --- /dev/null +++ b/tests/specs/run/top_level_await_nested/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read top_level_await/nested/main.js", + "output": "top_level_await/nested.out" +} diff --git a/tests/specs/run/top_level_await_nested/top_level_await/circular.js b/tests/specs/run/top_level_await_nested/top_level_await/circular.js new file mode 100644 index 0000000000..ff2964b6a5 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/circular.js @@ -0,0 +1,8 @@ +import { foo } from "./tla3/timeout_loop.js"; + +export const collection = []; + +const mod = await import("./tla3/b.js"); + +console.log("foo in main", foo); +console.log("mod", mod); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/circular.out b/tests/specs/run/top_level_await_nested/top_level_await/circular.out new file mode 100644 index 0000000000..c889789613 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/circular.out @@ -0,0 +1,10 @@ +timeout loop 0 +timeout loop 1 +timeout loop 2 +timeout loop 3 +timeout loop 4 +timeout loop 5 +error: Top-level await promise never resolved +const mod = await import("./tla3/b.js"); + ^ + at ([WILDCARD]/top_level_await/circular.js:5:13) diff --git a/tests/testdata/run/top_level_await/loop.js b/tests/specs/run/top_level_await_nested/top_level_await/loop.js similarity index 100% rename from tests/testdata/run/top_level_await/loop.js rename to tests/specs/run/top_level_await_nested/top_level_await/loop.js diff --git a/tests/specs/run/top_level_await_nested/top_level_await/loop.out b/tests/specs/run/top_level_await_nested/top_level_await/loop.out new file mode 100644 index 0000000000..1bdffbf660 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/loop.out @@ -0,0 +1,5 @@ +loading [WILDCARD]a.js +loaded [Module: null prototype] { default: [class Foo] } +loading [WILDCARD]b.js +loaded [Module: null prototype] { default: [class Bar] } +all loaded diff --git a/tests/specs/run/top_level_await_nested/top_level_await/nested.out b/tests/specs/run/top_level_await_nested/top_level_await/nested.out new file mode 100644 index 0000000000..8a1218a102 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/nested.out @@ -0,0 +1,5 @@ +1 +2 +3 +4 +5 diff --git a/tests/specs/run/top_level_await_nested/top_level_await/nested/a.js b/tests/specs/run/top_level_await_nested/top_level_await/nested/a.js new file mode 100644 index 0000000000..74837d4ba1 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/nested/a.js @@ -0,0 +1,3 @@ +console.log(2); +await import("./b.js"); +console.log(4); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/nested/b.js b/tests/specs/run/top_level_await_nested/top_level_await/nested/b.js new file mode 100644 index 0000000000..3bd241b50e --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/nested/b.js @@ -0,0 +1 @@ +console.log(3); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/nested/main.js b/tests/specs/run/top_level_await_nested/top_level_await/nested/main.js new file mode 100644 index 0000000000..ed46a47175 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/nested/main.js @@ -0,0 +1,3 @@ +console.log(1); +await import("./a.js"); +console.log(5); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/order.js b/tests/specs/run/top_level_await_nested/top_level_await/order.js new file mode 100644 index 0000000000..30659cdfbf --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/order.js @@ -0,0 +1,21 @@ +// Ported from Node +// https://github.com/nodejs/node/blob/54746bb763ebea0dc7e99d88ff4b379bcd680964/test/es-module/test-esm-tla.mjs + +const { default: order } = await import("./tla/parent.js"); + +console.log("order", JSON.stringify(order)); + +if ( + !( + order[0] === "order" && + order[1] === "b" && + order[2] === "c" && + order[3] === "d" && + order[4] === "a" && + order[5] === "parent" + ) +) { + throw new Error("TLA wrong order"); +} + +console.log("TLA order correct"); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/order.out b/tests/specs/run/top_level_await_nested/top_level_await/order.out new file mode 100644 index 0000000000..4cc27858cf --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/order.out @@ -0,0 +1,2 @@ +order ["order","b","c","d","a","parent"] +TLA order correct diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla/a.js b/tests/specs/run/top_level_await_nested/top_level_await/tla/a.js new file mode 100644 index 0000000000..c3ef3f7dbc --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/tla/a.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("b"); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla/b.js b/tests/specs/run/top_level_await_nested/top_level_await/tla/b.js new file mode 100644 index 0000000000..3271c92d8f --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/tla/b.js @@ -0,0 +1,7 @@ +import order from "./order.js"; + +await new Promise((resolve) => { + setTimeout(resolve, 200); +}); + +order.push("a"); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla/c.js b/tests/specs/run/top_level_await_nested/top_level_await/tla/c.js new file mode 100644 index 0000000000..806eb0a8be --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/tla/c.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("c"); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla/d.js b/tests/specs/run/top_level_await_nested/top_level_await/tla/d.js new file mode 100644 index 0000000000..283ebf817f --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/tla/d.js @@ -0,0 +1,8 @@ +import order from "./order.js"; + +const end = Date.now() + 500; +while (end < Date.now()) { + // pass +} + +order.push("d"); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla/order.js b/tests/specs/run/top_level_await_nested/top_level_await/tla/order.js new file mode 100644 index 0000000000..f213a562ce --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/tla/order.js @@ -0,0 +1 @@ +export default ["order"]; diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla/parent.js b/tests/specs/run/top_level_await_nested/top_level_await/tla/parent.js new file mode 100644 index 0000000000..1ecc154634 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/tla/parent.js @@ -0,0 +1,9 @@ +import order from "./order.js"; +import "./a.js"; +import "./b.js"; +import "./c.js"; +import "./d.js"; + +order.push("parent"); + +export default order; diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla2/a.js b/tests/specs/run/top_level_await_nested/top_level_await/tla2/a.js new file mode 100644 index 0000000000..d07bcb94db --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/tla2/a.js @@ -0,0 +1,5 @@ +export default class Foo { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla2/b.js b/tests/specs/run/top_level_await_nested/top_level_await/tla2/b.js new file mode 100644 index 0000000000..68e357c1e9 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/tla2/b.js @@ -0,0 +1,5 @@ +export default class Bar { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla3/b.js b/tests/specs/run/top_level_await_nested/top_level_await/tla3/b.js new file mode 100644 index 0000000000..d0349545e9 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/tla3/b.js @@ -0,0 +1,7 @@ +import { foo } from "./timeout_loop.js"; +import { collection } from "../circular.js"; + +console.log("collection in b", collection); +console.log("foo in b", foo); + +export const a = "a"; diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_await_nested/top_level_await/tla3/timeout_loop.js new file mode 100644 index 0000000000..860e6cd2ae --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/tla3/timeout_loop.js @@ -0,0 +1,23 @@ +export const foo = "foo"; + +export function delay(ms) { + return new Promise((res) => + setTimeout(() => { + res(); + }, ms) + ); +} + +let i = 0; + +async function timeoutLoop() { + await delay(1000); + console.log("timeout loop", i); + i++; + if (i > 5) { + return; + } + timeoutLoop(); +} + +timeoutLoop(); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.js b/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.js new file mode 100644 index 0000000000..ea319ea124 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.js @@ -0,0 +1,3 @@ +const buf = await Deno.readFile("./assets/hello.txt"); +const n = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.out b/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.out new file mode 100644 index 0000000000..4b65d15fe3 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.out @@ -0,0 +1,3 @@ +Hello world! + +write 12 diff --git a/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.ts b/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.ts new file mode 100644 index 0000000000..8d47ceb21e --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.ts @@ -0,0 +1,3 @@ +const buf: Uint8Array = await Deno.readFile("./assets/hello.txt"); +const n: number = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.js new file mode 100644 index 0000000000..a330f6c711 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.js @@ -0,0 +1,10 @@ +function* asyncGenerator() { + let i = 0; + while (i < 3) { + yield i++; + } +} + +for await (const num of asyncGenerator()) { + console.log(num); +} diff --git a/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.out new file mode 100644 index 0000000000..4539bbf2d2 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.out @@ -0,0 +1,3 @@ +0 +1 +2 diff --git a/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.ts new file mode 100644 index 0000000000..9179322d78 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.ts @@ -0,0 +1,10 @@ +async function* asyncGenerator(): AsyncIterableIterator { + let i = 0; + while (i < 3) { + yield i++; + } +} + +for await (const num of asyncGenerator()) { + console.log(num); +} diff --git a/tests/specs/run/top_level_await_nested/top_level_await/unresolved.js b/tests/specs/run/top_level_await_nested/top_level_await/unresolved.js new file mode 100644 index 0000000000..231a8cd634 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/unresolved.js @@ -0,0 +1 @@ +await new Promise(() => {}); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/unresolved.out b/tests/specs/run/top_level_await_nested/top_level_await/unresolved.out new file mode 100644 index 0000000000..1f4ea5d382 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/top_level_await/unresolved.out @@ -0,0 +1,4 @@ +error: Top-level await promise never resolved +await new Promise(() => {}); +^ + at ([WILDCARD]top_level_await/unresolved.js:1:1) diff --git a/tests/specs/run/top_level_await_order/__test__.jsonc b/tests/specs/run/top_level_await_order/__test__.jsonc new file mode 100644 index 0000000000..65d00d607d --- /dev/null +++ b/tests/specs/run/top_level_await_order/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read top_level_await/order.js", + "output": "top_level_await/order.out" +} diff --git a/tests/specs/run/top_level_await_order/top_level_await/circular.js b/tests/specs/run/top_level_await_order/top_level_await/circular.js new file mode 100644 index 0000000000..ff2964b6a5 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/circular.js @@ -0,0 +1,8 @@ +import { foo } from "./tla3/timeout_loop.js"; + +export const collection = []; + +const mod = await import("./tla3/b.js"); + +console.log("foo in main", foo); +console.log("mod", mod); diff --git a/tests/specs/run/top_level_await_order/top_level_await/circular.out b/tests/specs/run/top_level_await_order/top_level_await/circular.out new file mode 100644 index 0000000000..c889789613 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/circular.out @@ -0,0 +1,10 @@ +timeout loop 0 +timeout loop 1 +timeout loop 2 +timeout loop 3 +timeout loop 4 +timeout loop 5 +error: Top-level await promise never resolved +const mod = await import("./tla3/b.js"); + ^ + at ([WILDCARD]/top_level_await/circular.js:5:13) diff --git a/tests/specs/run/top_level_await_order/top_level_await/loop.js b/tests/specs/run/top_level_await_order/top_level_await/loop.js new file mode 100644 index 0000000000..415db5ec78 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/loop.js @@ -0,0 +1,20 @@ +const importsDir = Deno.readDirSync( + Deno.realPathSync("./run/top_level_await/tla2"), +); + +const resolvedPaths = []; + +for (const { name } of importsDir) { + const filePath = Deno.realPathSync(`./run/top_level_await/tla2/${name}`); + resolvedPaths.push(filePath); +} + +resolvedPaths.sort(); + +for (const filePath of resolvedPaths) { + console.log("loading", filePath); + const mod = await import(`file://${filePath}`); + console.log("loaded", mod); +} + +console.log("all loaded"); diff --git a/tests/specs/run/top_level_await_order/top_level_await/loop.out b/tests/specs/run/top_level_await_order/top_level_await/loop.out new file mode 100644 index 0000000000..1bdffbf660 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/loop.out @@ -0,0 +1,5 @@ +loading [WILDCARD]a.js +loaded [Module: null prototype] { default: [class Foo] } +loading [WILDCARD]b.js +loaded [Module: null prototype] { default: [class Bar] } +all loaded diff --git a/tests/specs/run/top_level_await_order/top_level_await/nested.out b/tests/specs/run/top_level_await_order/top_level_await/nested.out new file mode 100644 index 0000000000..8a1218a102 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/nested.out @@ -0,0 +1,5 @@ +1 +2 +3 +4 +5 diff --git a/tests/specs/run/top_level_await_order/top_level_await/nested/a.js b/tests/specs/run/top_level_await_order/top_level_await/nested/a.js new file mode 100644 index 0000000000..74837d4ba1 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/nested/a.js @@ -0,0 +1,3 @@ +console.log(2); +await import("./b.js"); +console.log(4); diff --git a/tests/specs/run/top_level_await_order/top_level_await/nested/b.js b/tests/specs/run/top_level_await_order/top_level_await/nested/b.js new file mode 100644 index 0000000000..3bd241b50e --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/nested/b.js @@ -0,0 +1 @@ +console.log(3); diff --git a/tests/specs/run/top_level_await_order/top_level_await/nested/main.js b/tests/specs/run/top_level_await_order/top_level_await/nested/main.js new file mode 100644 index 0000000000..ed46a47175 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/nested/main.js @@ -0,0 +1,3 @@ +console.log(1); +await import("./a.js"); +console.log(5); diff --git a/tests/specs/run/top_level_await_order/top_level_await/order.js b/tests/specs/run/top_level_await_order/top_level_await/order.js new file mode 100644 index 0000000000..30659cdfbf --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/order.js @@ -0,0 +1,21 @@ +// Ported from Node +// https://github.com/nodejs/node/blob/54746bb763ebea0dc7e99d88ff4b379bcd680964/test/es-module/test-esm-tla.mjs + +const { default: order } = await import("./tla/parent.js"); + +console.log("order", JSON.stringify(order)); + +if ( + !( + order[0] === "order" && + order[1] === "b" && + order[2] === "c" && + order[3] === "d" && + order[4] === "a" && + order[5] === "parent" + ) +) { + throw new Error("TLA wrong order"); +} + +console.log("TLA order correct"); diff --git a/tests/specs/run/top_level_await_order/top_level_await/order.out b/tests/specs/run/top_level_await_order/top_level_await/order.out new file mode 100644 index 0000000000..4cc27858cf --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/order.out @@ -0,0 +1,2 @@ +order ["order","b","c","d","a","parent"] +TLA order correct diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla/a.js b/tests/specs/run/top_level_await_order/top_level_await/tla/a.js new file mode 100644 index 0000000000..c3ef3f7dbc --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/tla/a.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("b"); diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla/b.js b/tests/specs/run/top_level_await_order/top_level_await/tla/b.js new file mode 100644 index 0000000000..3271c92d8f --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/tla/b.js @@ -0,0 +1,7 @@ +import order from "./order.js"; + +await new Promise((resolve) => { + setTimeout(resolve, 200); +}); + +order.push("a"); diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla/c.js b/tests/specs/run/top_level_await_order/top_level_await/tla/c.js new file mode 100644 index 0000000000..806eb0a8be --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/tla/c.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("c"); diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla/d.js b/tests/specs/run/top_level_await_order/top_level_await/tla/d.js new file mode 100644 index 0000000000..283ebf817f --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/tla/d.js @@ -0,0 +1,8 @@ +import order from "./order.js"; + +const end = Date.now() + 500; +while (end < Date.now()) { + // pass +} + +order.push("d"); diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla/order.js b/tests/specs/run/top_level_await_order/top_level_await/tla/order.js new file mode 100644 index 0000000000..f213a562ce --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/tla/order.js @@ -0,0 +1 @@ +export default ["order"]; diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla/parent.js b/tests/specs/run/top_level_await_order/top_level_await/tla/parent.js new file mode 100644 index 0000000000..1ecc154634 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/tla/parent.js @@ -0,0 +1,9 @@ +import order from "./order.js"; +import "./a.js"; +import "./b.js"; +import "./c.js"; +import "./d.js"; + +order.push("parent"); + +export default order; diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla2/a.js b/tests/specs/run/top_level_await_order/top_level_await/tla2/a.js new file mode 100644 index 0000000000..d07bcb94db --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/tla2/a.js @@ -0,0 +1,5 @@ +export default class Foo { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla2/b.js b/tests/specs/run/top_level_await_order/top_level_await/tla2/b.js new file mode 100644 index 0000000000..68e357c1e9 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/tla2/b.js @@ -0,0 +1,5 @@ +export default class Bar { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla3/b.js b/tests/specs/run/top_level_await_order/top_level_await/tla3/b.js new file mode 100644 index 0000000000..d0349545e9 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/tla3/b.js @@ -0,0 +1,7 @@ +import { foo } from "./timeout_loop.js"; +import { collection } from "../circular.js"; + +console.log("collection in b", collection); +console.log("foo in b", foo); + +export const a = "a"; diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_await_order/top_level_await/tla3/timeout_loop.js new file mode 100644 index 0000000000..860e6cd2ae --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/tla3/timeout_loop.js @@ -0,0 +1,23 @@ +export const foo = "foo"; + +export function delay(ms) { + return new Promise((res) => + setTimeout(() => { + res(); + }, ms) + ); +} + +let i = 0; + +async function timeoutLoop() { + await delay(1000); + console.log("timeout loop", i); + i++; + if (i > 5) { + return; + } + timeoutLoop(); +} + +timeoutLoop(); diff --git a/tests/specs/run/top_level_await_order/top_level_await/top_level_await.js b/tests/specs/run/top_level_await_order/top_level_await/top_level_await.js new file mode 100644 index 0000000000..ea319ea124 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/top_level_await.js @@ -0,0 +1,3 @@ +const buf = await Deno.readFile("./assets/hello.txt"); +const n = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_order/top_level_await/top_level_await.out b/tests/specs/run/top_level_await_order/top_level_await/top_level_await.out new file mode 100644 index 0000000000..4b65d15fe3 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/top_level_await.out @@ -0,0 +1,3 @@ +Hello world! + +write 12 diff --git a/tests/specs/run/top_level_await_order/top_level_await/top_level_await.ts b/tests/specs/run/top_level_await_order/top_level_await/top_level_await.ts new file mode 100644 index 0000000000..8d47ceb21e --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/top_level_await.ts @@ -0,0 +1,3 @@ +const buf: Uint8Array = await Deno.readFile("./assets/hello.txt"); +const n: number = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.js new file mode 100644 index 0000000000..a330f6c711 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.js @@ -0,0 +1,10 @@ +function* asyncGenerator() { + let i = 0; + while (i < 3) { + yield i++; + } +} + +for await (const num of asyncGenerator()) { + console.log(num); +} diff --git a/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.out new file mode 100644 index 0000000000..4539bbf2d2 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.out @@ -0,0 +1,3 @@ +0 +1 +2 diff --git a/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.ts new file mode 100644 index 0000000000..9179322d78 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.ts @@ -0,0 +1,10 @@ +async function* asyncGenerator(): AsyncIterableIterator { + let i = 0; + while (i < 3) { + yield i++; + } +} + +for await (const num of asyncGenerator()) { + console.log(num); +} diff --git a/tests/specs/run/top_level_await_order/top_level_await/unresolved.js b/tests/specs/run/top_level_await_order/top_level_await/unresolved.js new file mode 100644 index 0000000000..231a8cd634 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/unresolved.js @@ -0,0 +1 @@ +await new Promise(() => {}); diff --git a/tests/specs/run/top_level_await_order/top_level_await/unresolved.out b/tests/specs/run/top_level_await_order/top_level_await/unresolved.out new file mode 100644 index 0000000000..1f4ea5d382 --- /dev/null +++ b/tests/specs/run/top_level_await_order/top_level_await/unresolved.out @@ -0,0 +1,4 @@ +error: Top-level await promise never resolved +await new Promise(() => {}); +^ + at ([WILDCARD]top_level_await/unresolved.js:1:1) diff --git a/tests/specs/run/top_level_await_ts/__test__.jsonc b/tests/specs/run/top_level_await_ts/__test__.jsonc new file mode 100644 index 0000000000..15f937df19 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --allow-read top_level_await/top_level_await.ts", + "output": "top_level_await/top_level_await.out" +} diff --git a/tests/specs/run/top_level_await_ts/hello.txt b/tests/specs/run/top_level_await_ts/hello.txt new file mode 100644 index 0000000000..6769dd60bd --- /dev/null +++ b/tests/specs/run/top_level_await_ts/hello.txt @@ -0,0 +1 @@ +Hello world! \ No newline at end of file diff --git a/tests/specs/run/top_level_await_ts/top_level_await/circular.js b/tests/specs/run/top_level_await_ts/top_level_await/circular.js new file mode 100644 index 0000000000..ff2964b6a5 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/circular.js @@ -0,0 +1,8 @@ +import { foo } from "./tla3/timeout_loop.js"; + +export const collection = []; + +const mod = await import("./tla3/b.js"); + +console.log("foo in main", foo); +console.log("mod", mod); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/circular.out b/tests/specs/run/top_level_await_ts/top_level_await/circular.out new file mode 100644 index 0000000000..c889789613 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/circular.out @@ -0,0 +1,10 @@ +timeout loop 0 +timeout loop 1 +timeout loop 2 +timeout loop 3 +timeout loop 4 +timeout loop 5 +error: Top-level await promise never resolved +const mod = await import("./tla3/b.js"); + ^ + at ([WILDCARD]/top_level_await/circular.js:5:13) diff --git a/tests/specs/run/top_level_await_ts/top_level_await/loop.js b/tests/specs/run/top_level_await_ts/top_level_await/loop.js new file mode 100644 index 0000000000..415db5ec78 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/loop.js @@ -0,0 +1,20 @@ +const importsDir = Deno.readDirSync( + Deno.realPathSync("./run/top_level_await/tla2"), +); + +const resolvedPaths = []; + +for (const { name } of importsDir) { + const filePath = Deno.realPathSync(`./run/top_level_await/tla2/${name}`); + resolvedPaths.push(filePath); +} + +resolvedPaths.sort(); + +for (const filePath of resolvedPaths) { + console.log("loading", filePath); + const mod = await import(`file://${filePath}`); + console.log("loaded", mod); +} + +console.log("all loaded"); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/loop.out b/tests/specs/run/top_level_await_ts/top_level_await/loop.out new file mode 100644 index 0000000000..1bdffbf660 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/loop.out @@ -0,0 +1,5 @@ +loading [WILDCARD]a.js +loaded [Module: null prototype] { default: [class Foo] } +loading [WILDCARD]b.js +loaded [Module: null prototype] { default: [class Bar] } +all loaded diff --git a/tests/specs/run/top_level_await_ts/top_level_await/nested.out b/tests/specs/run/top_level_await_ts/top_level_await/nested.out new file mode 100644 index 0000000000..8a1218a102 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/nested.out @@ -0,0 +1,5 @@ +1 +2 +3 +4 +5 diff --git a/tests/specs/run/top_level_await_ts/top_level_await/nested/a.js b/tests/specs/run/top_level_await_ts/top_level_await/nested/a.js new file mode 100644 index 0000000000..74837d4ba1 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/nested/a.js @@ -0,0 +1,3 @@ +console.log(2); +await import("./b.js"); +console.log(4); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/nested/b.js b/tests/specs/run/top_level_await_ts/top_level_await/nested/b.js new file mode 100644 index 0000000000..3bd241b50e --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/nested/b.js @@ -0,0 +1 @@ +console.log(3); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/nested/main.js b/tests/specs/run/top_level_await_ts/top_level_await/nested/main.js new file mode 100644 index 0000000000..ed46a47175 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/nested/main.js @@ -0,0 +1,3 @@ +console.log(1); +await import("./a.js"); +console.log(5); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/order.js b/tests/specs/run/top_level_await_ts/top_level_await/order.js new file mode 100644 index 0000000000..30659cdfbf --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/order.js @@ -0,0 +1,21 @@ +// Ported from Node +// https://github.com/nodejs/node/blob/54746bb763ebea0dc7e99d88ff4b379bcd680964/test/es-module/test-esm-tla.mjs + +const { default: order } = await import("./tla/parent.js"); + +console.log("order", JSON.stringify(order)); + +if ( + !( + order[0] === "order" && + order[1] === "b" && + order[2] === "c" && + order[3] === "d" && + order[4] === "a" && + order[5] === "parent" + ) +) { + throw new Error("TLA wrong order"); +} + +console.log("TLA order correct"); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/order.out b/tests/specs/run/top_level_await_ts/top_level_await/order.out new file mode 100644 index 0000000000..4cc27858cf --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/order.out @@ -0,0 +1,2 @@ +order ["order","b","c","d","a","parent"] +TLA order correct diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla/a.js b/tests/specs/run/top_level_await_ts/top_level_await/tla/a.js new file mode 100644 index 0000000000..c3ef3f7dbc --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/tla/a.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("b"); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla/b.js b/tests/specs/run/top_level_await_ts/top_level_await/tla/b.js new file mode 100644 index 0000000000..3271c92d8f --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/tla/b.js @@ -0,0 +1,7 @@ +import order from "./order.js"; + +await new Promise((resolve) => { + setTimeout(resolve, 200); +}); + +order.push("a"); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla/c.js b/tests/specs/run/top_level_await_ts/top_level_await/tla/c.js new file mode 100644 index 0000000000..806eb0a8be --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/tla/c.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("c"); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla/d.js b/tests/specs/run/top_level_await_ts/top_level_await/tla/d.js new file mode 100644 index 0000000000..283ebf817f --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/tla/d.js @@ -0,0 +1,8 @@ +import order from "./order.js"; + +const end = Date.now() + 500; +while (end < Date.now()) { + // pass +} + +order.push("d"); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla/order.js b/tests/specs/run/top_level_await_ts/top_level_await/tla/order.js new file mode 100644 index 0000000000..f213a562ce --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/tla/order.js @@ -0,0 +1 @@ +export default ["order"]; diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla/parent.js b/tests/specs/run/top_level_await_ts/top_level_await/tla/parent.js new file mode 100644 index 0000000000..1ecc154634 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/tla/parent.js @@ -0,0 +1,9 @@ +import order from "./order.js"; +import "./a.js"; +import "./b.js"; +import "./c.js"; +import "./d.js"; + +order.push("parent"); + +export default order; diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla2/a.js b/tests/specs/run/top_level_await_ts/top_level_await/tla2/a.js new file mode 100644 index 0000000000..d07bcb94db --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/tla2/a.js @@ -0,0 +1,5 @@ +export default class Foo { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla2/b.js b/tests/specs/run/top_level_await_ts/top_level_await/tla2/b.js new file mode 100644 index 0000000000..68e357c1e9 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/tla2/b.js @@ -0,0 +1,5 @@ +export default class Bar { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla3/b.js b/tests/specs/run/top_level_await_ts/top_level_await/tla3/b.js new file mode 100644 index 0000000000..d0349545e9 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/tla3/b.js @@ -0,0 +1,7 @@ +import { foo } from "./timeout_loop.js"; +import { collection } from "../circular.js"; + +console.log("collection in b", collection); +console.log("foo in b", foo); + +export const a = "a"; diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_await_ts/top_level_await/tla3/timeout_loop.js new file mode 100644 index 0000000000..860e6cd2ae --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/tla3/timeout_loop.js @@ -0,0 +1,23 @@ +export const foo = "foo"; + +export function delay(ms) { + return new Promise((res) => + setTimeout(() => { + res(); + }, ms) + ); +} + +let i = 0; + +async function timeoutLoop() { + await delay(1000); + console.log("timeout loop", i); + i++; + if (i > 5) { + return; + } + timeoutLoop(); +} + +timeoutLoop(); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/top_level_await.js b/tests/specs/run/top_level_await_ts/top_level_await/top_level_await.js new file mode 100644 index 0000000000..ea319ea124 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/top_level_await.js @@ -0,0 +1,3 @@ +const buf = await Deno.readFile("./assets/hello.txt"); +const n = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/top_level_await.out b/tests/specs/run/top_level_await_ts/top_level_await/top_level_await.out new file mode 100644 index 0000000000..4b65d15fe3 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/top_level_await.out @@ -0,0 +1,3 @@ +Hello world! + +write 12 diff --git a/tests/specs/run/top_level_await_ts/top_level_await/top_level_await.ts b/tests/specs/run/top_level_await_ts/top_level_await/top_level_await.ts new file mode 100644 index 0000000000..48f66545ac --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/top_level_await.ts @@ -0,0 +1,3 @@ +const buf: Uint8Array = await Deno.readFile("./hello.txt"); +const n: number = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.js new file mode 100644 index 0000000000..a330f6c711 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.js @@ -0,0 +1,10 @@ +function* asyncGenerator() { + let i = 0; + while (i < 3) { + yield i++; + } +} + +for await (const num of asyncGenerator()) { + console.log(num); +} diff --git a/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.out new file mode 100644 index 0000000000..4539bbf2d2 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.out @@ -0,0 +1,3 @@ +0 +1 +2 diff --git a/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.ts new file mode 100644 index 0000000000..9179322d78 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.ts @@ -0,0 +1,10 @@ +async function* asyncGenerator(): AsyncIterableIterator { + let i = 0; + while (i < 3) { + yield i++; + } +} + +for await (const num of asyncGenerator()) { + console.log(num); +} diff --git a/tests/specs/run/top_level_await_ts/top_level_await/unresolved.js b/tests/specs/run/top_level_await_ts/top_level_await/unresolved.js new file mode 100644 index 0000000000..231a8cd634 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/unresolved.js @@ -0,0 +1 @@ +await new Promise(() => {}); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/unresolved.out b/tests/specs/run/top_level_await_ts/top_level_await/unresolved.out new file mode 100644 index 0000000000..1f4ea5d382 --- /dev/null +++ b/tests/specs/run/top_level_await_ts/top_level_await/unresolved.out @@ -0,0 +1,4 @@ +error: Top-level await promise never resolved +await new Promise(() => {}); +^ + at ([WILDCARD]top_level_await/unresolved.js:1:1) diff --git a/tests/specs/run/top_level_await_unresolved/__test__.jsonc b/tests/specs/run/top_level_await_unresolved/__test__.jsonc new file mode 100644 index 0000000000..a92774c1b8 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run top_level_await/unresolved.js", + "output": "top_level_await/unresolved.out", + "exitCode": 1 +} diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/circular.js b/tests/specs/run/top_level_await_unresolved/top_level_await/circular.js new file mode 100644 index 0000000000..ff2964b6a5 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/circular.js @@ -0,0 +1,8 @@ +import { foo } from "./tla3/timeout_loop.js"; + +export const collection = []; + +const mod = await import("./tla3/b.js"); + +console.log("foo in main", foo); +console.log("mod", mod); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/circular.out b/tests/specs/run/top_level_await_unresolved/top_level_await/circular.out new file mode 100644 index 0000000000..c889789613 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/circular.out @@ -0,0 +1,10 @@ +timeout loop 0 +timeout loop 1 +timeout loop 2 +timeout loop 3 +timeout loop 4 +timeout loop 5 +error: Top-level await promise never resolved +const mod = await import("./tla3/b.js"); + ^ + at ([WILDCARD]/top_level_await/circular.js:5:13) diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/loop.js b/tests/specs/run/top_level_await_unresolved/top_level_await/loop.js new file mode 100644 index 0000000000..415db5ec78 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/loop.js @@ -0,0 +1,20 @@ +const importsDir = Deno.readDirSync( + Deno.realPathSync("./run/top_level_await/tla2"), +); + +const resolvedPaths = []; + +for (const { name } of importsDir) { + const filePath = Deno.realPathSync(`./run/top_level_await/tla2/${name}`); + resolvedPaths.push(filePath); +} + +resolvedPaths.sort(); + +for (const filePath of resolvedPaths) { + console.log("loading", filePath); + const mod = await import(`file://${filePath}`); + console.log("loaded", mod); +} + +console.log("all loaded"); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/loop.out b/tests/specs/run/top_level_await_unresolved/top_level_await/loop.out new file mode 100644 index 0000000000..1bdffbf660 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/loop.out @@ -0,0 +1,5 @@ +loading [WILDCARD]a.js +loaded [Module: null prototype] { default: [class Foo] } +loading [WILDCARD]b.js +loaded [Module: null prototype] { default: [class Bar] } +all loaded diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/nested.out b/tests/specs/run/top_level_await_unresolved/top_level_await/nested.out new file mode 100644 index 0000000000..8a1218a102 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/nested.out @@ -0,0 +1,5 @@ +1 +2 +3 +4 +5 diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/nested/a.js b/tests/specs/run/top_level_await_unresolved/top_level_await/nested/a.js new file mode 100644 index 0000000000..74837d4ba1 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/nested/a.js @@ -0,0 +1,3 @@ +console.log(2); +await import("./b.js"); +console.log(4); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/nested/b.js b/tests/specs/run/top_level_await_unresolved/top_level_await/nested/b.js new file mode 100644 index 0000000000..3bd241b50e --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/nested/b.js @@ -0,0 +1 @@ +console.log(3); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/nested/main.js b/tests/specs/run/top_level_await_unresolved/top_level_await/nested/main.js new file mode 100644 index 0000000000..ed46a47175 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/nested/main.js @@ -0,0 +1,3 @@ +console.log(1); +await import("./a.js"); +console.log(5); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/order.js b/tests/specs/run/top_level_await_unresolved/top_level_await/order.js new file mode 100644 index 0000000000..30659cdfbf --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/order.js @@ -0,0 +1,21 @@ +// Ported from Node +// https://github.com/nodejs/node/blob/54746bb763ebea0dc7e99d88ff4b379bcd680964/test/es-module/test-esm-tla.mjs + +const { default: order } = await import("./tla/parent.js"); + +console.log("order", JSON.stringify(order)); + +if ( + !( + order[0] === "order" && + order[1] === "b" && + order[2] === "c" && + order[3] === "d" && + order[4] === "a" && + order[5] === "parent" + ) +) { + throw new Error("TLA wrong order"); +} + +console.log("TLA order correct"); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/order.out b/tests/specs/run/top_level_await_unresolved/top_level_await/order.out new file mode 100644 index 0000000000..4cc27858cf --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/order.out @@ -0,0 +1,2 @@ +order ["order","b","c","d","a","parent"] +TLA order correct diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/a.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/a.js new file mode 100644 index 0000000000..c3ef3f7dbc --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/a.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("b"); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/b.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/b.js new file mode 100644 index 0000000000..3271c92d8f --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/b.js @@ -0,0 +1,7 @@ +import order from "./order.js"; + +await new Promise((resolve) => { + setTimeout(resolve, 200); +}); + +order.push("a"); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/c.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/c.js new file mode 100644 index 0000000000..806eb0a8be --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/c.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("c"); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/d.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/d.js new file mode 100644 index 0000000000..283ebf817f --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/d.js @@ -0,0 +1,8 @@ +import order from "./order.js"; + +const end = Date.now() + 500; +while (end < Date.now()) { + // pass +} + +order.push("d"); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/order.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/order.js new file mode 100644 index 0000000000..f213a562ce --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/order.js @@ -0,0 +1 @@ +export default ["order"]; diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/parent.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/parent.js new file mode 100644 index 0000000000..1ecc154634 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/parent.js @@ -0,0 +1,9 @@ +import order from "./order.js"; +import "./a.js"; +import "./b.js"; +import "./c.js"; +import "./d.js"; + +order.push("parent"); + +export default order; diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla2/a.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla2/a.js new file mode 100644 index 0000000000..d07bcb94db --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/tla2/a.js @@ -0,0 +1,5 @@ +export default class Foo { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla2/b.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla2/b.js new file mode 100644 index 0000000000..68e357c1e9 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/tla2/b.js @@ -0,0 +1,5 @@ +export default class Bar { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla3/b.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla3/b.js new file mode 100644 index 0000000000..d0349545e9 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/tla3/b.js @@ -0,0 +1,7 @@ +import { foo } from "./timeout_loop.js"; +import { collection } from "../circular.js"; + +console.log("collection in b", collection); +console.log("foo in b", foo); + +export const a = "a"; diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla3/timeout_loop.js new file mode 100644 index 0000000000..860e6cd2ae --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/tla3/timeout_loop.js @@ -0,0 +1,23 @@ +export const foo = "foo"; + +export function delay(ms) { + return new Promise((res) => + setTimeout(() => { + res(); + }, ms) + ); +} + +let i = 0; + +async function timeoutLoop() { + await delay(1000); + console.log("timeout loop", i); + i++; + if (i > 5) { + return; + } + timeoutLoop(); +} + +timeoutLoop(); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.js b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.js new file mode 100644 index 0000000000..ea319ea124 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.js @@ -0,0 +1,3 @@ +const buf = await Deno.readFile("./assets/hello.txt"); +const n = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.out b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.out new file mode 100644 index 0000000000..4b65d15fe3 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.out @@ -0,0 +1,3 @@ +Hello world! + +write 12 diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.ts b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.ts new file mode 100644 index 0000000000..8d47ceb21e --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.ts @@ -0,0 +1,3 @@ +const buf: Uint8Array = await Deno.readFile("./assets/hello.txt"); +const n: number = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.js new file mode 100644 index 0000000000..a330f6c711 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.js @@ -0,0 +1,10 @@ +function* asyncGenerator() { + let i = 0; + while (i < 3) { + yield i++; + } +} + +for await (const num of asyncGenerator()) { + console.log(num); +} diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.out new file mode 100644 index 0000000000..4539bbf2d2 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.out @@ -0,0 +1,3 @@ +0 +1 +2 diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.ts new file mode 100644 index 0000000000..9179322d78 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.ts @@ -0,0 +1,10 @@ +async function* asyncGenerator(): AsyncIterableIterator { + let i = 0; + while (i < 3) { + yield i++; + } +} + +for await (const num of asyncGenerator()) { + console.log(num); +} diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/unresolved.js b/tests/specs/run/top_level_await_unresolved/top_level_await/unresolved.js new file mode 100644 index 0000000000..231a8cd634 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/unresolved.js @@ -0,0 +1 @@ +await new Promise(() => {}); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/unresolved.out b/tests/specs/run/top_level_await_unresolved/top_level_await/unresolved.out new file mode 100644 index 0000000000..1f4ea5d382 --- /dev/null +++ b/tests/specs/run/top_level_await_unresolved/top_level_await/unresolved.out @@ -0,0 +1,4 @@ +error: Top-level await promise never resolved +await new Promise(() => {}); +^ + at ([WILDCARD]top_level_await/unresolved.js:1:1) diff --git a/tests/specs/run/top_level_for_await/__test__.jsonc b/tests/specs/run/top_level_for_await/__test__.jsonc new file mode 100644 index 0000000000..198008560b --- /dev/null +++ b/tests/specs/run/top_level_for_await/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet top_level_await/top_level_for_await.js", + "output": "top_level_await/top_level_for_await.out" +} diff --git a/tests/specs/run/top_level_for_await/top_level_await/circular.js b/tests/specs/run/top_level_for_await/top_level_await/circular.js new file mode 100644 index 0000000000..ff2964b6a5 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/circular.js @@ -0,0 +1,8 @@ +import { foo } from "./tla3/timeout_loop.js"; + +export const collection = []; + +const mod = await import("./tla3/b.js"); + +console.log("foo in main", foo); +console.log("mod", mod); diff --git a/tests/specs/run/top_level_for_await/top_level_await/circular.out b/tests/specs/run/top_level_for_await/top_level_await/circular.out new file mode 100644 index 0000000000..c889789613 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/circular.out @@ -0,0 +1,10 @@ +timeout loop 0 +timeout loop 1 +timeout loop 2 +timeout loop 3 +timeout loop 4 +timeout loop 5 +error: Top-level await promise never resolved +const mod = await import("./tla3/b.js"); + ^ + at ([WILDCARD]/top_level_await/circular.js:5:13) diff --git a/tests/specs/run/top_level_for_await/top_level_await/loop.js b/tests/specs/run/top_level_for_await/top_level_await/loop.js new file mode 100644 index 0000000000..415db5ec78 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/loop.js @@ -0,0 +1,20 @@ +const importsDir = Deno.readDirSync( + Deno.realPathSync("./run/top_level_await/tla2"), +); + +const resolvedPaths = []; + +for (const { name } of importsDir) { + const filePath = Deno.realPathSync(`./run/top_level_await/tla2/${name}`); + resolvedPaths.push(filePath); +} + +resolvedPaths.sort(); + +for (const filePath of resolvedPaths) { + console.log("loading", filePath); + const mod = await import(`file://${filePath}`); + console.log("loaded", mod); +} + +console.log("all loaded"); diff --git a/tests/specs/run/top_level_for_await/top_level_await/loop.out b/tests/specs/run/top_level_for_await/top_level_await/loop.out new file mode 100644 index 0000000000..1bdffbf660 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/loop.out @@ -0,0 +1,5 @@ +loading [WILDCARD]a.js +loaded [Module: null prototype] { default: [class Foo] } +loading [WILDCARD]b.js +loaded [Module: null prototype] { default: [class Bar] } +all loaded diff --git a/tests/specs/run/top_level_for_await/top_level_await/nested.out b/tests/specs/run/top_level_for_await/top_level_await/nested.out new file mode 100644 index 0000000000..8a1218a102 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/nested.out @@ -0,0 +1,5 @@ +1 +2 +3 +4 +5 diff --git a/tests/specs/run/top_level_for_await/top_level_await/nested/a.js b/tests/specs/run/top_level_for_await/top_level_await/nested/a.js new file mode 100644 index 0000000000..74837d4ba1 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/nested/a.js @@ -0,0 +1,3 @@ +console.log(2); +await import("./b.js"); +console.log(4); diff --git a/tests/specs/run/top_level_for_await/top_level_await/nested/b.js b/tests/specs/run/top_level_for_await/top_level_await/nested/b.js new file mode 100644 index 0000000000..3bd241b50e --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/nested/b.js @@ -0,0 +1 @@ +console.log(3); diff --git a/tests/specs/run/top_level_for_await/top_level_await/nested/main.js b/tests/specs/run/top_level_for_await/top_level_await/nested/main.js new file mode 100644 index 0000000000..ed46a47175 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/nested/main.js @@ -0,0 +1,3 @@ +console.log(1); +await import("./a.js"); +console.log(5); diff --git a/tests/specs/run/top_level_for_await/top_level_await/order.js b/tests/specs/run/top_level_for_await/top_level_await/order.js new file mode 100644 index 0000000000..30659cdfbf --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/order.js @@ -0,0 +1,21 @@ +// Ported from Node +// https://github.com/nodejs/node/blob/54746bb763ebea0dc7e99d88ff4b379bcd680964/test/es-module/test-esm-tla.mjs + +const { default: order } = await import("./tla/parent.js"); + +console.log("order", JSON.stringify(order)); + +if ( + !( + order[0] === "order" && + order[1] === "b" && + order[2] === "c" && + order[3] === "d" && + order[4] === "a" && + order[5] === "parent" + ) +) { + throw new Error("TLA wrong order"); +} + +console.log("TLA order correct"); diff --git a/tests/specs/run/top_level_for_await/top_level_await/order.out b/tests/specs/run/top_level_for_await/top_level_await/order.out new file mode 100644 index 0000000000..4cc27858cf --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/order.out @@ -0,0 +1,2 @@ +order ["order","b","c","d","a","parent"] +TLA order correct diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla/a.js b/tests/specs/run/top_level_for_await/top_level_await/tla/a.js new file mode 100644 index 0000000000..c3ef3f7dbc --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/tla/a.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("b"); diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla/b.js b/tests/specs/run/top_level_for_await/top_level_await/tla/b.js new file mode 100644 index 0000000000..3271c92d8f --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/tla/b.js @@ -0,0 +1,7 @@ +import order from "./order.js"; + +await new Promise((resolve) => { + setTimeout(resolve, 200); +}); + +order.push("a"); diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla/c.js b/tests/specs/run/top_level_for_await/top_level_await/tla/c.js new file mode 100644 index 0000000000..806eb0a8be --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/tla/c.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("c"); diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla/d.js b/tests/specs/run/top_level_for_await/top_level_await/tla/d.js new file mode 100644 index 0000000000..283ebf817f --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/tla/d.js @@ -0,0 +1,8 @@ +import order from "./order.js"; + +const end = Date.now() + 500; +while (end < Date.now()) { + // pass +} + +order.push("d"); diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla/order.js b/tests/specs/run/top_level_for_await/top_level_await/tla/order.js new file mode 100644 index 0000000000..f213a562ce --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/tla/order.js @@ -0,0 +1 @@ +export default ["order"]; diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla/parent.js b/tests/specs/run/top_level_for_await/top_level_await/tla/parent.js new file mode 100644 index 0000000000..1ecc154634 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/tla/parent.js @@ -0,0 +1,9 @@ +import order from "./order.js"; +import "./a.js"; +import "./b.js"; +import "./c.js"; +import "./d.js"; + +order.push("parent"); + +export default order; diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla2/a.js b/tests/specs/run/top_level_for_await/top_level_await/tla2/a.js new file mode 100644 index 0000000000..d07bcb94db --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/tla2/a.js @@ -0,0 +1,5 @@ +export default class Foo { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla2/b.js b/tests/specs/run/top_level_for_await/top_level_await/tla2/b.js new file mode 100644 index 0000000000..68e357c1e9 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/tla2/b.js @@ -0,0 +1,5 @@ +export default class Bar { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla3/b.js b/tests/specs/run/top_level_for_await/top_level_await/tla3/b.js new file mode 100644 index 0000000000..d0349545e9 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/tla3/b.js @@ -0,0 +1,7 @@ +import { foo } from "./timeout_loop.js"; +import { collection } from "../circular.js"; + +console.log("collection in b", collection); +console.log("foo in b", foo); + +export const a = "a"; diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_for_await/top_level_await/tla3/timeout_loop.js new file mode 100644 index 0000000000..860e6cd2ae --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/tla3/timeout_loop.js @@ -0,0 +1,23 @@ +export const foo = "foo"; + +export function delay(ms) { + return new Promise((res) => + setTimeout(() => { + res(); + }, ms) + ); +} + +let i = 0; + +async function timeoutLoop() { + await delay(1000); + console.log("timeout loop", i); + i++; + if (i > 5) { + return; + } + timeoutLoop(); +} + +timeoutLoop(); diff --git a/tests/specs/run/top_level_for_await/top_level_await/top_level_await.js b/tests/specs/run/top_level_for_await/top_level_await/top_level_await.js new file mode 100644 index 0000000000..ea319ea124 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/top_level_await.js @@ -0,0 +1,3 @@ +const buf = await Deno.readFile("./assets/hello.txt"); +const n = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_for_await/top_level_await/top_level_await.out b/tests/specs/run/top_level_for_await/top_level_await/top_level_await.out new file mode 100644 index 0000000000..4b65d15fe3 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/top_level_await.out @@ -0,0 +1,3 @@ +Hello world! + +write 12 diff --git a/tests/specs/run/top_level_for_await/top_level_await/top_level_await.ts b/tests/specs/run/top_level_for_await/top_level_await/top_level_await.ts new file mode 100644 index 0000000000..8d47ceb21e --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/top_level_await.ts @@ -0,0 +1,3 @@ +const buf: Uint8Array = await Deno.readFile("./assets/hello.txt"); +const n: number = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.js new file mode 100644 index 0000000000..a330f6c711 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.js @@ -0,0 +1,10 @@ +function* asyncGenerator() { + let i = 0; + while (i < 3) { + yield i++; + } +} + +for await (const num of asyncGenerator()) { + console.log(num); +} diff --git a/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.out new file mode 100644 index 0000000000..4539bbf2d2 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.out @@ -0,0 +1,3 @@ +0 +1 +2 diff --git a/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.ts new file mode 100644 index 0000000000..9179322d78 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.ts @@ -0,0 +1,10 @@ +async function* asyncGenerator(): AsyncIterableIterator { + let i = 0; + while (i < 3) { + yield i++; + } +} + +for await (const num of asyncGenerator()) { + console.log(num); +} diff --git a/tests/specs/run/top_level_for_await/top_level_await/unresolved.js b/tests/specs/run/top_level_for_await/top_level_await/unresolved.js new file mode 100644 index 0000000000..231a8cd634 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/unresolved.js @@ -0,0 +1 @@ +await new Promise(() => {}); diff --git a/tests/specs/run/top_level_for_await/top_level_await/unresolved.out b/tests/specs/run/top_level_for_await/top_level_await/unresolved.out new file mode 100644 index 0000000000..1f4ea5d382 --- /dev/null +++ b/tests/specs/run/top_level_for_await/top_level_await/unresolved.out @@ -0,0 +1,4 @@ +error: Top-level await promise never resolved +await new Promise(() => {}); +^ + at ([WILDCARD]top_level_await/unresolved.js:1:1) diff --git a/tests/specs/run/top_level_for_await_ts/__test__.jsonc b/tests/specs/run/top_level_for_await_ts/__test__.jsonc new file mode 100644 index 0000000000..22314e8e0d --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet top_level_await/top_level_for_await.ts", + "output": "top_level_await/top_level_for_await.out" +} diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/circular.js b/tests/specs/run/top_level_for_await_ts/top_level_await/circular.js new file mode 100644 index 0000000000..ff2964b6a5 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/circular.js @@ -0,0 +1,8 @@ +import { foo } from "./tla3/timeout_loop.js"; + +export const collection = []; + +const mod = await import("./tla3/b.js"); + +console.log("foo in main", foo); +console.log("mod", mod); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/circular.out b/tests/specs/run/top_level_for_await_ts/top_level_await/circular.out new file mode 100644 index 0000000000..c889789613 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/circular.out @@ -0,0 +1,10 @@ +timeout loop 0 +timeout loop 1 +timeout loop 2 +timeout loop 3 +timeout loop 4 +timeout loop 5 +error: Top-level await promise never resolved +const mod = await import("./tla3/b.js"); + ^ + at ([WILDCARD]/top_level_await/circular.js:5:13) diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/loop.js b/tests/specs/run/top_level_for_await_ts/top_level_await/loop.js new file mode 100644 index 0000000000..415db5ec78 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/loop.js @@ -0,0 +1,20 @@ +const importsDir = Deno.readDirSync( + Deno.realPathSync("./run/top_level_await/tla2"), +); + +const resolvedPaths = []; + +for (const { name } of importsDir) { + const filePath = Deno.realPathSync(`./run/top_level_await/tla2/${name}`); + resolvedPaths.push(filePath); +} + +resolvedPaths.sort(); + +for (const filePath of resolvedPaths) { + console.log("loading", filePath); + const mod = await import(`file://${filePath}`); + console.log("loaded", mod); +} + +console.log("all loaded"); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/loop.out b/tests/specs/run/top_level_for_await_ts/top_level_await/loop.out new file mode 100644 index 0000000000..1bdffbf660 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/loop.out @@ -0,0 +1,5 @@ +loading [WILDCARD]a.js +loaded [Module: null prototype] { default: [class Foo] } +loading [WILDCARD]b.js +loaded [Module: null prototype] { default: [class Bar] } +all loaded diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/nested.out b/tests/specs/run/top_level_for_await_ts/top_level_await/nested.out new file mode 100644 index 0000000000..8a1218a102 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/nested.out @@ -0,0 +1,5 @@ +1 +2 +3 +4 +5 diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/nested/a.js b/tests/specs/run/top_level_for_await_ts/top_level_await/nested/a.js new file mode 100644 index 0000000000..74837d4ba1 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/nested/a.js @@ -0,0 +1,3 @@ +console.log(2); +await import("./b.js"); +console.log(4); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/nested/b.js b/tests/specs/run/top_level_for_await_ts/top_level_await/nested/b.js new file mode 100644 index 0000000000..3bd241b50e --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/nested/b.js @@ -0,0 +1 @@ +console.log(3); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/nested/main.js b/tests/specs/run/top_level_for_await_ts/top_level_await/nested/main.js new file mode 100644 index 0000000000..ed46a47175 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/nested/main.js @@ -0,0 +1,3 @@ +console.log(1); +await import("./a.js"); +console.log(5); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/order.js b/tests/specs/run/top_level_for_await_ts/top_level_await/order.js new file mode 100644 index 0000000000..30659cdfbf --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/order.js @@ -0,0 +1,21 @@ +// Ported from Node +// https://github.com/nodejs/node/blob/54746bb763ebea0dc7e99d88ff4b379bcd680964/test/es-module/test-esm-tla.mjs + +const { default: order } = await import("./tla/parent.js"); + +console.log("order", JSON.stringify(order)); + +if ( + !( + order[0] === "order" && + order[1] === "b" && + order[2] === "c" && + order[3] === "d" && + order[4] === "a" && + order[5] === "parent" + ) +) { + throw new Error("TLA wrong order"); +} + +console.log("TLA order correct"); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/order.out b/tests/specs/run/top_level_for_await_ts/top_level_await/order.out new file mode 100644 index 0000000000..4cc27858cf --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/order.out @@ -0,0 +1,2 @@ +order ["order","b","c","d","a","parent"] +TLA order correct diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/a.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/a.js new file mode 100644 index 0000000000..c3ef3f7dbc --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/a.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("b"); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/b.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/b.js new file mode 100644 index 0000000000..3271c92d8f --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/b.js @@ -0,0 +1,7 @@ +import order from "./order.js"; + +await new Promise((resolve) => { + setTimeout(resolve, 200); +}); + +order.push("a"); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/c.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/c.js new file mode 100644 index 0000000000..806eb0a8be --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/c.js @@ -0,0 +1,3 @@ +import order from "./order.js"; + +order.push("c"); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/d.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/d.js new file mode 100644 index 0000000000..283ebf817f --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/d.js @@ -0,0 +1,8 @@ +import order from "./order.js"; + +const end = Date.now() + 500; +while (end < Date.now()) { + // pass +} + +order.push("d"); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/order.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/order.js new file mode 100644 index 0000000000..f213a562ce --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/order.js @@ -0,0 +1 @@ +export default ["order"]; diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/parent.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/parent.js new file mode 100644 index 0000000000..1ecc154634 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/parent.js @@ -0,0 +1,9 @@ +import order from "./order.js"; +import "./a.js"; +import "./b.js"; +import "./c.js"; +import "./d.js"; + +order.push("parent"); + +export default order; diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla2/a.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla2/a.js new file mode 100644 index 0000000000..d07bcb94db --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/tla2/a.js @@ -0,0 +1,5 @@ +export default class Foo { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla2/b.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla2/b.js new file mode 100644 index 0000000000..68e357c1e9 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/tla2/b.js @@ -0,0 +1,5 @@ +export default class Bar { + constructor(message) { + this.message = message; + } +} diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla3/b.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla3/b.js new file mode 100644 index 0000000000..d0349545e9 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/tla3/b.js @@ -0,0 +1,7 @@ +import { foo } from "./timeout_loop.js"; +import { collection } from "../circular.js"; + +console.log("collection in b", collection); +console.log("foo in b", foo); + +export const a = "a"; diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla3/timeout_loop.js new file mode 100644 index 0000000000..860e6cd2ae --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/tla3/timeout_loop.js @@ -0,0 +1,23 @@ +export const foo = "foo"; + +export function delay(ms) { + return new Promise((res) => + setTimeout(() => { + res(); + }, ms) + ); +} + +let i = 0; + +async function timeoutLoop() { + await delay(1000); + console.log("timeout loop", i); + i++; + if (i > 5) { + return; + } + timeoutLoop(); +} + +timeoutLoop(); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.js b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.js new file mode 100644 index 0000000000..ea319ea124 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.js @@ -0,0 +1,3 @@ +const buf = await Deno.readFile("./assets/hello.txt"); +const n = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.out b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.out new file mode 100644 index 0000000000..4b65d15fe3 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.out @@ -0,0 +1,3 @@ +Hello world! + +write 12 diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.ts b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.ts new file mode 100644 index 0000000000..8d47ceb21e --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.ts @@ -0,0 +1,3 @@ +const buf: Uint8Array = await Deno.readFile("./assets/hello.txt"); +const n: number = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.js new file mode 100644 index 0000000000..a330f6c711 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.js @@ -0,0 +1,10 @@ +function* asyncGenerator() { + let i = 0; + while (i < 3) { + yield i++; + } +} + +for await (const num of asyncGenerator()) { + console.log(num); +} diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.out new file mode 100644 index 0000000000..4539bbf2d2 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.out @@ -0,0 +1,3 @@ +0 +1 +2 diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.ts new file mode 100644 index 0000000000..9179322d78 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.ts @@ -0,0 +1,10 @@ +async function* asyncGenerator(): AsyncIterableIterator { + let i = 0; + while (i < 3) { + yield i++; + } +} + +for await (const num of asyncGenerator()) { + console.log(num); +} diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/unresolved.js b/tests/specs/run/top_level_for_await_ts/top_level_await/unresolved.js new file mode 100644 index 0000000000..231a8cd634 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/unresolved.js @@ -0,0 +1 @@ +await new Promise(() => {}); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/unresolved.out b/tests/specs/run/top_level_for_await_ts/top_level_await/unresolved.out new file mode 100644 index 0000000000..1f4ea5d382 --- /dev/null +++ b/tests/specs/run/top_level_for_await_ts/top_level_await/unresolved.out @@ -0,0 +1,4 @@ +error: Top-level await promise never resolved +await new Promise(() => {}); +^ + at ([WILDCARD]top_level_await/unresolved.js:1:1) diff --git a/tests/specs/run/ts_decorators/__test__.jsonc b/tests/specs/run/ts_decorators/__test__.jsonc new file mode 100644 index 0000000000..96e7cdf308 --- /dev/null +++ b/tests/specs/run/ts_decorators/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --check decorators/experimental/ts/main.ts", + "output": "decorators/experimental/ts/main.out" +} diff --git a/tests/specs/run/ts_decorators/decorators/experimental/deno.json b/tests/specs/run/ts_decorators/decorators/experimental/deno.json new file mode 100644 index 0000000000..504cd646e1 --- /dev/null +++ b/tests/specs/run/ts_decorators/decorators/experimental/deno.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "experimentalDecorators": true + } +} diff --git a/tests/specs/run/ts_decorators/decorators/experimental/no_check/main.out b/tests/specs/run/ts_decorators/decorators/experimental/no_check/main.out new file mode 100644 index 0000000000..015f7076e8 --- /dev/null +++ b/tests/specs/run/ts_decorators/decorators/experimental/no_check/main.out @@ -0,0 +1,3 @@ +a(): evaluated +a(): called +method diff --git a/tests/specs/run/ts_decorators/decorators/experimental/no_check/main.ts b/tests/specs/run/ts_decorators/decorators/experimental/no_check/main.ts new file mode 100644 index 0000000000..9f7ec550d5 --- /dev/null +++ b/tests/specs/run/ts_decorators/decorators/experimental/no_check/main.ts @@ -0,0 +1,21 @@ +// deno-lint-ignore-file +function a() { + console.log("a(): evaluated"); + return ( + _target: any, + _propertyKey: string, + _descriptor: PropertyDescriptor, + ) => { + console.log("a(): called"); + }; +} + +class B { + @a() + method() { + console.log("method"); + } +} + +const b = new B(); +b.method(); diff --git a/tests/specs/run/ts_decorators/decorators/experimental/runtime/main.out b/tests/specs/run/ts_decorators/decorators/experimental/runtime/main.out new file mode 100644 index 0000000000..0fc1d4590e --- /dev/null +++ b/tests/specs/run/ts_decorators/decorators/experimental/runtime/main.out @@ -0,0 +1,7 @@ +@A evaluated +@B evaluated +@B called +@A called +fn() called from @A +fn() called from @B +C.test() called diff --git a/tests/specs/run/ts_decorators/decorators/experimental/runtime/main.ts b/tests/specs/run/ts_decorators/decorators/experimental/runtime/main.ts new file mode 100644 index 0000000000..40a26bbd4d --- /dev/null +++ b/tests/specs/run/ts_decorators/decorators/experimental/runtime/main.ts @@ -0,0 +1,42 @@ +// deno-lint-ignore-file +function a() { + console.log("@A evaluated"); + return function ( + target: any, + propertyKey: string, + descriptor: PropertyDescriptor, + ) { + console.log("@A called"); + const fn = descriptor.value; + descriptor.value = function () { + console.log("fn() called from @A"); + fn(); + }; + }; +} + +function b() { + console.log("@B evaluated"); + return function ( + target: any, + propertyKey: string, + descriptor: PropertyDescriptor, + ) { + console.log("@B called"); + const fn = descriptor.value; + descriptor.value = function () { + console.log("fn() called from @B"); + fn(); + }; + }; +} + +class C { + @a() + @b() + static test() { + console.log("C.test() called"); + } +} + +C.test(); diff --git a/tests/specs/run/ts_decorators/decorators/experimental/ts/main.out b/tests/specs/run/ts_decorators/decorators/experimental/ts/main.out new file mode 100644 index 0000000000..ea64fbaa63 --- /dev/null +++ b/tests/specs/run/ts_decorators/decorators/experimental/ts/main.out @@ -0,0 +1,3 @@ +Warning experimentalDecorators compiler option is deprecated and may be removed at any time +Check [WILDCARD] +SomeClass { someField: "asdf" } diff --git a/tests/specs/run/ts_decorators/decorators/experimental/ts/main.ts b/tests/specs/run/ts_decorators/decorators/experimental/ts/main.ts new file mode 100644 index 0000000000..95fba6cd48 --- /dev/null +++ b/tests/specs/run/ts_decorators/decorators/experimental/ts/main.ts @@ -0,0 +1,14 @@ +// deno-lint-ignore-file + +function Decorate() { + return function (constructor: any): any { + return class extends constructor { + protected someField: string = "asdf"; + }; + }; +} + +@Decorate() +class SomeClass {} + +console.log(new SomeClass()); diff --git a/tests/specs/run/ts_decorators/decorators/tc39_proposal/main.out b/tests/specs/run/ts_decorators/decorators/tc39_proposal/main.out new file mode 100644 index 0000000000..39394952e8 --- /dev/null +++ b/tests/specs/run/ts_decorators/decorators/tc39_proposal/main.out @@ -0,0 +1,3 @@ +starting m with arguments 1 +C.m 1 +ending m diff --git a/tests/specs/run/ts_decorators/decorators/tc39_proposal/main.ts b/tests/specs/run/ts_decorators/decorators/tc39_proposal/main.ts new file mode 100644 index 0000000000..00c8a85025 --- /dev/null +++ b/tests/specs/run/ts_decorators/decorators/tc39_proposal/main.ts @@ -0,0 +1,21 @@ +// deno-lint-ignore no-explicit-any +function logged(value: any, { kind, name }: { kind: string; name: string }) { + if (kind === "method") { + return function (...args: unknown[]) { + console.log(`starting ${name} with arguments ${args.join(", ")}`); + // @ts-ignore this has implicit any type + const ret = value.call(this, ...args); + console.log(`ending ${name}`); + return ret; + }; + } +} + +class C { + @logged + m(arg: number) { + console.log("C.m", arg); + } +} + +new C().m(1); diff --git a/tests/specs/run/ts_import_from_js/005_more_imports.ts b/tests/specs/run/ts_import_from_js/005_more_imports.ts new file mode 100644 index 0000000000..c69556be15 --- /dev/null +++ b/tests/specs/run/ts_import_from_js/005_more_imports.ts @@ -0,0 +1,11 @@ +import { printHello3, returnsFoo2, returnsHi } from "./mod1.ts"; + +printHello3(); + +if (returnsHi() !== "Hi") { + throw Error("Unexpected"); +} + +if (returnsFoo2() !== "Foo") { + throw Error("Unexpected"); +} diff --git a/tests/specs/run/ts_import_from_js/__test__.jsonc b/tests/specs/run/ts_import_from_js/__test__.jsonc new file mode 100644 index 0000000000..de11873cbc --- /dev/null +++ b/tests/specs/run/ts_import_from_js/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --quiet --reload ts_import_from_js/main.js", + "output": "ts_import_from_js/main.out" +} diff --git a/tests/specs/run/ts_import_from_js/mod1.ts b/tests/specs/run/ts_import_from_js/mod1.ts new file mode 100644 index 0000000000..5e58f432ed --- /dev/null +++ b/tests/specs/run/ts_import_from_js/mod1.ts @@ -0,0 +1,17 @@ +import { printHello2, returnsFoo } from "./subdir2/mod2.ts"; + +export function returnsHi(): string { + return "Hi"; +} + +export function returnsFoo2(): string { + return returnsFoo(); +} + +export function printHello3() { + printHello2(); +} + +export function throwsError() { + throw Error("exception from mod1"); +} diff --git a/tests/specs/run/ts_import_from_js/mod2.ts b/tests/specs/run/ts_import_from_js/mod2.ts new file mode 100644 index 0000000000..ce1adc0e81 --- /dev/null +++ b/tests/specs/run/ts_import_from_js/mod2.ts @@ -0,0 +1 @@ +export { printHello } from "./print_hello.ts"; diff --git a/tests/specs/run/ts_import_from_js/print_hello.ts b/tests/specs/run/ts_import_from_js/print_hello.ts new file mode 100644 index 0000000000..b9c0ad5275 --- /dev/null +++ b/tests/specs/run/ts_import_from_js/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/specs/run/ts_import_from_js/subdir2/dynamic_import.ts b/tests/specs/run/ts_import_from_js/subdir2/dynamic_import.ts new file mode 100644 index 0000000000..59beb64c33 --- /dev/null +++ b/tests/specs/run/ts_import_from_js/subdir2/dynamic_import.ts @@ -0,0 +1,4 @@ +(async () => { + const { printHello } = await import("../mod2.ts"); + printHello(); +})(); diff --git a/tests/specs/run/ts_import_from_js/subdir2/mod2.ts b/tests/specs/run/ts_import_from_js/subdir2/mod2.ts new file mode 100644 index 0000000000..9071d0aeb4 --- /dev/null +++ b/tests/specs/run/ts_import_from_js/subdir2/mod2.ts @@ -0,0 +1,9 @@ +import { printHello } from "../print_hello.ts"; + +export function returnsFoo(): string { + return "Foo"; +} + +export function printHello2() { + printHello(); +} diff --git a/tests/testdata/run/ts_import_from_js/deps.js b/tests/specs/run/ts_import_from_js/ts_import_from_js/deps.js similarity index 100% rename from tests/testdata/run/ts_import_from_js/deps.js rename to tests/specs/run/ts_import_from_js/ts_import_from_js/deps.js diff --git a/tests/testdata/run/ts_import_from_js/main.js b/tests/specs/run/ts_import_from_js/ts_import_from_js/main.js similarity index 100% rename from tests/testdata/run/ts_import_from_js/main.js rename to tests/specs/run/ts_import_from_js/ts_import_from_js/main.js diff --git a/tests/testdata/run/ts_import_from_js/main.out b/tests/specs/run/ts_import_from_js/ts_import_from_js/main.out similarity index 100% rename from tests/testdata/run/ts_import_from_js/main.out rename to tests/specs/run/ts_import_from_js/ts_import_from_js/main.out diff --git a/tests/specs/run/ts_type_imports/__test__.jsonc b/tests/specs/run/ts_type_imports/__test__.jsonc new file mode 100644 index 0000000000..e9a925d1a8 --- /dev/null +++ b/tests/specs/run/ts_type_imports/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload --check ts_type_imports.ts", + "output": "ts_type_imports.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/ts_type_imports.ts b/tests/specs/run/ts_type_imports/ts_type_imports.ts similarity index 100% rename from tests/testdata/run/ts_type_imports.ts rename to tests/specs/run/ts_type_imports/ts_type_imports.ts diff --git a/tests/testdata/run/ts_type_imports.ts.out b/tests/specs/run/ts_type_imports/ts_type_imports.ts.out similarity index 100% rename from tests/testdata/run/ts_type_imports.ts.out rename to tests/specs/run/ts_type_imports/ts_type_imports.ts.out diff --git a/tests/specs/run/ts_type_imports/ts_type_imports_foo.ts b/tests/specs/run/ts_type_imports/ts_type_imports_foo.ts new file mode 100644 index 0000000000..db20773f63 --- /dev/null +++ b/tests/specs/run/ts_type_imports/ts_type_imports_foo.ts @@ -0,0 +1 @@ +export type Foo = Map; diff --git a/tests/specs/run/ts_type_only_import/__test__.jsonc b/tests/specs/run/ts_type_only_import/__test__.jsonc new file mode 100644 index 0000000000..977a6aba7a --- /dev/null +++ b/tests/specs/run/ts_type_only_import/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --check ts_type_only_import.ts", + "output": "ts_type_only_import.ts.out" +} diff --git a/tests/specs/run/ts_type_only_import/ts_type_only_import.d.ts b/tests/specs/run/ts_type_only_import/ts_type_only_import.d.ts new file mode 100644 index 0000000000..d48e4b48ab --- /dev/null +++ b/tests/specs/run/ts_type_only_import/ts_type_only_import.d.ts @@ -0,0 +1,3 @@ +export interface HelloWorld { + a: string; +} diff --git a/tests/testdata/run/ts_type_only_import.ts b/tests/specs/run/ts_type_only_import/ts_type_only_import.ts similarity index 100% rename from tests/testdata/run/ts_type_only_import.ts rename to tests/specs/run/ts_type_only_import/ts_type_only_import.ts diff --git a/tests/testdata/run/ts_type_only_import.ts.out b/tests/specs/run/ts_type_only_import/ts_type_only_import.ts.out similarity index 100% rename from tests/testdata/run/ts_type_only_import.ts.out rename to tests/specs/run/ts_type_only_import/ts_type_only_import.ts.out diff --git a/tests/specs/run/ts_without_extension/__test__.jsonc b/tests/specs/run/ts_without_extension/__test__.jsonc new file mode 100644 index 0000000000..a6c713bf5a --- /dev/null +++ b/tests/specs/run/ts_without_extension/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --ext ts --check ts_without_extension", + "output": "ts_without_extension.out", + "exitCode": 0 +} diff --git a/tests/specs/run/ts_without_extension/ts_without_extension b/tests/specs/run/ts_without_extension/ts_without_extension new file mode 100644 index 0000000000..f10891d7a2 --- /dev/null +++ b/tests/specs/run/ts_without_extension/ts_without_extension @@ -0,0 +1,3 @@ +interface Lollipop {} + +console.log("executing typescript with no extension"); diff --git a/tests/specs/run/ts_without_extension/ts_without_extension.out b/tests/specs/run/ts_without_extension/ts_without_extension.out new file mode 100644 index 0000000000..4f02dd4c33 --- /dev/null +++ b/tests/specs/run/ts_without_extension/ts_without_extension.out @@ -0,0 +1,2 @@ +Check [WILDCARD]/ts_without_extension +executing typescript with no extension diff --git a/tests/specs/run/tsx_imports/046_jsx_test.tsx b/tests/specs/run/tsx_imports/046_jsx_test.tsx new file mode 100644 index 0000000000..5ed3ff2fab --- /dev/null +++ b/tests/specs/run/tsx_imports/046_jsx_test.tsx @@ -0,0 +1,14 @@ +declare global { + export namespace JSX { + interface IntrinsicElements { + [elemName: string]: any; + } + } +} +const React = { + createElement(factory: any, props: any, ...children: any[]) { + return { factory, props, children }; + }, +}; +const View = () =>
land
; +console.log(); diff --git a/tests/specs/run/tsx_imports/__test__.jsonc b/tests/specs/run/tsx_imports/__test__.jsonc new file mode 100644 index 0000000000..2026804add --- /dev/null +++ b/tests/specs/run/tsx_imports/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --check tsx_imports/tsx_imports.ts", + "output": "tsx_imports/tsx_imports.ts.out" +} diff --git a/tests/testdata/run/tsx_imports/Component.tsx b/tests/specs/run/tsx_imports/tsx_imports/Component.tsx similarity index 100% rename from tests/testdata/run/tsx_imports/Component.tsx rename to tests/specs/run/tsx_imports/tsx_imports/Component.tsx diff --git a/tests/testdata/run/tsx_imports/tsx_imports.ts b/tests/specs/run/tsx_imports/tsx_imports/tsx_imports.ts similarity index 100% rename from tests/testdata/run/tsx_imports/tsx_imports.ts rename to tests/specs/run/tsx_imports/tsx_imports/tsx_imports.ts diff --git a/tests/testdata/run/tsx_imports/tsx_imports.ts.out b/tests/specs/run/tsx_imports/tsx_imports/tsx_imports.ts.out similarity index 100% rename from tests/testdata/run/tsx_imports/tsx_imports.ts.out rename to tests/specs/run/tsx_imports/tsx_imports/tsx_imports.ts.out diff --git a/tests/specs/run/type_definitions/__test__.jsonc b/tests/specs/run/type_definitions/__test__.jsonc new file mode 100644 index 0000000000..5030612a51 --- /dev/null +++ b/tests/specs/run/type_definitions/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload type_definitions.ts", + "output": "type_definitions.ts.out" +} diff --git a/tests/testdata/run/type_definitions.ts b/tests/specs/run/type_definitions/type_definitions.ts similarity index 56% rename from tests/testdata/run/type_definitions.ts rename to tests/specs/run/type_definitions/type_definitions.ts index 5948427219..0297c7e3d5 100644 --- a/tests/testdata/run/type_definitions.ts +++ b/tests/specs/run/type_definitions/type_definitions.ts @@ -1,11 +1,11 @@ // deno-lint-ignore-file // @deno-types="../type_definitions/foo.d.ts" -import { foo } from "../type_definitions/foo.js"; +import { foo } from "./type_definitions/foo.js"; // @deno-types="../type_definitions/fizz.d.ts" -import "../type_definitions/fizz.js"; +import "./type_definitions/fizz.js"; -import * as qat from "../type_definitions/qat.ts"; +import * as qat from "./type_definitions/qat.ts"; console.log(foo); console.log(fizz); diff --git a/tests/testdata/run/type_definitions.ts.out b/tests/specs/run/type_definitions/type_definitions.ts.out similarity index 100% rename from tests/testdata/run/type_definitions.ts.out rename to tests/specs/run/type_definitions/type_definitions.ts.out diff --git a/tests/specs/run/type_definitions/type_definitions/bar.d.ts b/tests/specs/run/type_definitions/type_definitions/bar.d.ts new file mode 100644 index 0000000000..d43335dbb5 --- /dev/null +++ b/tests/specs/run/type_definitions/type_definitions/bar.d.ts @@ -0,0 +1,7 @@ +/// + +declare namespace bar { + export class Bar { + baz: string; + } +} diff --git a/tests/specs/run/type_definitions/type_definitions/bar.js b/tests/specs/run/type_definitions/type_definitions/bar.js new file mode 100644 index 0000000000..e9c2e5193c --- /dev/null +++ b/tests/specs/run/type_definitions/type_definitions/bar.js @@ -0,0 +1,5 @@ +export class Bar { + constructor() { + this.baz = "baz"; + } +} diff --git a/tests/specs/run/type_definitions/type_definitions/fizz.d.ts b/tests/specs/run/type_definitions/type_definitions/fizz.d.ts new file mode 100644 index 0000000000..34eb41b960 --- /dev/null +++ b/tests/specs/run/type_definitions/type_definitions/fizz.d.ts @@ -0,0 +1,2 @@ +/** A global value. */ +declare const fizz: string; diff --git a/tests/specs/run/type_definitions/type_definitions/fizz.js b/tests/specs/run/type_definitions/type_definitions/fizz.js new file mode 100644 index 0000000000..852162c940 --- /dev/null +++ b/tests/specs/run/type_definitions/type_definitions/fizz.js @@ -0,0 +1 @@ +globalThis.fizz = "fizz"; diff --git a/tests/specs/run/type_definitions/type_definitions/foo.d.ts b/tests/specs/run/type_definitions/type_definitions/foo.d.ts new file mode 100644 index 0000000000..ce39201e1b --- /dev/null +++ b/tests/specs/run/type_definitions/type_definitions/foo.d.ts @@ -0,0 +1,2 @@ +/** An exported value. */ +export const foo: string; diff --git a/tests/specs/run/type_definitions/type_definitions/foo.js b/tests/specs/run/type_definitions/type_definitions/foo.js new file mode 100644 index 0000000000..61d366eb25 --- /dev/null +++ b/tests/specs/run/type_definitions/type_definitions/foo.js @@ -0,0 +1 @@ +export const foo = "foo"; diff --git a/tests/specs/run/type_definitions/type_definitions/qat.ts b/tests/specs/run/type_definitions/type_definitions/qat.ts new file mode 100644 index 0000000000..6196c9d387 --- /dev/null +++ b/tests/specs/run/type_definitions/type_definitions/qat.ts @@ -0,0 +1 @@ +export const qat = "qat"; diff --git a/tests/specs/run/type_definitions_for_export/__test__.jsonc b/tests/specs/run/type_definitions_for_export/__test__.jsonc new file mode 100644 index 0000000000..cf32bc9609 --- /dev/null +++ b/tests/specs/run/type_definitions_for_export/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --reload --check type_definitions_for_export.ts", + "output": "type_definitions_for_export.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/run/type_definitions_for_export/export_type_def.ts b/tests/specs/run/type_definitions_for_export/export_type_def.ts new file mode 100644 index 0000000000..e33b70a644 --- /dev/null +++ b/tests/specs/run/type_definitions_for_export/export_type_def.ts @@ -0,0 +1,2 @@ +// @deno-types="./type_definitions/foo.d.ts" +export { foo } from "./type_definitions/foo.js"; diff --git a/tests/specs/run/type_definitions_for_export/type_definitions/bar.d.ts b/tests/specs/run/type_definitions_for_export/type_definitions/bar.d.ts new file mode 100644 index 0000000000..d43335dbb5 --- /dev/null +++ b/tests/specs/run/type_definitions_for_export/type_definitions/bar.d.ts @@ -0,0 +1,7 @@ +/// + +declare namespace bar { + export class Bar { + baz: string; + } +} diff --git a/tests/specs/run/type_definitions_for_export/type_definitions/bar.js b/tests/specs/run/type_definitions_for_export/type_definitions/bar.js new file mode 100644 index 0000000000..e9c2e5193c --- /dev/null +++ b/tests/specs/run/type_definitions_for_export/type_definitions/bar.js @@ -0,0 +1,5 @@ +export class Bar { + constructor() { + this.baz = "baz"; + } +} diff --git a/tests/specs/run/type_definitions_for_export/type_definitions/fizz.d.ts b/tests/specs/run/type_definitions_for_export/type_definitions/fizz.d.ts new file mode 100644 index 0000000000..34eb41b960 --- /dev/null +++ b/tests/specs/run/type_definitions_for_export/type_definitions/fizz.d.ts @@ -0,0 +1,2 @@ +/** A global value. */ +declare const fizz: string; diff --git a/tests/specs/run/type_definitions_for_export/type_definitions/fizz.js b/tests/specs/run/type_definitions_for_export/type_definitions/fizz.js new file mode 100644 index 0000000000..852162c940 --- /dev/null +++ b/tests/specs/run/type_definitions_for_export/type_definitions/fizz.js @@ -0,0 +1 @@ +globalThis.fizz = "fizz"; diff --git a/tests/specs/run/type_definitions_for_export/type_definitions/foo.d.ts b/tests/specs/run/type_definitions_for_export/type_definitions/foo.d.ts new file mode 100644 index 0000000000..ce39201e1b --- /dev/null +++ b/tests/specs/run/type_definitions_for_export/type_definitions/foo.d.ts @@ -0,0 +1,2 @@ +/** An exported value. */ +export const foo: string; diff --git a/tests/specs/run/type_definitions_for_export/type_definitions/foo.js b/tests/specs/run/type_definitions_for_export/type_definitions/foo.js new file mode 100644 index 0000000000..61d366eb25 --- /dev/null +++ b/tests/specs/run/type_definitions_for_export/type_definitions/foo.js @@ -0,0 +1 @@ +export const foo = "foo"; diff --git a/tests/specs/run/type_definitions_for_export/type_definitions/qat.ts b/tests/specs/run/type_definitions_for_export/type_definitions/qat.ts new file mode 100644 index 0000000000..6196c9d387 --- /dev/null +++ b/tests/specs/run/type_definitions_for_export/type_definitions/qat.ts @@ -0,0 +1 @@ +export const qat = "qat"; diff --git a/tests/testdata/run/type_definitions_for_export.ts b/tests/specs/run/type_definitions_for_export/type_definitions_for_export.ts similarity index 100% rename from tests/testdata/run/type_definitions_for_export.ts rename to tests/specs/run/type_definitions_for_export/type_definitions_for_export.ts diff --git a/tests/testdata/run/type_definitions_for_export.ts.out b/tests/specs/run/type_definitions_for_export/type_definitions_for_export.ts.out similarity index 100% rename from tests/testdata/run/type_definitions_for_export.ts.out rename to tests/specs/run/type_definitions_for_export/type_definitions_for_export.ts.out diff --git a/tests/specs/run/type_directives_01/__test__.jsonc b/tests/specs/run/type_directives_01/__test__.jsonc new file mode 100644 index 0000000000..08826b776e --- /dev/null +++ b/tests/specs/run/type_directives_01/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --check=all -L debug type_directives_01.ts", + "output": "type_directives_01.ts.out" +} diff --git a/tests/testdata/run/type_directives_01.ts b/tests/specs/run/type_directives_01/type_directives_01.ts similarity index 100% rename from tests/testdata/run/type_directives_01.ts rename to tests/specs/run/type_directives_01/type_directives_01.ts diff --git a/tests/testdata/run/type_directives_01.ts.out b/tests/specs/run/type_directives_01/type_directives_01.ts.out similarity index 100% rename from tests/testdata/run/type_directives_01.ts.out rename to tests/specs/run/type_directives_01/type_directives_01.ts.out diff --git a/tests/specs/run/type_directives_02/__test__.jsonc b/tests/specs/run/type_directives_02/__test__.jsonc new file mode 100644 index 0000000000..e731e393e1 --- /dev/null +++ b/tests/specs/run/type_directives_02/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --check=all -L debug type_directives_02.ts", + "output": "type_directives_02.ts.out" +} diff --git a/tests/specs/run/type_directives_02/type_directives_02.ts b/tests/specs/run/type_directives_02/type_directives_02.ts new file mode 100644 index 0000000000..f829c0cec3 --- /dev/null +++ b/tests/specs/run/type_directives_02/type_directives_02.ts @@ -0,0 +1,3 @@ +import * as foo from "./type_reference.js"; + +console.log(foo.foo); diff --git a/tests/specs/run/type_directives_02/type_directives_02.ts.out b/tests/specs/run/type_directives_02/type_directives_02.ts.out new file mode 100644 index 0000000000..d9bd381504 --- /dev/null +++ b/tests/specs/run/type_directives_02/type_directives_02.ts.out @@ -0,0 +1,3 @@ +[WILDCARD] +DEBUG TS - host.getSourceFile("file:///[WILDCARD]/type_reference.d.ts", Latest) +[WILDCARD] \ No newline at end of file diff --git a/tests/specs/run/type_directives_02/type_reference.d.ts b/tests/specs/run/type_directives_02/type_reference.d.ts new file mode 100644 index 0000000000..f9b8de5ede --- /dev/null +++ b/tests/specs/run/type_directives_02/type_reference.d.ts @@ -0,0 +1 @@ +export const foo: "foo"; diff --git a/tests/specs/run/type_directives_02/type_reference.js b/tests/specs/run/type_directives_02/type_reference.js new file mode 100644 index 0000000000..917d891980 --- /dev/null +++ b/tests/specs/run/type_directives_02/type_reference.js @@ -0,0 +1,3 @@ +/// + +export const foo = "foo"; diff --git a/tests/specs/run/type_headers_deno_types/__test__.jsonc b/tests/specs/run/type_headers_deno_types/__test__.jsonc new file mode 100644 index 0000000000..1a95fa2d45 --- /dev/null +++ b/tests/specs/run/type_headers_deno_types/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import --reload --check type_headers_deno_types.ts", + "output": "type_headers_deno_types.ts.out" +} diff --git a/tests/testdata/run/type_headers_deno_types.ts b/tests/specs/run/type_headers_deno_types/type_headers_deno_types.ts similarity index 100% rename from tests/testdata/run/type_headers_deno_types.ts rename to tests/specs/run/type_headers_deno_types/type_headers_deno_types.ts diff --git a/tests/testdata/run/type_headers_deno_types.ts.out b/tests/specs/run/type_headers_deno_types/type_headers_deno_types.ts.out similarity index 100% rename from tests/testdata/run/type_headers_deno_types.ts.out rename to tests/specs/run/type_headers_deno_types/type_headers_deno_types.ts.out diff --git a/tests/specs/run/unbuffered_stderr/__test__.jsonc b/tests/specs/run/unbuffered_stderr/__test__.jsonc new file mode 100644 index 0000000000..4b8a091f24 --- /dev/null +++ b/tests/specs/run/unbuffered_stderr/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload unbuffered_stderr.ts", + "output": "unbuffered_stderr.ts.out" +} diff --git a/tests/testdata/run/unbuffered_stderr.ts b/tests/specs/run/unbuffered_stderr/unbuffered_stderr.ts similarity index 100% rename from tests/testdata/run/unbuffered_stderr.ts rename to tests/specs/run/unbuffered_stderr/unbuffered_stderr.ts diff --git a/tests/testdata/run/unbuffered_stderr.ts.out b/tests/specs/run/unbuffered_stderr/unbuffered_stderr.ts.out similarity index 100% rename from tests/testdata/run/unbuffered_stderr.ts.out rename to tests/specs/run/unbuffered_stderr/unbuffered_stderr.ts.out diff --git a/tests/specs/run/unbuffered_stdout/__test__.jsonc b/tests/specs/run/unbuffered_stdout/__test__.jsonc new file mode 100644 index 0000000000..4225e9d0a2 --- /dev/null +++ b/tests/specs/run/unbuffered_stdout/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload unbuffered_stdout.ts", + "output": "unbuffered_stdout.ts.out" +} diff --git a/tests/testdata/run/unbuffered_stdout.ts b/tests/specs/run/unbuffered_stdout/unbuffered_stdout.ts similarity index 100% rename from tests/testdata/run/unbuffered_stdout.ts rename to tests/specs/run/unbuffered_stdout/unbuffered_stdout.ts diff --git a/tests/testdata/run/unbuffered_stdout.ts.out b/tests/specs/run/unbuffered_stdout/unbuffered_stdout.ts.out similarity index 100% rename from tests/testdata/run/unbuffered_stdout.ts.out rename to tests/specs/run/unbuffered_stdout/unbuffered_stdout.ts.out diff --git a/tests/specs/run/unhandled_rejection/__test__.jsonc b/tests/specs/run/unhandled_rejection/__test__.jsonc new file mode 100644 index 0000000000..3a22292062 --- /dev/null +++ b/tests/specs/run/unhandled_rejection/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --check unhandled_rejection.ts", + "output": "unhandled_rejection.ts.out" +} diff --git a/tests/testdata/run/unhandled_rejection.ts b/tests/specs/run/unhandled_rejection/unhandled_rejection.ts similarity index 100% rename from tests/testdata/run/unhandled_rejection.ts rename to tests/specs/run/unhandled_rejection/unhandled_rejection.ts diff --git a/tests/specs/run/unhandled_rejection/unhandled_rejection.ts.out b/tests/specs/run/unhandled_rejection/unhandled_rejection.ts.out new file mode 100644 index 0000000000..fc5a3915f6 --- /dev/null +++ b/tests/specs/run/unhandled_rejection/unhandled_rejection.ts.out @@ -0,0 +1,9 @@ +[WILDCARD] +unhandled rejection at: Promise { + Error: bar not available + at new Foo (file:///[WILDCARD]/unhandled_rejection.ts:8:20) + at file:///[WILDCARD]/unhandled_rejection.ts:12:1 +} reason: Error: bar not available + at new Foo (file:///[WILDCARD]/unhandled_rejection.ts:8:20) + at file:///[WILDCARD]/unhandled_rejection.ts:12:1 +unhandled rejection at: Promise { undefined } reason: undefined diff --git a/tests/specs/run/unhandled_rejection_dynamic_import/__test__.jsonc b/tests/specs/run/unhandled_rejection_dynamic_import/__test__.jsonc new file mode 100644 index 0000000000..6ca0d093b9 --- /dev/null +++ b/tests/specs/run/unhandled_rejection_dynamic_import/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --allow-read unhandled_rejection_dynamic_import/main.ts", + "output": "unhandled_rejection_dynamic_import/main.ts.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/unhandled_rejection_dynamic_import/import.ts b/tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/import.ts similarity index 100% rename from tests/testdata/run/unhandled_rejection_dynamic_import/import.ts rename to tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/import.ts diff --git a/tests/testdata/run/unhandled_rejection_dynamic_import/main.ts b/tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/main.ts similarity index 100% rename from tests/testdata/run/unhandled_rejection_dynamic_import/main.ts rename to tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/main.ts diff --git a/tests/testdata/run/unhandled_rejection_dynamic_import/main.ts.out b/tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/main.ts.out similarity index 100% rename from tests/testdata/run/unhandled_rejection_dynamic_import/main.ts.out rename to tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/main.ts.out diff --git a/tests/specs/run/unhandled_rejection_dynamic_import2/__test__.jsonc b/tests/specs/run/unhandled_rejection_dynamic_import2/__test__.jsonc new file mode 100644 index 0000000000..a4e588f463 --- /dev/null +++ b/tests/specs/run/unhandled_rejection_dynamic_import2/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read unhandled_rejection_dynamic_import2/main.ts", + "output": "unhandled_rejection_dynamic_import2/main.ts.out" +} diff --git a/tests/testdata/run/unhandled_rejection_dynamic_import2/import.ts b/tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/import.ts similarity index 100% rename from tests/testdata/run/unhandled_rejection_dynamic_import2/import.ts rename to tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/import.ts diff --git a/tests/testdata/run/unhandled_rejection_dynamic_import2/main.ts b/tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/main.ts similarity index 100% rename from tests/testdata/run/unhandled_rejection_dynamic_import2/main.ts rename to tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/main.ts diff --git a/tests/testdata/run/unhandled_rejection_dynamic_import2/main.ts.out b/tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/main.ts.out similarity index 100% rename from tests/testdata/run/unhandled_rejection_dynamic_import2/main.ts.out rename to tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/main.ts.out diff --git a/tests/specs/run/unhandled_rejection_sync_error/__test__.jsonc b/tests/specs/run/unhandled_rejection_sync_error/__test__.jsonc new file mode 100644 index 0000000000..3f09f9c369 --- /dev/null +++ b/tests/specs/run/unhandled_rejection_sync_error/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --check unhandled_rejection_sync_error.ts", + "output": "unhandled_rejection_sync_error.ts.out" +} diff --git a/tests/testdata/run/unhandled_rejection_sync_error.ts b/tests/specs/run/unhandled_rejection_sync_error/unhandled_rejection_sync_error.ts similarity index 100% rename from tests/testdata/run/unhandled_rejection_sync_error.ts rename to tests/specs/run/unhandled_rejection_sync_error/unhandled_rejection_sync_error.ts diff --git a/tests/specs/run/unhandled_rejection_sync_error/unhandled_rejection_sync_error.ts.out b/tests/specs/run/unhandled_rejection_sync_error/unhandled_rejection_sync_error.ts.out new file mode 100644 index 0000000000..0c1115ef24 --- /dev/null +++ b/tests/specs/run/unhandled_rejection_sync_error/unhandled_rejection_sync_error.ts.out @@ -0,0 +1,6 @@ +[WILDCARD] +unhandled rejection at: Promise { + Error: boom! + at file:///[WILDCARD]unhandled_rejection_sync_error.ts:6:7 +} reason: Error: boom! + at file:///[WILDCARD]unhandled_rejection_sync_error.ts:6:7 diff --git a/tests/specs/run/unsafe_proto/__test__.jsonc b/tests/specs/run/unsafe_proto/__test__.jsonc new file mode 100644 index 0000000000..d1c608b515 --- /dev/null +++ b/tests/specs/run/unsafe_proto/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run -A unsafe_proto/main.js", + "output": "unsafe_proto/main.out", + "exitCode": 0 +} diff --git a/tests/testdata/run/unsafe_proto/main.js b/tests/specs/run/unsafe_proto/unsafe_proto/main.js similarity index 100% rename from tests/testdata/run/unsafe_proto/main.js rename to tests/specs/run/unsafe_proto/unsafe_proto/main.js diff --git a/tests/testdata/run/unsafe_proto/main.out b/tests/specs/run/unsafe_proto/unsafe_proto/main.out similarity index 100% rename from tests/testdata/run/unsafe_proto/main.out rename to tests/specs/run/unsafe_proto/unsafe_proto/main.out diff --git a/tests/testdata/run/unsafe_proto/main_with_unsafe_proto_flag.out b/tests/specs/run/unsafe_proto/unsafe_proto/main_with_unsafe_proto_flag.out similarity index 100% rename from tests/testdata/run/unsafe_proto/main_with_unsafe_proto_flag.out rename to tests/specs/run/unsafe_proto/unsafe_proto/main_with_unsafe_proto_flag.out diff --git a/tests/testdata/run/unsafe_proto/worker.js b/tests/specs/run/unsafe_proto/unsafe_proto/worker.js similarity index 100% rename from tests/testdata/run/unsafe_proto/worker.js rename to tests/specs/run/unsafe_proto/unsafe_proto/worker.js diff --git a/tests/specs/run/unsafe_proto_flag/__test__.jsonc b/tests/specs/run/unsafe_proto_flag/__test__.jsonc new file mode 100644 index 0000000000..8bd2b56ffc --- /dev/null +++ b/tests/specs/run/unsafe_proto_flag/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run -A --unstable-unsafe-proto unsafe_proto/main.js", + "output": "unsafe_proto/main_with_unsafe_proto_flag.out", + "exitCode": 0 +} diff --git a/tests/specs/run/unsafe_proto_flag/unsafe_proto/main.js b/tests/specs/run/unsafe_proto_flag/unsafe_proto/main.js new file mode 100644 index 0000000000..eb95c55a03 --- /dev/null +++ b/tests/specs/run/unsafe_proto_flag/unsafe_proto/main.js @@ -0,0 +1,5 @@ +console.log(Object.hasOwn(Object.prototype, "__proto__")); + +new Worker(import.meta.resolve("./worker.js"), { + type: "module", +}); diff --git a/tests/specs/run/unsafe_proto_flag/unsafe_proto/main.out b/tests/specs/run/unsafe_proto_flag/unsafe_proto/main.out new file mode 100644 index 0000000000..4b095fd0ff --- /dev/null +++ b/tests/specs/run/unsafe_proto_flag/unsafe_proto/main.out @@ -0,0 +1,2 @@ +false +false diff --git a/tests/specs/run/unsafe_proto_flag/unsafe_proto/main_with_unsafe_proto_flag.out b/tests/specs/run/unsafe_proto_flag/unsafe_proto/main_with_unsafe_proto_flag.out new file mode 100644 index 0000000000..bb101b641b --- /dev/null +++ b/tests/specs/run/unsafe_proto_flag/unsafe_proto/main_with_unsafe_proto_flag.out @@ -0,0 +1,2 @@ +true +true diff --git a/tests/specs/run/unsafe_proto_flag/unsafe_proto/worker.js b/tests/specs/run/unsafe_proto_flag/unsafe_proto/worker.js new file mode 100644 index 0000000000..b22bc87139 --- /dev/null +++ b/tests/specs/run/unsafe_proto_flag/unsafe_proto/worker.js @@ -0,0 +1,2 @@ +console.log(Object.hasOwn(Object.prototype, "__proto__")); +close(); diff --git a/tests/specs/run/unstable_broadcast_channel_disabled/__test__.jsonc b/tests/specs/run/unstable_broadcast_channel_disabled/__test__.jsonc new file mode 100644 index 0000000000..fa12c9f91d --- /dev/null +++ b/tests/specs/run/unstable_broadcast_channel_disabled/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read unstable_broadcast_channel.js", + "output": "unstable_broadcast_channel.disabled.out" +} diff --git a/tests/testdata/run/unstable_broadcast_channel.disabled.out b/tests/specs/run/unstable_broadcast_channel_disabled/unstable_broadcast_channel.disabled.out similarity index 100% rename from tests/testdata/run/unstable_broadcast_channel.disabled.out rename to tests/specs/run/unstable_broadcast_channel_disabled/unstable_broadcast_channel.disabled.out diff --git a/tests/testdata/run/unstable_broadcast_channel.js b/tests/specs/run/unstable_broadcast_channel_disabled/unstable_broadcast_channel.js similarity index 100% rename from tests/testdata/run/unstable_broadcast_channel.js rename to tests/specs/run/unstable_broadcast_channel_disabled/unstable_broadcast_channel.js diff --git a/tests/specs/run/unstable_broadcast_channel_enabled/__test__.jsonc b/tests/specs/run/unstable_broadcast_channel_enabled/__test__.jsonc new file mode 100644 index 0000000000..f93c7785a4 --- /dev/null +++ b/tests/specs/run/unstable_broadcast_channel_enabled/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read --unstable-broadcast-channel unstable_broadcast_channel.js", + "output": "unstable_broadcast_channel.enabled.out" +} diff --git a/tests/testdata/run/unstable_broadcast_channel.enabled.out b/tests/specs/run/unstable_broadcast_channel_enabled/unstable_broadcast_channel.enabled.out similarity index 100% rename from tests/testdata/run/unstable_broadcast_channel.enabled.out rename to tests/specs/run/unstable_broadcast_channel_enabled/unstable_broadcast_channel.enabled.out diff --git a/tests/specs/run/unstable_broadcast_channel_enabled/unstable_broadcast_channel.js b/tests/specs/run/unstable_broadcast_channel_enabled/unstable_broadcast_channel.js new file mode 100644 index 0000000000..b8576aa22f --- /dev/null +++ b/tests/specs/run/unstable_broadcast_channel_enabled/unstable_broadcast_channel.js @@ -0,0 +1,10 @@ +const scope = import.meta.url.slice(-7) === "#worker" ? "worker" : "main"; + +console.log(scope, globalThis.BroadcastChannel); + +if (scope === "worker") { + postMessage("done"); +} else { + const worker = new Worker(`${import.meta.url}#worker`, { type: "module" }); + worker.onmessage = () => Deno.exit(0); +} diff --git a/tests/specs/run/unstable_cron_disabled/__test__.jsonc b/tests/specs/run/unstable_cron_disabled/__test__.jsonc new file mode 100644 index 0000000000..be89db40b5 --- /dev/null +++ b/tests/specs/run/unstable_cron_disabled/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read unstable_cron.js", + "output": "unstable_cron.disabled.out" +} diff --git a/tests/testdata/run/unstable_cron.disabled.out b/tests/specs/run/unstable_cron_disabled/unstable_cron.disabled.out similarity index 100% rename from tests/testdata/run/unstable_cron.disabled.out rename to tests/specs/run/unstable_cron_disabled/unstable_cron.disabled.out diff --git a/tests/testdata/run/unstable_cron.js b/tests/specs/run/unstable_cron_disabled/unstable_cron.js similarity index 100% rename from tests/testdata/run/unstable_cron.js rename to tests/specs/run/unstable_cron_disabled/unstable_cron.js diff --git a/tests/specs/run/unstable_cron_enabled/__test__.jsonc b/tests/specs/run/unstable_cron_enabled/__test__.jsonc new file mode 100644 index 0000000000..07a37e3fef --- /dev/null +++ b/tests/specs/run/unstable_cron_enabled/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read --unstable-cron unstable_cron.js", + "output": "unstable_cron.enabled.out" +} diff --git a/tests/testdata/run/unstable_cron.enabled.out b/tests/specs/run/unstable_cron_enabled/unstable_cron.enabled.out similarity index 100% rename from tests/testdata/run/unstable_cron.enabled.out rename to tests/specs/run/unstable_cron_enabled/unstable_cron.enabled.out diff --git a/tests/specs/run/unstable_cron_enabled/unstable_cron.js b/tests/specs/run/unstable_cron_enabled/unstable_cron.js new file mode 100644 index 0000000000..3114f6e555 --- /dev/null +++ b/tests/specs/run/unstable_cron_enabled/unstable_cron.js @@ -0,0 +1,10 @@ +const scope = import.meta.url.slice(-7) === "#worker" ? "worker" : "main"; + +console.log(scope, Deno.cron); + +if (scope === "worker") { + postMessage("done"); +} else { + const worker = new Worker(`${import.meta.url}#worker`, { type: "module" }); + worker.onmessage = () => Deno.exit(0); +} diff --git a/tests/specs/run/unstable_kv_disabled/__test__.jsonc b/tests/specs/run/unstable_kv_disabled/__test__.jsonc new file mode 100644 index 0000000000..6521c180d8 --- /dev/null +++ b/tests/specs/run/unstable_kv_disabled/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read unstable_kv.js", + "output": "unstable_kv.disabled.out" +} diff --git a/tests/testdata/run/unstable_kv.disabled.out b/tests/specs/run/unstable_kv_disabled/unstable_kv.disabled.out similarity index 100% rename from tests/testdata/run/unstable_kv.disabled.out rename to tests/specs/run/unstable_kv_disabled/unstable_kv.disabled.out diff --git a/tests/testdata/run/unstable_kv.js b/tests/specs/run/unstable_kv_disabled/unstable_kv.js similarity index 100% rename from tests/testdata/run/unstable_kv.js rename to tests/specs/run/unstable_kv_disabled/unstable_kv.js diff --git a/tests/specs/run/unstable_kv_enabled/__test__.jsonc b/tests/specs/run/unstable_kv_enabled/__test__.jsonc new file mode 100644 index 0000000000..6e9fea1000 --- /dev/null +++ b/tests/specs/run/unstable_kv_enabled/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read --unstable-kv unstable_kv.js", + "output": "unstable_kv.enabled.out" +} diff --git a/tests/testdata/run/unstable_kv.enabled.out b/tests/specs/run/unstable_kv_enabled/unstable_kv.enabled.out similarity index 100% rename from tests/testdata/run/unstable_kv.enabled.out rename to tests/specs/run/unstable_kv_enabled/unstable_kv.enabled.out diff --git a/tests/specs/run/unstable_kv_enabled/unstable_kv.js b/tests/specs/run/unstable_kv_enabled/unstable_kv.js new file mode 100644 index 0000000000..17c0e05aa5 --- /dev/null +++ b/tests/specs/run/unstable_kv_enabled/unstable_kv.js @@ -0,0 +1,14 @@ +const scope = import.meta.url.slice(-7) === "#worker" ? "worker" : "main"; + +console.log(scope, Deno.AtomicOperation); +console.log(scope, Deno.Kv); +console.log(scope, Deno.KvListIterator); +console.log(scope, Deno.KvU64); +console.log(scope, Deno.openKv); + +if (scope === "worker") { + postMessage("done"); +} else { + const worker = new Worker(`${import.meta.url}#worker`, { type: "module" }); + worker.onmessage = () => Deno.exit(0); +} diff --git a/tests/specs/run/unstable_net_disabled/__test__.jsonc b/tests/specs/run/unstable_net_disabled/__test__.jsonc new file mode 100644 index 0000000000..6bccb2ef6c --- /dev/null +++ b/tests/specs/run/unstable_net_disabled/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read unstable_net.js", + "output": "unstable_net.disabled.out" +} diff --git a/tests/testdata/run/unstable_net.disabled.out b/tests/specs/run/unstable_net_disabled/unstable_net.disabled.out similarity index 100% rename from tests/testdata/run/unstable_net.disabled.out rename to tests/specs/run/unstable_net_disabled/unstable_net.disabled.out diff --git a/tests/testdata/run/unstable_net.js b/tests/specs/run/unstable_net_disabled/unstable_net.js similarity index 100% rename from tests/testdata/run/unstable_net.js rename to tests/specs/run/unstable_net_disabled/unstable_net.js diff --git a/tests/specs/run/unstable_net_enabled/__test__.jsonc b/tests/specs/run/unstable_net_enabled/__test__.jsonc new file mode 100644 index 0000000000..8e9696f44a --- /dev/null +++ b/tests/specs/run/unstable_net_enabled/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read --unstable-net unstable_net.js", + "output": "unstable_net.enabled.out" +} diff --git a/tests/testdata/run/unstable_net.enabled.out b/tests/specs/run/unstable_net_enabled/unstable_net.enabled.out similarity index 100% rename from tests/testdata/run/unstable_net.enabled.out rename to tests/specs/run/unstable_net_enabled/unstable_net.enabled.out diff --git a/tests/specs/run/unstable_net_enabled/unstable_net.js b/tests/specs/run/unstable_net_enabled/unstable_net.js new file mode 100644 index 0000000000..4492b202b1 --- /dev/null +++ b/tests/specs/run/unstable_net_enabled/unstable_net.js @@ -0,0 +1,11 @@ +const scope = import.meta.url.slice(-7) === "#worker" ? "worker" : "main"; + +console.log(scope, Deno.listenDatagram); +console.log(scope, globalThis.WebSocketStream); + +if (scope === "worker") { + postMessage("done"); +} else { + const worker = new Worker(`${import.meta.url}#worker`, { type: "module" }); + worker.onmessage = () => Deno.exit(0); +} diff --git a/tests/specs/run/unstable_worker/__test__.jsonc b/tests/specs/run/unstable_worker/__test__.jsonc new file mode 100644 index 0000000000..7a6e9bfbe0 --- /dev/null +++ b/tests/specs/run/unstable_worker/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --reload --quiet --allow-read unstable_worker.ts", + "output": "unstable_worker.ts.out" +} diff --git a/tests/testdata/run/unstable_worker.ts b/tests/specs/run/unstable_worker/unstable_worker.ts similarity index 62% rename from tests/testdata/run/unstable_worker.ts rename to tests/specs/run/unstable_worker/unstable_worker.ts index d111d2c7e3..b0554c5b21 100644 --- a/tests/testdata/run/unstable_worker.ts +++ b/tests/specs/run/unstable_worker/unstable_worker.ts @@ -1,5 +1,5 @@ const w = new Worker( - import.meta.resolve("../workers/worker_unstable.ts"), + import.meta.resolve("./worker_unstable.ts"), { type: "module", name: "Unstable Worker" }, ); diff --git a/tests/testdata/run/unstable_worker.ts.out b/tests/specs/run/unstable_worker/unstable_worker.ts.out similarity index 100% rename from tests/testdata/run/unstable_worker.ts.out rename to tests/specs/run/unstable_worker/unstable_worker.ts.out diff --git a/tests/specs/run/unstable_worker/worker_unstable.ts b/tests/specs/run/unstable_worker/worker_unstable.ts new file mode 100644 index 0000000000..219f34e7b8 --- /dev/null +++ b/tests/specs/run/unstable_worker/worker_unstable.ts @@ -0,0 +1,5 @@ +console.log(Deno.permissions.query); +console.log(Deno.consoleSize); +self.onmessage = () => { + self.close(); +}; diff --git a/tests/specs/run/unstable_worker_options_disabled/__test__.jsonc b/tests/specs/run/unstable_worker_options_disabled/__test__.jsonc new file mode 100644 index 0000000000..30087244ec --- /dev/null +++ b/tests/specs/run/unstable_worker_options_disabled/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --reload --allow-read unstable_worker_options.js", + "output": "unstable_worker_options.disabled.out", + "exitCode": 70 +} diff --git a/tests/testdata/run/unstable_worker_options.disabled.out b/tests/specs/run/unstable_worker_options_disabled/unstable_worker_options.disabled.out similarity index 100% rename from tests/testdata/run/unstable_worker_options.disabled.out rename to tests/specs/run/unstable_worker_options_disabled/unstable_worker_options.disabled.out diff --git a/tests/testdata/run/unstable_worker_options.js b/tests/specs/run/unstable_worker_options_disabled/unstable_worker_options.js similarity index 100% rename from tests/testdata/run/unstable_worker_options.js rename to tests/specs/run/unstable_worker_options_disabled/unstable_worker_options.js diff --git a/tests/specs/run/unstable_worker_options_enabled/__test__.jsonc b/tests/specs/run/unstable_worker_options_enabled/__test__.jsonc new file mode 100644 index 0000000000..1d397c5f24 --- /dev/null +++ b/tests/specs/run/unstable_worker_options_enabled/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read --unstable-worker-options unstable_worker_options.js", + "output": "unstable_worker_options.enabled.out" +} diff --git a/tests/testdata/run/unstable_worker_options.enabled.out b/tests/specs/run/unstable_worker_options_enabled/unstable_worker_options.enabled.out similarity index 100% rename from tests/testdata/run/unstable_worker_options.enabled.out rename to tests/specs/run/unstable_worker_options_enabled/unstable_worker_options.enabled.out diff --git a/tests/specs/run/unstable_worker_options_enabled/unstable_worker_options.js b/tests/specs/run/unstable_worker_options_enabled/unstable_worker_options.js new file mode 100644 index 0000000000..213eb3ee67 --- /dev/null +++ b/tests/specs/run/unstable_worker_options_enabled/unstable_worker_options.js @@ -0,0 +1,19 @@ +const scope = import.meta.url.slice(-7) === "#worker" ? "worker" : "main"; + +new Worker(`data:application/javascript;base64,${btoa(`postMessage("ok");`)}`, { + type: "module", + deno: { + permissions: { + read: true, + }, + }, +}).onmessage = ({ data }) => { + console.log(scope, data); + + if (scope === "main") { + const worker = new Worker(`${import.meta.url}#worker`, { type: "module" }); + worker.onmessage = () => Deno.exit(0); + } else { + postMessage("done"); + } +}; diff --git a/tests/specs/run/unsupported_dynamic_import_scheme/__test__.jsonc b/tests/specs/run/unsupported_dynamic_import_scheme/__test__.jsonc new file mode 100644 index 0000000000..7f71dcebae --- /dev/null +++ b/tests/specs/run/unsupported_dynamic_import_scheme/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "eval import('xxx:')", + "output": "unsupported_dynamic_import_scheme.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/unsupported_dynamic_import_scheme.out b/tests/specs/run/unsupported_dynamic_import_scheme/unsupported_dynamic_import_scheme.out similarity index 100% rename from tests/testdata/run/unsupported_dynamic_import_scheme.out rename to tests/specs/run/unsupported_dynamic_import_scheme/unsupported_dynamic_import_scheme.out diff --git a/tests/specs/run/v8_flags_env_run/__test__.jsonc b/tests/specs/run/v8_flags_env_run/__test__.jsonc new file mode 100644 index 0000000000..39ea666b84 --- /dev/null +++ b/tests/specs/run/v8_flags_env_run/__test__.jsonc @@ -0,0 +1,7 @@ +{ + "args": "run v8_flags.js", + "output": "v8_flags.js.out", + "envs": { + "DENO_V8_FLAGS": "--expose-gc" + } +} diff --git a/tests/testdata/run/v8_flags.js b/tests/specs/run/v8_flags_env_run/v8_flags.js similarity index 100% rename from tests/testdata/run/v8_flags.js rename to tests/specs/run/v8_flags_env_run/v8_flags.js diff --git a/tests/testdata/run/v8_flags.js.out b/tests/specs/run/v8_flags_env_run/v8_flags.js.out similarity index 100% rename from tests/testdata/run/v8_flags.js.out rename to tests/specs/run/v8_flags_env_run/v8_flags.js.out diff --git a/tests/specs/run/v8_flags_run/__test__.jsonc b/tests/specs/run/v8_flags_run/__test__.jsonc new file mode 100644 index 0000000000..ff21fb8c5b --- /dev/null +++ b/tests/specs/run/v8_flags_run/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --v8-flags=--expose-gc v8_flags.js", + "output": "v8_flags.js.out" +} diff --git a/tests/specs/run/v8_flags_run/v8_flags.js b/tests/specs/run/v8_flags_run/v8_flags.js new file mode 100644 index 0000000000..f7999c4afd --- /dev/null +++ b/tests/specs/run/v8_flags_run/v8_flags.js @@ -0,0 +1 @@ +console.log(typeof gc); diff --git a/tests/specs/run/v8_flags_run/v8_flags.js.out b/tests/specs/run/v8_flags_run/v8_flags.js.out new file mode 100644 index 0000000000..e2dbde096f --- /dev/null +++ b/tests/specs/run/v8_flags_run/v8_flags.js.out @@ -0,0 +1 @@ +function diff --git a/tests/specs/run/v8_flags_unrecognized/__test__.jsonc b/tests/specs/run/v8_flags_unrecognized/__test__.jsonc new file mode 100644 index 0000000000..93472d0d74 --- /dev/null +++ b/tests/specs/run/v8_flags_unrecognized/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "repl --v8-flags=--foo,bar,--trace-gc,-baz", + "output": "v8_flags_unrecognized.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/v8_flags_unrecognized.out b/tests/specs/run/v8_flags_unrecognized/v8_flags_unrecognized.out similarity index 100% rename from tests/testdata/run/v8_flags_unrecognized.out rename to tests/specs/run/v8_flags_unrecognized/v8_flags_unrecognized.out diff --git a/tests/specs/run/v8_help/__test__.jsonc b/tests/specs/run/v8_help/__test__.jsonc new file mode 100644 index 0000000000..90cbeb2748 --- /dev/null +++ b/tests/specs/run/v8_help/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "repl --v8-flags=--help", + "output": "v8_help.out" +} diff --git a/tests/testdata/run/v8_help.out b/tests/specs/run/v8_help/v8_help.out similarity index 100% rename from tests/testdata/run/v8_help.out rename to tests/specs/run/v8_help/v8_help.out diff --git a/tests/specs/run/wasm/__test__.jsonc b/tests/specs/run/wasm/__test__.jsonc new file mode 100644 index 0000000000..a3c6f58b2b --- /dev/null +++ b/tests/specs/run/wasm/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet wasm.ts", + "output": "wasm.ts.out" +} diff --git a/tests/testdata/run/wasm.ts b/tests/specs/run/wasm/wasm.ts similarity index 100% rename from tests/testdata/run/wasm.ts rename to tests/specs/run/wasm/wasm.ts diff --git a/tests/specs/run/wasm/wasm.ts.out b/tests/specs/run/wasm/wasm.ts.out new file mode 100644 index 0000000000..d81cc0710e --- /dev/null +++ b/tests/specs/run/wasm/wasm.ts.out @@ -0,0 +1 @@ +42 diff --git a/tests/specs/run/wasm_async/__test__.jsonc b/tests/specs/run/wasm_async/__test__.jsonc new file mode 100644 index 0000000000..583da86e01 --- /dev/null +++ b/tests/specs/run/wasm_async/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run wasm_async.js", + "output": "wasm_async.out" +} diff --git a/tests/testdata/run/wasm_async.js b/tests/specs/run/wasm_async/wasm_async.js similarity index 100% rename from tests/testdata/run/wasm_async.js rename to tests/specs/run/wasm_async/wasm_async.js diff --git a/tests/testdata/run/wasm_async.out b/tests/specs/run/wasm_async/wasm_async.out similarity index 100% rename from tests/testdata/run/wasm_async.out rename to tests/specs/run/wasm_async/wasm_async.out diff --git a/tests/specs/run/wasm_shared/__test__.jsonc b/tests/specs/run/wasm_shared/__test__.jsonc new file mode 100644 index 0000000000..1b6ececa75 --- /dev/null +++ b/tests/specs/run/wasm_shared/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet wasm_shared.ts", + "output": "wasm_shared.out" +} diff --git a/tests/specs/run/wasm_shared/wasm_shared.out b/tests/specs/run/wasm_shared/wasm_shared.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/testdata/run/wasm_shared.ts b/tests/specs/run/wasm_shared/wasm_shared.ts similarity index 100% rename from tests/testdata/run/wasm_shared.ts rename to tests/specs/run/wasm_shared/wasm_shared.ts diff --git a/tests/specs/run/wasm_streaming_panic_test/__test__.jsonc b/tests/specs/run/wasm_streaming_panic_test/__test__.jsonc new file mode 100644 index 0000000000..e22e1f98a8 --- /dev/null +++ b/tests/specs/run/wasm_streaming_panic_test/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run wasm_streaming_panic_test.js", + "output": "wasm_streaming_panic_test.js.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/wasm_streaming_panic_test.js b/tests/specs/run/wasm_streaming_panic_test/wasm_streaming_panic_test.js similarity index 100% rename from tests/testdata/run/wasm_streaming_panic_test.js rename to tests/specs/run/wasm_streaming_panic_test/wasm_streaming_panic_test.js diff --git a/tests/testdata/run/wasm_streaming_panic_test.js.out b/tests/specs/run/wasm_streaming_panic_test/wasm_streaming_panic_test.js.out similarity index 100% rename from tests/testdata/run/wasm_streaming_panic_test.js.out rename to tests/specs/run/wasm_streaming_panic_test/wasm_streaming_panic_test.js.out diff --git a/tests/specs/run/wasm_unreachable/__test__.jsonc b/tests/specs/run/wasm_unreachable/__test__.jsonc new file mode 100644 index 0000000000..cd6165629c --- /dev/null +++ b/tests/specs/run/wasm_unreachable/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --allow-read wasm_unreachable.js", + "output": "wasm_unreachable.out", + "exitCode": 1 +} diff --git a/tests/specs/run/wasm_unreachable/unreachable.wasm b/tests/specs/run/wasm_unreachable/unreachable.wasm new file mode 100644 index 0000000000000000000000000000000000000000..a4110ee393142cdbea567a320004b81f78850559 GIT binary patch literal 42 xcmZQbEY4+QU|?WmVN76PU}j=uVCQG#F3l@SO-#;6Ov*`RVBlh9WM*LC1^|Ym25A5Q literal 0 HcmV?d00001 diff --git a/tests/testdata/run/wasm_unreachable.js b/tests/specs/run/wasm_unreachable/wasm_unreachable.js similarity index 82% rename from tests/testdata/run/wasm_unreachable.js rename to tests/specs/run/wasm_unreachable/wasm_unreachable.js index d6a4f59dbc..36aab0d84f 100644 --- a/tests/testdata/run/wasm_unreachable.js +++ b/tests/specs/run/wasm_unreachable/wasm_unreachable.js @@ -1,5 +1,5 @@ // WebAssembly module containing a single function with an unreachable instruction -const binary = await Deno.readFile("./assets/unreachable.wasm"); +const binary = await Deno.readFile("./unreachable.wasm"); const module = new WebAssembly.Module(binary); const instance = new WebAssembly.Instance(module); diff --git a/tests/testdata/run/wasm_unreachable.out b/tests/specs/run/wasm_unreachable/wasm_unreachable.out similarity index 100% rename from tests/testdata/run/wasm_unreachable.out rename to tests/specs/run/wasm_unreachable/wasm_unreachable.out diff --git a/tests/specs/run/wasm_url/__test__.jsonc b/tests/specs/run/wasm_url/__test__.jsonc new file mode 100644 index 0000000000..a776527b1f --- /dev/null +++ b/tests/specs/run/wasm_url/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --allow-net=localhost:4545 wasm_url.js", + "output": "wasm_url.out", + "exitCode": 1 +} diff --git a/tests/testdata/run/wasm_url.js b/tests/specs/run/wasm_url/wasm_url.js similarity index 100% rename from tests/testdata/run/wasm_url.js rename to tests/specs/run/wasm_url/wasm_url.js diff --git a/tests/testdata/run/wasm_url.out b/tests/specs/run/wasm_url/wasm_url.out similarity index 100% rename from tests/testdata/run/wasm_url.out rename to tests/specs/run/wasm_url/wasm_url.out diff --git a/tests/specs/run/weakref/__test__.jsonc b/tests/specs/run/weakref/__test__.jsonc new file mode 100644 index 0000000000..1a5808ec7b --- /dev/null +++ b/tests/specs/run/weakref/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload weakref.ts", + "output": "weakref.ts.out" +} diff --git a/tests/testdata/run/weakref.ts b/tests/specs/run/weakref/weakref.ts similarity index 100% rename from tests/testdata/run/weakref.ts rename to tests/specs/run/weakref/weakref.ts diff --git a/tests/testdata/run/weakref.ts.out b/tests/specs/run/weakref/weakref.ts.out similarity index 100% rename from tests/testdata/run/weakref.ts.out rename to tests/specs/run/weakref/weakref.ts.out diff --git a/tests/specs/run/webstorage_serialization/__test__.jsonc b/tests/specs/run/webstorage_serialization/__test__.jsonc new file mode 100644 index 0000000000..4362a84b26 --- /dev/null +++ b/tests/specs/run/webstorage_serialization/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run webstorage/serialization.ts", + "output": "webstorage/serialization.ts.out" +} diff --git a/tests/specs/run/webstorage_serialization/webstorage/config_a.jsonc b/tests/specs/run/webstorage_serialization/webstorage/config_a.jsonc new file mode 100644 index 0000000000..875cb60012 --- /dev/null +++ b/tests/specs/run/webstorage_serialization/webstorage/config_a.jsonc @@ -0,0 +1,3 @@ +{ + "compilerOptions": {} +} diff --git a/tests/specs/run/webstorage_serialization/webstorage/config_b.jsonc b/tests/specs/run/webstorage_serialization/webstorage/config_b.jsonc new file mode 100644 index 0000000000..875cb60012 --- /dev/null +++ b/tests/specs/run/webstorage_serialization/webstorage/config_b.jsonc @@ -0,0 +1,3 @@ +{ + "compilerOptions": {} +} diff --git a/tests/specs/run/webstorage_serialization/webstorage/fixture.ts b/tests/specs/run/webstorage_serialization/webstorage/fixture.ts new file mode 100644 index 0000000000..cf4bd9f1f1 --- /dev/null +++ b/tests/specs/run/webstorage_serialization/webstorage/fixture.ts @@ -0,0 +1,2 @@ +import "./logger.ts"; +import "./setter.ts"; diff --git a/tests/specs/run/webstorage_serialization/webstorage/logger.ts b/tests/specs/run/webstorage_serialization/webstorage/logger.ts new file mode 100644 index 0000000000..feadd39eb6 --- /dev/null +++ b/tests/specs/run/webstorage_serialization/webstorage/logger.ts @@ -0,0 +1 @@ +console.log(globalThis.localStorage); diff --git a/tests/testdata/run/webstorage/serialization.ts b/tests/specs/run/webstorage_serialization/webstorage/serialization.ts similarity index 100% rename from tests/testdata/run/webstorage/serialization.ts rename to tests/specs/run/webstorage_serialization/webstorage/serialization.ts diff --git a/tests/testdata/run/webstorage/serialization.ts.out b/tests/specs/run/webstorage_serialization/webstorage/serialization.ts.out similarity index 100% rename from tests/testdata/run/webstorage/serialization.ts.out rename to tests/specs/run/webstorage_serialization/webstorage/serialization.ts.out diff --git a/tests/specs/run/webstorage_serialization/webstorage/setter.ts b/tests/specs/run/webstorage_serialization/webstorage/setter.ts new file mode 100644 index 0000000000..cf5a7bfaf6 --- /dev/null +++ b/tests/specs/run/webstorage_serialization/webstorage/setter.ts @@ -0,0 +1 @@ +globalThis.localStorage.setItem("hello", "deno"); diff --git a/tests/specs/run/worker_close_in_wasm_reactions/__test__.jsonc b/tests/specs/run/worker_close_in_wasm_reactions/__test__.jsonc new file mode 100644 index 0000000000..104b547564 --- /dev/null +++ b/tests/specs/run/worker_close_in_wasm_reactions/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read worker_close_in_wasm_reactions.js", + "output": "worker_close_in_wasm_reactions.js.out" +} diff --git a/tests/specs/run/worker_close_in_wasm_reactions/close_in_wasm_reactions.js b/tests/specs/run/worker_close_in_wasm_reactions/close_in_wasm_reactions.js new file mode 100644 index 0000000000..abe5731085 --- /dev/null +++ b/tests/specs/run/worker_close_in_wasm_reactions/close_in_wasm_reactions.js @@ -0,0 +1,21 @@ +// https://github.com/denoland/deno/issues/12263 +// Test for a panic that happens when a worker is closed in the reactions of a +// WASM async operation. + +// The minimum valid wasm module, plus two additional zero bytes. +const buffer = new Uint8Array([ + 0x00, + 0x61, + 0x73, + 0x6D, + 0x01, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, +]); +WebAssembly.compile(buffer).catch((err) => { + console.log("Error:", err); + self.close(); +}); diff --git a/tests/testdata/run/worker_close_in_wasm_reactions.js b/tests/specs/run/worker_close_in_wasm_reactions/worker_close_in_wasm_reactions.js similarity index 80% rename from tests/testdata/run/worker_close_in_wasm_reactions.js rename to tests/specs/run/worker_close_in_wasm_reactions/worker_close_in_wasm_reactions.js index 95f34e944d..828320a240 100644 --- a/tests/testdata/run/worker_close_in_wasm_reactions.js +++ b/tests/specs/run/worker_close_in_wasm_reactions/worker_close_in_wasm_reactions.js @@ -5,6 +5,6 @@ // WASM async operation. new Worker( - import.meta.resolve("../workers/close_in_wasm_reactions.js"), + import.meta.resolve("./close_in_wasm_reactions.js"), { type: "module" }, ); diff --git a/tests/testdata/run/worker_close_in_wasm_reactions.js.out b/tests/specs/run/worker_close_in_wasm_reactions/worker_close_in_wasm_reactions.js.out similarity index 100% rename from tests/testdata/run/worker_close_in_wasm_reactions.js.out rename to tests/specs/run/worker_close_in_wasm_reactions/worker_close_in_wasm_reactions.js.out diff --git a/tests/specs/run/worker_close_nested/__test__.jsonc b/tests/specs/run/worker_close_nested/__test__.jsonc new file mode 100644 index 0000000000..5cce107c7a --- /dev/null +++ b/tests/specs/run/worker_close_nested/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read worker_close_nested.js", + "output": "worker_close_nested.js.out" +} diff --git a/tests/specs/run/worker_close_nested/close_nested_child.js b/tests/specs/run/worker_close_nested/close_nested_child.js new file mode 100644 index 0000000000..97980c689e --- /dev/null +++ b/tests/specs/run/worker_close_nested/close_nested_child.js @@ -0,0 +1,8 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +console.log("Starting the child worker"); + +setTimeout(() => { + console.log("The child worker survived the death of the parent!!!"); + Deno.exit(1); +}, 2000); diff --git a/tests/specs/run/worker_close_nested/close_nested_parent.js b/tests/specs/run/worker_close_nested/close_nested_parent.js new file mode 100644 index 0000000000..d1fe47553e --- /dev/null +++ b/tests/specs/run/worker_close_nested/close_nested_parent.js @@ -0,0 +1,13 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +console.log("Starting the parent worker"); + +new Worker( + import.meta.resolve("./close_nested_child.js"), + { type: "module" }, +); + +self.addEventListener("message", () => { + console.log("Closing"); + self.close(); +}); diff --git a/tests/testdata/run/worker_close_nested.js b/tests/specs/run/worker_close_nested/worker_close_nested.js similarity index 89% rename from tests/testdata/run/worker_close_nested.js rename to tests/specs/run/worker_close_nested/worker_close_nested.js index 37b6ed9c9a..8d9c88d1cf 100644 --- a/tests/testdata/run/worker_close_nested.js +++ b/tests/specs/run/worker_close_nested/worker_close_nested.js @@ -6,7 +6,7 @@ console.log("Starting the main thread"); const worker = new Worker( - import.meta.resolve("../workers/close_nested_parent.js"), + import.meta.resolve("./close_nested_parent.js"), { type: "module" }, ); diff --git a/tests/testdata/run/worker_close_nested.js.out b/tests/specs/run/worker_close_nested/worker_close_nested.js.out similarity index 100% rename from tests/testdata/run/worker_close_nested.js.out rename to tests/specs/run/worker_close_nested/worker_close_nested.js.out diff --git a/tests/specs/run/worker_close_race/__test__.jsonc b/tests/specs/run/worker_close_race/__test__.jsonc new file mode 100644 index 0000000000..bdb9665f7e --- /dev/null +++ b/tests/specs/run/worker_close_race/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read worker_close_race.js", + "output": "worker_close_race.js.out" +} diff --git a/tests/specs/run/worker_close_race/close_race_worker.js b/tests/specs/run/worker_close_race/close_race_worker.js new file mode 100644 index 0000000000..6964be34a0 --- /dev/null +++ b/tests/specs/run/worker_close_race/close_race_worker.js @@ -0,0 +1,6 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +setTimeout(() => { + self.postMessage(""); + self.close(); +}, 500); diff --git a/tests/testdata/run/worker_close_race.js b/tests/specs/run/worker_close_race/worker_close_race.js similarity index 85% rename from tests/testdata/run/worker_close_race.js rename to tests/specs/run/worker_close_race/worker_close_race.js index 1da8324259..188cd9ed88 100644 --- a/tests/testdata/run/worker_close_race.js +++ b/tests/specs/run/worker_close_race/worker_close_race.js @@ -5,7 +5,7 @@ // `Worker.prototype.terminate()`. const worker = new Worker( - import.meta.resolve("../workers/close_race_worker.js"), + import.meta.resolve("./close_race_worker.js"), { type: "module" }, ); diff --git a/tests/specs/run/worker_close_race/worker_close_race.js.out b/tests/specs/run/worker_close_race/worker_close_race.js.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/specs/run/worker_drop_handle_race/__test__.jsonc b/tests/specs/run/worker_drop_handle_race/__test__.jsonc new file mode 100644 index 0000000000..cc600d5ef4 --- /dev/null +++ b/tests/specs/run/worker_drop_handle_race/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --quiet --reload --allow-read worker_drop_handle_race.js", + "output": "worker_drop_handle_race.js.out", + "exitCode": 1 +} diff --git a/tests/specs/run/worker_drop_handle_race/drop_handle_race.js b/tests/specs/run/worker_drop_handle_race/drop_handle_race.js new file mode 100644 index 0000000000..30676a600a --- /dev/null +++ b/tests/specs/run/worker_drop_handle_race/drop_handle_race.js @@ -0,0 +1,3 @@ +setTimeout(() => { + throw new Error(); +}, 1000); diff --git a/tests/testdata/run/worker_drop_handle_race.js b/tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js similarity index 88% rename from tests/testdata/run/worker_drop_handle_race.js rename to tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js index 731a369648..ef9bcbe072 100644 --- a/tests/testdata/run/worker_drop_handle_race.js +++ b/tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js @@ -7,6 +7,6 @@ // The exception thrown in the worker will not terminate the worker, but it will // propagate to the main thread and cause it to exit. new Worker( - import.meta.resolve("../workers/drop_handle_race.js"), + import.meta.resolve("./drop_handle_race.js"), { type: "module" }, ); diff --git a/tests/testdata/run/worker_drop_handle_race.js.out b/tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js.out similarity index 79% rename from tests/testdata/run/worker_drop_handle_race.js.out rename to tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js.out index 0820f164e5..a1c2e30ad4 100644 --- a/tests/testdata/run/worker_drop_handle_race.js.out +++ b/tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js.out @@ -1,7 +1,7 @@ error: Uncaught (in worker "") Error throw new Error(); ^ - at [WILDCARD]/workers/drop_handle_race.js:2:9 + at [WILDCARD]/drop_handle_race.js:2:9 at [WILDCARD] error: Uncaught (in promise) Error: Unhandled error in child worker. at Worker.#pollControl [WILDCARD] diff --git a/tests/specs/run/worker_drop_handle_race_terminate/__test__.jsonc b/tests/specs/run/worker_drop_handle_race_terminate/__test__.jsonc new file mode 100644 index 0000000000..e752074ebf --- /dev/null +++ b/tests/specs/run/worker_drop_handle_race_terminate/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run worker_drop_handle_race_terminate.js", + "output": "worker_drop_handle_race_terminate.js.out" +} diff --git a/tests/testdata/run/worker_drop_handle_race_terminate.js b/tests/specs/run/worker_drop_handle_race_terminate/worker_drop_handle_race_terminate.js similarity index 100% rename from tests/testdata/run/worker_drop_handle_race_terminate.js rename to tests/specs/run/worker_drop_handle_race_terminate/worker_drop_handle_race_terminate.js diff --git a/tests/testdata/run/worker_drop_handle_race_terminate.js.out b/tests/specs/run/worker_drop_handle_race_terminate/worker_drop_handle_race_terminate.js.out similarity index 100% rename from tests/testdata/run/worker_drop_handle_race_terminate.js.out rename to tests/specs/run/worker_drop_handle_race_terminate/worker_drop_handle_race_terminate.js.out diff --git a/tests/specs/run/worker_event_handler_test/__test__.jsonc b/tests/specs/run/worker_event_handler_test/__test__.jsonc new file mode 100644 index 0000000000..c07fca97c6 --- /dev/null +++ b/tests/specs/run/worker_event_handler_test/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read worker_event_handler_test.js", + "output": "worker_event_handler_test.js.out" +} diff --git a/tests/testdata/run/worker_event_handler_test.js b/tests/specs/run/worker_event_handler_test/worker_event_handler_test.js similarity index 51% rename from tests/testdata/run/worker_event_handler_test.js rename to tests/specs/run/worker_event_handler_test/worker_event_handler_test.js index a91b0ec0b1..91c5ba9469 100644 --- a/tests/testdata/run/worker_event_handler_test.js +++ b/tests/specs/run/worker_event_handler_test/worker_event_handler_test.js @@ -1,5 +1,5 @@ const w = new Worker( - import.meta.resolve("../workers/worker_event_handlers.js"), + import.meta.resolve("./worker_event_handlers.js"), { type: "module" }, ); w.postMessage({}); diff --git a/tests/testdata/run/worker_event_handler_test.js.out b/tests/specs/run/worker_event_handler_test/worker_event_handler_test.js.out similarity index 100% rename from tests/testdata/run/worker_event_handler_test.js.out rename to tests/specs/run/worker_event_handler_test/worker_event_handler_test.js.out diff --git a/tests/specs/run/worker_event_handler_test/worker_event_handlers.js b/tests/specs/run/worker_event_handler_test/worker_event_handlers.js new file mode 100644 index 0000000000..5e457cd2e3 --- /dev/null +++ b/tests/specs/run/worker_event_handler_test/worker_event_handlers.js @@ -0,0 +1,26 @@ +self.onmessage = (evt) => { + console.log("Target from self.onmessage:", String(evt.target)); +}; + +self.addEventListener("message", (evt) => { + console.log("Target from message event listener:", String(evt.target)); + + // Throw an error here so the global's error event will fire. + throw new Error("Some error message"); +}); + +self.onerror = (...args) => { + // Take the last 100 characters so the filename doesn't get truncated + // depending on the dev's FS structure. + args = args.map((v) => typeof v == "string" ? v.slice(-100) : v); + console.log("Arguments from self.onerror:", args); + return true; +}; + +self.addEventListener("error", (evt) => { + // Returning true from self.onerror means that subsequent event listeners + // should see the event as canceled. + console.log("Is event canceled?:", evt.defaultPrevented); + + self.close(); +}); diff --git a/tests/specs/run/worker_message_before_close/__test__.jsonc b/tests/specs/run/worker_message_before_close/__test__.jsonc new file mode 100644 index 0000000000..ae2d65b919 --- /dev/null +++ b/tests/specs/run/worker_message_before_close/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --allow-read worker_message_before_close.js", + "output": "worker_message_before_close.js.out" +} diff --git a/tests/specs/run/worker_message_before_close/message_before_close.js b/tests/specs/run/worker_message_before_close/message_before_close.js new file mode 100644 index 0000000000..9364b6d824 --- /dev/null +++ b/tests/specs/run/worker_message_before_close/message_before_close.js @@ -0,0 +1,4 @@ +onmessage = () => { + postMessage({}); + close(); +}; diff --git a/tests/testdata/run/worker_message_before_close.js b/tests/specs/run/worker_message_before_close/worker_message_before_close.js similarity index 89% rename from tests/testdata/run/worker_message_before_close.js rename to tests/specs/run/worker_message_before_close/worker_message_before_close.js index 569388b9bb..d613bd1cac 100644 --- a/tests/testdata/run/worker_message_before_close.js +++ b/tests/specs/run/worker_message_before_close/worker_message_before_close.js @@ -2,7 +2,7 @@ const messagesReceived = new Set(); for (let i = 0; i < 4; i++) { const worker = new Worker( - import.meta.resolve("../workers/message_before_close.js"), + import.meta.resolve("./message_before_close.js"), { type: "module", name: String(i) }, ); diff --git a/tests/testdata/run/worker_message_before_close.js.out b/tests/specs/run/worker_message_before_close/worker_message_before_close.js.out similarity index 100% rename from tests/testdata/run/worker_message_before_close.js.out rename to tests/specs/run/worker_message_before_close/worker_message_before_close.js.out diff --git a/tests/testdata/run/014_duplicate_import.ts b/tests/testdata/run/014_duplicate_import.ts deleted file mode 100644 index c7dd881cf0..0000000000 --- a/tests/testdata/run/014_duplicate_import.ts +++ /dev/null @@ -1,9 +0,0 @@ -// with all the imports of the same module, the module should only be -// instantiated once -import "../subdir/auto_print_hello.ts"; - -import "../subdir/auto_print_hello.ts"; - -(async () => { - await import("../subdir/auto_print_hello.ts"); -})(); diff --git a/tests/testdata/run/020_json_modules.ts b/tests/testdata/run/020_json_modules.ts deleted file mode 100644 index b4ae606654..0000000000 --- a/tests/testdata/run/020_json_modules.ts +++ /dev/null @@ -1,2 +0,0 @@ -import config from "../subdir/config.json"; -console.log(JSON.stringify(config)); diff --git a/tests/testdata/run/021_mjs_modules.ts b/tests/testdata/run/021_mjs_modules.ts deleted file mode 100644 index 838cd2c382..0000000000 --- a/tests/testdata/run/021_mjs_modules.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { isMod5 } from "../subdir/mod5.mjs"; -console.log(isMod5); diff --git a/tests/testdata/run/035_cached_only_flag.out b/tests/testdata/run/035_cached_only_flag.out deleted file mode 100644 index f677ec9153..0000000000 --- a/tests/testdata/run/035_cached_only_flag.out +++ /dev/null @@ -1 +0,0 @@ -error: Specifier not found in cache: "http://127.0.0.1:4545/run/019_media_types.ts", --cached-only is specified. diff --git a/tests/testdata/run/044_bad_resource.ts b/tests/testdata/run/044_bad_resource.ts deleted file mode 100644 index b956a3e3f2..0000000000 --- a/tests/testdata/run/044_bad_resource.ts +++ /dev/null @@ -1,3 +0,0 @@ -const file = await Deno.open("./run/044_bad_resource.ts", { read: true }); -file.close(); -await file.seek(10, 0); diff --git a/tests/testdata/run/config_json_import.ts b/tests/testdata/run/config_json_import.ts deleted file mode 100644 index 7141f14950..0000000000 --- a/tests/testdata/run/config_json_import.ts +++ /dev/null @@ -1,2 +0,0 @@ -import config from "../jsx/deno-jsx.json" with { type: "json" }; -console.log(config); diff --git a/tests/testdata/run/error_002.ts b/tests/testdata/run/error_002.ts deleted file mode 100644 index 5f8179bbeb..0000000000 --- a/tests/testdata/run/error_002.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { throwsError } from "../subdir/mod1.ts"; - -function foo() { - throwsError(); -} - -foo(); diff --git a/tests/testdata/run/error_015_dynamic_import_permissions.js b/tests/testdata/run/error_015_dynamic_import_permissions.js deleted file mode 100644 index bdf423b59c..0000000000 --- a/tests/testdata/run/error_015_dynamic_import_permissions.js +++ /dev/null @@ -1,3 +0,0 @@ -(async () => { - await import("" + "http://example.com/subdir/mod4.js"); -})(); diff --git a/tests/testdata/run/error_no_check.ts b/tests/testdata/run/error_no_check.ts deleted file mode 100644 index 2da01e639a..0000000000 --- a/tests/testdata/run/error_no_check.ts +++ /dev/null @@ -1 +0,0 @@ -export { AnInterface, isAnInterface } from "../subdir/type_and_code.ts"; diff --git a/tests/testdata/run/error_no_check.ts.out b/tests/testdata/run/error_no_check.ts.out deleted file mode 100644 index 78f478045d..0000000000 --- a/tests/testdata/run/error_no_check.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -error: Uncaught SyntaxError: The requested module '../subdir/type_and_code.ts' does not provide an export named 'AnInterface' -[WILDCARD] \ No newline at end of file diff --git a/tests/testdata/run/error_type_definitions.ts b/tests/testdata/run/error_type_definitions.ts deleted file mode 100644 index 86675cbaae..0000000000 --- a/tests/testdata/run/error_type_definitions.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @deno-types="../type_definitions/bar.d.ts" -import { Bar } from "../type_definitions/bar.js"; - -const bar = new Bar(); -console.log(bar); diff --git a/tests/testdata/run/fix_emittable_skipped.js b/tests/testdata/run/fix_emittable_skipped.js deleted file mode 100644 index a4ccc9efda..0000000000 --- a/tests/testdata/run/fix_emittable_skipped.js +++ /dev/null @@ -1,7 +0,0 @@ -/// - -import "../subdir/polyfill.ts"; - -export const a = "a"; - -console.log(globalThis.polyfill); diff --git a/tests/testdata/run/fix_js_import_js.ts b/tests/testdata/run/fix_js_import_js.ts deleted file mode 100644 index 0f01877cd8..0000000000 --- a/tests/testdata/run/fix_js_import_js.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { isMod4 } from "../subdir/mod6.js"; - -console.log(isMod4); diff --git a/tests/testdata/run/fix_js_imports.ts b/tests/testdata/run/fix_js_imports.ts deleted file mode 100644 index 6ed13bae30..0000000000 --- a/tests/testdata/run/fix_js_imports.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as amdLike from "../subdir/amd_like.js"; - -console.log(amdLike); diff --git a/tests/testdata/run/import_type.ts b/tests/testdata/run/import_type.ts deleted file mode 100644 index 22c639cbcf..0000000000 --- a/tests/testdata/run/import_type.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { type B, create } from "../subdir/export_types.ts"; - -const b: B = create(); - -console.log(b); diff --git a/tests/testdata/run/issue13562.ts b/tests/testdata/run/issue13562.ts deleted file mode 100644 index afbf69f99e..0000000000 --- a/tests/testdata/run/issue13562.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { printHello3 } from "../subdir/mod1.ts?q=.json"; - -printHello3(); diff --git a/tests/testdata/run/lock_check_ok.json b/tests/testdata/run/lock_check_ok.json deleted file mode 100644 index 94de0f6307..0000000000 --- a/tests/testdata/run/lock_check_ok.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "http://127.0.0.1:4545/subdir/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", - "http://127.0.0.1:4545/run/003_relative_import.ts": "a1572e8fd2c2712b33f04aed2561505b5feb2c8696f1f2cded3de7127931b97e" -} diff --git a/tests/testdata/run/lock_v2_check_ok.json b/tests/testdata/run/lock_v2_check_ok.json deleted file mode 100644 index 63bec862a7..0000000000 --- a/tests/testdata/run/lock_v2_check_ok.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": "2", - "remote": { - "http://127.0.0.1:4545/subdir/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", - "http://127.0.0.1:4545/run/003_relative_import.ts": "a1572e8fd2c2712b33f04aed2561505b5feb2c8696f1f2cded3de7127931b97e" - } -} diff --git a/tests/testdata/run/type_directives_02.ts b/tests/testdata/run/type_directives_02.ts deleted file mode 100644 index 0c59346e2b..0000000000 --- a/tests/testdata/run/type_directives_02.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as foo from "../subdir/type_reference.js"; - -console.log(foo.foo); diff --git a/tests/testdata/run/type_directives_02.ts.out b/tests/testdata/run/type_directives_02.ts.out deleted file mode 100644 index b064483b41..0000000000 --- a/tests/testdata/run/type_directives_02.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -[WILDCARD] -DEBUG TS - host.getSourceFile("file:///[WILDCARD]/subdir/type_reference.d.ts", Latest) -[WILDCARD] \ No newline at end of file diff --git a/tests/testdata/run/unhandled_rejection.ts.out b/tests/testdata/run/unhandled_rejection.ts.out deleted file mode 100644 index 6ab1667dc1..0000000000 --- a/tests/testdata/run/unhandled_rejection.ts.out +++ /dev/null @@ -1,9 +0,0 @@ -[WILDCARD] -unhandled rejection at: Promise { - Error: bar not available - at new Foo (file:///[WILDCARD]/testdata/run/unhandled_rejection.ts:8:20) - at file:///[WILDCARD]/testdata/run/unhandled_rejection.ts:12:1 -} reason: Error: bar not available - at new Foo (file:///[WILDCARD]/testdata/run/unhandled_rejection.ts:8:20) - at file:///[WILDCARD]/testdata/run/unhandled_rejection.ts:12:1 -unhandled rejection at: Promise { undefined } reason: undefined diff --git a/tests/testdata/run/unhandled_rejection_sync_error.ts.out b/tests/testdata/run/unhandled_rejection_sync_error.ts.out deleted file mode 100644 index e178373f03..0000000000 --- a/tests/testdata/run/unhandled_rejection_sync_error.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -[WILDCARD] -unhandled rejection at: Promise { - Error: boom! - at file:///[WILDCARD]testdata/run/unhandled_rejection_sync_error.ts:6:7 -} reason: Error: boom! - at file:///[WILDCARD]testdata/run/unhandled_rejection_sync_error.ts:6:7 diff --git a/tests/testdata/run/with_package_json/with_stop/main.out b/tests/testdata/run/with_package_json/with_stop/main.out deleted file mode 100644 index 44098a2d86..0000000000 --- a/tests/testdata/run/with_package_json/with_stop/main.out +++ /dev/null @@ -1,5 +0,0 @@ -[WILDCARD]Config file found at '[WILDCARD]with_package_json[WILDCARD]with_stop[WILDCARD]some[WILDCARD]nested[WILDCARD]deno.json' -[WILDCARD] -error: Relative import path "chalk" not prefixed with / or ./ or ../ - hint: If you want to use a JSR or npm package, try running `deno add jsr:chalk` or `deno add npm:chalk` - at file:///[WILDCARD]with_package_json/with_stop/some/nested/dir/main.ts:3:19 diff --git a/tools/lint.js b/tools/lint.js index b591cae0ba..cc595c2b13 100755 --- a/tools/lint.js +++ b/tools/lint.js @@ -219,7 +219,7 @@ async function ensureNoNewITests() { "pm_tests.rs": 0, "publish_tests.rs": 0, "repl_tests.rs": 0, - "run_tests.rs": 331, + "run_tests.rs": 24, "shared_library_tests.rs": 0, "task_tests.rs": 2, "test_tests.rs": 0, From 4861108592e4543c6245f8b477f083ec1b34f627 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 5 Nov 2024 13:10:23 +0530 Subject: [PATCH 035/227] fix: panic_hook hangs without procfs (#26732) Fixes https://github.com/denoland/deno/issues/26701 Ref https://github.com/denoland/sui/commit/69e491353fb82ce15a861376ee8dc68f183e0486 --- Cargo.lock | 4 ++-- cli/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 73d417baae..29fe91641d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4195,9 +4195,9 @@ dependencies = [ [[package]] name = "libsui" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "205eca4e7beaad637dcd38fe41292065894ee7f498077cf3c135d5f7252b9f27" +checksum = "89795977654ad6250d6c0915411b622bac22f9efb4f852af94b2e00964cab832" dependencies = [ "editpe", "libc", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 1fa9692a4d..a91482c3e1 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -84,7 +84,7 @@ deno_runtime = { workspace = true, features = ["include_js_files_for_snapshottin deno_semver.workspace = true deno_task_shell = "=0.18.1" deno_terminal.workspace = true -libsui = "0.4.0" +libsui = "0.5.0" node_resolver.workspace = true anstream = "0.6.14" From 770ef1460085e1a1b706cc7f066e7b3ea5010eb0 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 5 Nov 2024 13:10:45 +0530 Subject: [PATCH 036/227] chore: upgrade publish workflow to ubuntu 24 (#26731) --- .github/workflows/cargo_publish.yml | 2 +- .github/workflows/post_publish.yml | 2 +- .github/workflows/start_release.yml | 2 +- .github/workflows/version_bump.yml | 2 +- .github/workflows/wpt_epoch.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cargo_publish.yml b/.github/workflows/cargo_publish.yml index f285b78919..3af97f4662 100644 --- a/.github/workflows/cargo_publish.yml +++ b/.github/workflows/cargo_publish.yml @@ -10,7 +10,7 @@ concurrency: jobs: build: name: cargo publish - runs-on: ubuntu-20.04-xl + runs-on: ubuntu-24.04-xl timeout-minutes: 90 env: diff --git a/.github/workflows/post_publish.yml b/.github/workflows/post_publish.yml index c0db0906df..dd80b3637a 100644 --- a/.github/workflows/post_publish.yml +++ b/.github/workflows/post_publish.yml @@ -7,7 +7,7 @@ on: jobs: update-dl-version: name: update dl.deno.land version - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 if: github.repository == 'denoland/deno' steps: - name: Authenticate with Google Cloud diff --git a/.github/workflows/start_release.yml b/.github/workflows/start_release.yml index 7c2f149e11..40a44bb61a 100644 --- a/.github/workflows/start_release.yml +++ b/.github/workflows/start_release.yml @@ -16,7 +16,7 @@ on: jobs: build: name: start release - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 timeout-minutes: 30 env: diff --git a/.github/workflows/version_bump.yml b/.github/workflows/version_bump.yml index fd082bca3e..9038fe0d22 100644 --- a/.github/workflows/version_bump.yml +++ b/.github/workflows/version_bump.yml @@ -16,7 +16,7 @@ on: jobs: build: name: version bump - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 timeout-minutes: 90 env: diff --git a/.github/workflows/wpt_epoch.yml b/.github/workflows/wpt_epoch.yml index d679498b83..1d86ed5557 100644 --- a/.github/workflows/wpt_epoch.yml +++ b/.github/workflows/wpt_epoch.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: deno-version: [v1.x, canary] - os: [ubuntu-22.04-xl] + os: [ubuntu-24.04-xl] steps: - name: Clone repository From ef7432c03f83ad9e9ca2812d0ab5653e87fa5259 Mon Sep 17 00:00:00 2001 From: denobot <33910674+denobot@users.noreply.github.com> Date: Tue, 5 Nov 2024 20:27:14 -0500 Subject: [PATCH 037/227] chore: forward v2.0.5 release commit to main (#26755) This is the release commit being forwarded back to main for 2.0.5 Co-authored-by: bartlomieju --- .github/workflows/ci.generate.ts | 2 +- .github/workflows/ci.yml | 8 ++--- Cargo.lock | 58 ++++++++++++++++---------------- Cargo.toml | 56 +++++++++++++++--------------- Releases.md | 36 ++++++++++++++++++++ bench_util/Cargo.toml | 2 +- cli/Cargo.toml | 2 +- ext/broadcast_channel/Cargo.toml | 2 +- ext/cache/Cargo.toml | 2 +- ext/canvas/Cargo.toml | 2 +- ext/console/Cargo.toml | 2 +- ext/cron/Cargo.toml | 2 +- ext/crypto/Cargo.toml | 2 +- ext/fetch/Cargo.toml | 2 +- ext/ffi/Cargo.toml | 2 +- ext/fs/Cargo.toml | 2 +- ext/http/Cargo.toml | 2 +- ext/io/Cargo.toml | 2 +- ext/kv/Cargo.toml | 2 +- ext/napi/Cargo.toml | 2 +- ext/napi/sym/Cargo.toml | 2 +- ext/net/Cargo.toml | 2 +- ext/node/Cargo.toml | 2 +- ext/tls/Cargo.toml | 2 +- ext/url/Cargo.toml | 2 +- ext/web/Cargo.toml | 2 +- ext/webgpu/Cargo.toml | 2 +- ext/webidl/Cargo.toml | 2 +- ext/websocket/Cargo.toml | 2 +- ext/webstorage/Cargo.toml | 2 +- resolvers/deno/Cargo.toml | 2 +- resolvers/node/Cargo.toml | 2 +- runtime/Cargo.toml | 2 +- runtime/permissions/Cargo.toml | 2 +- 34 files changed, 127 insertions(+), 91 deletions(-) diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts index 0faf08a1a8..430387d5ba 100755 --- a/.github/workflows/ci.generate.ts +++ b/.github/workflows/ci.generate.ts @@ -5,7 +5,7 @@ import { stringify } from "jsr:@std/yaml@^0.221/stringify"; // Bump this number when you want to purge the cache. // Note: the tools/release/01_bump_crate_versions.ts script will update this version // automatically via regex, so ensure that this line maintains this format. -const cacheVersion = 23; +const cacheVersion = 24; const ubuntuX86Runner = "ubuntu-24.04"; const ubuntuX86XlRunner = "ubuntu-24.04-xl"; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5aafe89d27..7b621e1235 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -361,8 +361,8 @@ jobs: path: |- ~/.cargo/registry/index ~/.cargo/registry/cache - key: '23-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}' - restore-keys: '23-cargo-home-${{ matrix.os }}-${{ matrix.arch }}' + key: '24-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}' + restore-keys: '24-cargo-home-${{ matrix.os }}-${{ matrix.arch }}' if: '!(matrix.skip)' - name: Restore cache build output (PR) uses: actions/cache/restore@v4 @@ -375,7 +375,7 @@ jobs: !./target/*/*.zip !./target/*/*.tar.gz key: never_saved - restore-keys: '23-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-' + restore-keys: '24-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-' - name: Apply and update mtime cache if: '!(matrix.skip) && (!startsWith(github.ref, ''refs/tags/''))' uses: ./.github/mtime_cache @@ -685,7 +685,7 @@ jobs: !./target/*/*.zip !./target/*/*.sha256sum !./target/*/*.tar.gz - key: '23-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}' + key: '24-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}' publish-canary: name: publish canary runs-on: ubuntu-24.04 diff --git a/Cargo.lock b/Cargo.lock index 29fe91641d..2ae13eab0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1154,7 +1154,7 @@ dependencies = [ [[package]] name = "deno" -version = "2.0.4" +version = "2.0.5" dependencies = [ "anstream", "async-trait", @@ -1323,7 +1323,7 @@ dependencies = [ [[package]] name = "deno_bench_util" -version = "0.169.0" +version = "0.170.0" dependencies = [ "bencher", "deno_core", @@ -1332,7 +1332,7 @@ dependencies = [ [[package]] name = "deno_broadcast_channel" -version = "0.169.0" +version = "0.170.0" dependencies = [ "async-trait", "deno_core", @@ -1343,7 +1343,7 @@ dependencies = [ [[package]] name = "deno_cache" -version = "0.107.0" +version = "0.108.0" dependencies = [ "async-trait", "deno_core", @@ -1376,7 +1376,7 @@ dependencies = [ [[package]] name = "deno_canvas" -version = "0.44.0" +version = "0.45.0" dependencies = [ "deno_core", "deno_webgpu", @@ -1411,7 +1411,7 @@ dependencies = [ [[package]] name = "deno_console" -version = "0.175.0" +version = "0.176.0" dependencies = [ "deno_core", ] @@ -1456,7 +1456,7 @@ checksum = "a13951ea98c0a4c372f162d669193b4c9d991512de9f2381dd161027f34b26b1" [[package]] name = "deno_cron" -version = "0.55.0" +version = "0.56.0" dependencies = [ "anyhow", "async-trait", @@ -1469,7 +1469,7 @@ dependencies = [ [[package]] name = "deno_crypto" -version = "0.189.0" +version = "0.190.0" dependencies = [ "aes", "aes-gcm", @@ -1531,7 +1531,7 @@ dependencies = [ [[package]] name = "deno_fetch" -version = "0.199.0" +version = "0.200.0" dependencies = [ "base64 0.21.7", "bytes", @@ -1564,7 +1564,7 @@ dependencies = [ [[package]] name = "deno_ffi" -version = "0.162.0" +version = "0.163.0" dependencies = [ "deno_core", "deno_permissions", @@ -1584,7 +1584,7 @@ dependencies = [ [[package]] name = "deno_fs" -version = "0.85.0" +version = "0.86.0" dependencies = [ "async-trait", "base32", @@ -1635,7 +1635,7 @@ dependencies = [ [[package]] name = "deno_http" -version = "0.173.0" +version = "0.174.0" dependencies = [ "async-compression", "async-trait", @@ -1674,7 +1674,7 @@ dependencies = [ [[package]] name = "deno_io" -version = "0.85.0" +version = "0.86.0" dependencies = [ "async-trait", "deno_core", @@ -1695,7 +1695,7 @@ dependencies = [ [[package]] name = "deno_kv" -version = "0.83.0" +version = "0.84.0" dependencies = [ "anyhow", "async-trait", @@ -1767,7 +1767,7 @@ dependencies = [ [[package]] name = "deno_napi" -version = "0.106.0" +version = "0.107.0" dependencies = [ "deno_core", "deno_permissions", @@ -1795,7 +1795,7 @@ dependencies = [ [[package]] name = "deno_net" -version = "0.167.0" +version = "0.168.0" dependencies = [ "deno_core", "deno_permissions", @@ -1812,7 +1812,7 @@ dependencies = [ [[package]] name = "deno_node" -version = "0.112.0" +version = "0.113.0" dependencies = [ "aead-gcm-stream", "aes", @@ -1961,7 +1961,7 @@ dependencies = [ [[package]] name = "deno_permissions" -version = "0.35.0" +version = "0.36.0" dependencies = [ "deno_core", "deno_path_util", @@ -1979,7 +1979,7 @@ dependencies = [ [[package]] name = "deno_resolver" -version = "0.7.0" +version = "0.8.0" dependencies = [ "anyhow", "base32", @@ -1995,7 +1995,7 @@ dependencies = [ [[package]] name = "deno_runtime" -version = "0.184.0" +version = "0.185.0" dependencies = [ "color-print", "deno_ast", @@ -2113,7 +2113,7 @@ dependencies = [ [[package]] name = "deno_tls" -version = "0.162.0" +version = "0.163.0" dependencies = [ "deno_core", "deno_native_certs", @@ -2162,7 +2162,7 @@ dependencies = [ [[package]] name = "deno_url" -version = "0.175.0" +version = "0.176.0" dependencies = [ "deno_bench_util", "deno_console", @@ -2174,7 +2174,7 @@ dependencies = [ [[package]] name = "deno_web" -version = "0.206.0" +version = "0.207.0" dependencies = [ "async-trait", "base64-simd 0.8.0", @@ -2196,7 +2196,7 @@ dependencies = [ [[package]] name = "deno_webgpu" -version = "0.142.0" +version = "0.143.0" dependencies = [ "deno_core", "raw-window-handle", @@ -2209,7 +2209,7 @@ dependencies = [ [[package]] name = "deno_webidl" -version = "0.175.0" +version = "0.176.0" dependencies = [ "deno_bench_util", "deno_core", @@ -2217,7 +2217,7 @@ dependencies = [ [[package]] name = "deno_websocket" -version = "0.180.0" +version = "0.181.0" dependencies = [ "bytes", "deno_core", @@ -2239,7 +2239,7 @@ dependencies = [ [[package]] name = "deno_webstorage" -version = "0.170.0" +version = "0.171.0" dependencies = [ "deno_core", "deno_web", @@ -4484,7 +4484,7 @@ dependencies = [ [[package]] name = "napi_sym" -version = "0.105.0" +version = "0.106.0" dependencies = [ "quote", "serde", @@ -4539,7 +4539,7 @@ dependencies = [ [[package]] name = "node_resolver" -version = "0.14.0" +version = "0.15.0" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 28ef2829e0..13140b65dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,16 +48,16 @@ repository = "https://github.com/denoland/deno" deno_ast = { version = "=0.43.3", features = ["transpiling"] } deno_core = { version = "0.318.0" } -deno_bench_util = { version = "0.169.0", path = "./bench_util" } +deno_bench_util = { version = "0.170.0", path = "./bench_util" } deno_lockfile = "=0.23.1" deno_media_type = { version = "0.2.0", features = ["module_specifier"] } deno_npm = "=0.25.4" deno_path_util = "=0.2.1" -deno_permissions = { version = "0.35.0", path = "./runtime/permissions" } -deno_runtime = { version = "0.184.0", path = "./runtime" } +deno_permissions = { version = "0.36.0", path = "./runtime/permissions" } +deno_runtime = { version = "0.185.0", path = "./runtime" } deno_semver = "=0.5.16" deno_terminal = "0.2.0" -napi_sym = { version = "0.105.0", path = "./ext/napi/sym" } +napi_sym = { version = "0.106.0", path = "./ext/napi/sym" } test_util = { package = "test_server", path = "./tests/util/server" } denokv_proto = "0.8.1" @@ -66,32 +66,32 @@ denokv_remote = "0.8.1" denokv_sqlite = { default-features = false, version = "0.8.2" } # exts -deno_broadcast_channel = { version = "0.169.0", path = "./ext/broadcast_channel" } -deno_cache = { version = "0.107.0", path = "./ext/cache" } -deno_canvas = { version = "0.44.0", path = "./ext/canvas" } -deno_console = { version = "0.175.0", path = "./ext/console" } -deno_cron = { version = "0.55.0", path = "./ext/cron" } -deno_crypto = { version = "0.189.0", path = "./ext/crypto" } -deno_fetch = { version = "0.199.0", path = "./ext/fetch" } -deno_ffi = { version = "0.162.0", path = "./ext/ffi" } -deno_fs = { version = "0.85.0", path = "./ext/fs" } -deno_http = { version = "0.173.0", path = "./ext/http" } -deno_io = { version = "0.85.0", path = "./ext/io" } -deno_kv = { version = "0.83.0", path = "./ext/kv" } -deno_napi = { version = "0.106.0", path = "./ext/napi" } -deno_net = { version = "0.167.0", path = "./ext/net" } -deno_node = { version = "0.112.0", path = "./ext/node" } -deno_tls = { version = "0.162.0", path = "./ext/tls" } -deno_url = { version = "0.175.0", path = "./ext/url" } -deno_web = { version = "0.206.0", path = "./ext/web" } -deno_webgpu = { version = "0.142.0", path = "./ext/webgpu" } -deno_webidl = { version = "0.175.0", path = "./ext/webidl" } -deno_websocket = { version = "0.180.0", path = "./ext/websocket" } -deno_webstorage = { version = "0.170.0", path = "./ext/webstorage" } +deno_broadcast_channel = { version = "0.170.0", path = "./ext/broadcast_channel" } +deno_cache = { version = "0.108.0", path = "./ext/cache" } +deno_canvas = { version = "0.45.0", path = "./ext/canvas" } +deno_console = { version = "0.176.0", path = "./ext/console" } +deno_cron = { version = "0.56.0", path = "./ext/cron" } +deno_crypto = { version = "0.190.0", path = "./ext/crypto" } +deno_fetch = { version = "0.200.0", path = "./ext/fetch" } +deno_ffi = { version = "0.163.0", path = "./ext/ffi" } +deno_fs = { version = "0.86.0", path = "./ext/fs" } +deno_http = { version = "0.174.0", path = "./ext/http" } +deno_io = { version = "0.86.0", path = "./ext/io" } +deno_kv = { version = "0.84.0", path = "./ext/kv" } +deno_napi = { version = "0.107.0", path = "./ext/napi" } +deno_net = { version = "0.168.0", path = "./ext/net" } +deno_node = { version = "0.113.0", path = "./ext/node" } +deno_tls = { version = "0.163.0", path = "./ext/tls" } +deno_url = { version = "0.176.0", path = "./ext/url" } +deno_web = { version = "0.207.0", path = "./ext/web" } +deno_webgpu = { version = "0.143.0", path = "./ext/webgpu" } +deno_webidl = { version = "0.176.0", path = "./ext/webidl" } +deno_websocket = { version = "0.181.0", path = "./ext/websocket" } +deno_webstorage = { version = "0.171.0", path = "./ext/webstorage" } # resolvers -deno_resolver = { version = "0.7.0", path = "./resolvers/deno" } -node_resolver = { version = "0.14.0", path = "./resolvers/node" } +deno_resolver = { version = "0.8.0", path = "./resolvers/deno" } +node_resolver = { version = "0.15.0", path = "./resolvers/node" } aes = "=0.8.3" anyhow = "1.0.57" diff --git a/Releases.md b/Releases.md index a183e01ecd..8010379309 100644 --- a/Releases.md +++ b/Releases.md @@ -6,6 +6,42 @@ https://github.com/denoland/deno/releases We also have one-line install commands at: https://github.com/denoland/deno_install +### 2.0.5 / 2024.11.05 + +- fix(add): better error message when adding package that only has pre-release + versions (#26724) +- fix(add): only add npm deps to package.json if it's at least as close as + deno.json (#26683) +- fix(cli): set `npm_config_user_agent` when running npm packages or tasks + (#26639) +- fix(coverage): exclude comment lines from coverage reports (#25939) +- fix(ext/node): add `findSourceMap` to the default export of `node:module` + (#26720) +- fix(ext/node): convert errors from `fs.readFile/fs.readFileSync` to node + format (#26632) +- fix(ext/node): resolve exports even if parent module filename isn't present + (#26553) +- fix(ext/node): return `this` from `http.Server.ref/unref()` (#26647) +- fix(fmt): do not panic for jsx ignore container followed by jsx text (#26723) +- fix(fmt): fix several HTML and components issues (#26654) +- fix(fmt): ignore file directive for YAML files (#26717) +- fix(install): handle invalid function error, and fallback to junctions + regardless of the error (#26730) +- fix(lsp): include unstable features from editor settings (#26655) +- fix(lsp): scope attribution for lazily loaded assets (#26699) +- fix(node): Implement `os.userInfo` properly, add missing `toPrimitive` + (#24702) +- fix(serve): support serve hmr (#26078) +- fix(types): missing `import` permission on `PermissionOptionsObject` (#26627) +- fix(workspace): support wildcard packages (#26568) +- fix: clamp smi in fast calls by default (#26506) +- fix: improved support for cjs and cts modules (#26558) +- fix: op_run_microtasks crash (#26718) +- fix: panic_hook hangs without procfs (#26732) +- fix: remove permission check in op_require_node_module_paths (#26645) +- fix: surface package.json location on dep parse failure (#26665) +- perf(lsp): don't walk coverage directory (#26715) + ### 2.0.4 / 2024.10.29 - Revert "fix(ext/node): fix dns.lookup result ordering (#26264)" (#26621) diff --git a/bench_util/Cargo.toml b/bench_util/Cargo.toml index 31c27b9a9d..ff48442b3b 100644 --- a/bench_util/Cargo.toml +++ b/bench_util/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_bench_util" -version = "0.169.0" +version = "0.170.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/cli/Cargo.toml b/cli/Cargo.toml index a91482c3e1..32229d816f 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno" -version = "2.0.4" +version = "2.0.5" authors.workspace = true default-run = "deno" edition.workspace = true diff --git a/ext/broadcast_channel/Cargo.toml b/ext/broadcast_channel/Cargo.toml index e6eeeed5ec..0951286f71 100644 --- a/ext/broadcast_channel/Cargo.toml +++ b/ext/broadcast_channel/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_broadcast_channel" -version = "0.169.0" +version = "0.170.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/cache/Cargo.toml b/ext/cache/Cargo.toml index 7cae8d88a2..20dc9ca48c 100644 --- a/ext/cache/Cargo.toml +++ b/ext/cache/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_cache" -version = "0.107.0" +version = "0.108.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/canvas/Cargo.toml b/ext/canvas/Cargo.toml index 5d2c371999..5c6e44f95c 100644 --- a/ext/canvas/Cargo.toml +++ b/ext/canvas/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_canvas" -version = "0.44.0" +version = "0.45.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/console/Cargo.toml b/ext/console/Cargo.toml index b3543ed85f..bf476574ee 100644 --- a/ext/console/Cargo.toml +++ b/ext/console/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_console" -version = "0.175.0" +version = "0.176.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/cron/Cargo.toml b/ext/cron/Cargo.toml index 0d52cb6a97..90b39aa0e2 100644 --- a/ext/cron/Cargo.toml +++ b/ext/cron/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_cron" -version = "0.55.0" +version = "0.56.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/crypto/Cargo.toml b/ext/crypto/Cargo.toml index 95981bba3b..890cd868ae 100644 --- a/ext/crypto/Cargo.toml +++ b/ext/crypto/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_crypto" -version = "0.189.0" +version = "0.190.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/fetch/Cargo.toml b/ext/fetch/Cargo.toml index 93fc88ae64..0b15d05b8f 100644 --- a/ext/fetch/Cargo.toml +++ b/ext/fetch/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_fetch" -version = "0.199.0" +version = "0.200.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/ffi/Cargo.toml b/ext/ffi/Cargo.toml index 58144790bf..27ecd1d546 100644 --- a/ext/ffi/Cargo.toml +++ b/ext/ffi/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_ffi" -version = "0.162.0" +version = "0.163.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/fs/Cargo.toml b/ext/fs/Cargo.toml index 0ccde7f7e2..d1720b7bc7 100644 --- a/ext/fs/Cargo.toml +++ b/ext/fs/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_fs" -version = "0.85.0" +version = "0.86.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/http/Cargo.toml b/ext/http/Cargo.toml index a1a4cb20be..1d7c4d87ed 100644 --- a/ext/http/Cargo.toml +++ b/ext/http/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_http" -version = "0.173.0" +version = "0.174.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/io/Cargo.toml b/ext/io/Cargo.toml index 7e858d298c..b791f16a3f 100644 --- a/ext/io/Cargo.toml +++ b/ext/io/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_io" -version = "0.85.0" +version = "0.86.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/kv/Cargo.toml b/ext/kv/Cargo.toml index bbd2349011..59b425d3cb 100644 --- a/ext/kv/Cargo.toml +++ b/ext/kv/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_kv" -version = "0.83.0" +version = "0.84.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/napi/Cargo.toml b/ext/napi/Cargo.toml index c31367118e..064d335689 100644 --- a/ext/napi/Cargo.toml +++ b/ext/napi/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_napi" -version = "0.106.0" +version = "0.107.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/napi/sym/Cargo.toml b/ext/napi/sym/Cargo.toml index c23054eb40..bf48d2742c 100644 --- a/ext/napi/sym/Cargo.toml +++ b/ext/napi/sym/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "napi_sym" -version = "0.105.0" +version = "0.106.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/net/Cargo.toml b/ext/net/Cargo.toml index 5ffd1b4504..b22fbe7b57 100644 --- a/ext/net/Cargo.toml +++ b/ext/net/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_net" -version = "0.167.0" +version = "0.168.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/node/Cargo.toml b/ext/node/Cargo.toml index ed31dbf17e..d830be5759 100644 --- a/ext/node/Cargo.toml +++ b/ext/node/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_node" -version = "0.112.0" +version = "0.113.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/tls/Cargo.toml b/ext/tls/Cargo.toml index 6871faa5b8..89a78f4b62 100644 --- a/ext/tls/Cargo.toml +++ b/ext/tls/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_tls" -version = "0.162.0" +version = "0.163.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/url/Cargo.toml b/ext/url/Cargo.toml index 24d81abf83..7f3fa97613 100644 --- a/ext/url/Cargo.toml +++ b/ext/url/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_url" -version = "0.175.0" +version = "0.176.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/web/Cargo.toml b/ext/web/Cargo.toml index a02cff98fc..faba8e9fb2 100644 --- a/ext/web/Cargo.toml +++ b/ext/web/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_web" -version = "0.206.0" +version = "0.207.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/webgpu/Cargo.toml b/ext/webgpu/Cargo.toml index 3bb814c25c..c682965d5e 100644 --- a/ext/webgpu/Cargo.toml +++ b/ext/webgpu/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webgpu" -version = "0.142.0" +version = "0.143.0" authors = ["the Deno authors"] edition.workspace = true license = "MIT" diff --git a/ext/webidl/Cargo.toml b/ext/webidl/Cargo.toml index 1685bb1fd0..1e8dd77cf0 100644 --- a/ext/webidl/Cargo.toml +++ b/ext/webidl/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webidl" -version = "0.175.0" +version = "0.176.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/websocket/Cargo.toml b/ext/websocket/Cargo.toml index 6a575cb416..6724cea2c1 100644 --- a/ext/websocket/Cargo.toml +++ b/ext/websocket/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_websocket" -version = "0.180.0" +version = "0.181.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/webstorage/Cargo.toml b/ext/webstorage/Cargo.toml index 079ab2e4ee..c1d2092f13 100644 --- a/ext/webstorage/Cargo.toml +++ b/ext/webstorage/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webstorage" -version = "0.170.0" +version = "0.171.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/resolvers/deno/Cargo.toml b/resolvers/deno/Cargo.toml index d8569d7219..060b3e7895 100644 --- a/resolvers/deno/Cargo.toml +++ b/resolvers/deno/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_resolver" -version = "0.7.0" +version = "0.8.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/resolvers/node/Cargo.toml b/resolvers/node/Cargo.toml index 95f7eabad8..6cbfc717d5 100644 --- a/resolvers/node/Cargo.toml +++ b/resolvers/node/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "node_resolver" -version = "0.14.0" +version = "0.15.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index c4c0c8ff9b..a509c711ee 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_runtime" -version = "0.184.0" +version = "0.185.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/runtime/permissions/Cargo.toml b/runtime/permissions/Cargo.toml index f0b2e71b55..5fcc8a3e13 100644 --- a/runtime/permissions/Cargo.toml +++ b/runtime/permissions/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_permissions" -version = "0.35.0" +version = "0.36.0" authors.workspace = true edition.workspace = true license.workspace = true From 5088b25f2315fa45e912377356a89ba2a44dbcda Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Wed, 6 Nov 2024 06:26:46 +0000 Subject: [PATCH 038/227] feat(lsp): auto-import completions from byonm dependencies (#26680) --- cli/lsp/analysis.rs | 76 +++++++++----- cli/lsp/documents.rs | 28 ----- cli/lsp/language_server.rs | 13 ++- cli/lsp/resolver.rs | 45 ++++++++ cli/lsp/tsc.rs | 102 ++++++++++++------ tests/integration/lsp_tests.rs | 185 +++++++++++++++++++++++++++++---- 6 files changed, 344 insertions(+), 105 deletions(-) diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs index 0769c90477..98215855c9 100644 --- a/cli/lsp/analysis.rs +++ b/cli/lsp/analysis.rs @@ -12,7 +12,9 @@ use super::urls::url_to_uri; use crate::args::jsr_url; use crate::lsp::search::PackageSearchApi; use crate::tools::lint::CliLinter; +use crate::util::path::relative_specifier; use deno_config::workspace::MappedResolution; +use deno_graph::source::ResolutionMode; use deno_lint::diagnostic::LintDiagnosticRange; use deno_ast::SourceRange; @@ -228,6 +230,7 @@ pub struct TsResponseImportMapper<'a> { documents: &'a Documents, maybe_import_map: Option<&'a ImportMap>, resolver: &'a LspResolver, + tsc_specifier_map: &'a tsc::TscSpecifierMap, file_referrer: ModuleSpecifier, } @@ -236,12 +239,14 @@ impl<'a> TsResponseImportMapper<'a> { documents: &'a Documents, maybe_import_map: Option<&'a ImportMap>, resolver: &'a LspResolver, + tsc_specifier_map: &'a tsc::TscSpecifierMap, file_referrer: &ModuleSpecifier, ) -> Self { Self { documents, maybe_import_map, resolver, + tsc_specifier_map, file_referrer: file_referrer.clone(), } } @@ -387,6 +392,11 @@ impl<'a> TsResponseImportMapper<'a> { } } } + } else if let Some(dep_name) = self + .resolver + .file_url_to_package_json_dep(specifier, Some(&self.file_referrer)) + { + return Some(dep_name); } // check if the import map has this specifier @@ -457,19 +467,36 @@ impl<'a> TsResponseImportMapper<'a> { specifier: &str, referrer: &ModuleSpecifier, ) -> Option { - if let Ok(specifier) = referrer.join(specifier) { - if let Some(specifier) = self.check_specifier(&specifier, referrer) { - return Some(specifier); - } - } - let specifier = specifier.strip_suffix(".js").unwrap_or(specifier); - for ext in SUPPORTED_EXTENSIONS { - let specifier_with_ext = format!("{specifier}{ext}"); - if self - .documents - .contains_import(&specifier_with_ext, referrer) + let specifier_stem = specifier.strip_suffix(".js").unwrap_or(specifier); + let specifiers = std::iter::once(Cow::Borrowed(specifier)).chain( + SUPPORTED_EXTENSIONS + .iter() + .map(|ext| Cow::Owned(format!("{specifier_stem}{ext}"))), + ); + for specifier in specifiers { + if let Some(specifier) = self + .resolver + .as_graph_resolver(Some(&self.file_referrer)) + .resolve( + &specifier, + &deno_graph::Range { + specifier: referrer.clone(), + start: deno_graph::Position::zeroed(), + end: deno_graph::Position::zeroed(), + }, + ResolutionMode::Types, + ) + .ok() + .and_then(|s| self.tsc_specifier_map.normalize(s.as_str()).ok()) + .filter(|s| self.documents.exists(s, Some(&self.file_referrer))) { - return Some(specifier_with_ext); + if let Some(specifier) = self + .check_specifier(&specifier, referrer) + .or_else(|| relative_specifier(referrer, &specifier)) + .filter(|s| !s.contains("/node_modules/")) + { + return Some(specifier); + } } } None @@ -559,8 +586,9 @@ fn try_reverse_map_package_json_exports( pub fn fix_ts_import_changes( referrer: &ModuleSpecifier, changes: &[tsc::FileTextChanges], - import_mapper: &TsResponseImportMapper, + language_server: &language_server::Inner, ) -> Result, AnyError> { + let import_mapper = language_server.get_ts_response_import_mapper(referrer); let mut r = Vec::new(); for change in changes { let mut text_changes = Vec::new(); @@ -605,7 +633,7 @@ pub fn fix_ts_import_changes( fn fix_ts_import_action<'a>( referrer: &ModuleSpecifier, action: &'a tsc::CodeFixAction, - import_mapper: &TsResponseImportMapper, + language_server: &language_server::Inner, ) -> Option> { if !matches!( action.fix_name.as_str(), @@ -621,6 +649,7 @@ fn fix_ts_import_action<'a>( let Some(specifier) = specifier else { return Some(Cow::Borrowed(action)); }; + let import_mapper = language_server.get_ts_response_import_mapper(referrer); if let Some(new_specifier) = import_mapper.check_unresolved_specifier(specifier, referrer) { @@ -728,7 +757,7 @@ pub fn ts_changes_to_edit( })) } -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodeActionData { pub specifier: ModuleSpecifier, @@ -998,11 +1027,8 @@ impl CodeActionCollection { "The action returned from TypeScript is unsupported.", )); } - let Some(action) = fix_ts_import_action( - specifier, - action, - &language_server.get_ts_response_import_mapper(specifier), - ) else { + let Some(action) = fix_ts_import_action(specifier, action, language_server) + else { return Ok(()); }; let edit = ts_changes_to_edit(&action.changes, language_server)?; @@ -1051,10 +1077,12 @@ impl CodeActionCollection { specifier: &ModuleSpecifier, diagnostic: &lsp::Diagnostic, ) { - let data = Some(json!({ - "specifier": specifier, - "fixId": action.fix_id, - })); + let data = action.fix_id.as_ref().map(|fix_id| { + json!(CodeActionData { + specifier: specifier.clone(), + fix_id: fix_id.clone(), + }) + }); let title = if let Some(description) = &action.fix_all_description { description.clone() } else { diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs index 8609aed05e..ce13c32157 100644 --- a/cli/lsp/documents.rs +++ b/cli/lsp/documents.rs @@ -1059,34 +1059,6 @@ impl Documents { self.cache.is_valid_file_referrer(specifier) } - /// Return `true` if the provided specifier can be resolved to a document, - /// otherwise `false`. - pub fn contains_import( - &self, - specifier: &str, - referrer: &ModuleSpecifier, - ) -> bool { - let file_referrer = self.get_file_referrer(referrer); - let maybe_specifier = self - .resolver - .as_graph_resolver(file_referrer.as_deref()) - .resolve( - specifier, - &deno_graph::Range { - specifier: referrer.clone(), - start: deno_graph::Position::zeroed(), - end: deno_graph::Position::zeroed(), - }, - ResolutionMode::Types, - ) - .ok(); - if let Some(import_specifier) = maybe_specifier { - self.exists(&import_specifier, file_referrer.as_deref()) - } else { - false - } - } - pub fn resolve_document_specifier( &self, specifier: &ModuleSpecifier, diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 61a02f036e..2554fa34b1 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -1837,7 +1837,7 @@ impl Inner { fix_ts_import_changes( &code_action_data.specifier, &combined_code_actions.changes, - &self.get_ts_response_import_mapper(&code_action_data.specifier), + self, ) .map_err(|err| { error!("Unable to remap changes: {:#}", err); @@ -1890,7 +1890,7 @@ impl Inner { refactor_edit_info.edits = fix_ts_import_changes( &action_data.specifier, &refactor_edit_info.edits, - &self.get_ts_response_import_mapper(&action_data.specifier), + self, ) .map_err(|err| { error!("Unable to remap changes: {:#}", err); @@ -1921,7 +1921,8 @@ impl Inner { // todo(dsherret): this should probably just take the resolver itself // as the import map is an implementation detail .and_then(|d| d.resolver.maybe_import_map()), - self.resolver.as_ref(), + &self.resolver, + &self.ts_server.specifier_map, file_referrer, ) } @@ -2284,7 +2285,11 @@ impl Inner { .into(), scope.cloned(), ) - .await; + .await + .unwrap_or_else(|err| { + error!("Unable to get completion info from TypeScript: {:#}", err); + None + }); if let Some(completions) = maybe_completion_info { response = Some( diff --git a/cli/lsp/resolver.rs b/cli/lsp/resolver.rs index 9ce76005e5..f5df24d575 100644 --- a/cli/lsp/resolver.rs +++ b/cli/lsp/resolver.rs @@ -74,6 +74,7 @@ struct LspScopeResolver { pkg_json_resolver: Option>, redirect_resolver: Option>, graph_imports: Arc>, + package_json_deps_by_resolution: Arc>, config_data: Option>, } @@ -88,6 +89,7 @@ impl Default for LspScopeResolver { pkg_json_resolver: None, redirect_resolver: None, graph_imports: Default::default(), + package_json_deps_by_resolution: Default::default(), config_data: None, } } @@ -165,6 +167,33 @@ impl LspScopeResolver { ) }) .unwrap_or_default(); + let package_json_deps_by_resolution = (|| { + let node_resolver = node_resolver.as_ref()?; + let package_json = config_data?.maybe_pkg_json()?; + let referrer = package_json.specifier(); + let dependencies = package_json.dependencies.as_ref()?; + let result = dependencies + .iter() + .flat_map(|(name, _)| { + let req_ref = + NpmPackageReqReference::from_str(&format!("npm:{name}")).ok()?; + let specifier = into_specifier_and_media_type(Some( + node_resolver + .resolve_req_reference( + &req_ref, + &referrer, + NodeResolutionMode::Types, + ) + .ok()?, + )) + .0; + Some((specifier, name.clone())) + }) + .collect(); + Some(result) + })(); + let package_json_deps_by_resolution = + Arc::new(package_json_deps_by_resolution.unwrap_or_default()); Self { cjs_tracker: lsp_cjs_tracker, graph_resolver, @@ -174,6 +203,7 @@ impl LspScopeResolver { pkg_json_resolver: Some(pkg_json_resolver), redirect_resolver, graph_imports, + package_json_deps_by_resolution, config_data: config_data.cloned(), } } @@ -216,6 +246,9 @@ impl LspScopeResolver { redirect_resolver: self.redirect_resolver.clone(), pkg_json_resolver: Some(pkg_json_resolver), graph_imports: self.graph_imports.clone(), + package_json_deps_by_resolution: self + .package_json_deps_by_resolution + .clone(), config_data: self.config_data.clone(), }) } @@ -407,6 +440,18 @@ impl LspResolver { ))) } + pub fn file_url_to_package_json_dep( + &self, + specifier: &ModuleSpecifier, + file_referrer: Option<&ModuleSpecifier>, + ) -> Option { + let resolver = self.get_scope_resolver(file_referrer); + resolver + .package_json_deps_by_resolution + .get(specifier) + .cloned() + } + pub fn in_node_modules(&self, specifier: &ModuleSpecifier) -> bool { fn has_node_modules_dir(specifier: &ModuleSpecifier) -> bool { // consider any /node_modules/ directory as being in the node_modules diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index 5fcdb3575a..6f63ced5be 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -236,7 +236,7 @@ pub struct TsServer { performance: Arc, sender: mpsc::UnboundedSender, receiver: Mutex>>, - specifier_map: Arc, + pub specifier_map: Arc, inspector_server: Mutex>>, pending_change: Mutex>, } @@ -882,20 +882,22 @@ impl TsServer { options: GetCompletionsAtPositionOptions, format_code_settings: FormatCodeSettings, scope: Option, - ) -> Option { + ) -> Result, AnyError> { let req = TscRequest::GetCompletionsAtPosition(Box::new(( self.specifier_map.denormalize(&specifier), position, options, format_code_settings, ))); - match self.request(snapshot, req, scope).await { - Ok(maybe_info) => maybe_info, - Err(err) => { - log::error!("Unable to get completion info from TypeScript: {:#}", err); - None - } - } + self + .request::>(snapshot, req, scope) + .await + .map(|mut info| { + if let Some(info) = &mut info { + info.normalize(&self.specifier_map); + } + info + }) } pub async fn get_completion_details( @@ -3642,6 +3644,12 @@ pub struct CompletionInfo { } impl CompletionInfo { + fn normalize(&mut self, specifier_map: &TscSpecifierMap) { + for entry in &mut self.entries { + entry.normalize(specifier_map); + } + } + pub fn as_completion_response( &self, line_index: Arc, @@ -3703,11 +3711,17 @@ pub struct CompletionItemData { #[derive(Debug, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] -struct CompletionEntryDataImport { +struct CompletionEntryDataAutoImport { module_specifier: String, file_name: String, } +#[derive(Debug)] +pub struct CompletionNormalizedAutoImportData { + raw: CompletionEntryDataAutoImport, + normalized: ModuleSpecifier, +} + #[derive(Debug, Default, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CompletionEntry { @@ -3740,9 +3754,28 @@ pub struct CompletionEntry { is_import_statement_completion: Option, #[serde(skip_serializing_if = "Option::is_none")] data: Option, + /// This is not from tsc, we add it for convenience during normalization. + /// Represents `self.data.file_name`, but normalized. + #[serde(skip)] + auto_import_data: Option, } impl CompletionEntry { + fn normalize(&mut self, specifier_map: &TscSpecifierMap) { + let Some(data) = &self.data else { + return; + }; + let Ok(raw) = + serde_json::from_value::(data.clone()) + else { + return; + }; + if let Ok(normalized) = specifier_map.normalize(&raw.file_name) { + self.auto_import_data = + Some(CompletionNormalizedAutoImportData { raw, normalized }); + } + } + fn get_commit_characters( &self, info: &CompletionInfo, @@ -3891,25 +3924,24 @@ impl CompletionEntry { if let Some(source) = &self.source { let mut display_source = source.clone(); - if let Some(data) = &self.data { - if let Ok(import_data) = - serde_json::from_value::(data.clone()) + if let Some(import_data) = &self.auto_import_data { + if let Some(new_module_specifier) = language_server + .get_ts_response_import_mapper(specifier) + .check_specifier(&import_data.normalized, specifier) + .or_else(|| relative_specifier(specifier, &import_data.normalized)) { - if let Ok(import_specifier) = resolve_url(&import_data.file_name) { - if let Some(new_module_specifier) = language_server - .get_ts_response_import_mapper(specifier) - .check_specifier(&import_specifier, specifier) - .or_else(|| relative_specifier(specifier, &import_specifier)) - { - display_source.clone_from(&new_module_specifier); - if new_module_specifier != import_data.module_specifier { - specifier_rewrite = - Some((import_data.module_specifier, new_module_specifier)); - } - } else if source.starts_with(jsr_url().as_str()) { - return None; - } + if new_module_specifier.contains("/node_modules/") { + return None; } + display_source.clone_from(&new_module_specifier); + if new_module_specifier != import_data.raw.module_specifier { + specifier_rewrite = Some(( + import_data.raw.module_specifier.clone(), + new_module_specifier, + )); + } + } else if source.starts_with(jsr_url().as_str()) { + return None; } } // We want relative or bare (import-mapped or otherwise) specifiers to @@ -4212,6 +4244,13 @@ impl TscSpecifierMap { return specifier.to_string(); } let mut specifier = original.to_string(); + if specifier.contains("/node_modules/.deno/") + && !specifier.contains("/node_modules/@types/node/") + { + // The ts server doesn't give completions from files in + // `node_modules/.deno/`. We work around it like this. + specifier = specifier.replace("/node_modules/", "/$node_modules/"); + } let media_type = MediaType::from_specifier(original); // If the URL-inferred media type doesn't correspond to tsc's path-inferred // media type, force it to be the same by appending an extension. @@ -4329,7 +4368,7 @@ fn op_is_cancelled(state: &mut OpState) -> bool { fn op_is_node_file(state: &mut OpState, #[string] path: String) -> bool { let state = state.borrow::(); let mark = state.performance.mark("tsc.op.op_is_node_file"); - let r = match ModuleSpecifier::parse(&path) { + let r = match state.specifier_map.normalize(path) { Ok(specifier) => state.state_snapshot.resolver.in_node_modules(&specifier), Err(_) => false, }; @@ -4609,7 +4648,10 @@ fn op_script_names(state: &mut OpState) -> ScriptNames { for doc in &docs { let specifier = doc.specifier(); let is_open = doc.is_open(); - if is_open || specifier.scheme() == "file" { + if is_open + || (specifier.scheme() == "file" + && !state.state_snapshot.resolver.in_node_modules(specifier)) + { let script_names = doc .scope() .and_then(|s| result.by_scope.get_mut(s)) @@ -6035,6 +6077,7 @@ mod tests { Some(temp_dir.url()), ) .await + .unwrap() .unwrap(); assert_eq!(info.entries.len(), 22); let details = ts_server @@ -6194,6 +6237,7 @@ mod tests { Some(temp_dir.url()), ) .await + .unwrap() .unwrap(); let entry = info .entries diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 56221a0269..af5f9de23e 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -6628,6 +6628,23 @@ export class DuckConfig { }] }] } + }, { + "title": "Add all missing imports", + "kind": "quickfix", + "diagnostics": [{ + "range": { + "start": { "line": 0, "character": 50 }, + "end": { "line": 0, "character": 67 } + }, + "severity": 1, + "code": 2304, + "source": "deno-ts", + "message": "Cannot find name 'DuckConfigOptions'." + }], + "data": { + "specifier": "file:///a/file00.ts", + "fixId": "fixMissingImport" + } }, { "title": "Add import from \"./file01.ts\"", "kind": "quickfix", @@ -6656,23 +6673,6 @@ export class DuckConfig { }] }] } - }, { - "title": "Add all missing imports", - "kind": "quickfix", - "diagnostics": [{ - "range": { - "start": { "line": 0, "character": 50 }, - "end": { "line": 0, "character": 67 } - }, - "severity": 1, - "code": 2304, - "source": "deno-ts", - "message": "Cannot find name 'DuckConfigOptions'." - }], - "data": { - "specifier": "file:///a/file00.ts", - "fixId": "fixMissingImport" - } }]) ); let res = client.write_request( @@ -8125,6 +8125,151 @@ fn lsp_npm_completions_auto_import_and_quick_fix_no_import_map() { client.shutdown(); } +#[test] +fn lsp_npm_auto_import_and_quick_fix_byonm() { + let context = TestContextBuilder::new() + .use_http_server() + .use_temp_cwd() + .add_npm_env_vars() + .build(); + let temp_dir = context.temp_dir(); + temp_dir.write("deno.json", json!({}).to_string()); + temp_dir.write( + "package.json", + json!({ + "dependencies": { + "cowsay": "*", + }, + }) + .to_string(), + ); + context + .new_command() + .args("install") + .run() + .skip_output_check(); + temp_dir.write("other.ts", "import \"cowsay\";\n"); + let mut client = context.new_lsp_command().build(); + client.initialize_default(); + let diagnostics = client.did_open(json!({ + "textDocument": { + "uri": temp_dir.url().join("file.ts").unwrap(), + "languageId": "typescript", + "version": 1, + "text": "think({ text: \"foo\" });\n", + }, + })); + let list = client.get_completion_list( + temp_dir.url().join("file.ts").unwrap(), + (0, 5), + json!({ "triggerKind": 1 }), + ); + assert!(!list.is_incomplete); + let item = list + .items + .iter() + .find(|item| item.label == "think") + .unwrap(); + let res = client.write_request("completionItem/resolve", item); + assert_eq!( + res, + json!({ + "label": "think", + "labelDetails": { + "description": "cowsay", + }, + "kind": 3, + "detail": "function think(options: IOptions): string", + "documentation": { + "kind": "markdown", + "value": "\n\n*@param* \noptions ## Face :\nEither choose a mode (set the value as true) **_or_**\nset your own defined eyes and tongue to `e` and `T`.\n- ### `e` : eyes\n- ### `T` : tongue\n\n## Cow :\nEither specify a cow name (e.g. \"fox\") **_or_**\nset the value of `r` to true which selects a random cow.\n- ### `r` : random selection\n- ### `f` : cow name - from `cows` folder\n\n## Modes :\nModes are just ready-to-use faces, here's their list:\n- #### `b` : borg\n- #### `d` : dead \n- #### `g` : greedy\n- #### `p` : paranoia\n- #### `s` : stoned\n- #### `t` : tired\n- #### `w` : youthful\n- #### `y` : wired \n\n*@example* \n```\n// custom cow and face\ncowsay.think({\n text: 'Hello world!',\n e: '^^', // eyes\n T: 'U ', // tongue\n f: 'USA' // name of the cow from `cows` folder\n})\n\n// using a random cow\ncowsay.think({\n text: 'Hello world!',\n e: 'xx', // eyes\n r: true, // random mode - use a random cow.\n})\n\n// using a mode\ncowsay.think({\n text: 'Hello world!',\n y: true, // using y mode - youthful mode\n})\n```", + }, + "sortText": "￿16_0", + "additionalTextEdits": [ + { + "range": { + "start": { "line": 0, "character": 0 }, + "end": { "line": 0, "character": 0 }, + }, + "newText": "import { think } from \"cowsay\";\n\n", + }, + ], + }), + ); + let diagnostics = diagnostics + .messages_with_file_and_source( + temp_dir.url().join("file.ts").unwrap().as_str(), + "deno-ts", + ) + .diagnostics; + let res = client.write_request( + "textDocument/codeAction", + json!(json!({ + "textDocument": { + "uri": temp_dir.url().join("file.ts").unwrap(), + }, + "range": { + "start": { "line": 0, "character": 0 }, + "end": { "line": 0, "character": 5 }, + }, + "context": { + "diagnostics": &diagnostics, + "only": ["quickfix"], + }, + })), + ); + assert_eq!( + res, + json!([ + { + "title": "Add import from \"cowsay\"", + "kind": "quickfix", + "diagnostics": &diagnostics, + "edit": { + "documentChanges": [{ + "textDocument": { + "uri": temp_dir.url().join("file.ts").unwrap(), + "version": 1, + }, + "edits": [{ + "range": { + "start": { "line": 0, "character": 0 }, + "end": { "line": 0, "character": 0 }, + }, + "newText": "import { think } from \"cowsay\";\n\n", + }], + }], + }, + }, + { + "title": "Add missing function declaration 'think'", + "kind": "quickfix", + "diagnostics": &diagnostics, + "edit": { + "documentChanges": [ + { + "textDocument": { + "uri": temp_dir.url().join("file.ts").unwrap(), + "version": 1, + }, + "edits": [ + { + "range": { + "start": { "line": 1, "character": 0 }, + "end": { "line": 1, "character": 0 }, + }, + "newText": "\nfunction think(arg0: { text: string; }) {\n throw new Error(\"Function not implemented.\");\n}\n", + }, + ], + }, + ], + }, + }, + ]), + ); + client.shutdown(); +} + #[test] fn lsp_completions_node_specifier() { let context = TestContextBuilder::new().use_temp_cwd().build(); @@ -8237,8 +8382,8 @@ fn lsp_infer_return_type() { let context = TestContextBuilder::new().use_temp_cwd().build(); let temp_dir = context.temp_dir(); temp_dir.write("deno.json", json!({}).to_string()); - let types_file = source_file( - temp_dir.path().join("types.d.ts"), + temp_dir.write( + "types.d.ts", r#" export interface SomeInterface { someField: number; @@ -8319,7 +8464,7 @@ fn lsp_infer_return_type() { "start": { "line": 1, "character": 20 }, "end": { "line": 1, "character": 20 }, }, - "newText": format!(": import(\"{}\").SomeInterface", types_file.url()), + "newText": ": import(\"./types.d.ts\").SomeInterface", }, ], }, From 64e887083aa67047f5ad37b9d55c418274b03ea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 6 Nov 2024 12:56:03 +0000 Subject: [PATCH 039/227] fix(fmt): don't use self-closing tags in HTML (#26754) Closes https://github.com/denoland/deno/issues/26748 --- cli/tools/fmt.rs | 2 +- tests/specs/fmt/html/well_formatted.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index 8378835612..f7f8dabc6f 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -1032,7 +1032,7 @@ fn get_resolved_markup_fmt_config( max_attrs_per_line: None, prefer_attrs_single_line: false, html_normal_self_closing: None, - html_void_self_closing: Some(true), + html_void_self_closing: None, component_self_closing: None, svg_self_closing: None, mathml_self_closing: None, diff --git a/tests/specs/fmt/html/well_formatted.html b/tests/specs/fmt/html/well_formatted.html index c0c06cd9bd..7af705c049 100644 --- a/tests/specs/fmt/html/well_formatted.html +++ b/tests/specs/fmt/html/well_formatted.html @@ -1,4 +1,4 @@ -
content
+
content
"#, + deno_doc::html::comrak::COMRAK_STYLESHEET_FILENAME + ) + })), }; - let files = deno_doc::html::generate(options, doc_nodes_by_url) + let mut files = deno_doc::html::generate(options, doc_nodes_by_url) .context("Failed to generate HTML documentation")?; + files.insert("prism.js".to_string(), PRISM_JS.to_string()); + files.insert("prism.css".to_string(), PRISM_CSS.to_string()); + let path = &output_dir_resolved; let _ = std::fs::remove_dir_all(path); std::fs::create_dir(path) diff --git a/cli/tools/doc/prism.css b/cli/tools/doc/prism.css new file mode 100644 index 0000000000..afc2ef6ca9 --- /dev/null +++ b/cli/tools/doc/prism.css @@ -0,0 +1,3 @@ +/* PrismJS 1.29.0 +https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+bash+json+markdown+regex+rust+typescript */ +code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help} diff --git a/cli/tools/doc/prism.js b/cli/tools/doc/prism.js new file mode 100644 index 0000000000..23bf919589 --- /dev/null +++ b/cli/tools/doc/prism.js @@ -0,0 +1,15 @@ +// MIT LICENSE +// Copyright (c) 2012 Lea Verou +/* PrismJS 1.29.0 +https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+bash+json+markdown+regex+rust+typescript */ +var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(e){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,r={},a={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof i?new i(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&").replace(/=g.reach);A+=w.value.length,w=w.next){var E=w.value;if(n.length>e.length)return;if(!(E instanceof i)){var P,L=1;if(y){if(!(P=l(b,A,e,m))||P.index>=e.length)break;var S=P.index,O=P.index+P[0].length,j=A;for(j+=w.value.length;S>=j;)j+=(w=w.next).value.length;if(A=j-=w.value.length,w.value instanceof i)continue;for(var C=w;C!==n.tail&&(jg.reach&&(g.reach=W);var z=w.prev;if(_&&(z=u(n,z,_),A+=_.length),c(n,z,L),w=u(n,z,new i(f,p?a.tokenize(N,p):N,k,N)),M&&u(n,w,M),L>1){var I={cause:f+","+d,reach:W};o(e,n,t,w.prev,A,I),g&&I.reach>g.reach&&(g.reach=I.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function u(e,n,t){var r=n.next,a={value:t,prev:n,next:r};return n.next=a,r.prev=a,e.length++,a}function c(e,n,t){for(var r=n.next,a=0;a"+i.content+""},!e.document)return e.addEventListener?(a.disableWorkerMessageHandler||e.addEventListener("message",(function(n){var t=JSON.parse(n.data),r=t.language,i=t.code,l=t.immediateClose;e.postMessage(a.highlight(i,a.languages[r],r)),l&&e.close()}),!1),a):a;var g=a.util.currentScript();function f(){a.manual||a.highlightAll()}if(g&&(a.filename=g.src,g.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var h=document.readyState;"loading"===h||"interactive"===h&&g&&g.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return a}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism); +Prism.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(a,e){var s={};s["language-"+e]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[e]},s.cdata=/^$/i;var t={"included-cdata":{pattern://i,inside:s}};t["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var n={};n[a]={pattern:RegExp("(<__[^>]*>)(?:))*\\]\\]>|(?!)".replace(/__/g,(function(){return a})),"i"),lookbehind:!0,greedy:!0,inside:t},Prism.languages.insertBefore("markup","cdata",n)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(a,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp("(^|[\"'\\s])(?:"+a+")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))","i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml; +!function(s){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;s.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:[^;{\\s\"']|\\s+(?!\\s)|"+e.source+")*?(?:;|(?=\\s*\\{))"),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|(?:[^\\\\\r\n()\"']|\\\\[^])*)\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},s.languages.css.atrule.inside.rest=s.languages.css;var t=s.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(Prism); +Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}; +Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp("((?:^|[^$\\w\\xA0-\\uFFFF.\"'\\])\\s]|\\b(?:return|yield))\\s*)/(?:(?:\\[(?:[^\\]\\\\\r\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|/\\*(?:[^*]|\\*(?!/))*\\*/)*(?:$|[\r\n,.;:})\\]]|//))"),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute("on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)","javascript")),Prism.languages.js=Prism.languages.javascript; +!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",a={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},n={bash:a,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:n},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:a}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:n},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:n.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:n.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},a.inside=e.languages.bash;for(var s=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=n.variable[1].inside,i=0;i/g,(function(){return"(?:\\\\.|[^\\\\\n\r]|(?:\n|\r\n?)(?![\r\n]))"})),RegExp("((?:^|[^\\\\])(?:\\\\{2})*)(?:"+n+")")}var t="(?:\\\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\\\|\r\n`])+",a="\\|?__(?:\\|__)+\\|?(?:(?:\n|\r\n?)|(?![^]))".replace(/__/g,(function(){return t})),i="\\|?[ \t]*:?-{3,}:?[ \t]*(?:\\|[ \t]*:?-{3,}:?[ \t]*)+\\|?(?:\n|\r\n?)";n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+a+i+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+i+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(t),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(t),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:e("\\b__(?:(?!_)|_(?:(?!_))+_)+__\\b|\\*\\*(?:(?!\\*)|\\*(?:(?!\\*))+\\*)+\\*\\*"),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:e("\\b_(?:(?!_)|__(?:(?!_))+__)+_\\b|\\*(?:(?!\\*)|\\*\\*(?:(?!\\*))+\\*\\*)+\\*"),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:e("(~~?)(?:(?!~))+\\2"),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:e('!?\\[(?:(?!\\]))+\\](?:\\([^\\s)]+(?:[\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \t]?\\[(?:(?!\\]))+\\])'),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(e){["url","bold","italic","strike","code-snippet"].forEach((function(t){e!==t&&(n.languages.markdown[e].inside.content.inside[t]=n.languages.markdown[t])}))})),n.hooks.add("after-tokenize",(function(n){"markdown"!==n.language&&"md"!==n.language||function n(e){if(e&&"string"!=typeof e)for(var t=0,a=e.length;t",quot:'"'},l=String.fromCodePoint||String.fromCharCode;n.languages.md=n.languages.markdown}(Prism); +!function(a){var e={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,t="(?:[^\\\\-]|"+n.source+")",s=RegExp(t+"-"+t),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};a.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:s,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":e,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":e,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|)*\\*/",t=0;t<2;t++)a=a.replace(//g,(function(){return a}));a=a.replace(//g,(function(){return"[^\\s\\S]"})),e.languages.rust={comment:[{pattern:RegExp("(^|[^\\\\])"+a),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism); +!function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var s=e.languages.extend("typescript",{});delete s["class-name"],e.languages.typescript["class-name"].inside=s,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:s}}}}),e.languages.ts=e.languages.typescript}(Prism); diff --git a/cli/tools/info.rs b/cli/tools/info.rs index c2f5a8cb8d..a417a60179 100644 --- a/cli/tools/info.rs +++ b/cli/tools/info.rs @@ -447,6 +447,7 @@ impl<'a> GraphDisplayContext<'a> { Module::Js(module) => module.maybe_cache_info.as_ref(), Module::Json(module) => module.maybe_cache_info.as_ref(), Module::Node(_) | Module::Npm(_) | Module::External(_) => None, + Module::Wasm(_) => todo!("@dsherret"), }; if let Some(cache_info) = maybe_cache_info { if let Some(local) = &cache_info.local { @@ -469,6 +470,7 @@ impl<'a> GraphDisplayContext<'a> { Module::Js(module) => module.size(), Module::Json(module) => module.size(), Module::Node(_) | Module::Npm(_) | Module::External(_) => 0, + Module::Wasm(_) => todo!("@dsherret"), }; size as f64 }) @@ -568,6 +570,7 @@ impl<'a> GraphDisplayContext<'a> { Module::Js(module) => Some(module.size() as u64), Module::Json(module) => Some(module.size() as u64), Module::Node(_) | Module::Npm(_) | Module::External(_) => None, + Module::Wasm(_) => todo!("@dsherret"), }, }; format!("{} {}", header_text, maybe_size_to_text(maybe_size)) @@ -670,6 +673,7 @@ impl<'a> GraphDisplayContext<'a> { ModuleError::Missing(_, _) | ModuleError::MissingDynamic(_, _) => { self.build_error_msg(specifier, "(missing)") } + ModuleError::WasmParseErr(_, _) => todo!("@dsherret"), } } diff --git a/cli/tools/registry/mod.rs b/cli/tools/registry/mod.rs index 12289c581b..35317e12da 100644 --- a/cli/tools/registry/mod.rs +++ b/cli/tools/registry/mod.rs @@ -26,6 +26,7 @@ use deno_core::serde_json; use deno_core::serde_json::json; use deno_core::serde_json::Value; use deno_core::url::Url; +use deno_graph::Module; use deno_terminal::colors; use http_body_util::BodyExt; use serde::Deserialize; @@ -1113,6 +1114,7 @@ fn collect_excluded_module_diagnostics( deno_graph::Module::Npm(_) | deno_graph::Module::Node(_) | deno_graph::Module::External(_) => None, + Module::Wasm(_) => todo!("@dsherret"), }) .filter(|s| s.as_str().starts_with(root.as_str())); for specifier in graph_specifiers { diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index 8179e4223c..d9f66f11a7 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -4535,7 +4535,7 @@ declare namespace Deno { /** The object that is returned from a {@linkcode Deno.upgradeWebSocket} * request. * - * @category Web Sockets */ + * @category WebSockets */ export interface WebSocketUpgrade { /** The response object that represents the HTTP response to the client, * which should be used to the {@linkcode RequestEvent} `.respondWith()` for @@ -4549,7 +4549,7 @@ declare namespace Deno { /** Options which can be set when performing a * {@linkcode Deno.upgradeWebSocket} upgrade of a {@linkcode Request} * - * @category Web Sockets */ + * @category WebSockets */ export interface UpgradeWebSocketOptions { /** Sets the `.protocol` property on the client side web socket to the * value provided here, which should be one of the strings specified in the @@ -4597,7 +4597,7 @@ declare namespace Deno { * This operation does not yet consume the request or open the websocket. This * only happens once the returned response has been passed to `respondWith()`. * - * @category Web Sockets + * @category WebSockets */ export function upgradeWebSocket( request: Request, diff --git a/cli/tsc/mod.rs b/cli/tsc/mod.rs index 8f8bed20a4..c9f726ca28 100644 --- a/cli/tsc/mod.rs +++ b/cli/tsc/mod.rs @@ -664,6 +664,7 @@ fn op_load_inner( &mut is_cjs, )?)) } + Module::Wasm(_) => todo!("@dsherret"), } } else if let Some(npm) = state .maybe_npm @@ -928,6 +929,7 @@ fn resolve_graph_specifier_types( })) } Some(Module::Node(_)) | None => Ok(None), + Some(Module::Wasm(_)) => todo!("@dsherret"), } } diff --git a/tests/specs/doc/lint_html_success/lint_success_html.out b/tests/specs/doc/lint_html_success/lint_success_html.out index 783dd5927e..57b179e226 100644 --- a/tests/specs/doc/lint_html_success/lint_success_html.out +++ b/tests/specs/doc/lint_html_success/lint_success_html.out @@ -1 +1 @@ -Written 12 files to "./docs/" +Written 15 files to "./docs/" diff --git a/tools/copyright_checker.js b/tools/copyright_checker.js index 24afe1dfd7..d7d196bc44 100755 --- a/tools/copyright_checker.js +++ b/tools/copyright_checker.js @@ -31,6 +31,8 @@ export async function checkCopyright() { ":!:.github/mtime_cache/action.js", ":!:cli/bench/testdata/**", ":!:cli/tools/bench/mitata.rs", + ":!:cli/tools/doc/prism.css", + ":!:cli/tools/doc/prism.js", ":!:cli/tools/init/templates/**", ":!:cli/tsc/*typescript.js", ":!:cli/tsc/compiler.d.ts", diff --git a/tools/lint.js b/tools/lint.js index 604dee9b30..8e0057fa30 100755 --- a/tools/lint.js +++ b/tools/lint.js @@ -51,6 +51,8 @@ async function dlint() { ":!:cli/bench/testdata/express-router.js", ":!:cli/bench/testdata/react-dom.js", ":!:cli/compilers/wasm_wrap.js", + ":!:cli/tools/doc/prism.css", + ":!:cli/tools/doc/prism.js", ":!:cli/tsc/dts/**", ":!:cli/tsc/*typescript.js", ":!:cli/tsc/compiler.d.ts", From c55e936be03a3a023330789f903e2fbd12f4a308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Baptista?= <15786310+M4RC3L05@users.noreply.github.com> Date: Tue, 19 Nov 2024 21:01:16 +0000 Subject: [PATCH 110/227] feat(fmt): support SQL (#26750) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds support for .sql files in "deno fmt" subcommand. Closes: https://github.com/denoland/deno/issues/25024 --------- Signed-off-by: m4rc3l05 <15786310+M4RC3L05@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk --- Cargo.lock | 12 ++++ cli/Cargo.toml | 2 + cli/args/flags.rs | 27 ++++++++- cli/args/mod.rs | 4 ++ cli/lsp/language_server.rs | 3 + cli/schemas/config-file.v1.json | 1 + cli/tools/fmt.rs | 64 +++++++++++++++++++- tests/integration/fmt_tests.rs | 18 +++++- tests/specs/fmt/sql/__test__.jsonc | 25 ++++++++ tests/specs/fmt/sql/badly_formatted.sql | 1 + tests/specs/fmt/sql/ignore_file.sql | 3 + tests/specs/fmt/sql/ignore_file2.sql | 3 + tests/specs/fmt/sql/ignore_file3.sql | 6 ++ tests/specs/fmt/sql/ignore_file4.sql | 3 + tests/specs/fmt/sql/well_formatted.sql | 4 ++ tests/specs/fmt/sql/wrong_file_ignore.sql | 6 ++ tests/testdata/fmt/badly_formatted.md | 12 ++++ tests/testdata/fmt/badly_formatted.sql | 21 +++++++ tests/testdata/fmt/badly_formatted_fixed.md | 15 +++++ tests/testdata/fmt/badly_formatted_fixed.sql | 22 +++++++ 20 files changed, 247 insertions(+), 5 deletions(-) create mode 100644 tests/specs/fmt/sql/__test__.jsonc create mode 100644 tests/specs/fmt/sql/badly_formatted.sql create mode 100644 tests/specs/fmt/sql/ignore_file.sql create mode 100644 tests/specs/fmt/sql/ignore_file2.sql create mode 100644 tests/specs/fmt/sql/ignore_file3.sql create mode 100644 tests/specs/fmt/sql/ignore_file4.sql create mode 100644 tests/specs/fmt/sql/well_formatted.sql create mode 100644 tests/specs/fmt/sql/wrong_file_ignore.sql create mode 100644 tests/testdata/fmt/badly_formatted.sql create mode 100644 tests/testdata/fmt/badly_formatted_fixed.sql diff --git a/Cargo.lock b/Cargo.lock index 5705acccc6..1a16714bba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1291,6 +1291,7 @@ dependencies = [ "sha2", "shell-escape", "spki", + "sqlformat", "strsim", "tar", "tempfile", @@ -6794,6 +6795,17 @@ dependencies = [ "der", ] +[[package]] +name = "sqlformat" +version = "0.3.1" +source = "git+https://github.com/shssoichiro/sqlformat-rs.git?rev=827d639#827d639bef94d8e5a5a0e29b41185c8d572f24e6" +dependencies = [ + "nom 7.1.3", + "once_cell", + "regex", + "unicode_categories", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index dd1d44a8ef..16f39e9d48 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -151,6 +151,8 @@ serde_repr.workspace = true sha2.workspace = true shell-escape = "=0.1.5" spki = { version = "0.7", features = ["pem"] } +# NOTE(bartlomieju): for now using github URL, because 0.3.2 with important fixes hasn't been released yet. +sqlformat = { git = "https://github.com/shssoichiro/sqlformat-rs.git", rev = "827d639" } strsim = "0.11.1" tar.workspace = true tempfile.workspace = true diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 39db12b5f1..262bc04682 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -210,6 +210,7 @@ pub struct FmtFlags { pub no_semicolons: Option, pub watch: Option, pub unstable_component: bool, + pub unstable_sql: bool, } impl FmtFlags { @@ -2291,7 +2292,7 @@ Ignore formatting a file by adding an ignore comment at the top of the file: .value_parser([ "ts", "tsx", "js", "jsx", "md", "json", "jsonc", "css", "scss", "sass", "less", "html", "svelte", "vue", "astro", "yml", "yaml", - "ipynb", + "ipynb", "sql" ]) .help_heading(FMT_HEADING).requires("files"), ) @@ -2410,6 +2411,14 @@ Ignore formatting a file by adding an ignore comment at the top of the file: .help_heading(FMT_HEADING) .hide(true), ) + .arg( + Arg::new("unstable-sql") + .long("unstable-sql") + .help("Enable formatting SQL files.") + .value_parser(FalseyValueParser::new()) + .action(ArgAction::SetTrue) + .help_heading(FMT_HEADING), + ) }) } @@ -4634,6 +4643,7 @@ fn fmt_parse( let prose_wrap = matches.remove_one::("prose-wrap"); let no_semicolons = matches.remove_one::("no-semicolons"); let unstable_component = matches.get_flag("unstable-component"); + let unstable_sql = matches.get_flag("unstable-sql"); flags.subcommand = DenoSubcommand::Fmt(FmtFlags { check: matches.get_flag("check"), @@ -4646,6 +4656,7 @@ fn fmt_parse( no_semicolons, watch: watch_arg_parse(matches)?, unstable_component, + unstable_sql, }); Ok(()) } @@ -6565,6 +6576,7 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_component: false, + unstable_sql: false, watch: Default::default(), }), ..Flags::default() @@ -6588,6 +6600,7 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_component: false, + unstable_sql: false, watch: Default::default(), }), ..Flags::default() @@ -6611,6 +6624,7 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_component: false, + unstable_sql: false, watch: Default::default(), }), ..Flags::default() @@ -6634,6 +6648,7 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_component: false, + unstable_sql: false, watch: Some(Default::default()), }), ..Flags::default() @@ -6648,7 +6663,8 @@ mod tests { "--unstable-css", "--unstable-html", "--unstable-component", - "--unstable-yaml" + "--unstable-yaml", + "--unstable-sql" ]); assert_eq!( r.unwrap(), @@ -6666,6 +6682,7 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_component: true, + unstable_sql: true, watch: Some(WatchFlags { hmr: false, no_clear_screen: true, @@ -6700,6 +6717,7 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_component: false, + unstable_sql: false, watch: Some(Default::default()), }), ..Flags::default() @@ -6723,6 +6741,7 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_component: false, + unstable_sql: false, watch: Default::default(), }), config_flag: ConfigFlag::Path("deno.jsonc".to_string()), @@ -6754,6 +6773,7 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_component: false, + unstable_sql: false, watch: Some(Default::default()), }), config_flag: ConfigFlag::Path("deno.jsonc".to_string()), @@ -6790,6 +6810,7 @@ mod tests { prose_wrap: Some("never".to_string()), no_semicolons: Some(true), unstable_component: false, + unstable_sql: false, watch: Default::default(), }), ..Flags::default() @@ -6820,6 +6841,7 @@ mod tests { prose_wrap: None, no_semicolons: Some(false), unstable_component: false, + unstable_sql: false, watch: Default::default(), }), ..Flags::default() @@ -6845,6 +6867,7 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_component: false, + unstable_sql: false, watch: Default::default(), }), ext: Some("html".to_string()), diff --git a/cli/args/mod.rs b/cli/args/mod.rs index ec75d7a100..61e1443a75 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -289,6 +289,7 @@ impl BenchOptions { #[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] pub struct UnstableFmtOptions { pub component: bool, + pub sql: bool, } #[derive(Clone, Debug)] @@ -322,6 +323,7 @@ impl FmtOptions { options: resolve_fmt_options(fmt_flags, fmt_config.options), unstable: UnstableFmtOptions { component: unstable.component || fmt_flags.unstable_component, + sql: unstable.sql || fmt_flags.unstable_sql, }, files: fmt_config.files, } @@ -1319,6 +1321,7 @@ impl CliOptions { let workspace = self.workspace(); UnstableFmtOptions { component: workspace.has_unstable("fmt-component"), + sql: workspace.has_unstable("fmt-sql"), } } @@ -1667,6 +1670,7 @@ impl CliOptions { "byonm", "bare-node-builtins", "fmt-component", + "fmt-sql", ]) .collect(); diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 2ce26c1f2e..cbe194e14e 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -1405,6 +1405,9 @@ impl Inner { component: config_data .map(|d| d.unstable.contains("fmt-component")) .unwrap_or(false), + sql: config_data + .map(|d| d.unstable.contains("fmt-sql")) + .unwrap_or(false), }; let document = document.clone(); move || { diff --git a/cli/schemas/config-file.v1.json b/cli/schemas/config-file.v1.json index 3ba803ef8c..ccd773efbf 100644 --- a/cli/schemas/config-file.v1.json +++ b/cli/schemas/config-file.v1.json @@ -557,6 +557,7 @@ "ffi", "fs", "fmt-component", + "fmt-sql", "http", "kv", "net", diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index d40abd5f50..9c2c709129 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -272,6 +272,7 @@ fn format_markdown( | "njk" | "yml" | "yaml" + | "sql" ) { // It's important to tell dprint proper file extension, otherwise // it might parse the file twice. @@ -301,6 +302,13 @@ fn format_markdown( } } "yml" | "yaml" => format_yaml(text, fmt_options), + "sql" => { + if unstable_options.sql { + format_sql(text, fmt_options) + } else { + Ok(None) + } + } _ => { let mut codeblock_config = get_resolved_typescript_config(fmt_options); @@ -503,7 +511,48 @@ pub fn format_html( }) } -/// Formats a single TS, TSX, JS, JSX, JSONC, JSON, MD, or IPYNB file. +pub fn format_sql( + file_text: &str, + fmt_options: &FmtOptionsConfig, +) -> Result, AnyError> { + let ignore_file = file_text + .lines() + .take_while(|line| line.starts_with("--")) + .any(|line| { + line + .strip_prefix("--") + .unwrap() + .trim() + .starts_with("deno-fmt-ignore-file") + }); + + if ignore_file { + return Ok(None); + } + + let mut formatted_str = sqlformat::format( + file_text, + &sqlformat::QueryParams::None, + &sqlformat::FormatOptions { + ignore_case_convert: None, + indent: if fmt_options.use_tabs.unwrap_or_default() { + sqlformat::Indent::Tabs + } else { + sqlformat::Indent::Spaces(fmt_options.indent_width.unwrap_or(2)) + }, + // leave one blank line between queries. + lines_between_queries: 2, + uppercase: Some(true), + }, + ); + + // Add single new line to the end of file. + formatted_str.push('\n'); + + Ok(Some(formatted_str)) +} + +/// Formats a single TS, TSX, JS, JSX, JSONC, JSON, MD, IPYNB or SQL file. pub fn format_file( file_path: &Path, file_text: &str, @@ -538,6 +587,13 @@ pub fn format_file( format_file(file_path, &file_text, fmt_options, unstable_options, None) }, ), + "sql" => { + if unstable_options.sql { + format_sql(file_text, fmt_options) + } else { + Ok(None) + } + } _ => { let config = get_resolved_typescript_config(fmt_options); dprint_plugin_typescript::format_text( @@ -1209,6 +1265,7 @@ fn is_supported_ext_fmt(path: &Path) -> bool { | "yml" | "yaml" | "ipynb" + | "sql" ) }) } @@ -1269,6 +1326,11 @@ mod test { assert!(is_supported_ext_fmt(Path::new("foo.yaml"))); assert!(is_supported_ext_fmt(Path::new("foo.YaML"))); assert!(is_supported_ext_fmt(Path::new("foo.ipynb"))); + assert!(is_supported_ext_fmt(Path::new("foo.sql"))); + assert!(is_supported_ext_fmt(Path::new("foo.Sql"))); + assert!(is_supported_ext_fmt(Path::new("foo.sQl"))); + assert!(is_supported_ext_fmt(Path::new("foo.sqL"))); + assert!(is_supported_ext_fmt(Path::new("foo.SQL"))); } #[test] diff --git a/tests/integration/fmt_tests.rs b/tests/integration/fmt_tests.rs index b890b3b72a..ccf54a4d0f 100644 --- a/tests/integration/fmt_tests.rs +++ b/tests/integration/fmt_tests.rs @@ -61,6 +61,12 @@ fn fmt_test() { let badly_formatted_yaml = t.path().join("badly_formatted.yaml"); badly_formatted_original_yaml.copy(&badly_formatted_yaml); + let fixed_sql = testdata_fmt_dir.join("badly_formatted_fixed.sql"); + let badly_formatted_original_sql = + testdata_fmt_dir.join("badly_formatted.sql"); + let badly_formatted_sql = t.path().join("badly_formatted.sql"); + badly_formatted_original_sql.copy(&badly_formatted_sql); + // First, check formatting by ignoring the badly formatted file. let output = context .new_command() @@ -71,11 +77,12 @@ fn fmt_test() { "--unstable-html".to_string(), "--unstable-component".to_string(), "--unstable-yaml".to_string(), + "--unstable-sql".to_string(), format!( - "--ignore={badly_formatted_js},{badly_formatted_md},{badly_formatted_json},{badly_formatted_css},{badly_formatted_html},{badly_formatted_component},{badly_formatted_yaml},{badly_formatted_ipynb}", + "--ignore={badly_formatted_js},{badly_formatted_md},{badly_formatted_json},{badly_formatted_css},{badly_formatted_html},{badly_formatted_component},{badly_formatted_yaml},{badly_formatted_ipynb},{badly_formatted_sql}", ), format!( - "--check {badly_formatted_js} {badly_formatted_md} {badly_formatted_json} {badly_formatted_css} {badly_formatted_html} {badly_formatted_component} {badly_formatted_yaml} {badly_formatted_ipynb}", + "--check {badly_formatted_js} {badly_formatted_md} {badly_formatted_json} {badly_formatted_css} {badly_formatted_html} {badly_formatted_component} {badly_formatted_yaml} {badly_formatted_ipynb} {badly_formatted_sql}", ), ]) .run(); @@ -95,6 +102,7 @@ fn fmt_test() { "--unstable-html".to_string(), "--unstable-component".to_string(), "--unstable-yaml".to_string(), + "--unstable-sql".to_string(), badly_formatted_js.to_string(), badly_formatted_md.to_string(), badly_formatted_json.to_string(), @@ -103,6 +111,7 @@ fn fmt_test() { badly_formatted_component.to_string(), badly_formatted_yaml.to_string(), badly_formatted_ipynb.to_string(), + badly_formatted_sql.to_string(), ]) .run(); @@ -119,6 +128,7 @@ fn fmt_test() { "--unstable-html".to_string(), "--unstable-component".to_string(), "--unstable-yaml".to_string(), + "--unstable-sql".to_string(), badly_formatted_js.to_string(), badly_formatted_md.to_string(), badly_formatted_json.to_string(), @@ -127,6 +137,7 @@ fn fmt_test() { badly_formatted_component.to_string(), badly_formatted_yaml.to_string(), badly_formatted_ipynb.to_string(), + badly_formatted_sql.to_string(), ]) .run(); @@ -141,6 +152,7 @@ fn fmt_test() { let expected_component = fixed_component.read_to_string(); let expected_yaml = fixed_yaml.read_to_string(); let expected_ipynb = fixed_ipynb.read_to_string(); + let expected_sql = fixed_sql.read_to_string(); let actual_js = badly_formatted_js.read_to_string(); let actual_md = badly_formatted_md.read_to_string(); let actual_json = badly_formatted_json.read_to_string(); @@ -149,6 +161,7 @@ fn fmt_test() { let actual_component = badly_formatted_component.read_to_string(); let actual_yaml = badly_formatted_yaml.read_to_string(); let actual_ipynb = badly_formatted_ipynb.read_to_string(); + let actual_sql = badly_formatted_sql.read_to_string(); assert_eq!(expected_js, actual_js); assert_eq!(expected_md, actual_md); assert_eq!(expected_json, actual_json); @@ -157,6 +170,7 @@ fn fmt_test() { assert_eq!(expected_component, actual_component); assert_eq!(expected_yaml, actual_yaml); assert_eq!(expected_ipynb, actual_ipynb); + assert_eq!(expected_sql, actual_sql); } #[test] diff --git a/tests/specs/fmt/sql/__test__.jsonc b/tests/specs/fmt/sql/__test__.jsonc new file mode 100644 index 0000000000..a335e79c24 --- /dev/null +++ b/tests/specs/fmt/sql/__test__.jsonc @@ -0,0 +1,25 @@ +{ + "tempDir": true, + "tests": { + "nothing": { + "args": "fmt", + "output": "Checked 7 files\n" + }, + "flag": { + "args": "fmt --unstable-sql", + "output": "[UNORDERED_START]\n[WILDLINE]badly_formatted.sql\n[WILDLINE]well_formatted.sql\n[WILDLINE]wrong_file_ignore.sql\n[UNORDERED_END]\nChecked 7 files\n" + }, + "config_file": { + "steps": [{ + "args": [ + "eval", + "Deno.writeTextFile('deno.json', '{\\n \"unstable\": [\"fmt-sql\"]\\n}\\n')" + ], + "output": "[WILDCARD]" + }, { + "args": "fmt", + "output": "[UNORDERED_START]\n[WILDLINE]badly_formatted.sql\n[WILDLINE]well_formatted.sql\n[WILDLINE]wrong_file_ignore.sql\n[UNORDERED_END]\nChecked 8 files\n" + }] + } + } +} diff --git a/tests/specs/fmt/sql/badly_formatted.sql b/tests/specs/fmt/sql/badly_formatted.sql new file mode 100644 index 0000000000..619fc7afdd --- /dev/null +++ b/tests/specs/fmt/sql/badly_formatted.sql @@ -0,0 +1 @@ +select *; \ No newline at end of file diff --git a/tests/specs/fmt/sql/ignore_file.sql b/tests/specs/fmt/sql/ignore_file.sql new file mode 100644 index 0000000000..62418c611b --- /dev/null +++ b/tests/specs/fmt/sql/ignore_file.sql @@ -0,0 +1,3 @@ +-- deno-fmt-ignore-file + +foo%! diff --git a/tests/specs/fmt/sql/ignore_file2.sql b/tests/specs/fmt/sql/ignore_file2.sql new file mode 100644 index 0000000000..fe9969f1d3 --- /dev/null +++ b/tests/specs/fmt/sql/ignore_file2.sql @@ -0,0 +1,3 @@ +--deno-fmt-ignore-file + +foo%! diff --git a/tests/specs/fmt/sql/ignore_file3.sql b/tests/specs/fmt/sql/ignore_file3.sql new file mode 100644 index 0000000000..c87da3e591 --- /dev/null +++ b/tests/specs/fmt/sql/ignore_file3.sql @@ -0,0 +1,6 @@ +-- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor +-- incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, +-- quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +-- deno-fmt-ignore-file + + foo%! diff --git a/tests/specs/fmt/sql/ignore_file4.sql b/tests/specs/fmt/sql/ignore_file4.sql new file mode 100644 index 0000000000..2de65712a5 --- /dev/null +++ b/tests/specs/fmt/sql/ignore_file4.sql @@ -0,0 +1,3 @@ +-- deno-fmt-ignore-file Foo bar biz + + foo%! diff --git a/tests/specs/fmt/sql/well_formatted.sql b/tests/specs/fmt/sql/well_formatted.sql new file mode 100644 index 0000000000..92ce980185 --- /dev/null +++ b/tests/specs/fmt/sql/well_formatted.sql @@ -0,0 +1,4 @@ +SELECT + * +FROM + foo; diff --git a/tests/specs/fmt/sql/wrong_file_ignore.sql b/tests/specs/fmt/sql/wrong_file_ignore.sql new file mode 100644 index 0000000000..c124855dc2 --- /dev/null +++ b/tests/specs/fmt/sql/wrong_file_ignore.sql @@ -0,0 +1,6 @@ +-- File ignore directive only works if it's in the first cluster +-- of comment, ie. there are no empty lines after the first n-leading lines. + +-- deno-fmt-ignore-file + + foo \ No newline at end of file diff --git a/tests/testdata/fmt/badly_formatted.md b/tests/testdata/fmt/badly_formatted.md index 642918ceae..be90ff845f 100644 --- a/tests/testdata/fmt/badly_formatted.md +++ b/tests/testdata/fmt/badly_formatted.md @@ -63,3 +63,15 @@ function foo(): number { let a:number ``` + + +```sql + seLect * , biz, buz +from baz; +``` + +```sql +-- deno-fmt-ignore-file + seLect * , biz, buz +from baz; +``` diff --git a/tests/testdata/fmt/badly_formatted.sql b/tests/testdata/fmt/badly_formatted.sql new file mode 100644 index 0000000000..8b4cb978f0 --- /dev/null +++ b/tests/testdata/fmt/badly_formatted.sql @@ -0,0 +1,21 @@ +select * from foo; +update foo set a = 'b'Where id = 'biz'; + + + create table foo(id text not null +bar text, + biz int, + buz number NOT NULL +); + +INSERT + into + user_data + (first_name, +last_name, address, phone, email) +VALUES + ('foo', 'bar', + 'biz', 1, 'bix'); + + + diff --git a/tests/testdata/fmt/badly_formatted_fixed.md b/tests/testdata/fmt/badly_formatted_fixed.md index 21176742bb..7a482e058f 100644 --- a/tests/testdata/fmt/badly_formatted_fixed.md +++ b/tests/testdata/fmt/badly_formatted_fixed.md @@ -56,3 +56,18 @@ function foo(): number { let a: number; ``` + +```sql +SELECT + *, + biz, + buz +FROM + baz; +``` + +```sql +-- deno-fmt-ignore-file + seLect * , biz, buz +from baz; +``` diff --git a/tests/testdata/fmt/badly_formatted_fixed.sql b/tests/testdata/fmt/badly_formatted_fixed.sql new file mode 100644 index 0000000000..d50c619216 --- /dev/null +++ b/tests/testdata/fmt/badly_formatted_fixed.sql @@ -0,0 +1,22 @@ +SELECT + * +FROM + foo; + +UPDATE + foo +SET + a = 'b' +WHERE + id = 'biz'; + +CREATE TABLE foo( + id text NOT NULL bar text, + biz int, + buz number NOT NULL +); + +INSERT INTO + user_data (first_name, last_name, address, phone, email) +VALUES + ('foo', 'bar', 'biz', 1, 'bix'); From 46b6037644c761369e689704f8e7b857959da155 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 19 Nov 2024 16:19:35 -0500 Subject: [PATCH 111/227] feat(compile): ability to embed local data files (#26934) ``` > deno compile --allow-read=. --include data-file.txt main.js ``` This only applies to files on the filesystem. For remote modules, that's going to have to wait for `import ... from "./data.txt" with { "type": "bytes" }` or whatever it will be. --- cli/args/flags.rs | 6 +- cli/factory.rs | 1 + cli/standalone/binary.rs | 168 ++++++++++-------- cli/standalone/virtual_fs.rs | 3 +- cli/tools/compile.rs | 80 +++++++-- .../compile/include_data_files/__test__.jsonc | 41 +++++ .../compile/include_data_files/data-file.txt | 1 + .../specs/compile/include_data_files/main.js | 1 + .../include_data_files/non_existent.out | 6 + .../compile/include_data_files/output.out | 1 + 10 files changed, 213 insertions(+), 95 deletions(-) create mode 100644 tests/specs/compile/include_data_files/__test__.jsonc create mode 100644 tests/specs/compile/include_data_files/data-file.txt create mode 100644 tests/specs/compile/include_data_files/main.js create mode 100644 tests/specs/compile/include_data_files/non_existent.out create mode 100644 tests/specs/compile/include_data_files/output.out diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 262bc04682..85b8abefe1 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -1909,10 +1909,10 @@ On the first invocation with deno will download the proper binary and cache it i Arg::new("include") .long("include") .help( - cstr!("Includes an additional module in the compiled executable's module graph. + cstr!("Includes an additional module or local data file in the compiled executable. Use this flag if a dynamically imported module or a web worker main module - fails to load in the executable. This flag can be passed multiple times, - to include multiple additional modules.", + fails to load in the executable or to embed a file in the executable. This flag can + be passed multiple times, to include multiple additional modules.", )) .action(ArgAction::Append) .value_hint(ValueHint::FilePath) diff --git a/cli/factory.rs b/cli/factory.rs index 7949a83a55..98149982f0 100644 --- a/cli/factory.rs +++ b/cli/factory.rs @@ -884,6 +884,7 @@ impl CliFactory { let cli_options = self.cli_options()?; Ok(DenoCompileBinaryWriter::new( self.cjs_tracker()?, + self.cli_options()?, self.deno_dir()?, self.emitter()?, self.file_fetcher()?, diff --git a/cli/standalone/binary.rs b/cli/standalone/binary.rs index d18d775641..8153993137 100644 --- a/cli/standalone/binary.rs +++ b/cli/standalone/binary.rs @@ -201,7 +201,8 @@ fn write_binary_bytes( compile_flags: &CompileFlags, ) -> Result<(), AnyError> { let data_section_bytes = - serialize_binary_data_section(metadata, npm_snapshot, remote_modules, vfs)?; + serialize_binary_data_section(metadata, npm_snapshot, remote_modules, vfs) + .context("Serializing binary data section.")?; let target = compile_flags.resolve_target(); if target.contains("linux") { @@ -364,6 +365,7 @@ pub fn extract_standalone( pub struct DenoCompileBinaryWriter<'a> { cjs_tracker: &'a CjsTracker, + cli_options: &'a CliOptions, deno_dir: &'a DenoDir, emitter: &'a Emitter, file_fetcher: &'a FileFetcher, @@ -377,6 +379,7 @@ impl<'a> DenoCompileBinaryWriter<'a> { #[allow(clippy::too_many_arguments)] pub fn new( cjs_tracker: &'a CjsTracker, + cli_options: &'a CliOptions, deno_dir: &'a DenoDir, emitter: &'a Emitter, file_fetcher: &'a FileFetcher, @@ -387,6 +390,7 @@ impl<'a> DenoCompileBinaryWriter<'a> { ) -> Self { Self { cjs_tracker, + cli_options, deno_dir, emitter, file_fetcher, @@ -403,8 +407,8 @@ impl<'a> DenoCompileBinaryWriter<'a> { graph: &ModuleGraph, root_dir_url: StandaloneRelativeFileBaseUrl<'_>, entrypoint: &ModuleSpecifier, + include_files: &[ModuleSpecifier], compile_flags: &CompileFlags, - cli_options: &CliOptions, ) -> Result<(), AnyError> { // Select base binary based on target let mut original_binary = self.get_base_binary(compile_flags).await?; @@ -417,7 +421,8 @@ impl<'a> DenoCompileBinaryWriter<'a> { target, ) } - set_windows_binary_to_gui(&mut original_binary)?; + set_windows_binary_to_gui(&mut original_binary) + .context("Setting windows binary to GUI.")?; } if compile_flags.icon.is_some() { let target = compile_flags.resolve_target(); @@ -435,7 +440,7 @@ impl<'a> DenoCompileBinaryWriter<'a> { graph, root_dir_url, entrypoint, - cli_options, + include_files, compile_flags, ) .await @@ -478,10 +483,14 @@ impl<'a> DenoCompileBinaryWriter<'a> { if !binary_path.exists() { self .download_base_binary(&download_directory, &binary_path_suffix) - .await?; + .await + .context("Setting up base binary.")?; } - let archive_data = std::fs::read(binary_path)?; + let read_file = |path: &Path| -> Result, AnyError> { + std::fs::read(path).with_context(|| format!("Reading {}", path.display())) + }; + let archive_data = read_file(&binary_path)?; let temp_dir = tempfile::TempDir::new()?; let base_binary_path = archive::unpack_into_dir(archive::UnpackArgs { exe_name: "denort", @@ -490,7 +499,7 @@ impl<'a> DenoCompileBinaryWriter<'a> { is_windows: target.contains("windows"), dest_path: temp_dir.path(), })?; - let base_binary = std::fs::read(base_binary_path)?; + let base_binary = read_file(&base_binary_path)?; drop(temp_dir); // delete the temp dir Ok(base_binary) } @@ -518,15 +527,19 @@ impl<'a> DenoCompileBinaryWriter<'a> { let bytes = match maybe_bytes { Some(bytes) => bytes, None => { - log::info!("Download could not be found, aborting"); - deno_runtime::exit(1); + bail!("Download could not be found, aborting"); } }; - std::fs::create_dir_all(output_directory)?; + let create_dir_all = |dir: &Path| { + std::fs::create_dir_all(dir) + .with_context(|| format!("Creating {}", dir.display())) + }; + create_dir_all(output_directory)?; let output_path = output_directory.join(binary_path_suffix); - std::fs::create_dir_all(output_path.parent().unwrap())?; - tokio::fs::write(output_path, bytes).await?; + create_dir_all(output_path.parent().unwrap())?; + std::fs::write(&output_path, bytes) + .with_context(|| format!("Writing {}", output_path.display()))?; Ok(()) } @@ -540,73 +553,79 @@ impl<'a> DenoCompileBinaryWriter<'a> { graph: &ModuleGraph, root_dir_url: StandaloneRelativeFileBaseUrl<'_>, entrypoint: &ModuleSpecifier, - cli_options: &CliOptions, + include_files: &[ModuleSpecifier], compile_flags: &CompileFlags, ) -> Result<(), AnyError> { - let ca_data = match cli_options.ca_data() { + let ca_data = match self.cli_options.ca_data() { Some(CaData::File(ca_file)) => Some( - std::fs::read(ca_file) - .with_context(|| format!("Reading: {ca_file}"))?, + std::fs::read(ca_file).with_context(|| format!("Reading {ca_file}"))?, ), Some(CaData::Bytes(bytes)) => Some(bytes.clone()), None => None, }; let root_path = root_dir_url.inner().to_file_path().unwrap(); - let (maybe_npm_vfs, node_modules, npm_snapshot) = match self - .npm_resolver - .as_inner() - { - InnerCliNpmResolverRef::Managed(managed) => { - let snapshot = - managed.serialized_valid_snapshot_for_system(&self.npm_system_info); - if !snapshot.as_serialized().packages.is_empty() { - let npm_vfs_builder = self.build_npm_vfs(&root_path, cli_options)?; + let (maybe_npm_vfs, node_modules, npm_snapshot) = + match self.npm_resolver.as_inner() { + InnerCliNpmResolverRef::Managed(managed) => { + let snapshot = + managed.serialized_valid_snapshot_for_system(&self.npm_system_info); + if !snapshot.as_serialized().packages.is_empty() { + let npm_vfs_builder = self + .build_npm_vfs(&root_path) + .context("Building npm vfs.")?; + ( + Some(npm_vfs_builder), + Some(NodeModules::Managed { + node_modules_dir: self + .npm_resolver + .root_node_modules_path() + .map(|path| { + root_dir_url + .specifier_key( + &ModuleSpecifier::from_directory_path(path).unwrap(), + ) + .into_owned() + }), + }), + Some(snapshot), + ) + } else { + (None, None, None) + } + } + InnerCliNpmResolverRef::Byonm(resolver) => { + let npm_vfs_builder = self.build_npm_vfs(&root_path)?; ( Some(npm_vfs_builder), - Some(NodeModules::Managed { - node_modules_dir: self.npm_resolver.root_node_modules_path().map( - |path| { + Some(NodeModules::Byonm { + root_node_modules_dir: resolver.root_node_modules_path().map( + |node_modules_dir| { root_dir_url .specifier_key( - &ModuleSpecifier::from_directory_path(path).unwrap(), + &ModuleSpecifier::from_directory_path(node_modules_dir) + .unwrap(), ) .into_owned() }, ), }), - Some(snapshot), + None, ) - } else { - (None, None, None) } - } - InnerCliNpmResolverRef::Byonm(resolver) => { - let npm_vfs_builder = self.build_npm_vfs(&root_path, cli_options)?; - ( - Some(npm_vfs_builder), - Some(NodeModules::Byonm { - root_node_modules_dir: resolver.root_node_modules_path().map( - |node_modules_dir| { - root_dir_url - .specifier_key( - &ModuleSpecifier::from_directory_path(node_modules_dir) - .unwrap(), - ) - .into_owned() - }, - ), - }), - None, - ) - } - }; + }; let mut vfs = if let Some(npm_vfs) = maybe_npm_vfs { npm_vfs } else { VfsBuilder::new(root_path.clone())? }; + for include_file in include_files { + let path = deno_path_util::url_to_file_path(include_file)?; + vfs + .add_file_at_path(&path) + .with_context(|| format!("Including {}", path.display()))?; + } let mut remote_modules_store = RemoteModulesStoreBuilder::default(); - let mut code_cache_key_hasher = if cli_options.code_cache_enabled() { + let mut code_cache_key_hasher = if self.cli_options.code_cache_enabled() { Some(FastInsecureHasher::new_deno_versioned()) } else { None @@ -672,7 +691,7 @@ impl<'a> DenoCompileBinaryWriter<'a> { } remote_modules_store.add_redirects(&graph.redirects); - let env_vars_from_env_file = match cli_options.env_file_name() { + let env_vars_from_env_file = match self.cli_options.env_file_name() { Some(env_filenames) => { let mut aggregated_env_vars = IndexMap::new(); for env_filename in env_filenames.iter().rev() { @@ -688,16 +707,17 @@ impl<'a> DenoCompileBinaryWriter<'a> { let metadata = Metadata { argv: compile_flags.args.clone(), - seed: cli_options.seed(), + seed: self.cli_options.seed(), code_cache_key: code_cache_key_hasher.map(|h| h.finish()), - location: cli_options.location_flag().clone(), - permissions: cli_options.permission_flags().clone(), - v8_flags: cli_options.v8_flags().clone(), - unsafely_ignore_certificate_errors: cli_options + location: self.cli_options.location_flag().clone(), + permissions: self.cli_options.permission_flags().clone(), + v8_flags: self.cli_options.v8_flags().clone(), + unsafely_ignore_certificate_errors: self + .cli_options .unsafely_ignore_certificate_errors() .clone(), - log_level: cli_options.log_level(), - ca_stores: cli_options.ca_stores().clone(), + log_level: self.cli_options.log_level(), + ca_stores: self.cli_options.ca_stores().clone(), ca_data, env_vars_from_env_file, entrypoint_key: root_dir_url.specifier_key(entrypoint).into_owned(), @@ -740,11 +760,11 @@ impl<'a> DenoCompileBinaryWriter<'a> { node_modules, unstable_config: UnstableConfig { legacy_flag_enabled: false, - bare_node_builtins: cli_options.unstable_bare_node_builtins(), - sloppy_imports: cli_options.unstable_sloppy_imports(), - features: cli_options.unstable_features(), + bare_node_builtins: self.cli_options.unstable_bare_node_builtins(), + sloppy_imports: self.cli_options.unstable_sloppy_imports(), + features: self.cli_options.unstable_features(), }, - otel_config: cli_options.otel_config(), + otel_config: self.cli_options.otel_config(), }; write_binary_bytes( @@ -756,13 +776,10 @@ impl<'a> DenoCompileBinaryWriter<'a> { vfs, compile_flags, ) + .context("Writing binary bytes") } - fn build_npm_vfs( - &self, - root_path: &Path, - cli_options: &CliOptions, - ) -> Result { + fn build_npm_vfs(&self, root_path: &Path) -> Result { fn maybe_warn_different_system(system_info: &NpmSystemInfo) { if system_info != &NpmSystemInfo::default() { log::warn!("{} The node_modules directory may be incompatible with the target system.", crate::colors::yellow("Warning")); @@ -839,13 +856,18 @@ impl<'a> DenoCompileBinaryWriter<'a> { InnerCliNpmResolverRef::Byonm(_) => { maybe_warn_different_system(&self.npm_system_info); let mut builder = VfsBuilder::new(root_path.to_path_buf())?; - for pkg_json in cli_options.workspace().package_jsons() { + for pkg_json in self.cli_options.workspace().package_jsons() { builder.add_file_at_path(&pkg_json.path)?; } // traverse and add all the node_modules directories in the workspace let mut pending_dirs = VecDeque::new(); pending_dirs.push_back( - cli_options.workspace().root_dir().to_file_path().unwrap(), + self + .cli_options + .workspace() + .root_dir() + .to_file_path() + .unwrap(), ); while let Some(pending_dir) = pending_dirs.pop_front() { let mut entries = fs::read_dir(&pending_dir) diff --git a/cli/standalone/virtual_fs.rs b/cli/standalone/virtual_fs.rs index 26bb0db75f..d1084f016c 100644 --- a/cli/standalone/virtual_fs.rs +++ b/cli/standalone/virtual_fs.rs @@ -51,7 +51,8 @@ pub struct VfsBuilder { impl VfsBuilder { pub fn new(root_path: PathBuf) -> Result { - let root_path = canonicalize_path(&root_path)?; + let root_path = canonicalize_path(&root_path) + .with_context(|| format!("Canonicalizing {}", root_path.display()))?; log::debug!("Building vfs with root '{}'", root_path.display()); Ok(Self { root_dir: VirtualDirectory { diff --git a/cli/tools/compile.rs b/cli/tools/compile.rs index b3e9993379..4fa9963683 100644 --- a/cli/tools/compile.rs +++ b/cli/tools/compile.rs @@ -7,6 +7,7 @@ use crate::factory::CliFactory; use crate::http_util::HttpClientProvider; use crate::standalone::binary::StandaloneRelativeFileBaseUrl; use crate::standalone::is_standalone_binary; +use deno_ast::MediaType; use deno_ast::ModuleSpecifier; use deno_core::anyhow::bail; use deno_core::anyhow::Context; @@ -31,15 +32,12 @@ pub async fn compile( let module_graph_creator = factory.module_graph_creator().await?; let binary_writer = factory.create_compile_binary_writer().await?; let http_client = factory.http_client_provider(); - let module_specifier = cli_options.resolve_main_module()?; - let module_roots = { - let mut vec = Vec::with_capacity(compile_flags.include.len() + 1); - vec.push(module_specifier.clone()); - for side_module in &compile_flags.include { - vec.push(resolve_url_or_path(side_module, cli_options.initial_cwd())?); - } - vec - }; + let entrypoint = cli_options.resolve_main_module()?; + let (module_roots, include_files) = get_module_roots_and_include_files( + entrypoint, + &compile_flags, + cli_options.initial_cwd(), + )?; // this is not supported, so show a warning about it, but don't error in order // to allow someone to still run `deno compile` when this is in a deno.json @@ -82,18 +80,22 @@ pub async fn compile( check_warn_tsconfig(&ts_config_for_emit); let root_dir_url = resolve_root_dir_from_specifiers( cli_options.workspace().root_dir(), - graph.specifiers().map(|(s, _)| s).chain( - cli_options - .node_modules_dir_path() - .and_then(|p| ModuleSpecifier::from_directory_path(p).ok()) - .iter(), - ), + graph + .specifiers() + .map(|(s, _)| s) + .chain( + cli_options + .node_modules_dir_path() + .and_then(|p| ModuleSpecifier::from_directory_path(p).ok()) + .iter(), + ) + .chain(include_files.iter()), ); log::debug!("Binary root dir: {}", root_dir_url); log::info!( "{} {} to {}", colors::green("Compile"), - module_specifier.to_string(), + entrypoint, output_path.display(), ); validate_output_path(&output_path)?; @@ -118,9 +120,9 @@ pub async fn compile( file, &graph, StandaloneRelativeFileBaseUrl::from(&root_dir_url), - module_specifier, + entrypoint, + &include_files, &compile_flags, - cli_options, ) .await .with_context(|| { @@ -212,6 +214,48 @@ fn validate_output_path(output_path: &Path) -> Result<(), AnyError> { Ok(()) } +fn get_module_roots_and_include_files( + entrypoint: &ModuleSpecifier, + compile_flags: &CompileFlags, + initial_cwd: &Path, +) -> Result<(Vec, Vec), AnyError> { + fn is_module_graph_module(url: &ModuleSpecifier) -> bool { + if url.scheme() != "file" { + return true; + } + let media_type = MediaType::from_specifier(url); + match media_type { + MediaType::JavaScript + | MediaType::Jsx + | MediaType::Mjs + | MediaType::Cjs + | MediaType::TypeScript + | MediaType::Mts + | MediaType::Cts + | MediaType::Dts + | MediaType::Dmts + | MediaType::Dcts + | MediaType::Tsx + | MediaType::Json + | MediaType::Wasm => true, + MediaType::Css | MediaType::SourceMap | MediaType::Unknown => false, + } + } + + let mut module_roots = Vec::with_capacity(compile_flags.include.len() + 1); + let mut include_files = Vec::with_capacity(compile_flags.include.len()); + module_roots.push(entrypoint.clone()); + for side_module in &compile_flags.include { + let url = resolve_url_or_path(side_module, initial_cwd)?; + if is_module_graph_module(&url) { + module_roots.push(url); + } else { + include_files.push(url); + } + } + Ok((module_roots, include_files)) +} + async fn resolve_compile_executable_output_path( http_client_provider: &HttpClientProvider, compile_flags: &CompileFlags, diff --git a/tests/specs/compile/include_data_files/__test__.jsonc b/tests/specs/compile/include_data_files/__test__.jsonc new file mode 100644 index 0000000000..5d5d967ca2 --- /dev/null +++ b/tests/specs/compile/include_data_files/__test__.jsonc @@ -0,0 +1,41 @@ +{ + "tempDir": true, + "tests": { + "success": { + "steps": [{ + "if": "unix", + "args": "compile --allow-read=data-file.txt --include data-file.txt --output main main.js", + "output": "[WILDCARD]" + }, { + "if": "unix", + "commandName": "./main", + "args": [], + "output": "output.out", + "exitCode": 0 + }, { + "if": "windows", + "args": "compile --allow-read=data-file.txt --include data-file.txt --output main.exe main.js", + "output": "[WILDCARD]" + }, { + "if": "windows", + "commandName": "./main.exe", + "args": [], + "output": "output.out", + "exitCode": 0 + }] + }, + "non_existent": { + "steps": [{ + "if": "unix", + "args": "compile --include does_not_exist.txt --output main main.js", + "output": "non_existent.out", + "exitCode": 1 + }, { + "if": "windows", + "args": "compile --include does_not_exist.txt --output main.exe main.js", + "output": "non_existent.out", + "exitCode": 1 + }] + } + } +} diff --git a/tests/specs/compile/include_data_files/data-file.txt b/tests/specs/compile/include_data_files/data-file.txt new file mode 100644 index 0000000000..b14df6442e --- /dev/null +++ b/tests/specs/compile/include_data_files/data-file.txt @@ -0,0 +1 @@ +Hi diff --git a/tests/specs/compile/include_data_files/main.js b/tests/specs/compile/include_data_files/main.js new file mode 100644 index 0000000000..4c1f1e98d5 --- /dev/null +++ b/tests/specs/compile/include_data_files/main.js @@ -0,0 +1 @@ +console.log(Deno.readTextFileSync("./data-file.txt").trim()); diff --git a/tests/specs/compile/include_data_files/non_existent.out b/tests/specs/compile/include_data_files/non_existent.out new file mode 100644 index 0000000000..a88b441ba8 --- /dev/null +++ b/tests/specs/compile/include_data_files/non_existent.out @@ -0,0 +1,6 @@ +Compile file:///[WILDLINE]/main.js to [WILDLINE] +error: Writing deno compile executable to temporary file 'main[WILDLINE]' + +Caused by: + 0: Including [WILDLINE]does_not_exist.txt + 1: [WILDLINE] diff --git a/tests/specs/compile/include_data_files/output.out b/tests/specs/compile/include_data_files/output.out new file mode 100644 index 0000000000..b14df6442e --- /dev/null +++ b/tests/specs/compile/include_data_files/output.out @@ -0,0 +1 @@ +Hi From 6b478cd0a3fdff15d5d9d8849a3019652b919921 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 19 Nov 2024 18:20:14 -0500 Subject: [PATCH 112/227] feat(compile): ability to embed directory in executable (#26939) --- cli/args/flags.rs | 6 ++--- cli/standalone/binary.rs | 14 ++++++++--- .../compile/include_folder/__test__.jsonc | 24 +++++++++++++++++++ tests/specs/compile/include_folder/data/a.txt | 1 + tests/specs/compile/include_folder/data/b.txt | 1 + tests/specs/compile/include_folder/main.js | 8 +++++++ tests/specs/compile/include_folder/output.out | 2 ++ 7 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 tests/specs/compile/include_folder/__test__.jsonc create mode 100644 tests/specs/compile/include_folder/data/a.txt create mode 100644 tests/specs/compile/include_folder/data/b.txt create mode 100644 tests/specs/compile/include_folder/main.js create mode 100644 tests/specs/compile/include_folder/output.out diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 85b8abefe1..f40d5aed41 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -1909,10 +1909,10 @@ On the first invocation with deno will download the proper binary and cache it i Arg::new("include") .long("include") .help( - cstr!("Includes an additional module or local data file in the compiled executable. + cstr!("Includes an additional module or file/directory in the compiled executable. Use this flag if a dynamically imported module or a web worker main module - fails to load in the executable or to embed a file in the executable. This flag can - be passed multiple times, to include multiple additional modules.", + fails to load in the executable or to embed a file or directory in the executable. + This flag can be passed multiple times, to include multiple additional modules.", )) .action(ArgAction::Append) .value_hint(ValueHint::FilePath) diff --git a/cli/standalone/binary.rs b/cli/standalone/binary.rs index 8153993137..39e508dc3b 100644 --- a/cli/standalone/binary.rs +++ b/cli/standalone/binary.rs @@ -620,9 +620,17 @@ impl<'a> DenoCompileBinaryWriter<'a> { }; for include_file in include_files { let path = deno_path_util::url_to_file_path(include_file)?; - vfs - .add_file_at_path(&path) - .with_context(|| format!("Including {}", path.display()))?; + if path.is_dir() { + // TODO(#26941): we should analyze if any of these are + // modules in order to include their dependencies + vfs + .add_dir_recursive(&path) + .with_context(|| format!("Including {}", path.display()))?; + } else { + vfs + .add_file_at_path(&path) + .with_context(|| format!("Including {}", path.display()))?; + } } let mut remote_modules_store = RemoteModulesStoreBuilder::default(); let mut code_cache_key_hasher = if self.cli_options.code_cache_enabled() { diff --git a/tests/specs/compile/include_folder/__test__.jsonc b/tests/specs/compile/include_folder/__test__.jsonc new file mode 100644 index 0000000000..eeaea53b65 --- /dev/null +++ b/tests/specs/compile/include_folder/__test__.jsonc @@ -0,0 +1,24 @@ +{ + "tempDir": true, + "steps": [{ + "if": "unix", + "args": "compile --allow-read=data --include data --output main main.js", + "output": "[WILDCARD]" + }, { + "if": "unix", + "commandName": "./main", + "args": [], + "output": "output.out", + "exitCode": 0 + }, { + "if": "windows", + "args": "compile --allow-read=data --include data --output main.exe main.js", + "output": "[WILDCARD]" + }, { + "if": "windows", + "commandName": "./main.exe", + "args": [], + "output": "output.out", + "exitCode": 0 + }] +} diff --git a/tests/specs/compile/include_folder/data/a.txt b/tests/specs/compile/include_folder/data/a.txt new file mode 100644 index 0000000000..7898192261 --- /dev/null +++ b/tests/specs/compile/include_folder/data/a.txt @@ -0,0 +1 @@ +a diff --git a/tests/specs/compile/include_folder/data/b.txt b/tests/specs/compile/include_folder/data/b.txt new file mode 100644 index 0000000000..6178079822 --- /dev/null +++ b/tests/specs/compile/include_folder/data/b.txt @@ -0,0 +1 @@ +b diff --git a/tests/specs/compile/include_folder/main.js b/tests/specs/compile/include_folder/main.js new file mode 100644 index 0000000000..831d26167f --- /dev/null +++ b/tests/specs/compile/include_folder/main.js @@ -0,0 +1,8 @@ +const dataDir = import.meta.dirname + "/data"; +const files = Array.from( + Deno.readDirSync(dataDir).map((entry) => dataDir + "/" + entry.name), +); +files.sort(); +for (const file of files) { + console.log(Deno.readTextFileSync(file).trim()); +} diff --git a/tests/specs/compile/include_folder/output.out b/tests/specs/compile/include_folder/output.out new file mode 100644 index 0000000000..422c2b7ab3 --- /dev/null +++ b/tests/specs/compile/include_folder/output.out @@ -0,0 +1,2 @@ +a +b From 8be2bbf074c7b32647a56d97f1c340fcab52c4aa Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 19 Nov 2024 18:59:23 -0500 Subject: [PATCH 113/227] feat: Wasm module support (#26668) Support for Wasm modules. Note this implements the standard where the default export is the instance (not the module). The module will come later with source phase imports. ```ts import { add } from "./math.wasm"; console.log(add(1, 2)); ``` --- Cargo.lock | 14 ++--- Cargo.toml | 2 +- cli/args/mod.rs | 4 ++ cli/errors.rs | 2 +- cli/lsp/documents.rs | 38 +++++++++++-- cli/lsp/tsc.rs | 2 +- cli/module_loader.rs | 16 ++++-- cli/standalone/binary.rs | 4 +- cli/tools/check.rs | 8 ++- cli/tools/info.rs | 24 ++++++--- cli/tools/registry/mod.rs | 8 ++- cli/tsc/99_main_compiler.js | 6 +++ cli/tsc/mod.rs | 11 ++-- ext/node/polyfills/01_require.js | 10 ++-- runtime/worker.rs | 2 +- tests/integration/lsp_tests.rs | 50 ++++++++++++++++-- tests/specs/check/wasm/__test__.jsonc | 5 ++ tests/specs/check/wasm/check.out | 6 +++ tests/specs/check/wasm/main.ts | 3 ++ tests/specs/doc/wasm/__test__.jsonc | 4 ++ tests/specs/doc/wasm/doc.out | 21 ++++++++ tests/specs/info/wasm_module/__test__.jsonc | 4 ++ tests/specs/info/wasm_module/main.js | 7 +++ tests/specs/info/wasm_module/main.out | 10 ++++ .../wasm_module/cjs_importing/__test__.jsonc | 12 +++++ .../run/wasm_module/cjs_importing/main.cjs | 5 ++ .../run/wasm_module/cjs_importing/main.cts | 4 ++ .../run/wasm_module/cjs_importing/main.out | 3 ++ .../run/wasm_module/cjs_importing/math.wasm | Bin 0 -> 318 bytes .../wasm_module/cjs_importing/package.json | 4 ++ .../run/wasm_module/cjs_importing/setup.ts | 7 +++ .../import_file_not_found/__test__.jsonc | 5 ++ .../import_file_not_found/deno.jsonc | 9 ++++ .../wasm_module/import_file_not_found/main.js | 7 +++ .../import_file_not_found/main.out | 3 ++ .../__test__.jsonc | 5 ++ .../import_named_export_not_found/deno.jsonc | 8 +++ .../local_math.ts | 7 +++ .../import_named_export_not_found/main.js | 7 +++ .../import_named_export_not_found/main.out | 3 ++ .../run/wasm_module/imports/__test__.jsonc | 4 ++ tests/specs/run/wasm_module/imports/main.js | 7 +++ tests/specs/run/wasm_module/imports/main.out | 4 ++ .../integrity_check_failed/__test__.jsonc | 5 ++ .../integrity_check_failed/deno.json | 2 + .../integrity_check_failed/deno.lock | 6 +++ .../integrity_check_failed/main.js | 4 ++ .../integrity_check_failed/main.out | 12 +++++ .../map_imports_via_import_map/__test__.jsonc | 4 ++ .../map_imports_via_import_map/deno.json | 8 +++ .../map_imports_via_import_map/local_math.ts | 7 +++ .../map_imports_via_import_map/main.js | 7 +++ .../map_imports_via_import_map/main.out | 3 ++ .../run/wasm_module/no_imports/__test__.jsonc | 4 ++ .../specs/run/wasm_module/no_imports/main.out | 3 ++ .../specs/run/wasm_module/no_imports/main.ts | 4 ++ tests/testdata/wasm/math.ts | 8 +++ tests/testdata/wasm/math.wasm | Bin 0 -> 318 bytes tests/testdata/wasm/math_with_import.wasm | Bin 0 -> 449 bytes tests/util/server/src/lib.rs | 5 ++ 60 files changed, 401 insertions(+), 46 deletions(-) create mode 100644 tests/specs/check/wasm/__test__.jsonc create mode 100644 tests/specs/check/wasm/check.out create mode 100644 tests/specs/check/wasm/main.ts create mode 100644 tests/specs/doc/wasm/__test__.jsonc create mode 100644 tests/specs/doc/wasm/doc.out create mode 100644 tests/specs/info/wasm_module/__test__.jsonc create mode 100644 tests/specs/info/wasm_module/main.js create mode 100644 tests/specs/info/wasm_module/main.out create mode 100644 tests/specs/run/wasm_module/cjs_importing/__test__.jsonc create mode 100644 tests/specs/run/wasm_module/cjs_importing/main.cjs create mode 100644 tests/specs/run/wasm_module/cjs_importing/main.cts create mode 100644 tests/specs/run/wasm_module/cjs_importing/main.out create mode 100644 tests/specs/run/wasm_module/cjs_importing/math.wasm create mode 100644 tests/specs/run/wasm_module/cjs_importing/package.json create mode 100644 tests/specs/run/wasm_module/cjs_importing/setup.ts create mode 100644 tests/specs/run/wasm_module/import_file_not_found/__test__.jsonc create mode 100644 tests/specs/run/wasm_module/import_file_not_found/deno.jsonc create mode 100644 tests/specs/run/wasm_module/import_file_not_found/main.js create mode 100644 tests/specs/run/wasm_module/import_file_not_found/main.out create mode 100644 tests/specs/run/wasm_module/import_named_export_not_found/__test__.jsonc create mode 100644 tests/specs/run/wasm_module/import_named_export_not_found/deno.jsonc create mode 100644 tests/specs/run/wasm_module/import_named_export_not_found/local_math.ts create mode 100644 tests/specs/run/wasm_module/import_named_export_not_found/main.js create mode 100644 tests/specs/run/wasm_module/import_named_export_not_found/main.out create mode 100644 tests/specs/run/wasm_module/imports/__test__.jsonc create mode 100644 tests/specs/run/wasm_module/imports/main.js create mode 100644 tests/specs/run/wasm_module/imports/main.out create mode 100644 tests/specs/run/wasm_module/integrity_check_failed/__test__.jsonc create mode 100644 tests/specs/run/wasm_module/integrity_check_failed/deno.json create mode 100644 tests/specs/run/wasm_module/integrity_check_failed/deno.lock create mode 100644 tests/specs/run/wasm_module/integrity_check_failed/main.js create mode 100644 tests/specs/run/wasm_module/integrity_check_failed/main.out create mode 100644 tests/specs/run/wasm_module/map_imports_via_import_map/__test__.jsonc create mode 100644 tests/specs/run/wasm_module/map_imports_via_import_map/deno.json create mode 100644 tests/specs/run/wasm_module/map_imports_via_import_map/local_math.ts create mode 100644 tests/specs/run/wasm_module/map_imports_via_import_map/main.js create mode 100644 tests/specs/run/wasm_module/map_imports_via_import_map/main.out create mode 100644 tests/specs/run/wasm_module/no_imports/__test__.jsonc create mode 100644 tests/specs/run/wasm_module/no_imports/main.out create mode 100644 tests/specs/run/wasm_module/no_imports/main.ts create mode 100644 tests/testdata/wasm/math.ts create mode 100644 tests/testdata/wasm/math.wasm create mode 100644 tests/testdata/wasm/math_with_import.wasm diff --git a/Cargo.lock b/Cargo.lock index 1a16714bba..52bb39ee83 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1466,9 +1466,9 @@ dependencies = [ [[package]] name = "deno_core" -version = "0.320.0" +version = "0.321.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f285eed7b072749f9c3a9c4cf2c9ebb06462a2c22afec94892a6684c38f32696" +checksum = "cd2a54cda74cdc187d5fc2d23370a45cf09f912caf566dd1cd24a50157d809c7" dependencies = [ "anyhow", "bincode", @@ -1480,6 +1480,7 @@ dependencies = [ "deno_ops", "deno_unsync", "futures", + "indexmap 2.3.0", "libc", "memoffset", "parking_lot", @@ -1494,6 +1495,7 @@ dependencies = [ "tokio", "url", "v8", + "wasm_dep_analyzer", ] [[package]] @@ -1981,9 +1983,9 @@ dependencies = [ [[package]] name = "deno_ops" -version = "0.196.0" +version = "0.197.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d35c75ae05062f37ec2ae5fd1d99b2dcdfa0aef70844d3706759b8775056c5f6" +checksum = "37a8825d92301cf445727c43f17fee2a20fcdf4370004339965156ae7c56c97e" dependencies = [ "proc-macro-rules", "proc-macro2", @@ -6517,9 +6519,9 @@ dependencies = [ [[package]] name = "serde_v8" -version = "0.229.0" +version = "0.230.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e1dbbda82d67a393ea96f75d8383bc41fcd0bba43164aeaab599e1c2c2d46d7" +checksum = "b5a783242d2af51d6955cc04bf2b64adb643ab588b61e9573c908a69dabf8c2f" dependencies = [ "num-bigint", "serde", diff --git a/Cargo.toml b/Cargo.toml index cfe67ba692..cf7e2610bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ repository = "https://github.com/denoland/deno" [workspace.dependencies] deno_ast = { version = "=0.43.3", features = ["transpiling"] } -deno_core = { version = "0.320.0" } +deno_core = { version = "0.321.0" } deno_bench_util = { version = "0.171.0", path = "./bench_util" } deno_config = { version = "=0.39.1", features = ["workspace", "sync"] } diff --git a/cli/args/mod.rs b/cli/args/mod.rs index 61e1443a75..21df6cf115 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1548,6 +1548,10 @@ impl CliOptions { }) => Url::parse(&flags.module_url) .ok() .map(|url| vec![Cow::Owned(url)]), + DenoSubcommand::Doc(DocFlags { + source_files: DocSourceFileFlag::Paths(paths), + .. + }) => Some(files_to_urls(paths)), _ => None, }) .unwrap_or_default(); diff --git a/cli/errors.rs b/cli/errors.rs index cf23ccd0e0..38dc8259e3 100644 --- a/cli/errors.rs +++ b/cli/errors.rs @@ -38,6 +38,7 @@ fn get_module_graph_error_class(err: &ModuleGraphError) -> &'static str { ModuleGraphError::ModuleError(err) => match err { ModuleError::InvalidTypeAssertion { .. } => "SyntaxError", ModuleError::ParseErr(_, diagnostic) => get_diagnostic_class(diagnostic), + ModuleError::WasmParseErr(..) => "SyntaxError", ModuleError::UnsupportedMediaType { .. } | ModuleError::UnsupportedImportAttributeType { .. } => "TypeError", ModuleError::Missing(_, _) | ModuleError::MissingDynamic(_, _) => { @@ -71,7 +72,6 @@ fn get_module_graph_error_class(err: &ModuleGraphError) -> &'static str { | JsrLoadError::UnknownExport { .. } => "NotFound", }, }, - ModuleError::WasmParseErr(_, _) => "SyntaxError", }, } } diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs index b01544ddf9..cdc25f3ac3 100644 --- a/cli/lsp/documents.rs +++ b/cli/lsp/documents.rs @@ -883,8 +883,13 @@ impl FileSystemDocuments { let doc = if specifier.scheme() == "file" { let path = url_to_file_path(specifier).ok()?; let bytes = fs::read(path).ok()?; - let content = - deno_graph::source::decode_owned_source(specifier, bytes, None).ok()?; + let content = bytes_to_content( + specifier, + MediaType::from_specifier(specifier), + bytes, + None, + ) + .ok()?; Document::new( specifier.clone(), content.into(), @@ -923,19 +928,24 @@ impl FileSystemDocuments { specifier, Some(&cached_file.metadata.headers), ); - let content = deno_graph::source::decode_owned_source( + let media_type = resolve_media_type( specifier, + Some(&cached_file.metadata.headers), + None, + ); + let content = bytes_to_content( + specifier, + media_type, cached_file.content, maybe_charset, ) .ok()?; - let maybe_headers = Some(cached_file.metadata.headers); Document::new( specifier.clone(), content.into(), None, None, - maybe_headers, + Some(cached_file.metadata.headers), is_cjs_resolver, resolver.clone(), config.clone(), @@ -1706,6 +1716,24 @@ fn analyze_module( } } +fn bytes_to_content( + specifier: &ModuleSpecifier, + media_type: MediaType, + bytes: Vec, + maybe_charset: Option<&str>, +) -> Result { + if media_type == MediaType::Wasm { + // we use the dts representation for Wasm modules + Ok(deno_graph::source::wasm::wasm_module_to_dts(&bytes)?) + } else { + Ok(deno_graph::source::decode_owned_source( + specifier, + bytes, + maybe_charset, + )?) + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index fc7ff57948..c221a6097b 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -5609,7 +5609,7 @@ mod tests { let (_tx, rx) = mpsc::unbounded_channel(); let state = State::new(state_snapshot, Default::default(), Default::default(), rx); - let mut op_state = OpState::new(None); + let mut op_state = OpState::new(None, None); op_state.put(state); op_state } diff --git a/cli/module_loader.rs b/cli/module_loader.rs index f985286d69..035ae4264b 100644 --- a/cli/module_loader.rs +++ b/cli/module_loader.rs @@ -66,6 +66,7 @@ use deno_graph::JsonModule; use deno_graph::Module; use deno_graph::ModuleGraph; use deno_graph::Resolution; +use deno_graph::WasmModule; use deno_runtime::code_cache; use deno_runtime::deno_fs::FileSystem; use deno_runtime::deno_node::create_host_defined_options; @@ -368,7 +369,9 @@ impl requested_module_type: RequestedModuleType, ) -> Result { let code_source = self.load_code_source(specifier, maybe_referrer).await?; - let code = if self.shared.is_inspecting { + let code = if self.shared.is_inspecting + || code_source.media_type == MediaType::Wasm + { // we need the code with the source map in order for // it to work with --inspect or --inspect-brk code_source.code @@ -378,6 +381,7 @@ impl }; let module_type = match code_source.media_type { MediaType::Json => ModuleType::Json, + MediaType::Wasm => ModuleType::Wasm, _ => ModuleType::JavaScript, }; @@ -545,6 +549,7 @@ impl Some(Module::Node(module)) => module.specifier.clone(), Some(Module::Js(module)) => module.specifier.clone(), Some(Module::Json(module)) => module.specifier.clone(), + Some(Module::Wasm(module)) => module.specifier.clone(), Some(Module::External(module)) => { node::resolve_specifier_into_node_modules( &module.specifier, @@ -552,7 +557,6 @@ impl ) } None => specifier.into_owned(), - Some(Module::Wasm(_)) => todo!("@dsherret"), }; Ok(specifier) } @@ -717,13 +721,19 @@ impl media_type: *media_type, }))) } + Some(deno_graph::Module::Wasm(WasmModule { + source, specifier, .. + })) => Ok(Some(CodeOrDeferredEmit::Code(ModuleCodeStringSource { + code: ModuleSourceCode::Bytes(source.clone().into()), + found_url: specifier.clone(), + media_type: MediaType::Wasm, + }))), Some( deno_graph::Module::External(_) | deno_graph::Module::Node(_) | deno_graph::Module::Npm(_), ) | None => Ok(None), - Some(deno_graph::Module::Wasm(_)) => todo!("@dsherret"), } } diff --git a/cli/standalone/binary.rs b/cli/standalone/binary.rs index 39e508dc3b..e35119e0aa 100644 --- a/cli/standalone/binary.rs +++ b/cli/standalone/binary.rs @@ -675,10 +675,12 @@ impl<'a> DenoCompileBinaryWriter<'a> { deno_graph::Module::Json(m) => { (Some(m.source.as_bytes().to_vec()), m.media_type) } + deno_graph::Module::Wasm(m) => { + (Some(m.source.to_vec()), MediaType::Wasm) + } deno_graph::Module::Npm(_) | deno_graph::Module::Node(_) | deno_graph::Module::External(_) => (None, MediaType::Unknown), - deno_graph::Module::Wasm(_) => todo!("@dsherret"), }; if module.specifier().scheme() == "file" { let file_path = deno_path_util::url_to_file_path(module.specifier())?; diff --git a/cli/tools/check.rs b/cli/tools/check.rs index f7a488bb45..ad5c7c3ab1 100644 --- a/cli/tools/check.rs +++ b/cli/tools/check.rs @@ -380,10 +380,14 @@ fn get_check_hash( hasher.write_str(module.specifier.as_str()); hasher.write_str(&module.source); } + Module::Wasm(module) => { + has_file_to_type_check = true; + hasher.write_str(module.specifier.as_str()); + hasher.write_str(&module.source_dts); + } Module::External(module) => { hasher.write_str(module.specifier.as_str()); } - Module::Wasm(_) => todo!("@dsherret"), } } @@ -438,11 +442,11 @@ fn get_tsc_roots( | MediaType::SourceMap | MediaType::Unknown => None, }, + Module::Wasm(module) => Some((module.specifier.clone(), MediaType::Dmts)), Module::External(_) | Module::Node(_) | Module::Npm(_) | Module::Json(_) => None, - Module::Wasm(_) => todo!("@dsherret"), } } diff --git a/cli/tools/info.rs b/cli/tools/info.rs index a417a60179..6cddf96995 100644 --- a/cli/tools/info.rs +++ b/cli/tools/info.rs @@ -446,8 +446,8 @@ impl<'a> GraphDisplayContext<'a> { let maybe_cache_info = match root { Module::Js(module) => module.maybe_cache_info.as_ref(), Module::Json(module) => module.maybe_cache_info.as_ref(), + Module::Wasm(module) => module.maybe_cache_info.as_ref(), Module::Node(_) | Module::Npm(_) | Module::External(_) => None, - Module::Wasm(_) => todo!("@dsherret"), }; if let Some(cache_info) = maybe_cache_info { if let Some(local) = &cache_info.local { @@ -469,8 +469,8 @@ impl<'a> GraphDisplayContext<'a> { let size = match m { Module::Js(module) => module.size(), Module::Json(module) => module.size(), + Module::Wasm(module) => module.size(), Module::Node(_) | Module::Npm(_) | Module::External(_) => 0, - Module::Wasm(_) => todo!("@dsherret"), }; size as f64 }) @@ -569,8 +569,8 @@ impl<'a> GraphDisplayContext<'a> { Specifier(_) => match module { Module::Js(module) => Some(module.size() as u64), Module::Json(module) => Some(module.size() as u64), + Module::Wasm(module) => Some(module.size() as u64), Module::Node(_) | Module::Npm(_) | Module::External(_) => None, - Module::Wasm(_) => todo!("@dsherret"), }, }; format!("{} {}", header_text, maybe_size_to_text(maybe_size)) @@ -583,8 +583,8 @@ impl<'a> GraphDisplayContext<'a> { Package(package) => { tree_node.children.extend(self.build_npm_deps(package)); } - Specifier(_) => { - if let Some(module) = module.js() { + Specifier(_) => match module { + Module::Js(module) => { if let Some(types_dep) = &module.maybe_types_dependency { if let Some(child) = self.build_resolved_info(&types_dep.dependency, true) @@ -596,7 +596,16 @@ impl<'a> GraphDisplayContext<'a> { tree_node.children.extend(self.build_dep_info(dep)); } } - } + Module::Wasm(module) => { + for dep in module.dependencies.values() { + tree_node.children.extend(self.build_dep_info(dep)); + } + } + Module::Json(_) + | Module::Npm(_) + | Module::Node(_) + | Module::External(_) => {} + }, } } tree_node @@ -661,7 +670,7 @@ impl<'a> GraphDisplayContext<'a> { }; self.build_error_msg(specifier, message.as_ref()) } - ModuleError::ParseErr(_, _) => { + ModuleError::ParseErr(_, _) | ModuleError::WasmParseErr(_, _) => { self.build_error_msg(specifier, "(parsing error)") } ModuleError::UnsupportedImportAttributeType { .. } => { @@ -673,7 +682,6 @@ impl<'a> GraphDisplayContext<'a> { ModuleError::Missing(_, _) | ModuleError::MissingDynamic(_, _) => { self.build_error_msg(specifier, "(missing)") } - ModuleError::WasmParseErr(_, _) => todo!("@dsherret"), } } diff --git a/cli/tools/registry/mod.rs b/cli/tools/registry/mod.rs index 35317e12da..dec3c1afeb 100644 --- a/cli/tools/registry/mod.rs +++ b/cli/tools/registry/mod.rs @@ -26,7 +26,6 @@ use deno_core::serde_json; use deno_core::serde_json::json; use deno_core::serde_json::Value; use deno_core::url::Url; -use deno_graph::Module; use deno_terminal::colors; use http_body_util::BodyExt; use serde::Deserialize; @@ -1108,13 +1107,12 @@ fn collect_excluded_module_diagnostics( let graph_specifiers = graph .modules() .filter_map(|m| match m { - deno_graph::Module::Js(_) | deno_graph::Module::Json(_) => { - Some(m.specifier()) - } + deno_graph::Module::Js(_) + | deno_graph::Module::Json(_) + | deno_graph::Module::Wasm(_) => Some(m.specifier()), deno_graph::Module::Npm(_) | deno_graph::Module::Node(_) | deno_graph::Module::External(_) => None, - Module::Wasm(_) => todo!("@dsherret"), }) .filter(|s| s.as_str().starts_with(root.as_str())); for specifier in graph_specifiers { diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index 68d099253a..93b9e92d89 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -450,6 +450,12 @@ delete Object.prototype.__proto__; // We specify the resolution mode to be CommonJS for some npm files and this // diagnostic gets generated even though we're using custom module resolution. 1452, + // Module '...' cannot be imported using this construct. The specifier only resolves to an + // ES module, which cannot be imported with 'require'. + 1471, + // TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; + // however, the referenced file is an ECMAScript module and cannot be imported with 'require'. + 1479, // TS2306: File '.../index.d.ts' is not a module. // We get this for `x-typescript-types` declaration files which don't export // anything. We prefer to treat these as modules with no exports. diff --git a/cli/tsc/mod.rs b/cli/tsc/mod.rs index c9f726ca28..976d407c15 100644 --- a/cli/tsc/mod.rs +++ b/cli/tsc/mod.rs @@ -650,6 +650,10 @@ fn op_load_inner( media_type = MediaType::Json; Some(Cow::Borrowed(&*module.source)) } + Module::Wasm(module) => { + media_type = MediaType::Dts; + Some(Cow::Borrowed(&*module.source_dts)) + } Module::Npm(_) | Module::Node(_) => None, Module::External(module) => { // means it's Deno code importing an npm module @@ -664,7 +668,6 @@ fn op_load_inner( &mut is_cjs, )?)) } - Module::Wasm(_) => todo!("@dsherret"), } } else if let Some(npm) = state .maybe_npm @@ -890,6 +893,9 @@ fn resolve_graph_specifier_types( Some(Module::Json(module)) => { Ok(Some((module.specifier.clone(), module.media_type))) } + Some(Module::Wasm(module)) => { + Ok(Some((module.specifier.clone(), MediaType::Dmts))) + } Some(Module::Npm(module)) => { if let Some(npm) = &state.maybe_npm.as_ref() { let package_folder = npm @@ -929,7 +935,6 @@ fn resolve_graph_specifier_types( })) } Some(Module::Node(_)) | None => Ok(None), - Some(Module::Wasm(_)) => todo!("@dsherret"), } } @@ -1198,7 +1203,7 @@ mod tests { .context("Unable to get CWD") .unwrap(), ); - let mut op_state = OpState::new(None); + let mut op_state = OpState::new(None, None); op_state.put(state); op_state } diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js index 083d4e49be..db032014c2 100644 --- a/ext/node/polyfills/01_require.js +++ b/ext/node/polyfills/01_require.js @@ -1086,12 +1086,10 @@ function loadESMFromCJS(module, filename, code) { module.exports = namespace; } -Module._extensions[".mjs"] = Module._extensions[".mts"] = function ( - module, - filename, -) { - loadESMFromCJS(module, filename); -}; +Module._extensions[".mjs"] = + Module._extensions[".mts"] = + Module._extensions[".wasm"] = + loadESMFromCJS; function stripBOM(content) { if (StringPrototypeCharCodeAt(content, 0) === 0xfeff) { diff --git a/runtime/worker.rs b/runtime/worker.rs index 909147df9b..97cbb6428f 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -78,7 +78,7 @@ pub fn validate_import_attributes_callback( for (key, value) in attributes { let msg = if key != "type" { Some(format!("\"{key}\" attribute is not supported.")) - } else if value != "json" { + } else if value != "json" && value != "$$deno-core-internal-wasm-module" { Some(format!("\"{value}\" is not a valid module type.")) } else { None diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 8eaccb5487..b716aa921e 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -5427,7 +5427,8 @@ fn lsp_code_actions_deno_cache() { let res = client - .write_request( "textDocument/codeAction", + .write_request( + "textDocument/codeAction", json!({ "textDocument": { "uri": "file:///a/file.ts" @@ -5453,8 +5454,7 @@ fn lsp_code_actions_deno_cache() { "only": ["quickfix"] } }), - ) - ; + ); assert_eq!( res, json!([{ @@ -16516,3 +16516,47 @@ fn lsp_jsdoc_named_example() { }), ); } + +#[test] +fn lsp_wasm_module() { + let context = TestContextBuilder::new() + .use_temp_cwd() + .use_http_server() + .build(); + let mut client = context.new_lsp_command().build(); + client.initialize_default(); + client.did_open(json!({ + "textDocument": { + "uri": "file:///a/file.ts", + "languageId": "typescript", + "version": 1, + "text": "import { add } from \"http://localhost:4545/wasm/math.wasm\";\nadd(1, '');\n" + } + })); + + client.write_request( + "workspace/executeCommand", + json!({ + "command": "deno.cache", + "arguments": [[], "file:///a/file.ts"], + }), + ); + + let diagnostics = client.read_diagnostics(); + assert_eq!( + json!(diagnostics.all()), + json!([ + { + "range": { + "start": { "line": 1, "character": 7 }, + "end": { "line": 1, "character": 9 } + }, + "severity": 1, + "code": 2345, + "source": "deno-ts", + "message": "Argument of type 'string' is not assignable to parameter of type 'number'." + } + ]) + ); + client.shutdown(); +} diff --git a/tests/specs/check/wasm/__test__.jsonc b/tests/specs/check/wasm/__test__.jsonc new file mode 100644 index 0000000000..cb11ce33bd --- /dev/null +++ b/tests/specs/check/wasm/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check --allow-import main.ts", + "output": "check.out", + "exitCode": 1 +} diff --git a/tests/specs/check/wasm/check.out b/tests/specs/check/wasm/check.out new file mode 100644 index 0000000000..b3a23646db --- /dev/null +++ b/tests/specs/check/wasm/check.out @@ -0,0 +1,6 @@ +Download http://localhost:4545/wasm/math.wasm +Check file:///[WILDLINE]/main.ts +error: TS2345 [ERROR]: Argument of type 'string' is not assignable to parameter of type 'number'. +console.log(add(1, "")); + ~~ + at file:///[WILDLINE]/main.ts:3:20 diff --git a/tests/specs/check/wasm/main.ts b/tests/specs/check/wasm/main.ts new file mode 100644 index 0000000000..64a8f64d8d --- /dev/null +++ b/tests/specs/check/wasm/main.ts @@ -0,0 +1,3 @@ +import { add } from "http://localhost:4545/wasm/math.wasm"; + +console.log(add(1, "")); diff --git a/tests/specs/doc/wasm/__test__.jsonc b/tests/specs/doc/wasm/__test__.jsonc new file mode 100644 index 0000000000..967bd08ea3 --- /dev/null +++ b/tests/specs/doc/wasm/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "doc http://localhost:4545/wasm/math.wasm", + "output": "doc.out" +} diff --git a/tests/specs/doc/wasm/doc.out b/tests/specs/doc/wasm/doc.out new file mode 100644 index 0000000000..9e93f1b938 --- /dev/null +++ b/tests/specs/doc/wasm/doc.out @@ -0,0 +1,21 @@ +Download http://localhost:4545/wasm/math.wasm +Defined in http://localhost:4545/wasm/math.wasm:2:1 + +function add(arg0: number, arg1: number): number + +Defined in http://localhost:4545/wasm/math.wasm:3:1 + +function subtract(arg0: number, arg1: number): number + +Defined in http://localhost:4545/wasm/math.wasm:4:22 + +const __data_end: number + +Defined in http://localhost:4545/wasm/math.wasm:5:22 + +const __heap_base: number + +Defined in http://localhost:4545/wasm/math.wasm:1:22 + +const memory: WebAssembly.Memory + diff --git a/tests/specs/info/wasm_module/__test__.jsonc b/tests/specs/info/wasm_module/__test__.jsonc new file mode 100644 index 0000000000..37a02b4484 --- /dev/null +++ b/tests/specs/info/wasm_module/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info --allow-import main.js", + "output": "main.out" +} diff --git a/tests/specs/info/wasm_module/main.js b/tests/specs/info/wasm_module/main.js new file mode 100644 index 0000000000..9ad66df35b --- /dev/null +++ b/tests/specs/info/wasm_module/main.js @@ -0,0 +1,7 @@ +import { + add, + subtract, +} from "http://localhost:4545/wasm/math_with_import.wasm"; + +console.log(add(1, 2)); +console.log(subtract(100, 50)); diff --git a/tests/specs/info/wasm_module/main.out b/tests/specs/info/wasm_module/main.out new file mode 100644 index 0000000000..d8daf39409 --- /dev/null +++ b/tests/specs/info/wasm_module/main.out @@ -0,0 +1,10 @@ +Download http://localhost:4545/wasm/math_with_import.wasm +Download http://localhost:4545/wasm/math.ts +local: [WILDLINE]main.js +type: JavaScript +dependencies: 2 unique +size: [WILDLINE] + +file:///[WILDLINE]/main.js ([WILDLINE]) +└─┬ http://localhost:4545/wasm/math_with_import.wasm ([WILDLINE]) + └── http://localhost:4545/wasm/math.ts ([WILDLINE]) diff --git a/tests/specs/run/wasm_module/cjs_importing/__test__.jsonc b/tests/specs/run/wasm_module/cjs_importing/__test__.jsonc new file mode 100644 index 0000000000..9c91b73692 --- /dev/null +++ b/tests/specs/run/wasm_module/cjs_importing/__test__.jsonc @@ -0,0 +1,12 @@ +{ + "steps": [{ + "args": "run -A setup.ts", + "output": "[WILDCARD]" + }, { + "args": "run -A --check main.cts", + "output": "main.out" + }, { + "args": "run -A --check main.cjs", + "output": "main.out" + }] +} diff --git a/tests/specs/run/wasm_module/cjs_importing/main.cjs b/tests/specs/run/wasm_module/cjs_importing/main.cjs new file mode 100644 index 0000000000..51d253203e --- /dev/null +++ b/tests/specs/run/wasm_module/cjs_importing/main.cjs @@ -0,0 +1,5 @@ +// @ts-check +const { add, subtract } = require("./math.wasm"); + +console.log(add(1, 2)); +console.log(subtract(9, 3)); diff --git a/tests/specs/run/wasm_module/cjs_importing/main.cts b/tests/specs/run/wasm_module/cjs_importing/main.cts new file mode 100644 index 0000000000..2b22d48500 --- /dev/null +++ b/tests/specs/run/wasm_module/cjs_importing/main.cts @@ -0,0 +1,4 @@ +import WasmModule = require("./math.wasm"); + +console.log(WasmModule.add(1, 2)); +console.log(WasmModule.subtract(9, 3)); diff --git a/tests/specs/run/wasm_module/cjs_importing/main.out b/tests/specs/run/wasm_module/cjs_importing/main.out new file mode 100644 index 0000000000..69dbf81127 --- /dev/null +++ b/tests/specs/run/wasm_module/cjs_importing/main.out @@ -0,0 +1,3 @@ +Check file:///[WILDLINE] +3 +6 diff --git a/tests/specs/run/wasm_module/cjs_importing/math.wasm b/tests/specs/run/wasm_module/cjs_importing/math.wasm new file mode 100644 index 0000000000000000000000000000000000000000..6b3950fcc5297b78e0cdfddc5b91ac72505c7c94 GIT binary patch literal 318 zcmY+8%}#?r6ov1dfkMHg)tw6ymYPaKn^x-52XNyHj2F1lTK+OKM7yGo=A(%*F>&>s zoRfSxK&D0jKo4KVFyJ7i0B~IF5Yd$g^U1Xw@acU1f^dNU^d8(v&2_6!0wfg$fN%QD zYRWBOpj1JY6gP#$P^mprr!q1uMQ|xRh%kcpaO9YdA*4=2HA671$?lgQKey(;R{WEC zR|qqujHUdjy7tgm*6=*-bX)W}Ya{%MnzE;o(Rt~Og^O{@*%&V3?1Zi!yZmOg+$GB- zx=psLO}cyBrqMcCZ{j44*Q-0YpIOo+TlL0dd(B2HW_52Vt2i#JHlxZcd~+z9m_O|| D`Uz8u literal 0 HcmV?d00001 diff --git a/tests/specs/run/wasm_module/cjs_importing/package.json b/tests/specs/run/wasm_module/cjs_importing/package.json new file mode 100644 index 0000000000..b04e77362d --- /dev/null +++ b/tests/specs/run/wasm_module/cjs_importing/package.json @@ -0,0 +1,4 @@ +{ + "args": "run -A main.cjs", + "output": "main.out" +} diff --git a/tests/specs/run/wasm_module/cjs_importing/setup.ts b/tests/specs/run/wasm_module/cjs_importing/setup.ts new file mode 100644 index 0000000000..6f5c0e7781 --- /dev/null +++ b/tests/specs/run/wasm_module/cjs_importing/setup.ts @@ -0,0 +1,7 @@ +fetch("http://localhost:4545/wasm/math.wasm").then(async (response) => { + if (!response.ok) { + throw new Error(`Failed to fetch WASM module: ${response.statusText}`); + } + using file = Deno.openSync("math.wasm", { write: true, create: true }); + await response.body!.pipeTo(file.writable); +}); diff --git a/tests/specs/run/wasm_module/import_file_not_found/__test__.jsonc b/tests/specs/run/wasm_module/import_file_not_found/__test__.jsonc new file mode 100644 index 0000000000..a27fcfa82b --- /dev/null +++ b/tests/specs/run/wasm_module/import_file_not_found/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "--allow-import main.js", + "output": "main.out", + "exitCode": 1 +} diff --git a/tests/specs/run/wasm_module/import_file_not_found/deno.jsonc b/tests/specs/run/wasm_module/import_file_not_found/deno.jsonc new file mode 100644 index 0000000000..d24935d178 --- /dev/null +++ b/tests/specs/run/wasm_module/import_file_not_found/deno.jsonc @@ -0,0 +1,9 @@ +{ + "lock": false, + "scopes": { + "http://localhost:4545/wasm/": { + // file won't exist + "http://localhost:4545/wasm/math.ts": "./local_math.ts" + } + } +} diff --git a/tests/specs/run/wasm_module/import_file_not_found/main.js b/tests/specs/run/wasm_module/import_file_not_found/main.js new file mode 100644 index 0000000000..9ad66df35b --- /dev/null +++ b/tests/specs/run/wasm_module/import_file_not_found/main.js @@ -0,0 +1,7 @@ +import { + add, + subtract, +} from "http://localhost:4545/wasm/math_with_import.wasm"; + +console.log(add(1, 2)); +console.log(subtract(100, 50)); diff --git a/tests/specs/run/wasm_module/import_file_not_found/main.out b/tests/specs/run/wasm_module/import_file_not_found/main.out new file mode 100644 index 0000000000..54343673f1 --- /dev/null +++ b/tests/specs/run/wasm_module/import_file_not_found/main.out @@ -0,0 +1,3 @@ +Download http://localhost:4545/wasm/math_with_import.wasm +error: Module not found "file:///[WILDLINE]/local_math.ts". + at http://localhost:4545/wasm/math_with_import.wasm:1:8 diff --git a/tests/specs/run/wasm_module/import_named_export_not_found/__test__.jsonc b/tests/specs/run/wasm_module/import_named_export_not_found/__test__.jsonc new file mode 100644 index 0000000000..a27fcfa82b --- /dev/null +++ b/tests/specs/run/wasm_module/import_named_export_not_found/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "--allow-import main.js", + "output": "main.out", + "exitCode": 1 +} diff --git a/tests/specs/run/wasm_module/import_named_export_not_found/deno.jsonc b/tests/specs/run/wasm_module/import_named_export_not_found/deno.jsonc new file mode 100644 index 0000000000..a8f541dcec --- /dev/null +++ b/tests/specs/run/wasm_module/import_named_export_not_found/deno.jsonc @@ -0,0 +1,8 @@ +{ + "lock": false, + "scopes": { + "http://localhost:4545/wasm/": { + "http://localhost:4545/wasm/math.ts": "./local_math.ts" + } + } +} diff --git a/tests/specs/run/wasm_module/import_named_export_not_found/local_math.ts b/tests/specs/run/wasm_module/import_named_export_not_found/local_math.ts new file mode 100644 index 0000000000..8a72ea008b --- /dev/null +++ b/tests/specs/run/wasm_module/import_named_export_not_found/local_math.ts @@ -0,0 +1,7 @@ +export function addTest(a: number, b: number) { + return (a + b) * 2; +} + +export function subtractTest(a: number, b: number) { + return (a - b) / 2; +} diff --git a/tests/specs/run/wasm_module/import_named_export_not_found/main.js b/tests/specs/run/wasm_module/import_named_export_not_found/main.js new file mode 100644 index 0000000000..9ad66df35b --- /dev/null +++ b/tests/specs/run/wasm_module/import_named_export_not_found/main.js @@ -0,0 +1,7 @@ +import { + add, + subtract, +} from "http://localhost:4545/wasm/math_with_import.wasm"; + +console.log(add(1, 2)); +console.log(subtract(100, 50)); diff --git a/tests/specs/run/wasm_module/import_named_export_not_found/main.out b/tests/specs/run/wasm_module/import_named_export_not_found/main.out new file mode 100644 index 0000000000..f79dab7a05 --- /dev/null +++ b/tests/specs/run/wasm_module/import_named_export_not_found/main.out @@ -0,0 +1,3 @@ +Download http://localhost:4545/wasm/math_with_import.wasm +error: Uncaught SyntaxError: The requested module './math.ts' does not provide an export named 'add' + at (http://localhost:4545/wasm/math_with_import.wasm:[WILDLINE]) diff --git a/tests/specs/run/wasm_module/imports/__test__.jsonc b/tests/specs/run/wasm_module/imports/__test__.jsonc new file mode 100644 index 0000000000..744ae74d3e --- /dev/null +++ b/tests/specs/run/wasm_module/imports/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "--allow-import main.js", + "output": "main.out" +} diff --git a/tests/specs/run/wasm_module/imports/main.js b/tests/specs/run/wasm_module/imports/main.js new file mode 100644 index 0000000000..9ad66df35b --- /dev/null +++ b/tests/specs/run/wasm_module/imports/main.js @@ -0,0 +1,7 @@ +import { + add, + subtract, +} from "http://localhost:4545/wasm/math_with_import.wasm"; + +console.log(add(1, 2)); +console.log(subtract(100, 50)); diff --git a/tests/specs/run/wasm_module/imports/main.out b/tests/specs/run/wasm_module/imports/main.out new file mode 100644 index 0000000000..1b1210ded4 --- /dev/null +++ b/tests/specs/run/wasm_module/imports/main.out @@ -0,0 +1,4 @@ +Download http://localhost:4545/wasm/math_with_import.wasm +Download http://localhost:4545/wasm/math.ts +3 +50 diff --git a/tests/specs/run/wasm_module/integrity_check_failed/__test__.jsonc b/tests/specs/run/wasm_module/integrity_check_failed/__test__.jsonc new file mode 100644 index 0000000000..711016d259 --- /dev/null +++ b/tests/specs/run/wasm_module/integrity_check_failed/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "--allow-import main.js", + "output": "main.out", + "exitCode": 10 +} diff --git a/tests/specs/run/wasm_module/integrity_check_failed/deno.json b/tests/specs/run/wasm_module/integrity_check_failed/deno.json new file mode 100644 index 0000000000..2c63c08510 --- /dev/null +++ b/tests/specs/run/wasm_module/integrity_check_failed/deno.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/specs/run/wasm_module/integrity_check_failed/deno.lock b/tests/specs/run/wasm_module/integrity_check_failed/deno.lock new file mode 100644 index 0000000000..adb4b91ee9 --- /dev/null +++ b/tests/specs/run/wasm_module/integrity_check_failed/deno.lock @@ -0,0 +1,6 @@ +{ + "version": "4", + "remote": { + "http://localhost:4545/wasm/math.wasm": "c4fdd49432f1517835b93274447890007947f9d30674ab7f1474091860113d95" + } +} diff --git a/tests/specs/run/wasm_module/integrity_check_failed/main.js b/tests/specs/run/wasm_module/integrity_check_failed/main.js new file mode 100644 index 0000000000..1e1b2629d1 --- /dev/null +++ b/tests/specs/run/wasm_module/integrity_check_failed/main.js @@ -0,0 +1,4 @@ +import { add, subtract } from "http://localhost:4545/wasm/math.wasm"; + +console.log(add(1, 2)); +console.log(subtract(100, 50)); diff --git a/tests/specs/run/wasm_module/integrity_check_failed/main.out b/tests/specs/run/wasm_module/integrity_check_failed/main.out new file mode 100644 index 0000000000..6434bfcf93 --- /dev/null +++ b/tests/specs/run/wasm_module/integrity_check_failed/main.out @@ -0,0 +1,12 @@ +Download http://localhost:4545/wasm/math.wasm +error: Integrity check failed for remote specifier. The source code is invalid, as it does not match the expected hash in the lock file. + + Specifier: http://localhost:4545/wasm/math.wasm + Actual: d1643d9d4ba8f34ee5198717860cbc629013179addba6d4e347b68eb721c73b4 + Expected: c4fdd49432f1517835b93274447890007947f9d30674ab7f1474091860113d95 + +This could be caused by: + * the lock file may be corrupt + * the source itself may be corrupt + +Investigate the lockfile; delete it to regenerate the lockfile or --reload to reload the source code from the server. diff --git a/tests/specs/run/wasm_module/map_imports_via_import_map/__test__.jsonc b/tests/specs/run/wasm_module/map_imports_via_import_map/__test__.jsonc new file mode 100644 index 0000000000..744ae74d3e --- /dev/null +++ b/tests/specs/run/wasm_module/map_imports_via_import_map/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "--allow-import main.js", + "output": "main.out" +} diff --git a/tests/specs/run/wasm_module/map_imports_via_import_map/deno.json b/tests/specs/run/wasm_module/map_imports_via_import_map/deno.json new file mode 100644 index 0000000000..a8f541dcec --- /dev/null +++ b/tests/specs/run/wasm_module/map_imports_via_import_map/deno.json @@ -0,0 +1,8 @@ +{ + "lock": false, + "scopes": { + "http://localhost:4545/wasm/": { + "http://localhost:4545/wasm/math.ts": "./local_math.ts" + } + } +} diff --git a/tests/specs/run/wasm_module/map_imports_via_import_map/local_math.ts b/tests/specs/run/wasm_module/map_imports_via_import_map/local_math.ts new file mode 100644 index 0000000000..e681c2d7da --- /dev/null +++ b/tests/specs/run/wasm_module/map_imports_via_import_map/local_math.ts @@ -0,0 +1,7 @@ +export function add(a: number, b: number) { + return (a + b) * 2; +} + +export function subtract(a: number, b: number) { + return (a - b) / 2; +} diff --git a/tests/specs/run/wasm_module/map_imports_via_import_map/main.js b/tests/specs/run/wasm_module/map_imports_via_import_map/main.js new file mode 100644 index 0000000000..9ad66df35b --- /dev/null +++ b/tests/specs/run/wasm_module/map_imports_via_import_map/main.js @@ -0,0 +1,7 @@ +import { + add, + subtract, +} from "http://localhost:4545/wasm/math_with_import.wasm"; + +console.log(add(1, 2)); +console.log(subtract(100, 50)); diff --git a/tests/specs/run/wasm_module/map_imports_via_import_map/main.out b/tests/specs/run/wasm_module/map_imports_via_import_map/main.out new file mode 100644 index 0000000000..3a90c739aa --- /dev/null +++ b/tests/specs/run/wasm_module/map_imports_via_import_map/main.out @@ -0,0 +1,3 @@ +Download http://localhost:4545/wasm/math_with_import.wasm +6 +25 diff --git a/tests/specs/run/wasm_module/no_imports/__test__.jsonc b/tests/specs/run/wasm_module/no_imports/__test__.jsonc new file mode 100644 index 0000000000..29c4a86f31 --- /dev/null +++ b/tests/specs/run/wasm_module/no_imports/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-import main.ts", + "output": "main.out" +} diff --git a/tests/specs/run/wasm_module/no_imports/main.out b/tests/specs/run/wasm_module/no_imports/main.out new file mode 100644 index 0000000000..ce0d170ffd --- /dev/null +++ b/tests/specs/run/wasm_module/no_imports/main.out @@ -0,0 +1,3 @@ +Download http://localhost:4545/wasm/math.wasm +3 +6 diff --git a/tests/specs/run/wasm_module/no_imports/main.ts b/tests/specs/run/wasm_module/no_imports/main.ts new file mode 100644 index 0000000000..3cd3f675d2 --- /dev/null +++ b/tests/specs/run/wasm_module/no_imports/main.ts @@ -0,0 +1,4 @@ +import { add, subtract } from "http://localhost:4545/wasm/math.wasm"; + +console.log(add(1, 2)); +console.log(subtract(8, 2)); diff --git a/tests/testdata/wasm/math.ts b/tests/testdata/wasm/math.ts new file mode 100644 index 0000000000..5a1de0865e --- /dev/null +++ b/tests/testdata/wasm/math.ts @@ -0,0 +1,8 @@ +// this file is imported by math_with_import.wasm +export function add(a: number, b: number) { + return a + b; +} + +export function subtract(a: number, b: number) { + return a - b; +} diff --git a/tests/testdata/wasm/math.wasm b/tests/testdata/wasm/math.wasm new file mode 100644 index 0000000000000000000000000000000000000000..6b3950fcc5297b78e0cdfddc5b91ac72505c7c94 GIT binary patch literal 318 zcmY+8%}#?r6ov1dfkMHg)tw6ymYPaKn^x-52XNyHj2F1lTK+OKM7yGo=A(%*F>&>s zoRfSxK&D0jKo4KVFyJ7i0B~IF5Yd$g^U1Xw@acU1f^dNU^d8(v&2_6!0wfg$fN%QD zYRWBOpj1JY6gP#$P^mprr!q1uMQ|xRh%kcpaO9YdA*4=2HA671$?lgQKey(;R{WEC zR|qqujHUdjy7tgm*6=*-bX)W}Ya{%MnzE;o(Rt~Og^O{@*%&V3?1Zi!yZmOg+$GB- zx=psLO}cyBrqMcCZ{j44*Q-0YpIOo+TlL0dd(B2HW_52Vt2i#JHlxZcd~+z9m_O|| D`Uz8u literal 0 HcmV?d00001 diff --git a/tests/testdata/wasm/math_with_import.wasm b/tests/testdata/wasm/math_with_import.wasm new file mode 100644 index 0000000000000000000000000000000000000000..64e195e42b6a2ee67e2ef2fe89118c33cc2094ae GIT binary patch literal 449 zcmY+9PfNo<5XEP98~abFcoPu{f+#gL8`Gp7J@lvtk6zYEcAKhATCy9or__^Q%a3MS ztm0gT_vSJD9+1fp0I-Qqtg5hLXRJNE%E-=!)^Jh^;7_+q8QX#q3&1%8XgIh;M290B z>>cq6Z`bQD=vMH5H$!JH)7hd}G1$Ije~)-aN=25W&K1Y5lrv3B8I#eRb&lCS^r4Rj z>w2L3BR;kQKCzKgrlHf`(!On)JT>4{KHdi#Cwwuo<`>b-kG-3*AB4iESd5jL;KeQ^ zM4j5Ts-r|+H1$-R1i}v~xSp^LF#qLk9wPLlG?tQAxm-NwRu^#BUKR^gCb}@JHK#l+ zDb?6`D2;{v`jlv6v~uGWIz{azCt^7EhF<^N8;Kwq-;AQZ@A-l2MXoO{;Ie0_NVSzy eO|~qwVS`>)T8ih|P3Mc4=4Q|`&uQ-Jcl!;wZF?;M literal 0 HcmV?d00001 diff --git a/tests/util/server/src/lib.rs b/tests/util/server/src/lib.rs index 89dc1ffc3b..953896cffd 100644 --- a/tests/util/server/src/lib.rs +++ b/tests/util/server/src/lib.rs @@ -919,6 +919,11 @@ pub fn wildcard_match_detailed( if was_last_wildcard || was_last_wildline || current_text.is_empty() { WildcardMatchResult::Success + } else if current_text == "\n" { + WildcardMatchResult::Fail( + "\n!!!! PROBLEM: Missing final newline at end of expected output !!!!" + .to_string(), + ) } else { output_lines.push("==== HAD TEXT AT END OF FILE ====".to_string()); output_lines.push(colors::red(annotate_whitespace(current_text))); From 9956731ddb09a478504632175e8db4aacbd1e6db Mon Sep 17 00:00:00 2001 From: Cornelius Krassow <58032399+ckrassow@users.noreply.github.com> Date: Wed, 20 Nov 2024 01:00:47 +0100 Subject: [PATCH 114/227] feat(publish): add `--set-version ` flag (#26141) --- cli/args/flags.rs | 54 ++++++++++++------- cli/tools/registry/mod.rs | 33 ++++++++---- .../set_version/multiple_packages/LICENSE | 0 .../multiple_packages/__test__.jsonc | 5 ++ .../set_version/multiple_packages/deno.json | 8 +++ .../multiple_packages/error_set_version.out | 1 + .../packages/package1/deno.json | 7 +++ .../packages/package1/mod.ts | 3 ++ .../packages/package2/deno.json | 7 +++ .../packages/package2/mod.ts | 3 ++ .../specs/publish/set_version/success/LICENSE | 0 .../set_version/success/__test__.jsonc | 4 ++ .../publish/set_version/success/deno.json | 10 ++++ .../specs/publish/set_version/success/mod.ts | 7 +++ .../publish/set_version/success/std_http.ts | 6 +++ .../success/successful_set_version.out | 6 +++ 16 files changed, 127 insertions(+), 27 deletions(-) create mode 100644 tests/specs/publish/set_version/multiple_packages/LICENSE create mode 100644 tests/specs/publish/set_version/multiple_packages/__test__.jsonc create mode 100644 tests/specs/publish/set_version/multiple_packages/deno.json create mode 100644 tests/specs/publish/set_version/multiple_packages/error_set_version.out create mode 100644 tests/specs/publish/set_version/multiple_packages/packages/package1/deno.json create mode 100644 tests/specs/publish/set_version/multiple_packages/packages/package1/mod.ts create mode 100644 tests/specs/publish/set_version/multiple_packages/packages/package2/deno.json create mode 100644 tests/specs/publish/set_version/multiple_packages/packages/package2/mod.ts create mode 100644 tests/specs/publish/set_version/success/LICENSE create mode 100644 tests/specs/publish/set_version/success/__test__.jsonc create mode 100644 tests/specs/publish/set_version/success/deno.json create mode 100644 tests/specs/publish/set_version/success/mod.ts create mode 100644 tests/specs/publish/set_version/success/std_http.ts create mode 100644 tests/specs/publish/set_version/success/successful_set_version.out diff --git a/cli/args/flags.rs b/cli/args/flags.rs index f40d5aed41..b31bfcecf7 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -428,6 +428,7 @@ pub struct PublishFlags { pub allow_slow_types: bool, pub allow_dirty: bool, pub no_provenance: bool, + pub set_version: Option, } #[derive(Clone, Debug, Eq, PartialEq)] @@ -1391,7 +1392,7 @@ pub fn flags_from_vec(args: Vec) -> clap::error::Result { "uninstall" => uninstall_parse(&mut flags, &mut m), "upgrade" => upgrade_parse(&mut flags, &mut m), "vendor" => vendor_parse(&mut flags, &mut m), - "publish" => publish_parse(&mut flags, &mut m), + "publish" => publish_parse(&mut flags, &mut m)?, _ => unreachable!(), } } else { @@ -3225,12 +3226,12 @@ fn publish_subcommand() -> Command { command("publish", "Publish the current working directory's package or workspace to JSR", UnstableArgsConfig::ResolutionOnly) .defer(|cmd| { cmd - .arg( - Arg::new("token") - .long("token") - .help("The API token to use when publishing. If unset, interactive authentication is be used") - .help_heading(PUBLISH_HEADING) - ) + .arg( + Arg::new("token") + .long("token") + .help("The API token to use when publishing. If unset, interactive authentication is be used") + .help_heading(PUBLISH_HEADING) + ) .arg(config_arg()) .arg(no_config_arg()) .arg( @@ -3238,29 +3239,38 @@ fn publish_subcommand() -> Command { .long("dry-run") .help("Prepare the package for publishing performing all checks and validations without uploading") .action(ArgAction::SetTrue) - .help_heading(PUBLISH_HEADING), + .help_heading(PUBLISH_HEADING), ) .arg( Arg::new("allow-slow-types") .long("allow-slow-types") .help("Allow publishing with slow types") .action(ArgAction::SetTrue) - .help_heading(PUBLISH_HEADING), + .help_heading(PUBLISH_HEADING), ) .arg( Arg::new("allow-dirty") .long("allow-dirty") .help("Allow publishing if the repository has uncommitted changed") .action(ArgAction::SetTrue) - .help_heading(PUBLISH_HEADING), - ).arg( - Arg::new("no-provenance") - .long("no-provenance") - .help(cstr!("Disable provenance attestation. + .help_heading(PUBLISH_HEADING), + ) + .arg( + Arg::new("no-provenance") + .long("no-provenance") + .help(cstr!("Disable provenance attestation. Enabled by default on Github actions, publicly links the package to where it was built and published from.")) - .action(ArgAction::SetTrue) - .help_heading(PUBLISH_HEADING) - ) + .action(ArgAction::SetTrue) + .help_heading(PUBLISH_HEADING) + ) + .arg( + Arg::new("set-version") + .long("set-version") + .help("Set version for a package to be published. + This flag can be used while publishing individual packages and cannot be used in a workspace.") + .value_name("VERSION") + .help_heading(PUBLISH_HEADING) + ) .arg(check_arg(/* type checks by default */ true)) .arg(no_check_arg()) }) @@ -5229,7 +5239,10 @@ fn vendor_parse(flags: &mut Flags, _matches: &mut ArgMatches) { flags.subcommand = DenoSubcommand::Vendor } -fn publish_parse(flags: &mut Flags, matches: &mut ArgMatches) { +fn publish_parse( + flags: &mut Flags, + matches: &mut ArgMatches, +) -> clap::error::Result<()> { flags.type_check_mode = TypeCheckMode::Local; // local by default unstable_args_parse(flags, matches, UnstableArgsConfig::ResolutionOnly); no_check_arg_parse(flags, matches); @@ -5242,7 +5255,10 @@ fn publish_parse(flags: &mut Flags, matches: &mut ArgMatches) { allow_slow_types: matches.get_flag("allow-slow-types"), allow_dirty: matches.get_flag("allow-dirty"), no_provenance: matches.get_flag("no-provenance"), + set_version: matches.remove_one::("set-version"), }); + + Ok(()) } fn compile_args_parse( @@ -10769,6 +10785,7 @@ mod tests { "--allow-slow-types", "--allow-dirty", "--token=asdf", + "--set-version=1.0.1", ]); assert_eq!( r.unwrap(), @@ -10779,6 +10796,7 @@ mod tests { allow_slow_types: true, allow_dirty: true, no_provenance: true, + set_version: Some("1.0.1".to_string()), }), type_check_mode: TypeCheckMode::Local, ..Flags::default() diff --git a/cli/tools/registry/mod.rs b/cli/tools/registry/mod.rs index dec3c1afeb..f121c4623c 100644 --- a/cli/tools/registry/mod.rs +++ b/cli/tools/registry/mod.rs @@ -90,7 +90,7 @@ pub async fn publish( let cli_options = cli_factory.cli_options()?; let directory_path = cli_options.initial_cwd(); - let publish_configs = cli_options.start_dir.jsr_packages_for_publish(); + let mut publish_configs = cli_options.start_dir.jsr_packages_for_publish(); if publish_configs.is_empty() { match cli_options.start_dir.maybe_deno_json() { Some(deno_json) => { @@ -108,6 +108,18 @@ pub async fn publish( } } } + + if let Some(version) = &publish_flags.set_version { + if publish_configs.len() > 1 { + bail!("Cannot use --set-version when publishing a workspace. Change your cwd to an individual package instead."); + } + if let Some(publish_config) = publish_configs.get_mut(0) { + let mut config_file = publish_config.config_file.as_ref().clone(); + config_file.json.version = Some(version.clone()); + publish_config.config_file = Arc::new(config_file); + } + } + let specifier_unfurler = Arc::new(SpecifierUnfurler::new( if cli_options.unstable_sloppy_imports() { Some(CliSloppyImportsResolver::new(SloppyImportsCachedFs::new( @@ -410,9 +422,12 @@ impl PublishPreparer { let deno_json = &package.config_file; let config_path = deno_json.specifier.to_file_path().unwrap(); let root_dir = config_path.parent().unwrap().to_path_buf(); - let Some(version) = deno_json.json.version.clone() else { - bail!("{} is missing 'version' field", deno_json.specifier); - }; + let version = deno_json.json.version.clone().ok_or_else(|| { + deno_core::anyhow::anyhow!( + "{} is missing 'version' field", + deno_json.specifier + ) + })?; if deno_json.json.exports.is_none() { let mut suggested_entrypoint = None; @@ -435,11 +450,11 @@ impl PublishPreparer { ); bail!( - "You did not specify an entrypoint to \"{}\" package in {}. Add `exports` mapping in the configuration file, eg:\n{}", - package.name, - deno_json.specifier, - exports_content - ); + "You did not specify an entrypoint to \"{}\" package in {}. Add `exports` mapping in the configuration file, eg:\n{}", + package.name, + deno_json.specifier, + exports_content + ); } let Some(name_no_at) = package.name.strip_prefix('@') else { bail!("Invalid package name, use '@/ format"); diff --git a/tests/specs/publish/set_version/multiple_packages/LICENSE b/tests/specs/publish/set_version/multiple_packages/LICENSE new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/specs/publish/set_version/multiple_packages/__test__.jsonc b/tests/specs/publish/set_version/multiple_packages/__test__.jsonc new file mode 100644 index 0000000000..c191386d80 --- /dev/null +++ b/tests/specs/publish/set_version/multiple_packages/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "publish --set-version 1.1.0 --token 'sadfasdf'", + "output": "error_set_version.out", + "exitCode": 1 +} diff --git a/tests/specs/publish/set_version/multiple_packages/deno.json b/tests/specs/publish/set_version/multiple_packages/deno.json new file mode 100644 index 0000000000..4b3ffe44da --- /dev/null +++ b/tests/specs/publish/set_version/multiple_packages/deno.json @@ -0,0 +1,8 @@ +{ + "workspace": { + "members": [ + "packages/package1", + "packages/package2" + ] + } +} diff --git a/tests/specs/publish/set_version/multiple_packages/error_set_version.out b/tests/specs/publish/set_version/multiple_packages/error_set_version.out new file mode 100644 index 0000000000..098692c4c6 --- /dev/null +++ b/tests/specs/publish/set_version/multiple_packages/error_set_version.out @@ -0,0 +1 @@ +error: Cannot use --set-version when publishing a workspace. Change your cwd to an individual package instead. diff --git a/tests/specs/publish/set_version/multiple_packages/packages/package1/deno.json b/tests/specs/publish/set_version/multiple_packages/packages/package1/deno.json new file mode 100644 index 0000000000..737fc9c139 --- /dev/null +++ b/tests/specs/publish/set_version/multiple_packages/packages/package1/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@foo/package1", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/publish/set_version/multiple_packages/packages/package1/mod.ts b/tests/specs/publish/set_version/multiple_packages/packages/package1/mod.ts new file mode 100644 index 0000000000..a2cd81bed7 --- /dev/null +++ b/tests/specs/publish/set_version/multiple_packages/packages/package1/mod.ts @@ -0,0 +1,3 @@ +export function package1() { + return "package1"; +} diff --git a/tests/specs/publish/set_version/multiple_packages/packages/package2/deno.json b/tests/specs/publish/set_version/multiple_packages/packages/package2/deno.json new file mode 100644 index 0000000000..16987e6194 --- /dev/null +++ b/tests/specs/publish/set_version/multiple_packages/packages/package2/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@foo/package2", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/publish/set_version/multiple_packages/packages/package2/mod.ts b/tests/specs/publish/set_version/multiple_packages/packages/package2/mod.ts new file mode 100644 index 0000000000..6c1361aa42 --- /dev/null +++ b/tests/specs/publish/set_version/multiple_packages/packages/package2/mod.ts @@ -0,0 +1,3 @@ +export function package2() { + return "package2"; +} diff --git a/tests/specs/publish/set_version/success/LICENSE b/tests/specs/publish/set_version/success/LICENSE new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/specs/publish/set_version/success/__test__.jsonc b/tests/specs/publish/set_version/success/__test__.jsonc new file mode 100644 index 0000000000..6f0bf802e7 --- /dev/null +++ b/tests/specs/publish/set_version/success/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "publish --set-version 1.1.0 --token 'sadfasdf'", + "output": "successful_set_version.out" +} diff --git a/tests/specs/publish/set_version/success/deno.json b/tests/specs/publish/set_version/success/deno.json new file mode 100644 index 0000000000..fefab899bd --- /dev/null +++ b/tests/specs/publish/set_version/success/deno.json @@ -0,0 +1,10 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + }, + "imports": { + "@std/http": "./std_http.ts" + } +} diff --git a/tests/specs/publish/set_version/success/mod.ts b/tests/specs/publish/set_version/success/mod.ts new file mode 100644 index 0000000000..6e8a61bae9 --- /dev/null +++ b/tests/specs/publish/set_version/success/mod.ts @@ -0,0 +1,7 @@ +import http from "@std/http"; + +export function foobar(): { fileServer(): void } { + return { + fileServer: http.fileServer, + }; +} diff --git a/tests/specs/publish/set_version/success/std_http.ts b/tests/specs/publish/set_version/success/std_http.ts new file mode 100644 index 0000000000..9d57b36f34 --- /dev/null +++ b/tests/specs/publish/set_version/success/std_http.ts @@ -0,0 +1,6 @@ +// temp until we get jsr:@std/http in the test server +export default { + fileServer() { + console.log("Hi"); + }, +}; diff --git a/tests/specs/publish/set_version/success/successful_set_version.out b/tests/specs/publish/set_version/success/successful_set_version.out new file mode 100644 index 0000000000..a5cb9aa821 --- /dev/null +++ b/tests/specs/publish/set_version/success/successful_set_version.out @@ -0,0 +1,6 @@ +Check file:///[WILDCARD]/success/mod.ts +Checking for slow types in the public API... +Check file:///[WILDCARD]/success/mod.ts +Publishing @foo/bar@1.1.0 ... +Successfully published @foo/bar@1.1.0 +Visit http://127.0.0.1:4250/@foo/bar@1.1.0 for details From fadda6a8fb00602e85b7aa415747c56815d1efac Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 19 Nov 2024 19:49:19 -0500 Subject: [PATCH 115/227] fix(lockfile): track dependencies specified in TypeScript compiler options (#26551) We should track dependencies in `jsxImportSource`, `jsxImportSourceTypes`, and `types`. That way, for example, if someone removes or changes the `jsxImportSource` then we can remove those items from the lockfile. --- cli/args/deno_json.rs | 52 +++++++++++++++++-- cli/args/lockfile.rs | 6 +-- .../__test__.jsonc | 13 +++++ .../jsx_import_source_and_types/deno.json | 10 ++++ .../jsx_import_source_and_types/deno.lock.out | 30 +++++++++++ .../jsx_import_source_and_types/index.out | 7 +++ .../jsx_import_source_and_types/index.tsx | 1 + 7 files changed, 109 insertions(+), 10 deletions(-) create mode 100644 tests/specs/lockfile/jsx_import_source_and_types/__test__.jsonc create mode 100644 tests/specs/lockfile/jsx_import_source_and_types/deno.json create mode 100644 tests/specs/lockfile/jsx_import_source_and_types/deno.lock.out create mode 100644 tests/specs/lockfile/jsx_import_source_and_types/index.out create mode 100644 tests/specs/lockfile/jsx_import_source_and_types/index.tsx diff --git a/cli/args/deno_json.rs b/cli/args/deno_json.rs index e9ab0189f5..a82289e67d 100644 --- a/cli/args/deno_json.rs +++ b/cli/args/deno_json.rs @@ -70,7 +70,41 @@ pub fn deno_json_deps( let values = imports_values(config.json.imports.as_ref()) .into_iter() .chain(scope_values(config.json.scopes.as_ref())); - values_to_set(values) + let mut set = values_to_set(values); + + if let Some(serde_json::Value::Object(compiler_options)) = + &config.json.compiler_options + { + // add jsxImportSource + if let Some(serde_json::Value::String(value)) = + compiler_options.get("jsxImportSource") + { + if let Some(dep_req) = value_to_dep_req(value) { + set.insert(dep_req); + } + } + // add jsxImportSourceTypes + if let Some(serde_json::Value::String(value)) = + compiler_options.get("jsxImportSourceTypes") + { + if let Some(dep_req) = value_to_dep_req(value) { + set.insert(dep_req); + } + } + // add the dependencies in the types array + if let Some(serde_json::Value::Array(types)) = compiler_options.get("types") + { + for value in types { + if let serde_json::Value::String(value) = value { + if let Some(dep_req) = value_to_dep_req(value) { + set.insert(dep_req); + } + } + } + } + } + + set } fn imports_values(value: Option<&serde_json::Value>) -> Vec<&String> { @@ -98,15 +132,23 @@ fn values_to_set<'a>( ) -> HashSet { let mut entries = HashSet::new(); for value in values { - if let Ok(req_ref) = JsrPackageReqReference::from_str(value) { - entries.insert(JsrDepPackageReq::jsr(req_ref.into_inner().req)); - } else if let Ok(req_ref) = NpmPackageReqReference::from_str(value) { - entries.insert(JsrDepPackageReq::npm(req_ref.into_inner().req)); + if let Some(dep_req) = value_to_dep_req(value) { + entries.insert(dep_req); } } entries } +fn value_to_dep_req(value: &str) -> Option { + if let Ok(req_ref) = JsrPackageReqReference::from_str(value) { + Some(JsrDepPackageReq::jsr(req_ref.into_inner().req)) + } else if let Ok(req_ref) = NpmPackageReqReference::from_str(value) { + Some(JsrDepPackageReq::npm(req_ref.into_inner().req)) + } else { + None + } +} + pub fn check_warn_tsconfig(ts_config: &TsConfigForEmit) { if let Some(ignored_options) = &ts_config.maybe_ignored_options { log::warn!("{}", ignored_options); diff --git a/cli/args/lockfile.rs b/cli/args/lockfile.rs index 1805d26426..a9eb8a0d7c 100644 --- a/cli/args/lockfile.rs +++ b/cli/args/lockfile.rs @@ -126,11 +126,7 @@ impl CliLockfile { maybe_deno_json: Option<&ConfigFile>, ) -> HashSet { maybe_deno_json - .map(|c| { - crate::args::deno_json::deno_json_deps(c) - .into_iter() - .collect() - }) + .map(crate::args::deno_json::deno_json_deps) .unwrap_or_default() } diff --git a/tests/specs/lockfile/jsx_import_source_and_types/__test__.jsonc b/tests/specs/lockfile/jsx_import_source_and_types/__test__.jsonc new file mode 100644 index 0000000000..08ab2acf95 --- /dev/null +++ b/tests/specs/lockfile/jsx_import_source_and_types/__test__.jsonc @@ -0,0 +1,13 @@ +{ + "tempDir": true, + "steps": [{ + "args": "run index.tsx", + "output": "index.out" + }, { + "args": [ + "eval", + "console.log(Deno.readTextFileSync('deno.lock').trim())" + ], + "output": "deno.lock.out" + }] +} diff --git a/tests/specs/lockfile/jsx_import_source_and_types/deno.json b/tests/specs/lockfile/jsx_import_source_and_types/deno.json new file mode 100644 index 0000000000..3755934a58 --- /dev/null +++ b/tests/specs/lockfile/jsx_import_source_and_types/deno.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "npm:react", + "jsxImportSourceTypes": "npm:@types/react", + "types": [ + "npm:@types/node" + ] + } +} diff --git a/tests/specs/lockfile/jsx_import_source_and_types/deno.lock.out b/tests/specs/lockfile/jsx_import_source_and_types/deno.lock.out new file mode 100644 index 0000000000..3a933a1aa2 --- /dev/null +++ b/tests/specs/lockfile/jsx_import_source_and_types/deno.lock.out @@ -0,0 +1,30 @@ +{ + "version": "4", + "specifiers": { + "npm:react@*": "18.2.0" + }, + "npm": { + "js-tokens@4.0.0": { + "integrity": "[WILDLINE]" + }, + "loose-envify@1.4.0": { + "integrity": "[WILDLINE]", + "dependencies": [ + "js-tokens" + ] + }, + "react@18.2.0": { + "integrity": "[WILDLINE]", + "dependencies": [ + "loose-envify" + ] + } + }, + "workspace": { + "dependencies": [ + "npm:@types/node@*", + "npm:@types/react@*", + "npm:react@*" + ] + } +} diff --git a/tests/specs/lockfile/jsx_import_source_and_types/index.out b/tests/specs/lockfile/jsx_import_source_and_types/index.out new file mode 100644 index 0000000000..7fc82c71df --- /dev/null +++ b/tests/specs/lockfile/jsx_import_source_and_types/index.out @@ -0,0 +1,7 @@ +Download http://localhost:4260/react +Download http://localhost:4260/loose-envify +Download http://localhost:4260/js-tokens +Download http://localhost:4260/react/react-18.2.0.tgz +Download http://localhost:4260/loose-envify/loose-envify-1.4.0.tgz +Download http://localhost:4260/js-tokens/js-tokens-4.0.0.tgz +1 diff --git a/tests/specs/lockfile/jsx_import_source_and_types/index.tsx b/tests/specs/lockfile/jsx_import_source_and_types/index.tsx new file mode 100644 index 0000000000..296d5492b0 --- /dev/null +++ b/tests/specs/lockfile/jsx_import_source_and_types/index.tsx @@ -0,0 +1 @@ +console.log(1); From 429f3929fae7446d720e21f94f8d7da251458bf3 Mon Sep 17 00:00:00 2001 From: haturau <135221985+haturatu@users.noreply.github.com> Date: Wed, 20 Nov 2024 10:04:48 +0900 Subject: [PATCH 116/227] feat(info): show location for Web Cache (#26205) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #26181 --------- Co-authored-by: Bartek Iwańczuk --- cli/tools/info.rs | 7 +++++++ cli/worker.rs | 17 +++++++++-------- tests/specs/info/flag/041_info_flag.out | 1 + .../flag_location/041_info_flag_location.out | 1 + tests/specs/info/json/info_json.out | 3 ++- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/cli/tools/info.rs b/cli/tools/info.rs index 6cddf96995..c3c37f0268 100644 --- a/cli/tools/info.rs +++ b/cli/tools/info.rs @@ -126,6 +126,7 @@ fn print_cache_info( let registry_cache = dir.registries_folder_path(); let mut origin_dir = dir.origin_data_folder_path(); let deno_dir = dir.root_path_for_display().to_string(); + let web_cache_dir = crate::worker::get_cache_storage_dir(); if let Some(location) = &location { origin_dir = @@ -143,6 +144,7 @@ fn print_cache_info( "typescriptCache": typescript_cache, "registryCache": registry_cache, "originStorage": origin_dir, + "webCacheStorage": web_cache_dir, }); if location.is_some() { @@ -177,6 +179,11 @@ fn print_cache_info( colors::bold("Origin storage:"), origin_dir.display() ); + println!( + "{} {}", + colors::bold("Web cache storage:"), + web_cache_dir.display() + ); if location.is_some() { println!( "{} {}", diff --git a/cli/worker.rs b/cli/worker.rs index 3b09714d59..0b07bb4bf3 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -393,6 +393,13 @@ impl CliMainWorker { } } +// TODO(bartlomieju): this should be moved to some other place, added to avoid string +// duplication between worker setups and `deno info` output. +pub fn get_cache_storage_dir() -> PathBuf { + // Note: we currently use temp_dir() to avoid managing storage size. + std::env::temp_dir().join("deno_cache") +} + #[derive(Clone)] pub struct CliMainWorkerFactory { shared: Arc, @@ -529,10 +536,7 @@ impl CliMainWorkerFactory { }); let cache_storage_dir = maybe_storage_key.map(|key| { // TODO(@satyarohith): storage quota management - // Note: we currently use temp_dir() to avoid managing storage size. - std::env::temp_dir() - .join("deno_cache") - .join(checksum::gen(&[key.as_bytes()])) + get_cache_storage_dir().join(checksum::gen(&[key.as_bytes()])) }); // TODO(bartlomieju): this is cruft, update FeatureChecker to spit out @@ -729,10 +733,7 @@ fn create_web_worker_callback( .resolve_storage_key(&args.main_module); let cache_storage_dir = maybe_storage_key.map(|key| { // TODO(@satyarohith): storage quota management - // Note: we currently use temp_dir() to avoid managing storage size. - std::env::temp_dir() - .join("deno_cache") - .join(checksum::gen(&[key.as_bytes()])) + get_cache_storage_dir().join(checksum::gen(&[key.as_bytes()])) }); // TODO(bartlomieju): this is cruft, update FeatureChecker to spit out diff --git a/tests/specs/info/flag/041_info_flag.out b/tests/specs/info/flag/041_info_flag.out index 72a00be303..48a08de4d9 100644 --- a/tests/specs/info/flag/041_info_flag.out +++ b/tests/specs/info/flag/041_info_flag.out @@ -4,3 +4,4 @@ npm modules cache: [WILDCARD]npm Emitted modules cache: [WILDCARD]gen Language server registries cache: [WILDCARD]registries Origin storage: [WILDCARD]location_data +Web cache storage: [WILDCARD]deno_cache diff --git a/tests/specs/info/flag_location/041_info_flag_location.out b/tests/specs/info/flag_location/041_info_flag_location.out index 684db2eec5..d3ba01ad35 100644 --- a/tests/specs/info/flag_location/041_info_flag_location.out +++ b/tests/specs/info/flag_location/041_info_flag_location.out @@ -4,4 +4,5 @@ npm modules cache: [WILDCARD]npm Emitted modules cache: [WILDCARD]gen Language server registries cache: [WILDCARD]registries Origin storage: [WILDCARD]location_data[WILDCARD] +Web cache storage: [WILDCARD]deno_cache Local Storage: [WILDCARD]location_data[WILDCARD]local_storage diff --git a/tests/specs/info/json/info_json.out b/tests/specs/info/json/info_json.out index 551f61026d..cc43c5f10a 100644 --- a/tests/specs/info/json/info_json.out +++ b/tests/specs/info/json/info_json.out @@ -5,5 +5,6 @@ "npmCache": "[WILDCARD]npm", "typescriptCache": "[WILDCARD]gen", "registryCache": "[WILDCARD]registries", - "originStorage": "[WILDCARD]location_data" + "originStorage": "[WILDCARD]location_data", + "webCacheStorage": [WILDCARD]deno_cache" } From dabb6775f351a163d3e55e15fef957db8aa28b72 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 19 Nov 2024 20:14:49 -0500 Subject: [PATCH 117/227] fix(publish): improve error message when missing exports (#26945) --- cli/tools/registry/mod.rs | 65 ++++++++++--------- tests/specs/publish/missing_exports/LICENSE | 0 .../publish/missing_exports/__test__.jsonc | 5 ++ tests/specs/publish/missing_exports/deno.json | 7 ++ tests/specs/publish/missing_exports/mod.ts | 3 + .../specs/publish/missing_exports/publish.out | 8 +++ 6 files changed, 56 insertions(+), 32 deletions(-) create mode 100644 tests/specs/publish/missing_exports/LICENSE create mode 100644 tests/specs/publish/missing_exports/__test__.jsonc create mode 100644 tests/specs/publish/missing_exports/deno.json create mode 100644 tests/specs/publish/missing_exports/mod.ts create mode 100644 tests/specs/publish/missing_exports/publish.out diff --git a/cli/tools/registry/mod.rs b/cli/tools/registry/mod.rs index f121c4623c..89447f04f9 100644 --- a/cli/tools/registry/mod.rs +++ b/cli/tools/registry/mod.rs @@ -12,6 +12,7 @@ use std::sync::Arc; use base64::prelude::BASE64_STANDARD; use base64::Engine; use deno_ast::ModuleSpecifier; +use deno_config::deno_json::ConfigFile; use deno_config::workspace::JsrPackageConfig; use deno_config::workspace::PackageJsonDepResolution; use deno_config::workspace::Workspace; @@ -95,8 +96,9 @@ pub async fn publish( match cli_options.start_dir.maybe_deno_json() { Some(deno_json) => { debug_assert!(!deno_json.is_package()); + error_missing_exports_field(deno_json)?; bail!( - "Missing 'name', 'version' and 'exports' field in '{}'.", + "Missing 'name' or 'exports' field in '{}'.", deno_json.specifier ); } @@ -416,9 +418,6 @@ impl PublishPreparer { graph: Arc, diagnostics_collector: &PublishDiagnosticsCollector, ) -> Result, AnyError> { - static SUGGESTED_ENTRYPOINTS: [&str; 4] = - ["mod.ts", "mod.js", "index.ts", "index.js"]; - let deno_json = &package.config_file; let config_path = deno_json.specifier.to_file_path().unwrap(); let root_dir = config_path.parent().unwrap().to_path_buf(); @@ -428,34 +427,6 @@ impl PublishPreparer { deno_json.specifier ) })?; - if deno_json.json.exports.is_none() { - let mut suggested_entrypoint = None; - - for entrypoint in SUGGESTED_ENTRYPOINTS { - if root_dir.join(entrypoint).exists() { - suggested_entrypoint = Some(entrypoint); - break; - } - } - - let exports_content = format!( - r#"{{ - "name": "{}", - "version": "{}", - "exports": "{}" -}}"#, - package.name, - version, - suggested_entrypoint.unwrap_or("") - ); - - bail!( - "You did not specify an entrypoint to \"{}\" package in {}. Add `exports` mapping in the configuration file, eg:\n{}", - package.name, - deno_json.specifier, - exports_content - ); - } let Some(name_no_at) = package.name.strip_prefix('@') else { bail!("Invalid package name, use '@/ format"); }; @@ -1287,6 +1258,36 @@ fn has_license_file<'a>( }) } +fn error_missing_exports_field(deno_json: &ConfigFile) -> Result<(), AnyError> { + static SUGGESTED_ENTRYPOINTS: [&str; 4] = + ["mod.ts", "mod.js", "index.ts", "index.js"]; + let mut suggested_entrypoint = None; + + for entrypoint in SUGGESTED_ENTRYPOINTS { + if deno_json.dir_path().join(entrypoint).exists() { + suggested_entrypoint = Some(entrypoint); + break; + } + } + + let exports_content = format!( + r#"{{ + "name": "{}", + "version": "{}", + "exports": "{}" +}}"#, + deno_json.json.name.as_deref().unwrap_or("@scope/name"), + deno_json.json.name.as_deref().unwrap_or("0.0.0"), + suggested_entrypoint.unwrap_or("") + ); + + bail!( + "You did not specify an entrypoint in {}. Add `exports` mapping in the configuration file, eg:\n{}", + deno_json.specifier, + exports_content + ); +} + #[allow(clippy::print_stderr)] fn ring_bell() { // ASCII code for the bell character. diff --git a/tests/specs/publish/missing_exports/LICENSE b/tests/specs/publish/missing_exports/LICENSE new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/specs/publish/missing_exports/__test__.jsonc b/tests/specs/publish/missing_exports/__test__.jsonc new file mode 100644 index 0000000000..241bb87e04 --- /dev/null +++ b/tests/specs/publish/missing_exports/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "publish --token 'sadfasdf'", + "output": "publish.out", + "exitCode": 1 +} diff --git a/tests/specs/publish/missing_exports/deno.json b/tests/specs/publish/missing_exports/deno.json new file mode 100644 index 0000000000..4a66546360 --- /dev/null +++ b/tests/specs/publish/missing_exports/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "imports": { + "@std/http": "./std_http.ts" + } +} diff --git a/tests/specs/publish/missing_exports/mod.ts b/tests/specs/publish/missing_exports/mod.ts new file mode 100644 index 0000000000..8d9b8a22a1 --- /dev/null +++ b/tests/specs/publish/missing_exports/mod.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number): number { + return a + b; +} diff --git a/tests/specs/publish/missing_exports/publish.out b/tests/specs/publish/missing_exports/publish.out new file mode 100644 index 0000000000..ded06f638b --- /dev/null +++ b/tests/specs/publish/missing_exports/publish.out @@ -0,0 +1,8 @@ +Warning "exports" field should be specified when specifying a "name". + at file:///[WILDLINE]/deno.json +error: You did not specify an entrypoint in file:///[WILDLINE]/deno.json. Add `exports` mapping in the configuration file, eg: +{ + "name": "@foo/bar", + "version": "@foo/bar", + "exports": "mod.ts" +} From 318dd3cbc36f3acc9fcc2eb246c9093a565a2556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 20 Nov 2024 01:23:20 +0000 Subject: [PATCH 118/227] feat(task): add --eval flag (#26943) This commit adds `--eval` flag to `deno task` subcommand. This flag allows to evaluate provided "task name" as a task itself, effectively allowing to use `deno_task_shell` from the command line. Also fixes shebang parsing for `node_modules/.bin/` entries to handle `#!/usr/bin/node -S node` in addition to `#!/usr/bin/node node`. Closes https://github.com/denoland/deno/issues/26918 --- cli/args/flags.rs | 57 ++++++++++++++++++++++++++-- cli/main.rs | 1 + cli/task_runner.rs | 48 ++++++++++++++++------- cli/tools/task.rs | 15 +++++++- tests/specs/task/eval/__test__.jsonc | 35 +++++++++++++++++ tests/specs/task/eval/bin.out | 3 ++ tests/specs/task/eval/echo_pwd.out | 2 + tests/specs/task/eval/no_arg.out | 4 ++ tests/specs/task/eval/package.json | 9 +++++ tests/specs/task/eval/piped.out | 3 ++ 10 files changed, 160 insertions(+), 17 deletions(-) create mode 100644 tests/specs/task/eval/__test__.jsonc create mode 100644 tests/specs/task/eval/bin.out create mode 100644 tests/specs/task/eval/echo_pwd.out create mode 100644 tests/specs/task/eval/no_arg.out create mode 100644 tests/specs/task/eval/package.json create mode 100644 tests/specs/task/eval/piped.out diff --git a/cli/args/flags.rs b/cli/args/flags.rs index b31bfcecf7..5d85f2861c 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -380,6 +380,7 @@ pub struct TaskFlags { pub cwd: Option, pub task: Option, pub is_run: bool, + pub eval: bool, } #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] @@ -1386,7 +1387,7 @@ pub fn flags_from_vec(args: Vec) -> clap::error::Result { "repl" => repl_parse(&mut flags, &mut m)?, "run" => run_parse(&mut flags, &mut m, app, false)?, "serve" => serve_parse(&mut flags, &mut m, app)?, - "task" => task_parse(&mut flags, &mut m), + "task" => task_parse(&mut flags, &mut m, app)?, "test" => test_parse(&mut flags, &mut m)?, "types" => types_parse(&mut flags, &mut m), "uninstall" => uninstall_parse(&mut flags, &mut m), @@ -2931,7 +2932,10 @@ fn task_subcommand() -> Command { deno task build List all available tasks: - deno task" + deno task + +Evaluate a task from string + deno task --eval \"echo $(pwd)\"" ), UnstableArgsConfig::ResolutionAndRuntime, ) @@ -2947,6 +2951,13 @@ List all available tasks: .help("Specify the directory to run the task in") .value_hint(ValueHint::DirPath), ) + .arg( + Arg::new("eval") + .long("eval") + .help( + "Evaluate the passed value as if, it was a task in a configuration file", + ).action(ArgAction::SetTrue) + ) .arg(node_modules_dir_arg()) }) } @@ -5066,7 +5077,11 @@ fn serve_parse( Ok(()) } -fn task_parse(flags: &mut Flags, matches: &mut ArgMatches) { +fn task_parse( + flags: &mut Flags, + matches: &mut ArgMatches, + mut app: Command, +) -> clap::error::Result<()> { flags.config_flag = matches .remove_one::("config") .map(ConfigFlag::Path) @@ -5079,6 +5094,7 @@ fn task_parse(flags: &mut Flags, matches: &mut ArgMatches) { cwd: matches.remove_one::("cwd"), task: None, is_run: false, + eval: matches.get_flag("eval"), }; if let Some((task, mut matches)) = matches.remove_subcommand() { @@ -5091,9 +5107,15 @@ fn task_parse(flags: &mut Flags, matches: &mut ArgMatches) { .flatten() .filter_map(|arg| arg.into_string().ok()), ); + } else if task_flags.eval { + return Err(app.find_subcommand_mut("task").unwrap().error( + clap::error::ErrorKind::MissingRequiredArgument, + "[TASK] must be specified when using --eval", + )); } flags.subcommand = DenoSubcommand::Task(task_flags); + Ok(()) } fn parallel_arg_parse(matches: &mut ArgMatches) -> Option { @@ -10274,6 +10296,7 @@ mod tests { cwd: None, task: Some("build".to_string()), is_run: false, + eval: false, }), argv: svec!["hello", "world"], ..Flags::default() @@ -10288,6 +10311,7 @@ mod tests { cwd: None, task: Some("build".to_string()), is_run: false, + eval: false, }), ..Flags::default() } @@ -10301,10 +10325,28 @@ mod tests { cwd: Some("foo".to_string()), task: Some("build".to_string()), is_run: false, + eval: false, }), ..Flags::default() } ); + + let r = flags_from_vec(svec!["deno", "task", "--eval", "echo 1"]); + assert_eq!( + r.unwrap(), + Flags { + subcommand: DenoSubcommand::Task(TaskFlags { + cwd: None, + task: Some("echo 1".to_string()), + is_run: false, + eval: true, + }), + ..Flags::default() + } + ); + + let r = flags_from_vec(svec!["deno", "task", "--eval"]); + assert!(r.is_err()); } #[test] @@ -10326,6 +10368,7 @@ mod tests { cwd: None, task: Some("build".to_string()), is_run: false, + eval: false, }), argv: svec!["--", "hello", "world"], config_flag: ConfigFlag::Path("deno.json".to_owned()), @@ -10343,6 +10386,7 @@ mod tests { cwd: Some("foo".to_string()), task: Some("build".to_string()), is_run: false, + eval: false, }), argv: svec!["--", "hello", "world"], ..Flags::default() @@ -10361,6 +10405,7 @@ mod tests { cwd: None, task: Some("build".to_string()), is_run: false, + eval: false, }), argv: svec!["--"], ..Flags::default() @@ -10378,6 +10423,7 @@ mod tests { cwd: None, task: Some("build".to_string()), is_run: false, + eval: false, }), argv: svec!["-1", "--test"], ..Flags::default() @@ -10395,6 +10441,7 @@ mod tests { cwd: None, task: Some("build".to_string()), is_run: false, + eval: false, }), argv: svec!["--test"], ..Flags::default() @@ -10413,6 +10460,7 @@ mod tests { cwd: None, task: Some("build".to_string()), is_run: false, + eval: false, }), log_level: Some(log::Level::Error), ..Flags::default() @@ -10430,6 +10478,7 @@ mod tests { cwd: None, task: None, is_run: false, + eval: false, }), ..Flags::default() } @@ -10446,6 +10495,7 @@ mod tests { cwd: None, task: None, is_run: false, + eval: false, }), config_flag: ConfigFlag::Path("deno.jsonc".to_string()), ..Flags::default() @@ -10463,6 +10513,7 @@ mod tests { cwd: None, task: None, is_run: false, + eval: false, }), config_flag: ConfigFlag::Path("deno.jsonc".to_string()), ..Flags::default() diff --git a/cli/main.rs b/cli/main.rs index 7d3ef0e6a0..3dd2692f05 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -238,6 +238,7 @@ async fn run_subcommand(flags: Arc) -> Result { cwd: None, task: Some(run_flags.script.clone()), is_run: true, + eval: false, }; new_flags.subcommand = DenoSubcommand::Task(task_flags.clone()); let result = tools::task::execute_script(Arc::new(new_flags), task_flags.clone()).await; diff --git a/cli/task_runner.rs b/cli/task_runner.rs index 43840e868d..ec043f280e 100644 --- a/cli/task_runner.rs +++ b/cli/task_runner.rs @@ -483,20 +483,32 @@ fn resolve_execution_path_from_npx_shim( static SCRIPT_PATH_RE: Lazy = lazy_regex::lazy_regex!(r#""\$basedir\/([^"]+)" "\$@""#); - if text.starts_with("#!/usr/bin/env node") { - // launch this file itself because it's a JS file - Some(file_path) - } else { - // Search for... - // > "$basedir/../next/dist/bin/next" "$@" - // ...which is what it will look like on Windows - SCRIPT_PATH_RE - .captures(text) - .and_then(|c| c.get(1)) - .map(|relative_path| { - file_path.parent().unwrap().join(relative_path.as_str()) - }) + let maybe_first_line = { + let index = text.find("\n")?; + Some(&text[0..index]) + }; + + if let Some(first_line) = maybe_first_line { + // NOTE(bartlomieju): this is not perfect, but handle two most common scenarios + // where Node is run without any args. If there are args then we use `NodeCommand` + // struct. + if first_line == "#!/usr/bin/env node" + || first_line == "#!/usr/bin/env -S node" + { + // launch this file itself because it's a JS file + return Some(file_path); + } } + + // Search for... + // > "$basedir/../next/dist/bin/next" "$@" + // ...which is what it will look like on Windows + SCRIPT_PATH_RE + .captures(text) + .and_then(|c| c.get(1)) + .map(|relative_path| { + file_path.parent().unwrap().join(relative_path.as_str()) + }) } fn resolve_managed_npm_commands( @@ -564,6 +576,16 @@ mod test { let unix_shim = r#"#!/usr/bin/env node "use strict"; console.log('Hi!'); +"#; + let path = PathBuf::from("/node_modules/.bin/example"); + assert_eq!( + resolve_execution_path_from_npx_shim(path.clone(), unix_shim).unwrap(), + path + ); + // example shim on unix + let unix_shim = r#"#!/usr/bin/env -S node +"use strict"; +console.log('Hi!'); "#; let path = PathBuf::from("/node_modules/.bin/example"); assert_eq!( diff --git a/cli/tools/task.rs b/cli/tools/task.rs index 682dbf814d..85145c7af7 100644 --- a/cli/tools/task.rs +++ b/cli/tools/task.rs @@ -42,7 +42,7 @@ pub async fn execute_script( let factory = CliFactory::from_flags(flags); let cli_options = factory.cli_options()?; let start_dir = &cli_options.start_dir; - if !start_dir.has_deno_or_pkg_json() { + if !start_dir.has_deno_or_pkg_json() && !task_flags.eval { bail!("deno task couldn't find deno.json(c). See https://docs.deno.com/go/config") } let force_use_pkg_json = @@ -90,6 +90,19 @@ pub async fn execute_script( concurrency: no_of_concurrent_tasks.into(), }; + if task_flags.eval { + return task_runner + .run_deno_task( + &Url::from_directory_path(cli_options.initial_cwd()).unwrap(), + &"".to_string(), + &TaskDefinition { + command: task_flags.task.as_ref().unwrap().to_string(), + dependencies: vec![], + description: None, + }, + ) + .await; + } task_runner.run_task(task_name).await } diff --git a/tests/specs/task/eval/__test__.jsonc b/tests/specs/task/eval/__test__.jsonc new file mode 100644 index 0000000000..394db3052a --- /dev/null +++ b/tests/specs/task/eval/__test__.jsonc @@ -0,0 +1,35 @@ +{ + "tests": { + "no_arg": { + "args": "task --eval", + "output": "no_arg.out", + "exitCode": 1 + }, + "echo_pwd": { + "args": ["task", "--eval", "echo $(pwd)"], + "output": "echo_pwd.out" + }, + "piped": { + "args": [ + "task", + "--eval", + "echo 12345 | (deno eval 'const b = new Uint8Array(1);Deno.stdin.readSync(b);console.log(b)' && deno eval 'const b = new Uint8Array(1);Deno.stdin.readSync(b);console.log(b)')" + ], + "output": "piped.out" + }, + "node_modules_bin": { + "tempDir": true, + "steps": [{ + "args": "install", + "output": "[WILDCARD]Initialize @denotest/bin[WILDCARD]" + }, { + "args": [ + "task", + "--eval", + "cli-esm hi hello" + ], + "output": "bin.out" + }] + } + } +} diff --git a/tests/specs/task/eval/bin.out b/tests/specs/task/eval/bin.out new file mode 100644 index 0000000000..7663216bf7 --- /dev/null +++ b/tests/specs/task/eval/bin.out @@ -0,0 +1,3 @@ +Task cli-esm hi hello +hi +hello diff --git a/tests/specs/task/eval/echo_pwd.out b/tests/specs/task/eval/echo_pwd.out new file mode 100644 index 0000000000..f0c53d8b49 --- /dev/null +++ b/tests/specs/task/eval/echo_pwd.out @@ -0,0 +1,2 @@ +Task echo $(pwd) +[WILDCARD] diff --git a/tests/specs/task/eval/no_arg.out b/tests/specs/task/eval/no_arg.out new file mode 100644 index 0000000000..e462855762 --- /dev/null +++ b/tests/specs/task/eval/no_arg.out @@ -0,0 +1,4 @@ +error: [TASK] must be specified when using --eval + +Usage: deno task [OPTIONS] [TASK] + diff --git a/tests/specs/task/eval/package.json b/tests/specs/task/eval/package.json new file mode 100644 index 0000000000..c0a34548f5 --- /dev/null +++ b/tests/specs/task/eval/package.json @@ -0,0 +1,9 @@ +{ + "name": "bin_package", + "devDependencies": { + "@denotest/bin": "1.0.0" + }, + "scripts": { + "sayhi": "cli-esm hi hello" + } +} diff --git a/tests/specs/task/eval/piped.out b/tests/specs/task/eval/piped.out new file mode 100644 index 0000000000..64ccd7ab72 --- /dev/null +++ b/tests/specs/task/eval/piped.out @@ -0,0 +1,3 @@ +Task echo 12345 | (deno eval 'const b = new Uint8Array(1);Deno.stdin.readSync(b);console.log(b)' && deno eval 'const b = new Uint8Array(1);Deno.stdin.readSync(b);console.log(b)') +Uint8Array(1) [ 49 ] +Uint8Array(1) [ 50 ] From 03f47e6cf05cb1237bc13733a0c13496f84064b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 20 Nov 2024 18:01:56 +0000 Subject: [PATCH 119/227] fix(fmt): formatting of .svelte files (#26948) Closes https://github.com/denoland/deno/issues/26690 Closes https://github.com/denoland/deno/issues/26324 --- Cargo.lock | 4 ++-- cli/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52bb39ee83..bc386c9571 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4562,9 +4562,9 @@ dependencies = [ [[package]] name = "markup_fmt" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebae65c91eab3d42231232bf48107f351e5a8d511454927218c53aeb68bbdb6f" +checksum = "f303c36143671ac6c54112eb5aa95649b169dae783fdb6ead2c0e88b408c425c" dependencies = [ "aho-corasick", "css_dataset", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 16f39e9d48..ae573827b1 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -129,7 +129,7 @@ libz-sys.workspace = true log = { workspace = true, features = ["serde"] } lsp-types.workspace = true malva = "=0.11.0" -markup_fmt = "=0.15.0" +markup_fmt = "=0.16.0" memmem.workspace = true monch.workspace = true notify.workspace = true From 8f7279862249d8274dbef2cf5f48d13f0c0ab53a Mon Sep 17 00:00:00 2001 From: Keith Tan Date: Wed, 20 Nov 2024 20:59:43 +0100 Subject: [PATCH 120/227] feat(lint): Add checked files list to the JSON output(#26936) Fixes #26930 --- cli/tools/lint/reporters.rs | 18 ++++++++++++++++++ tests/specs/lint/json/expected_json.out | 5 +++++ .../stdin_json/expected_from_stdin_json.out | 5 ++++- .../with_report_config_override.out | 5 ++++- 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/cli/tools/lint/reporters.rs b/cli/tools/lint/reporters.rs index bf80be9f20..18bc1216a6 100644 --- a/cli/tools/lint/reporters.rs +++ b/cli/tools/lint/reporters.rs @@ -175,6 +175,7 @@ struct JsonLintReporter { version: u8, diagnostics: Vec, errors: Vec, + checked_files: Vec, } impl JsonLintReporter { @@ -183,6 +184,7 @@ impl JsonLintReporter { version: JSON_SCHEMA_VERSION, diagnostics: Vec::new(), errors: Vec::new(), + checked_files: Vec::new(), } } } @@ -209,6 +211,17 @@ impl LintReporter for JsonLintReporter { code: d.code().to_string(), hint: d.hint().map(|h| h.to_string()), }); + + let file_path = d + .specifier + .to_file_path() + .unwrap() + .to_string_lossy() + .to_string(); + + if !self.checked_files.contains(&file_path) { + self.checked_files.push(file_path); + } } fn visit_error(&mut self, file_path: &str, err: &AnyError) { @@ -216,10 +229,15 @@ impl LintReporter for JsonLintReporter { file_path: file_path.to_string(), message: err.to_string(), }); + + if !self.checked_files.contains(&file_path.to_string()) { + self.checked_files.push(file_path.to_string()); + } } fn close(&mut self, _check_count: usize) { sort_diagnostics(&mut self.diagnostics); + self.checked_files.sort(); let json = serde_json::to_string_pretty(&self); #[allow(clippy::print_stdout)] { diff --git a/tests/specs/lint/json/expected_json.out b/tests/specs/lint/json/expected_json.out index 6712c891a5..242c47cf56 100644 --- a/tests/specs/lint/json/expected_json.out +++ b/tests/specs/lint/json/expected_json.out @@ -61,5 +61,10 @@ "file_path": "[WILDCARD]malformed.js", "message": "Expected '{', got 'B' at [WILDCARD]malformed.js:4:16\n\n export class A B C\n ~" } + ], + "checked_files": [ + "[WILDCARD]file1.js", + "[WILDCARD]file2.ts", + "[WILDCARD]malformed.js" ] } diff --git a/tests/specs/lint/stdin_json/expected_from_stdin_json.out b/tests/specs/lint/stdin_json/expected_from_stdin_json.out index 5788248aa2..8db157bccb 100644 --- a/tests/specs/lint/stdin_json/expected_from_stdin_json.out +++ b/tests/specs/lint/stdin_json/expected_from_stdin_json.out @@ -20,5 +20,8 @@ "hint": [WILDCARD] } ], - "errors": [] + "errors": [], + "checked_files": [ + "[WILDCARD]main.ts" + ] } diff --git a/tests/specs/lint/with_report_config_override/with_report_config_override.out b/tests/specs/lint/with_report_config_override/with_report_config_override.out index ad32e31236..fb873f187e 100644 --- a/tests/specs/lint/with_report_config_override/with_report_config_override.out +++ b/tests/specs/lint/with_report_config_override/with_report_config_override.out @@ -38,5 +38,8 @@ "hint": "If this is intentional, prefix it with an underscore like `_add`" } ], - "errors": [] + "errors": [], + "checked_files": [ + "[WILDCARD]a.ts" + ] } From cf49599359d480b0716b34a8f0a27f37e2f51e48 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Wed, 20 Nov 2024 13:24:04 -0800 Subject: [PATCH 121/227] feat: permission stack traces in ops (#26938) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit improves permission prompts by adding an option to print a full trace of where the permissions is being requested. Due to big performance hint of stack trace collection, this is only enabled when `DENO_TRACE_PERMISSIONS` env var is present. Closes https://github.com/denoland/deno/issues/20756 --------- Co-authored-by: Bartek Iwańczuk --- cli/args/flags.rs | 41 ++++++------ cli/args/mod.rs | 4 ++ cli/ops/bench.rs | 2 +- cli/ops/testing.rs | 2 +- cli/worker.rs | 4 ++ ext/fetch/lib.rs | 4 +- ext/ffi/call.rs | 4 +- ext/ffi/callback.rs | 2 +- ext/ffi/dlfcn.rs | 2 +- ext/ffi/repr.rs | 42 ++++++------ ext/fs/ops.rs | 88 ++++++++++++------------- ext/kv/lib.rs | 2 +- ext/napi/lib.rs | 2 +- ext/net/ops.rs | 12 ++-- ext/net/ops_tls.rs | 6 +- ext/net/ops_unix.rs | 12 ++-- ext/node/ops/fs.rs | 18 ++--- ext/node/ops/http.rs | 2 +- ext/node/ops/inspector.rs | 4 +- ext/node/ops/os/mod.rs | 14 ++-- ext/node/ops/process.rs | 2 +- ext/node/ops/require.rs | 18 ++--- ext/node/ops/worker_threads.rs | 2 +- ext/websocket/lib.rs | 4 +- runtime/ops/fs_events.rs | 2 +- runtime/ops/os/mod.rs | 30 ++++----- runtime/ops/permissions.rs | 2 +- runtime/ops/process.rs | 8 +-- runtime/ops/worker_host.rs | 2 +- runtime/permissions/prompter.rs | 62 ++++++++++++----- runtime/web_worker.rs | 8 +++ runtime/worker.rs | 7 ++ tests/integration/run_tests.rs | 52 ++++++++++++++- tests/testdata/run/permissions_trace.ts | 9 +++ 34 files changed, 294 insertions(+), 181 deletions(-) create mode 100644 tests/testdata/run/permissions_trace.ts diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 5d85f2861c..567d4adfb9 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -1160,25 +1160,26 @@ static ENV_VARIABLES_HELP: &str = cstr!( Docs: https://docs.deno.com/go/env-vars DENO_AUTH_TOKENS A semi-colon separated list of bearer tokens and hostnames - to use when fetching remote modules from private repositories - (e.g. "abcde12345@deno.land;54321edcba@github.com") - DENO_CERT Load certificate authorities from PEM encoded file - DENO_DIR Set the cache directory - DENO_INSTALL_ROOT Set deno install's output directory - (defaults to $HOME/.deno/bin) - DENO_NO_PACKAGE_JSON Disables auto-resolution of package.json - DENO_NO_UPDATE_CHECK Set to disable checking if a newer Deno version is available - DENO_TLS_CA_STORE Comma-separated list of order dependent certificate stores. - Possible values: "system", "mozilla". - (defaults to "mozilla") - HTTP_PROXY Proxy address for HTTP requests - (module downloads, fetch) - HTTPS_PROXY Proxy address for HTTPS requests - (module downloads, fetch) - NO_COLOR Set to disable color - NO_PROXY Comma-separated list of hosts which do not use a proxy - (module downloads, fetch) - NPM_CONFIG_REGISTRY URL to use for the npm registry."# + to use when fetching remote modules from private repositories + (e.g. "abcde12345@deno.land;54321edcba@github.com") + DENO_CERT Load certificate authorities from PEM encoded file + DENO_DIR Set the cache directory + DENO_INSTALL_ROOT Set deno install's output directory + (defaults to $HOME/.deno/bin) + DENO_NO_PACKAGE_JSON Disables auto-resolution of package.json + DENO_NO_UPDATE_CHECK Set to disable checking if a newer Deno version is available + DENO_TLS_CA_STORE Comma-separated list of order dependent certificate stores. + DENO_TRACE_PERMISSIONS Environmental variable to enable stack traces in permission prompts. + Possible values: "system", "mozilla". + (defaults to "mozilla") + HTTP_PROXY Proxy address for HTTP requests + (module downloads, fetch) + HTTPS_PROXY Proxy address for HTTPS requests + (module downloads, fetch) + NO_COLOR Set to disable color + NO_PROXY Comma-separated list of hosts which do not use a proxy + (module downloads, fetch) + NPM_CONFIG_REGISTRY URL to use for the npm registry."# ); static DENO_HELP: &str = cstr!( @@ -3346,6 +3347,8 @@ fn permission_args(app: Command, requires: Option<&'static str>) -> Command { --deny-run | --deny-run="whoami,ps" --deny-ffi[=<...] (Unstable) Deny loading dynamic libraries. Optionally specify denied directories or files. --deny-ffi | --deny-ffi="./libfoo.so" + DENO_TRACE_PERMISSIONS Environmental variable to enable stack traces in permission prompts. + DENO_TRACE_PERMISSIONS=1 deno run main.ts "#)) .arg( { diff --git a/cli/args/mod.rs b/cli/args/mod.rs index 21df6cf115..bbdfa478c1 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1912,6 +1912,10 @@ pub fn resolve_no_prompt(flags: &PermissionFlags) -> bool { flags.no_prompt || has_flag_env_var("DENO_NO_PROMPT") } +pub fn has_trace_permissions_enabled() -> bool { + has_flag_env_var("DENO_TRACE_PERMISSIONS") +} + pub fn has_flag_env_var(name: &str) -> bool { let value = env::var(name); matches!(value.as_ref().map(|s| s.as_str()), Ok("1")) diff --git a/cli/ops/bench.rs b/cli/ops/bench.rs index 1f4a4bd9b5..a7c788a189 100644 --- a/cli/ops/bench.rs +++ b/cli/ops/bench.rs @@ -51,7 +51,7 @@ fn op_bench_get_origin(state: &mut OpState) -> String { #[derive(Clone)] struct PermissionsHolder(Uuid, PermissionsContainer); -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_pledge_test_permissions( state: &mut OpState, diff --git a/cli/ops/testing.rs b/cli/ops/testing.rs index 00aafb8286..3c6936971a 100644 --- a/cli/ops/testing.rs +++ b/cli/ops/testing.rs @@ -46,7 +46,7 @@ deno_core::extension!(deno_test, #[derive(Clone)] struct PermissionsHolder(Uuid, PermissionsContainer); -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_pledge_test_permissions( state: &mut OpState, diff --git a/cli/worker.rs b/cli/worker.rs index 0b07bb4bf3..5761571c5c 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -617,6 +617,8 @@ impl CliMainWorkerFactory { origin_storage_dir, stdio, skip_op_registration: shared.options.skip_op_registration, + enable_stack_trace_arg_in_ops: crate::args::has_trace_permissions_enabled( + ), }; let mut worker = MainWorker::bootstrap_from_options( @@ -813,6 +815,8 @@ fn create_web_worker_callback( strace_ops: shared.options.strace_ops.clone(), close_on_idle: args.close_on_idle, maybe_worker_metadata: args.maybe_worker_metadata, + enable_stack_trace_arg_in_ops: crate::args::has_trace_permissions_enabled( + ), }; WebWorker::bootstrap_from_options(services, options) diff --git a/ext/fetch/lib.rs b/ext/fetch/lib.rs index c8e93b9fea..303c955622 100644 --- a/ext/fetch/lib.rs +++ b/ext/fetch/lib.rs @@ -397,7 +397,7 @@ impl FetchPermissions for deno_permissions::PermissionsContainer { } } -#[op2] +#[op2(stack_trace)] #[serde] #[allow(clippy::too_many_arguments)] pub fn op_fetch( @@ -866,7 +866,7 @@ fn default_true() -> bool { true } -#[op2] +#[op2(stack_trace)] #[smi] pub fn op_fetch_custom_client( state: &mut OpState, diff --git a/ext/ffi/call.rs b/ext/ffi/call.rs index bbff0ee48f..c964071a09 100644 --- a/ext/ffi/call.rs +++ b/ext/ffi/call.rs @@ -287,7 +287,7 @@ fn ffi_call( } } -#[op2(async)] +#[op2(async, stack_trace)] #[serde] pub fn op_ffi_call_ptr_nonblocking( scope: &mut v8::HandleScope, @@ -385,7 +385,7 @@ pub fn op_ffi_call_nonblocking( }) } -#[op2(reentrant)] +#[op2(reentrant, stack_trace)] #[serde] pub fn op_ffi_call_ptr( scope: &mut v8::HandleScope, diff --git a/ext/ffi/callback.rs b/ext/ffi/callback.rs index 29583c800c..eff14503d1 100644 --- a/ext/ffi/callback.rs +++ b/ext/ffi/callback.rs @@ -561,7 +561,7 @@ pub struct RegisterCallbackArgs { result: NativeType, } -#[op2] +#[op2(stack_trace)] pub fn op_ffi_unsafe_callback_create( state: &mut OpState, scope: &mut v8::HandleScope<'scope>, diff --git a/ext/ffi/dlfcn.rs b/ext/ffi/dlfcn.rs index 26d1b71e9f..e1bb121d8c 100644 --- a/ext/ffi/dlfcn.rs +++ b/ext/ffi/dlfcn.rs @@ -124,7 +124,7 @@ pub struct FfiLoadArgs { symbols: HashMap, } -#[op2] +#[op2(stack_trace)] pub fn op_ffi_load<'scope, FP>( scope: &mut v8::HandleScope<'scope>, state: Rc>, diff --git a/ext/ffi/repr.rs b/ext/ffi/repr.rs index fd8a2c8e70..eea15f3e97 100644 --- a/ext/ffi/repr.rs +++ b/ext/ffi/repr.rs @@ -49,7 +49,7 @@ pub enum ReprError { Permission(#[from] deno_permissions::PermissionCheckError), } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_ffi_ptr_create( state: &mut OpState, #[bigint] ptr_number: usize, @@ -63,7 +63,7 @@ where Ok(ptr_number as *mut c_void) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_ffi_ptr_equals( state: &mut OpState, a: *const c_void, @@ -78,7 +78,7 @@ where Ok(a == b) } -#[op2] +#[op2(stack_trace)] pub fn op_ffi_ptr_of( state: &mut OpState, #[anybuffer] buf: *const u8, @@ -92,7 +92,7 @@ where Ok(buf as *mut c_void) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_ffi_ptr_of_exact( state: &mut OpState, buf: v8::Local, @@ -112,7 +112,7 @@ where Ok(buf.as_ptr() as _) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_ffi_ptr_offset( state: &mut OpState, ptr: *mut c_void, @@ -142,7 +142,7 @@ unsafe extern "C" fn noop_deleter_callback( ) { } -#[op2(fast)] +#[op2(fast, stack_trace)] #[bigint] pub fn op_ffi_ptr_value( state: &mut OpState, @@ -157,7 +157,7 @@ where Ok(ptr as usize) } -#[op2] +#[op2(stack_trace)] pub fn op_ffi_get_buf( scope: &mut v8::HandleScope<'scope>, state: &mut OpState, @@ -189,7 +189,7 @@ where Ok(array_buffer) } -#[op2] +#[op2(stack_trace)] pub fn op_ffi_buf_copy_into( state: &mut OpState, src: *mut c_void, @@ -219,7 +219,7 @@ where } } -#[op2] +#[op2(stack_trace)] pub fn op_ffi_cstr_read( scope: &mut v8::HandleScope<'scope>, state: &mut OpState, @@ -244,7 +244,7 @@ where Ok(value) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_ffi_read_bool( state: &mut OpState, ptr: *mut c_void, @@ -264,7 +264,7 @@ where Ok(unsafe { ptr::read_unaligned::(ptr.offset(offset) as *const bool) }) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_ffi_read_u8( state: &mut OpState, ptr: *mut c_void, @@ -286,7 +286,7 @@ where }) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_ffi_read_i8( state: &mut OpState, ptr: *mut c_void, @@ -308,7 +308,7 @@ where }) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_ffi_read_u16( state: &mut OpState, ptr: *mut c_void, @@ -330,7 +330,7 @@ where }) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_ffi_read_i16( state: &mut OpState, ptr: *mut c_void, @@ -352,7 +352,7 @@ where }) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_ffi_read_u32( state: &mut OpState, ptr: *mut c_void, @@ -372,7 +372,7 @@ where Ok(unsafe { ptr::read_unaligned::(ptr.offset(offset) as *const u32) }) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_ffi_read_i32( state: &mut OpState, ptr: *mut c_void, @@ -392,7 +392,7 @@ where Ok(unsafe { ptr::read_unaligned::(ptr.offset(offset) as *const i32) }) } -#[op2(fast)] +#[op2(fast, stack_trace)] #[bigint] pub fn op_ffi_read_u64( state: &mut OpState, @@ -418,7 +418,7 @@ where Ok(value) } -#[op2(fast)] +#[op2(fast, stack_trace)] #[bigint] pub fn op_ffi_read_i64( state: &mut OpState, @@ -444,7 +444,7 @@ where Ok(value) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_ffi_read_f32( state: &mut OpState, ptr: *mut c_void, @@ -464,7 +464,7 @@ where Ok(unsafe { ptr::read_unaligned::(ptr.offset(offset) as *const f32) }) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_ffi_read_f64( state: &mut OpState, ptr: *mut c_void, @@ -484,7 +484,7 @@ where Ok(unsafe { ptr::read_unaligned::(ptr.offset(offset) as *const f64) }) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_ffi_read_ptr( state: &mut OpState, ptr: *mut c_void, diff --git a/ext/fs/ops.rs b/ext/fs/ops.rs index e3a511f8e7..7a9778c485 100644 --- a/ext/fs/ops.rs +++ b/ext/fs/ops.rs @@ -146,7 +146,7 @@ fn map_permission_error( } } -#[op2] +#[op2(stack_trace)] #[string] pub fn op_fs_cwd

(state: &mut OpState) -> Result where @@ -161,7 +161,7 @@ where Ok(path_str) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_fs_chdir

( state: &mut OpState, #[string] directory: &str, @@ -188,7 +188,7 @@ where state.borrow::().umask(mask).context("umask") } -#[op2] +#[op2(stack_trace)] #[smi] pub fn op_fs_open_sync

( state: &mut OpState, @@ -215,7 +215,7 @@ where Ok(rid) } -#[op2(async)] +#[op2(async, stack_trace)] #[smi] pub async fn op_fs_open_async

( state: Rc>, @@ -243,7 +243,7 @@ where Ok(rid) } -#[op2] +#[op2(stack_trace)] pub fn op_fs_mkdir_sync

( state: &mut OpState, #[string] path: String, @@ -266,7 +266,7 @@ where Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] pub async fn op_fs_mkdir_async

( state: Rc>, #[string] path: String, @@ -291,7 +291,7 @@ where Ok(()) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_fs_chmod_sync

( state: &mut OpState, #[string] path: String, @@ -308,7 +308,7 @@ where Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] pub async fn op_fs_chmod_async

( state: Rc>, #[string] path: String, @@ -328,7 +328,7 @@ where Ok(()) } -#[op2] +#[op2(stack_trace)] pub fn op_fs_chown_sync

( state: &mut OpState, #[string] path: String, @@ -347,7 +347,7 @@ where Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] pub async fn op_fs_chown_async

( state: Rc>, #[string] path: String, @@ -368,7 +368,7 @@ where Ok(()) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_fs_remove_sync

( state: &mut OpState, #[string] path: &str, @@ -388,7 +388,7 @@ where Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] pub async fn op_fs_remove_async

( state: Rc>, #[string] path: String, @@ -419,7 +419,7 @@ where Ok(()) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_fs_copy_file_sync

( state: &mut OpState, #[string] from: &str, @@ -439,7 +439,7 @@ where Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] pub async fn op_fs_copy_file_async

( state: Rc>, #[string] from: String, @@ -463,7 +463,7 @@ where Ok(()) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_fs_stat_sync

( state: &mut OpState, #[string] path: String, @@ -482,7 +482,7 @@ where Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] #[serde] pub async fn op_fs_stat_async

( state: Rc>, @@ -504,7 +504,7 @@ where Ok(SerializableStat::from(stat)) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_fs_lstat_sync

( state: &mut OpState, #[string] path: String, @@ -523,7 +523,7 @@ where Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] #[serde] pub async fn op_fs_lstat_async

( state: Rc>, @@ -545,7 +545,7 @@ where Ok(SerializableStat::from(stat)) } -#[op2] +#[op2(stack_trace)] #[string] pub fn op_fs_realpath_sync

( state: &mut OpState, @@ -568,7 +568,7 @@ where Ok(path_string) } -#[op2(async)] +#[op2(async, stack_trace)] #[string] pub async fn op_fs_realpath_async

( state: Rc>, @@ -596,7 +596,7 @@ where Ok(path_string) } -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_fs_read_dir_sync

( state: &mut OpState, @@ -615,7 +615,7 @@ where Ok(entries) } -#[op2(async)] +#[op2(async, stack_trace)] #[serde] pub async fn op_fs_read_dir_async

( state: Rc>, @@ -640,7 +640,7 @@ where Ok(entries) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_fs_rename_sync

( state: &mut OpState, #[string] oldpath: String, @@ -661,7 +661,7 @@ where Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] pub async fn op_fs_rename_async

( state: Rc>, #[string] oldpath: String, @@ -686,7 +686,7 @@ where Ok(()) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_fs_link_sync

( state: &mut OpState, #[string] oldpath: &str, @@ -708,7 +708,7 @@ where Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] pub async fn op_fs_link_async

( state: Rc>, #[string] oldpath: String, @@ -734,7 +734,7 @@ where Ok(()) } -#[op2] +#[op2(stack_trace)] pub fn op_fs_symlink_sync

( state: &mut OpState, #[string] oldpath: &str, @@ -758,7 +758,7 @@ where Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] pub async fn op_fs_symlink_async

( state: Rc>, #[string] oldpath: String, @@ -786,7 +786,7 @@ where Ok(()) } -#[op2] +#[op2(stack_trace)] #[string] pub fn op_fs_read_link_sync

( state: &mut OpState, @@ -806,7 +806,7 @@ where Ok(target_string) } -#[op2(async)] +#[op2(async, stack_trace)] #[string] pub async fn op_fs_read_link_async

( state: Rc>, @@ -831,7 +831,7 @@ where Ok(target_string) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_fs_truncate_sync

( state: &mut OpState, #[string] path: &str, @@ -851,7 +851,7 @@ where Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] pub async fn op_fs_truncate_async

( state: Rc>, #[string] path: String, @@ -875,7 +875,7 @@ where Ok(()) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_fs_utime_sync

( state: &mut OpState, #[string] path: &str, @@ -896,7 +896,7 @@ where Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] pub async fn op_fs_utime_async

( state: Rc>, #[string] path: String, @@ -927,7 +927,7 @@ where Ok(()) } -#[op2] +#[op2(stack_trace)] #[string] pub fn op_fs_make_temp_dir_sync

( state: &mut OpState, @@ -969,7 +969,7 @@ where .context("tmpdir") } -#[op2(async)] +#[op2(async, stack_trace)] #[string] pub async fn op_fs_make_temp_dir_async

( state: Rc>, @@ -1015,7 +1015,7 @@ where .context("tmpdir") } -#[op2] +#[op2(stack_trace)] #[string] pub fn op_fs_make_temp_file_sync

( state: &mut OpState, @@ -1063,7 +1063,7 @@ where .context("tmpfile") } -#[op2(async)] +#[op2(async, stack_trace)] #[string] pub async fn op_fs_make_temp_file_async

( state: Rc>, @@ -1235,7 +1235,7 @@ fn tmp_name( Ok(path) } -#[op2] +#[op2(stack_trace)] pub fn op_fs_write_file_sync

( state: &mut OpState, #[string] path: String, @@ -1261,7 +1261,7 @@ where Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] #[allow(clippy::too_many_arguments)] pub async fn op_fs_write_file_async

( state: Rc>, @@ -1315,7 +1315,7 @@ where Ok(()) } -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_fs_read_file_sync

( state: &mut OpState, @@ -1336,7 +1336,7 @@ where Ok(buf.into()) } -#[op2(async)] +#[op2(async, stack_trace)] #[serde] pub async fn op_fs_read_file_async

( state: Rc>, @@ -1378,7 +1378,7 @@ where Ok(buf.into()) } -#[op2] +#[op2(stack_trace)] #[string] pub fn op_fs_read_file_text_sync

( state: &mut OpState, @@ -1399,7 +1399,7 @@ where Ok(str) } -#[op2(async)] +#[op2(async, stack_trace)] #[string] pub async fn op_fs_read_file_text_async

( state: Rc>, diff --git a/ext/kv/lib.rs b/ext/kv/lib.rs index 5392b97210..ce7509721a 100644 --- a/ext/kv/lib.rs +++ b/ext/kv/lib.rs @@ -178,7 +178,7 @@ pub enum KvErrorKind { InvalidRange, } -#[op2(async)] +#[op2(async, stack_trace)] #[smi] async fn op_kv_database_open( state: Rc>, diff --git a/ext/napi/lib.rs b/ext/napi/lib.rs index 88b8c238df..6db6af48a2 100644 --- a/ext/napi/lib.rs +++ b/ext/napi/lib.rs @@ -530,7 +530,7 @@ static NAPI_LOADED_MODULES: std::sync::LazyLock< RwLock>, > = std::sync::LazyLock::new(|| RwLock::new(HashMap::new())); -#[op2(reentrant)] +#[op2(reentrant, stack_trace)] fn op_napi_open( scope: &mut v8::HandleScope<'scope>, isolate: *mut v8::Isolate, diff --git a/ext/net/ops.rs b/ext/net/ops.rs index 9a8b70f0f6..8d62bdeb4d 100644 --- a/ext/net/ops.rs +++ b/ext/net/ops.rs @@ -182,7 +182,7 @@ pub async fn op_net_recv_udp( Ok((nread, IpAddr::from(remote_addr))) } -#[op2(async)] +#[op2(async, stack_trace)] #[number] pub async fn op_net_send_udp( state: Rc>, @@ -343,7 +343,7 @@ pub async fn op_net_set_multi_ttl_udp( Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] #[serde] pub async fn op_net_connect_tcp( state: Rc>, @@ -401,7 +401,7 @@ impl Resource for UdpSocketResource { } } -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_net_listen_tcp( state: &mut OpState, @@ -501,7 +501,7 @@ where Ok((rid, IpAddr::from(local_addr))) } -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_net_listen_udp( state: &mut OpState, @@ -516,7 +516,7 @@ where net_listen_udp::(state, addr, reuse_address, loopback) } -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_node_unstable_net_listen_udp( state: &mut OpState, @@ -601,7 +601,7 @@ pub struct NameServer { port: u16, } -#[op2(async)] +#[op2(async, stack_trace)] #[serde] pub async fn op_dns_resolve( state: Rc>, diff --git a/ext/net/ops_tls.rs b/ext/net/ops_tls.rs index c7d65dd85e..4d2073fd09 100644 --- a/ext/net/ops_tls.rs +++ b/ext/net/ops_tls.rs @@ -251,7 +251,7 @@ pub fn op_tls_cert_resolver_resolve_error( lookup.resolve(sni, Err(error)) } -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_tls_start( state: Rc>, @@ -340,7 +340,7 @@ where Ok((rid, IpAddr::from(local_addr), IpAddr::from(remote_addr))) } -#[op2(async)] +#[op2(async, stack_trace)] #[serde] pub async fn op_net_connect_tls( state: Rc>, @@ -445,7 +445,7 @@ pub struct ListenTlsArgs { load_balanced: bool, } -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_net_listen_tls( state: &mut OpState, diff --git a/ext/net/ops_unix.rs b/ext/net/ops_unix.rs index 04ae84906f..483dc99b40 100644 --- a/ext/net/ops_unix.rs +++ b/ext/net/ops_unix.rs @@ -85,7 +85,7 @@ pub async fn op_net_accept_unix( Ok((rid, local_addr_path, remote_addr_path)) } -#[op2(async)] +#[op2(async, stack_trace)] #[serde] pub async fn op_net_connect_unix( state: Rc>, @@ -118,7 +118,7 @@ where Ok((rid, local_addr_path, remote_addr_path)) } -#[op2(async)] +#[op2(async, stack_trace)] #[serde] pub async fn op_net_recv_unixpacket( state: Rc>, @@ -140,7 +140,7 @@ pub async fn op_net_recv_unixpacket( Ok((nread, path)) } -#[op2(async)] +#[op2(async, stack_trace)] #[number] pub async fn op_net_send_unixpacket( state: Rc>, @@ -171,7 +171,7 @@ where Ok(nwritten) } -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_net_listen_unix( state: &mut OpState, @@ -222,7 +222,7 @@ where Ok((rid, pathname)) } -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_net_listen_unixpacket( state: &mut OpState, @@ -235,7 +235,7 @@ where net_listen_unixpacket::(state, path) } -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_node_unstable_net_listen_unixpacket( state: &mut OpState, diff --git a/ext/node/ops/fs.rs b/ext/node/ops/fs.rs index 9c0e4e1ccf..58a688a1fe 100644 --- a/ext/node/ops/fs.rs +++ b/ext/node/ops/fs.rs @@ -26,7 +26,7 @@ pub enum FsError { Fs(#[from] deno_io::fs::FsError), } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_node_fs_exists_sync

( state: &mut OpState, #[string] path: String, @@ -41,7 +41,7 @@ where Ok(fs.exists_sync(&path)) } -#[op2(async)] +#[op2(async, stack_trace)] pub async fn op_node_fs_exists

( state: Rc>, #[string] path: String, @@ -60,7 +60,7 @@ where Ok(fs.exists_async(path).await?) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_node_cp_sync

( state: &mut OpState, #[string] path: &str, @@ -81,7 +81,7 @@ where Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] pub async fn op_node_cp

( state: Rc>, #[string] path: String, @@ -117,7 +117,7 @@ pub struct StatFs { pub ffree: u64, } -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_node_statfs

( state: Rc>, @@ -258,7 +258,7 @@ where } } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_node_lutimes_sync

( state: &mut OpState, #[string] path: &str, @@ -279,7 +279,7 @@ where Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] pub async fn op_node_lutimes

( state: Rc>, #[string] path: String, @@ -305,7 +305,7 @@ where Ok(()) } -#[op2] +#[op2(stack_trace)] pub fn op_node_lchown_sync

( state: &mut OpState, #[string] path: String, @@ -323,7 +323,7 @@ where Ok(()) } -#[op2(async)] +#[op2(async, stack_trace)] pub async fn op_node_lchown

( state: Rc>, #[string] path: String, diff --git a/ext/node/ops/http.rs b/ext/node/ops/http.rs index 69571078fe..f4adb94060 100644 --- a/ext/node/ops/http.rs +++ b/ext/node/ops/http.rs @@ -49,7 +49,7 @@ use std::cmp::min; use tokio::io::AsyncReadExt; use tokio::io::AsyncWriteExt; -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_node_http_request

( state: &mut OpState, diff --git a/ext/node/ops/inspector.rs b/ext/node/ops/inspector.rs index 34a7e004c1..9986aeb197 100644 --- a/ext/node/ops/inspector.rs +++ b/ext/node/ops/inspector.rs @@ -20,7 +20,7 @@ pub fn op_inspector_enabled() -> bool { false } -#[op2] +#[op2(stack_trace)] pub fn op_inspector_open

( _state: &mut OpState, _port: Option, @@ -85,7 +85,7 @@ struct JSInspectorSession { impl GarbageCollected for JSInspectorSession {} -#[op2] +#[op2(stack_trace)] #[cppgc] pub fn op_inspector_connect<'s, P>( isolate: *mut v8::Isolate, diff --git a/ext/node/ops/os/mod.rs b/ext/node/ops/os/mod.rs index d291277ad4..ddb2a70c64 100644 --- a/ext/node/ops/os/mod.rs +++ b/ext/node/ops/os/mod.rs @@ -21,7 +21,7 @@ pub enum OsError { FailedToGetUserInfo(#[source] std::io::Error), } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_node_os_get_priority

( state: &mut OpState, pid: u32, @@ -37,7 +37,7 @@ where priority::get_priority(pid).map_err(OsError::Priority) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_node_os_set_priority

( state: &mut OpState, pid: u32, @@ -193,7 +193,7 @@ fn get_user_info(_uid: u32) -> Result { }) } -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_node_os_user_info

( state: &mut OpState, @@ -212,7 +212,7 @@ where get_user_info(uid) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_geteuid

( state: &mut OpState, ) -> Result @@ -233,7 +233,7 @@ where Ok(euid) } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_getegid

( state: &mut OpState, ) -> Result @@ -254,7 +254,7 @@ where Ok(egid) } -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_cpus

(state: &mut OpState) -> Result, OsError> where @@ -268,7 +268,7 @@ where cpus::cpu_info().ok_or(OsError::FailedToGetCpuInfo) } -#[op2] +#[op2(stack_trace)] #[string] pub fn op_homedir

( state: &mut OpState, diff --git a/ext/node/ops/process.rs b/ext/node/ops/process.rs index 282567226e..45c599bee2 100644 --- a/ext/node/ops/process.rs +++ b/ext/node/ops/process.rs @@ -45,7 +45,7 @@ fn kill(pid: i32, _sig: i32) -> i32 { } } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_node_process_kill( state: &mut OpState, #[smi] pid: i32, diff --git a/ext/node/ops/require.rs b/ext/node/ops/require.rs index 06c034fd50..f8de07a3be 100644 --- a/ext/node/ops/require.rs +++ b/ext/node/ops/require.rs @@ -125,7 +125,7 @@ pub fn op_require_init_paths() -> Vec { vec![] } -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_require_node_module_paths

( state: &mut OpState, @@ -295,7 +295,7 @@ pub fn op_require_path_is_absolute(#[string] p: String) -> bool { PathBuf::from(p).is_absolute() } -#[op2(fast)] +#[op2(fast, stack_trace)] pub fn op_require_stat

( state: &mut OpState, #[string] path: String, @@ -317,7 +317,7 @@ where Ok(-1) } -#[op2] +#[op2(stack_trace)] #[string] pub fn op_require_real_path

( state: &mut OpState, @@ -381,7 +381,7 @@ pub fn op_require_path_basename( } } -#[op2] +#[op2(stack_trace)] #[string] pub fn op_require_try_self_parent_path

( state: &mut OpState, @@ -412,7 +412,7 @@ where Ok(None) } -#[op2] +#[op2(stack_trace)] #[string] pub fn op_require_try_self

( state: &mut OpState, @@ -476,7 +476,7 @@ where } } -#[op2] +#[op2(stack_trace)] #[string] pub fn op_require_read_file

( state: &mut OpState, @@ -507,7 +507,7 @@ pub fn op_require_as_file_path(#[string] file_or_url: String) -> String { file_or_url } -#[op2] +#[op2(stack_trace)] #[string] pub fn op_require_resolve_exports

( state: &mut OpState, @@ -583,7 +583,7 @@ pub fn op_require_is_maybe_cjs( loader.is_maybe_cjs(&url) } -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_require_read_package_scope

( state: &mut OpState, @@ -604,7 +604,7 @@ where .flatten() } -#[op2] +#[op2(stack_trace)] #[string] pub fn op_require_package_imports_resolve

( state: &mut OpState, diff --git a/ext/node/ops/worker_threads.rs b/ext/node/ops/worker_threads.rs index d2e5758826..37a7b477d0 100644 --- a/ext/node/ops/worker_threads.rs +++ b/ext/node/ops/worker_threads.rs @@ -45,7 +45,7 @@ pub enum WorkerThreadsFilenameError { } // todo(dsherret): we should remove this and do all this work inside op_create_worker -#[op2] +#[op2(stack_trace)] #[string] pub fn op_worker_threads_filename

( state: &mut OpState, diff --git a/ext/websocket/lib.rs b/ext/websocket/lib.rs index a5734271cf..5aef1a7a55 100644 --- a/ext/websocket/lib.rs +++ b/ext/websocket/lib.rs @@ -148,7 +148,7 @@ impl Resource for WsCancelResource { // This op is needed because creating a WS instance in JavaScript is a sync // operation and should throw error when permissions are not fulfilled, // but actual op that connects WS is async. -#[op2] +#[op2(stack_trace)] #[smi] pub fn op_ws_check_permission_and_cancel_handle( state: &mut OpState, @@ -443,7 +443,7 @@ fn populate_common_request_headers( Ok(request) } -#[op2(async)] +#[op2(async, stack_trace)] #[serde] pub async fn op_ws_create( state: Rc>, diff --git a/runtime/ops/fs_events.rs b/runtime/ops/fs_events.rs index c8e0228bc0..a91722f91a 100644 --- a/runtime/ops/fs_events.rs +++ b/runtime/ops/fs_events.rs @@ -162,7 +162,7 @@ fn start_watcher( Ok(()) } -#[op2] +#[op2(stack_trace)] #[smi] fn op_fs_events_open( state: &mut OpState, diff --git a/runtime/ops/os/mod.rs b/runtime/ops/os/mod.rs index 74c708c532..b8ebc88bed 100644 --- a/runtime/ops/os/mod.rs +++ b/runtime/ops/os/mod.rs @@ -87,7 +87,7 @@ pub enum OsError { Io(#[from] std::io::Error), } -#[op2] +#[op2(stack_trace)] #[string] fn op_exec_path(state: &mut OpState) -> Result { let current_exe = env::current_exe().unwrap(); @@ -103,7 +103,7 @@ fn op_exec_path(state: &mut OpState) -> Result { .map_err(OsError::InvalidUtf8) } -#[op2(fast)] +#[op2(fast, stack_trace)] fn op_set_env( state: &mut OpState, #[string] key: &str, @@ -123,7 +123,7 @@ fn op_set_env( Ok(()) } -#[op2] +#[op2(stack_trace)] #[serde] fn op_env( state: &mut OpState, @@ -132,7 +132,7 @@ fn op_env( Ok(env::vars().collect()) } -#[op2] +#[op2(stack_trace)] #[string] fn op_get_env( state: &mut OpState, @@ -159,7 +159,7 @@ fn op_get_env( Ok(r) } -#[op2(fast)] +#[op2(fast, stack_trace)] fn op_delete_env( state: &mut OpState, #[string] key: String, @@ -189,7 +189,7 @@ fn op_exit(state: &mut OpState) { crate::exit(code) } -#[op2] +#[op2(stack_trace)] #[serde] fn op_loadavg( state: &mut OpState, @@ -200,7 +200,7 @@ fn op_loadavg( Ok(sys_info::loadavg()) } -#[op2] +#[op2(stack_trace, stack_trace)] #[string] fn op_hostname( state: &mut OpState, @@ -211,7 +211,7 @@ fn op_hostname( Ok(sys_info::hostname()) } -#[op2] +#[op2(stack_trace)] #[string] fn op_os_release( state: &mut OpState, @@ -222,7 +222,7 @@ fn op_os_release( Ok(sys_info::os_release()) } -#[op2] +#[op2(stack_trace)] #[serde] fn op_network_interfaces( state: &mut OpState, @@ -274,7 +274,7 @@ impl From for NetworkInterface { } } -#[op2] +#[op2(stack_trace)] #[serde] fn op_system_memory_info( state: &mut OpState, @@ -286,7 +286,7 @@ fn op_system_memory_info( } #[cfg(not(windows))] -#[op2] +#[op2(stack_trace)] #[smi] fn op_gid( state: &mut OpState, @@ -302,7 +302,7 @@ fn op_gid( } #[cfg(windows)] -#[op2] +#[op2(stack_trace)] #[smi] fn op_gid( state: &mut OpState, @@ -314,7 +314,7 @@ fn op_gid( } #[cfg(not(windows))] -#[op2] +#[op2(stack_trace)] #[smi] fn op_uid( state: &mut OpState, @@ -330,7 +330,7 @@ fn op_uid( } #[cfg(windows)] -#[op2] +#[op2(stack_trace)] #[smi] fn op_uid( state: &mut OpState, @@ -519,7 +519,7 @@ fn os_uptime(state: &mut OpState) -> Result { Ok(sys_info::os_uptime()) } -#[op2(fast)] +#[op2(fast, stack_trace)] #[number] fn op_os_uptime( state: &mut OpState, diff --git a/runtime/ops/permissions.rs b/runtime/ops/permissions.rs index 9ad963f3bc..b5f9e284df 100644 --- a/runtime/ops/permissions.rs +++ b/runtime/ops/permissions.rs @@ -99,7 +99,7 @@ pub fn op_revoke_permission( Ok(PermissionStatus::from(perm)) } -#[op2] +#[op2(stack_trace)] #[serde] pub fn op_request_permission( state: &mut OpState, diff --git a/runtime/ops/process.rs b/runtime/ops/process.rs index ee2f660dcc..83d9317d32 100644 --- a/runtime/ops/process.rs +++ b/runtime/ops/process.rs @@ -802,7 +802,7 @@ fn get_requires_allow_all_env_vars(env: &RunEnv) -> Vec<&str> { found_envs } -#[op2] +#[op2(stack_trace)] #[serde] fn op_spawn_child( state: &mut OpState, @@ -844,7 +844,7 @@ async fn op_spawn_wait( Ok(result) } -#[op2] +#[op2(stack_trace)] #[serde] fn op_spawn_sync( state: &mut OpState, @@ -928,7 +928,7 @@ mod deprecated { stderr_rid: Option, } - #[op2] + #[op2(stack_trace)] #[serde] pub fn op_run( state: &mut OpState, @@ -1129,7 +1129,7 @@ mod deprecated { } } - #[op2(fast)] + #[op2(fast, stack_trace)] pub fn op_kill( state: &mut OpState, #[smi] pid: i32, diff --git a/runtime/ops/worker_host.rs b/runtime/ops/worker_host.rs index 521284a6a0..131bad1962 100644 --- a/runtime/ops/worker_host.rs +++ b/runtime/ops/worker_host.rs @@ -133,7 +133,7 @@ pub enum CreateWorkerError { } /// Create worker as the host -#[op2] +#[op2(stack_trace)] #[serde] fn op_create_worker( state: &mut OpState, diff --git a/runtime/permissions/prompter.rs b/runtime/permissions/prompter.rs index 168a845a29..0272744cc2 100644 --- a/runtime/permissions/prompter.rs +++ b/runtime/permissions/prompter.rs @@ -1,5 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use crate::is_standalone; +use deno_core::error::JsStackFrame; use deno_core::parking_lot::Mutex; use deno_terminal::colors; use once_cell::sync::Lazy; @@ -10,8 +12,6 @@ use std::io::StderrLock; use std::io::StdinLock; use std::io::Write as IoWrite; -use crate::is_standalone; - /// Helper function to make control characters visible so users can see the underlying filename. fn escape_control_characters(s: &str) -> std::borrow::Cow { if !s.contains(|c: char| c.is_ascii_control() || c.is_control()) { @@ -53,6 +53,13 @@ static MAYBE_BEFORE_PROMPT_CALLBACK: Lazy>> = static MAYBE_AFTER_PROMPT_CALLBACK: Lazy>> = Lazy::new(|| Mutex::new(None)); +static MAYBE_CURRENT_STACKTRACE: Lazy>>> = + Lazy::new(|| Mutex::new(None)); + +pub fn set_current_stacktrace(trace: Vec) { + *MAYBE_CURRENT_STACKTRACE.lock() = Some(trace); +} + pub fn permission_prompt( message: &str, flag: &str, @@ -62,9 +69,10 @@ pub fn permission_prompt( if let Some(before_callback) = MAYBE_BEFORE_PROMPT_CALLBACK.lock().as_mut() { before_callback(); } + let stack = MAYBE_CURRENT_STACKTRACE.lock().take(); let r = PERMISSION_PROMPTER .lock() - .prompt(message, flag, api_name, is_unary); + .prompt(message, flag, api_name, is_unary, stack); if let Some(after_callback) = MAYBE_AFTER_PROMPT_CALLBACK.lock().as_mut() { after_callback(); } @@ -92,6 +100,7 @@ pub trait PermissionPrompter: Send + Sync { name: &str, api_name: Option<&str>, is_unary: bool, + stack: Option>, ) -> PromptResponse; } @@ -298,6 +307,7 @@ impl PermissionPrompter for TtyPrompter { name: &str, api_name: Option<&str>, is_unary: bool, + stack: Option>, ) -> PromptResponse { if !std::io::stdin().is_terminal() || !std::io::stderr().is_terminal() { return PromptResponse::Deny; @@ -340,7 +350,7 @@ impl PermissionPrompter for TtyPrompter { }; // output everything in one shot to make the tests more reliable - { + let stack_lines_count = { let mut output = String::new(); write!(&mut output, "┏ {PERMISSION_EMOJI} ").unwrap(); write!(&mut output, "{}", colors::bold("Deno requests ")).unwrap(); @@ -354,6 +364,27 @@ impl PermissionPrompter for TtyPrompter { ) .unwrap(); } + let stack_lines_count = if let Some(stack) = stack { + let len = stack.len(); + for (idx, frame) in stack.into_iter().enumerate() { + writeln!( + &mut output, + "┃ {} {}", + colors::gray(if idx != len - 1 { "├─" } else { "└─" }), + colors::gray(deno_core::error::format_frame::< + deno_core::error::NoAnsiColors, + >(&frame)) + ) + .unwrap(); + } + len + } else { + writeln!( + &mut output, + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.", + ).unwrap(); + 1 + }; let msg = format!( "Learn more at: {}", colors::cyan_with_underline(&format!( @@ -372,7 +403,9 @@ impl PermissionPrompter for TtyPrompter { write!(&mut output, " {opts} > ").unwrap(); stderr_lock.write_all(output.as_bytes()).unwrap(); - } + + stack_lines_count + }; let value = loop { // Clear stdin each time we loop around in case the user accidentally pasted @@ -391,30 +424,24 @@ impl PermissionPrompter for TtyPrompter { if result.is_err() || input.len() != 1 { break PromptResponse::Deny; }; + + let clear_n = if api_name.is_some() { 5 } else { 4 } + stack_lines_count; + match input.as_bytes()[0] as char { 'y' | 'Y' => { - clear_n_lines( - &mut stderr_lock, - if api_name.is_some() { 5 } else { 4 }, - ); + clear_n_lines(&mut stderr_lock, clear_n); let msg = format!("Granted {message}."); writeln!(stderr_lock, "✅ {}", colors::bold(&msg)).unwrap(); break PromptResponse::Allow; } 'n' | 'N' | '\x1b' => { - clear_n_lines( - &mut stderr_lock, - if api_name.is_some() { 5 } else { 4 }, - ); + clear_n_lines(&mut stderr_lock, clear_n); let msg = format!("Denied {message}."); writeln!(stderr_lock, "❌ {}", colors::bold(&msg)).unwrap(); break PromptResponse::Deny; } 'A' if is_unary => { - clear_n_lines( - &mut stderr_lock, - if api_name.is_some() { 5 } else { 4 }, - ); + clear_n_lines(&mut stderr_lock, clear_n); let msg = format!("Granted all {name} access."); writeln!(stderr_lock, "✅ {}", colors::bold(&msg)).unwrap(); break PromptResponse::AllowAll; @@ -475,6 +502,7 @@ pub mod tests { _name: &str, _api_name: Option<&str>, _is_unary: bool, + _stack: Option>, ) -> PromptResponse { if STUB_PROMPT_VALUE.load(Ordering::SeqCst) { PromptResponse::Allow diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs index a282d11b9a..214ae59c80 100644 --- a/runtime/web_worker.rs +++ b/runtime/web_worker.rs @@ -373,6 +373,7 @@ pub struct WebWorkerOptions { pub strace_ops: Option>, pub close_on_idle: bool, pub maybe_worker_metadata: Option, + pub enable_stack_trace_arg_in_ops: bool, } /// This struct is an implementation of `Worker` Web API @@ -585,6 +586,13 @@ impl WebWorker { validate_import_attributes_callback, )), import_assertions_support: deno_core::ImportAssertionsSupport::Error, + maybe_op_stack_trace_callback: if options.enable_stack_trace_arg_in_ops { + Some(Box::new(|stack| { + deno_permissions::prompter::set_current_stacktrace(stack) + })) + } else { + None + }, ..Default::default() }); diff --git a/runtime/worker.rs b/runtime/worker.rs index 97cbb6428f..65fc99c766 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -207,6 +207,7 @@ pub struct WorkerOptions { pub cache_storage_dir: Option, pub origin_storage_dir: Option, pub stdio: Stdio, + pub enable_stack_trace_arg_in_ops: bool, } impl Default for WorkerOptions { @@ -231,6 +232,7 @@ impl Default for WorkerOptions { create_params: Default::default(), bootstrap: Default::default(), stdio: Default::default(), + enable_stack_trace_arg_in_ops: false, } } } @@ -544,6 +546,11 @@ impl MainWorker { ) as Box, ) }), + maybe_op_stack_trace_callback: if options.enable_stack_trace_arg_in_ops { + Some(Box::new(|stack| { + deno_permissions::prompter::set_current_stacktrace(stack) + })) + } else { None }, ..Default::default() }); diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs index c97b700c5d..18cded90cb 100644 --- a/tests/integration/run_tests.rs +++ b/tests/integration/run_tests.rs @@ -179,6 +179,7 @@ fn _090_run_permissions_request() { console.expect(concat!( "┏ ⚠️ Deno requests run access to \"ls\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-run\r\n", "┠─ Run again with --allow-run to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all run permissions)", @@ -189,6 +190,7 @@ fn _090_run_permissions_request() { console.expect(concat!( "┏ ⚠️ Deno requests run access to \"cat\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-run\r\n", "┠─ Run again with --allow-run to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all run permissions)", @@ -210,6 +212,7 @@ fn _090_run_permissions_request_sync() { console.expect(concat!( "┏ ⚠️ Deno requests run access to \"ls\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-run\r\n", "┠─ Run again with --allow-run to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all run permissions)", @@ -220,6 +223,7 @@ fn _090_run_permissions_request_sync() { console.expect(concat!( "┏ ⚠️ Deno requests run access to \"cat\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-run\r\n", "┠─ Run again with --allow-run to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all run permissions)", @@ -242,6 +246,7 @@ fn permissions_prompt_allow_all() { console.expect(concat!( "┏ ⚠️ Deno requests run access to \"FOO\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-run\r\n", "┠─ Run again with --allow-run to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all run permissions)", @@ -253,6 +258,7 @@ fn permissions_prompt_allow_all() { console.expect(concat!( "┏ ⚠️ Deno requests read access to \"FOO\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-read\r\n", "┠─ Run again with --allow-read to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all read permissions)", @@ -264,6 +270,7 @@ fn permissions_prompt_allow_all() { console.expect(concat!( "┏ ⚠️ Deno requests write access to \"FOO\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-write\r\n", "┠─ Run again with --allow-write to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all write permissions)", @@ -275,6 +282,7 @@ fn permissions_prompt_allow_all() { console.expect(concat!( "┏ ⚠️ Deno requests net access to \"foo\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-net\r\n", "┠─ Run again with --allow-net to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all net permissions)", @@ -286,6 +294,7 @@ fn permissions_prompt_allow_all() { console.expect(concat!( "┏ ⚠️ Deno requests env access to \"FOO\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-env\r\n", "┠─ Run again with --allow-env to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all env permissions)", @@ -297,6 +306,7 @@ fn permissions_prompt_allow_all() { console.expect(concat!( "┏ ⚠️ Deno requests sys access to \"loadavg\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-sys\r\n", "┠─ Run again with --allow-sys to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all sys permissions)", @@ -308,6 +318,7 @@ fn permissions_prompt_allow_all() { console.expect(concat!( "┏ ⚠️ Deno requests ffi access to \"FOO\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-ffi\r\n", "┠─ Run again with --allow-ffi to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all ffi permissions)", @@ -328,6 +339,7 @@ fn permissions_prompt_allow_all_2() { // "env" permissions console.expect(concat!( "┏ ⚠️ Deno requests env access to \"FOO\".\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-env\r\n", "┠─ Run again with --allow-env to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all env permissions)", @@ -340,6 +352,7 @@ fn permissions_prompt_allow_all_2() { console.expect(concat!( "┏ ⚠️ Deno requests sys access to \"loadavg\".\r\n", "┠─ Requested by `Deno.loadavg()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-sys\r\n", "┠─ Run again with --allow-sys to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all sys permissions)", @@ -352,6 +365,7 @@ fn permissions_prompt_allow_all_2() { console.expect(concat!( "┏ ⚠️ Deno requests read access to .\r\n", "┠─ Requested by `Deno.cwd()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-read\r\n", "┠─ Run again with --allow-read to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all read permissions)", @@ -372,6 +386,7 @@ fn permissions_prompt_allow_all_lowercase_a() { console.expect(concat!( "┏ ⚠️ Deno requests run access to \"FOO\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-run\r\n", "┠─ Run again with --allow-run to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all run permissions)", @@ -406,6 +421,7 @@ fn permissions_cache() { "prompt\r\n", "┏ ⚠️ Deno requests read access to \"foo\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-read\r\n", "┠─ Run again with --allow-read to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all read permissions)", @@ -418,6 +434,32 @@ fn permissions_cache() { }); } +#[test] +fn permissions_trace() { + TestContext::default() + .new_command() + .env("DENO_TRACE_PERMISSIONS", "1") + .args_vec(["run", "--quiet", "run/permissions_trace.ts"]) + .with_pty(|mut console| { + let text = console.read_until("Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all sys permissions)"); + test_util::assertions::assert_wildcard_match(&text, concat!( + "┏ ⚠️ Deno requests sys access to \"hostname\".\r\n", + "┠─ Requested by `Deno.hostname()` API.\r\n", + "┃ ├─ Object.hostname (ext:runtime/30_os.js:43:10)\r\n", + "┃ ├─ foo (file://[WILDCARD]/run/permissions_trace.ts:2:8)\r\n", + "┃ ├─ bar (file://[WILDCARD]/run/permissions_trace.ts:6:3)\r\n", + "┃ └─ file://[WILDCARD]/run/permissions_trace.ts:9:1\r\n", + "┠─ Learn more at: https://docs.deno.com/go/--allow-sys\r\n", + "┠─ Run again with --allow-sys to bypass this prompt.\r\n", + "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all sys permissions)", + )); + + console.human_delay(); + console.write_line_raw("y"); + console.expect("✅ Granted sys access to \"hostname\"."); + }); +} + itest!(lock_write_fetch { args: "run --quiet --allow-import --allow-read --allow-write --allow-env --allow-run run/lock_write_fetch/main.ts", @@ -1512,6 +1554,7 @@ mod permissions { console.expect(concat!( "┏ ⚠️ Deno requests read access to \"foo\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-read\r\n", "┠─ Run again with --allow-read to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all read permissions)", @@ -1521,6 +1564,7 @@ mod permissions { console.expect(concat!( "┏ ⚠️ Deno requests read access to \"bar\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-read\r\n", "┠─ Run again with --allow-read to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all read permissions)", @@ -1542,6 +1586,7 @@ mod permissions { console.expect(concat!( "┏ ⚠️ Deno requests read access to \"foo\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-read\r\n", "┠─ Run again with --allow-read to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all read permissions)", @@ -1551,6 +1596,7 @@ mod permissions { console.expect(concat!( "┏ ⚠️ Deno requests read access to \"bar\".\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-read\r\n", "┠─ Run again with --allow-read to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all read permissions)", @@ -1572,6 +1618,7 @@ mod permissions { console.expect(concat!( "┏ ⚠️ Deno requests read access.\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-read\r\n", "┠─ Run again with --allow-read to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all read permissions)", @@ -1596,6 +1643,7 @@ mod permissions { console.expect(concat!( "┏ ⚠️ Deno requests read access.\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-read\r\n", "┠─ Run again with --allow-read to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all read permissions)", @@ -1673,6 +1721,7 @@ fn issue9750() { console.expect(concat!( "┏ ⚠️ Deno requests env access.\r\n", "┠─ Requested by `Deno.permissions.request()` API.\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-env\r\n", "┠─ Run again with --allow-env to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all env permissions)", @@ -1682,6 +1731,7 @@ fn issue9750() { console.expect("Denied env access."); console.expect(concat!( "┏ ⚠️ Deno requests env access to \"SECRET\".\r\n", + "┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.\r\n", "┠─ Learn more at: https://docs.deno.com/go/--allow-env\r\n", "┠─ Run again with --allow-env to bypass this prompt.\r\n", "┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all env permissions)", @@ -2723,7 +2773,7 @@ fn stdio_streams_are_locked_in_permission_prompt() { console.human_delay(); console.write_line_raw("y"); // We ensure that nothing gets written here between the permission prompt and this text, despire the delay - console.expect_raw_next(format!("y{newline}\x1b[5A\x1b[0J✅ Granted read access to \"")); + console.expect_raw_next(format!("y{newline}\x1b[6A\x1b[0J✅ Granted read access to \"")); // Back to spamming! console.expect(malicious_output); diff --git a/tests/testdata/run/permissions_trace.ts b/tests/testdata/run/permissions_trace.ts new file mode 100644 index 0000000000..d061ac6bf8 --- /dev/null +++ b/tests/testdata/run/permissions_trace.ts @@ -0,0 +1,9 @@ +function foo() { + Deno.hostname(); +} + +function bar() { + foo(); +} + +bar(); From 0670206a2cf7751e6927912bddc06ce0b5839b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 20 Nov 2024 23:21:41 +0000 Subject: [PATCH 122/227] chore: use forked sqlformat-rs (#26952) Some crucial fixes have not yet been released, so I forked it for the time being. --- Cargo.lock | 25 +++++++++++++------------ cli/Cargo.toml | 4 ++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bc386c9571..8850726cec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1232,6 +1232,7 @@ dependencies = [ "deno_resolver", "deno_runtime", "deno_semver", + "deno_sqlformat", "deno_task_shell", "deno_terminal 0.2.0", "deno_tower_lsp", @@ -1291,7 +1292,6 @@ dependencies = [ "sha2", "shell-escape", "spki", - "sqlformat", "strsim", "tar", "tempfile", @@ -2147,6 +2147,18 @@ dependencies = [ "url", ] +[[package]] +name = "deno_sqlformat" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e196799ec0cc240fac1fb5c5bf813ef92a9602740a059cfcbb20593b2deee52" +dependencies = [ + "nom 7.1.3", + "once_cell", + "regex", + "unicode_categories", +] + [[package]] name = "deno_task_shell" version = "0.18.1" @@ -6797,17 +6809,6 @@ dependencies = [ "der", ] -[[package]] -name = "sqlformat" -version = "0.3.1" -source = "git+https://github.com/shssoichiro/sqlformat-rs.git?rev=827d639#827d639bef94d8e5a5a0e29b41185c8d572f24e6" -dependencies = [ - "nom 7.1.3", - "once_cell", - "regex", - "unicode_categories", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index ae573827b1..d6f509eb97 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -151,8 +151,8 @@ serde_repr.workspace = true sha2.workspace = true shell-escape = "=0.1.5" spki = { version = "0.7", features = ["pem"] } -# NOTE(bartlomieju): for now using github URL, because 0.3.2 with important fixes hasn't been released yet. -sqlformat = { git = "https://github.com/shssoichiro/sqlformat-rs.git", rev = "827d639" } +# NOTE(bartlomieju): using temporary fork for now, revert back to `sqlformat-rs` later +sqlformat = { package = "deno_sqlformat", version = "0.3.2" } strsim = "0.11.1" tar.workspace = true tempfile.workspace = true From 56f31628f7a9d4a3dc54c70c4df1067b8a214ec6 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:22:15 -0800 Subject: [PATCH 123/227] feat: subcommand to view and update outdated dependencies (#26942) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #20487 Currently spelled ``` deno outdated ``` and ``` deno outdated --update ``` Works across package.json and deno.json, and in workspaces. There's a bit of duplicated code, I'll refactor to reduce this in follow ups ## Currently supported: ### Printing outdated deps (current output below which basically mimics pnpm, but requesting feedback / suggestions) ``` deno outdated ``` ![Screenshot 2024-11-19 at 2 01 56 PM](https://github.com/user-attachments/assets/51fea83a-181a-4082-b388-163313ce15e7) ### Updating deps semver compatible: ``` deno outdated --update ``` latest: ``` deno outdated --latest ``` current output is basic, again would love suggestions ![Screenshot 2024-11-19 at 2 13 46 PM](https://github.com/user-attachments/assets/e4c4db87-cd67-4b74-9ea7-4bd80106d5e9) #### Filters ``` deno outdated --update "@std/*" deno outdated --update --latest "@std/* "!@std/fmt" ``` #### Update to specific versions ``` deno outdated --update @std/fmt@1.0.2 @std/cli@^1.0.3 ``` ### Include all workspace members ``` deno outdated --recursive deno outdated --update --recursive ``` ## Future work - interactive update - update deps in js/ts files - better support for transitive deps Known issues (to be fixed in follow ups): - If no top level dependencies have changed, we won't update transitive deps (even if they could be updated) - Can't filter transitive deps, or update them to specific versions ## TODO (in this PR): - ~~spec tests for filters~~ - ~~spec test for mixed workspace (have tested manually)~~ - tweak output - suggestion when you try `deno update` --------- Co-authored-by: Bartek Iwańczuk --- cli/args/flags.rs | 192 ++++ cli/args/mod.rs | 1 + cli/main.rs | 5 + cli/npm/managed/mod.rs | 2 +- cli/tools/registry/mod.rs | 1 + cli/tools/registry/pm.rs | 32 +- cli/tools/registry/pm/cache_deps.rs | 17 +- cli/tools/registry/pm/deps.rs | 964 ++++++++++++++++++ cli/tools/registry/pm/outdated.rs | 661 ++++++++++++ tests/registry/jsr/@denotest/add/0.2.1/mod.ts | 4 + .../jsr/@denotest/add/0.2.1_meta.json | 8 + tests/registry/jsr/@denotest/add/meta.json | 3 +- .../@denotest/multiple-exports/0.2.0/add.ts | 1 + .../multiple-exports/0.2.0/data.json | 3 + .../multiple-exports/0.2.0/subtract.ts | 1 + .../multiple-exports/0.2.0_meta.json | 7 + .../@denotest/multiple-exports/0.5.0/add.ts | 1 + .../multiple-exports/0.5.0/data.json | 3 + .../multiple-exports/0.5.0/subtract.ts | 1 + .../multiple-exports/0.5.0_meta.json | 7 + .../jsr/@denotest/multiple-exports/meta.json | 4 +- .../jsr/@denotest/subtract/0.2.0/mod.ts | 3 + .../jsr/@denotest/subtract/0.2.0_meta.json | 8 + .../registry/jsr/@denotest/subtract/meta.json | 4 +- .../has-patch-versions/0.1.0/package.json | 5 + .../has-patch-versions/0.1.1/package.json | 5 + .../has-patch-versions/0.2.0/package.json | 4 + tests/specs/update/deno_json/__test__.jsonc | 101 ++ tests/specs/update/deno_json/deno.json | 19 + tests/specs/update/deno_json/deno.lock | 43 + .../specs/update/deno_json/deno.lock.orig.out | 43 + .../update/deno_json/filtered/deno.json.out | 19 + .../update/deno_json/filtered/update.out | 10 + tests/specs/update/deno_json/outdated.out | 15 + .../update/deno_json/outdated_compatible.out | 7 + tests/specs/update/deno_json/print_file.ts | 2 + .../deno_json/update_compatible/deno.json.out | 19 + .../deno_json/update_compatible/deno.lock.out | 43 + .../deno_json/update_compatible/update.out | 7 + .../deno_json/update_latest/deno.json.out | 19 + .../deno_json/update_latest/deno.lock.out | 43 + .../update/deno_json/update_latest/update.out | 16 + .../update/mixed_workspace/__test__.jsonc | 153 +++ tests/specs/update/mixed_workspace/deno.json | 6 + tests/specs/update/mixed_workspace/deno.lock | 55 + .../update/mixed_workspace/deno.lock.orig.out | 55 + .../filtered/member_a_deno.json.out | 10 + .../filtered/member_b_package.json.out | 8 + .../mixed_workspace/filtered/update.out | 12 + .../update/mixed_workspace/member-a/deno.json | 10 + .../update/mixed_workspace/member-a/mod.ts | 0 .../mixed_workspace/member-b/package.json | 8 + .../update/mixed_workspace/print_file.ts | 2 + .../print_outdated/member_a.out | 9 + .../print_outdated/member_b.out | 7 + .../print_outdated/recursive.out | 15 + .../mixed_workspace/print_outdated/root.out | 5 + .../update_latest/recursive/update.out | 16 + .../update_latest/root/deno.json.out | 6 + .../update_latest/root/update.out | 3 + .../update_latest/subdir/member_a.out | 10 + .../subdir/member_a_deno.json.out | 10 + .../update_latest/subdir/member_b.out | 7 + .../subdir/member_b_package.json.out | 8 + .../specs/update/package_json/__test__.jsonc | 100 ++ tests/specs/update/package_json/deno.lock | 28 + .../update/package_json/deno.lock.orig.out | 28 + .../package_json/filtered/package.json.out | 9 + .../update/package_json/filtered/update.out | 9 + tests/specs/update/package_json/outdated.out | 9 + .../package_json/outdated_compatible.out | 5 + tests/specs/update/package_json/package.json | 9 + tests/specs/update/package_json/print_file.ts | 2 + .../update_compatible/deno.lock.out | 28 + .../update_compatible/package.json.out | 9 + .../package_json/update_compatible/update.out | 4 + .../package_json/update_latest/deno.lock.out | 28 + .../update_latest/package.json.out | 9 + .../package_json/update_latest/update.out | 14 + tests/util/server/src/npm.rs | 68 +- 80 files changed, 3109 insertions(+), 18 deletions(-) create mode 100644 cli/tools/registry/pm/deps.rs create mode 100644 cli/tools/registry/pm/outdated.rs create mode 100644 tests/registry/jsr/@denotest/add/0.2.1/mod.ts create mode 100644 tests/registry/jsr/@denotest/add/0.2.1_meta.json create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.2.0/add.ts create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.2.0/data.json create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.2.0/subtract.ts create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.2.0_meta.json create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.5.0/add.ts create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.5.0/data.json create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.5.0/subtract.ts create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.5.0_meta.json create mode 100644 tests/registry/jsr/@denotest/subtract/0.2.0/mod.ts create mode 100644 tests/registry/jsr/@denotest/subtract/0.2.0_meta.json create mode 100644 tests/registry/npm/@denotest/has-patch-versions/0.1.0/package.json create mode 100644 tests/registry/npm/@denotest/has-patch-versions/0.1.1/package.json create mode 100644 tests/registry/npm/@denotest/has-patch-versions/0.2.0/package.json create mode 100644 tests/specs/update/deno_json/__test__.jsonc create mode 100644 tests/specs/update/deno_json/deno.json create mode 100644 tests/specs/update/deno_json/deno.lock create mode 100644 tests/specs/update/deno_json/deno.lock.orig.out create mode 100644 tests/specs/update/deno_json/filtered/deno.json.out create mode 100644 tests/specs/update/deno_json/filtered/update.out create mode 100644 tests/specs/update/deno_json/outdated.out create mode 100644 tests/specs/update/deno_json/outdated_compatible.out create mode 100644 tests/specs/update/deno_json/print_file.ts create mode 100644 tests/specs/update/deno_json/update_compatible/deno.json.out create mode 100644 tests/specs/update/deno_json/update_compatible/deno.lock.out create mode 100644 tests/specs/update/deno_json/update_compatible/update.out create mode 100644 tests/specs/update/deno_json/update_latest/deno.json.out create mode 100644 tests/specs/update/deno_json/update_latest/deno.lock.out create mode 100644 tests/specs/update/deno_json/update_latest/update.out create mode 100644 tests/specs/update/mixed_workspace/__test__.jsonc create mode 100644 tests/specs/update/mixed_workspace/deno.json create mode 100644 tests/specs/update/mixed_workspace/deno.lock create mode 100644 tests/specs/update/mixed_workspace/deno.lock.orig.out create mode 100644 tests/specs/update/mixed_workspace/filtered/member_a_deno.json.out create mode 100644 tests/specs/update/mixed_workspace/filtered/member_b_package.json.out create mode 100644 tests/specs/update/mixed_workspace/filtered/update.out create mode 100644 tests/specs/update/mixed_workspace/member-a/deno.json create mode 100644 tests/specs/update/mixed_workspace/member-a/mod.ts create mode 100644 tests/specs/update/mixed_workspace/member-b/package.json create mode 100644 tests/specs/update/mixed_workspace/print_file.ts create mode 100644 tests/specs/update/mixed_workspace/print_outdated/member_a.out create mode 100644 tests/specs/update/mixed_workspace/print_outdated/member_b.out create mode 100644 tests/specs/update/mixed_workspace/print_outdated/recursive.out create mode 100644 tests/specs/update/mixed_workspace/print_outdated/root.out create mode 100644 tests/specs/update/mixed_workspace/update_latest/recursive/update.out create mode 100644 tests/specs/update/mixed_workspace/update_latest/root/deno.json.out create mode 100644 tests/specs/update/mixed_workspace/update_latest/root/update.out create mode 100644 tests/specs/update/mixed_workspace/update_latest/subdir/member_a.out create mode 100644 tests/specs/update/mixed_workspace/update_latest/subdir/member_a_deno.json.out create mode 100644 tests/specs/update/mixed_workspace/update_latest/subdir/member_b.out create mode 100644 tests/specs/update/mixed_workspace/update_latest/subdir/member_b_package.json.out create mode 100644 tests/specs/update/package_json/__test__.jsonc create mode 100644 tests/specs/update/package_json/deno.lock create mode 100644 tests/specs/update/package_json/deno.lock.orig.out create mode 100644 tests/specs/update/package_json/filtered/package.json.out create mode 100644 tests/specs/update/package_json/filtered/update.out create mode 100644 tests/specs/update/package_json/outdated.out create mode 100644 tests/specs/update/package_json/outdated_compatible.out create mode 100644 tests/specs/update/package_json/package.json create mode 100644 tests/specs/update/package_json/print_file.ts create mode 100644 tests/specs/update/package_json/update_compatible/deno.lock.out create mode 100644 tests/specs/update/package_json/update_compatible/package.json.out create mode 100644 tests/specs/update/package_json/update_compatible/update.out create mode 100644 tests/specs/update/package_json/update_latest/deno.lock.out create mode 100644 tests/specs/update/package_json/update_latest/package.json.out create mode 100644 tests/specs/update/package_json/update_latest/update.out diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 567d4adfb9..6945065574 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -465,6 +465,7 @@ pub enum DenoSubcommand { Serve(ServeFlags), Task(TaskFlags), Test(TestFlags), + Outdated(OutdatedFlags), Types, Upgrade(UpgradeFlags), Vendor, @@ -472,6 +473,19 @@ pub enum DenoSubcommand { Help(HelpFlags), } +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum OutdatedKind { + Update { latest: bool }, + PrintOutdated { compatible: bool }, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct OutdatedFlags { + pub filters: Vec, + pub recursive: bool, + pub kind: OutdatedKind, +} + impl DenoSubcommand { pub fn is_run(&self) -> bool { matches!(self, Self::Run(_)) @@ -1203,6 +1217,7 @@ static DENO_HELP: &str = cstr!( deno add jsr:@std/assert | deno add npm:express install Installs dependencies either in the local project or globally to a bin directory uninstall Uninstalls a dependency or an executable script in the installation root's bin directory + outdated Find and update outdated dependencies remove Remove dependencies from the configuration file Tooling: @@ -1385,6 +1400,7 @@ pub fn flags_from_vec(args: Vec) -> clap::error::Result { "jupyter" => jupyter_parse(&mut flags, &mut m), "lint" => lint_parse(&mut flags, &mut m)?, "lsp" => lsp_parse(&mut flags, &mut m), + "outdated" => outdated_parse(&mut flags, &mut m)?, "repl" => repl_parse(&mut flags, &mut m)?, "run" => run_parse(&mut flags, &mut m, app, false)?, "serve" => serve_parse(&mut flags, &mut m, app)?, @@ -1627,6 +1643,7 @@ pub fn clap_root() -> Command { .subcommand(json_reference_subcommand()) .subcommand(jupyter_subcommand()) .subcommand(uninstall_subcommand()) + .subcommand(outdated_subcommand()) .subcommand(lsp_subcommand()) .subcommand(lint_subcommand()) .subcommand(publish_subcommand()) @@ -2617,6 +2634,83 @@ fn jupyter_subcommand() -> Command { .conflicts_with("install")) } +fn outdated_subcommand() -> Command { + command( + "outdated", + cstr!("Find and update outdated dependencies. +By default, outdated dependencies are only displayed. + +Display outdated dependencies: + deno outdated + deno outdated --compatible + +Update dependencies: + deno outdated --update + deno outdated --update --latest + deno outdated --update + +Filters can be used to select which packages to act on. Filters can include wildcards (*) to match multiple packages. + deno outdated --update --latest \"@std/*\" + deno outdated --update --latest \"react*\" +Note that filters act on their aliases configured in deno.json / package.json, not the actual package names: + Given \"foobar\": \"npm:react@17.0.0\" in deno.json or package.json, the filter \"foobar\" would update npm:react to + the latest version. + deno outdated --update --latest foobar +Filters can be combined, and negative filters can be used to exclude results: + deno outdated --update --latest \"@std/*\" \"!@std/fmt*\" + +Specific version requirements to update to can be specified: + deno outdated --update @std/fmt@^1.0.2 +"), + UnstableArgsConfig::None, + ) + .defer(|cmd| { + cmd + .arg( + Arg::new("filters") + .num_args(0..) + .action(ArgAction::Append) + .help(concat!("Filters selecting which packages to act on. Can include wildcards (*) to match multiple packages. ", + "If a version requirement is specified, the matching packages will be updated to the given requirement."), + ) + ) + .arg(no_lock_arg()) + .arg(lock_arg()) + .arg( + Arg::new("latest") + .long("latest") + .action(ArgAction::SetTrue) + .help( + "Update to the latest version, regardless of semver constraints", + ) + .requires("update") + .conflicts_with("compatible"), + ) + .arg( + Arg::new("update") + .long("update") + .short('u') + .action(ArgAction::SetTrue) + .conflicts_with("compatible") + .help("Update dependency versions"), + ) + .arg( + Arg::new("compatible") + .long("compatible") + .action(ArgAction::SetTrue) + .help("Only output versions that satisfy semver requirements") + .conflicts_with("update"), + ) + .arg( + Arg::new("recursive") + .long("recursive") + .short('r') + .action(ArgAction::SetTrue) + .help("include all workspace members"), + ) + }) +} + fn uninstall_subcommand() -> Command { command( "uninstall", @@ -4353,6 +4447,31 @@ fn remove_parse(flags: &mut Flags, matches: &mut ArgMatches) { }); } +fn outdated_parse( + flags: &mut Flags, + matches: &mut ArgMatches, +) -> clap::error::Result<()> { + let filters = match matches.remove_many::("filters") { + Some(f) => f.collect(), + None => vec![], + }; + let recursive = matches.get_flag("recursive"); + let update = matches.get_flag("update"); + let kind = if update { + let latest = matches.get_flag("latest"); + OutdatedKind::Update { latest } + } else { + let compatible = matches.get_flag("compatible"); + OutdatedKind::PrintOutdated { compatible } + }; + flags.subcommand = DenoSubcommand::Outdated(OutdatedFlags { + filters, + recursive, + kind, + }); + Ok(()) +} + fn bench_parse( flags: &mut Flags, matches: &mut ArgMatches, @@ -11299,4 +11418,77 @@ Usage: deno repl [OPTIONS] [-- [ARGS]...]\n" assert!(r.is_err()); } } + + #[test] + fn outdated_subcommand() { + let cases = [ + ( + svec![], + OutdatedFlags { + filters: vec![], + kind: OutdatedKind::PrintOutdated { compatible: false }, + recursive: false, + }, + ), + ( + svec!["--recursive"], + OutdatedFlags { + filters: vec![], + kind: OutdatedKind::PrintOutdated { compatible: false }, + recursive: true, + }, + ), + ( + svec!["--recursive", "--compatible"], + OutdatedFlags { + filters: vec![], + kind: OutdatedKind::PrintOutdated { compatible: true }, + recursive: true, + }, + ), + ( + svec!["--update"], + OutdatedFlags { + filters: vec![], + kind: OutdatedKind::Update { latest: false }, + recursive: false, + }, + ), + ( + svec!["--update", "--latest"], + OutdatedFlags { + filters: vec![], + kind: OutdatedKind::Update { latest: true }, + recursive: false, + }, + ), + ( + svec!["--update", "--recursive"], + OutdatedFlags { + filters: vec![], + kind: OutdatedKind::Update { latest: false }, + recursive: true, + }, + ), + ( + svec!["--update", "@foo/bar"], + OutdatedFlags { + filters: svec!["@foo/bar"], + kind: OutdatedKind::Update { latest: false }, + recursive: false, + }, + ), + ]; + for (input, expected) in cases { + let mut args = svec!["deno", "outdated"]; + args.extend(input); + let r = flags_from_vec(args.clone()).unwrap(); + assert_eq!( + r.subcommand, + DenoSubcommand::Outdated(expected), + "incorrect result for args: {:?}", + args + ); + } + } } diff --git a/cli/args/mod.rs b/cli/args/mod.rs index bbdfa478c1..37e1f00ffa 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1628,6 +1628,7 @@ impl CliOptions { DenoSubcommand::Install(_) | DenoSubcommand::Add(_) | DenoSubcommand::Remove(_) + | DenoSubcommand::Outdated(_) ) { // For `deno install/add/remove` we want to force the managed resolver so it can set up `node_modules/` directory. return false; diff --git a/cli/main.rs b/cli/main.rs index 3dd2692f05..017e343178 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -188,6 +188,11 @@ async fn run_subcommand(flags: Arc) -> Result { tools::lint::lint(flags, lint_flags).await } }), + DenoSubcommand::Outdated(update_flags) => { + spawn_subcommand(async move { + tools::registry::outdated(flags, update_flags).await + }) + } DenoSubcommand::Repl(repl_flags) => { spawn_subcommand(async move { tools::repl::run(flags, repl_flags).await }) } diff --git a/cli/npm/managed/mod.rs b/cli/npm/managed/mod.rs index 2e64f5f188..88094d5141 100644 --- a/cli/npm/managed/mod.rs +++ b/cli/npm/managed/mod.rs @@ -500,7 +500,7 @@ impl ManagedCliNpmResolver { self.resolve_pkg_folder_from_pkg_id(&pkg_id) } - fn resolve_pkg_id_from_pkg_req( + pub fn resolve_pkg_id_from_pkg_req( &self, req: &PackageReq, ) -> Result { diff --git a/cli/tools/registry/mod.rs b/cli/tools/registry/mod.rs index 89447f04f9..ba61d352d3 100644 --- a/cli/tools/registry/mod.rs +++ b/cli/tools/registry/mod.rs @@ -68,6 +68,7 @@ use auth::get_auth_method; use auth::AuthMethod; pub use pm::add; pub use pm::cache_top_level_deps; +pub use pm::outdated; pub use pm::remove; pub use pm::AddCommandName; pub use pm::AddRmPackageReq; diff --git a/cli/tools/registry/pm.rs b/cli/tools/registry/pm.rs index c1ea2c75ea..5718cd3ec1 100644 --- a/cli/tools/registry/pm.rs +++ b/cli/tools/registry/pm.rs @@ -16,6 +16,7 @@ use deno_semver::package::PackageNv; use deno_semver::package::PackageReq; use deno_semver::Version; use deno_semver::VersionReq; +use deps::KeyPath; use jsonc_parser::cst::CstObject; use jsonc_parser::cst::CstObjectProp; use jsonc_parser::cst::CstRootNode; @@ -32,10 +33,13 @@ use crate::jsr::JsrFetchResolver; use crate::npm::NpmFetchResolver; mod cache_deps; +pub(crate) mod deps; +mod outdated; pub use cache_deps::cache_top_level_deps; +pub use outdated::outdated; -#[derive(Debug, Copy, Clone)] +#[derive(Debug, Copy, Clone, Hash)] enum ConfigKind { DenoJson, PackageJson, @@ -86,6 +90,28 @@ impl ConfigUpdater { self.cst.to_string() } + fn get_property_for_mutation( + &mut self, + key_path: &KeyPath, + ) -> Option { + let mut current_node = self.root_object.clone(); + + self.modified = true; + + for (i, part) in key_path.parts.iter().enumerate() { + let s = part.as_str(); + if i < key_path.parts.len().saturating_sub(1) { + let object = current_node.object_value(s)?; + current_node = object; + } else { + // last part + return current_node.get(s); + } + } + + None + } + fn add(&mut self, selected: SelectedPackage, dev: bool) { fn insert_index(object: &CstObject, searching_name: &str) -> usize { object @@ -824,7 +850,7 @@ async fn npm_install_after_modification( flags: Arc, // explicitly provided to prevent redownloading jsr_resolver: Option>, -) -> Result<(), AnyError> { +) -> Result { // clear the previously cached package.json from memory before reloading it node_resolver::PackageJsonThreadLocalCache::clear(); @@ -842,7 +868,7 @@ async fn npm_install_after_modification( lockfile.write_if_changed()?; } - Ok(()) + Ok(cli_factory) } #[cfg(test)] diff --git a/cli/tools/registry/pm/cache_deps.rs b/cli/tools/registry/pm/cache_deps.rs index d3c8da868c..f9d67e4d4f 100644 --- a/cli/tools/registry/pm/cache_deps.rs +++ b/cli/tools/registry/pm/cache_deps.rs @@ -8,7 +8,7 @@ use crate::graph_container::ModuleGraphUpdatePermit; use deno_core::error::AnyError; use deno_core::futures::stream::FuturesUnordered; use deno_core::futures::StreamExt; -use deno_semver::package::PackageReq; +use deno_semver::jsr::JsrPackageReqReference; pub async fn cache_top_level_deps( // todo(dsherret): don't pass the factory into this function. Instead use ctor deps @@ -56,15 +56,20 @@ pub async fn cache_top_level_deps( match specifier.scheme() { "jsr" => { let specifier_str = specifier.as_str(); - let specifier_str = - specifier_str.strip_prefix("jsr:").unwrap_or(specifier_str); - if let Ok(req) = PackageReq::from_str(specifier_str) { - if !seen_reqs.insert(req.clone()) { + if let Ok(req) = JsrPackageReqReference::from_str(specifier_str) { + if let Some(sub_path) = req.sub_path() { + if sub_path.ends_with('/') { + continue; + } + roots.push(specifier.clone()); + continue; + } + if !seen_reqs.insert(req.req().clone()) { continue; } let jsr_resolver = jsr_resolver.clone(); info_futures.push(async move { - if let Some(nv) = jsr_resolver.req_to_nv(&req).await { + if let Some(nv) = jsr_resolver.req_to_nv(req.req()).await { if let Some(info) = jsr_resolver.package_version_info(&nv).await { return Some((specifier.clone(), info)); diff --git a/cli/tools/registry/pm/deps.rs b/cli/tools/registry/pm/deps.rs new file mode 100644 index 0000000000..4778d6f327 --- /dev/null +++ b/cli/tools/registry/pm/deps.rs @@ -0,0 +1,964 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +use std::borrow::Cow; +use std::collections::HashMap; +use std::sync::atomic::AtomicBool; +use std::sync::Arc; + +use deno_ast::ModuleSpecifier; +use deno_config::deno_json::ConfigFile; +use deno_config::deno_json::ConfigFileRc; +use deno_config::workspace::Workspace; +use deno_config::workspace::WorkspaceDirectory; +use deno_core::anyhow::bail; +use deno_core::error::AnyError; +use deno_core::futures::future::try_join; +use deno_core::futures::stream::FuturesOrdered; +use deno_core::futures::stream::FuturesUnordered; +use deno_core::futures::FutureExt; +use deno_core::futures::StreamExt; +use deno_core::serde_json; +use deno_graph::FillFromLockfileOptions; +use deno_package_json::PackageJsonDepValue; +use deno_package_json::PackageJsonDepValueParseError; +use deno_package_json::PackageJsonRc; +use deno_runtime::deno_permissions::PermissionsContainer; +use deno_semver::jsr::JsrPackageReqReference; +use deno_semver::npm::NpmPackageReqReference; +use deno_semver::package::PackageNv; +use deno_semver::package::PackageReq; +use deno_semver::package::PackageReqReference; +use deno_semver::VersionReq; +use import_map::ImportMap; +use import_map::ImportMapWithDiagnostics; +use import_map::SpecifierMapEntry; +use indexmap::IndexMap; +use tokio::sync::Semaphore; + +use crate::args::CliLockfile; +use crate::graph_container::MainModuleGraphContainer; +use crate::graph_container::ModuleGraphContainer; +use crate::graph_container::ModuleGraphUpdatePermit; +use crate::jsr::JsrFetchResolver; +use crate::module_loader::ModuleLoadPreparer; +use crate::npm::CliNpmResolver; +use crate::npm::NpmFetchResolver; + +use super::ConfigUpdater; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum ImportMapKind { + Inline, + Outline, +} + +#[derive(Clone)] +pub enum DepLocation { + DenoJson(ConfigFileRc, KeyPath, ImportMapKind), + PackageJson(PackageJsonRc, KeyPath), +} + +impl DepLocation { + pub fn is_deno_json(&self) -> bool { + matches!(self, DepLocation::DenoJson(..)) + } + + pub fn file_path(&self) -> Cow { + match self { + DepLocation::DenoJson(arc, _, _) => { + Cow::Owned(arc.specifier.to_file_path().unwrap()) + } + DepLocation::PackageJson(arc, _) => Cow::Borrowed(arc.path.as_ref()), + } + } + fn config_kind(&self) -> super::ConfigKind { + match self { + DepLocation::DenoJson(_, _, _) => super::ConfigKind::DenoJson, + DepLocation::PackageJson(_, _) => super::ConfigKind::PackageJson, + } + } +} + +struct DebugAdapter(T); + +impl<'a> std::fmt::Debug for DebugAdapter<&'a ConfigFileRc> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("ConfigFile") + .field("specifier", &self.0.specifier) + .finish() + } +} +impl<'a> std::fmt::Debug for DebugAdapter<&'a PackageJsonRc> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("PackageJson") + .field("path", &self.0.path) + .finish() + } +} + +impl std::fmt::Debug for DepLocation { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + DepLocation::DenoJson(arc, key_path, kind) => { + let mut debug = f.debug_tuple("DenoJson"); + debug + .field(&DebugAdapter(arc)) + .field(key_path) + .field(kind) + .finish() + } + DepLocation::PackageJson(arc, key_path) => { + let mut debug = f.debug_tuple("PackageJson"); + debug.field(&DebugAdapter(arc)).field(key_path).finish() + } + } + } +} + +#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] +pub enum DepKind { + Jsr, + Npm, +} + +impl DepKind { + pub fn scheme(&self) -> &'static str { + match self { + DepKind::Npm => "npm", + DepKind::Jsr => "jsr", + } + } +} + +#[derive(Clone, Debug)] +pub enum KeyPart { + Imports, + Scopes, + Dependencies, + DevDependencies, + String(String), +} + +impl From for KeyPart { + fn from(value: String) -> Self { + KeyPart::String(value) + } +} + +impl From for KeyPart { + fn from(value: PackageJsonDepKind) -> Self { + match value { + PackageJsonDepKind::Normal => Self::Dependencies, + PackageJsonDepKind::Dev => Self::DevDependencies, + } + } +} + +impl KeyPart { + pub fn as_str(&self) -> &str { + match self { + KeyPart::Imports => "imports", + KeyPart::Scopes => "scopes", + KeyPart::Dependencies => "dependencies", + KeyPart::DevDependencies => "devDependencies", + KeyPart::String(s) => s, + } + } +} + +#[derive(Clone, Debug)] +pub struct KeyPath { + pub parts: Vec, +} + +impl KeyPath { + fn from_parts(parts: impl IntoIterator) -> Self { + Self { + parts: parts.into_iter().collect(), + } + } + fn last(&self) -> Option<&KeyPart> { + self.parts.last() + } + fn push(&mut self, part: KeyPart) { + self.parts.push(part) + } +} + +#[derive(Clone, Debug)] +pub struct Dep { + pub req: PackageReq, + pub kind: DepKind, + pub location: DepLocation, + #[allow(dead_code)] + pub id: DepId, + #[allow(dead_code)] + pub alias: Option, +} + +fn import_map_entries( + import_map: &ImportMap, +) -> impl Iterator)> { + import_map + .imports() + .entries() + .map(|entry| { + ( + KeyPath::from_parts([ + KeyPart::Imports, + KeyPart::String(entry.raw_key.into()), + ]), + entry, + ) + }) + .chain(import_map.scopes().flat_map(|scope| { + let path = KeyPath::from_parts([ + KeyPart::Scopes, + scope.raw_key.to_string().into(), + ]); + + scope.imports.entries().map(move |entry| { + let mut full_path = path.clone(); + full_path.push(KeyPart::String(entry.raw_key.to_string())); + (full_path, entry) + }) + })) +} + +fn to_import_map_value_from_imports( + deno_json: &ConfigFile, +) -> serde_json::Value { + let mut value = serde_json::Map::with_capacity(2); + if let Some(imports) = &deno_json.json.imports { + value.insert("imports".to_string(), imports.clone()); + } + if let Some(scopes) = &deno_json.json.scopes { + value.insert("scopes".to_string(), scopes.clone()); + } + serde_json::Value::Object(value) +} + +fn deno_json_import_map( + deno_json: &ConfigFile, +) -> Result, AnyError> { + let (value, kind) = + if deno_json.json.imports.is_some() || deno_json.json.scopes.is_some() { + ( + to_import_map_value_from_imports(deno_json), + ImportMapKind::Inline, + ) + } else { + match deno_json.to_import_map_path()? { + Some(path) => { + let text = std::fs::read_to_string(&path)?; + let value = serde_json::from_str(&text)?; + (value, ImportMapKind::Outline) + } + None => return Ok(None), + } + }; + + import_map::parse_from_value(deno_json.specifier.clone(), value) + .map_err(Into::into) + .map(|import_map| Some((import_map, kind))) +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +enum PackageJsonDepKind { + Normal, + Dev, +} + +type PackageJsonDeps = IndexMap< + String, + Result< + (PackageJsonDepKind, PackageJsonDepValue), + PackageJsonDepValueParseError, + >, +>; + +/// Resolve the package.json's dependencies. +// TODO(nathanwhit): Remove once we update deno_package_json with dev deps split out +fn resolve_local_package_json_deps( + package_json: &PackageJsonRc, +) -> PackageJsonDeps { + /// Gets the name and raw version constraint for a registry info or + /// package.json dependency entry taking into account npm package aliases. + fn parse_dep_entry_name_and_raw_version<'a>( + key: &'a str, + value: &'a str, + ) -> (&'a str, &'a str) { + if let Some(package_and_version) = value.strip_prefix("npm:") { + if let Some((name, version)) = package_and_version.rsplit_once('@') { + // if empty, then the name was scoped and there's no version + if name.is_empty() { + (package_and_version, "*") + } else { + (name, version) + } + } else { + (package_and_version, "*") + } + } else { + (key, value) + } + } + + fn parse_entry( + key: &str, + value: &str, + ) -> Result { + if let Some(workspace_key) = value.strip_prefix("workspace:") { + let version_req = VersionReq::parse_from_npm(workspace_key)?; + return Ok(PackageJsonDepValue::Workspace(version_req)); + } + if value.starts_with("file:") + || value.starts_with("git:") + || value.starts_with("http:") + || value.starts_with("https:") + { + return Err(PackageJsonDepValueParseError::Unsupported { + scheme: value.split(':').next().unwrap().to_string(), + }); + } + let (name, version_req) = parse_dep_entry_name_and_raw_version(key, value); + let result = VersionReq::parse_from_npm(version_req); + match result { + Ok(version_req) => Ok(PackageJsonDepValue::Req(PackageReq { + name: name.to_string(), + version_req, + })), + Err(err) => Err(PackageJsonDepValueParseError::VersionReq(err)), + } + } + + fn insert_deps( + deps: Option<&IndexMap>, + result: &mut PackageJsonDeps, + kind: PackageJsonDepKind, + ) { + if let Some(deps) = deps { + for (key, value) in deps { + result.entry(key.to_string()).or_insert_with(|| { + parse_entry(key, value).map(|entry| (kind, entry)) + }); + } + } + } + + let deps = package_json.dependencies.as_ref(); + let dev_deps = package_json.dev_dependencies.as_ref(); + let mut result = IndexMap::new(); + + // favors the deps over dev_deps + insert_deps(deps, &mut result, PackageJsonDepKind::Normal); + insert_deps(dev_deps, &mut result, PackageJsonDepKind::Dev); + + result +} + +fn add_deps_from_deno_json( + deno_json: &Arc, + mut filter: impl DepFilter, + deps: &mut Vec, +) { + let (import_map, import_map_kind) = match deno_json_import_map(deno_json) { + Ok(Some((import_map, import_map_kind))) => (import_map, import_map_kind), + Ok(None) => return, + Err(e) => { + log::warn!("failed to parse imports from {}: {e}", &deno_json.specifier); + return; + } + }; + for (key_path, entry) in import_map_entries(&import_map.import_map) { + let Some(value) = entry.value else { continue }; + let kind = match value.scheme() { + "npm" => DepKind::Npm, + "jsr" => DepKind::Jsr, + _ => continue, + }; + let req = match parse_req_reference(value.as_str(), kind) { + Ok(req) => req.req.clone(), + Err(err) => { + log::warn!("failed to parse package req \"{}\": {err}", value.as_str()); + continue; + } + }; + let alias: &str = key_path.last().unwrap().as_str().trim_end_matches('/'); + let alias = (alias != req.name).then(|| alias.to_string()); + if !filter.should_include(alias.as_deref(), &req, kind) { + continue; + } + let id = DepId(deps.len()); + deps.push(Dep { + location: DepLocation::DenoJson( + deno_json.clone(), + key_path, + import_map_kind, + ), + kind, + req, + id, + alias, + }); + } +} + +fn add_deps_from_package_json( + package_json: &PackageJsonRc, + mut filter: impl DepFilter, + deps: &mut Vec, +) { + let package_json_deps = resolve_local_package_json_deps(package_json); + for (k, v) in package_json_deps { + let (package_dep_kind, v) = match v { + Ok((k, v)) => (k, v), + Err(e) => { + log::warn!("bad package json dep value: {e}"); + continue; + } + }; + match v { + deno_package_json::PackageJsonDepValue::Req(req) => { + let alias = k.as_str(); + let alias = (alias != req.name).then(|| alias.to_string()); + if !filter.should_include(alias.as_deref(), &req, DepKind::Npm) { + continue; + } + let id = DepId(deps.len()); + deps.push(Dep { + id, + kind: DepKind::Npm, + location: DepLocation::PackageJson( + package_json.clone(), + KeyPath::from_parts([package_dep_kind.into(), k.into()]), + ), + req, + alias, + }) + } + deno_package_json::PackageJsonDepValue::Workspace(_) => continue, + } + } +} + +fn deps_from_workspace( + workspace: &Arc, + dep_filter: impl DepFilter, +) -> Result, AnyError> { + let mut deps = Vec::with_capacity(256); + for deno_json in workspace.deno_jsons() { + add_deps_from_deno_json(deno_json, dep_filter, &mut deps); + } + for package_json in workspace.package_jsons() { + add_deps_from_package_json(package_json, dep_filter, &mut deps); + } + + Ok(deps) +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub struct DepId(usize); + +#[derive(Debug, Clone)] +pub enum Change { + Update(DepId, VersionReq), +} + +pub trait DepFilter: Copy { + fn should_include( + &mut self, + alias: Option<&str>, + package_req: &PackageReq, + dep_kind: DepKind, + ) -> bool; +} + +impl DepFilter for T +where + T: FnMut(Option<&str>, &PackageReq, DepKind) -> bool + Copy, +{ + fn should_include<'a>( + &mut self, + alias: Option<&'a str>, + package_req: &'a PackageReq, + dep_kind: DepKind, + ) -> bool { + (*self)(alias, package_req, dep_kind) + } +} + +#[derive(Clone, Debug)] +pub struct PackageLatestVersion { + pub semver_compatible: Option, + pub latest: Option, +} + +pub struct DepManager { + deps: Vec, + resolved_versions: Vec>, + latest_versions: Vec, + + pending_changes: Vec, + + dependencies_resolved: AtomicBool, + module_load_preparer: Arc, + // TODO(nathanwhit): probably shouldn't be pub + pub(crate) jsr_fetch_resolver: Arc, + pub(crate) npm_fetch_resolver: Arc, + npm_resolver: Arc, + permissions_container: PermissionsContainer, + main_module_graph_container: Arc, + lockfile: Option>, +} + +pub struct DepManagerArgs { + pub module_load_preparer: Arc, + pub jsr_fetch_resolver: Arc, + pub npm_fetch_resolver: Arc, + pub npm_resolver: Arc, + pub permissions_container: PermissionsContainer, + pub main_module_graph_container: Arc, + pub lockfile: Option>, +} + +impl DepManager { + pub fn reloaded_after_modification(self, args: DepManagerArgs) -> Self { + let mut new = Self::with_deps_args(self.deps, args); + new.latest_versions = self.latest_versions; + new + } + fn with_deps_args(deps: Vec, args: DepManagerArgs) -> Self { + let DepManagerArgs { + module_load_preparer, + jsr_fetch_resolver, + npm_fetch_resolver, + npm_resolver, + permissions_container, + main_module_graph_container, + lockfile, + } = args; + Self { + deps, + resolved_versions: Vec::new(), + latest_versions: Vec::new(), + jsr_fetch_resolver, + dependencies_resolved: AtomicBool::new(false), + module_load_preparer, + npm_fetch_resolver, + npm_resolver, + permissions_container, + main_module_graph_container, + lockfile, + pending_changes: Vec::new(), + } + } + pub fn from_workspace_dir( + workspace_dir: &Arc, + dep_filter: impl DepFilter, + args: DepManagerArgs, + ) -> Result { + let mut deps = Vec::with_capacity(256); + if let Some(deno_json) = workspace_dir.maybe_deno_json() { + if deno_json.specifier.scheme() != "file" { + bail!("remote deno.json files are not supported"); + } + let path = deno_json.specifier.to_file_path().unwrap(); + if path.parent().unwrap() == workspace_dir.dir_path() { + add_deps_from_deno_json(deno_json, dep_filter, &mut deps); + } + } + if let Some(package_json) = workspace_dir.maybe_pkg_json() { + add_deps_from_package_json(package_json, dep_filter, &mut deps); + } + + Ok(Self::with_deps_args(deps, args)) + } + pub fn from_workspace( + workspace: &Arc, + dep_filter: impl DepFilter, + args: DepManagerArgs, + ) -> Result { + let deps = deps_from_workspace(workspace, dep_filter)?; + Ok(Self::with_deps_args(deps, args)) + } + + async fn run_dependency_resolution(&self) -> Result<(), AnyError> { + if self + .dependencies_resolved + .load(std::sync::atomic::Ordering::Relaxed) + { + return Ok(()); + } + + let mut graph_permit = self + .main_module_graph_container + .acquire_update_permit() + .await; + let graph = graph_permit.graph_mut(); + // populate the information from the lockfile + if let Some(lockfile) = &self.lockfile { + let lockfile = lockfile.lock(); + graph.fill_from_lockfile(FillFromLockfileOptions { + redirects: lockfile + .content + .redirects + .iter() + .map(|(from, to)| (from.as_str(), to.as_str())), + package_specifiers: lockfile + .content + .packages + .specifiers + .iter() + .map(|(dep, id)| (dep, id.as_str())), + }); + } + + let npm_resolver = self.npm_resolver.as_managed().unwrap(); + if self.deps.iter().all(|dep| match dep.kind { + DepKind::Npm => { + npm_resolver.resolve_pkg_id_from_pkg_req(&dep.req).is_ok() + } + DepKind::Jsr => graph.packages.mappings().contains_key(&dep.req), + }) { + self + .dependencies_resolved + .store(true, std::sync::atomic::Ordering::Relaxed); + graph_permit.commit(); + return Ok(()); + } + + npm_resolver.ensure_top_level_package_json_install().await?; + let mut roots = Vec::new(); + let mut info_futures = FuturesUnordered::new(); + for dep in &self.deps { + if dep.location.is_deno_json() { + match dep.kind { + DepKind::Npm => roots.push( + ModuleSpecifier::parse(&format!("npm:/{}/", dep.req)).unwrap(), + ), + DepKind::Jsr => info_futures.push(async { + if let Some(nv) = self.jsr_fetch_resolver.req_to_nv(&dep.req).await + { + if let Some(info) = + self.jsr_fetch_resolver.package_version_info(&nv).await + { + let specifier = + ModuleSpecifier::parse(&format!("jsr:/{}/", dep.req)) + .unwrap(); + return Some((specifier, info)); + } + } + None + }), + } + } + } + + while let Some(info_future) = info_futures.next().await { + if let Some((specifier, info)) = info_future { + let exports = info.exports(); + for (k, _) in exports { + if let Ok(spec) = specifier.join(k) { + roots.push(spec); + } + } + } + } + + self + .module_load_preparer + .prepare_module_load( + graph, + &roots, + false, + deno_config::deno_json::TsTypeLib::DenoWindow, + self.permissions_container.clone(), + None, + ) + .await?; + + graph_permit.commit(); + + Ok(()) + } + + pub fn resolved_version(&self, id: DepId) -> Option<&PackageNv> { + self.resolved_versions[id.0].as_ref() + } + + pub async fn resolve_current_versions(&mut self) -> Result<(), AnyError> { + self.run_dependency_resolution().await?; + + let graph = self.main_module_graph_container.graph(); + + let mut resolved = Vec::with_capacity(self.deps.len()); + let snapshot = self.npm_resolver.as_managed().unwrap().snapshot(); + let resolved_npm = snapshot.package_reqs(); + let resolved_jsr = graph.packages.mappings(); + for dep in &self.deps { + match dep.kind { + DepKind::Npm => { + let resolved_version = resolved_npm.get(&dep.req).cloned(); + resolved.push(resolved_version); + } + DepKind::Jsr => { + let resolved_version = resolved_jsr.get(&dep.req).cloned(); + resolved.push(resolved_version) + } + } + } + + self.resolved_versions = resolved; + + Ok(()) + } + + async fn load_latest_versions( + &self, + ) -> Result, AnyError> { + if self.latest_versions.len() == self.deps.len() { + return Ok(self.latest_versions.clone()); + } + let latest_tag_req = deno_semver::VersionReq::from_raw_text_and_inner( + "latest".into(), + deno_semver::RangeSetOrTag::Tag("latest".into()), + ); + let mut latest_versions = Vec::with_capacity(self.deps.len()); + + let npm_sema = Semaphore::new(32); + let jsr_sema = Semaphore::new(32); + let mut futs = FuturesOrdered::new(); + + for dep in &self.deps { + match dep.kind { + DepKind::Npm => futs.push_back( + async { + let semver_req = &dep.req; + let latest_req = PackageReq { + name: dep.req.name.clone(), + version_req: latest_tag_req.clone(), + }; + let _permit = npm_sema.acquire().await; + let semver_compatible = + self.npm_fetch_resolver.req_to_nv(semver_req).await; + let latest = self.npm_fetch_resolver.req_to_nv(&latest_req).await; + PackageLatestVersion { + latest, + semver_compatible, + } + } + .boxed_local(), + ), + DepKind::Jsr => futs.push_back( + async { + let semver_req = &dep.req; + let latest_req = PackageReq { + name: dep.req.name.clone(), + version_req: deno_semver::WILDCARD_VERSION_REQ.clone(), + }; + let _permit = jsr_sema.acquire().await; + let semver_compatible = + self.jsr_fetch_resolver.req_to_nv(semver_req).await; + let latest = self.jsr_fetch_resolver.req_to_nv(&latest_req).await; + PackageLatestVersion { + latest, + semver_compatible, + } + } + .boxed_local(), + ), + } + } + while let Some(nv) = futs.next().await { + latest_versions.push(nv); + } + + Ok(latest_versions) + } + + pub async fn resolve_versions(&mut self) -> Result<(), AnyError> { + let (_, latest_versions) = try_join( + self.run_dependency_resolution(), + self.load_latest_versions(), + ) + .await?; + + self.latest_versions = latest_versions; + + self.resolve_current_versions().await?; + + Ok(()) + } + + pub fn deps_with_resolved_latest_versions( + &self, + ) -> impl IntoIterator, PackageLatestVersion)> + '_ + { + self + .resolved_versions + .iter() + .zip(self.latest_versions.iter()) + .enumerate() + .map(|(i, (resolved, latest))| { + (DepId(i), resolved.clone(), latest.clone()) + }) + } + + pub fn get_dep(&self, id: DepId) -> &Dep { + &self.deps[id.0] + } + + pub fn update_dep(&mut self, dep_id: DepId, new_version_req: VersionReq) { + self + .pending_changes + .push(Change::Update(dep_id, new_version_req)); + } + + pub fn commit_changes(&mut self) -> Result<(), AnyError> { + let changes = std::mem::take(&mut self.pending_changes); + let mut config_updaters = HashMap::new(); + for change in changes { + match change { + Change::Update(dep_id, version_req) => { + // TODO: move most of this to ConfigUpdater + let dep = &mut self.deps[dep_id.0]; + dep.req.version_req = version_req.clone(); + match &dep.location { + DepLocation::DenoJson(arc, key_path, import_map_kind) => { + if matches!(import_map_kind, ImportMapKind::Outline) { + // not supported + continue; + } + let updater = + get_or_create_updater(&mut config_updaters, &dep.location)?; + + let Some(property) = updater.get_property_for_mutation(key_path) + else { + log::warn!( + "failed to find property at path {key_path:?} for file {}", + arc.specifier + ); + continue; + }; + let Some(string_value) = cst_string_literal(&property) else { + continue; + }; + let mut req_reference = match dep.kind { + DepKind::Npm => NpmPackageReqReference::from_str(&string_value) + .unwrap() + .into_inner(), + DepKind::Jsr => JsrPackageReqReference::from_str(&string_value) + .unwrap() + .into_inner(), + }; + req_reference.req.version_req = version_req; + let mut new_value = + format!("{}:{}", dep.kind.scheme(), req_reference); + if string_value.ends_with('/') && !new_value.ends_with('/') { + // the display impl for PackageReqReference maps `/` to the root + // subpath, but for the import map the trailing `/` is significant + new_value.push('/'); + } + if string_value + .trim_start_matches(format!("{}:", dep.kind.scheme()).as_str()) + .starts_with('/') + { + // this is gross + new_value = new_value.replace(':', ":/"); + } + property + .set_value(jsonc_parser::cst::CstInputValue::String(new_value)); + } + DepLocation::PackageJson(arc, key_path) => { + let updater = + get_or_create_updater(&mut config_updaters, &dep.location)?; + let Some(property) = updater.get_property_for_mutation(key_path) + else { + log::warn!( + "failed to find property at path {key_path:?} for file {}", + arc.path.display() + ); + continue; + }; + let Some(string_value) = cst_string_literal(&property) else { + continue; + }; + let new_value = if string_value.starts_with("npm:") { + // aliased + let rest = string_value.trim_start_matches("npm:"); + let mut parts = rest.split('@'); + let first = parts.next().unwrap(); + if first.is_empty() { + let scope_and_name = parts.next().unwrap(); + format!("npm:@{scope_and_name}@{version_req}") + } else { + format!("npm:{first}@{version_req}") + } + } else if string_value.contains(":") { + bail!("Unexpected package json dependency string: \"{string_value}\" in {}", arc.path.display()); + } else { + version_req.to_string() + }; + property + .set_value(jsonc_parser::cst::CstInputValue::String(new_value)); + } + } + } + } + } + + for (_, updater) in config_updaters { + updater.commit()?; + } + + Ok(()) + } +} + +fn get_or_create_updater<'a>( + config_updaters: &'a mut HashMap, + location: &DepLocation, +) -> Result<&'a mut ConfigUpdater, AnyError> { + match config_updaters.entry(location.file_path().into_owned()) { + std::collections::hash_map::Entry::Occupied(occupied_entry) => { + Ok(occupied_entry.into_mut()) + } + std::collections::hash_map::Entry::Vacant(vacant_entry) => { + let updater = ConfigUpdater::new( + location.config_kind(), + location.file_path().into_owned(), + )?; + Ok(vacant_entry.insert(updater)) + } + } +} + +fn cst_string_literal( + property: &jsonc_parser::cst::CstObjectProp, +) -> Option { + // TODO(nathanwhit): ensure this unwrap is safe + let value = property.value().unwrap(); + let Some(string) = value.as_string_lit() else { + log::warn!("malformed entry"); + return None; + }; + let Ok(string_value) = string.decoded_value() else { + log::warn!("malformed string: {string:?}"); + return None; + }; + Some(string_value) +} + +fn parse_req_reference( + input: &str, + kind: DepKind, +) -> Result< + PackageReqReference, + deno_semver::package::PackageReqReferenceParseError, +> { + Ok(match kind { + DepKind::Npm => NpmPackageReqReference::from_str(input)?.into_inner(), + DepKind::Jsr => JsrPackageReqReference::from_str(input)?.into_inner(), + }) +} diff --git a/cli/tools/registry/pm/outdated.rs b/cli/tools/registry/pm/outdated.rs new file mode 100644 index 0000000000..2a29014267 --- /dev/null +++ b/cli/tools/registry/pm/outdated.rs @@ -0,0 +1,661 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +use std::collections::HashSet; +use std::sync::Arc; + +use deno_core::error::AnyError; +use deno_semver::package::PackageNv; +use deno_semver::package::PackageReq; +use deno_semver::VersionReq; +use deno_terminal::colors; + +use crate::args::CacheSetting; +use crate::args::CliOptions; +use crate::args::Flags; +use crate::args::OutdatedFlags; +use crate::factory::CliFactory; +use crate::file_fetcher::FileFetcher; +use crate::jsr::JsrFetchResolver; +use crate::npm::NpmFetchResolver; +use crate::tools::registry::pm::deps::DepKind; + +use super::deps::Dep; +use super::deps::DepManager; +use super::deps::DepManagerArgs; +use super::deps::PackageLatestVersion; + +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)] +struct OutdatedPackage { + kind: DepKind, + latest: String, + semver_compatible: String, + current: String, + name: String, +} + +#[allow(clippy::print_stdout)] +fn print_outdated_table(packages: &[OutdatedPackage]) { + const HEADINGS: &[&str] = &["Package", "Current", "Update", "Latest"]; + + let mut longest_package = 0; + let mut longest_current = 0; + let mut longest_update = 0; + let mut longest_latest = 0; + + for package in packages { + let name_len = package.kind.scheme().len() + 1 + package.name.len(); + longest_package = longest_package.max(name_len); + longest_current = longest_current.max(package.current.len()); + longest_update = longest_update.max(package.semver_compatible.len()); + longest_latest = longest_latest.max(package.latest.len()); + } + + let package_column_width = longest_package.max(HEADINGS[0].len()) + 2; + let current_column_width = longest_current.max(HEADINGS[1].len()) + 2; + let update_column_width = longest_update.max(HEADINGS[2].len()) + 2; + let latest_column_width = longest_latest.max(HEADINGS[3].len()) + 2; + + let package_fill = "─".repeat(package_column_width); + let current_fill = "─".repeat(current_column_width); + let update_fill = "─".repeat(update_column_width); + let latest_fill = "─".repeat(latest_column_width); + + println!("┌{package_fill}┬{current_fill}┬{update_fill}┬{latest_fill}┐"); + println!( + "│ {}{} │ {}{} │ {}{} │ {}{} │", + colors::intense_blue(HEADINGS[0]), + " ".repeat(package_column_width - 2 - HEADINGS[0].len()), + colors::intense_blue(HEADINGS[1]), + " ".repeat(current_column_width - 2 - HEADINGS[1].len()), + colors::intense_blue(HEADINGS[2]), + " ".repeat(update_column_width - 2 - HEADINGS[2].len()), + colors::intense_blue(HEADINGS[3]), + " ".repeat(latest_column_width - 2 - HEADINGS[3].len()) + ); + for package in packages { + println!("├{package_fill}┼{current_fill}┼{update_fill}┼{latest_fill}┤",); + + print!( + "│ {: Result<(), AnyError> { + let mut outdated = Vec::new(); + let mut seen = std::collections::BTreeSet::new(); + for (dep_id, resolved, latest_versions) in + deps.deps_with_resolved_latest_versions() + { + let dep = deps.get_dep(dep_id); + + let Some(resolved) = resolved else { continue }; + + let latest = { + let preferred = if compatible { + &latest_versions.semver_compatible + } else { + &latest_versions.latest + }; + if let Some(v) = preferred { + v + } else { + continue; + } + }; + + if latest > &resolved + && seen.insert((dep.kind, dep.req.name.clone(), resolved.version.clone())) + { + outdated.push(OutdatedPackage { + kind: dep.kind, + name: dep.req.name.clone(), + current: resolved.version.to_string(), + latest: latest_versions + .latest + .map(|l| l.version.to_string()) + .unwrap_or_default(), + semver_compatible: latest_versions + .semver_compatible + .map(|l| l.version.to_string()) + .unwrap_or_default(), + }) + } + } + + if !outdated.is_empty() { + outdated.sort(); + print_outdated_table(&outdated); + } + + Ok(()) +} + +pub async fn outdated( + flags: Arc, + update_flags: OutdatedFlags, +) -> Result<(), AnyError> { + let factory = CliFactory::from_flags(flags.clone()); + let cli_options = factory.cli_options()?; + let workspace = cli_options.workspace(); + let http_client = factory.http_client_provider(); + let deps_http_cache = factory.global_http_cache()?; + let mut file_fetcher = FileFetcher::new( + deps_http_cache.clone(), + CacheSetting::RespectHeaders, + true, + http_client.clone(), + Default::default(), + None, + ); + file_fetcher.set_download_log_level(log::Level::Trace); + let file_fetcher = Arc::new(file_fetcher); + let npm_fetch_resolver = Arc::new(NpmFetchResolver::new( + file_fetcher.clone(), + cli_options.npmrc().clone(), + )); + let jsr_fetch_resolver = + Arc::new(JsrFetchResolver::new(file_fetcher.clone())); + + let args = dep_manager_args( + &factory, + cli_options, + npm_fetch_resolver.clone(), + jsr_fetch_resolver.clone(), + ) + .await?; + + let filter_set = filter::FilterSet::from_filter_strings( + update_flags.filters.iter().map(|s| s.as_str()), + )?; + + let filter_fn = |alias: Option<&str>, req: &PackageReq, _: DepKind| { + if filter_set.is_empty() { + return true; + } + let name = alias.unwrap_or(&req.name); + filter_set.matches(name) + }; + let mut deps = if update_flags.recursive { + super::deps::DepManager::from_workspace(workspace, filter_fn, args)? + } else { + super::deps::DepManager::from_workspace_dir( + &cli_options.start_dir, + filter_fn, + args, + )? + }; + + deps.resolve_versions().await?; + + match update_flags.kind { + crate::args::OutdatedKind::Update { latest } => { + update(deps, latest, &filter_set, flags).await?; + } + crate::args::OutdatedKind::PrintOutdated { compatible } => { + print_outdated(&mut deps, compatible)?; + } + } + + Ok(()) +} + +fn choose_new_version_req( + dep: &Dep, + resolved: Option<&PackageNv>, + latest_versions: &PackageLatestVersion, + update_to_latest: bool, + filter_set: &filter::FilterSet, +) -> Option { + let explicit_version_req = filter_set + .matching_filter(dep.alias.as_deref().unwrap_or(&dep.req.name)) + .version_spec() + .cloned(); + + if let Some(version_req) = explicit_version_req { + if let Some(resolved) = resolved { + // todo(nathanwhit): handle tag + if version_req.tag().is_none() && version_req.matches(&resolved.version) { + return None; + } + } + Some(version_req) + } else { + let preferred = if update_to_latest { + latest_versions.latest.as_ref()? + } else { + latest_versions.semver_compatible.as_ref()? + }; + if preferred.version <= resolved?.version { + return None; + } + Some( + VersionReq::parse_from_specifier( + format!("^{}", preferred.version).as_str(), + ) + .unwrap(), + ) + } +} + +async fn update( + mut deps: DepManager, + update_to_latest: bool, + filter_set: &filter::FilterSet, + flags: Arc, +) -> Result<(), AnyError> { + let mut updated = Vec::new(); + + for (dep_id, resolved, latest_versions) in deps + .deps_with_resolved_latest_versions() + .into_iter() + .collect::>() + { + let dep = deps.get_dep(dep_id); + let new_version_req = choose_new_version_req( + dep, + resolved.as_ref(), + &latest_versions, + update_to_latest, + filter_set, + ); + let Some(new_version_req) = new_version_req else { + continue; + }; + + updated.push(( + dep_id, + format!("{}:{}", dep.kind.scheme(), dep.req.name), + deps.resolved_version(dep.id).cloned(), + new_version_req.clone(), + )); + + deps.update_dep(dep_id, new_version_req); + } + + deps.commit_changes()?; + + if !updated.is_empty() { + let factory = super::npm_install_after_modification( + flags.clone(), + Some(deps.jsr_fetch_resolver.clone()), + ) + .await?; + + let mut updated_to_versions = HashSet::new(); + let cli_options = factory.cli_options()?; + let args = dep_manager_args( + &factory, + cli_options, + deps.npm_fetch_resolver.clone(), + deps.jsr_fetch_resolver.clone(), + ) + .await?; + + let mut deps = deps.reloaded_after_modification(args); + deps.resolve_current_versions().await?; + for (dep_id, package_name, maybe_current_version, new_version_req) in + updated + { + if let Some(nv) = deps.resolved_version(dep_id) { + updated_to_versions.insert(( + package_name, + maybe_current_version, + nv.version.clone(), + )); + } else { + log::warn!( + "Failed to resolve version for new version requirement: {} -> {}", + package_name, + new_version_req + ); + } + } + + log::info!( + "Updated {} dependenc{}:", + updated_to_versions.len(), + if updated_to_versions.len() == 1 { + "y" + } else { + "ies" + } + ); + let mut updated_to_versions = + updated_to_versions.into_iter().collect::>(); + updated_to_versions.sort_by(|(k, _, _), (k2, _, _)| k.cmp(k2)); + let max_name = updated_to_versions + .iter() + .map(|(name, _, _)| name.len()) + .max() + .unwrap_or(0); + let max_old = updated_to_versions + .iter() + .map(|(_, maybe_current, _)| { + maybe_current + .as_ref() + .map(|v| v.version.to_string().len()) + .unwrap_or(0) + }) + .max() + .unwrap_or(0); + let max_new = updated_to_versions + .iter() + .map(|(_, _, new_version)| new_version.to_string().len()) + .max() + .unwrap_or(0); + + for (package_name, maybe_current_version, new_version) in + updated_to_versions + { + let current_version = if let Some(current_version) = maybe_current_version + { + current_version.version.to_string() + } else { + "".to_string() + }; + + log::info!( + " - {}{} {}{} -> {}{}", + format!( + "{}{}", + colors::gray(package_name[0..4].to_string()), + package_name[4..].to_string() + ), + " ".repeat(max_name - package_name.len()), + " ".repeat(max_old - current_version.len()), + colors::gray(¤t_version), + " ".repeat(max_new - new_version.to_string().len()), + colors::green(&new_version), + ); + } + } else { + log::info!( + "All {}dependencies are up to date.", + if filter_set.is_empty() { + "" + } else { + "matching " + } + ); + } + + Ok(()) +} + +async fn dep_manager_args( + factory: &CliFactory, + cli_options: &CliOptions, + npm_fetch_resolver: Arc, + jsr_fetch_resolver: Arc, +) -> Result { + Ok(DepManagerArgs { + module_load_preparer: factory.module_load_preparer().await?.clone(), + jsr_fetch_resolver, + npm_fetch_resolver, + npm_resolver: factory.npm_resolver().await?.clone(), + permissions_container: factory.root_permissions_container()?.clone(), + main_module_graph_container: factory + .main_module_graph_container() + .await? + .clone(), + lockfile: cli_options.maybe_lockfile().cloned(), + }) +} + +mod filter { + use deno_core::anyhow::anyhow; + use deno_core::anyhow::Context; + use deno_core::error::AnyError; + use deno_semver::VersionReq; + + enum FilterKind { + Exclude, + Include, + } + pub struct Filter { + kind: FilterKind, + regex: regex::Regex, + version_spec: Option, + } + + fn pattern_to_regex(pattern: &str) -> Result { + let escaped = regex::escape(pattern); + let unescaped_star = escaped.replace(r"\*", ".*"); + Ok(regex::Regex::new(&format!("^{}$", unescaped_star))?) + } + + impl Filter { + pub fn version_spec(&self) -> Option<&VersionReq> { + self.version_spec.as_ref() + } + pub fn from_str(input: &str) -> Result { + let (kind, first_idx) = if input.starts_with('!') { + (FilterKind::Exclude, 1) + } else { + (FilterKind::Include, 0) + }; + let s = &input[first_idx..]; + let (pattern, version_spec) = + if let Some(scope_name) = s.strip_prefix('@') { + if let Some(idx) = scope_name.find('@') { + let (pattern, version_spec) = s.split_at(idx + 1); + ( + pattern, + Some( + VersionReq::parse_from_specifier( + version_spec.trim_start_matches('@'), + ) + .with_context(|| format!("Invalid filter \"{input}\""))?, + ), + ) + } else { + (s, None) + } + } else { + let mut parts = s.split('@'); + let Some(pattern) = parts.next() else { + return Err(anyhow!("Invalid filter \"{input}\"")); + }; + ( + pattern, + parts + .next() + .map(VersionReq::parse_from_specifier) + .transpose() + .with_context(|| format!("Invalid filter \"{input}\""))?, + ) + }; + + Ok(Filter { + kind, + regex: pattern_to_regex(pattern) + .with_context(|| format!("Invalid filter \"{input}\""))?, + version_spec, + }) + } + + pub fn matches(&self, name: &str) -> bool { + self.regex.is_match(name) + } + } + + pub struct FilterSet { + filters: Vec, + has_exclude: bool, + has_include: bool, + } + impl FilterSet { + pub fn from_filter_strings<'a>( + filter_strings: impl IntoIterator, + ) -> Result { + let filters = filter_strings + .into_iter() + .map(Filter::from_str) + .collect::, _>>()?; + let has_exclude = filters + .iter() + .any(|f| matches!(f.kind, FilterKind::Exclude)); + let has_include = filters + .iter() + .any(|f| matches!(f.kind, FilterKind::Include)); + Ok(FilterSet { + filters, + has_exclude, + has_include, + }) + } + + pub fn is_empty(&self) -> bool { + self.filters.is_empty() + } + + pub fn matches(&self, name: &str) -> bool { + self.matching_filter(name).is_included() + } + + pub fn matching_filter(&self, name: &str) -> MatchResult<'_> { + if self.filters.is_empty() { + return MatchResult::Included; + } + let mut matched = None; + for filter in &self.filters { + match filter.kind { + FilterKind::Include => { + if matched.is_none() && filter.matches(name) { + matched = Some(filter); + } + } + FilterKind::Exclude => { + if filter.matches(name) { + return MatchResult::Excluded; + } + } + } + } + if let Some(filter) = matched { + MatchResult::Matches(filter) + } else if self.has_exclude && !self.has_include { + MatchResult::Included + } else { + MatchResult::Excluded + } + } + } + + pub enum MatchResult<'a> { + Matches(&'a Filter), + Included, + Excluded, + } + + impl MatchResult<'_> { + pub fn version_spec(&self) -> Option<&VersionReq> { + match self { + MatchResult::Matches(filter) => filter.version_spec(), + _ => None, + } + } + pub fn is_included(&self) -> bool { + matches!(self, MatchResult::Included | MatchResult::Matches(_)) + } + } + + #[cfg(test)] + mod test { + fn matches_filters<'a, 'b>( + filters: impl IntoIterator, + name: &str, + ) -> bool { + let filters = super::FilterSet::from_filter_strings(filters).unwrap(); + filters.matches(name) + } + + fn version_spec(s: &str) -> deno_semver::VersionReq { + deno_semver::VersionReq::parse_from_specifier(s).unwrap() + } + + #[test] + fn basic_glob() { + assert!(matches_filters(["foo*"], "foo")); + assert!(matches_filters(["foo*"], "foobar")); + assert!(!matches_filters(["foo*"], "barfoo")); + + assert!(matches_filters(["*foo"], "foo")); + assert!(matches_filters(["*foo"], "barfoo")); + assert!(!matches_filters(["*foo"], "foobar")); + + assert!(matches_filters(["@scope/foo*"], "@scope/foobar")); + } + + #[test] + fn basic_glob_with_version() { + assert!(matches_filters(["foo*@1"], "foo",)); + assert!(matches_filters(["foo*@1"], "foobar",)); + assert!(matches_filters(["foo*@1"], "foo-bar",)); + assert!(!matches_filters(["foo*@1"], "barfoo",)); + assert!(matches_filters(["@scope/*@1"], "@scope/foo")); + } + + #[test] + fn glob_exclude() { + assert!(!matches_filters(["!foo*"], "foo")); + assert!(!matches_filters(["!foo*"], "foobar")); + assert!(matches_filters(["!foo*"], "barfoo")); + + assert!(!matches_filters(["!*foo"], "foo")); + assert!(!matches_filters(["!*foo"], "barfoo")); + assert!(matches_filters(["!*foo"], "foobar")); + + assert!(!matches_filters(["!@scope/foo*"], "@scope/foobar")); + } + + #[test] + fn multiple_globs() { + assert!(matches_filters(["foo*", "bar*"], "foo")); + assert!(matches_filters(["foo*", "bar*"], "bar")); + assert!(!matches_filters(["foo*", "bar*"], "baz")); + + assert!(matches_filters(["foo*", "!bar*"], "foo")); + assert!(!matches_filters(["foo*", "!bar*"], "bar")); + assert!(matches_filters(["foo*", "!bar*"], "foobar")); + assert!(!matches_filters(["foo*", "!*bar"], "foobar")); + assert!(!matches_filters(["foo*", "!*bar"], "baz")); + + let filters = + super::FilterSet::from_filter_strings(["foo*@1", "bar*@2"]).unwrap(); + + assert_eq!( + filters.matching_filter("foo").version_spec().cloned(), + Some(version_spec("1")) + ); + + assert_eq!( + filters.matching_filter("bar").version_spec().cloned(), + Some(version_spec("2")) + ); + } + } +} diff --git a/tests/registry/jsr/@denotest/add/0.2.1/mod.ts b/tests/registry/jsr/@denotest/add/0.2.1/mod.ts new file mode 100644 index 0000000000..864e8dd321 --- /dev/null +++ b/tests/registry/jsr/@denotest/add/0.2.1/mod.ts @@ -0,0 +1,4 @@ +// This is renamed to `add()` in 1.0.0. +export function sum(a: number, b: number): number { + return a + b; +} diff --git a/tests/registry/jsr/@denotest/add/0.2.1_meta.json b/tests/registry/jsr/@denotest/add/0.2.1_meta.json new file mode 100644 index 0000000000..6eebe21985 --- /dev/null +++ b/tests/registry/jsr/@denotest/add/0.2.1_meta.json @@ -0,0 +1,8 @@ +{ + "exports": { + ".": "./mod.ts" + }, + "moduleGraph1": { + "/mod.ts": {} + } +} diff --git a/tests/registry/jsr/@denotest/add/meta.json b/tests/registry/jsr/@denotest/add/meta.json index 72aea80cc3..f1a50109d8 100644 --- a/tests/registry/jsr/@denotest/add/meta.json +++ b/tests/registry/jsr/@denotest/add/meta.json @@ -4,6 +4,7 @@ "yanked": true }, "1.0.0": {}, - "0.2.0": {} + "0.2.0": {}, + "0.2.1": {} } } diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.2.0/add.ts b/tests/registry/jsr/@denotest/multiple-exports/0.2.0/add.ts new file mode 100644 index 0000000000..de02f69024 --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.2.0/add.ts @@ -0,0 +1 @@ +export * from "jsr:@denotest/add@1"; diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.2.0/data.json b/tests/registry/jsr/@denotest/multiple-exports/0.2.0/data.json new file mode 100644 index 0000000000..885e71c6cc --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.2.0/data.json @@ -0,0 +1,3 @@ +{ + "a": 1 +} \ No newline at end of file diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.2.0/subtract.ts b/tests/registry/jsr/@denotest/multiple-exports/0.2.0/subtract.ts new file mode 100644 index 0000000000..215c42310d --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.2.0/subtract.ts @@ -0,0 +1 @@ +export * from "jsr:@denotest/subtract@1"; diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.2.0_meta.json b/tests/registry/jsr/@denotest/multiple-exports/0.2.0_meta.json new file mode 100644 index 0000000000..d9f58b9a61 --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.2.0_meta.json @@ -0,0 +1,7 @@ +{ + "exports": { + "./add": "./add.ts", + "./subtract": "./subtract.ts", + "./data-json": "./data.json" + } +} diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.5.0/add.ts b/tests/registry/jsr/@denotest/multiple-exports/0.5.0/add.ts new file mode 100644 index 0000000000..de02f69024 --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.5.0/add.ts @@ -0,0 +1 @@ +export * from "jsr:@denotest/add@1"; diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.5.0/data.json b/tests/registry/jsr/@denotest/multiple-exports/0.5.0/data.json new file mode 100644 index 0000000000..885e71c6cc --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.5.0/data.json @@ -0,0 +1,3 @@ +{ + "a": 1 +} \ No newline at end of file diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.5.0/subtract.ts b/tests/registry/jsr/@denotest/multiple-exports/0.5.0/subtract.ts new file mode 100644 index 0000000000..215c42310d --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.5.0/subtract.ts @@ -0,0 +1 @@ +export * from "jsr:@denotest/subtract@1"; diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.5.0_meta.json b/tests/registry/jsr/@denotest/multiple-exports/0.5.0_meta.json new file mode 100644 index 0000000000..d9f58b9a61 --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.5.0_meta.json @@ -0,0 +1,7 @@ +{ + "exports": { + "./add": "./add.ts", + "./subtract": "./subtract.ts", + "./data-json": "./data.json" + } +} diff --git a/tests/registry/jsr/@denotest/multiple-exports/meta.json b/tests/registry/jsr/@denotest/multiple-exports/meta.json index 02601e4d0d..aaaf18a184 100644 --- a/tests/registry/jsr/@denotest/multiple-exports/meta.json +++ b/tests/registry/jsr/@denotest/multiple-exports/meta.json @@ -1,5 +1,7 @@ { "versions": { - "1.0.0": {} + "1.0.0": {}, + "0.5.0": {}, + "0.2.0": {} } } diff --git a/tests/registry/jsr/@denotest/subtract/0.2.0/mod.ts b/tests/registry/jsr/@denotest/subtract/0.2.0/mod.ts new file mode 100644 index 0000000000..74e49ea6fa --- /dev/null +++ b/tests/registry/jsr/@denotest/subtract/0.2.0/mod.ts @@ -0,0 +1,3 @@ +export function sub(a: number, b: number): number { + return a - b; +} diff --git a/tests/registry/jsr/@denotest/subtract/0.2.0_meta.json b/tests/registry/jsr/@denotest/subtract/0.2.0_meta.json new file mode 100644 index 0000000000..6eebe21985 --- /dev/null +++ b/tests/registry/jsr/@denotest/subtract/0.2.0_meta.json @@ -0,0 +1,8 @@ +{ + "exports": { + ".": "./mod.ts" + }, + "moduleGraph1": { + "/mod.ts": {} + } +} diff --git a/tests/registry/jsr/@denotest/subtract/meta.json b/tests/registry/jsr/@denotest/subtract/meta.json index 02601e4d0d..2f4cee59df 100644 --- a/tests/registry/jsr/@denotest/subtract/meta.json +++ b/tests/registry/jsr/@denotest/subtract/meta.json @@ -1,5 +1,7 @@ { + "latest": "1.0.0", "versions": { - "1.0.0": {} + "1.0.0": {}, + "0.2.0": {} } } diff --git a/tests/registry/npm/@denotest/has-patch-versions/0.1.0/package.json b/tests/registry/npm/@denotest/has-patch-versions/0.1.0/package.json new file mode 100644 index 0000000000..45684d4f52 --- /dev/null +++ b/tests/registry/npm/@denotest/has-patch-versions/0.1.0/package.json @@ -0,0 +1,5 @@ +{ + "name": "@denotest/has-patch-versions", + "version": "0.1.0" + +} \ No newline at end of file diff --git a/tests/registry/npm/@denotest/has-patch-versions/0.1.1/package.json b/tests/registry/npm/@denotest/has-patch-versions/0.1.1/package.json new file mode 100644 index 0000000000..4483df34e5 --- /dev/null +++ b/tests/registry/npm/@denotest/has-patch-versions/0.1.1/package.json @@ -0,0 +1,5 @@ +{ + "name": "@denotest/has-patch-versions", + "version": "0.1.1" + +} \ No newline at end of file diff --git a/tests/registry/npm/@denotest/has-patch-versions/0.2.0/package.json b/tests/registry/npm/@denotest/has-patch-versions/0.2.0/package.json new file mode 100644 index 0000000000..55efaaa326 --- /dev/null +++ b/tests/registry/npm/@denotest/has-patch-versions/0.2.0/package.json @@ -0,0 +1,4 @@ +{ + "name": "@denotest/has-patch-versions", + "version": "0.2.0" +} \ No newline at end of file diff --git a/tests/specs/update/deno_json/__test__.jsonc b/tests/specs/update/deno_json/__test__.jsonc new file mode 100644 index 0000000000..8b4aa26b5c --- /dev/null +++ b/tests/specs/update/deno_json/__test__.jsonc @@ -0,0 +1,101 @@ +{ + "tempDir": true, + "tests": { + // just to make sure install doesn't change the lockfile + "sanity_lockfile_up_to_date": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": [ + "eval", + "const now = Deno.readTextFileSync('./deno.lock'); console.log(now.trim());" + ], + "output": "deno.lock.orig.out" + } + ] + }, + "print_outdated": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "outdated", + "output": "outdated.out" + } + ] + }, + "print_outdated_compatible": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "outdated --compatible", + "output": "outdated_compatible.out" + } + ] + }, + "update_compatible": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "outdated --update", + "output": "./update_compatible/update.out" + }, + { + "args": "-A print_file.ts ./deno.json", + "output": "./update_compatible/deno.json.out" + }, + { + "args": "-A print_file.ts ./deno.lock", + "output": "./update_compatible/deno.lock.out" + } + ] + }, + "update_latest": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "outdated --update --latest", + "output": "update_latest/update.out" + }, + { + "args": "-A print_file.ts ./deno.json", + "output": "./update_latest/deno.json.out" + }, + { + "args": "-A print_file.ts ./deno.lock", + "output": "./update_latest/deno.lock.out" + } + ] + }, + "update_filtered": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "outdated --update --latest @denotest/add @denotest/b* !@denotest/breaking* @denotest/with-subpath@0.5.0", + "output": "filtered/update.out" + }, + { + "args": "-A print_file.ts ./deno.json", + "output": "filtered/deno.json.out" + } + ] + } + } +} diff --git a/tests/specs/update/deno_json/deno.json b/tests/specs/update/deno_json/deno.json new file mode 100644 index 0000000000..4f880e6db9 --- /dev/null +++ b/tests/specs/update/deno_json/deno.json @@ -0,0 +1,19 @@ +{ + "imports": { + "@denotest/add": "jsr:@denotest/add@^0.2.0", + "@denotest/add/": "jsr:/@denotest/add@^0.2.0/", + "@denotest/subtract": "jsr:@denotest/subtract@^0.2.0", + "@denotest/with-subpath": "jsr:@denotest/multiple-exports@0.2.0/data-json", + "@denotest/breaking-change-between-versions": "npm:@denotest/breaking-change-between-versions@1.0.0", + "@denotest/bin": "npm:@denotest/bin@0.6.0", + "@denotest/has-patch-versions": "npm:@denotest/has-patch-versions@^0.1.0" + }, + "scopes": { + "/foo/": { + "@denotest/add": "jsr:@denotest/add@^0.2.0", + "@denotest/add/": "jsr:/@denotest/add@^0.2.0/", + "@denotest/subtract": "jsr:@denotest/subtract@^0.2.0", + "@denotest/with-subpath": "jsr:@denotest/multiple-exports@0.2.0/data-json" + } + } +} diff --git a/tests/specs/update/deno_json/deno.lock b/tests/specs/update/deno_json/deno.lock new file mode 100644 index 0000000000..7c4d5e3690 --- /dev/null +++ b/tests/specs/update/deno_json/deno.lock @@ -0,0 +1,43 @@ +{ + "version": "4", + "specifiers": { + "jsr:@denotest/add@0.2": "0.2.0", + "jsr:@denotest/multiple-exports@0.2.0": "0.2.0", + "jsr:@denotest/subtract@0.2": "0.2.0", + "npm:@denotest/bin@0.6.0": "0.6.0", + "npm:@denotest/breaking-change-between-versions@1.0.0": "1.0.0", + "npm:@denotest/has-patch-versions@0.1": "0.1.0" + }, + "jsr": { + "@denotest/add@0.2.0": { + "integrity": "a9076d30ecb42b2fc6dd95e7055fbf4e6358b53f550741bd7f60089d19f68848" + }, + "@denotest/multiple-exports@0.2.0": { + "integrity": "efe9748a0c0939c7ac245fee04acc0c42bd7a61874ff71a360c4543e4f5f6b36" + }, + "@denotest/subtract@0.2.0": { + "integrity": "c9650fc559ab2430effc0c7fb1540e3aa89888fbdd926335ccfdeac57eb3a64d" + } + }, + "npm": { + "@denotest/bin@0.6.0": { + "integrity": "sha512-vCNpxFgQN4fw4ZOp63nbTX1ilcDqNpvXCvYyC8nmfxQQAezsEt095I/YXwMIoMGzWtjCvlMf9kVEYfLuT5oEGQ==" + }, + "@denotest/breaking-change-between-versions@1.0.0": { + "integrity": "sha512-bzMGYx+DxxPlI74n/VsDAN7Db1BY7Sz2XqxXruMo9dEznsBZu7Ez3i8YQ8n0leTxAiiMk1RCG4zQHPG1aj3xRw==" + }, + "@denotest/has-patch-versions@0.1.0": { + "integrity": "sha512-H/MBo0jKDdMsX4AAGEGQbZj70nfNe3oUNZXbohYHhqf9EfpLnXp/7FC29ZdfV4+p6VjEcOGdCtXc6rilE6iYpg==" + } + }, + "workspace": { + "dependencies": [ + "jsr:@denotest/add@0.2", + "jsr:@denotest/multiple-exports@0.2.0", + "jsr:@denotest/subtract@0.2", + "npm:@denotest/bin@0.6.0", + "npm:@denotest/breaking-change-between-versions@1.0.0", + "npm:@denotest/has-patch-versions@0.1" + ] + } +} diff --git a/tests/specs/update/deno_json/deno.lock.orig.out b/tests/specs/update/deno_json/deno.lock.orig.out new file mode 100644 index 0000000000..7c4d5e3690 --- /dev/null +++ b/tests/specs/update/deno_json/deno.lock.orig.out @@ -0,0 +1,43 @@ +{ + "version": "4", + "specifiers": { + "jsr:@denotest/add@0.2": "0.2.0", + "jsr:@denotest/multiple-exports@0.2.0": "0.2.0", + "jsr:@denotest/subtract@0.2": "0.2.0", + "npm:@denotest/bin@0.6.0": "0.6.0", + "npm:@denotest/breaking-change-between-versions@1.0.0": "1.0.0", + "npm:@denotest/has-patch-versions@0.1": "0.1.0" + }, + "jsr": { + "@denotest/add@0.2.0": { + "integrity": "a9076d30ecb42b2fc6dd95e7055fbf4e6358b53f550741bd7f60089d19f68848" + }, + "@denotest/multiple-exports@0.2.0": { + "integrity": "efe9748a0c0939c7ac245fee04acc0c42bd7a61874ff71a360c4543e4f5f6b36" + }, + "@denotest/subtract@0.2.0": { + "integrity": "c9650fc559ab2430effc0c7fb1540e3aa89888fbdd926335ccfdeac57eb3a64d" + } + }, + "npm": { + "@denotest/bin@0.6.0": { + "integrity": "sha512-vCNpxFgQN4fw4ZOp63nbTX1ilcDqNpvXCvYyC8nmfxQQAezsEt095I/YXwMIoMGzWtjCvlMf9kVEYfLuT5oEGQ==" + }, + "@denotest/breaking-change-between-versions@1.0.0": { + "integrity": "sha512-bzMGYx+DxxPlI74n/VsDAN7Db1BY7Sz2XqxXruMo9dEznsBZu7Ez3i8YQ8n0leTxAiiMk1RCG4zQHPG1aj3xRw==" + }, + "@denotest/has-patch-versions@0.1.0": { + "integrity": "sha512-H/MBo0jKDdMsX4AAGEGQbZj70nfNe3oUNZXbohYHhqf9EfpLnXp/7FC29ZdfV4+p6VjEcOGdCtXc6rilE6iYpg==" + } + }, + "workspace": { + "dependencies": [ + "jsr:@denotest/add@0.2", + "jsr:@denotest/multiple-exports@0.2.0", + "jsr:@denotest/subtract@0.2", + "npm:@denotest/bin@0.6.0", + "npm:@denotest/breaking-change-between-versions@1.0.0", + "npm:@denotest/has-patch-versions@0.1" + ] + } +} diff --git a/tests/specs/update/deno_json/filtered/deno.json.out b/tests/specs/update/deno_json/filtered/deno.json.out new file mode 100644 index 0000000000..4458e2d037 --- /dev/null +++ b/tests/specs/update/deno_json/filtered/deno.json.out @@ -0,0 +1,19 @@ +{ + "imports": { + "@denotest/add": "jsr:@denotest/add@^1.0.0", + "@denotest/add/": "jsr:/@denotest/add@^1.0.0/", + "@denotest/subtract": "jsr:@denotest/subtract@^0.2.0", + "@denotest/with-subpath": "jsr:@denotest/multiple-exports@0.5.0/data-json", + "@denotest/breaking-change-between-versions": "npm:@denotest/breaking-change-between-versions@1.0.0", + "@denotest/bin": "npm:@denotest/bin@^1.0.0", + "@denotest/has-patch-versions": "npm:@denotest/has-patch-versions@^0.1.0" + }, + "scopes": { + "/foo/": { + "@denotest/add": "jsr:@denotest/add@^1.0.0", + "@denotest/add/": "jsr:/@denotest/add@^1.0.0/", + "@denotest/subtract": "jsr:@denotest/subtract@^0.2.0", + "@denotest/with-subpath": "jsr:@denotest/multiple-exports@0.5.0/data-json" + } + } +} diff --git a/tests/specs/update/deno_json/filtered/update.out b/tests/specs/update/deno_json/filtered/update.out new file mode 100644 index 0000000000..ce16c6f6b7 --- /dev/null +++ b/tests/specs/update/deno_json/filtered/update.out @@ -0,0 +1,10 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/bin/1.0.0.tgz +Download http://127.0.0.1:4250/@denotest/multiple-exports/0.5.0_meta.json +Download http://127.0.0.1:4250/@denotest/multiple-exports/0.5.0/data.json +Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts +[UNORDERED_END] +Updated 3 dependencies: + - jsr:@denotest/add 0.2.0 -> 1.0.0 + - jsr:@denotest/multiple-exports 0.2.0 -> 0.5.0 + - npm:@denotest/bin 0.6.0 -> 1.0.0 diff --git a/tests/specs/update/deno_json/outdated.out b/tests/specs/update/deno_json/outdated.out new file mode 100644 index 0000000000..07ff9f3416 --- /dev/null +++ b/tests/specs/update/deno_json/outdated.out @@ -0,0 +1,15 @@ +┌────────────────────────────────────────────────┬─────────┬────────┬────────┐ +│ Package │ Current │ Update │ Latest │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ jsr:@denotest/multiple-exports │ 0.2.0 │ 0.2.0 │ 1.0.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ jsr:@denotest/subtract │ 0.2.0 │ 0.2.0 │ 1.0.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ jsr:@denotest/add │ 0.2.0 │ 0.2.1 │ 1.0.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/has-patch-versions │ 0.1.0 │ 0.1.1 │ 0.2.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/bin │ 0.6.0 │ 0.6.0 │ 1.0.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/breaking-change-between-versions │ 1.0.0 │ 1.0.0 │ 2.0.0 │ +└────────────────────────────────────────────────┴─────────┴────────┴────────┘ diff --git a/tests/specs/update/deno_json/outdated_compatible.out b/tests/specs/update/deno_json/outdated_compatible.out new file mode 100644 index 0000000000..54511a537f --- /dev/null +++ b/tests/specs/update/deno_json/outdated_compatible.out @@ -0,0 +1,7 @@ +┌──────────────────────────────────┬─────────┬────────┬────────┐ +│ Package │ Current │ Update │ Latest │ +├──────────────────────────────────┼─────────┼────────┼────────┤ +│ jsr:@denotest/add │ 0.2.0 │ 0.2.1 │ 1.0.0 │ +├──────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/has-patch-versions │ 0.1.0 │ 0.1.1 │ 0.2.0 │ +└──────────────────────────────────┴─────────┴────────┴────────┘ diff --git a/tests/specs/update/deno_json/print_file.ts b/tests/specs/update/deno_json/print_file.ts new file mode 100644 index 0000000000..c57b6c3a4e --- /dev/null +++ b/tests/specs/update/deno_json/print_file.ts @@ -0,0 +1,2 @@ +const file = Deno.args[0]; +console.log(Deno.readTextFileSync(file).trim()); diff --git a/tests/specs/update/deno_json/update_compatible/deno.json.out b/tests/specs/update/deno_json/update_compatible/deno.json.out new file mode 100644 index 0000000000..e453eff3c9 --- /dev/null +++ b/tests/specs/update/deno_json/update_compatible/deno.json.out @@ -0,0 +1,19 @@ +{ + "imports": { + "@denotest/add": "jsr:@denotest/add@^0.2.1", + "@denotest/add/": "jsr:/@denotest/add@^0.2.1/", + "@denotest/subtract": "jsr:@denotest/subtract@^0.2.0", + "@denotest/with-subpath": "jsr:@denotest/multiple-exports@0.2.0/data-json", + "@denotest/breaking-change-between-versions": "npm:@denotest/breaking-change-between-versions@1.0.0", + "@denotest/bin": "npm:@denotest/bin@0.6.0", + "@denotest/has-patch-versions": "npm:@denotest/has-patch-versions@^0.1.1" + }, + "scopes": { + "/foo/": { + "@denotest/add": "jsr:@denotest/add@^0.2.1", + "@denotest/add/": "jsr:/@denotest/add@^0.2.1/", + "@denotest/subtract": "jsr:@denotest/subtract@^0.2.0", + "@denotest/with-subpath": "jsr:@denotest/multiple-exports@0.2.0/data-json" + } + } +} diff --git a/tests/specs/update/deno_json/update_compatible/deno.lock.out b/tests/specs/update/deno_json/update_compatible/deno.lock.out new file mode 100644 index 0000000000..994d6f7ac9 --- /dev/null +++ b/tests/specs/update/deno_json/update_compatible/deno.lock.out @@ -0,0 +1,43 @@ +{ + "version": "4", + "specifiers": { + "jsr:@denotest/add@~0.2.1": "0.2.1", + "jsr:@denotest/multiple-exports@0.2.0": "0.2.0", + "jsr:@denotest/subtract@0.2": "0.2.0", + "npm:@denotest/bin@0.6.0": "0.6.0", + "npm:@denotest/breaking-change-between-versions@1.0.0": "1.0.0", + "npm:@denotest/has-patch-versions@~0.1.1": "0.1.1" + }, + "jsr": { + "@denotest/add@0.2.1": { + "integrity": "a9076d30ecb42b2fc6dd95e7055fbf4e6358b53f550741bd7f60089d19f68848" + }, + "@denotest/multiple-exports@0.2.0": { + "integrity": "efe9748a0c0939c7ac245fee04acc0c42bd7a61874ff71a360c4543e4f5f6b36" + }, + "@denotest/subtract@0.2.0": { + "integrity": "c9650fc559ab2430effc0c7fb1540e3aa89888fbdd926335ccfdeac57eb3a64d" + } + }, + "npm": { + "@denotest/bin@0.6.0": { + "integrity": "sha512-vCNpxFgQN4fw4ZOp63nbTX1ilcDqNpvXCvYyC8nmfxQQAezsEt095I/YXwMIoMGzWtjCvlMf9kVEYfLuT5oEGQ==" + }, + "@denotest/breaking-change-between-versions@1.0.0": { + "integrity": "sha512-bzMGYx+DxxPlI74n/VsDAN7Db1BY7Sz2XqxXruMo9dEznsBZu7Ez3i8YQ8n0leTxAiiMk1RCG4zQHPG1aj3xRw==" + }, + "@denotest/has-patch-versions@0.1.1": { + "integrity": "sha512-slUqYhu6DrPiSdNzmW5aMdW2/osIYnDP0yY3CwgLzAiyK0/cwb0epSpTSyZEmTKXA3rezxxC7ASSsnD34uH1/w==" + } + }, + "workspace": { + "dependencies": [ + "jsr:@denotest/add@~0.2.1", + "jsr:@denotest/multiple-exports@0.2.0", + "jsr:@denotest/subtract@0.2", + "npm:@denotest/bin@0.6.0", + "npm:@denotest/breaking-change-between-versions@1.0.0", + "npm:@denotest/has-patch-versions@~0.1.1" + ] + } +} diff --git a/tests/specs/update/deno_json/update_compatible/update.out b/tests/specs/update/deno_json/update_compatible/update.out new file mode 100644 index 0000000000..17c5358fe6 --- /dev/null +++ b/tests/specs/update/deno_json/update_compatible/update.out @@ -0,0 +1,7 @@ +[UNORDERED_START] +Download http://127.0.0.1:4250/@denotest/add/0.2.1/mod.ts +Download http://localhost:4260/@denotest/has-patch-versions/0.1.1.tgz +[UNORDERED_END] +Updated 2 dependencies: + - jsr:@denotest/add 0.2.0 -> 0.2.1 + - npm:@denotest/has-patch-versions 0.1.0 -> 0.1.1 diff --git a/tests/specs/update/deno_json/update_latest/deno.json.out b/tests/specs/update/deno_json/update_latest/deno.json.out new file mode 100644 index 0000000000..5e4e99bd66 --- /dev/null +++ b/tests/specs/update/deno_json/update_latest/deno.json.out @@ -0,0 +1,19 @@ +{ + "imports": { + "@denotest/add": "jsr:@denotest/add@^1.0.0", + "@denotest/add/": "jsr:/@denotest/add@^1.0.0/", + "@denotest/subtract": "jsr:@denotest/subtract@^1.0.0", + "@denotest/with-subpath": "jsr:@denotest/multiple-exports@^1.0.0/data-json", + "@denotest/breaking-change-between-versions": "npm:@denotest/breaking-change-between-versions@^2.0.0", + "@denotest/bin": "npm:@denotest/bin@^1.0.0", + "@denotest/has-patch-versions": "npm:@denotest/has-patch-versions@^0.2.0" + }, + "scopes": { + "/foo/": { + "@denotest/add": "jsr:@denotest/add@^1.0.0", + "@denotest/add/": "jsr:/@denotest/add@^1.0.0/", + "@denotest/subtract": "jsr:@denotest/subtract@^1.0.0", + "@denotest/with-subpath": "jsr:@denotest/multiple-exports@^1.0.0/data-json" + } + } +} diff --git a/tests/specs/update/deno_json/update_latest/deno.lock.out b/tests/specs/update/deno_json/update_latest/deno.lock.out new file mode 100644 index 0000000000..ad83546ab1 --- /dev/null +++ b/tests/specs/update/deno_json/update_latest/deno.lock.out @@ -0,0 +1,43 @@ +{ + "version": "4", + "specifiers": { + "jsr:@denotest/add@1": "1.0.0", + "jsr:@denotest/multiple-exports@1": "1.0.0", + "jsr:@denotest/subtract@1": "1.0.0", + "npm:@denotest/bin@1": "1.0.0", + "npm:@denotest/breaking-change-between-versions@2": "2.0.0", + "npm:@denotest/has-patch-versions@0.2": "0.2.0" + }, + "jsr": { + "@denotest/add@1.0.0": { + "integrity": "3b2e675c1ad7fba2a45bc251992e01aff08a3c974ac09079b11e6a5b95d4bfcb" + }, + "@denotest/multiple-exports@1.0.0": { + "integrity": "efe9748a0c0939c7ac245fee04acc0c42bd7a61874ff71a360c4543e4f5f6b36" + }, + "@denotest/subtract@1.0.0": { + "integrity": "e178a7101c073e93d9efa6833d5cbf83bc1bc8d509b7c2a5ecbf74265e917597" + } + }, + "npm": { + "@denotest/bin@1.0.0": { + "integrity": "sha512-ZtrWnYYPIzw4a9H1uNeZRZRWuLCpHZZU/SllIyFLqcTLH/3zdRI8UH4Z1Kf+8N++bWGO3fg8Ev4vvS1LoLlidg==" + }, + "@denotest/breaking-change-between-versions@2.0.0": { + "integrity": "sha512-3eQpPhhJYbSHaAmpgyVT8IM3+MkxcAQl90Uw8zmuTiFs64Wt3HGzSz74cwPlvfqqesRktm8fBZMmrtxVo3ENzw==" + }, + "@denotest/has-patch-versions@0.2.0": { + "integrity": "sha512-7XIVGrBMyqnts5/wcc7dn7rVl4IWrCiGUT2GLDSLWnogOMIZBapJJLW9n8Leq1bDTJ3U6aDTEFKz9fVSOwZfLQ==" + } + }, + "workspace": { + "dependencies": [ + "jsr:@denotest/add@1", + "jsr:@denotest/multiple-exports@1", + "jsr:@denotest/subtract@1", + "npm:@denotest/bin@1", + "npm:@denotest/breaking-change-between-versions@2", + "npm:@denotest/has-patch-versions@0.2" + ] + } +} diff --git a/tests/specs/update/deno_json/update_latest/update.out b/tests/specs/update/deno_json/update_latest/update.out new file mode 100644 index 0000000000..35e1ef9fe5 --- /dev/null +++ b/tests/specs/update/deno_json/update_latest/update.out @@ -0,0 +1,16 @@ +[UNORDERED_START] +Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts +Download http://127.0.0.1:4250/@denotest/subtract/1.0.0/mod.ts +Download http://127.0.0.1:4250/@denotest/multiple-exports/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/multiple-exports/1.0.0/data.json +Download http://localhost:4260/@denotest/has-patch-versions/0.2.0.tgz +Download http://localhost:4260/@denotest/bin/1.0.0.tgz +Download http://localhost:4260/@denotest/breaking-change-between-versions/2.0.0.tgz +[UNORDERED_END] +Updated 6 dependencies: + - jsr:@denotest/add 0.2.0 -> 1.0.0 + - jsr:@denotest/multiple-exports 0.2.0 -> 1.0.0 + - jsr:@denotest/subtract 0.2.0 -> 1.0.0 + - npm:@denotest/bin 0.6.0 -> 1.0.0 + - npm:@denotest/breaking-change-between-versions 1.0.0 -> 2.0.0 + - npm:@denotest/has-patch-versions 0.1.0 -> 0.2.0 diff --git a/tests/specs/update/mixed_workspace/__test__.jsonc b/tests/specs/update/mixed_workspace/__test__.jsonc new file mode 100644 index 0000000000..8c846467d4 --- /dev/null +++ b/tests/specs/update/mixed_workspace/__test__.jsonc @@ -0,0 +1,153 @@ +{ + "tempDir": true, + "tests": { + // just to make sure install doesn't change the lockfile + "sanity_lockfile_up_to_date": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": [ + "eval", + "const now = Deno.readTextFileSync('./deno.lock'); console.log(now.trim());" + ], + "output": "deno.lock.orig.out" + } + ] + }, + "print_outdated_root": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "outdated", + "output": "print_outdated/root.out" + } + ] + }, + "print_outdated_recursive": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "outdated --recursive", + "output": "print_outdated/recursive.out" + } + ] + }, + "print_outdated_subdir": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "cwd": "member-a", + "args": "outdated", + "output": "print_outdated/member_a.out" + }, + { + "cwd": "member-b", + "args": "outdated", + "output": "print_outdated/member_b.out" + } + ] + }, + "update_latest_root": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "outdated --update --latest", + "output": "update_latest/root/update.out" + }, + { + "args": "-A print_file.ts ./deno.json", + "output": "./update_latest/root/deno.json.out" + } + ] + }, + "update_latest_subdir": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "cwd": "member-a", + "args": "outdated --update --latest", + "output": "update_latest/subdir/member_a.out" + }, + { + "args": "-A print_file.ts ./member-a/deno.json", + "output": "update_latest/subdir/member_a_deno.json.out" + }, + { + "cwd": "member-b", + "args": "outdated --update --latest", + "output": "update_latest/subdir/member_b.out" + }, + { + "args": "-A print_file.ts ./member-b/package.json", + "output": "update_latest/subdir/member_b_package.json.out" + } + ] + }, + "update_latest_recursive": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "outdated --update --latest --recursive", + "output": "update_latest/recursive/update.out" + }, + { + "args": "-A print_file.ts ./deno.json", + "output": "update_latest/root/deno.json.out" + }, + { + "args": "-A print_file.ts ./member-a/deno.json", + "output": "update_latest/subdir/member_a_deno.json.out" + }, + { + "args": "-A print_file.ts ./member-b/package.json", + "output": "update_latest/subdir/member_b_package.json.out" + } + ] + }, + "update_filtered": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "outdated --update --latest --recursive @denotest/add @denotest/sub* !@denotest/breaking* aliased @denotest/with-subpath@0.5.0", + "output": "filtered/update.out" + }, + { + "args": "-A print_file.ts ./deno.json", + "output": "./update_latest/root/deno.json.out" + }, + { + "args": "-A print_file.ts ./member-a/deno.json", + "output": "./filtered/member_a_deno.json.out" + }, + { + "args": "-A print_file.ts ./member-b/package.json", + "output": "./filtered/member_b_package.json.out" + } + ] + } + } +} diff --git a/tests/specs/update/mixed_workspace/deno.json b/tests/specs/update/mixed_workspace/deno.json new file mode 100644 index 0000000000..e4034d3a31 --- /dev/null +++ b/tests/specs/update/mixed_workspace/deno.json @@ -0,0 +1,6 @@ +{ + "workspace": ["./member-a", "./member-b"], + "imports": { + "@denotest/subtract": "jsr:@denotest/subtract@^0.2.0" + } +} diff --git a/tests/specs/update/mixed_workspace/deno.lock b/tests/specs/update/mixed_workspace/deno.lock new file mode 100644 index 0000000000..23613ce58d --- /dev/null +++ b/tests/specs/update/mixed_workspace/deno.lock @@ -0,0 +1,55 @@ +{ + "version": "4", + "specifiers": { + "jsr:@denotest/add@0.2": "0.2.1", + "jsr:@denotest/multiple-exports@0.2.0": "0.2.0", + "jsr:@denotest/subtract@0.2": "0.2.0", + "npm:@denotest/bin@0.6.0": "0.6.0", + "npm:@denotest/breaking-change-between-versions@1.0.0": "1.0.0", + "npm:@denotest/has-patch-versions@0.1.0": "0.1.0" + }, + "jsr": { + "@denotest/add@0.2.1": { + "integrity": "a9076d30ecb42b2fc6dd95e7055fbf4e6358b53f550741bd7f60089d19f68848" + }, + "@denotest/multiple-exports@0.2.0": { + "integrity": "efe9748a0c0939c7ac245fee04acc0c42bd7a61874ff71a360c4543e4f5f6b36" + }, + "@denotest/subtract@0.2.0": { + "integrity": "c9650fc559ab2430effc0c7fb1540e3aa89888fbdd926335ccfdeac57eb3a64d" + } + }, + "npm": { + "@denotest/bin@0.6.0": { + "integrity": "sha512-vCNpxFgQN4fw4ZOp63nbTX1ilcDqNpvXCvYyC8nmfxQQAezsEt095I/YXwMIoMGzWtjCvlMf9kVEYfLuT5oEGQ==" + }, + "@denotest/breaking-change-between-versions@1.0.0": { + "integrity": "sha512-bzMGYx+DxxPlI74n/VsDAN7Db1BY7Sz2XqxXruMo9dEznsBZu7Ez3i8YQ8n0leTxAiiMk1RCG4zQHPG1aj3xRw==" + }, + "@denotest/has-patch-versions@0.1.0": { + "integrity": "sha512-H/MBo0jKDdMsX4AAGEGQbZj70nfNe3oUNZXbohYHhqf9EfpLnXp/7FC29ZdfV4+p6VjEcOGdCtXc6rilE6iYpg==" + } + }, + "workspace": { + "dependencies": [ + "jsr:@denotest/subtract@0.2" + ], + "members": { + "member-a": { + "dependencies": [ + "jsr:@denotest/add@0.2", + "jsr:@denotest/multiple-exports@0.2.0", + "npm:@denotest/breaking-change-between-versions@1.0.0" + ] + }, + "member-b": { + "packageJson": { + "dependencies": [ + "npm:@denotest/bin@0.6.0", + "npm:@denotest/has-patch-versions@0.1.0" + ] + } + } + } + } +} diff --git a/tests/specs/update/mixed_workspace/deno.lock.orig.out b/tests/specs/update/mixed_workspace/deno.lock.orig.out new file mode 100644 index 0000000000..23613ce58d --- /dev/null +++ b/tests/specs/update/mixed_workspace/deno.lock.orig.out @@ -0,0 +1,55 @@ +{ + "version": "4", + "specifiers": { + "jsr:@denotest/add@0.2": "0.2.1", + "jsr:@denotest/multiple-exports@0.2.0": "0.2.0", + "jsr:@denotest/subtract@0.2": "0.2.0", + "npm:@denotest/bin@0.6.0": "0.6.0", + "npm:@denotest/breaking-change-between-versions@1.0.0": "1.0.0", + "npm:@denotest/has-patch-versions@0.1.0": "0.1.0" + }, + "jsr": { + "@denotest/add@0.2.1": { + "integrity": "a9076d30ecb42b2fc6dd95e7055fbf4e6358b53f550741bd7f60089d19f68848" + }, + "@denotest/multiple-exports@0.2.0": { + "integrity": "efe9748a0c0939c7ac245fee04acc0c42bd7a61874ff71a360c4543e4f5f6b36" + }, + "@denotest/subtract@0.2.0": { + "integrity": "c9650fc559ab2430effc0c7fb1540e3aa89888fbdd926335ccfdeac57eb3a64d" + } + }, + "npm": { + "@denotest/bin@0.6.0": { + "integrity": "sha512-vCNpxFgQN4fw4ZOp63nbTX1ilcDqNpvXCvYyC8nmfxQQAezsEt095I/YXwMIoMGzWtjCvlMf9kVEYfLuT5oEGQ==" + }, + "@denotest/breaking-change-between-versions@1.0.0": { + "integrity": "sha512-bzMGYx+DxxPlI74n/VsDAN7Db1BY7Sz2XqxXruMo9dEznsBZu7Ez3i8YQ8n0leTxAiiMk1RCG4zQHPG1aj3xRw==" + }, + "@denotest/has-patch-versions@0.1.0": { + "integrity": "sha512-H/MBo0jKDdMsX4AAGEGQbZj70nfNe3oUNZXbohYHhqf9EfpLnXp/7FC29ZdfV4+p6VjEcOGdCtXc6rilE6iYpg==" + } + }, + "workspace": { + "dependencies": [ + "jsr:@denotest/subtract@0.2" + ], + "members": { + "member-a": { + "dependencies": [ + "jsr:@denotest/add@0.2", + "jsr:@denotest/multiple-exports@0.2.0", + "npm:@denotest/breaking-change-between-versions@1.0.0" + ] + }, + "member-b": { + "packageJson": { + "dependencies": [ + "npm:@denotest/bin@0.6.0", + "npm:@denotest/has-patch-versions@0.1.0" + ] + } + } + } + } +} diff --git a/tests/specs/update/mixed_workspace/filtered/member_a_deno.json.out b/tests/specs/update/mixed_workspace/filtered/member_a_deno.json.out new file mode 100644 index 0000000000..2b622efee5 --- /dev/null +++ b/tests/specs/update/mixed_workspace/filtered/member_a_deno.json.out @@ -0,0 +1,10 @@ +{ + "name": "@denotest/member-a", + "exports": "./mod.ts", + "imports": { + "@denotest/add": "jsr:@denotest/add@^1.0.0", + "@denotest/add/": "jsr:/@denotest/add@^1.0.0/", + "@denotest/with-subpath": "jsr:@denotest/multiple-exports@0.5.0/data-json", + "@denotest/breaking-change-between-versions": "npm:@denotest/breaking-change-between-versions@1.0.0" + } +} diff --git a/tests/specs/update/mixed_workspace/filtered/member_b_package.json.out b/tests/specs/update/mixed_workspace/filtered/member_b_package.json.out new file mode 100644 index 0000000000..7e582feeab --- /dev/null +++ b/tests/specs/update/mixed_workspace/filtered/member_b_package.json.out @@ -0,0 +1,8 @@ +{ + "name": "@denotest/member-b", + "version": "0.1.0", + "dependencies": { + "@denotest/has-patch-versions": "0.1.0", + "aliased": "npm:@denotest/bin@^1.0.0" + } +} diff --git a/tests/specs/update/mixed_workspace/filtered/update.out b/tests/specs/update/mixed_workspace/filtered/update.out new file mode 100644 index 0000000000..26543e5167 --- /dev/null +++ b/tests/specs/update/mixed_workspace/filtered/update.out @@ -0,0 +1,12 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/bin/1.0.0.tgz +Download http://127.0.0.1:4250/@denotest/multiple-exports/0.5.0_meta.json +Download http://127.0.0.1:4250/@denotest/multiple-exports/0.5.0/data.json +Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts +Download http://127.0.0.1:4250/@denotest/subtract/1.0.0/mod.ts +[UNORDERED_END] +Updated 4 dependencies: + - jsr:@denotest/add 0.2.1 -> 1.0.0 + - jsr:@denotest/multiple-exports 0.2.0 -> 0.5.0 + - jsr:@denotest/subtract 0.2.0 -> 1.0.0 + - npm:@denotest/bin 0.6.0 -> 1.0.0 diff --git a/tests/specs/update/mixed_workspace/member-a/deno.json b/tests/specs/update/mixed_workspace/member-a/deno.json new file mode 100644 index 0000000000..0340d3bb92 --- /dev/null +++ b/tests/specs/update/mixed_workspace/member-a/deno.json @@ -0,0 +1,10 @@ +{ + "name": "@denotest/member-a", + "exports": "./mod.ts", + "imports": { + "@denotest/add": "jsr:@denotest/add@^0.2.0", + "@denotest/add/": "jsr:/@denotest/add@^0.2.0/", + "@denotest/with-subpath": "jsr:@denotest/multiple-exports@0.2.0/data-json", + "@denotest/breaking-change-between-versions": "npm:@denotest/breaking-change-between-versions@1.0.0" + } +} diff --git a/tests/specs/update/mixed_workspace/member-a/mod.ts b/tests/specs/update/mixed_workspace/member-a/mod.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/specs/update/mixed_workspace/member-b/package.json b/tests/specs/update/mixed_workspace/member-b/package.json new file mode 100644 index 0000000000..0f9929a478 --- /dev/null +++ b/tests/specs/update/mixed_workspace/member-b/package.json @@ -0,0 +1,8 @@ +{ + "name": "@denotest/member-b", + "version": "0.1.0", + "dependencies": { + "@denotest/has-patch-versions": "0.1.0", + "aliased": "npm:@denotest/bin@0.6.0" + } +} diff --git a/tests/specs/update/mixed_workspace/print_file.ts b/tests/specs/update/mixed_workspace/print_file.ts new file mode 100644 index 0000000000..c57b6c3a4e --- /dev/null +++ b/tests/specs/update/mixed_workspace/print_file.ts @@ -0,0 +1,2 @@ +const file = Deno.args[0]; +console.log(Deno.readTextFileSync(file).trim()); diff --git a/tests/specs/update/mixed_workspace/print_outdated/member_a.out b/tests/specs/update/mixed_workspace/print_outdated/member_a.out new file mode 100644 index 0000000000..8699aac2bf --- /dev/null +++ b/tests/specs/update/mixed_workspace/print_outdated/member_a.out @@ -0,0 +1,9 @@ +┌────────────────────────────────────────────────┬─────────┬────────┬────────┐ +│ Package │ Current │ Update │ Latest │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ jsr:@denotest/multiple-exports │ 0.2.0 │ 0.2.0 │ 1.0.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ jsr:@denotest/add │ 0.2.1 │ 0.2.1 │ 1.0.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/breaking-change-between-versions │ 1.0.0 │ 1.0.0 │ 2.0.0 │ +└────────────────────────────────────────────────┴─────────┴────────┴────────┘ diff --git a/tests/specs/update/mixed_workspace/print_outdated/member_b.out b/tests/specs/update/mixed_workspace/print_outdated/member_b.out new file mode 100644 index 0000000000..fc8ef320a8 --- /dev/null +++ b/tests/specs/update/mixed_workspace/print_outdated/member_b.out @@ -0,0 +1,7 @@ +┌──────────────────────────────────┬─────────┬────────┬────────┐ +│ Package │ Current │ Update │ Latest │ +├──────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/has-patch-versions │ 0.1.0 │ 0.1.0 │ 0.2.0 │ +├──────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/bin │ 0.6.0 │ 0.6.0 │ 1.0.0 │ +└──────────────────────────────────┴─────────┴────────┴────────┘ diff --git a/tests/specs/update/mixed_workspace/print_outdated/recursive.out b/tests/specs/update/mixed_workspace/print_outdated/recursive.out new file mode 100644 index 0000000000..ca03776a9c --- /dev/null +++ b/tests/specs/update/mixed_workspace/print_outdated/recursive.out @@ -0,0 +1,15 @@ +┌────────────────────────────────────────────────┬─────────┬────────┬────────┐ +│ Package │ Current │ Update │ Latest │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ jsr:@denotest/multiple-exports │ 0.2.0 │ 0.2.0 │ 1.0.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ jsr:@denotest/subtract │ 0.2.0 │ 0.2.0 │ 1.0.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ jsr:@denotest/add │ 0.2.1 │ 0.2.1 │ 1.0.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/has-patch-versions │ 0.1.0 │ 0.1.0 │ 0.2.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/bin │ 0.6.0 │ 0.6.0 │ 1.0.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/breaking-change-between-versions │ 1.0.0 │ 1.0.0 │ 2.0.0 │ +└────────────────────────────────────────────────┴─────────┴────────┴────────┘ diff --git a/tests/specs/update/mixed_workspace/print_outdated/root.out b/tests/specs/update/mixed_workspace/print_outdated/root.out new file mode 100644 index 0000000000..c7934edc79 --- /dev/null +++ b/tests/specs/update/mixed_workspace/print_outdated/root.out @@ -0,0 +1,5 @@ +┌────────────────────────┬─────────┬────────┬────────┐ +│ Package │ Current │ Update │ Latest │ +├────────────────────────┼─────────┼────────┼────────┤ +│ jsr:@denotest/subtract │ 0.2.0 │ 0.2.0 │ 1.0.0 │ +└────────────────────────┴─────────┴────────┴────────┘ diff --git a/tests/specs/update/mixed_workspace/update_latest/recursive/update.out b/tests/specs/update/mixed_workspace/update_latest/recursive/update.out new file mode 100644 index 0000000000..ef6e36ded5 --- /dev/null +++ b/tests/specs/update/mixed_workspace/update_latest/recursive/update.out @@ -0,0 +1,16 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/breaking-change-between-versions/2.0.0.tgz +Download http://localhost:4260/@denotest/has-patch-versions/0.2.0.tgz +Download http://localhost:4260/@denotest/bin/1.0.0.tgz +Download http://127.0.0.1:4250/@denotest/multiple-exports/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/multiple-exports/1.0.0/data.json +Download http://127.0.0.1:4250/@denotest/subtract/1.0.0/mod.ts +Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts +[UNORDERED_END] +Updated 6 dependencies: + - jsr:@denotest/add 0.2.1 -> 1.0.0 + - jsr:@denotest/multiple-exports 0.2.0 -> 1.0.0 + - jsr:@denotest/subtract 0.2.0 -> 1.0.0 + - npm:@denotest/bin 0.6.0 -> 1.0.0 + - npm:@denotest/breaking-change-between-versions 1.0.0 -> 2.0.0 + - npm:@denotest/has-patch-versions 0.1.0 -> 0.2.0 diff --git a/tests/specs/update/mixed_workspace/update_latest/root/deno.json.out b/tests/specs/update/mixed_workspace/update_latest/root/deno.json.out new file mode 100644 index 0000000000..0317e6c39f --- /dev/null +++ b/tests/specs/update/mixed_workspace/update_latest/root/deno.json.out @@ -0,0 +1,6 @@ +{ + "workspace": ["./member-a", "./member-b"], + "imports": { + "@denotest/subtract": "jsr:@denotest/subtract@^1.0.0" + } +} diff --git a/tests/specs/update/mixed_workspace/update_latest/root/update.out b/tests/specs/update/mixed_workspace/update_latest/root/update.out new file mode 100644 index 0000000000..15d21621e8 --- /dev/null +++ b/tests/specs/update/mixed_workspace/update_latest/root/update.out @@ -0,0 +1,3 @@ +Download http://127.0.0.1:4250/@denotest/subtract/1.0.0/mod.ts +Updated 1 dependency: + - jsr:@denotest/subtract 0.2.0 -> 1.0.0 diff --git a/tests/specs/update/mixed_workspace/update_latest/subdir/member_a.out b/tests/specs/update/mixed_workspace/update_latest/subdir/member_a.out new file mode 100644 index 0000000000..f16e0b7f2a --- /dev/null +++ b/tests/specs/update/mixed_workspace/update_latest/subdir/member_a.out @@ -0,0 +1,10 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/breaking-change-between-versions/2.0.0.tgz +Download http://127.0.0.1:4250/@denotest/multiple-exports/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/multiple-exports/1.0.0/data.json +Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts +[UNORDERED_END] +Updated 3 dependencies: + - jsr:@denotest/add 0.2.1 -> 1.0.0 + - jsr:@denotest/multiple-exports 0.2.0 -> 1.0.0 + - npm:@denotest/breaking-change-between-versions 1.0.0 -> 2.0.0 diff --git a/tests/specs/update/mixed_workspace/update_latest/subdir/member_a_deno.json.out b/tests/specs/update/mixed_workspace/update_latest/subdir/member_a_deno.json.out new file mode 100644 index 0000000000..9210123b82 --- /dev/null +++ b/tests/specs/update/mixed_workspace/update_latest/subdir/member_a_deno.json.out @@ -0,0 +1,10 @@ +{ + "name": "@denotest/member-a", + "exports": "./mod.ts", + "imports": { + "@denotest/add": "jsr:@denotest/add@^1.0.0", + "@denotest/add/": "jsr:/@denotest/add@^1.0.0/", + "@denotest/with-subpath": "jsr:@denotest/multiple-exports@^1.0.0/data-json", + "@denotest/breaking-change-between-versions": "npm:@denotest/breaking-change-between-versions@^2.0.0" + } +} diff --git a/tests/specs/update/mixed_workspace/update_latest/subdir/member_b.out b/tests/specs/update/mixed_workspace/update_latest/subdir/member_b.out new file mode 100644 index 0000000000..5ca3297e20 --- /dev/null +++ b/tests/specs/update/mixed_workspace/update_latest/subdir/member_b.out @@ -0,0 +1,7 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/bin/1.0.0.tgz +Download http://localhost:4260/@denotest/has-patch-versions/0.2.0.tgz +[UNORDERED_END] +Updated 2 dependencies: + - npm:@denotest/bin 0.6.0 -> 1.0.0 + - npm:@denotest/has-patch-versions 0.1.0 -> 0.2.0 diff --git a/tests/specs/update/mixed_workspace/update_latest/subdir/member_b_package.json.out b/tests/specs/update/mixed_workspace/update_latest/subdir/member_b_package.json.out new file mode 100644 index 0000000000..1426fcd7f8 --- /dev/null +++ b/tests/specs/update/mixed_workspace/update_latest/subdir/member_b_package.json.out @@ -0,0 +1,8 @@ +{ + "name": "@denotest/member-b", + "version": "0.1.0", + "dependencies": { + "@denotest/has-patch-versions": "^0.2.0", + "aliased": "npm:@denotest/bin@^1.0.0" + } +} diff --git a/tests/specs/update/package_json/__test__.jsonc b/tests/specs/update/package_json/__test__.jsonc new file mode 100644 index 0000000000..19d576dfc0 --- /dev/null +++ b/tests/specs/update/package_json/__test__.jsonc @@ -0,0 +1,100 @@ +{ + "tempDir": true, + "tests": { + "sanity_lockfile_up_to_date": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": [ + "eval", + "const now = Deno.readTextFileSync('./deno.lock'); console.log(now.trim());" + ], + "output": "deno.lock.orig.out" + } + ] + }, + "print_outdated": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "outdated", + "output": "outdated.out" + } + ] + }, + "print_outdated_compatible": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "outdated --compatible", + "output": "outdated_compatible.out" + } + ] + }, + "update_compatible": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "outdated --update", + "output": "./update_compatible/update.out" + }, + { + "args": "-A ./print_file.ts ./package.json", + "output": "./update_compatible/package.json.out" + }, + { + "args": "-A ./print_file.ts ./deno.lock", + "output": "./update_compatible/deno.lock.out" + } + ] + }, + "update_latest": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "outdated --update --latest", + "output": "update_latest/update.out" + }, + { + "args": "-A ./print_file.ts ./package.json", + "output": "update_latest/package.json.out" + }, + { + "args": "-A ./print_file.ts ./deno.lock", + "output": "update_latest/deno.lock.out" + } + ] + }, + "update_filtered": { + "steps": [ + { + "args": "install", + "output": "[WILDCARD]" + }, + { + "args": "outdated --update --latest @denotest/has-patch* aliased@0.7.0", + "output": "filtered/update.out" + }, + { + "args": "-A print_file.ts ./package.json", + "output": "filtered/package.json.out" + } + ] + } + } +} diff --git a/tests/specs/update/package_json/deno.lock b/tests/specs/update/package_json/deno.lock new file mode 100644 index 0000000000..05253094db --- /dev/null +++ b/tests/specs/update/package_json/deno.lock @@ -0,0 +1,28 @@ +{ + "version": "4", + "specifiers": { + "npm:@denotest/bin@0.6": "0.6.0", + "npm:@denotest/breaking-change-between-versions@1.0.0": "1.0.0", + "npm:@denotest/has-patch-versions@0.1": "0.1.0" + }, + "npm": { + "@denotest/bin@0.6.0": { + "integrity": "sha512-vCNpxFgQN4fw4ZOp63nbTX1ilcDqNpvXCvYyC8nmfxQQAezsEt095I/YXwMIoMGzWtjCvlMf9kVEYfLuT5oEGQ==" + }, + "@denotest/breaking-change-between-versions@1.0.0": { + "integrity": "sha512-bzMGYx+DxxPlI74n/VsDAN7Db1BY7Sz2XqxXruMo9dEznsBZu7Ez3i8YQ8n0leTxAiiMk1RCG4zQHPG1aj3xRw==" + }, + "@denotest/has-patch-versions@0.1.0": { + "integrity": "sha512-H/MBo0jKDdMsX4AAGEGQbZj70nfNe3oUNZXbohYHhqf9EfpLnXp/7FC29ZdfV4+p6VjEcOGdCtXc6rilE6iYpg==" + } + }, + "workspace": { + "packageJson": { + "dependencies": [ + "npm:@denotest/bin@0.6", + "npm:@denotest/breaking-change-between-versions@1.0.0", + "npm:@denotest/has-patch-versions@0.1" + ] + } + } +} diff --git a/tests/specs/update/package_json/deno.lock.orig.out b/tests/specs/update/package_json/deno.lock.orig.out new file mode 100644 index 0000000000..05253094db --- /dev/null +++ b/tests/specs/update/package_json/deno.lock.orig.out @@ -0,0 +1,28 @@ +{ + "version": "4", + "specifiers": { + "npm:@denotest/bin@0.6": "0.6.0", + "npm:@denotest/breaking-change-between-versions@1.0.0": "1.0.0", + "npm:@denotest/has-patch-versions@0.1": "0.1.0" + }, + "npm": { + "@denotest/bin@0.6.0": { + "integrity": "sha512-vCNpxFgQN4fw4ZOp63nbTX1ilcDqNpvXCvYyC8nmfxQQAezsEt095I/YXwMIoMGzWtjCvlMf9kVEYfLuT5oEGQ==" + }, + "@denotest/breaking-change-between-versions@1.0.0": { + "integrity": "sha512-bzMGYx+DxxPlI74n/VsDAN7Db1BY7Sz2XqxXruMo9dEznsBZu7Ez3i8YQ8n0leTxAiiMk1RCG4zQHPG1aj3xRw==" + }, + "@denotest/has-patch-versions@0.1.0": { + "integrity": "sha512-H/MBo0jKDdMsX4AAGEGQbZj70nfNe3oUNZXbohYHhqf9EfpLnXp/7FC29ZdfV4+p6VjEcOGdCtXc6rilE6iYpg==" + } + }, + "workspace": { + "packageJson": { + "dependencies": [ + "npm:@denotest/bin@0.6", + "npm:@denotest/breaking-change-between-versions@1.0.0", + "npm:@denotest/has-patch-versions@0.1" + ] + } + } +} diff --git a/tests/specs/update/package_json/filtered/package.json.out b/tests/specs/update/package_json/filtered/package.json.out new file mode 100644 index 0000000000..39faff22d6 --- /dev/null +++ b/tests/specs/update/package_json/filtered/package.json.out @@ -0,0 +1,9 @@ +{ + "dependencies": { + "@denotest/has-patch-versions": "^0.2.0", + "@denotest/breaking-change-between-versions": "1.0.0" + }, + "devDependencies": { + "aliased": "npm:@denotest/bin@0.7.0" + } +} diff --git a/tests/specs/update/package_json/filtered/update.out b/tests/specs/update/package_json/filtered/update.out new file mode 100644 index 0000000000..3093281f10 --- /dev/null +++ b/tests/specs/update/package_json/filtered/update.out @@ -0,0 +1,9 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/bin/0.7.0.tgz +Download http://localhost:4260/@denotest/has-patch-versions/0.2.0.tgz +Initialize @denotest/has-patch-versions@0.2.0 +Initialize @denotest/bin@0.7.0 +[UNORDERED_END] +Updated 2 dependencies: + - npm:@denotest/bin 0.6.0 -> 0.7.0 + - npm:@denotest/has-patch-versions 0.1.0 -> 0.2.0 diff --git a/tests/specs/update/package_json/outdated.out b/tests/specs/update/package_json/outdated.out new file mode 100644 index 0000000000..d672aace7f --- /dev/null +++ b/tests/specs/update/package_json/outdated.out @@ -0,0 +1,9 @@ +┌────────────────────────────────────────────────┬─────────┬────────┬────────┐ +│ Package │ Current │ Update │ Latest │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/has-patch-versions │ 0.1.0 │ 0.1.1 │ 0.2.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/bin │ 0.6.0 │ 0.6.0 │ 1.0.0 │ +├────────────────────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/breaking-change-between-versions │ 1.0.0 │ 1.0.0 │ 2.0.0 │ +└────────────────────────────────────────────────┴─────────┴────────┴────────┘ diff --git a/tests/specs/update/package_json/outdated_compatible.out b/tests/specs/update/package_json/outdated_compatible.out new file mode 100644 index 0000000000..8a682c461c --- /dev/null +++ b/tests/specs/update/package_json/outdated_compatible.out @@ -0,0 +1,5 @@ +┌──────────────────────────────────┬─────────┬────────┬────────┐ +│ Package │ Current │ Update │ Latest │ +├──────────────────────────────────┼─────────┼────────┼────────┤ +│ npm:@denotest/has-patch-versions │ 0.1.0 │ 0.1.1 │ 0.2.0 │ +└──────────────────────────────────┴─────────┴────────┴────────┘ diff --git a/tests/specs/update/package_json/package.json b/tests/specs/update/package_json/package.json new file mode 100644 index 0000000000..9cd8cf59dc --- /dev/null +++ b/tests/specs/update/package_json/package.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "@denotest/has-patch-versions": "^0.1.0", + "@denotest/breaking-change-between-versions": "1.0.0" + }, + "devDependencies": { + "aliased": "npm:@denotest/bin@^0.6.0" + } +} diff --git a/tests/specs/update/package_json/print_file.ts b/tests/specs/update/package_json/print_file.ts new file mode 100644 index 0000000000..c57b6c3a4e --- /dev/null +++ b/tests/specs/update/package_json/print_file.ts @@ -0,0 +1,2 @@ +const file = Deno.args[0]; +console.log(Deno.readTextFileSync(file).trim()); diff --git a/tests/specs/update/package_json/update_compatible/deno.lock.out b/tests/specs/update/package_json/update_compatible/deno.lock.out new file mode 100644 index 0000000000..f82a21ee46 --- /dev/null +++ b/tests/specs/update/package_json/update_compatible/deno.lock.out @@ -0,0 +1,28 @@ +{ + "version": "4", + "specifiers": { + "npm:@denotest/bin@0.6": "0.6.0", + "npm:@denotest/breaking-change-between-versions@1.0.0": "1.0.0", + "npm:@denotest/has-patch-versions@~0.1.1": "0.1.1" + }, + "npm": { + "@denotest/bin@0.6.0": { + "integrity": "sha512-vCNpxFgQN4fw4ZOp63nbTX1ilcDqNpvXCvYyC8nmfxQQAezsEt095I/YXwMIoMGzWtjCvlMf9kVEYfLuT5oEGQ==" + }, + "@denotest/breaking-change-between-versions@1.0.0": { + "integrity": "sha512-bzMGYx+DxxPlI74n/VsDAN7Db1BY7Sz2XqxXruMo9dEznsBZu7Ez3i8YQ8n0leTxAiiMk1RCG4zQHPG1aj3xRw==" + }, + "@denotest/has-patch-versions@0.1.1": { + "integrity": "sha512-slUqYhu6DrPiSdNzmW5aMdW2/osIYnDP0yY3CwgLzAiyK0/cwb0epSpTSyZEmTKXA3rezxxC7ASSsnD34uH1/w==" + } + }, + "workspace": { + "packageJson": { + "dependencies": [ + "npm:@denotest/bin@0.6", + "npm:@denotest/breaking-change-between-versions@1.0.0", + "npm:@denotest/has-patch-versions@~0.1.1" + ] + } + } +} diff --git a/tests/specs/update/package_json/update_compatible/package.json.out b/tests/specs/update/package_json/update_compatible/package.json.out new file mode 100644 index 0000000000..6f822ee5d6 --- /dev/null +++ b/tests/specs/update/package_json/update_compatible/package.json.out @@ -0,0 +1,9 @@ +{ + "dependencies": { + "@denotest/has-patch-versions": "^0.1.1", + "@denotest/breaking-change-between-versions": "1.0.0" + }, + "devDependencies": { + "aliased": "npm:@denotest/bin@^0.6.0" + } +} diff --git a/tests/specs/update/package_json/update_compatible/update.out b/tests/specs/update/package_json/update_compatible/update.out new file mode 100644 index 0000000000..4c3c740791 --- /dev/null +++ b/tests/specs/update/package_json/update_compatible/update.out @@ -0,0 +1,4 @@ +Download http://localhost:4260/@denotest/has-patch-versions/0.1.1.tgz +Initialize @denotest/has-patch-versions@0.1.1 +Updated 1 dependency: + - npm:@denotest/has-patch-versions 0.1.0 -> 0.1.1 diff --git a/tests/specs/update/package_json/update_latest/deno.lock.out b/tests/specs/update/package_json/update_latest/deno.lock.out new file mode 100644 index 0000000000..9a9b1bad5e --- /dev/null +++ b/tests/specs/update/package_json/update_latest/deno.lock.out @@ -0,0 +1,28 @@ +{ + "version": "4", + "specifiers": { + "npm:@denotest/bin@1": "1.0.0", + "npm:@denotest/breaking-change-between-versions@2": "2.0.0", + "npm:@denotest/has-patch-versions@0.2": "0.2.0" + }, + "npm": { + "@denotest/bin@1.0.0": { + "integrity": "sha512-ZtrWnYYPIzw4a9H1uNeZRZRWuLCpHZZU/SllIyFLqcTLH/3zdRI8UH4Z1Kf+8N++bWGO3fg8Ev4vvS1LoLlidg==" + }, + "@denotest/breaking-change-between-versions@2.0.0": { + "integrity": "sha512-3eQpPhhJYbSHaAmpgyVT8IM3+MkxcAQl90Uw8zmuTiFs64Wt3HGzSz74cwPlvfqqesRktm8fBZMmrtxVo3ENzw==" + }, + "@denotest/has-patch-versions@0.2.0": { + "integrity": "sha512-7XIVGrBMyqnts5/wcc7dn7rVl4IWrCiGUT2GLDSLWnogOMIZBapJJLW9n8Leq1bDTJ3U6aDTEFKz9fVSOwZfLQ==" + } + }, + "workspace": { + "packageJson": { + "dependencies": [ + "npm:@denotest/bin@1", + "npm:@denotest/breaking-change-between-versions@2", + "npm:@denotest/has-patch-versions@0.2" + ] + } + } +} diff --git a/tests/specs/update/package_json/update_latest/package.json.out b/tests/specs/update/package_json/update_latest/package.json.out new file mode 100644 index 0000000000..fb483d78bd --- /dev/null +++ b/tests/specs/update/package_json/update_latest/package.json.out @@ -0,0 +1,9 @@ +{ + "dependencies": { + "@denotest/has-patch-versions": "^0.2.0", + "@denotest/breaking-change-between-versions": "^2.0.0" + }, + "devDependencies": { + "aliased": "npm:@denotest/bin@^1.0.0" + } +} diff --git a/tests/specs/update/package_json/update_latest/update.out b/tests/specs/update/package_json/update_latest/update.out new file mode 100644 index 0000000000..a24ae1e32b --- /dev/null +++ b/tests/specs/update/package_json/update_latest/update.out @@ -0,0 +1,14 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/bin/1.0.0.tgz +Download http://localhost:4260/@denotest/has-patch-versions/0.2.0.tgz +Download http://localhost:4260/@denotest/breaking-change-between-versions/2.0.0.tgz +Initialize @denotest/has-patch-versions@0.2.0 +Initialize @denotest/breaking-change-between-versions@2.0.0 +Initialize @denotest/bin@1.0.0 +[UNORDERED_END] +Updated 3 dependencies: +[UNORDERED_START] + - npm:@denotest/bin 0.6.0 -> 1.0.0 + - npm:@denotest/breaking-change-between-versions 1.0.0 -> 2.0.0 + - npm:@denotest/has-patch-versions 0.1.0 -> 0.2.0 +[UNORDERED_END] diff --git a/tests/util/server/src/npm.rs b/tests/util/server/src/npm.rs index 31686fa854..081989ddb5 100644 --- a/tests/util/server/src/npm.rs +++ b/tests/util/server/src/npm.rs @@ -2,6 +2,7 @@ use std::collections::HashMap; use std::fs; +use std::path::Path; use anyhow::Context; use anyhow::Result; @@ -189,6 +190,60 @@ impl TestNpmRegistry { } } +// NOTE: extracted out partially from the `tar` crate, all credits to the original authors +fn append_dir_all( + builder: &mut tar::Builder, + path: &Path, + src_path: &Path, +) -> Result<()> { + builder.follow_symlinks(true); + let mode = tar::HeaderMode::Deterministic; + builder.mode(mode); + let mut stack = vec![(src_path.to_path_buf(), true, false)]; + let mut entries = Vec::new(); + while let Some((src, is_dir, is_symlink)) = stack.pop() { + let dest = path.join(src.strip_prefix(src_path).unwrap()); + // In case of a symlink pointing to a directory, is_dir is false, but src.is_dir() will return true + if is_dir || (is_symlink && src.is_dir()) { + for entry in fs::read_dir(&src)? { + let entry = entry?; + let file_type = entry.file_type()?; + stack.push((entry.path(), file_type.is_dir(), file_type.is_symlink())); + } + if dest != Path::new("") { + entries.push((src, dest)); + } + } else { + entries.push((src, dest)); + } + } + entries.sort_by(|(_, a), (_, b)| a.cmp(b)); + for (src, dest) in entries { + let mut header = tar::Header::new_gnu(); + let metadata = src.metadata().with_context(|| { + format!("trying to get metadata for {}", src.display()) + })?; + header.set_metadata_in_mode(&metadata, mode); + // this is what `tar` sets the mtime to on unix in deterministic mode, on windows it uses a different + // value, which causes the tarball to have a different hash on windows. force it to be the same + // to ensure the same output on all platforms + header.set_mtime(1153704088); + + let data = if src.is_file() { + Box::new( + fs::File::open(&src) + .with_context(|| format!("trying to open file {}", src.display()))?, + ) as Box + } else { + Box::new(std::io::empty()) as Box + }; + builder + .append_data(&mut header, dest, data) + .with_context(|| "appending data")?; + } + Ok(()) +} + fn get_npm_package( registry_hostname: &str, local_path: &str, @@ -228,11 +283,14 @@ fn get_npm_package( GzEncoder::new(&mut tarball_bytes, Compression::default()); { let mut builder = Builder::new(&mut encoder); - builder - .append_dir_all("package", &version_folder) - .with_context(|| { - format!("Error adding tarball for directory: {}", version_folder) - })?; + append_dir_all( + &mut builder, + Path::new("package"), + version_folder.as_path(), + ) + .with_context(|| { + format!("Error adding tarball for directory {}", version_folder,) + })?; builder.finish()?; } encoder.finish()?; From b729bf0ad9a2711b9740b30dcf78d826fbc76349 Mon Sep 17 00:00:00 2001 From: Yazan AbdAl-Rahman Date: Thu, 21 Nov 2024 01:30:43 +0200 Subject: [PATCH 124/227] feat(permission): support suffix wildcards in `--allow-env` flag (#25255) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds support for suffix wildcard for `--allow-env` flag. Specifying flag like `--allow-env=DENO_*` will enable access to all environmental variables starting with `DENO_*`. Closes #24847 --------- Co-authored-by: Bartek Iwańczuk Co-authored-by: David Sherret --- runtime/permissions/lib.rs | 203 ++++++++++++++++-- .../process_env_permissions/__test__.jsonc | 26 +++ .../process_env_permissions/main.js | 5 + .../allow_env_wildcard_worker/__test__.jsonc | 10 + .../run/allow_env_wildcard_worker/main.js | 12 ++ .../run/allow_env_wildcard_worker/main.out | 11 + .../run/allow_env_wildcard_worker/worker.js | 3 + 7 files changed, 250 insertions(+), 20 deletions(-) create mode 100644 tests/specs/permission/process_env_permissions/__test__.jsonc create mode 100644 tests/specs/permission/process_env_permissions/main.js create mode 100644 tests/specs/run/allow_env_wildcard_worker/__test__.jsonc create mode 100644 tests/specs/run/allow_env_wildcard_worker/main.js create mode 100644 tests/specs/run/allow_env_wildcard_worker/main.out create mode 100644 tests/specs/run/allow_env_wildcard_worker/worker.js diff --git a/runtime/permissions/lib.rs b/runtime/permissions/lib.rs index 71ef7d2289..a0b901d200 100644 --- a/runtime/permissions/lib.rs +++ b/runtime/permissions/lib.rs @@ -294,7 +294,7 @@ impl UnitPermission { /// A normalized environment variable name. On Windows this will /// be uppercase and on other platforms it will stay as-is. #[derive(Clone, Eq, PartialEq, Hash, Debug)] -struct EnvVarName { +pub struct EnvVarName { inner: String, } @@ -1114,15 +1114,37 @@ impl ImportDescriptor { pub struct EnvDescriptorParseError; #[derive(Clone, Eq, PartialEq, Hash, Debug)] -pub struct EnvDescriptor(EnvVarName); +pub enum EnvDescriptor { + Name(EnvVarName), + PrefixPattern(EnvVarName), +} impl EnvDescriptor { pub fn new(env: impl AsRef) -> Self { - Self(EnvVarName::new(env)) + if let Some(prefix_pattern) = env.as_ref().strip_suffix('*') { + Self::PrefixPattern(EnvVarName::new(prefix_pattern)) + } else { + Self::Name(EnvVarName::new(env)) + } } } -impl QueryDescriptor for EnvDescriptor { +#[derive(Clone, Eq, PartialEq, Hash, Debug)] +enum EnvQueryDescriptorInner { + Name(EnvVarName), + PrefixPattern(EnvVarName), +} + +#[derive(Clone, Eq, PartialEq, Hash, Debug)] +pub struct EnvQueryDescriptor(EnvQueryDescriptorInner); + +impl EnvQueryDescriptor { + pub fn new(env: impl AsRef) -> Self { + Self(EnvQueryDescriptorInner::Name(EnvVarName::new(env))) + } +} + +impl QueryDescriptor for EnvQueryDescriptor { type AllowDesc = EnvDescriptor; type DenyDesc = EnvDescriptor; @@ -1131,19 +1153,45 @@ impl QueryDescriptor for EnvDescriptor { } fn display_name(&self) -> Cow { - Cow::from(self.0.as_ref()) + Cow::from(match &self.0 { + EnvQueryDescriptorInner::Name(env_var_name) => env_var_name.as_ref(), + EnvQueryDescriptorInner::PrefixPattern(env_var_name) => { + env_var_name.as_ref() + } + }) } fn from_allow(allow: &Self::AllowDesc) -> Self { - allow.clone() + match allow { + Self::AllowDesc::Name(s) => { + Self(EnvQueryDescriptorInner::Name(s.clone())) + } + Self::AllowDesc::PrefixPattern(s) => { + Self(EnvQueryDescriptorInner::PrefixPattern(s.clone())) + } + } } fn as_allow(&self) -> Option { - Some(self.clone()) + Some(match &self.0 { + EnvQueryDescriptorInner::Name(env_var_name) => { + Self::AllowDesc::Name(env_var_name.clone()) + } + EnvQueryDescriptorInner::PrefixPattern(env_var_name) => { + Self::AllowDesc::PrefixPattern(env_var_name.clone()) + } + }) } fn as_deny(&self) -> Self::DenyDesc { - self.clone() + match &self.0 { + EnvQueryDescriptorInner::Name(env_var_name) => { + Self::DenyDesc::Name(env_var_name.clone()) + } + EnvQueryDescriptorInner::PrefixPattern(env_var_name) => { + Self::DenyDesc::PrefixPattern(env_var_name.clone()) + } + } } fn check_in_permission( @@ -1156,19 +1204,79 @@ impl QueryDescriptor for EnvDescriptor { } fn matches_allow(&self, other: &Self::AllowDesc) -> bool { - self == other + match other { + Self::AllowDesc::Name(n) => match &self.0 { + EnvQueryDescriptorInner::Name(env_var_name) => n == env_var_name, + EnvQueryDescriptorInner::PrefixPattern(env_var_name) => { + env_var_name.as_ref().starts_with(n.as_ref()) + } + }, + Self::AllowDesc::PrefixPattern(p) => match &self.0 { + EnvQueryDescriptorInner::Name(env_var_name) => { + env_var_name.as_ref().starts_with(p.as_ref()) + } + EnvQueryDescriptorInner::PrefixPattern(env_var_name) => { + env_var_name.as_ref().starts_with(p.as_ref()) + } + }, + } } fn matches_deny(&self, other: &Self::DenyDesc) -> bool { - self == other + match other { + Self::AllowDesc::Name(n) => match &self.0 { + EnvQueryDescriptorInner::Name(env_var_name) => n == env_var_name, + EnvQueryDescriptorInner::PrefixPattern(env_var_name) => { + env_var_name.as_ref().starts_with(n.as_ref()) + } + }, + Self::AllowDesc::PrefixPattern(p) => match &self.0 { + EnvQueryDescriptorInner::Name(env_var_name) => { + env_var_name.as_ref().starts_with(p.as_ref()) + } + EnvQueryDescriptorInner::PrefixPattern(env_var_name) => { + p == env_var_name + } + }, + } } fn revokes(&self, other: &Self::AllowDesc) -> bool { - self == other + match other { + Self::AllowDesc::Name(n) => match &self.0 { + EnvQueryDescriptorInner::Name(env_var_name) => n == env_var_name, + EnvQueryDescriptorInner::PrefixPattern(env_var_name) => { + env_var_name.as_ref().starts_with(n.as_ref()) + } + }, + Self::AllowDesc::PrefixPattern(p) => match &self.0 { + EnvQueryDescriptorInner::Name(env_var_name) => { + env_var_name.as_ref().starts_with(p.as_ref()) + } + EnvQueryDescriptorInner::PrefixPattern(env_var_name) => { + p == env_var_name + } + }, + } } fn stronger_than_deny(&self, other: &Self::DenyDesc) -> bool { - self == other + match other { + Self::AllowDesc::Name(n) => match &self.0 { + EnvQueryDescriptorInner::Name(env_var_name) => n == env_var_name, + EnvQueryDescriptorInner::PrefixPattern(env_var_name) => { + env_var_name.as_ref().starts_with(n.as_ref()) + } + }, + Self::AllowDesc::PrefixPattern(p) => match &self.0 { + EnvQueryDescriptorInner::Name(env_var_name) => { + env_var_name.as_ref().starts_with(p.as_ref()) + } + EnvQueryDescriptorInner::PrefixPattern(env_var_name) => { + p == env_var_name + } + }, + } } fn overlaps_deny(&self, _other: &Self::DenyDesc) -> bool { @@ -1176,9 +1284,14 @@ impl QueryDescriptor for EnvDescriptor { } } -impl AsRef for EnvDescriptor { +impl AsRef for EnvQueryDescriptor { fn as_ref(&self) -> &str { - self.0.as_ref() + match &self.0 { + EnvQueryDescriptorInner::Name(env_var_name) => env_var_name.as_ref(), + EnvQueryDescriptorInner::PrefixPattern(env_var_name) => { + env_var_name.as_ref() + } + } } } @@ -1749,20 +1862,20 @@ impl UnaryPermission { } } -impl UnaryPermission { +impl UnaryPermission { pub fn query(&self, env: Option<&str>) -> PermissionState { self.query_desc( - env.map(EnvDescriptor::new).as_ref(), + env.map(EnvQueryDescriptor::new).as_ref(), AllowPartial::TreatAsPartialGranted, ) } pub fn request(&mut self, env: Option<&str>) -> PermissionState { - self.request_desc(env.map(EnvDescriptor::new).as_ref()) + self.request_desc(env.map(EnvQueryDescriptor::new).as_ref()) } pub fn revoke(&mut self, env: Option<&str>) -> PermissionState { - self.revoke_desc(env.map(EnvDescriptor::new).as_ref()) + self.revoke_desc(env.map(EnvQueryDescriptor::new).as_ref()) } pub fn check( @@ -1771,7 +1884,7 @@ impl UnaryPermission { api_name: Option<&str>, ) -> Result<(), PermissionDeniedError> { skip_check_if_is_permission_fully_granted!(self); - self.check_desc(Some(&EnvDescriptor::new(env)), false, api_name) + self.check_desc(Some(&EnvQueryDescriptor::new(env)), false, api_name) } pub fn check_all(&mut self) -> Result<(), PermissionDeniedError> { @@ -1905,7 +2018,7 @@ pub struct Permissions { pub read: UnaryPermission, pub write: UnaryPermission, pub net: UnaryPermission, - pub env: UnaryPermission, + pub env: UnaryPermission, pub sys: UnaryPermission, pub run: UnaryPermission, pub ffi: UnaryPermission, @@ -4564,6 +4677,56 @@ mod tests { assert_eq!(perms.env.revoke(Some("HomE")), PermissionState::Prompt); } + #[test] + fn test_env_wildcards() { + set_prompter(Box::new(TestPrompter)); + let _prompt_value = PERMISSION_PROMPT_STUB_VALUE_SETTER.lock(); + let mut perms = Permissions::allow_all(); + perms.env = UnaryPermission { + granted_global: false, + ..Permissions::new_unary( + Some(HashSet::from([EnvDescriptor::new("HOME_*")])), + None, + false, + ) + }; + assert_eq!(perms.env.query(Some("HOME")), PermissionState::Prompt); + assert_eq!(perms.env.query(Some("HOME_")), PermissionState::Granted); + assert_eq!(perms.env.query(Some("HOME_TEST")), PermissionState::Granted); + + // assert no privilege escalation + let parser = TestPermissionDescriptorParser; + assert!(perms + .env + .create_child_permissions( + ChildUnaryPermissionArg::GrantedList(vec!["HOME_SUB".to_string()]), + |value| parser.parse_env_descriptor(value).map(Some), + ) + .is_ok()); + assert!(perms + .env + .create_child_permissions( + ChildUnaryPermissionArg::GrantedList(vec!["HOME*".to_string()]), + |value| parser.parse_env_descriptor(value).map(Some), + ) + .is_err()); + assert!(perms + .env + .create_child_permissions( + ChildUnaryPermissionArg::GrantedList(vec!["OUTSIDE".to_string()]), + |value| parser.parse_env_descriptor(value).map(Some), + ) + .is_err()); + assert!(perms + .env + .create_child_permissions( + // ok because this is a subset of HOME_* + ChildUnaryPermissionArg::GrantedList(vec!["HOME_S*".to_string()]), + |value| parser.parse_env_descriptor(value).map(Some), + ) + .is_ok()); + } + #[test] fn test_check_partial_denied() { let parser = TestPermissionDescriptorParser; diff --git a/tests/specs/permission/process_env_permissions/__test__.jsonc b/tests/specs/permission/process_env_permissions/__test__.jsonc new file mode 100644 index 0000000000..d3c756e0dc --- /dev/null +++ b/tests/specs/permission/process_env_permissions/__test__.jsonc @@ -0,0 +1,26 @@ +{ + "tempDir": true, + "tests": { + "deno_env_wildcard_tests": { + "envs": { + "MYAPP_HELLO": "Hello\tworld,", + "MYAPP_GOODBYE": "farewell", + "OTHER_VAR": "ignore" + }, + "steps": [ + { + "args": "run --allow-env=MYAPP_* main.js", + "output": "Hello\tworld,\nfarewell\ndone\n" + }, + { + "args": "run --allow-env main.js", + "output": "Hello\tworld,\nfarewell\ndone\n" + }, + { + "args": "run --allow-env=MYAPP_HELLO,MYAPP_GOODBYE,MYAPP_TEST,MYAPP_DONE main.js", + "output": "Hello\tworld,\nfarewell\ndone\n" + } + ] + } + } +} diff --git a/tests/specs/permission/process_env_permissions/main.js b/tests/specs/permission/process_env_permissions/main.js new file mode 100644 index 0000000000..7a412659c9 --- /dev/null +++ b/tests/specs/permission/process_env_permissions/main.js @@ -0,0 +1,5 @@ +console.log(Deno.env.get("MYAPP_HELLO")); +console.log(Deno.env.get("MYAPP_GOODBYE")); +Deno.env.set("MYAPP_TEST", "done"); +Deno.env.set("MYAPP_DONE", "done"); +console.log(Deno.env.get("MYAPP_DONE")); diff --git a/tests/specs/run/allow_env_wildcard_worker/__test__.jsonc b/tests/specs/run/allow_env_wildcard_worker/__test__.jsonc new file mode 100644 index 0000000000..6cfde6207f --- /dev/null +++ b/tests/specs/run/allow_env_wildcard_worker/__test__.jsonc @@ -0,0 +1,10 @@ +{ + "envs": { + "DENO_HELLO": "hello", + "DENO_BYE": "bye", + "AWS_HELLO": "aws" + }, + "args": "run --allow-env --allow-read --unstable-worker-options main.js", + "output": "main.out", + "exitCode": 1 +} diff --git a/tests/specs/run/allow_env_wildcard_worker/main.js b/tests/specs/run/allow_env_wildcard_worker/main.js new file mode 100644 index 0000000000..8d1a45fa61 --- /dev/null +++ b/tests/specs/run/allow_env_wildcard_worker/main.js @@ -0,0 +1,12 @@ +console.log("main1", Deno.env.get("DENO_HELLO")); +console.log("main2", Deno.env.get("DENO_BYE")); +console.log("main3", Deno.env.get("AWS_HELLO")); + +new Worker(import.meta.resolve("./worker.js"), { + type: "module", + deno: { + permissions: { + env: ["DENO_*"], + }, + }, +}); diff --git a/tests/specs/run/allow_env_wildcard_worker/main.out b/tests/specs/run/allow_env_wildcard_worker/main.out new file mode 100644 index 0000000000..01a7c42e39 --- /dev/null +++ b/tests/specs/run/allow_env_wildcard_worker/main.out @@ -0,0 +1,11 @@ +main1 hello +main2 bye +main3 aws +worker1 hello +worker2 bye +error: Uncaught (in worker "") (in promise) NotCapable: Requires env access to "AWS_HELLO", run again with the --allow-env flag +console.log("worker3", Deno.env.get("AWS_HELLO")); + ^ +[WILDCARD] +error: Uncaught (in promise) Error: Unhandled error in child worker. +[WILDCARD] diff --git a/tests/specs/run/allow_env_wildcard_worker/worker.js b/tests/specs/run/allow_env_wildcard_worker/worker.js new file mode 100644 index 0000000000..0238cbf6dc --- /dev/null +++ b/tests/specs/run/allow_env_wildcard_worker/worker.js @@ -0,0 +1,3 @@ +console.log("worker1", Deno.env.get("DENO_HELLO")); +console.log("worker2", Deno.env.get("DENO_BYE")); +console.log("worker3", Deno.env.get("AWS_HELLO")); From f0b245c8eee563a8d52db07b25a72d7382c2620b Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Thu, 21 Nov 2024 00:35:12 +0100 Subject: [PATCH 125/227] feat(task): workspace support with --filter and --recursive (#26949) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds workspace support to "deno taks". Two new flags were added: - "--recursive" - allows to run a specified task in workspace members, eg. "deno task --recursive dev" - "--filter" - allows to run a specified task only in specific workspace members, eg. "deno task --recursive --filter 'client/*' dev" "--filter" flag implies "--recursive" flag. Closes https://github.com/denoland/deno/issues/24991 --------- Signed-off-by: Bartek Iwańczuk Signed-off-by: David Sherret Co-authored-by: Bartek Iwańczuk Co-authored-by: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Co-authored-by: David Sherret Co-authored-by: David Sherret --- Cargo.lock | 4 +- Cargo.toml | 2 +- cli/args/flags.rs | 97 +++++- cli/main.rs | 2 + cli/tools/task.rs | 277 +++++++++++++----- .../__test__.jsonc | 5 + .../deno_json_lifecycle_script_names/bin.out | 2 + .../deno.jsonc | 7 + .../package.json | 5 + tests/specs/task/filter/__test__.jsonc | 59 ++++ tests/specs/task/filter/deno/bar/deno.json | 7 + tests/specs/task/filter/deno/deno.json | 6 + tests/specs/task/filter/deno/foo/deno.json | 7 + tests/specs/task/filter/deno_all.out | 4 + tests/specs/task/filter/deno_exact.out | 2 + tests/specs/task/filter/deno_multi.out | 0 tests/specs/task/filter/deno_scoped/deno.json | 3 + .../task/filter/deno_scoped/foo_bar/deno.json | 7 + .../task/filter/deno_scoped/foo_baz/deno.json | 7 + tests/specs/task/filter/deno_scoped_exact.out | 2 + tests/specs/task/filter/deno_scoped_multi.out | 4 + .../task/filter/deno_workspace_order.out | 4 + .../filter/deno_workspace_order/deno.json | 6 + .../deno_workspace_order/foo_bar/deno.json | 7 + .../deno_workspace_order/foo_baz/deno.json | 10 + tests/specs/task/filter/npm/bar/package.json | 6 + tests/specs/task/filter/npm/foo/package.json | 6 + tests/specs/task/filter/npm/package.json | 3 + tests/specs/task/filter/npm_all.out | 4 + tests/specs/task/filter/npm_exact.out | 2 + tests/specs/task/filter/npm_multi.out | 4 + .../filter/npm_multi/multi-a/package.json | 6 + .../filter/npm_multi/multi-b/package.json | 6 + .../specs/task/filter/npm_multi/package.json | 3 + .../filter/npm_scoped/foo_bar/package.json | 6 + .../filter/npm_scoped/foo_baz/package.json | 6 + .../specs/task/filter/npm_scoped/package.json | 3 + tests/specs/task/filter/npm_scoped_exact.out | 2 + tests/specs/task/filter/npm_scoped_multi.out | 4 + .../specs/task/filter/npm_workspace_order.out | 4 + .../npm_workspace_order/foo_bar/package.json | 6 + .../npm_workspace_order/foo_baz/package.json | 9 + .../filter/npm_workspace_order/package.json | 3 + 43 files changed, 541 insertions(+), 78 deletions(-) create mode 100644 tests/specs/task/deno_json_lifecycle_script_names/__test__.jsonc create mode 100644 tests/specs/task/deno_json_lifecycle_script_names/bin.out create mode 100644 tests/specs/task/deno_json_lifecycle_script_names/deno.jsonc create mode 100644 tests/specs/task/deno_json_lifecycle_script_names/package.json create mode 100644 tests/specs/task/filter/__test__.jsonc create mode 100644 tests/specs/task/filter/deno/bar/deno.json create mode 100644 tests/specs/task/filter/deno/deno.json create mode 100644 tests/specs/task/filter/deno/foo/deno.json create mode 100644 tests/specs/task/filter/deno_all.out create mode 100644 tests/specs/task/filter/deno_exact.out create mode 100644 tests/specs/task/filter/deno_multi.out create mode 100644 tests/specs/task/filter/deno_scoped/deno.json create mode 100644 tests/specs/task/filter/deno_scoped/foo_bar/deno.json create mode 100644 tests/specs/task/filter/deno_scoped/foo_baz/deno.json create mode 100644 tests/specs/task/filter/deno_scoped_exact.out create mode 100644 tests/specs/task/filter/deno_scoped_multi.out create mode 100644 tests/specs/task/filter/deno_workspace_order.out create mode 100644 tests/specs/task/filter/deno_workspace_order/deno.json create mode 100644 tests/specs/task/filter/deno_workspace_order/foo_bar/deno.json create mode 100644 tests/specs/task/filter/deno_workspace_order/foo_baz/deno.json create mode 100644 tests/specs/task/filter/npm/bar/package.json create mode 100644 tests/specs/task/filter/npm/foo/package.json create mode 100644 tests/specs/task/filter/npm/package.json create mode 100644 tests/specs/task/filter/npm_all.out create mode 100644 tests/specs/task/filter/npm_exact.out create mode 100644 tests/specs/task/filter/npm_multi.out create mode 100644 tests/specs/task/filter/npm_multi/multi-a/package.json create mode 100644 tests/specs/task/filter/npm_multi/multi-b/package.json create mode 100644 tests/specs/task/filter/npm_multi/package.json create mode 100644 tests/specs/task/filter/npm_scoped/foo_bar/package.json create mode 100644 tests/specs/task/filter/npm_scoped/foo_baz/package.json create mode 100644 tests/specs/task/filter/npm_scoped/package.json create mode 100644 tests/specs/task/filter/npm_scoped_exact.out create mode 100644 tests/specs/task/filter/npm_scoped_multi.out create mode 100644 tests/specs/task/filter/npm_workspace_order.out create mode 100644 tests/specs/task/filter/npm_workspace_order/foo_bar/package.json create mode 100644 tests/specs/task/filter/npm_workspace_order/foo_baz/package.json create mode 100644 tests/specs/task/filter/npm_workspace_order/package.json diff --git a/Cargo.lock b/Cargo.lock index 8850726cec..2896c0e058 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1435,9 +1435,9 @@ dependencies = [ [[package]] name = "deno_config" -version = "0.39.1" +version = "0.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a91aa99751ebe305a7edad12a3ad751f3b3b9f5ecddbfe4a0459e3cdc8493b6" +checksum = "38fb809500238be2b10eee42944a47b3ac38974e1edbb47f73afcfca7df143bf" dependencies = [ "anyhow", "deno_package_json", diff --git a/Cargo.toml b/Cargo.toml index cf7e2610bb..0dfe7e8bd9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ deno_ast = { version = "=0.43.3", features = ["transpiling"] } deno_core = { version = "0.321.0" } deno_bench_util = { version = "0.171.0", path = "./bench_util" } -deno_config = { version = "=0.39.1", features = ["workspace", "sync"] } +deno_config = { version = "=0.39.2", features = ["workspace", "sync"] } deno_lockfile = "=0.23.1" deno_media_type = { version = "0.2.0", features = ["module_specifier"] } deno_npm = "=0.25.4" diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 6945065574..3464766728 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -380,6 +380,8 @@ pub struct TaskFlags { pub cwd: Option, pub task: Option, pub is_run: bool, + pub recursive: bool, + pub filter: Option, pub eval: bool, } @@ -3046,13 +3048,27 @@ Evaluate a task from string .help("Specify the directory to run the task in") .value_hint(ValueHint::DirPath), ) + .arg( + Arg::new("recursive") + .long("recursive") + .short('r') + .help("Run the task in all projects in the workspace") + .action(ArgAction::SetTrue), + ) + .arg( + Arg::new("filter") + .long("filter") + .short('f') + .help("Filter members of the workspace by name - should be used with --recursive") + .value_parser(value_parser!(String)), + ) .arg( Arg::new("eval") .long("eval") .help( "Evaluate the passed value as if, it was a task in a configuration file", ).action(ArgAction::SetTrue) - ) + ) .arg(node_modules_dir_arg()) }) } @@ -5212,10 +5228,15 @@ fn task_parse( unstable_args_parse(flags, matches, UnstableArgsConfig::ResolutionAndRuntime); node_modules_arg_parse(flags, matches); + let filter = matches.remove_one::("filter"); + let recursive = matches.get_flag("recursive") || filter.is_some(); + let mut task_flags = TaskFlags { cwd: matches.remove_one::("cwd"), task: None, is_run: false, + recursive, + filter, eval: matches.get_flag("eval"), }; @@ -10418,6 +10439,8 @@ mod tests { cwd: None, task: Some("build".to_string()), is_run: false, + recursive: false, + filter: None, eval: false, }), argv: svec!["hello", "world"], @@ -10433,6 +10456,8 @@ mod tests { cwd: None, task: Some("build".to_string()), is_run: false, + recursive: false, + filter: None, eval: false, }), ..Flags::default() @@ -10447,6 +10472,56 @@ mod tests { cwd: Some("foo".to_string()), task: Some("build".to_string()), is_run: false, + recursive: false, + filter: None, + eval: false, + }), + ..Flags::default() + } + ); + + let r = flags_from_vec(svec!["deno", "task", "--filter", "*", "build"]); + assert_eq!( + r.unwrap(), + Flags { + subcommand: DenoSubcommand::Task(TaskFlags { + cwd: None, + task: Some("build".to_string()), + is_run: false, + recursive: true, + filter: Some("*".to_string()), + eval: false, + }), + ..Flags::default() + } + ); + + let r = flags_from_vec(svec!["deno", "task", "--recursive", "build"]); + assert_eq!( + r.unwrap(), + Flags { + subcommand: DenoSubcommand::Task(TaskFlags { + cwd: None, + task: Some("build".to_string()), + is_run: false, + recursive: true, + filter: None, + eval: false, + }), + ..Flags::default() + } + ); + + let r = flags_from_vec(svec!["deno", "task", "-r", "build"]); + assert_eq!( + r.unwrap(), + Flags { + subcommand: DenoSubcommand::Task(TaskFlags { + cwd: None, + task: Some("build".to_string()), + is_run: false, + recursive: true, + filter: None, eval: false, }), ..Flags::default() @@ -10461,6 +10536,8 @@ mod tests { cwd: None, task: Some("echo 1".to_string()), is_run: false, + recursive: false, + filter: None, eval: true, }), ..Flags::default() @@ -10490,6 +10567,8 @@ mod tests { cwd: None, task: Some("build".to_string()), is_run: false, + recursive: false, + filter: None, eval: false, }), argv: svec!["--", "hello", "world"], @@ -10508,6 +10587,8 @@ mod tests { cwd: Some("foo".to_string()), task: Some("build".to_string()), is_run: false, + recursive: false, + filter: None, eval: false, }), argv: svec!["--", "hello", "world"], @@ -10527,6 +10608,8 @@ mod tests { cwd: None, task: Some("build".to_string()), is_run: false, + recursive: false, + filter: None, eval: false, }), argv: svec!["--"], @@ -10545,6 +10628,8 @@ mod tests { cwd: None, task: Some("build".to_string()), is_run: false, + recursive: false, + filter: None, eval: false, }), argv: svec!["-1", "--test"], @@ -10563,6 +10648,8 @@ mod tests { cwd: None, task: Some("build".to_string()), is_run: false, + recursive: false, + filter: None, eval: false, }), argv: svec!["--test"], @@ -10582,6 +10669,8 @@ mod tests { cwd: None, task: Some("build".to_string()), is_run: false, + recursive: false, + filter: None, eval: false, }), log_level: Some(log::Level::Error), @@ -10600,6 +10689,8 @@ mod tests { cwd: None, task: None, is_run: false, + recursive: false, + filter: None, eval: false, }), ..Flags::default() @@ -10617,6 +10708,8 @@ mod tests { cwd: None, task: None, is_run: false, + recursive: false, + filter: None, eval: false, }), config_flag: ConfigFlag::Path("deno.jsonc".to_string()), @@ -10635,6 +10728,8 @@ mod tests { cwd: None, task: None, is_run: false, + recursive: false, + filter: None, eval: false, }), config_flag: ConfigFlag::Path("deno.jsonc".to_string()), diff --git a/cli/main.rs b/cli/main.rs index 017e343178..29f5914bbf 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -243,6 +243,8 @@ async fn run_subcommand(flags: Arc) -> Result { cwd: None, task: Some(run_flags.script.clone()), is_run: true, + recursive: false, + filter: None, eval: false, }; new_flags.subcommand = DenoSubcommand::Task(task_flags.clone()); diff --git a/cli/tools/task.rs b/cli/tools/task.rs index 85145c7af7..b0c290adc0 100644 --- a/cli/tools/task.rs +++ b/cli/tools/task.rs @@ -8,6 +8,7 @@ use std::path::PathBuf; use std::rc::Rc; use std::sync::Arc; +use deno_config::workspace::FolderConfigs; use deno_config::workspace::TaskDefinition; use deno_config::workspace::TaskOrScript; use deno_config::workspace::WorkspaceDirectory; @@ -25,6 +26,7 @@ use deno_path_util::normalize_path; use deno_runtime::deno_node::NodeResolver; use deno_task_shell::ShellCommand; use indexmap::IndexMap; +use regex::Regex; use crate::args::CliOptions; use crate::args::Flags; @@ -35,6 +37,12 @@ use crate::npm::CliNpmResolver; use crate::task_runner; use crate::util::fs::canonicalize_path; +#[derive(Debug)] +struct PackageTaskInfo { + matched_tasks: Vec, + tasks_config: WorkspaceTasksConfig, +} + pub async fn execute_script( flags: Arc, task_flags: TaskFlags, @@ -55,18 +63,145 @@ pub async fn execute_script( v == "1" }) .unwrap_or(false); - let mut tasks_config = start_dir.to_tasks_config()?; - if force_use_pkg_json { - tasks_config = tasks_config.with_only_pkg_json() + + fn arg_to_regex(input: &str) -> Result { + let mut regex_str = regex::escape(input); + regex_str = regex_str.replace("\\*", ".*"); + + Regex::new(®ex_str) } - let Some(task_name) = &task_flags.task else { - print_available_tasks( - &mut std::io::stdout(), - &cli_options.start_dir, - &tasks_config, - )?; - return Ok(0); + let packages_task_configs: Vec = if let Some(filter) = + &task_flags.filter + { + let task_name = task_flags.task.as_ref().unwrap(); + + // Filter based on package name + let package_regex = arg_to_regex(filter)?; + let task_regex = arg_to_regex(task_name)?; + + let mut packages_task_info: Vec = vec![]; + + fn matches_package( + config: &FolderConfigs, + force_use_pkg_json: bool, + regex: &Regex, + ) -> bool { + if !force_use_pkg_json { + if let Some(deno_json) = &config.deno_json { + if let Some(name) = &deno_json.json.name { + if regex.is_match(name) { + return true; + } + } + } + } + + if let Some(package_json) = &config.pkg_json { + if let Some(name) = &package_json.name { + if regex.is_match(name) { + return true; + } + } + } + + false + } + + let workspace = cli_options.workspace(); + for folder in workspace.config_folders() { + if !matches_package(folder.1, force_use_pkg_json, &package_regex) { + continue; + } + + let member_dir = workspace.resolve_member_dir(folder.0); + let mut tasks_config = member_dir.to_tasks_config()?; + if force_use_pkg_json { + tasks_config = tasks_config.with_only_pkg_json(); + } + + // Any of the matched tasks could be a child task of another matched + // one. Therefore we need to filter these out to ensure that every + // task is only run once. + let mut matched: HashSet = HashSet::new(); + let mut visited: HashSet = HashSet::new(); + + fn visit_task( + tasks_config: &WorkspaceTasksConfig, + visited: &mut HashSet, + name: &str, + ) { + if visited.contains(name) { + return; + } + + visited.insert(name.to_string()); + + if let Some((_, TaskOrScript::Task(_, task))) = &tasks_config.task(name) + { + for dep in &task.dependencies { + visit_task(tasks_config, visited, dep); + } + } + } + + // Match tasks in deno.json + for name in tasks_config.task_names() { + if task_regex.is_match(name) && !visited.contains(name) { + matched.insert(name.to_string()); + visit_task(&tasks_config, &mut visited, name); + } + } + + packages_task_info.push(PackageTaskInfo { + matched_tasks: matched + .iter() + .map(|s| s.to_string()) + .collect::>(), + tasks_config, + }); + } + + // Logging every task definition would be too spammy. Pnpm only + // logs a simple message too. + if packages_task_info + .iter() + .all(|config| config.matched_tasks.is_empty()) + { + log::warn!( + "{}", + colors::red(format!( + "No matching task or script '{}' found in selected packages.", + task_name + )) + ); + return Ok(0); + } + + // FIXME: Sort packages topologically + // + + packages_task_info + } else { + let mut tasks_config = start_dir.to_tasks_config()?; + + if force_use_pkg_json { + tasks_config = tasks_config.with_only_pkg_json() + } + + let Some(task_name) = &task_flags.task else { + print_available_tasks( + &mut std::io::stdout(), + &cli_options.start_dir, + &tasks_config, + )?; + return Ok(0); + }; + + vec![PackageTaskInfo { + tasks_config, + matched_tasks: vec![task_name.to_string()], + }] }; let npm_resolver = factory.npm_resolver().await?; @@ -81,7 +216,6 @@ pub async fn execute_script( .unwrap_or_else(|| NonZeroUsize::new(2).unwrap()); let task_runner = TaskRunner { - tasks_config, task_flags: &task_flags, npm_resolver: npm_resolver.as_ref(), node_resolver: node_resolver.as_ref(), @@ -94,7 +228,7 @@ pub async fn execute_script( return task_runner .run_deno_task( &Url::from_directory_path(cli_options.initial_cwd()).unwrap(), - &"".to_string(), + "", &TaskDefinition { command: task_flags.task.as_ref().unwrap().to_string(), dependencies: vec![], @@ -103,7 +237,15 @@ pub async fn execute_script( ) .await; } - task_runner.run_task(task_name).await + + for task_config in &packages_task_configs { + let exit_code = task_runner.run_tasks(task_config).await?; + if exit_code > 0 { + return Ok(exit_code); + } + } + + Ok(0) } struct RunSingleOptions<'a> { @@ -114,7 +256,6 @@ struct RunSingleOptions<'a> { } struct TaskRunner<'a> { - tasks_config: WorkspaceTasksConfig, task_flags: &'a TaskFlags, npm_resolver: &'a dyn CliNpmResolver, node_resolver: &'a NodeResolver, @@ -124,12 +265,16 @@ struct TaskRunner<'a> { } impl<'a> TaskRunner<'a> { - pub async fn run_task( + pub async fn run_tasks( &self, - task_name: &str, + pkg_tasks_config: &PackageTaskInfo, ) -> Result { - match sort_tasks_topo(task_name, &self.tasks_config) { - Ok(sorted) => self.run_tasks_in_parallel(sorted).await, + match sort_tasks_topo(pkg_tasks_config) { + Ok(sorted) => { + self + .run_tasks_in_parallel(&pkg_tasks_config.tasks_config, sorted) + .await + } Err(err) => match err { TaskError::NotFound(name) => { if self.task_flags.is_run { @@ -138,7 +283,7 @@ impl<'a> TaskRunner<'a> { log::error!("Task not found: {}", name); if log::log_enabled!(log::Level::Error) { - self.print_available_tasks()?; + self.print_available_tasks(&pkg_tasks_config.tasks_config)?; } Ok(1) } @@ -150,16 +295,20 @@ impl<'a> TaskRunner<'a> { } } - pub fn print_available_tasks(&self) -> Result<(), std::io::Error> { + pub fn print_available_tasks( + &self, + tasks_config: &WorkspaceTasksConfig, + ) -> Result<(), std::io::Error> { print_available_tasks( &mut std::io::stderr(), &self.cli_options.start_dir, - &self.tasks_config, + tasks_config, ) } async fn run_tasks_in_parallel( &self, + tasks_config: &WorkspaceTasksConfig, task_names: Vec, ) -> Result { struct PendingTasksContext { @@ -181,22 +330,23 @@ impl<'a> TaskRunner<'a> { fn get_next_task<'a>( &mut self, runner: &'a TaskRunner<'a>, + tasks_config: &'a WorkspaceTasksConfig, ) -> Option>> { for name in &self.task_names { if self.completed.contains(name) || self.running.contains(name) { continue; } - let should_run = if let Ok((_, def)) = runner.get_task(name) { - match def { - TaskOrScript::Task(_, def) => def - .dependencies - .iter() - .all(|dep| self.completed.contains(dep)), - TaskOrScript::Script(_, _) => true, - } - } else { - false + let Some((folder_url, task_or_script)) = tasks_config.task(name) + else { + continue; + }; + let should_run = match task_or_script { + TaskOrScript::Task(_, def) => def + .dependencies + .iter() + .all(|dep| self.completed.contains(dep)), + TaskOrScript::Script(_, _) => true, }; if !should_run { @@ -207,10 +357,15 @@ impl<'a> TaskRunner<'a> { let name = name.clone(); return Some( async move { - runner - .run_task_no_dependencies(&name) - .await - .map(|exit_code| (exit_code, name)) + match task_or_script { + TaskOrScript::Task(_, def) => { + runner.run_deno_task(folder_url, &name, def).await + } + TaskOrScript::Script(scripts, _) => { + runner.run_npm_script(folder_url, &name, scripts).await + } + } + .map(|exit_code| (exit_code, name)) } .boxed_local(), ); @@ -229,7 +384,7 @@ impl<'a> TaskRunner<'a> { while context.has_remaining_tasks() { while queue.len() < self.concurrency { - if let Some(task) = context.get_next_task(self) { + if let Some(task) = context.get_next_task(self, tasks_config) { queue.push(task); } else { break; @@ -253,37 +408,10 @@ impl<'a> TaskRunner<'a> { Ok(0) } - fn get_task( - &self, - task_name: &str, - ) -> Result<(&Url, TaskOrScript), TaskError> { - let Some(result) = self.tasks_config.task(task_name) else { - return Err(TaskError::NotFound(task_name.to_string())); - }; - - Ok(result) - } - - async fn run_task_no_dependencies( - &self, - task_name: &String, - ) -> Result { - let (dir_url, task_or_script) = self.get_task(task_name.as_str()).unwrap(); - - match task_or_script { - TaskOrScript::Task(_tasks, definition) => { - self.run_deno_task(dir_url, task_name, definition).await - } - TaskOrScript::Script(scripts, _script) => { - self.run_npm_script(dir_url, task_name, scripts).await - } - } - } - - async fn run_deno_task( + pub async fn run_deno_task( &self, dir_url: &Url, - task_name: &String, + task_name: &str, definition: &TaskDefinition, ) -> Result { let cwd = match &self.task_flags.cwd { @@ -306,10 +434,10 @@ impl<'a> TaskRunner<'a> { .await } - async fn run_npm_script( + pub async fn run_npm_script( &self, dir_url: &Url, - task_name: &String, + task_name: &str, scripts: &IndexMap, ) -> Result { // ensure the npm packages are installed if using a managed resolver @@ -327,7 +455,7 @@ impl<'a> TaskRunner<'a> { // dealing with package.json here and not deno.json let task_names = vec![ format!("pre{}", task_name), - task_name.clone(), + task_name.to_string(), format!("post{}", task_name), ]; let custom_commands = task_runner::resolve_custom_commands( @@ -394,8 +522,7 @@ enum TaskError { } fn sort_tasks_topo( - name: &str, - task_config: &WorkspaceTasksConfig, + pkg_task_config: &PackageTaskInfo, ) -> Result, TaskError> { fn sort_visit<'a>( name: &'a str, @@ -416,12 +543,12 @@ fn sort_tasks_topo( }); } - let Some(def) = tasks_config.task(name) else { + let Some((_, task_or_script)) = tasks_config.task(name) else { return Err(TaskError::NotFound(name.to_string())); }; - if let TaskOrScript::Task(_, actual_def) = def.1 { - for dep in &actual_def.dependencies { + if let TaskOrScript::Task(_, task) = task_or_script { + for dep in &task.dependencies { let mut path = path.clone(); path.push(name); sort_visit(dep, sorted, path, tasks_config)? @@ -435,7 +562,9 @@ fn sort_tasks_topo( let mut sorted: Vec = vec![]; - sort_visit(name, &mut sorted, Vec::new(), task_config)?; + for name in &pkg_task_config.matched_tasks { + sort_visit(name, &mut sorted, Vec::new(), &pkg_task_config.tasks_config)?; + } Ok(sorted) } diff --git a/tests/specs/task/deno_json_lifecycle_script_names/__test__.jsonc b/tests/specs/task/deno_json_lifecycle_script_names/__test__.jsonc new file mode 100644 index 0000000000..d22f77cc2b --- /dev/null +++ b/tests/specs/task/deno_json_lifecycle_script_names/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "task test", + "output": "bin.out", + "exitCode": 0 +} diff --git a/tests/specs/task/deno_json_lifecycle_script_names/bin.out b/tests/specs/task/deno_json_lifecycle_script_names/bin.out new file mode 100644 index 0000000000..ad66595f1e --- /dev/null +++ b/tests/specs/task/deno_json_lifecycle_script_names/bin.out @@ -0,0 +1,2 @@ +Task test echo 'test' +test diff --git a/tests/specs/task/deno_json_lifecycle_script_names/deno.jsonc b/tests/specs/task/deno_json_lifecycle_script_names/deno.jsonc new file mode 100644 index 0000000000..de2f8be880 --- /dev/null +++ b/tests/specs/task/deno_json_lifecycle_script_names/deno.jsonc @@ -0,0 +1,7 @@ +{ + "task": { + // should not execute this one because it's in a deno.json + // and not in the package.json + "pretest": "echo 'should not be in output'" + } +} diff --git a/tests/specs/task/deno_json_lifecycle_script_names/package.json b/tests/specs/task/deno_json_lifecycle_script_names/package.json new file mode 100644 index 0000000000..e66cb27e3d --- /dev/null +++ b/tests/specs/task/deno_json_lifecycle_script_names/package.json @@ -0,0 +1,5 @@ +{ + "scripts": { + "test": "echo 'test'" + } +} diff --git a/tests/specs/task/filter/__test__.jsonc b/tests/specs/task/filter/__test__.jsonc new file mode 100644 index 0000000000..8baaf04dd4 --- /dev/null +++ b/tests/specs/task/filter/__test__.jsonc @@ -0,0 +1,59 @@ +{ + "tests": { + "npm_all": { + "cwd": "./npm", + "args": "task --filter * dev", + "output": "npm_all.out" + }, + "npm_exact": { + "cwd": "./npm", + "args": "task --filter foo dev", + "output": "npm_exact.out" + }, + "npm_multi": { + "cwd": "./npm_multi", + "args": "task --filter multi-* dev", + "output": "npm_multi.out" + }, + "npm_scoped_exact": { + "cwd": "./npm_scoped", + "args": "task --filter @foo/bar dev", + "output": "npm_scoped_exact.out" + }, + "npm_scoped_multi": { + "cwd": "./npm_scoped", + "args": "task --filter @foo/* dev", + "output": "npm_scoped_multi.out" + }, + "npm_workspace_order": { + "cwd": "./npm_workspace_order", + "args": "task --filter @foo/* dev", + "output": "npm_workspace_order.out" + }, + "deno_all": { + "cwd": "./deno", + "args": "task --filter * dev", + "output": "deno_all.out" + }, + "deno_exact": { + "cwd": "./deno", + "args": "task --filter foo dev", + "output": "deno_exact.out" + }, + "deno_scoped_exact": { + "cwd": "./deno_scoped", + "args": "task --filter @foo/bar dev", + "output": "deno_scoped_exact.out" + }, + "deno_scoped_multi": { + "cwd": "./deno_scoped", + "args": "task --filter @foo/* dev", + "output": "deno_scoped_multi.out" + }, + "deno_workspace_order": { + "cwd": "./deno_workspace_order", + "args": "task --filter @foo/* dev", + "output": "deno_workspace_order.out" + } + } +} diff --git a/tests/specs/task/filter/deno/bar/deno.json b/tests/specs/task/filter/deno/bar/deno.json new file mode 100644 index 0000000000..9bc7d54233 --- /dev/null +++ b/tests/specs/task/filter/deno/bar/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@deno/bar", + "tasks": { + "dev": "echo '@deno/bar'" + }, + "exports": {} +} diff --git a/tests/specs/task/filter/deno/deno.json b/tests/specs/task/filter/deno/deno.json new file mode 100644 index 0000000000..133ab666b4 --- /dev/null +++ b/tests/specs/task/filter/deno/deno.json @@ -0,0 +1,6 @@ +{ + "workspace": [ + "./foo", + "./bar" + ] +} diff --git a/tests/specs/task/filter/deno/foo/deno.json b/tests/specs/task/filter/deno/foo/deno.json new file mode 100644 index 0000000000..6efb2125b7 --- /dev/null +++ b/tests/specs/task/filter/deno/foo/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@deno/foo", + "tasks": { + "dev": "echo '@deno/foo'" + }, + "exports": {} +} diff --git a/tests/specs/task/filter/deno_all.out b/tests/specs/task/filter/deno_all.out new file mode 100644 index 0000000000..c3c3441559 --- /dev/null +++ b/tests/specs/task/filter/deno_all.out @@ -0,0 +1,4 @@ +Task dev echo '@deno/bar' +@deno/bar +Task dev echo '@deno/foo' +@deno/foo diff --git a/tests/specs/task/filter/deno_exact.out b/tests/specs/task/filter/deno_exact.out new file mode 100644 index 0000000000..4bfebd6e92 --- /dev/null +++ b/tests/specs/task/filter/deno_exact.out @@ -0,0 +1,2 @@ +Task dev echo '@deno/foo' +@deno/foo diff --git a/tests/specs/task/filter/deno_multi.out b/tests/specs/task/filter/deno_multi.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/specs/task/filter/deno_scoped/deno.json b/tests/specs/task/filter/deno_scoped/deno.json new file mode 100644 index 0000000000..7a26f9ca68 --- /dev/null +++ b/tests/specs/task/filter/deno_scoped/deno.json @@ -0,0 +1,3 @@ +{ + "workspace": ["./foo_bar", "./foo_baz"] +} diff --git a/tests/specs/task/filter/deno_scoped/foo_bar/deno.json b/tests/specs/task/filter/deno_scoped/foo_bar/deno.json new file mode 100644 index 0000000000..1773d76c26 --- /dev/null +++ b/tests/specs/task/filter/deno_scoped/foo_bar/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@foo/bar", + "exports": {}, + "tasks": { + "dev": "echo '@foo/bar'" + } +} diff --git a/tests/specs/task/filter/deno_scoped/foo_baz/deno.json b/tests/specs/task/filter/deno_scoped/foo_baz/deno.json new file mode 100644 index 0000000000..f3e59719e5 --- /dev/null +++ b/tests/specs/task/filter/deno_scoped/foo_baz/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@foo/baz", + "exports": {}, + "tasks": { + "dev": "echo '@foo/baz'" + } +} diff --git a/tests/specs/task/filter/deno_scoped_exact.out b/tests/specs/task/filter/deno_scoped_exact.out new file mode 100644 index 0000000000..f7d61e8714 --- /dev/null +++ b/tests/specs/task/filter/deno_scoped_exact.out @@ -0,0 +1,2 @@ +Task dev echo '@foo/bar' +@foo/bar diff --git a/tests/specs/task/filter/deno_scoped_multi.out b/tests/specs/task/filter/deno_scoped_multi.out new file mode 100644 index 0000000000..f4609e94b6 --- /dev/null +++ b/tests/specs/task/filter/deno_scoped_multi.out @@ -0,0 +1,4 @@ +Task dev echo '@foo/bar' +@foo/bar +Task dev echo '@foo/baz' +@foo/baz diff --git a/tests/specs/task/filter/deno_workspace_order.out b/tests/specs/task/filter/deno_workspace_order.out new file mode 100644 index 0000000000..f4609e94b6 --- /dev/null +++ b/tests/specs/task/filter/deno_workspace_order.out @@ -0,0 +1,4 @@ +Task dev echo '@foo/bar' +@foo/bar +Task dev echo '@foo/baz' +@foo/baz diff --git a/tests/specs/task/filter/deno_workspace_order/deno.json b/tests/specs/task/filter/deno_workspace_order/deno.json new file mode 100644 index 0000000000..cd73d72b22 --- /dev/null +++ b/tests/specs/task/filter/deno_workspace_order/deno.json @@ -0,0 +1,6 @@ +{ + "workspace": [ + "./foo_bar", + "./foo_baz" + ] +} diff --git a/tests/specs/task/filter/deno_workspace_order/foo_bar/deno.json b/tests/specs/task/filter/deno_workspace_order/foo_bar/deno.json new file mode 100644 index 0000000000..5be2ceac7f --- /dev/null +++ b/tests/specs/task/filter/deno_workspace_order/foo_bar/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@foo/bar", + "tasks": { + "dev": "echo '@foo/bar'" + }, + "exports": {} +} diff --git a/tests/specs/task/filter/deno_workspace_order/foo_baz/deno.json b/tests/specs/task/filter/deno_workspace_order/foo_baz/deno.json new file mode 100644 index 0000000000..083cea5bf0 --- /dev/null +++ b/tests/specs/task/filter/deno_workspace_order/foo_baz/deno.json @@ -0,0 +1,10 @@ +{ + "name": "@foo/baz", + "tasks": { + "dev": "echo '@foo/baz'" + }, + "imports": { + "@foo/bar": "jsr:@foo/bar" + }, + "exports": {} +} diff --git a/tests/specs/task/filter/npm/bar/package.json b/tests/specs/task/filter/npm/bar/package.json new file mode 100644 index 0000000000..3723db6f01 --- /dev/null +++ b/tests/specs/task/filter/npm/bar/package.json @@ -0,0 +1,6 @@ +{ + "name": "bar", + "scripts": { + "dev": "echo 'bar'" + } +} diff --git a/tests/specs/task/filter/npm/foo/package.json b/tests/specs/task/filter/npm/foo/package.json new file mode 100644 index 0000000000..86fa20d111 --- /dev/null +++ b/tests/specs/task/filter/npm/foo/package.json @@ -0,0 +1,6 @@ +{ + "name": "foo", + "scripts": { + "dev": "echo 'foo'" + } +} diff --git a/tests/specs/task/filter/npm/package.json b/tests/specs/task/filter/npm/package.json new file mode 100644 index 0000000000..2d70009f2c --- /dev/null +++ b/tests/specs/task/filter/npm/package.json @@ -0,0 +1,3 @@ +{ + "workspaces": ["./foo", "./bar"] +} diff --git a/tests/specs/task/filter/npm_all.out b/tests/specs/task/filter/npm_all.out new file mode 100644 index 0000000000..592d4640cd --- /dev/null +++ b/tests/specs/task/filter/npm_all.out @@ -0,0 +1,4 @@ +Task dev echo 'bar' +bar +Task dev echo 'foo' +foo diff --git a/tests/specs/task/filter/npm_exact.out b/tests/specs/task/filter/npm_exact.out new file mode 100644 index 0000000000..f879b66df8 --- /dev/null +++ b/tests/specs/task/filter/npm_exact.out @@ -0,0 +1,2 @@ +Task dev echo 'foo' +foo diff --git a/tests/specs/task/filter/npm_multi.out b/tests/specs/task/filter/npm_multi.out new file mode 100644 index 0000000000..58898a5965 --- /dev/null +++ b/tests/specs/task/filter/npm_multi.out @@ -0,0 +1,4 @@ +Task dev echo 'multi-a' +multi-a +Task dev echo 'multi-b' +multi-b diff --git a/tests/specs/task/filter/npm_multi/multi-a/package.json b/tests/specs/task/filter/npm_multi/multi-a/package.json new file mode 100644 index 0000000000..348d7273ff --- /dev/null +++ b/tests/specs/task/filter/npm_multi/multi-a/package.json @@ -0,0 +1,6 @@ +{ + "name": "multi-a", + "scripts": { + "dev": "echo 'multi-a'" + } +} diff --git a/tests/specs/task/filter/npm_multi/multi-b/package.json b/tests/specs/task/filter/npm_multi/multi-b/package.json new file mode 100644 index 0000000000..f11006aea4 --- /dev/null +++ b/tests/specs/task/filter/npm_multi/multi-b/package.json @@ -0,0 +1,6 @@ +{ + "name": "multi-b", + "scripts": { + "dev": "echo 'multi-b'" + } +} diff --git a/tests/specs/task/filter/npm_multi/package.json b/tests/specs/task/filter/npm_multi/package.json new file mode 100644 index 0000000000..b6000c0487 --- /dev/null +++ b/tests/specs/task/filter/npm_multi/package.json @@ -0,0 +1,3 @@ +{ + "workspaces": ["./multi-a", "./multi-b"] +} diff --git a/tests/specs/task/filter/npm_scoped/foo_bar/package.json b/tests/specs/task/filter/npm_scoped/foo_bar/package.json new file mode 100644 index 0000000000..0e2c92c8be --- /dev/null +++ b/tests/specs/task/filter/npm_scoped/foo_bar/package.json @@ -0,0 +1,6 @@ +{ + "name": "@foo/bar", + "scripts": { + "dev": "echo '@foo/bar'" + } +} diff --git a/tests/specs/task/filter/npm_scoped/foo_baz/package.json b/tests/specs/task/filter/npm_scoped/foo_baz/package.json new file mode 100644 index 0000000000..77ec9209b1 --- /dev/null +++ b/tests/specs/task/filter/npm_scoped/foo_baz/package.json @@ -0,0 +1,6 @@ +{ + "name": "@foo/baz", + "scripts": { + "dev": "echo '@foo/baz'" + } +} diff --git a/tests/specs/task/filter/npm_scoped/package.json b/tests/specs/task/filter/npm_scoped/package.json new file mode 100644 index 0000000000..d02abfb3f8 --- /dev/null +++ b/tests/specs/task/filter/npm_scoped/package.json @@ -0,0 +1,3 @@ +{ + "workspaces": ["./foo_bar", "./foo_baz"] +} diff --git a/tests/specs/task/filter/npm_scoped_exact.out b/tests/specs/task/filter/npm_scoped_exact.out new file mode 100644 index 0000000000..f7d61e8714 --- /dev/null +++ b/tests/specs/task/filter/npm_scoped_exact.out @@ -0,0 +1,2 @@ +Task dev echo '@foo/bar' +@foo/bar diff --git a/tests/specs/task/filter/npm_scoped_multi.out b/tests/specs/task/filter/npm_scoped_multi.out new file mode 100644 index 0000000000..f4609e94b6 --- /dev/null +++ b/tests/specs/task/filter/npm_scoped_multi.out @@ -0,0 +1,4 @@ +Task dev echo '@foo/bar' +@foo/bar +Task dev echo '@foo/baz' +@foo/baz diff --git a/tests/specs/task/filter/npm_workspace_order.out b/tests/specs/task/filter/npm_workspace_order.out new file mode 100644 index 0000000000..f4609e94b6 --- /dev/null +++ b/tests/specs/task/filter/npm_workspace_order.out @@ -0,0 +1,4 @@ +Task dev echo '@foo/bar' +@foo/bar +Task dev echo '@foo/baz' +@foo/baz diff --git a/tests/specs/task/filter/npm_workspace_order/foo_bar/package.json b/tests/specs/task/filter/npm_workspace_order/foo_bar/package.json new file mode 100644 index 0000000000..0e2c92c8be --- /dev/null +++ b/tests/specs/task/filter/npm_workspace_order/foo_bar/package.json @@ -0,0 +1,6 @@ +{ + "name": "@foo/bar", + "scripts": { + "dev": "echo '@foo/bar'" + } +} diff --git a/tests/specs/task/filter/npm_workspace_order/foo_baz/package.json b/tests/specs/task/filter/npm_workspace_order/foo_baz/package.json new file mode 100644 index 0000000000..79f4b4b793 --- /dev/null +++ b/tests/specs/task/filter/npm_workspace_order/foo_baz/package.json @@ -0,0 +1,9 @@ +{ + "name": "@foo/baz", + "scripts": { + "dev": "echo '@foo/baz'" + }, + "dependencies": { + "@foo/bar": "workspace:*" + } +} diff --git a/tests/specs/task/filter/npm_workspace_order/package.json b/tests/specs/task/filter/npm_workspace_order/package.json new file mode 100644 index 0000000000..d02abfb3f8 --- /dev/null +++ b/tests/specs/task/filter/npm_workspace_order/package.json @@ -0,0 +1,3 @@ +{ + "workspaces": ["./foo_bar", "./foo_baz"] +} From d17f4590a246675b12ced7272b93b670b37f9f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 21 Nov 2024 00:03:11 +0000 Subject: [PATCH 126/227] feat(init): add --npm flag to initialize npm projects (#26896) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds support for `deno init --npm `. Running this will actually call to `npm:create-` package that is equivalent to running `npm create `. User will be prompted if they want to allow all permissions and lifecycle scripts to be executed. Closes https://github.com/denoland/deno/issues/26461 --------- Signed-off-by: Bartek Iwańczuk Co-authored-by: crowlkats Co-authored-by: David Sherret --- cli/args/flags.rs | 121 ++++++++++++++++++++++++++-- cli/args/mod.rs | 3 +- cli/main.rs | 4 +- cli/tools/init/mod.rs | 68 +++++++++++++++- tests/specs/init/npm/__test__.jsonc | 6 ++ tests/specs/init/npm/init.out | 1 + 6 files changed, 191 insertions(+), 12 deletions(-) create mode 100644 tests/specs/init/npm/__test__.jsonc create mode 100644 tests/specs/init/npm/init.out diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 3464766728..f6d53cd15e 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -222,6 +222,8 @@ impl FmtFlags { #[derive(Clone, Debug, Eq, PartialEq)] pub struct InitFlags { + pub package: Option, + pub package_args: Vec, pub dir: Option, pub lib: bool, pub serve: bool, @@ -1395,7 +1397,7 @@ pub fn flags_from_vec(args: Vec) -> clap::error::Result { "doc" => doc_parse(&mut flags, &mut m)?, "eval" => eval_parse(&mut flags, &mut m)?, "fmt" => fmt_parse(&mut flags, &mut m)?, - "init" => init_parse(&mut flags, &mut m), + "init" => init_parse(&mut flags, &mut m)?, "info" => info_parse(&mut flags, &mut m)?, "install" => install_parse(&mut flags, &mut m)?, "json_reference" => json_reference_parse(&mut flags, &mut m, app), @@ -2448,7 +2450,19 @@ fn init_subcommand() -> Command { command("init", "scaffolds a basic Deno project with a script, test, and configuration file", UnstableArgsConfig::None).defer( |cmd| { cmd - .arg(Arg::new("dir").value_hint(ValueHint::DirPath)) + .arg(Arg::new("args") + .num_args(0..) + .action(ArgAction::Append) + .value_name("DIRECTORY OR PACKAGE") + .trailing_var_arg(true) + ) + .arg( + Arg::new("npm") + .long("npm") + .help("Generate a npm create-* project") + .conflicts_with_all(["lib", "serve"]) + .action(ArgAction::SetTrue), + ) .arg( Arg::new("lib") .long("lib") @@ -4820,12 +4834,44 @@ fn fmt_parse( Ok(()) } -fn init_parse(flags: &mut Flags, matches: &mut ArgMatches) { +fn init_parse( + flags: &mut Flags, + matches: &mut ArgMatches, +) -> Result<(), clap::Error> { + let mut lib = matches.get_flag("lib"); + let mut serve = matches.get_flag("serve"); + let mut dir = None; + let mut package = None; + let mut package_args = vec![]; + + if let Some(mut args) = matches.remove_many::("args") { + let name = args.next().unwrap(); + let mut args = args.collect::>(); + + if matches.get_flag("npm") { + package = Some(name); + package_args = args; + } else { + dir = Some(name); + + if !args.is_empty() { + args.insert(0, "init".to_string()); + let inner_matches = init_subcommand().try_get_matches_from_mut(args)?; + lib = inner_matches.get_flag("lib"); + serve = inner_matches.get_flag("serve"); + } + } + } + flags.subcommand = DenoSubcommand::Init(InitFlags { - dir: matches.remove_one::("dir"), - lib: matches.get_flag("lib"), - serve: matches.get_flag("serve"), + package, + package_args, + dir, + lib, + serve, }); + + Ok(()) } fn info_parse( @@ -10907,6 +10953,8 @@ mod tests { r.unwrap(), Flags { subcommand: DenoSubcommand::Init(InitFlags { + package: None, + package_args: vec![], dir: None, lib: false, serve: false, @@ -10920,6 +10968,8 @@ mod tests { r.unwrap(), Flags { subcommand: DenoSubcommand::Init(InitFlags { + package: None, + package_args: vec![], dir: Some(String::from("foo")), lib: false, serve: false, @@ -10933,6 +10983,8 @@ mod tests { r.unwrap(), Flags { subcommand: DenoSubcommand::Init(InitFlags { + package: None, + package_args: vec![], dir: None, lib: false, serve: false, @@ -10947,6 +10999,8 @@ mod tests { r.unwrap(), Flags { subcommand: DenoSubcommand::Init(InitFlags { + package: None, + package_args: vec![], dir: None, lib: true, serve: false, @@ -10960,6 +11014,8 @@ mod tests { r.unwrap(), Flags { subcommand: DenoSubcommand::Init(InitFlags { + package: None, + package_args: vec![], dir: None, lib: false, serve: true, @@ -10973,6 +11029,8 @@ mod tests { r.unwrap(), Flags { subcommand: DenoSubcommand::Init(InitFlags { + package: None, + package_args: vec![], dir: Some(String::from("foo")), lib: true, serve: false, @@ -10980,6 +11038,57 @@ mod tests { ..Flags::default() } ); + + let r = flags_from_vec(svec!["deno", "init", "--lib", "--npm", "vite"]); + assert!(r.is_err()); + + let r = flags_from_vec(svec!["deno", "init", "--serve", "--npm", "vite"]); + assert!(r.is_err()); + + let r = flags_from_vec(svec!["deno", "init", "--npm", "vite", "--lib"]); + assert_eq!( + r.unwrap(), + Flags { + subcommand: DenoSubcommand::Init(InitFlags { + package: Some("vite".to_string()), + package_args: svec!["--lib"], + dir: None, + lib: false, + serve: false, + }), + ..Flags::default() + } + ); + + let r = flags_from_vec(svec!["deno", "init", "--npm", "vite", "--serve"]); + assert_eq!( + r.unwrap(), + Flags { + subcommand: DenoSubcommand::Init(InitFlags { + package: Some("vite".to_string()), + package_args: svec!["--serve"], + dir: None, + lib: false, + serve: false, + }), + ..Flags::default() + } + ); + + let r = flags_from_vec(svec!["deno", "init", "--npm", "vite", "new_dir"]); + assert_eq!( + r.unwrap(), + Flags { + subcommand: DenoSubcommand::Init(InitFlags { + package: Some("vite".to_string()), + package_args: svec!["new_dir"], + dir: None, + lib: false, + serve: false, + }), + ..Flags::default() + } + ); } #[test] diff --git a/cli/args/mod.rs b/cli/args/mod.rs index 37e1f00ffa..a1a9c49cbe 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1628,9 +1628,10 @@ impl CliOptions { DenoSubcommand::Install(_) | DenoSubcommand::Add(_) | DenoSubcommand::Remove(_) + | DenoSubcommand::Init(_) | DenoSubcommand::Outdated(_) ) { - // For `deno install/add/remove` we want to force the managed resolver so it can set up `node_modules/` directory. + // For `deno install/add/remove/init` we want to force the managed resolver so it can set up `node_modules/` directory. return false; } if self.node_modules_dir().ok().flatten().is_none() diff --git a/cli/main.rs b/cli/main.rs index 29f5914bbf..c49c8a83a6 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -144,9 +144,7 @@ async fn run_subcommand(flags: Arc) -> Result { } DenoSubcommand::Init(init_flags) => { spawn_subcommand(async { - // make compiler happy since init_project is sync - tokio::task::yield_now().await; - tools::init::init_project(init_flags) + tools::init::init_project(init_flags).await }) } DenoSubcommand::Info(info_flags) => { diff --git a/cli/tools/init/mod.rs b/cli/tools/init/mod.rs index 4e4a686c5f..8f486dad53 100644 --- a/cli/tools/init/mod.rs +++ b/cli/tools/init/mod.rs @@ -1,15 +1,28 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use crate::args::DenoSubcommand; +use crate::args::Flags; use crate::args::InitFlags; +use crate::args::PackagesAllowedScripts; +use crate::args::PermissionFlags; +use crate::args::RunFlags; use crate::colors; +use color_print::cformat; +use color_print::cstr; use deno_core::anyhow::Context; use deno_core::error::AnyError; use deno_core::serde_json::json; +use deno_runtime::WorkerExecutionMode; use log::info; +use std::io::IsTerminal; use std::io::Write; use std::path::Path; -pub fn init_project(init_flags: InitFlags) -> Result<(), AnyError> { +pub async fn init_project(init_flags: InitFlags) -> Result { + if let Some(package) = &init_flags.package { + return init_npm(package, init_flags.package_args).await; + } + let cwd = std::env::current_dir().context("Can't read current working directory.")?; let dir = if let Some(dir) = &init_flags.dir { @@ -235,7 +248,58 @@ Deno.test(function addTest() { info!(" {}", colors::gray("# Run the tests")); info!(" deno test"); } - Ok(()) + Ok(0) +} + +async fn init_npm(name: &str, args: Vec) -> Result { + let script_name = format!("npm:create-{}", name); + + fn print_manual_usage(script_name: &str, args: &[String]) -> i32 { + log::info!("{}", cformat!("You can initialize project manually by running deno run {} {} and applying desired permissions.", script_name, args.join(" "))); + 1 + } + + if std::io::stdin().is_terminal() { + log::info!( + cstr!("⚠️ Do you fully trust {} package? Deno will invoke code from it with all permissions. Do you want to continue? [y/n]"), + script_name + ); + loop { + let _ = std::io::stdout().write(b"> ")?; + std::io::stdout().flush()?; + let mut answer = String::new(); + if std::io::stdin().read_line(&mut answer).is_ok() { + let answer = answer.trim().to_ascii_lowercase(); + if answer != "y" { + return Ok(print_manual_usage(&script_name, &args)); + } else { + break; + } + } + } + } else { + return Ok(print_manual_usage(&script_name, &args)); + } + + let new_flags = Flags { + permissions: PermissionFlags { + allow_all: true, + ..Default::default() + }, + allow_scripts: PackagesAllowedScripts::All, + argv: args, + subcommand: DenoSubcommand::Run(RunFlags { + script: script_name, + ..Default::default() + }), + ..Default::default() + }; + crate::tools::run::run_script( + WorkerExecutionMode::Run, + new_flags.into(), + None, + ) + .await } fn create_json_file( diff --git a/tests/specs/init/npm/__test__.jsonc b/tests/specs/init/npm/__test__.jsonc new file mode 100644 index 0000000000..ccc9d181dd --- /dev/null +++ b/tests/specs/init/npm/__test__.jsonc @@ -0,0 +1,6 @@ +{ + "tempDir": true, + "args": "init --npm vite my-project", + "output": "init.out", + "exitCode": 1 +} diff --git a/tests/specs/init/npm/init.out b/tests/specs/init/npm/init.out new file mode 100644 index 0000000000..f4ba939437 --- /dev/null +++ b/tests/specs/init/npm/init.out @@ -0,0 +1 @@ +You can initialize project manually by running deno run npm:create-vite my-project and applying desired permissions. From be10901dfcfe84bda6b02828a9253f08365d5cfb Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 20 Nov 2024 20:02:58 -0500 Subject: [PATCH 127/227] docs: fix casing of Wasm (#26954) --- cli/tsc/dts/lib.deno.shared_globals.d.ts | 58 +++++++++---------- .../close_in_wasm_reactions.js | 2 +- .../worker_close_in_wasm_reactions.js | 2 +- .../workers/close_in_wasm_reactions.js | 2 +- tests/unit/wasm_test.ts | 4 +- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/cli/tsc/dts/lib.deno.shared_globals.d.ts b/cli/tsc/dts/lib.deno.shared_globals.d.ts index ba872ef46e..96790fb665 100644 --- a/cli/tsc/dts/lib.deno.shared_globals.d.ts +++ b/cli/tsc/dts/lib.deno.shared_globals.d.ts @@ -15,14 +15,14 @@ /// /// -/** @category WASM */ +/** @category Wasm */ declare namespace WebAssembly { /** * The `WebAssembly.CompileError` object indicates an error during WebAssembly decoding or validation. * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/CompileError) * - * @category WASM + * @category Wasm */ export class CompileError extends Error { /** Creates a new `WebAssembly.CompileError` object. */ @@ -36,7 +36,7 @@ declare namespace WebAssembly { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global) * - * @category WASM + * @category Wasm */ export class Global { /** Creates a new `Global` object. */ @@ -59,7 +59,7 @@ declare namespace WebAssembly { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance) * - * @category WASM + * @category Wasm */ export class Instance { /** Creates a new Instance object. */ @@ -79,7 +79,7 @@ declare namespace WebAssembly { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/LinkError) * - * @category WASM + * @category Wasm */ export class LinkError extends Error { /** Creates a new WebAssembly.LinkError object. */ @@ -95,7 +95,7 @@ declare namespace WebAssembly { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) * - * @category WASM + * @category Wasm */ export class Memory { /** Creates a new `Memory` object. */ @@ -117,7 +117,7 @@ declare namespace WebAssembly { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module) * - * @category WASM + * @category Wasm */ export class Module { /** Creates a new `Module` object. */ @@ -145,7 +145,7 @@ declare namespace WebAssembly { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/RuntimeError) * - * @category WASM + * @category Wasm */ export class RuntimeError extends Error { /** Creates a new `WebAssembly.RuntimeError` object. */ @@ -160,7 +160,7 @@ declare namespace WebAssembly { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table) * - * @category WASM + * @category Wasm */ export class Table { /** Creates a new `Table` object. */ @@ -182,7 +182,7 @@ declare namespace WebAssembly { /** The `GlobalDescriptor` describes the options you can pass to * `new WebAssembly.Global()`. * - * @category WASM + * @category Wasm */ export interface GlobalDescriptor { mutable?: boolean; @@ -192,7 +192,7 @@ declare namespace WebAssembly { /** The `MemoryDescriptor` describes the options you can pass to * `new WebAssembly.Memory()`. * - * @category WASM + * @category Wasm */ export interface MemoryDescriptor { initial: number; @@ -203,7 +203,7 @@ declare namespace WebAssembly { /** A `ModuleExportDescriptor` is the description of a declared export in a * `WebAssembly.Module`. * - * @category WASM + * @category Wasm */ export interface ModuleExportDescriptor { kind: ImportExportKind; @@ -213,7 +213,7 @@ declare namespace WebAssembly { /** A `ModuleImportDescriptor` is the description of a declared import in a * `WebAssembly.Module`. * - * @category WASM + * @category Wasm */ export interface ModuleImportDescriptor { kind: ImportExportKind; @@ -224,7 +224,7 @@ declare namespace WebAssembly { /** The `TableDescriptor` describes the options you can pass to * `new WebAssembly.Table()`. * - * @category WASM + * @category Wasm */ export interface TableDescriptor { element: TableKind; @@ -234,7 +234,7 @@ declare namespace WebAssembly { /** The value returned from `WebAssembly.instantiate`. * - * @category WASM + * @category Wasm */ export interface WebAssemblyInstantiatedSource { /* A `WebAssembly.Instance` object that contains all the exported WebAssembly functions. */ @@ -247,21 +247,21 @@ declare namespace WebAssembly { module: Module; } - /** @category WASM */ + /** @category Wasm */ export type ImportExportKind = "function" | "global" | "memory" | "table"; - /** @category WASM */ + /** @category Wasm */ export type TableKind = "anyfunc"; - /** @category WASM */ + /** @category Wasm */ export type ValueType = "f32" | "f64" | "i32" | "i64"; - /** @category WASM */ + /** @category Wasm */ export type ExportValue = Function | Global | Memory | Table; - /** @category WASM */ + /** @category Wasm */ export type Exports = Record; - /** @category WASM */ + /** @category Wasm */ export type ImportValue = ExportValue | number; - /** @category WASM */ + /** @category Wasm */ export type ModuleImports = Record; - /** @category WASM */ + /** @category Wasm */ export type Imports = Record; /** @@ -272,7 +272,7 @@ declare namespace WebAssembly { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compile) * - * @category WASM + * @category Wasm */ export function compile(bytes: BufferSource): Promise; @@ -284,7 +284,7 @@ declare namespace WebAssembly { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compileStreaming) * - * @category WASM + * @category Wasm */ export function compileStreaming( source: Response | Promise, @@ -301,7 +301,7 @@ declare namespace WebAssembly { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiate) * - * @category WASM + * @category Wasm */ export function instantiate( bytes: BufferSource, @@ -318,7 +318,7 @@ declare namespace WebAssembly { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiate) * - * @category WASM + * @category Wasm */ export function instantiate( moduleObject: Module, @@ -332,7 +332,7 @@ declare namespace WebAssembly { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiateStreaming) * - * @category WASM + * @category Wasm */ export function instantiateStreaming( response: Response | PromiseLike, @@ -346,7 +346,7 @@ declare namespace WebAssembly { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/validate) * - * @category WASM + * @category Wasm */ export function validate(bytes: BufferSource): boolean; } diff --git a/tests/specs/run/worker_close_in_wasm_reactions/close_in_wasm_reactions.js b/tests/specs/run/worker_close_in_wasm_reactions/close_in_wasm_reactions.js index abe5731085..2cb0e4a768 100644 --- a/tests/specs/run/worker_close_in_wasm_reactions/close_in_wasm_reactions.js +++ b/tests/specs/run/worker_close_in_wasm_reactions/close_in_wasm_reactions.js @@ -1,6 +1,6 @@ // https://github.com/denoland/deno/issues/12263 // Test for a panic that happens when a worker is closed in the reactions of a -// WASM async operation. +// Wasm async operation. // The minimum valid wasm module, plus two additional zero bytes. const buffer = new Uint8Array([ diff --git a/tests/specs/run/worker_close_in_wasm_reactions/worker_close_in_wasm_reactions.js b/tests/specs/run/worker_close_in_wasm_reactions/worker_close_in_wasm_reactions.js index 828320a240..2f62707eff 100644 --- a/tests/specs/run/worker_close_in_wasm_reactions/worker_close_in_wasm_reactions.js +++ b/tests/specs/run/worker_close_in_wasm_reactions/worker_close_in_wasm_reactions.js @@ -2,7 +2,7 @@ // https://github.com/denoland/deno/issues/12263 // Test for a panic that happens when a worker is closed in the reactions of a -// WASM async operation. +// Wasm async operation. new Worker( import.meta.resolve("./close_in_wasm_reactions.js"), diff --git a/tests/testdata/workers/close_in_wasm_reactions.js b/tests/testdata/workers/close_in_wasm_reactions.js index abe5731085..2cb0e4a768 100644 --- a/tests/testdata/workers/close_in_wasm_reactions.js +++ b/tests/testdata/workers/close_in_wasm_reactions.js @@ -1,6 +1,6 @@ // https://github.com/denoland/deno/issues/12263 // Test for a panic that happens when a worker is closed in the reactions of a -// WASM async operation. +// Wasm async operation. // The minimum valid wasm module, plus two additional zero bytes. const buffer = new Uint8Array([ diff --git a/tests/unit/wasm_test.ts b/tests/unit/wasm_test.ts index e0db41ed0e..8ee9392f93 100644 --- a/tests/unit/wasm_test.ts +++ b/tests/unit/wasm_test.ts @@ -32,7 +32,7 @@ Deno.test(async function wasmInstantiateWorksWithBuffer() { }); // V8's default implementation of `WebAssembly.instantiateStreaming()` if you -// don't set the WASM streaming callback, is to take a byte source. Here we +// don't set the Wasm streaming callback, is to take a byte source. Here we // check that our implementation of the callback disallows it. Deno.test( async function wasmInstantiateStreamingFailsWithBuffer() { @@ -95,7 +95,7 @@ Deno.test( Deno.test( { permissions: { net: true } }, async function wasmStreamingNonTrivial() { - // deno-dom's WASM file is a real-world non-trivial case that gave us + // deno-dom's Wasm file is a real-world non-trivial case that gave us // trouble when implementing this. await WebAssembly.instantiateStreaming(fetch( "http://localhost:4545/assets/deno_dom_0.1.3-alpha2.wasm", From 3da4eca7c1ed97906654671669e0bb3b095bc637 Mon Sep 17 00:00:00 2001 From: denobot <33910674+denobot@users.noreply.github.com> Date: Wed, 20 Nov 2024 21:05:02 -0500 Subject: [PATCH 128/227] 2.1.0 (#26957) Bumped versions for 2.1.0 Co-authored-by: bartlomieju --- .github/workflows/ci.generate.ts | 2 +- .github/workflows/ci.yml | 8 ++-- Cargo.lock | 58 +++++++++++++------------- Cargo.toml | 56 ++++++++++++------------- Releases.md | 70 ++++++++++++++++++++++++++++++++ bench_util/Cargo.toml | 2 +- cli/Cargo.toml | 2 +- ext/broadcast_channel/Cargo.toml | 2 +- ext/cache/Cargo.toml | 2 +- ext/canvas/Cargo.toml | 2 +- ext/console/Cargo.toml | 2 +- ext/cron/Cargo.toml | 2 +- ext/crypto/Cargo.toml | 2 +- ext/fetch/Cargo.toml | 2 +- ext/ffi/Cargo.toml | 2 +- ext/fs/Cargo.toml | 2 +- ext/http/Cargo.toml | 2 +- ext/io/Cargo.toml | 2 +- ext/kv/Cargo.toml | 2 +- ext/napi/Cargo.toml | 2 +- ext/napi/sym/Cargo.toml | 2 +- ext/net/Cargo.toml | 2 +- ext/node/Cargo.toml | 2 +- ext/tls/Cargo.toml | 2 +- ext/url/Cargo.toml | 2 +- ext/web/Cargo.toml | 2 +- ext/webgpu/Cargo.toml | 2 +- ext/webidl/Cargo.toml | 2 +- ext/websocket/Cargo.toml | 2 +- ext/webstorage/Cargo.toml | 2 +- resolvers/deno/Cargo.toml | 2 +- resolvers/node/Cargo.toml | 2 +- runtime/Cargo.toml | 2 +- runtime/permissions/Cargo.toml | 2 +- 34 files changed, 161 insertions(+), 91 deletions(-) diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts index 5ed02d3cde..941ee47984 100755 --- a/.github/workflows/ci.generate.ts +++ b/.github/workflows/ci.generate.ts @@ -5,7 +5,7 @@ import { stringify } from "jsr:@std/yaml@^0.221/stringify"; // Bump this number when you want to purge the cache. // Note: the tools/release/01_bump_crate_versions.ts script will update this version // automatically via regex, so ensure that this line maintains this format. -const cacheVersion = 25; +const cacheVersion = 26; const ubuntuX86Runner = "ubuntu-24.04"; const ubuntuX86XlRunner = "ubuntu-24.04-xl"; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39a3afe769..20e9fef503 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -361,8 +361,8 @@ jobs: path: |- ~/.cargo/registry/index ~/.cargo/registry/cache - key: '25-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}' - restore-keys: '25-cargo-home-${{ matrix.os }}-${{ matrix.arch }}' + key: '26-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}' + restore-keys: '26-cargo-home-${{ matrix.os }}-${{ matrix.arch }}' if: '!(matrix.skip)' - name: Restore cache build output (PR) uses: actions/cache/restore@v4 @@ -375,7 +375,7 @@ jobs: !./target/*/*.zip !./target/*/*.tar.gz key: never_saved - restore-keys: '25-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-' + restore-keys: '26-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-' - name: Apply and update mtime cache if: '!(matrix.skip) && (!startsWith(github.ref, ''refs/tags/''))' uses: ./.github/mtime_cache @@ -685,7 +685,7 @@ jobs: !./target/*/*.zip !./target/*/*.sha256sum !./target/*/*.tar.gz - key: '25-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}' + key: '26-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}' publish-canary: name: publish canary runs-on: ubuntu-24.04 diff --git a/Cargo.lock b/Cargo.lock index 2896c0e058..bf6d3a3714 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1201,7 +1201,7 @@ dependencies = [ [[package]] name = "deno" -version = "2.0.6" +version = "2.1.0" dependencies = [ "anstream", "async-trait", @@ -1371,7 +1371,7 @@ dependencies = [ [[package]] name = "deno_bench_util" -version = "0.171.0" +version = "0.172.0" dependencies = [ "bencher", "deno_core", @@ -1380,7 +1380,7 @@ dependencies = [ [[package]] name = "deno_broadcast_channel" -version = "0.171.0" +version = "0.172.0" dependencies = [ "async-trait", "deno_core", @@ -1391,7 +1391,7 @@ dependencies = [ [[package]] name = "deno_cache" -version = "0.109.0" +version = "0.110.0" dependencies = [ "async-trait", "deno_core", @@ -1424,7 +1424,7 @@ dependencies = [ [[package]] name = "deno_canvas" -version = "0.46.0" +version = "0.47.0" dependencies = [ "deno_core", "deno_webgpu", @@ -1459,7 +1459,7 @@ dependencies = [ [[package]] name = "deno_console" -version = "0.177.0" +version = "0.178.0" dependencies = [ "deno_core", ] @@ -1506,7 +1506,7 @@ checksum = "fe4dccb6147bb3f3ba0c7a48e993bfeb999d2c2e47a81badee80e2b370c8d695" [[package]] name = "deno_cron" -version = "0.57.0" +version = "0.58.0" dependencies = [ "anyhow", "async-trait", @@ -1519,7 +1519,7 @@ dependencies = [ [[package]] name = "deno_crypto" -version = "0.191.0" +version = "0.192.0" dependencies = [ "aes", "aes-gcm", @@ -1587,7 +1587,7 @@ dependencies = [ [[package]] name = "deno_fetch" -version = "0.201.0" +version = "0.202.0" dependencies = [ "base64 0.21.7", "bytes", @@ -1621,7 +1621,7 @@ dependencies = [ [[package]] name = "deno_ffi" -version = "0.164.0" +version = "0.165.0" dependencies = [ "deno_core", "deno_permissions", @@ -1641,7 +1641,7 @@ dependencies = [ [[package]] name = "deno_fs" -version = "0.87.0" +version = "0.88.0" dependencies = [ "async-trait", "base32", @@ -1694,7 +1694,7 @@ dependencies = [ [[package]] name = "deno_http" -version = "0.175.0" +version = "0.176.0" dependencies = [ "async-compression", "async-trait", @@ -1733,7 +1733,7 @@ dependencies = [ [[package]] name = "deno_io" -version = "0.87.0" +version = "0.88.0" dependencies = [ "async-trait", "deno_core", @@ -1754,7 +1754,7 @@ dependencies = [ [[package]] name = "deno_kv" -version = "0.85.0" +version = "0.86.0" dependencies = [ "anyhow", "async-trait", @@ -1827,7 +1827,7 @@ dependencies = [ [[package]] name = "deno_napi" -version = "0.108.0" +version = "0.109.0" dependencies = [ "deno_core", "deno_permissions", @@ -1855,7 +1855,7 @@ dependencies = [ [[package]] name = "deno_net" -version = "0.169.0" +version = "0.170.0" dependencies = [ "deno_core", "deno_permissions", @@ -1872,7 +1872,7 @@ dependencies = [ [[package]] name = "deno_node" -version = "0.114.0" +version = "0.115.0" dependencies = [ "aead-gcm-stream", "aes", @@ -2024,7 +2024,7 @@ dependencies = [ [[package]] name = "deno_permissions" -version = "0.37.0" +version = "0.38.0" dependencies = [ "deno_core", "deno_path_util", @@ -2042,7 +2042,7 @@ dependencies = [ [[package]] name = "deno_resolver" -version = "0.9.0" +version = "0.10.0" dependencies = [ "anyhow", "base32", @@ -2061,7 +2061,7 @@ dependencies = [ [[package]] name = "deno_runtime" -version = "0.186.0" +version = "0.187.0" dependencies = [ "async-trait", "color-print", @@ -2198,7 +2198,7 @@ dependencies = [ [[package]] name = "deno_tls" -version = "0.164.0" +version = "0.165.0" dependencies = [ "deno_core", "deno_native_certs", @@ -2247,7 +2247,7 @@ dependencies = [ [[package]] name = "deno_url" -version = "0.177.0" +version = "0.178.0" dependencies = [ "deno_bench_util", "deno_console", @@ -2259,7 +2259,7 @@ dependencies = [ [[package]] name = "deno_web" -version = "0.208.0" +version = "0.209.0" dependencies = [ "async-trait", "base64-simd 0.8.0", @@ -2281,7 +2281,7 @@ dependencies = [ [[package]] name = "deno_webgpu" -version = "0.144.0" +version = "0.145.0" dependencies = [ "deno_core", "raw-window-handle", @@ -2294,7 +2294,7 @@ dependencies = [ [[package]] name = "deno_webidl" -version = "0.177.0" +version = "0.178.0" dependencies = [ "deno_bench_util", "deno_core", @@ -2302,7 +2302,7 @@ dependencies = [ [[package]] name = "deno_websocket" -version = "0.182.0" +version = "0.183.0" dependencies = [ "bytes", "deno_core", @@ -2324,7 +2324,7 @@ dependencies = [ [[package]] name = "deno_webstorage" -version = "0.172.0" +version = "0.173.0" dependencies = [ "deno_core", "deno_web", @@ -4752,7 +4752,7 @@ dependencies = [ [[package]] name = "napi_sym" -version = "0.107.0" +version = "0.108.0" dependencies = [ "quote", "serde", @@ -4807,7 +4807,7 @@ dependencies = [ [[package]] name = "node_resolver" -version = "0.16.0" +version = "0.17.0" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 0dfe7e8bd9..5f66c0d44d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,17 +48,17 @@ repository = "https://github.com/denoland/deno" deno_ast = { version = "=0.43.3", features = ["transpiling"] } deno_core = { version = "0.321.0" } -deno_bench_util = { version = "0.171.0", path = "./bench_util" } +deno_bench_util = { version = "0.172.0", path = "./bench_util" } deno_config = { version = "=0.39.2", features = ["workspace", "sync"] } deno_lockfile = "=0.23.1" deno_media_type = { version = "0.2.0", features = ["module_specifier"] } deno_npm = "=0.25.4" deno_path_util = "=0.2.1" -deno_permissions = { version = "0.37.0", path = "./runtime/permissions" } -deno_runtime = { version = "0.186.0", path = "./runtime" } +deno_permissions = { version = "0.38.0", path = "./runtime/permissions" } +deno_runtime = { version = "0.187.0", path = "./runtime" } deno_semver = "=0.5.16" deno_terminal = "0.2.0" -napi_sym = { version = "0.107.0", path = "./ext/napi/sym" } +napi_sym = { version = "0.108.0", path = "./ext/napi/sym" } test_util = { package = "test_server", path = "./tests/util/server" } denokv_proto = "0.8.4" @@ -67,32 +67,32 @@ denokv_remote = "0.8.4" denokv_sqlite = { default-features = false, version = "0.8.4" } # exts -deno_broadcast_channel = { version = "0.171.0", path = "./ext/broadcast_channel" } -deno_cache = { version = "0.109.0", path = "./ext/cache" } -deno_canvas = { version = "0.46.0", path = "./ext/canvas" } -deno_console = { version = "0.177.0", path = "./ext/console" } -deno_cron = { version = "0.57.0", path = "./ext/cron" } -deno_crypto = { version = "0.191.0", path = "./ext/crypto" } -deno_fetch = { version = "0.201.0", path = "./ext/fetch" } -deno_ffi = { version = "0.164.0", path = "./ext/ffi" } -deno_fs = { version = "0.87.0", path = "./ext/fs" } -deno_http = { version = "0.175.0", path = "./ext/http" } -deno_io = { version = "0.87.0", path = "./ext/io" } -deno_kv = { version = "0.85.0", path = "./ext/kv" } -deno_napi = { version = "0.108.0", path = "./ext/napi" } -deno_net = { version = "0.169.0", path = "./ext/net" } -deno_node = { version = "0.114.0", path = "./ext/node" } -deno_tls = { version = "0.164.0", path = "./ext/tls" } -deno_url = { version = "0.177.0", path = "./ext/url" } -deno_web = { version = "0.208.0", path = "./ext/web" } -deno_webgpu = { version = "0.144.0", path = "./ext/webgpu" } -deno_webidl = { version = "0.177.0", path = "./ext/webidl" } -deno_websocket = { version = "0.182.0", path = "./ext/websocket" } -deno_webstorage = { version = "0.172.0", path = "./ext/webstorage" } +deno_broadcast_channel = { version = "0.172.0", path = "./ext/broadcast_channel" } +deno_cache = { version = "0.110.0", path = "./ext/cache" } +deno_canvas = { version = "0.47.0", path = "./ext/canvas" } +deno_console = { version = "0.178.0", path = "./ext/console" } +deno_cron = { version = "0.58.0", path = "./ext/cron" } +deno_crypto = { version = "0.192.0", path = "./ext/crypto" } +deno_fetch = { version = "0.202.0", path = "./ext/fetch" } +deno_ffi = { version = "0.165.0", path = "./ext/ffi" } +deno_fs = { version = "0.88.0", path = "./ext/fs" } +deno_http = { version = "0.176.0", path = "./ext/http" } +deno_io = { version = "0.88.0", path = "./ext/io" } +deno_kv = { version = "0.86.0", path = "./ext/kv" } +deno_napi = { version = "0.109.0", path = "./ext/napi" } +deno_net = { version = "0.170.0", path = "./ext/net" } +deno_node = { version = "0.115.0", path = "./ext/node" } +deno_tls = { version = "0.165.0", path = "./ext/tls" } +deno_url = { version = "0.178.0", path = "./ext/url" } +deno_web = { version = "0.209.0", path = "./ext/web" } +deno_webgpu = { version = "0.145.0", path = "./ext/webgpu" } +deno_webidl = { version = "0.178.0", path = "./ext/webidl" } +deno_websocket = { version = "0.183.0", path = "./ext/websocket" } +deno_webstorage = { version = "0.173.0", path = "./ext/webstorage" } # resolvers -deno_resolver = { version = "0.9.0", path = "./resolvers/deno" } -node_resolver = { version = "0.16.0", path = "./resolvers/node" } +deno_resolver = { version = "0.10.0", path = "./resolvers/deno" } +node_resolver = { version = "0.17.0", path = "./resolvers/node" } aes = "=0.8.3" anyhow = "1.0.57" diff --git a/Releases.md b/Releases.md index 5ce25815bd..2cb2dfbd80 100644 --- a/Releases.md +++ b/Releases.md @@ -6,6 +6,76 @@ https://github.com/denoland/deno/releases We also have one-line install commands at: https://github.com/denoland/deno_install +### 2.1.0 / 2024.11.21 + +- feat(cli): add `--unstable-node-globals` flag (#26617) +- feat(cli): support multiple env file argument (#26527) +- feat(compile): ability to embed directory in executable (#26939) +- feat(compile): ability to embed local data files (#26934) +- feat(ext/fetch): Make fetch client parameters configurable (#26909) +- feat(ext/fetch): allow embedders to use `hickory_dns_resolver` instead of + default `GaiResolver` (#26740) +- feat(ext/fs): add ctime to Deno.stats and use it in node compat layer (#24801) +- feat(ext/http): Make http server parameters configurable (#26785) +- feat(ext/node): perf_hooks.monitorEventLoopDelay() (#26905) +- feat(fetch): accept async iterables for body (#26882) +- feat(fmt): support SQL (#26750) +- feat(info): show location for Web Cache (#26205) +- feat(init): add --npm flag to initialize npm projects (#26896) +- feat(jupyter): Add `Deno.jupyter.image` API (#26284) +- feat(lint): Add checked files list to the JSON output(#26936) +- feat(lsp): auto-imports with @deno-types directives (#26821) +- feat(node): stabilize detecting if CJS via `"type": "commonjs"` in a + package.json (#26439) +- feat(permission): support suffix wildcards in `--allow-env` flag (#25255) +- feat(publish): add `--set-version ` flag (#26141) +- feat(runtime): remove public OTEL trace API (#26854) +- feat(task): add --eval flag (#26943) +- feat(task): dependencies (#26467) +- feat(task): support object notation, remove support for JSDocs (#26886) +- feat(task): workspace support with --filter and --recursive (#26949) +- feat(watch): log which file changed on HMR or watch change (#25801) +- feat: OpenTelemetry Tracing API and Exporting (#26710) +- feat: Wasm module support (#26668) +- feat: fmt and lint respect .gitignore file (#26897) +- feat: permission stack traces in ops (#26938) +- feat: subcommand to view and update outdated dependencies (#26942) +- feat: upgrade V8 to 13.0 (#26851) +- fix(cli): preserve comments in doc tests (#26828) +- fix(cli): show prefix hint when installing a package globally (#26629) +- fix(ext/cache): gracefully error when cache creation failed (#26895) +- fix(ext/http): prefer brotli for `accept-encoding: gzip, deflate, br, zstd` + (#26814) +- fix(ext/node): New async setInterval function to improve the nodejs + compatibility (#26703) +- fix(ext/node): add autoSelectFamily option to net.createConnection (#26661) +- fix(ext/node): handle `--allow-sys=inspector` (#26836) +- fix(ext/node): increase tolerance for interval test (#26899) +- fix(ext/node): process.getBuiltinModule (#26833) +- fix(ext/node): use ERR_NOT_IMPLEMENTED for notImplemented (#26853) +- fix(ext/node): zlib.crc32() (#26856) +- fix(ext/webgpu): Create GPUQuerySet converter before usage (#26883) +- fix(ext/websocket): initialize `error` attribute of WebSocket ErrorEvent + (#26796) +- fix(ext/webstorage): use error class for sqlite error case (#26806) +- fix(fmt): error instead of panic on unstable format (#26859) +- fix(fmt): formatting of .svelte files (#26948) +- fix(install): percent encodings in interactive progress bar (#26600) +- fix(install): re-setup bin entries after running lifecycle scripts (#26752) +- fix(lockfile): track dependencies specified in TypeScript compiler options + (#26551) +- fix(lsp): ignore editor indent settings if deno.json is present (#26912) +- fix(lsp): skip code action edits that can't be converted (#26831) +- fix(node): handle resolving ".//" in npm packages (#26920) +- fix(node/crypto): support promisify on generateKeyPair (#26913) +- fix(permissions): say to use --allow-run instead of --allow-all (#26842) +- fix(publish): improve error message when missing exports (#26945) +- fix: otel resiliency (#26857) +- fix: update message for unsupported schemes with npm and jsr (#26884) +- perf(compile): code cache (#26528) +- perf(windows): delay load webgpu and some other dlls (#26917) +- perf: use available system memory for v8 isolate memory limit (#26868) + ### 2.0.6 / 2024.11.10 - feat(ext/http): abort event when request is cancelled (#26781) diff --git a/bench_util/Cargo.toml b/bench_util/Cargo.toml index d6eefc3a5d..7bb785e6e5 100644 --- a/bench_util/Cargo.toml +++ b/bench_util/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_bench_util" -version = "0.171.0" +version = "0.172.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/cli/Cargo.toml b/cli/Cargo.toml index d6f509eb97..c681884837 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno" -version = "2.0.6" +version = "2.1.0" authors.workspace = true default-run = "deno" edition.workspace = true diff --git a/ext/broadcast_channel/Cargo.toml b/ext/broadcast_channel/Cargo.toml index 90ac038357..b92b1c7beb 100644 --- a/ext/broadcast_channel/Cargo.toml +++ b/ext/broadcast_channel/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_broadcast_channel" -version = "0.171.0" +version = "0.172.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/cache/Cargo.toml b/ext/cache/Cargo.toml index 56fa0a527f..c79024e82c 100644 --- a/ext/cache/Cargo.toml +++ b/ext/cache/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_cache" -version = "0.109.0" +version = "0.110.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/canvas/Cargo.toml b/ext/canvas/Cargo.toml index 4231d7c84d..8fcb2c4a9c 100644 --- a/ext/canvas/Cargo.toml +++ b/ext/canvas/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_canvas" -version = "0.46.0" +version = "0.47.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/console/Cargo.toml b/ext/console/Cargo.toml index 80f1cca84d..9f925ac61b 100644 --- a/ext/console/Cargo.toml +++ b/ext/console/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_console" -version = "0.177.0" +version = "0.178.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/cron/Cargo.toml b/ext/cron/Cargo.toml index 966ccdc958..23ac77d5ed 100644 --- a/ext/cron/Cargo.toml +++ b/ext/cron/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_cron" -version = "0.57.0" +version = "0.58.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/crypto/Cargo.toml b/ext/crypto/Cargo.toml index a5794dc68b..4a44314221 100644 --- a/ext/crypto/Cargo.toml +++ b/ext/crypto/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_crypto" -version = "0.191.0" +version = "0.192.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/fetch/Cargo.toml b/ext/fetch/Cargo.toml index 00c85f2aa1..9ebd9ec03f 100644 --- a/ext/fetch/Cargo.toml +++ b/ext/fetch/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_fetch" -version = "0.201.0" +version = "0.202.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/ffi/Cargo.toml b/ext/ffi/Cargo.toml index 295e8be846..e63d22e57d 100644 --- a/ext/ffi/Cargo.toml +++ b/ext/ffi/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_ffi" -version = "0.164.0" +version = "0.165.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/fs/Cargo.toml b/ext/fs/Cargo.toml index ace1b89f3a..f37d1f6997 100644 --- a/ext/fs/Cargo.toml +++ b/ext/fs/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_fs" -version = "0.87.0" +version = "0.88.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/http/Cargo.toml b/ext/http/Cargo.toml index ed98fe349c..5105b47dde 100644 --- a/ext/http/Cargo.toml +++ b/ext/http/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_http" -version = "0.175.0" +version = "0.176.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/io/Cargo.toml b/ext/io/Cargo.toml index 6ef049ff9b..8f7c0e197a 100644 --- a/ext/io/Cargo.toml +++ b/ext/io/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_io" -version = "0.87.0" +version = "0.88.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/kv/Cargo.toml b/ext/kv/Cargo.toml index aa73817667..870e4fec3b 100644 --- a/ext/kv/Cargo.toml +++ b/ext/kv/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_kv" -version = "0.85.0" +version = "0.86.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/napi/Cargo.toml b/ext/napi/Cargo.toml index df3ec0287b..19f4036a88 100644 --- a/ext/napi/Cargo.toml +++ b/ext/napi/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_napi" -version = "0.108.0" +version = "0.109.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/napi/sym/Cargo.toml b/ext/napi/sym/Cargo.toml index 7c13a9165c..83107782b8 100644 --- a/ext/napi/sym/Cargo.toml +++ b/ext/napi/sym/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "napi_sym" -version = "0.107.0" +version = "0.108.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/net/Cargo.toml b/ext/net/Cargo.toml index 1febbd5338..1cb109dd21 100644 --- a/ext/net/Cargo.toml +++ b/ext/net/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_net" -version = "0.169.0" +version = "0.170.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/node/Cargo.toml b/ext/node/Cargo.toml index 36910a8446..3502d3b5f8 100644 --- a/ext/node/Cargo.toml +++ b/ext/node/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_node" -version = "0.114.0" +version = "0.115.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/tls/Cargo.toml b/ext/tls/Cargo.toml index 943fc8413e..81d28d4421 100644 --- a/ext/tls/Cargo.toml +++ b/ext/tls/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_tls" -version = "0.164.0" +version = "0.165.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/url/Cargo.toml b/ext/url/Cargo.toml index 557a4669e6..2b390e8b07 100644 --- a/ext/url/Cargo.toml +++ b/ext/url/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_url" -version = "0.177.0" +version = "0.178.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/web/Cargo.toml b/ext/web/Cargo.toml index db28d0e578..c00298991b 100644 --- a/ext/web/Cargo.toml +++ b/ext/web/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_web" -version = "0.208.0" +version = "0.209.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/webgpu/Cargo.toml b/ext/webgpu/Cargo.toml index f23bb8371e..73541ba6a2 100644 --- a/ext/webgpu/Cargo.toml +++ b/ext/webgpu/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webgpu" -version = "0.144.0" +version = "0.145.0" authors = ["the Deno authors"] edition.workspace = true license = "MIT" diff --git a/ext/webidl/Cargo.toml b/ext/webidl/Cargo.toml index 8c3f6f6128..9f6fdc4943 100644 --- a/ext/webidl/Cargo.toml +++ b/ext/webidl/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webidl" -version = "0.177.0" +version = "0.178.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/websocket/Cargo.toml b/ext/websocket/Cargo.toml index 61f1f5959c..bdbc169435 100644 --- a/ext/websocket/Cargo.toml +++ b/ext/websocket/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_websocket" -version = "0.182.0" +version = "0.183.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/webstorage/Cargo.toml b/ext/webstorage/Cargo.toml index 01e23ab839..928844c5aa 100644 --- a/ext/webstorage/Cargo.toml +++ b/ext/webstorage/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webstorage" -version = "0.172.0" +version = "0.173.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/resolvers/deno/Cargo.toml b/resolvers/deno/Cargo.toml index c2d4a3bc29..6be746cecb 100644 --- a/resolvers/deno/Cargo.toml +++ b/resolvers/deno/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_resolver" -version = "0.9.0" +version = "0.10.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/resolvers/node/Cargo.toml b/resolvers/node/Cargo.toml index eeac79c256..7f914479ad 100644 --- a/resolvers/node/Cargo.toml +++ b/resolvers/node/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "node_resolver" -version = "0.16.0" +version = "0.17.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index b59cd14fa9..d4c41b831f 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_runtime" -version = "0.186.0" +version = "0.187.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/runtime/permissions/Cargo.toml b/runtime/permissions/Cargo.toml index e088eb8ce5..1e7133de6d 100644 --- a/runtime/permissions/Cargo.toml +++ b/runtime/permissions/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_permissions" -version = "0.37.0" +version = "0.38.0" authors.workspace = true edition.workspace = true license.workspace = true From 0b8df9f24d0119386dff4341bc4a6a1142688f2d Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 21 Nov 2024 00:13:47 -0500 Subject: [PATCH 129/227] chore: fix cargo publish (#26958) --- resolvers/deno/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/resolvers/deno/Cargo.toml b/resolvers/deno/Cargo.toml index 6be746cecb..0de8b31b38 100644 --- a/resolvers/deno/Cargo.toml +++ b/resolvers/deno/Cargo.toml @@ -25,6 +25,7 @@ deno_package_json.features = ["sync"] deno_path_util.workspace = true deno_semver.workspace = true node_resolver.workspace = true +node_resolver.features = ["sync"] thiserror.workspace = true url.workspace = true From e515ed23e8af7f849cad9a74e40c64c973149e6d Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 21 Nov 2024 09:43:51 -0500 Subject: [PATCH 130/227] fix(task): ensure root config always looks up dependencies in root (#26959) We were accidentally looking up dependencies in the member. --- cli/tools/task.rs | 194 +++++++++++------- .../__test__.jsonc | 5 + .../dependencies_root_not_cycle/deno.json | 10 + .../member/deno.json | 8 + .../task/dependencies_root_not_cycle/task.out | 6 + .../__test__.jsonc | 14 ++ .../deno.jsonc | 12 ++ .../member/deno.jsonc | 12 ++ .../member_depending_root_and_member.out | 10 + .../root_dependending_root.out | 4 + 10 files changed, 205 insertions(+), 70 deletions(-) create mode 100644 tests/specs/task/dependencies_root_not_cycle/__test__.jsonc create mode 100644 tests/specs/task/dependencies_root_not_cycle/deno.json create mode 100644 tests/specs/task/dependencies_root_not_cycle/member/deno.json create mode 100644 tests/specs/task/dependencies_root_not_cycle/task.out create mode 100644 tests/specs/task/dependencies_shadowed_root_name/__test__.jsonc create mode 100644 tests/specs/task/dependencies_shadowed_root_name/deno.jsonc create mode 100644 tests/specs/task/dependencies_shadowed_root_name/member/deno.jsonc create mode 100644 tests/specs/task/dependencies_shadowed_root_name/member_depending_root_and_member.out create mode 100644 tests/specs/task/dependencies_shadowed_root_name/root_dependending_root.out diff --git a/cli/tools/task.rs b/cli/tools/task.rs index b0c290adc0..478853f4e6 100644 --- a/cli/tools/task.rs +++ b/cli/tools/task.rs @@ -12,6 +12,7 @@ use deno_config::workspace::FolderConfigs; use deno_config::workspace::TaskDefinition; use deno_config::workspace::TaskOrScript; use deno_config::workspace::WorkspaceDirectory; +use deno_config::workspace::WorkspaceMemberTasksConfig; use deno_config::workspace::WorkspaceTasksConfig; use deno_core::anyhow::anyhow; use deno_core::anyhow::bail; @@ -270,11 +271,7 @@ impl<'a> TaskRunner<'a> { pkg_tasks_config: &PackageTaskInfo, ) -> Result { match sort_tasks_topo(pkg_tasks_config) { - Ok(sorted) => { - self - .run_tasks_in_parallel(&pkg_tasks_config.tasks_config, sorted) - .await - } + Ok(sorted) => self.run_tasks_in_parallel(sorted).await, Err(err) => match err { TaskError::NotFound(name) => { if self.task_flags.is_run { @@ -308,64 +305,62 @@ impl<'a> TaskRunner<'a> { async fn run_tasks_in_parallel( &self, - tasks_config: &WorkspaceTasksConfig, - task_names: Vec, + tasks: Vec>, ) -> Result { - struct PendingTasksContext { - completed: HashSet, - running: HashSet, - task_names: Vec, + struct PendingTasksContext<'a> { + completed: HashSet, + running: HashSet, + tasks: &'a [ResolvedTask<'a>], } - impl PendingTasksContext { + impl<'a> PendingTasksContext<'a> { fn has_remaining_tasks(&self) -> bool { - self.completed.len() < self.task_names.len() + self.completed.len() < self.tasks.len() } - fn mark_complete(&mut self, task_name: String) { - self.running.remove(&task_name); - self.completed.insert(task_name); + fn mark_complete(&mut self, task: &ResolvedTask) { + self.running.remove(&task.id); + self.completed.insert(task.id); } - fn get_next_task<'a>( + fn get_next_task<'b>( &mut self, - runner: &'a TaskRunner<'a>, - tasks_config: &'a WorkspaceTasksConfig, - ) -> Option>> { - for name in &self.task_names { - if self.completed.contains(name) || self.running.contains(name) { + runner: &'b TaskRunner<'b>, + ) -> Option< + LocalBoxFuture<'b, Result<(i32, &'a ResolvedTask<'a>), AnyError>>, + > + where + 'a: 'b, + { + for task in self.tasks.iter() { + if self.completed.contains(&task.id) + || self.running.contains(&task.id) + { continue; } - let Some((folder_url, task_or_script)) = tasks_config.task(name) - else { - continue; - }; - let should_run = match task_or_script { - TaskOrScript::Task(_, def) => def - .dependencies - .iter() - .all(|dep| self.completed.contains(dep)), - TaskOrScript::Script(_, _) => true, - }; - + let should_run = task + .dependencies + .iter() + .all(|dep_id| self.completed.contains(dep_id)); if !should_run { continue; } - self.running.insert(name.clone()); - let name = name.clone(); + self.running.insert(task.id); return Some( async move { - match task_or_script { + match task.task_or_script { TaskOrScript::Task(_, def) => { - runner.run_deno_task(folder_url, &name, def).await + runner.run_deno_task(task.folder_url, task.name, def).await } TaskOrScript::Script(scripts, _) => { - runner.run_npm_script(folder_url, &name, scripts).await + runner + .run_npm_script(task.folder_url, task.name, scripts) + .await } } - .map(|exit_code| (exit_code, name)) + .map(|exit_code| (exit_code, task)) } .boxed_local(), ); @@ -375,16 +370,16 @@ impl<'a> TaskRunner<'a> { } let mut context = PendingTasksContext { - completed: HashSet::with_capacity(task_names.len()), + completed: HashSet::with_capacity(tasks.len()), running: HashSet::with_capacity(self.concurrency), - task_names, + tasks: &tasks, }; let mut queue = futures_unordered::FuturesUnordered::new(); while context.has_remaining_tasks() { while queue.len() < self.concurrency { - if let Some(task) = context.get_next_task(self, tasks_config) { + if let Some(task) = context.get_next_task(self) { queue.push(task); } else { break; @@ -393,7 +388,7 @@ impl<'a> TaskRunner<'a> { // If queue is empty at this point, then there are no more tasks in the queue. let Some(result) = queue.next().await else { - debug_assert_eq!(context.task_names.len(), 0); + debug_assert_eq!(context.tasks.len(), 0); break; }; @@ -521,46 +516,105 @@ enum TaskError { TaskDepCycle { path: Vec }, } -fn sort_tasks_topo( - pkg_task_config: &PackageTaskInfo, -) -> Result, TaskError> { +struct ResolvedTask<'a> { + id: usize, + name: &'a str, + folder_url: &'a Url, + task_or_script: TaskOrScript<'a>, + dependencies: Vec, +} + +fn sort_tasks_topo<'a>( + pkg_task_config: &'a PackageTaskInfo, +) -> Result>, TaskError> { + trait TasksConfig { + fn task( + &self, + name: &str, + ) -> Option<(&Url, TaskOrScript, &dyn TasksConfig)>; + } + + impl TasksConfig for WorkspaceTasksConfig { + fn task( + &self, + name: &str, + ) -> Option<(&Url, TaskOrScript, &dyn TasksConfig)> { + if let Some(member) = &self.member { + if let Some((dir_url, task_or_script)) = member.task(name) { + return Some((dir_url, task_or_script, self as &dyn TasksConfig)); + } + } + if let Some(root) = &self.root { + if let Some((dir_url, task_or_script)) = root.task(name) { + // switch to only using the root tasks for the dependencies + return Some((dir_url, task_or_script, root as &dyn TasksConfig)); + } + } + None + } + } + + impl TasksConfig for WorkspaceMemberTasksConfig { + fn task( + &self, + name: &str, + ) -> Option<(&Url, TaskOrScript, &dyn TasksConfig)> { + self.task(name).map(|(dir_url, task_or_script)| { + (dir_url, task_or_script, self as &dyn TasksConfig) + }) + } + } + fn sort_visit<'a>( name: &'a str, - sorted: &mut Vec, - mut path: Vec<&'a str>, - tasks_config: &'a WorkspaceTasksConfig, - ) -> Result<(), TaskError> { - // Already sorted - if sorted.iter().any(|sorted_name| sorted_name == name) { - return Ok(()); - } - - // Graph has a cycle - if path.contains(&name) { - path.push(name); - return Err(TaskError::TaskDepCycle { - path: path.iter().map(|s| s.to_string()).collect(), - }); - } - - let Some((_, task_or_script)) = tasks_config.task(name) else { + sorted: &mut Vec>, + mut path: Vec<(&'a Url, &'a str)>, + tasks_config: &'a dyn TasksConfig, + ) -> Result { + let Some((folder_url, task_or_script, tasks_config)) = + tasks_config.task(name) + else { return Err(TaskError::NotFound(name.to_string())); }; + if let Some(existing_task) = sorted + .iter() + .find(|task| task.name == name && task.folder_url == folder_url) + { + // already exists + return Ok(existing_task.id); + } + + if path.contains(&(folder_url, name)) { + path.push((folder_url, name)); + return Err(TaskError::TaskDepCycle { + path: path.iter().map(|(_, s)| s.to_string()).collect(), + }); + } + + let mut dependencies: Vec = Vec::new(); if let TaskOrScript::Task(_, task) = task_or_script { + dependencies.reserve(task.dependencies.len()); for dep in &task.dependencies { let mut path = path.clone(); - path.push(name); - sort_visit(dep, sorted, path, tasks_config)? + path.push((folder_url, name)); + dependencies.push(sort_visit(dep, sorted, path, tasks_config)?); } } - sorted.push(name.to_string()); + let id = sorted.len(); + sorted.push(ResolvedTask { + id, + name, + folder_url, + task_or_script, + dependencies, + }); - Ok(()) + Ok(id) } - let mut sorted: Vec = vec![]; + let mut sorted: Vec> = vec![]; for name in &pkg_task_config.matched_tasks { sort_visit(name, &mut sorted, Vec::new(), &pkg_task_config.tasks_config)?; diff --git a/tests/specs/task/dependencies_root_not_cycle/__test__.jsonc b/tests/specs/task/dependencies_root_not_cycle/__test__.jsonc new file mode 100644 index 0000000000..0732103582 --- /dev/null +++ b/tests/specs/task/dependencies_root_not_cycle/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "task a", + "cwd": "member", + "output": "task.out" +} diff --git a/tests/specs/task/dependencies_root_not_cycle/deno.json b/tests/specs/task/dependencies_root_not_cycle/deno.json new file mode 100644 index 0000000000..43a4952f93 --- /dev/null +++ b/tests/specs/task/dependencies_root_not_cycle/deno.json @@ -0,0 +1,10 @@ +{ + "tasks": { + "a": "echo root-a", + "b": { + "dependencies": ["a"], + "command": "echo b" + } + }, + "workspace": ["./member"] +} diff --git a/tests/specs/task/dependencies_root_not_cycle/member/deno.json b/tests/specs/task/dependencies_root_not_cycle/member/deno.json new file mode 100644 index 0000000000..08c3493c73 --- /dev/null +++ b/tests/specs/task/dependencies_root_not_cycle/member/deno.json @@ -0,0 +1,8 @@ +{ + "tasks": { + "a": { + "dependencies": ["b"], + "command": "echo a" + } + } +} diff --git a/tests/specs/task/dependencies_root_not_cycle/task.out b/tests/specs/task/dependencies_root_not_cycle/task.out new file mode 100644 index 0000000000..0194f31e4e --- /dev/null +++ b/tests/specs/task/dependencies_root_not_cycle/task.out @@ -0,0 +1,6 @@ +Task a echo root-a +root-a +Task b echo b +b +Task a echo a +a diff --git a/tests/specs/task/dependencies_shadowed_root_name/__test__.jsonc b/tests/specs/task/dependencies_shadowed_root_name/__test__.jsonc new file mode 100644 index 0000000000..9d3d50582c --- /dev/null +++ b/tests/specs/task/dependencies_shadowed_root_name/__test__.jsonc @@ -0,0 +1,14 @@ +{ + "tests": { + "root_dependending_root": { + "args": "task root-depending-root", + "cwd": "member", + "output": "root_dependending_root.out" + }, + "member_depending_root_and_member": { + "args": "task member-dependending-root-and-member", + "cwd": "member", + "output": "member_depending_root_and_member.out" + } + } +} diff --git a/tests/specs/task/dependencies_shadowed_root_name/deno.jsonc b/tests/specs/task/dependencies_shadowed_root_name/deno.jsonc new file mode 100644 index 0000000000..88f0ee4e9e --- /dev/null +++ b/tests/specs/task/dependencies_shadowed_root_name/deno.jsonc @@ -0,0 +1,12 @@ +{ + "tasks": { + "build": "echo root", + "root-depending-root": { + "dependencies": [ + "build" + ], + "command": "echo test" + } + }, + "workspace": ["./member"] +} diff --git a/tests/specs/task/dependencies_shadowed_root_name/member/deno.jsonc b/tests/specs/task/dependencies_shadowed_root_name/member/deno.jsonc new file mode 100644 index 0000000000..df5ac047a3 --- /dev/null +++ b/tests/specs/task/dependencies_shadowed_root_name/member/deno.jsonc @@ -0,0 +1,12 @@ +{ + "tasks": { + "build": "echo member", + "member-dependending-root-and-member": { + "dependencies": [ + "build", + "root-depending-root" + ], + "command": "echo member-test" + } + } +} diff --git a/tests/specs/task/dependencies_shadowed_root_name/member_depending_root_and_member.out b/tests/specs/task/dependencies_shadowed_root_name/member_depending_root_and_member.out new file mode 100644 index 0000000000..3b6fd0e0a4 --- /dev/null +++ b/tests/specs/task/dependencies_shadowed_root_name/member_depending_root_and_member.out @@ -0,0 +1,10 @@ +[UNORDERED_START] +Task build echo member +member +Task build echo root +root +Task root-depending-root echo test +test +[UNORDERED_END] +Task member-dependending-root-and-member echo member-test +member-test diff --git a/tests/specs/task/dependencies_shadowed_root_name/root_dependending_root.out b/tests/specs/task/dependencies_shadowed_root_name/root_dependending_root.out new file mode 100644 index 0000000000..2b8d9d5efe --- /dev/null +++ b/tests/specs/task/dependencies_shadowed_root_name/root_dependending_root.out @@ -0,0 +1,4 @@ +Task build echo root +root +Task root-depending-root echo test +test From 3f3568bd95aac366bd03044850dd7d2c6d013ea7 Mon Sep 17 00:00:00 2001 From: Cornelius Krassow <58032399+ckrassow@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:54:20 +0100 Subject: [PATCH 131/227] fix(cli): Fix typo in doc subcommand help output (#26321) --- cli/args/flags.rs | 2 +- tests/integration/flags_tests.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/args/flags.rs b/cli/args/flags.rs index f6d53cd15e..d8ab46b654 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -1232,7 +1232,7 @@ static DENO_HELP: &str = cstr!( compile Compile the script into a self contained executable deno compile main.ts | deno compile --target=x86_64-unknown-linux-gnu coverage Print coverage reports - doc Genereate and show documentation for a module or built-ins + doc Generate and show documentation for a module or built-ins deno doc | deno doc --json | deno doc --html mod.ts fmt Format source files deno fmt | deno fmt main.ts diff --git a/tests/integration/flags_tests.rs b/tests/integration/flags_tests.rs index 663da363da..e233ca5baf 100644 --- a/tests/integration/flags_tests.rs +++ b/tests/integration/flags_tests.rs @@ -24,7 +24,7 @@ fn help_output() { "Type-check the dependencies", "Compile the script into a self contained executable", "Print coverage reports", - "Genereate and show documentation for a module or built-ins", + "Generate and show documentation for a module or built-ins", "Format source files", "Show info about cache or info related to source file", "Deno kernel for Jupyter notebooks", From aa0ba6580eeb8045433d3eeffc19fc14a36f0361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 21 Nov 2024 16:27:37 +0000 Subject: [PATCH 132/227] fix: Buffer global in --unstable-node-globals (#26973) --- runtime/js/98_global_scope_shared.js | 2 +- tests/specs/run/unstable/node_globals.out | 8 +++++++- tests/specs/run/unstable/node_globals.ts | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/runtime/js/98_global_scope_shared.js b/runtime/js/98_global_scope_shared.js index f8e76b7ce7..c01bde6fad 100644 --- a/runtime/js/98_global_scope_shared.js +++ b/runtime/js/98_global_scope_shared.js @@ -32,7 +32,7 @@ import { DOMException } from "ext:deno_web/01_dom_exception.js"; import * as abortSignal from "ext:deno_web/03_abort_signal.js"; import * as imageData from "ext:deno_web/16_image_data.js"; import process from "node:process"; -import Buffer from "node:buffer"; +import { Buffer } from "node:buffer"; import { clearImmediate, setImmediate } from "node:timers"; import { loadWebGPU } from "ext:deno_webgpu/00_init.js"; import * as webgpuSurface from "ext:deno_webgpu/02_surface.js"; diff --git a/tests/specs/run/unstable/node_globals.out b/tests/specs/run/unstable/node_globals.out index 77045c7cbd..8262ace271 100644 --- a/tests/specs/run/unstable/node_globals.out +++ b/tests/specs/run/unstable/node_globals.out @@ -1,4 +1,10 @@ global: true -Buffer: true +Buffer: function from( + value, + encodingOrOffset, + length, +) { + return _from(value, encodingOrOffset, length); +} setImmediate: true clearImmediate: true diff --git a/tests/specs/run/unstable/node_globals.ts b/tests/specs/run/unstable/node_globals.ts index 706b7eb654..3a000ea341 100644 --- a/tests/specs/run/unstable/node_globals.ts +++ b/tests/specs/run/unstable/node_globals.ts @@ -2,6 +2,6 @@ import * as nodeBuffer from "node:buffer"; import * as nodeTimers from "node:timers"; console.log(`global: ${globalThis === global}`); -console.log(`Buffer: ${Buffer === nodeBuffer.default}`); +console.log(`Buffer: ${Buffer.from}`); console.log(`setImmediate: ${setImmediate === nodeTimers.setImmediate}`); console.log(`clearImmediate: ${clearImmediate === nodeTimers.clearImmediate}`); From bfa9230d3b92115f73854339da972881c0d41e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 21 Nov 2024 16:29:40 +0000 Subject: [PATCH 133/227] fix(watch): don't panic if there's no path provided (#26972) Closes https://github.com/denoland/deno/issues/26970 --- cli/util/file_watcher.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cli/util/file_watcher.rs b/cli/util/file_watcher.rs index eb3fb8c602..b9318a6e4b 100644 --- a/cli/util/file_watcher.rs +++ b/cli/util/file_watcher.rs @@ -185,9 +185,11 @@ impl WatcherCommunicator { pub fn show_path_changed(&self, changed_paths: Option>) { if let Some(paths) = changed_paths { - self.print( - format!("Restarting! File change detected: {:?}", paths[0]).to_string(), - ) + if !paths.is_empty() { + self.print(format!("Restarting! File change detected: {:?}", paths[0])) + } else { + self.print("Restarting! File change detected.".to_string()) + } } } } From 75f8164b043339bf4883774dad29250c46201df2 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Thu, 21 Nov 2024 17:30:07 +0100 Subject: [PATCH 134/227] chore: update url + idna (#26963) They were pinned to old versions. This commit removes the pin. --- Cargo.lock | 219 +++++++++++++++++-- Cargo.toml | 3 +- ext/node/Cargo.toml | 2 +- tests/specs/doc/invalid_url/invalid_url.out | 2 +- tests/wpt/runner/expectation.json | 229 +------------------- 5 files changed, 215 insertions(+), 240 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bf6d3a3714..5ca7f30c94 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1911,7 +1911,7 @@ dependencies = [ "http-body-util", "hyper 1.4.1", "hyper-util", - "idna 0.3.0", + "idna 1.0.3", "indexmap 2.3.0", "ipnetwork", "k256", @@ -3982,22 +3982,130 @@ dependencies = [ "tracing", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "ident_case" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.4.0" @@ -4008,6 +4116,27 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + [[package]] name = "if_chain" version = "1.0.2" @@ -4477,6 +4606,12 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "litrs" version = "0.4.1" @@ -7636,6 +7771,16 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -8048,12 +8193,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.1" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" dependencies = [ "form_urlencoded", - "idna 0.4.0", + "idna 1.0.3", "percent-encoding", "serde", ] @@ -8076,12 +8221,24 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + [[package]] name = "utf8-width" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.1" @@ -8690,6 +8847,18 @@ version = "0.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wtf8" version = "0.1.0" @@ -8880,6 +9049,28 @@ dependencies = [ "uuid", ] +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "zip" version = "2.1.6" diff --git a/Cargo.toml b/Cargo.toml index 5f66c0d44d..d1e958fe1b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -200,8 +200,7 @@ tower-http = { version = "0.6.1", features = ["decompression-br", "decompression tower-lsp = { package = "deno_tower_lsp", version = "0.1.0", features = ["proposed"] } tower-service = "0.3.2" twox-hash = "=1.6.3" -# Upgrading past 2.4.1 may cause WPT failures -url = { version = "< 2.5.0", features = ["serde", "expose_internals"] } +url = { version = "2.5", features = ["serde", "expose_internals"] } uuid = { version = "1.3.0", features = ["v4"] } webpki-root-certs = "0.26.5" webpki-roots = "0.26" diff --git a/ext/node/Cargo.toml b/ext/node/Cargo.toml index 3502d3b5f8..e1650282c2 100644 --- a/ext/node/Cargo.toml +++ b/ext/node/Cargo.toml @@ -54,7 +54,7 @@ http.workspace = true http-body-util.workspace = true hyper.workspace = true hyper-util.workspace = true -idna = "0.3.0" +idna = "1.0.3" indexmap.workspace = true ipnetwork = "0.20.0" k256 = "0.13.1" diff --git a/tests/specs/doc/invalid_url/invalid_url.out b/tests/specs/doc/invalid_url/invalid_url.out index 038c53177a..17974318c7 100644 --- a/tests/specs/doc/invalid_url/invalid_url.out +++ b/tests/specs/doc/invalid_url/invalid_url.out @@ -1,4 +1,4 @@ error: Invalid URL 'https://raw.githubusercontent.com%2Fdyedgreen%2Fdeno-sqlite%2Frework_api%2Fmod.ts' Caused by: - invalid domain character + invalid international domain name diff --git a/tests/wpt/runner/expectation.json b/tests/wpt/runner/expectation.json index 23cc85b498..1a7cb8c560 100644 --- a/tests/wpt/runner/expectation.json +++ b/tests/wpt/runner/expectation.json @@ -3741,18 +3741,12 @@ "ab--c.ß (using .hostname)", "ab--c.ß (using .host)", "ab--c.ß (using .hostname)", - "‍.example (using URL)", - "‍.example (using URL.host)", - "‍.example (using URL.hostname)", "‍.example (using )", "‍.example (using .host)", "‍.example (using .hostname)", "‍.example (using )", "‍.example (using .host)", "‍.example (using .hostname)", - "xn--1ug.example (using URL)", - "xn--1ug.example (using URL.host)", - "xn--1ug.example (using URL.hostname)", "xn--1ug.example (using )", "xn--1ug.example (using .host)", "xn--1ug.example (using .hostname)", @@ -3874,18 +3868,8 @@ ], "url-searchparams.any.html": true, "url-searchparams.any.worker.html": true, - "url-setters-stripping.any.html": [ - "Setting port with leading U+0000 (https:)", - "Setting port with leading U+001F (https:)", - "Setting port with leading U+0000 (wpt++:)", - "Setting port with leading U+001F (wpt++:)" - ], - "url-setters-stripping.any.worker.html": [ - "Setting port with leading U+0000 (https:)", - "Setting port with leading U+001F (https:)", - "Setting port with leading U+0000 (wpt++:)", - "Setting port with leading U+001F (wpt++:)" - ], + "url-setters-stripping.any.html": true, + "url-setters-stripping.any.worker.html": true, "url-tojson.any.html": true, "url-tojson.any.worker.html": true, "urlencoded-parser.any.html": true, @@ -3894,12 +3878,8 @@ "urlsearchparams-append.any.worker.html": true, "urlsearchparams-constructor.any.html": true, "urlsearchparams-constructor.any.worker.html": true, - "urlsearchparams-delete.any.html": [ - "Changing the query of a URL with an opaque path can impact the path if the URL has no fragment" - ], - "urlsearchparams-delete.any.worker.html": [ - "Changing the query of a URL with an opaque path can impact the path if the URL has no fragment" - ], + "urlsearchparams-delete.any.html": true, + "urlsearchparams-delete.any.worker.html": true, "urlsearchparams-foreach.any.html": true, "urlsearchparams-foreach.any.worker.html": true, "urlsearchparams-get.any.html": true, @@ -3932,182 +3912,7 @@ "Input − with encoding utf-8", "Input á| with encoding utf-8" ], - "IdnaTestV2.window.html": [ - "ToASCII(\"a‌b\") C1", - "ToASCII(\"A‌B\") C1", - "ToASCII(\"A‌b\") C1", - "ToASCII(\"xn--ab-j1t\") C1", - "ToASCII(\"a‍b\") C2", - "ToASCII(\"A‍B\") C2", - "ToASCII(\"A‍b\") C2", - "ToASCII(\"xn--ab-m1t\") C2", - "ToASCII(\"1.aß‌‍b‌‍cßßßßdςσßßßßßßßßeßßßßßßßßßßxßßßßßßßßßßyßßßßßßßß̂ßz\") C1; C2; A4_2 (ignored)", - "ToASCII(\"1.ASS‌‍B‌‍CSSSSSSSSDΣΣSSSSSSSSSSSSSSSSESSSSSSSSSSSSSSSSSSSSXSSSSSSSSSSSSSSSSSSSSYSSSSSSSSSSSSSSSŜSSZ\") C1; C2; A4_2 (ignored)", - "ToASCII(\"1.ASS‌‍B‌‍CSSSSSSSSDΣΣSSSSSSSSSSSSSSSSESSSSSSSSSSSSSSSSSSSSXSSSSSSSSSSSSSSSSSSSSYSSSSSSSSSSSSSSSŜSSZ\") C1; C2; A4_2 (ignored)", - "ToASCII(\"1.ass‌‍b‌‍cssssssssdσσssssssssssssssssessssssssssssssssssssxssssssssssssssssssssysssssssssssssssŝssz\") C1; C2; A4_2 (ignored)", - "ToASCII(\"1.ass‌‍b‌‍cssssssssdσσssssssssssssssssessssssssssssssssssssxssssssssssssssssssssysssssssssssssssŝssz\") C1; C2; A4_2 (ignored)", - "ToASCII(\"1.Ass‌‍b‌‍cssssssssdσσssssssssssssssssessssssssssssssssssssxssssssssssssssssssssysssssssssssssssŝssz\") C1; C2; A4_2 (ignored)", - "ToASCII(\"1.Ass‌‍b‌‍cssssssssdσσssssssssssssssssessssssssssssssssssssxssssssssssssssssssssysssssssssssssssŝssz\") C1; C2; A4_2 (ignored)", - "ToASCII(\"1.xn--assbcssssssssdssssssssssssssssessssssssssssssssssssxssssssssssssssssssssysssssssssssssssssz-pxq1419aa69989dba9gc\") C1; C2; A4_2 (ignored)", - "ToASCII(\"1.Aß‌‍b‌‍cßßßßdςσßßßßßßßßeßßßßßßßßßßxßßßßßßßßßßyßßßßßßßß̂ßz\") C1; C2; A4_2 (ignored)", - "ToASCII(\"1.xn--abcdexyz-qyacaaabaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaa010ze2isb1140zba8cc\") C1; C2; A4_2 (ignored)", - "ToASCII(\"‌x‍n‌-‍-bß\") C1; C2", - "ToASCII(\"‌X‍N‌-‍-BSS\") C1; C2", - "ToASCII(\"‌x‍n‌-‍-bss\") C1; C2", - "ToASCII(\"‌X‍n‌-‍-Bss\") C1; C2", - "ToASCII(\"xn--xn--bss-7z6ccid\") C1; C2", - "ToASCII(\"‌X‍n‌-‍-Bß\") C1; C2", - "ToASCII(\"xn--xn--b-pqa5796ccahd\") C1; C2", - "ToASCII(\"ஹ‍\") C2", - "ToASCII(\"xn--dmc225h\") C2", - "ToASCII(\"‍\") C2", - "ToASCII(\"xn--1ug\") C2", - "ToASCII(\"ஹ‌\") C1", - "ToASCII(\"xn--dmc025h\") C1", - "ToASCII(\"‌\") C1", - "ToASCII(\"xn--0ug\") C1", - "ToASCII(\"ۯ‌ۯ\") C1", - "ToASCII(\"xn--cmba004q\") C1", - "ToASCII(\"ß۫。‍\") C2", - "ToASCII(\"SS۫。‍\") C2", - "ToASCII(\"ss۫。‍\") C2", - "ToASCII(\"Ss۫。‍\") C2", - "ToASCII(\"xn--ss-59d.xn--1ug\") C2", - "ToASCII(\"xn--zca012a.xn--1ug\") C2", - "ToASCII(\"‌긃.榶-\") C1; V3 (ignored)", - "ToASCII(\"‌긃.榶-\") C1; V3 (ignored)", - "ToASCII(\"xn--0ug3307c.xn----d87b\") C1; V3 (ignored)", - "ToASCII(\"Å둄-.‌\") C1; V3 (ignored)", - "ToASCII(\"Å둄-.‌\") C1; V3 (ignored)", - "ToASCII(\"Å둄-.‌\") C1; V3 (ignored)", - "ToASCII(\"Å둄-.‌\") C1; V3 (ignored)", - "ToASCII(\"å둄-.‌\") C1; V3 (ignored)", - "ToASCII(\"å둄-.‌\") C1; V3 (ignored)", - "ToASCII(\"xn----1fa1788k.xn--0ug\") C1; V3 (ignored)", - "ToASCII(\"å둄-.‌\") C1; V3 (ignored)", - "ToASCII(\"å둄-.‌\") C1; V3 (ignored)", - "ToASCII(\"ꡦᡑ‍1.。𐋣-\") C2; V3 (ignored); A4_2 (ignored)", - "ToASCII(\"xn--1-o7j663bdl7m..xn----381i\") C2; V3 (ignored); A4_2 (ignored)", - "ToASCII(\"1.䰹‍-。웈\") C2; V3 (ignored)", - "ToASCII(\"1.䰹‍-。웈\") C2; V3 (ignored)", - "ToASCII(\"1.xn----tgnz80r.xn--kp5b\") C2; V3 (ignored)", - "ToASCII(\"-3.‍ヌᢕ\") C2; V3 (ignored)", - "ToASCII(\"-3.xn--fbf739aq5o\") C2; V3 (ignored)", - "ToASCII(\"ς-。‌𝟭-\") C1; V3 (ignored)", - "ToASCII(\"ς-。‌1-\") C1; V3 (ignored)", - "ToASCII(\"Σ-。‌1-\") C1; V3 (ignored)", - "ToASCII(\"σ-。‌1-\") C1; V3 (ignored)", - "ToASCII(\"xn----zmb.xn--1--i1t\") C1; V3 (ignored)", - "ToASCII(\"xn----xmb.xn--1--i1t\") C1; V3 (ignored)", - "ToASCII(\"Σ-。‌𝟭-\") C1; V3 (ignored)", - "ToASCII(\"σ-。‌𝟭-\") C1; V3 (ignored)", - "ToASCII(\"ᡯ⚉姶🄉.۷‍🎪‍\") C2; P1; V6", - "ToASCII(\"𝟵隁⯮.᠍‌\") C1", - "ToASCII(\"9隁⯮.᠍‌\") C1", - "ToASCII(\"xn--9-mfs8024b.xn--0ug\") C1", - "ToASCII(\"ß‌꫶ᢥ.⊶ⴡⴖ\") C1", - "ToASCII(\"ss‌꫶ᢥ.⊶ⴡⴖ\") C1", - "ToASCII(\"xn--ss-4ep585bkm5p.xn--ifh802b6a\") C1", - "ToASCII(\"xn--zca682johfi89m.xn--ifh802b6a\") C1", - "ToASCII(\"ß‌꫶ᢥ.⊶ⴡⴖ\") C1", - "ToASCII(\"ss‌꫶ᢥ.⊶ⴡⴖ\") C1", - "ToASCII(\"-。‍\") C2; V3 (ignored)", - "ToASCII(\"-。‍\") C2; V3 (ignored)", - "ToASCII(\"-.xn--1ug\") C2; V3 (ignored)", - "ToASCII(\"ς‍-.ⴣ𦟙\") C2; V3 (ignored)", - "ToASCII(\"σ‍-.ⴣ𦟙\") C2; V3 (ignored)", - "ToASCII(\"xn----zmb048s.xn--rlj2573p\") C2; V3 (ignored)", - "ToASCII(\"xn----xmb348s.xn--rlj2573p\") C2; V3 (ignored)", - "ToASCII(\"鱊。‌\") C1", - "ToASCII(\"xn--rt6a.xn--0ug\") C1", - "ToASCII(\"‌ⴚ。ς\") C1", - "ToASCII(\"‌ⴚ。σ\") C1", - "ToASCII(\"xn--0ug262c.xn--4xa\") C1", - "ToASCII(\"xn--0ug262c.xn--3xa\") C1", - "ToASCII(\"‌ⴚ。ς\") C1", - "ToASCII(\"‌ⴚ。σ\") C1", - "ToASCII(\"‍⾕。‌꥓̐ꡎ\") C1; C2", - "ToASCII(\"‍⾕。‌꥓̐ꡎ\") C1; C2", - "ToASCII(\"‍谷。‌꥓̐ꡎ\") C1; C2", - "ToASCII(\"xn--1ug0273b.xn--0sa359l6n7g13a\") C1; C2", - "ToASCII(\"‍。‌\") C1; C2", - "ToASCII(\"xn--1ug.xn--0ug\") C1; C2", - "ToASCII(\"‌。。\") C1; A4_2 (ignored)", - "ToASCII(\"xn--0ug..\") C1; A4_2 (ignored)", - "ToASCII(\"ᡲ-𝟹.ß-‌-\") C1; V3 (ignored)", - "ToASCII(\"ᡲ-3.ß-‌-\") C1; V3 (ignored)", - "ToASCII(\"ᡲ-3.SS-‌-\") C1; V3 (ignored)", - "ToASCII(\"ᡲ-3.ss-‌-\") C1; V3 (ignored)", - "ToASCII(\"ᡲ-3.Ss-‌-\") C1; V3 (ignored)", - "ToASCII(\"xn---3-p9o.xn--ss---276a\") C1; V3 (ignored)", - "ToASCII(\"xn---3-p9o.xn-----fia9303a\") C1; V3 (ignored)", - "ToASCII(\"ᡲ-𝟹.SS-‌-\") C1; V3 (ignored)", - "ToASCII(\"ᡲ-𝟹.ss-‌-\") C1; V3 (ignored)", - "ToASCII(\"ᡲ-𝟹.Ss-‌-\") C1; V3 (ignored)", - "ToASCII(\"𝟙。‍𝟸‍⁷\") C2", - "ToASCII(\"1。‍2‍7\") C2", - "ToASCII(\"1.xn--27-l1tb\") C2", - "ToASCII(\"‌.ßⴉ-\") C1; V3 (ignored)", - "ToASCII(\"‌.ssⴉ-\") C1; V3 (ignored)", - "ToASCII(\"‌.Ssⴉ-\") C1; V3 (ignored)", - "ToASCII(\"xn--0ug.xn--ss--bi1b\") C1; V3 (ignored)", - "ToASCII(\"xn--0ug.xn----pfa2305a\") C1; V3 (ignored)", - "ToASCII(\"ⴏ󠅋-.‍ⴉ\") C2; V3 (ignored)", - "ToASCII(\"xn----3vs.xn--1ug532c\") C2; V3 (ignored)", - "ToASCII(\"ⴏ󠅋-.‍ⴉ\") C2; V3 (ignored)", - "ToASCII(\"。ⴖͦ.‌\") C1; A4_2 (ignored)", - "ToASCII(\".xn--hva754s.xn--0ug\") C1; A4_2 (ignored)", - "ToASCII(\"‍攌꯭。ᢖ-ⴘ\") C2", - "ToASCII(\"xn--1ug592ykp6b.xn----mck373i\") C2", - "ToASCII(\"‌ꖨ.16.3툒۳\") C1", - "ToASCII(\"‌ꖨ.16.3툒۳\") C1", - "ToASCII(\"xn--0ug2473c.16.xn--3-nyc0117m\") C1", - "ToASCII(\"𝟏𝨙⸖.‍\") C2", - "ToASCII(\"1𝨙⸖.‍\") C2", - "ToASCII(\"xn--1-5bt6845n.xn--1ug\") C2", - "ToASCII(\"-‍.ⴞ𐋷\") C2; V3 (ignored)", - "ToASCII(\"xn----ugn.xn--mlj8559d\") C2; V3 (ignored)", - "ToASCII(\"嬃𝍌.‍ୄ\") C2", - "ToASCII(\"嬃𝍌.‍ୄ\") C2", - "ToASCII(\"xn--b6s0078f.xn--0ic557h\") C2", - "ToASCII(\"‍.F\") C2", - "ToASCII(\"‍.f\") C2", - "ToASCII(\"xn--1ug.f\") C2", - "ToASCII(\"‍㨲。ß\") C2", - "ToASCII(\"‍㨲。ß\") C2", - "ToASCII(\"‍㨲。SS\") C2", - "ToASCII(\"‍㨲。ss\") C2", - "ToASCII(\"‍㨲。Ss\") C2", - "ToASCII(\"xn--1ug914h.ss\") C2", - "ToASCII(\"xn--1ug914h.xn--zca\") C2", - "ToASCII(\"‍㨲。SS\") C2", - "ToASCII(\"‍㨲。ss\") C2", - "ToASCII(\"‍㨲。Ss\") C2", - "ToASCII(\"璼𝨭。‌󠇟\") C1", - "ToASCII(\"璼𝨭。‌󠇟\") C1", - "ToASCII(\"xn--gky8837e.xn--0ug\") C1", - "ToASCII(\"‌.‌\") C1", - "ToASCII(\"xn--0ug.xn--0ug\") C1", - "ToASCII(\"𝟠4󠇗𝈻.‍𐋵⛧‍\") C2", - "ToASCII(\"84󠇗𝈻.‍𐋵⛧‍\") C2", - "ToASCII(\"xn--84-s850a.xn--1uga573cfq1w\") C2", - "ToASCII(\"‍‌󠆪。ß𑓃\") C1; C2", - "ToASCII(\"‍‌󠆪。ß𑓃\") C1; C2", - "ToASCII(\"‍‌󠆪。SS𑓃\") C1; C2", - "ToASCII(\"‍‌󠆪。ss𑓃\") C1; C2", - "ToASCII(\"‍‌󠆪。Ss𑓃\") C1; C2", - "ToASCII(\"xn--0ugb.xn--ss-bh7o\") C1; C2", - "ToASCII(\"xn--0ugb.xn--zca0732l\") C1; C2", - "ToASCII(\"‍‌󠆪。SS𑓃\") C1; C2", - "ToASCII(\"‍‌󠆪。ss𑓃\") C1; C2", - "ToASCII(\"‍‌󠆪。Ss𑓃\") C1; C2", - "ToASCII(\"。‌ヶ䒩.ꡪ\") C1; A4_2 (ignored)", - "ToASCII(\".xn--0ug287dj0o.xn--gd9a\") C1; A4_2 (ignored)", - "ToASCII(\"梉。‌\") C1", - "ToASCII(\"xn--7zv.xn--0ug\") C1", - "ToASCII(\"𐋷。‍\") C2", - "ToASCII(\"xn--r97c.xn--1ug\") C2" - ], + "IdnaTestV2.window.html": true, "javascript-urls.window.html": false, "url-constructor.any.html?exclude=(file|javascript|mailto)": [ "Parsing: without base", @@ -4760,21 +4565,11 @@ ": Setting .pathname = '/foo' Opaque paths cannot be set" ], "url-setters.any.html?exclude=(file|javascript|mailto)": [ - "URL: Setting .host = 'example.com:invalid' Anything other than ASCII digit stops the port parser in a setter but is not an error", - "URL: Setting .host = '[::1]:invalid' Anything other than ASCII digit stops the port parser in a setter but is not an error", "URL: Setting .hostname = 'example.com:8080' : delimiter invalidates entire value", "URL: Setting .hostname = 'example.com:' : delimiter invalidates entire value", "URL: Setting .hostname = 'h' Drop /. from path", "URL: Setting .hostname = ''", - "URL: Setting .port = 'randomstring' Setting port to a string that doesn't parse as a number", - "URL: Setting .pathname = '' Non-special URLs can have their paths erased", - "URL: Setting .pathname = '' Non-special URLs with an empty host can have their paths erased", - "URL: Setting .pathname = '/.//p' Serialize /. in path", - "URL: Setting .pathname = '/..//p'", - "URL: Setting .pathname = '//p'", - "URL: Setting .pathname = 'p' Drop /. from path", - "URL: Setting .search = '' Do not drop trailing spaces from non-trailing opaque paths", - "URL: Setting .search = ''" + "URL: Setting .pathname = '' Non-special URLs with an empty host can have their paths erased" ], "url-setters.any.html?include=file": [ "URL: Setting .pathname = '\\\\' File URLs and (back)slashes", @@ -4784,21 +4579,11 @@ "url-setters.any.html?include=javascript": true, "url-setters.any.html?include=mailto": true, "url-setters.any.worker.html?exclude=(file|javascript|mailto)": [ - "URL: Setting .host = 'example.com:invalid' Anything other than ASCII digit stops the port parser in a setter but is not an error", - "URL: Setting .host = '[::1]:invalid' Anything other than ASCII digit stops the port parser in a setter but is not an error", "URL: Setting .hostname = 'example.com:8080' : delimiter invalidates entire value", "URL: Setting .hostname = 'example.com:' : delimiter invalidates entire value", "URL: Setting .hostname = 'h' Drop /. from path", "URL: Setting .hostname = ''", - "URL: Setting .port = 'randomstring' Setting port to a string that doesn't parse as a number", - "URL: Setting .pathname = '' Non-special URLs can have their paths erased", - "URL: Setting .pathname = '' Non-special URLs with an empty host can have their paths erased", - "URL: Setting .pathname = '/.//p' Serialize /. in path", - "URL: Setting .pathname = '/..//p'", - "URL: Setting .pathname = '//p'", - "URL: Setting .pathname = 'p' Drop /. from path", - "URL: Setting .search = '' Do not drop trailing spaces from non-trailing opaque paths", - "URL: Setting .search = ''" + "URL: Setting .pathname = '' Non-special URLs with an empty host can have their paths erased" ], "url-setters.any.worker.html?include=file": [ "URL: Setting .pathname = '\\\\' File URLs and (back)slashes", From 928808163816c69ac53ee4d56d2762a7f4c7312f Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 21 Nov 2024 11:37:10 -0500 Subject: [PATCH 135/227] fix(node): regression where ts files were sometimes resolved instead of js (#26971) --- ext/node/polyfills/01_require.js | 52 +++++++++++------- .../npm/pkg_index_ts_and_js/__test__.jsonc | 4 ++ tests/specs/npm/pkg_index_ts_and_js/index.js | 1 + .../node_modules/package/index.js | 3 + .../node_modules/package/json/index.js | 1 + .../node_modules/package/json/index.json | 1 + .../node_modules/package/package.json | 3 + .../node_modules/package/subdir/index.js | 1 + .../node_modules/package/subdir/index.ts | 1 + .../node_modules/package/wasm/index.js | 1 + .../node_modules/package/wasm/index.wasm | Bin 0 -> 318 bytes .../npm/pkg_index_ts_and_js/package.json | 5 ++ 12 files changed, 53 insertions(+), 20 deletions(-) create mode 100644 tests/specs/npm/pkg_index_ts_and_js/__test__.jsonc create mode 100644 tests/specs/npm/pkg_index_ts_and_js/index.js create mode 100644 tests/specs/npm/pkg_index_ts_and_js/node_modules/package/index.js create mode 100644 tests/specs/npm/pkg_index_ts_and_js/node_modules/package/json/index.js create mode 100644 tests/specs/npm/pkg_index_ts_and_js/node_modules/package/json/index.json create mode 100644 tests/specs/npm/pkg_index_ts_and_js/node_modules/package/package.json create mode 100644 tests/specs/npm/pkg_index_ts_and_js/node_modules/package/subdir/index.js create mode 100644 tests/specs/npm/pkg_index_ts_and_js/node_modules/package/subdir/index.ts create mode 100644 tests/specs/npm/pkg_index_ts_and_js/node_modules/package/wasm/index.js create mode 100644 tests/specs/npm/pkg_index_ts_and_js/node_modules/package/wasm/index.wasm create mode 100644 tests/specs/npm/pkg_index_ts_and_js/package.json diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js index db032014c2..df73cad6b7 100644 --- a/ext/node/polyfills/01_require.js +++ b/ext/node/polyfills/01_require.js @@ -1060,22 +1060,39 @@ Module.prototype._compile = function (content, filename, format) { return result; }; -Module._extensions[".js"] = - Module._extensions[".ts"] = - Module._extensions[".jsx"] = - Module._extensions[".tsx"] = - function (module, filename) { - const content = op_require_read_file(filename); - const format = op_require_is_maybe_cjs(filename) ? undefined : "module"; - module._compile(content, filename, format); - }; +Module._extensions[".js"] = function (module, filename) { + // We don't define everything on Module.extensions in + // order to prevent probing for these files + if ( + StringPrototypeEndsWith(filename, ".js") || + StringPrototypeEndsWith(filename, ".ts") || + StringPrototypeEndsWith(filename, ".jsx") || + StringPrototypeEndsWith(filename, ".tsx") + ) { + return loadMaybeCjs(module, filename); + } else if (StringPrototypeEndsWith(filename, ".mts")) { + return loadESMFromCJS(module, filename); + } else if (StringPrototypeEndsWith(filename, ".cts")) { + return loadCjs(module, filename); + } else { + return loadMaybeCjs(module, filename); + } +}; -Module._extensions[".cjs"] = - Module._extensions[".cts"] = - function (module, filename) { - const content = op_require_read_file(filename); - module._compile(content, filename, "commonjs"); - }; +Module._extensions[".cjs"] = loadCjs; +Module._extensions[".mjs"] = loadESMFromCJS; +Module._extensions[".wasm"] = loadESMFromCJS; + +function loadMaybeCjs(module, filename) { + const content = op_require_read_file(filename); + const format = op_require_is_maybe_cjs(filename) ? undefined : "module"; + module._compile(content, filename, format); +} + +function loadCjs(module, filename) { + const content = op_require_read_file(filename); + module._compile(content, filename, "commonjs"); +} function loadESMFromCJS(module, filename, code) { const namespace = op_import_sync( @@ -1086,11 +1103,6 @@ function loadESMFromCJS(module, filename, code) { module.exports = namespace; } -Module._extensions[".mjs"] = - Module._extensions[".mts"] = - Module._extensions[".wasm"] = - loadESMFromCJS; - function stripBOM(content) { if (StringPrototypeCharCodeAt(content, 0) === 0xfeff) { content = StringPrototypeSlice(content, 1); diff --git a/tests/specs/npm/pkg_index_ts_and_js/__test__.jsonc b/tests/specs/npm/pkg_index_ts_and_js/__test__.jsonc new file mode 100644 index 0000000000..689f6e1f41 --- /dev/null +++ b/tests/specs/npm/pkg_index_ts_and_js/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run index.js", + "output": "Hi\nWasm\nJSON\n" +} diff --git a/tests/specs/npm/pkg_index_ts_and_js/index.js b/tests/specs/npm/pkg_index_ts_and_js/index.js new file mode 100644 index 0000000000..c6ef1486e6 --- /dev/null +++ b/tests/specs/npm/pkg_index_ts_and_js/index.js @@ -0,0 +1 @@ +import "package"; diff --git a/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/index.js b/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/index.js new file mode 100644 index 0000000000..4c83afcf50 --- /dev/null +++ b/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/index.js @@ -0,0 +1,3 @@ +require("./subdir"); +require("./wasm"); +require("./json"); diff --git a/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/json/index.js b/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/json/index.js new file mode 100644 index 0000000000..e998adfbdc --- /dev/null +++ b/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/json/index.js @@ -0,0 +1 @@ +console.log("JSON"); \ No newline at end of file diff --git a/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/json/index.json b/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/json/index.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/json/index.json @@ -0,0 +1 @@ +{} diff --git a/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/package.json b/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/package.json new file mode 100644 index 0000000000..028ddbb95b --- /dev/null +++ b/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/package.json @@ -0,0 +1,3 @@ +{ + "name": "package" +} \ No newline at end of file diff --git a/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/subdir/index.js b/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/subdir/index.js new file mode 100644 index 0000000000..1b8b5ee92b --- /dev/null +++ b/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/subdir/index.js @@ -0,0 +1 @@ +console.log("Hi") \ No newline at end of file diff --git a/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/subdir/index.ts b/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/subdir/index.ts new file mode 100644 index 0000000000..e9cffd2de0 --- /dev/null +++ b/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/subdir/index.ts @@ -0,0 +1 @@ +console.log("No"); \ No newline at end of file diff --git a/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/wasm/index.js b/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/wasm/index.js new file mode 100644 index 0000000000..9174e5fd65 --- /dev/null +++ b/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/wasm/index.js @@ -0,0 +1 @@ +console.log("Wasm"); \ No newline at end of file diff --git a/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/wasm/index.wasm b/tests/specs/npm/pkg_index_ts_and_js/node_modules/package/wasm/index.wasm new file mode 100644 index 0000000000000000000000000000000000000000..6b3950fcc5297b78e0cdfddc5b91ac72505c7c94 GIT binary patch literal 318 zcmY+8%}#?r6ov1dfkMHg)tw6ymYPaKn^x-52XNyHj2F1lTK+OKM7yGo=A(%*F>&>s zoRfSxK&D0jKo4KVFyJ7i0B~IF5Yd$g^U1Xw@acU1f^dNU^d8(v&2_6!0wfg$fN%QD zYRWBOpj1JY6gP#$P^mprr!q1uMQ|xRh%kcpaO9YdA*4=2HA671$?lgQKey(;R{WEC zR|qqujHUdjy7tgm*6=*-bX)W}Ya{%MnzE;o(Rt~Og^O{@*%&V3?1Zi!yZmOg+$GB- zx=psLO}cyBrqMcCZ{j44*Q-0YpIOo+TlL0dd(B2HW_52Vt2i#JHlxZcd~+z9m_O|| D`Uz8u literal 0 HcmV?d00001 diff --git a/tests/specs/npm/pkg_index_ts_and_js/package.json b/tests/specs/npm/pkg_index_ts_and_js/package.json new file mode 100644 index 0000000000..f0b3ee21dd --- /dev/null +++ b/tests/specs/npm/pkg_index_ts_and_js/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "package": "*" + } +} From 566a6c2ce750d28c4ffe170017a64413296977fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 21 Nov 2024 16:56:46 +0000 Subject: [PATCH 136/227] fix(task): update --filter flag description (#26974) `--recursive` is now implied by `--filter`. --- cli/args/flags.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/args/flags.rs b/cli/args/flags.rs index d8ab46b654..3e48fa2909 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -3073,7 +3073,7 @@ Evaluate a task from string Arg::new("filter") .long("filter") .short('f') - .help("Filter members of the workspace by name - should be used with --recursive") + .help("Filter members of the workspace by name, implies --recursive flag") .value_parser(value_parser!(String)), ) .arg( From 6ee8efc5b4ba18348040bb8207f72b6c72353b94 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 21 Nov 2024 12:00:10 -0500 Subject: [PATCH 137/227] fix(install/global): do not error if path is an npm pkg and relative file (#26975) Closes https://github.com/denoland/deno/issues/26969 --- cli/tools/installer.rs | 31 ++++++++++-------- tests/registry/npm/cli.ts/registry.json | 32 +++++++++++++++++++ .../pkg_name_same_as_file/__test__.jsonc | 20 ++++++++++++ .../pkg_name_same_as_file/file_not_exists.out | 1 + 4 files changed, 70 insertions(+), 14 deletions(-) create mode 100644 tests/registry/npm/cli.ts/registry.json create mode 100644 tests/specs/install/global/pkg_name_same_as_file/__test__.jsonc create mode 100644 tests/specs/install/global/pkg_name_same_as_file/file_not_exists.out diff --git a/cli/tools/installer.rs b/cli/tools/installer.rs index fe477a8e6c..df5981e6e7 100644 --- a/cli/tools/installer.rs +++ b/cli/tools/installer.rs @@ -359,6 +359,7 @@ async fn install_global( // ensure the module is cached let factory = CliFactory::from_flags(flags.clone()); + let cli_options = factory.cli_options()?; let http_client = factory.http_client_provider(); let deps_http_cache = factory.global_http_cache()?; let mut deps_file_fetcher = FileFetcher::new( @@ -381,20 +382,22 @@ async fn install_global( )); let entry_text = install_flags_global.module_url.as_str(); - let req = super::registry::AddRmPackageReq::parse(entry_text); - - // found a package requirement but missing the prefix - if let Ok(Err(package_req)) = req { - if jsr_resolver.req_to_nv(&package_req).await.is_some() { - bail!( - "{entry_text} is missing a prefix. Did you mean `{}`?", - crate::colors::yellow(format!("deno install -g jsr:{package_req}")) - ); - } else if npm_resolver.req_to_nv(&package_req).await.is_some() { - bail!( - "{entry_text} is missing a prefix. Did you mean `{}`?", - crate::colors::yellow(format!("deno install -g npm:{package_req}")) - ); + if !cli_options.initial_cwd().join(entry_text).exists() { + // check for package requirement missing prefix + if let Ok(Err(package_req)) = + super::registry::AddRmPackageReq::parse(entry_text) + { + if jsr_resolver.req_to_nv(&package_req).await.is_some() { + bail!( + "{entry_text} is missing a prefix. Did you mean `{}`?", + crate::colors::yellow(format!("deno install -g jsr:{package_req}")) + ); + } else if npm_resolver.req_to_nv(&package_req).await.is_some() { + bail!( + "{entry_text} is missing a prefix. Did you mean `{}`?", + crate::colors::yellow(format!("deno install -g npm:{package_req}")) + ); + } } } diff --git a/tests/registry/npm/cli.ts/registry.json b/tests/registry/npm/cli.ts/registry.json new file mode 100644 index 0000000000..d58dc85378 --- /dev/null +++ b/tests/registry/npm/cli.ts/registry.json @@ -0,0 +1,32 @@ +{ + "name": "cli.ts", + "description": "Package with name like a file path", + "dist-tags": { + "latest": "2.2.0" + }, + "versions": { + "2.2.0": { + "name": "cli.ts", + "version": "2.2.0", + "description": "Package with name like a file path", + "license": "MIT", + "author": {}, + "engines": { + "node": ">=6" + }, + "gitHead": "91440c5a1615354fb9419354650937c434eb9f49", + "_id": "cli.ts@2.2.0", + "_nodeVersion": "10.16.0", + "_npmVersion": "6.9.0", + "dist": { + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "shasum": "ee8472dbb129e727b31e8a10a427dee9dfe4008b", + "tarball": "http://localhost:4260/cli.ts/cli.ts-2.2.0.tgz", + "fileCount": 5, + "unpackedSize": 5508 + }, + "directories": {}, + "_hasShrinkwrap": false + } + } +} diff --git a/tests/specs/install/global/pkg_name_same_as_file/__test__.jsonc b/tests/specs/install/global/pkg_name_same_as_file/__test__.jsonc new file mode 100644 index 0000000000..980361361a --- /dev/null +++ b/tests/specs/install/global/pkg_name_same_as_file/__test__.jsonc @@ -0,0 +1,20 @@ +{ + "tempDir": true, + "tests": { + "file_exists": { + "steps": [{ + "args": ["eval", "Deno.writeTextFileSync('cli.ts', '')"], + "output": "[WILDCARD]" + }, { + // success + "args": "install --root ./bins -g --name my-cli cli.ts", + "output": "[WILDCARD]" + }] + }, + "file_not_exists": { + "args": "install --root ./bins -g --name my-cli cli.ts", + "output": "file_not_exists.out", + "exitCode": 1 + } + } +} diff --git a/tests/specs/install/global/pkg_name_same_as_file/file_not_exists.out b/tests/specs/install/global/pkg_name_same_as_file/file_not_exists.out new file mode 100644 index 0000000000..92a0bb8dcd --- /dev/null +++ b/tests/specs/install/global/pkg_name_same_as_file/file_not_exists.out @@ -0,0 +1 @@ +error: cli.ts is missing a prefix. Did you mean `deno install -g npm:cli.ts`? From a875a3785ba2b11f9bfd3dc31fd674670b587b44 Mon Sep 17 00:00:00 2001 From: Bhuwan Pandit Date: Thu, 21 Nov 2024 17:27:00 +0000 Subject: [PATCH 138/227] docs(cli/add): add clarification to add command (#26968) Signed-off-by: Bhuwan Pandit --- cli/args/flags.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 3e48fa2909..472eb9a376 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -1704,8 +1704,11 @@ fn add_subcommand() -> Command { "Add dependencies to your configuration file. deno add jsr:@std/path -You can add multiple dependencies at once: - deno add jsr:@std/path jsr:@std/assert" +You can also add npm packages: + deno add npm:react + +Or multiple dependencies at once: + deno add jsr:@std/path jsr:@std/assert npm:chalk" ), UnstableArgsConfig::None, ) From 8a5609ad73a1a92663ab49b562ca303be92e8306 Mon Sep 17 00:00:00 2001 From: denobot <33910674+denobot@users.noreply.github.com> Date: Thu, 21 Nov 2024 14:35:32 -0500 Subject: [PATCH 139/227] chore: forward v2.1.1 release commit to main (#26981) Co-authored-by: dsherret --- .github/workflows/ci.generate.ts | 2 +- .github/workflows/ci.yml | 8 ++--- Cargo.lock | 58 ++++++++++++++++---------------- Cargo.toml | 56 +++++++++++++++--------------- Releases.md | 10 ++++++ bench_util/Cargo.toml | 2 +- cli/Cargo.toml | 2 +- ext/broadcast_channel/Cargo.toml | 2 +- ext/cache/Cargo.toml | 2 +- ext/canvas/Cargo.toml | 2 +- ext/console/Cargo.toml | 2 +- ext/cron/Cargo.toml | 2 +- ext/crypto/Cargo.toml | 2 +- ext/fetch/Cargo.toml | 2 +- ext/ffi/Cargo.toml | 2 +- ext/fs/Cargo.toml | 2 +- ext/http/Cargo.toml | 2 +- ext/io/Cargo.toml | 2 +- ext/kv/Cargo.toml | 2 +- ext/napi/Cargo.toml | 2 +- ext/napi/sym/Cargo.toml | 2 +- ext/net/Cargo.toml | 2 +- ext/node/Cargo.toml | 2 +- ext/tls/Cargo.toml | 2 +- ext/url/Cargo.toml | 2 +- ext/web/Cargo.toml | 2 +- ext/webgpu/Cargo.toml | 2 +- ext/webidl/Cargo.toml | 2 +- ext/websocket/Cargo.toml | 2 +- ext/webstorage/Cargo.toml | 2 +- resolvers/deno/Cargo.toml | 2 +- resolvers/node/Cargo.toml | 2 +- runtime/Cargo.toml | 2 +- runtime/permissions/Cargo.toml | 2 +- 34 files changed, 101 insertions(+), 91 deletions(-) diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts index 941ee47984..53a0f46e50 100755 --- a/.github/workflows/ci.generate.ts +++ b/.github/workflows/ci.generate.ts @@ -5,7 +5,7 @@ import { stringify } from "jsr:@std/yaml@^0.221/stringify"; // Bump this number when you want to purge the cache. // Note: the tools/release/01_bump_crate_versions.ts script will update this version // automatically via regex, so ensure that this line maintains this format. -const cacheVersion = 26; +const cacheVersion = 27; const ubuntuX86Runner = "ubuntu-24.04"; const ubuntuX86XlRunner = "ubuntu-24.04-xl"; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20e9fef503..ee8527bcef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -361,8 +361,8 @@ jobs: path: |- ~/.cargo/registry/index ~/.cargo/registry/cache - key: '26-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}' - restore-keys: '26-cargo-home-${{ matrix.os }}-${{ matrix.arch }}' + key: '27-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}' + restore-keys: '27-cargo-home-${{ matrix.os }}-${{ matrix.arch }}' if: '!(matrix.skip)' - name: Restore cache build output (PR) uses: actions/cache/restore@v4 @@ -375,7 +375,7 @@ jobs: !./target/*/*.zip !./target/*/*.tar.gz key: never_saved - restore-keys: '26-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-' + restore-keys: '27-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-' - name: Apply and update mtime cache if: '!(matrix.skip) && (!startsWith(github.ref, ''refs/tags/''))' uses: ./.github/mtime_cache @@ -685,7 +685,7 @@ jobs: !./target/*/*.zip !./target/*/*.sha256sum !./target/*/*.tar.gz - key: '26-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}' + key: '27-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}' publish-canary: name: publish canary runs-on: ubuntu-24.04 diff --git a/Cargo.lock b/Cargo.lock index 5ca7f30c94..798bb24057 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1201,7 +1201,7 @@ dependencies = [ [[package]] name = "deno" -version = "2.1.0" +version = "2.1.1" dependencies = [ "anstream", "async-trait", @@ -1371,7 +1371,7 @@ dependencies = [ [[package]] name = "deno_bench_util" -version = "0.172.0" +version = "0.173.0" dependencies = [ "bencher", "deno_core", @@ -1380,7 +1380,7 @@ dependencies = [ [[package]] name = "deno_broadcast_channel" -version = "0.172.0" +version = "0.173.0" dependencies = [ "async-trait", "deno_core", @@ -1391,7 +1391,7 @@ dependencies = [ [[package]] name = "deno_cache" -version = "0.110.0" +version = "0.111.0" dependencies = [ "async-trait", "deno_core", @@ -1424,7 +1424,7 @@ dependencies = [ [[package]] name = "deno_canvas" -version = "0.47.0" +version = "0.48.0" dependencies = [ "deno_core", "deno_webgpu", @@ -1459,7 +1459,7 @@ dependencies = [ [[package]] name = "deno_console" -version = "0.178.0" +version = "0.179.0" dependencies = [ "deno_core", ] @@ -1506,7 +1506,7 @@ checksum = "fe4dccb6147bb3f3ba0c7a48e993bfeb999d2c2e47a81badee80e2b370c8d695" [[package]] name = "deno_cron" -version = "0.58.0" +version = "0.59.0" dependencies = [ "anyhow", "async-trait", @@ -1519,7 +1519,7 @@ dependencies = [ [[package]] name = "deno_crypto" -version = "0.192.0" +version = "0.193.0" dependencies = [ "aes", "aes-gcm", @@ -1587,7 +1587,7 @@ dependencies = [ [[package]] name = "deno_fetch" -version = "0.202.0" +version = "0.203.0" dependencies = [ "base64 0.21.7", "bytes", @@ -1621,7 +1621,7 @@ dependencies = [ [[package]] name = "deno_ffi" -version = "0.165.0" +version = "0.166.0" dependencies = [ "deno_core", "deno_permissions", @@ -1641,7 +1641,7 @@ dependencies = [ [[package]] name = "deno_fs" -version = "0.88.0" +version = "0.89.0" dependencies = [ "async-trait", "base32", @@ -1694,7 +1694,7 @@ dependencies = [ [[package]] name = "deno_http" -version = "0.176.0" +version = "0.177.0" dependencies = [ "async-compression", "async-trait", @@ -1733,7 +1733,7 @@ dependencies = [ [[package]] name = "deno_io" -version = "0.88.0" +version = "0.89.0" dependencies = [ "async-trait", "deno_core", @@ -1754,7 +1754,7 @@ dependencies = [ [[package]] name = "deno_kv" -version = "0.86.0" +version = "0.87.0" dependencies = [ "anyhow", "async-trait", @@ -1827,7 +1827,7 @@ dependencies = [ [[package]] name = "deno_napi" -version = "0.109.0" +version = "0.110.0" dependencies = [ "deno_core", "deno_permissions", @@ -1855,7 +1855,7 @@ dependencies = [ [[package]] name = "deno_net" -version = "0.170.0" +version = "0.171.0" dependencies = [ "deno_core", "deno_permissions", @@ -1872,7 +1872,7 @@ dependencies = [ [[package]] name = "deno_node" -version = "0.115.0" +version = "0.116.0" dependencies = [ "aead-gcm-stream", "aes", @@ -2024,7 +2024,7 @@ dependencies = [ [[package]] name = "deno_permissions" -version = "0.38.0" +version = "0.39.0" dependencies = [ "deno_core", "deno_path_util", @@ -2042,7 +2042,7 @@ dependencies = [ [[package]] name = "deno_resolver" -version = "0.10.0" +version = "0.11.0" dependencies = [ "anyhow", "base32", @@ -2061,7 +2061,7 @@ dependencies = [ [[package]] name = "deno_runtime" -version = "0.187.0" +version = "0.188.0" dependencies = [ "async-trait", "color-print", @@ -2198,7 +2198,7 @@ dependencies = [ [[package]] name = "deno_tls" -version = "0.165.0" +version = "0.166.0" dependencies = [ "deno_core", "deno_native_certs", @@ -2247,7 +2247,7 @@ dependencies = [ [[package]] name = "deno_url" -version = "0.178.0" +version = "0.179.0" dependencies = [ "deno_bench_util", "deno_console", @@ -2259,7 +2259,7 @@ dependencies = [ [[package]] name = "deno_web" -version = "0.209.0" +version = "0.210.0" dependencies = [ "async-trait", "base64-simd 0.8.0", @@ -2281,7 +2281,7 @@ dependencies = [ [[package]] name = "deno_webgpu" -version = "0.145.0" +version = "0.146.0" dependencies = [ "deno_core", "raw-window-handle", @@ -2294,7 +2294,7 @@ dependencies = [ [[package]] name = "deno_webidl" -version = "0.178.0" +version = "0.179.0" dependencies = [ "deno_bench_util", "deno_core", @@ -2302,7 +2302,7 @@ dependencies = [ [[package]] name = "deno_websocket" -version = "0.183.0" +version = "0.184.0" dependencies = [ "bytes", "deno_core", @@ -2324,7 +2324,7 @@ dependencies = [ [[package]] name = "deno_webstorage" -version = "0.173.0" +version = "0.174.0" dependencies = [ "deno_core", "deno_web", @@ -4887,7 +4887,7 @@ dependencies = [ [[package]] name = "napi_sym" -version = "0.108.0" +version = "0.109.0" dependencies = [ "quote", "serde", @@ -4942,7 +4942,7 @@ dependencies = [ [[package]] name = "node_resolver" -version = "0.17.0" +version = "0.18.0" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index d1e958fe1b..987c291fcf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,17 +48,17 @@ repository = "https://github.com/denoland/deno" deno_ast = { version = "=0.43.3", features = ["transpiling"] } deno_core = { version = "0.321.0" } -deno_bench_util = { version = "0.172.0", path = "./bench_util" } +deno_bench_util = { version = "0.173.0", path = "./bench_util" } deno_config = { version = "=0.39.2", features = ["workspace", "sync"] } deno_lockfile = "=0.23.1" deno_media_type = { version = "0.2.0", features = ["module_specifier"] } deno_npm = "=0.25.4" deno_path_util = "=0.2.1" -deno_permissions = { version = "0.38.0", path = "./runtime/permissions" } -deno_runtime = { version = "0.187.0", path = "./runtime" } +deno_permissions = { version = "0.39.0", path = "./runtime/permissions" } +deno_runtime = { version = "0.188.0", path = "./runtime" } deno_semver = "=0.5.16" deno_terminal = "0.2.0" -napi_sym = { version = "0.108.0", path = "./ext/napi/sym" } +napi_sym = { version = "0.109.0", path = "./ext/napi/sym" } test_util = { package = "test_server", path = "./tests/util/server" } denokv_proto = "0.8.4" @@ -67,32 +67,32 @@ denokv_remote = "0.8.4" denokv_sqlite = { default-features = false, version = "0.8.4" } # exts -deno_broadcast_channel = { version = "0.172.0", path = "./ext/broadcast_channel" } -deno_cache = { version = "0.110.0", path = "./ext/cache" } -deno_canvas = { version = "0.47.0", path = "./ext/canvas" } -deno_console = { version = "0.178.0", path = "./ext/console" } -deno_cron = { version = "0.58.0", path = "./ext/cron" } -deno_crypto = { version = "0.192.0", path = "./ext/crypto" } -deno_fetch = { version = "0.202.0", path = "./ext/fetch" } -deno_ffi = { version = "0.165.0", path = "./ext/ffi" } -deno_fs = { version = "0.88.0", path = "./ext/fs" } -deno_http = { version = "0.176.0", path = "./ext/http" } -deno_io = { version = "0.88.0", path = "./ext/io" } -deno_kv = { version = "0.86.0", path = "./ext/kv" } -deno_napi = { version = "0.109.0", path = "./ext/napi" } -deno_net = { version = "0.170.0", path = "./ext/net" } -deno_node = { version = "0.115.0", path = "./ext/node" } -deno_tls = { version = "0.165.0", path = "./ext/tls" } -deno_url = { version = "0.178.0", path = "./ext/url" } -deno_web = { version = "0.209.0", path = "./ext/web" } -deno_webgpu = { version = "0.145.0", path = "./ext/webgpu" } -deno_webidl = { version = "0.178.0", path = "./ext/webidl" } -deno_websocket = { version = "0.183.0", path = "./ext/websocket" } -deno_webstorage = { version = "0.173.0", path = "./ext/webstorage" } +deno_broadcast_channel = { version = "0.173.0", path = "./ext/broadcast_channel" } +deno_cache = { version = "0.111.0", path = "./ext/cache" } +deno_canvas = { version = "0.48.0", path = "./ext/canvas" } +deno_console = { version = "0.179.0", path = "./ext/console" } +deno_cron = { version = "0.59.0", path = "./ext/cron" } +deno_crypto = { version = "0.193.0", path = "./ext/crypto" } +deno_fetch = { version = "0.203.0", path = "./ext/fetch" } +deno_ffi = { version = "0.166.0", path = "./ext/ffi" } +deno_fs = { version = "0.89.0", path = "./ext/fs" } +deno_http = { version = "0.177.0", path = "./ext/http" } +deno_io = { version = "0.89.0", path = "./ext/io" } +deno_kv = { version = "0.87.0", path = "./ext/kv" } +deno_napi = { version = "0.110.0", path = "./ext/napi" } +deno_net = { version = "0.171.0", path = "./ext/net" } +deno_node = { version = "0.116.0", path = "./ext/node" } +deno_tls = { version = "0.166.0", path = "./ext/tls" } +deno_url = { version = "0.179.0", path = "./ext/url" } +deno_web = { version = "0.210.0", path = "./ext/web" } +deno_webgpu = { version = "0.146.0", path = "./ext/webgpu" } +deno_webidl = { version = "0.179.0", path = "./ext/webidl" } +deno_websocket = { version = "0.184.0", path = "./ext/websocket" } +deno_webstorage = { version = "0.174.0", path = "./ext/webstorage" } # resolvers -deno_resolver = { version = "0.10.0", path = "./resolvers/deno" } -node_resolver = { version = "0.17.0", path = "./resolvers/node" } +deno_resolver = { version = "0.11.0", path = "./resolvers/deno" } +node_resolver = { version = "0.18.0", path = "./resolvers/node" } aes = "=0.8.3" anyhow = "1.0.57" diff --git a/Releases.md b/Releases.md index 2cb2dfbd80..0e977d0311 100644 --- a/Releases.md +++ b/Releases.md @@ -6,6 +6,16 @@ https://github.com/denoland/deno/releases We also have one-line install commands at: https://github.com/denoland/deno_install +### 2.1.1 / 2024.11.21 + +- docs(add): clarification to add command (#26968) +- docs(doc): fix typo in doc subcommand help output (#26321) +- fix(node): regression where ts files were sometimes resolved instead of js + (#26971) +- fix(task): ensure root config always looks up dependencies in root (#26959) +- fix(watch): don't panic if there's no path provided (#26972) +- fix: Buffer global in --unstable-node-globals (#26973) + ### 2.1.0 / 2024.11.21 - feat(cli): add `--unstable-node-globals` flag (#26617) diff --git a/bench_util/Cargo.toml b/bench_util/Cargo.toml index 7bb785e6e5..4d39ae30e4 100644 --- a/bench_util/Cargo.toml +++ b/bench_util/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_bench_util" -version = "0.172.0" +version = "0.173.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/cli/Cargo.toml b/cli/Cargo.toml index c681884837..6a1fc51bc4 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno" -version = "2.1.0" +version = "2.1.1" authors.workspace = true default-run = "deno" edition.workspace = true diff --git a/ext/broadcast_channel/Cargo.toml b/ext/broadcast_channel/Cargo.toml index b92b1c7beb..e7c3f584b6 100644 --- a/ext/broadcast_channel/Cargo.toml +++ b/ext/broadcast_channel/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_broadcast_channel" -version = "0.172.0" +version = "0.173.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/cache/Cargo.toml b/ext/cache/Cargo.toml index c79024e82c..9005bf5b24 100644 --- a/ext/cache/Cargo.toml +++ b/ext/cache/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_cache" -version = "0.110.0" +version = "0.111.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/canvas/Cargo.toml b/ext/canvas/Cargo.toml index 8fcb2c4a9c..5dca442437 100644 --- a/ext/canvas/Cargo.toml +++ b/ext/canvas/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_canvas" -version = "0.47.0" +version = "0.48.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/console/Cargo.toml b/ext/console/Cargo.toml index 9f925ac61b..1d76390b6e 100644 --- a/ext/console/Cargo.toml +++ b/ext/console/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_console" -version = "0.178.0" +version = "0.179.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/cron/Cargo.toml b/ext/cron/Cargo.toml index 23ac77d5ed..d1809da135 100644 --- a/ext/cron/Cargo.toml +++ b/ext/cron/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_cron" -version = "0.58.0" +version = "0.59.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/crypto/Cargo.toml b/ext/crypto/Cargo.toml index 4a44314221..dfb81c62a3 100644 --- a/ext/crypto/Cargo.toml +++ b/ext/crypto/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_crypto" -version = "0.192.0" +version = "0.193.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/fetch/Cargo.toml b/ext/fetch/Cargo.toml index 9ebd9ec03f..90b1b152d9 100644 --- a/ext/fetch/Cargo.toml +++ b/ext/fetch/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_fetch" -version = "0.202.0" +version = "0.203.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/ffi/Cargo.toml b/ext/ffi/Cargo.toml index e63d22e57d..2f0813a58b 100644 --- a/ext/ffi/Cargo.toml +++ b/ext/ffi/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_ffi" -version = "0.165.0" +version = "0.166.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/fs/Cargo.toml b/ext/fs/Cargo.toml index f37d1f6997..1d7d5d3d9a 100644 --- a/ext/fs/Cargo.toml +++ b/ext/fs/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_fs" -version = "0.88.0" +version = "0.89.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/http/Cargo.toml b/ext/http/Cargo.toml index 5105b47dde..5dc3cd9a7b 100644 --- a/ext/http/Cargo.toml +++ b/ext/http/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_http" -version = "0.176.0" +version = "0.177.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/io/Cargo.toml b/ext/io/Cargo.toml index 8f7c0e197a..caaf67ab0b 100644 --- a/ext/io/Cargo.toml +++ b/ext/io/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_io" -version = "0.88.0" +version = "0.89.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/kv/Cargo.toml b/ext/kv/Cargo.toml index 870e4fec3b..972aabfbb7 100644 --- a/ext/kv/Cargo.toml +++ b/ext/kv/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_kv" -version = "0.86.0" +version = "0.87.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/napi/Cargo.toml b/ext/napi/Cargo.toml index 19f4036a88..f9a1f73007 100644 --- a/ext/napi/Cargo.toml +++ b/ext/napi/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_napi" -version = "0.109.0" +version = "0.110.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/napi/sym/Cargo.toml b/ext/napi/sym/Cargo.toml index 83107782b8..74d7b450ba 100644 --- a/ext/napi/sym/Cargo.toml +++ b/ext/napi/sym/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "napi_sym" -version = "0.108.0" +version = "0.109.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/net/Cargo.toml b/ext/net/Cargo.toml index 1cb109dd21..8669f650e3 100644 --- a/ext/net/Cargo.toml +++ b/ext/net/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_net" -version = "0.170.0" +version = "0.171.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/node/Cargo.toml b/ext/node/Cargo.toml index e1650282c2..5e47a74e1d 100644 --- a/ext/node/Cargo.toml +++ b/ext/node/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_node" -version = "0.115.0" +version = "0.116.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/tls/Cargo.toml b/ext/tls/Cargo.toml index 81d28d4421..6b4bc98909 100644 --- a/ext/tls/Cargo.toml +++ b/ext/tls/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_tls" -version = "0.165.0" +version = "0.166.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/url/Cargo.toml b/ext/url/Cargo.toml index 2b390e8b07..e2ea7dae58 100644 --- a/ext/url/Cargo.toml +++ b/ext/url/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_url" -version = "0.178.0" +version = "0.179.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/web/Cargo.toml b/ext/web/Cargo.toml index c00298991b..f56f21b72f 100644 --- a/ext/web/Cargo.toml +++ b/ext/web/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_web" -version = "0.209.0" +version = "0.210.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/webgpu/Cargo.toml b/ext/webgpu/Cargo.toml index 73541ba6a2..93be59b734 100644 --- a/ext/webgpu/Cargo.toml +++ b/ext/webgpu/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webgpu" -version = "0.145.0" +version = "0.146.0" authors = ["the Deno authors"] edition.workspace = true license = "MIT" diff --git a/ext/webidl/Cargo.toml b/ext/webidl/Cargo.toml index 9f6fdc4943..9bf65335c0 100644 --- a/ext/webidl/Cargo.toml +++ b/ext/webidl/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webidl" -version = "0.178.0" +version = "0.179.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/websocket/Cargo.toml b/ext/websocket/Cargo.toml index bdbc169435..d6177dada0 100644 --- a/ext/websocket/Cargo.toml +++ b/ext/websocket/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_websocket" -version = "0.183.0" +version = "0.184.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/webstorage/Cargo.toml b/ext/webstorage/Cargo.toml index 928844c5aa..580eb95e2f 100644 --- a/ext/webstorage/Cargo.toml +++ b/ext/webstorage/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webstorage" -version = "0.173.0" +version = "0.174.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/resolvers/deno/Cargo.toml b/resolvers/deno/Cargo.toml index 0de8b31b38..b2c4bd2384 100644 --- a/resolvers/deno/Cargo.toml +++ b/resolvers/deno/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_resolver" -version = "0.10.0" +version = "0.11.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/resolvers/node/Cargo.toml b/resolvers/node/Cargo.toml index 7f914479ad..fb30270573 100644 --- a/resolvers/node/Cargo.toml +++ b/resolvers/node/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "node_resolver" -version = "0.17.0" +version = "0.18.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index d4c41b831f..94fe4ce02b 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_runtime" -version = "0.187.0" +version = "0.188.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/runtime/permissions/Cargo.toml b/runtime/permissions/Cargo.toml index 1e7133de6d..efbc657055 100644 --- a/runtime/permissions/Cargo.toml +++ b/runtime/permissions/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_permissions" -version = "0.38.0" +version = "0.39.0" authors.workspace = true edition.workspace = true license.workspace = true From a19b3f44d469f96eec8dbde0ba3474841061de0d Mon Sep 17 00:00:00 2001 From: Caleb Cox Date: Thu, 21 Nov 2024 14:24:54 -0600 Subject: [PATCH 140/227] fix(cli): remove extraneous comma in task --eval help (#26985) --- cli/args/flags.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 472eb9a376..5e89f88a91 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -3083,7 +3083,7 @@ Evaluate a task from string Arg::new("eval") .long("eval") .help( - "Evaluate the passed value as if, it was a task in a configuration file", + "Evaluate the passed value as if it was a task in a configuration file", ).action(ArgAction::SetTrue) ) .arg(node_modules_dir_arg()) From 8f7787f81b185716406da752ff91f5ffa146c971 Mon Sep 17 00:00:00 2001 From: Charlie Bellini Date: Fri, 22 Nov 2024 00:04:47 +0100 Subject: [PATCH 141/227] fix(ext/websocket): don't throw exception when sending to closed socket (#26932) [The WebSocket specification for the `send` function](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send) says: > The browser will throw an exception if you call `send()` when the connection is in the `CONNECTING` state. If you call `send()` when the connection is in the `CLOSING` or `CLOSED` states, the browser will silently discard the data. and: > ### Exceptions > > `InvalidStateError` [`DOMException`](https://developer.mozilla.org/en-US/docs/Web/API/DOMException) > > Thrown if [`WebSocket.readyState`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/readyState) is `CONNECTING`. This pull request fixes the current behavior to match the specification. Also, I believe it fixes #17586. --- ext/websocket/01_websocket.js | 6 +++++- tests/unit/websocket_test.ts | 15 +++++++++++++++ tests/wpt/runner/expectation.json | 4 ++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ext/websocket/01_websocket.js b/ext/websocket/01_websocket.js index 468999b95d..78572f5f00 100644 --- a/ext/websocket/01_websocket.js +++ b/ext/websocket/01_websocket.js @@ -330,10 +330,14 @@ class WebSocket extends EventTarget { webidl.requiredArguments(arguments.length, 1, prefix); data = webidl.converters.WebSocketSend(data, prefix, "Argument 1"); - if (this[_readyState] !== OPEN) { + if (this[_readyState] === CONNECTING) { throw new DOMException("'readyState' not OPEN", "InvalidStateError"); } + if (this[_readyState] !== OPEN) { + return; + } + if (this[_sendQueue].length === 0) { // Fast path if the send queue is empty, for example when only synchronous // data is being sent. diff --git a/tests/unit/websocket_test.ts b/tests/unit/websocket_test.ts index 3aafe8da22..d9878828db 100644 --- a/tests/unit/websocket_test.ts +++ b/tests/unit/websocket_test.ts @@ -806,3 +806,18 @@ Deno.test("Close connection", async () => { await server.finished; conn.close(); }); + +Deno.test("send to a closed socket", async () => { + const { promise, resolve } = Promise.withResolvers(); + const ws = new WebSocket("ws://localhost:4242"); + const blob = new Blob(["foo"]); + ws.onerror = () => fail(); + ws.onopen = () => { + ws.close(); + ws.send(blob); + }; + ws.onclose = () => { + resolve(); + }; + await promise; +}); diff --git a/tests/wpt/runner/expectation.json b/tests/wpt/runner/expectation.json index 1a7cb8c560..6140f4379d 100644 --- a/tests/wpt/runner/expectation.json +++ b/tests/wpt/runner/expectation.json @@ -11303,10 +11303,10 @@ "006.html?default": true, "006.html?wpt_flags=h2": false, "006.html?wss": false, - "007.html?default": false, + "007.html?default": true, "007.html?wpt_flags=h2": false, "007.html?wss": false, - "008.html?default": false, + "008.html?default": true, "008.html?wss": false, "009.html?default": { "ignore": true From 45fad6a622700bac0b656a8500529bc4f41aed86 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 21 Nov 2024 18:16:40 -0500 Subject: [PATCH 142/227] chore(compile): log code cache file path (#26977) Ref #26976 --- cli/standalone/code_cache.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cli/standalone/code_cache.rs b/cli/standalone/code_cache.rs index 25b490544c..9580b9b44e 100644 --- a/cli/standalone/code_cache.rs +++ b/cli/standalone/code_cache.rs @@ -42,7 +42,11 @@ impl DenoCompileCodeCache { // attempt to deserialize the cache data match deserialize(&file_path, cache_key) { Ok(data) => { - log::debug!("Loaded {} code cache entries", data.len()); + log::debug!( + "Loaded {} code cache entries from {}", + data.len(), + file_path.display() + ); Self { strategy: CodeCacheStrategy::SubsequentRun( SubsequentRunCodeCacheStrategy { @@ -53,7 +57,11 @@ impl DenoCompileCodeCache { } } Err(err) => { - log::debug!("Failed to deserialize code cache: {:#}", err); + log::debug!( + "Failed to deserialize code cache from {}: {:#}", + file_path.display(), + err + ); Self { strategy: CodeCacheStrategy::FirstRun(FirstRunCodeCacheStrategy { cache_key, @@ -186,6 +194,7 @@ impl FirstRunCodeCacheStrategy { Ok(()) => { if let Err(err) = std::fs::rename(&temp_file, &self.file_path) { log::debug!("Failed to rename code cache: {}", err); + let _ = std::fs::remove_file(&temp_file); } else { log::debug!("Serialized {} code cache entries", count); } From 5ca47ee97a06c1b76bbdd58b50efd7016da2b020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 22 Nov 2024 00:46:23 +0000 Subject: [PATCH 143/227] fix: support non-function exports in Wasm modules (#26992) Closes https://github.com/denoland/deno/issues/26986 --- Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- .../wasm_module/table_global_memory/__test__.jsonc | 4 ++++ .../run/wasm_module/table_global_memory/main.js | 2 ++ .../run/wasm_module/table_global_memory/main.out | 7 +++++++ .../run/wasm_module/table_global_memory/mod.wasm | Bin 0 -> 80 bytes .../run/wasm_module/table_global_memory/mod.wat | 6 ++++++ 7 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 tests/specs/run/wasm_module/table_global_memory/__test__.jsonc create mode 100644 tests/specs/run/wasm_module/table_global_memory/main.js create mode 100644 tests/specs/run/wasm_module/table_global_memory/main.out create mode 100644 tests/specs/run/wasm_module/table_global_memory/mod.wasm create mode 100644 tests/specs/run/wasm_module/table_global_memory/mod.wat diff --git a/Cargo.lock b/Cargo.lock index 798bb24057..7947106e66 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1466,9 +1466,9 @@ dependencies = [ [[package]] name = "deno_core" -version = "0.321.0" +version = "0.322.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd2a54cda74cdc187d5fc2d23370a45cf09f912caf566dd1cd24a50157d809c7" +checksum = "2f593ef2b8acab8cd3ace9d50052edc65a3654fdbde808070cfa5da5cf7aaae6" dependencies = [ "anyhow", "bincode", @@ -1983,9 +1983,9 @@ dependencies = [ [[package]] name = "deno_ops" -version = "0.197.0" +version = "0.198.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a8825d92301cf445727c43f17fee2a20fcdf4370004339965156ae7c56c97e" +checksum = "870826735cd9aa0376d2aadca14365b753e830e3cc16891efb9232845a6982a4" dependencies = [ "proc-macro-rules", "proc-macro2", @@ -6666,9 +6666,9 @@ dependencies = [ [[package]] name = "serde_v8" -version = "0.230.0" +version = "0.231.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a783242d2af51d6955cc04bf2b64adb643ab588b61e9573c908a69dabf8c2f" +checksum = "1a0c48b8842ebae21c52da1d978fba5c2be5991680bddfdc1a36ee0ccbc60114" dependencies = [ "num-bigint", "serde", diff --git a/Cargo.toml b/Cargo.toml index 987c291fcf..f72d3c80d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ repository = "https://github.com/denoland/deno" [workspace.dependencies] deno_ast = { version = "=0.43.3", features = ["transpiling"] } -deno_core = { version = "0.321.0" } +deno_core = { version = "0.322.0" } deno_bench_util = { version = "0.173.0", path = "./bench_util" } deno_config = { version = "=0.39.2", features = ["workspace", "sync"] } diff --git a/tests/specs/run/wasm_module/table_global_memory/__test__.jsonc b/tests/specs/run/wasm_module/table_global_memory/__test__.jsonc new file mode 100644 index 0000000000..1dbb89a020 --- /dev/null +++ b/tests/specs/run/wasm_module/table_global_memory/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --check main.js", + "output": "main.out" +} diff --git a/tests/specs/run/wasm_module/table_global_memory/main.js b/tests/specs/run/wasm_module/table_global_memory/main.js new file mode 100644 index 0000000000..a5ff412a92 --- /dev/null +++ b/tests/specs/run/wasm_module/table_global_memory/main.js @@ -0,0 +1,2 @@ +import * as wasm from "./mod.wasm"; +console.log(wasm); diff --git a/tests/specs/run/wasm_module/table_global_memory/main.out b/tests/specs/run/wasm_module/table_global_memory/main.out new file mode 100644 index 0000000000..81a5b4b47c --- /dev/null +++ b/tests/specs/run/wasm_module/table_global_memory/main.out @@ -0,0 +1,7 @@ +Check [WILDCARD] +[Module: null prototype] { + func: [Function: 0], + global: Global [WebAssembly.Global] {}, + memory: Memory [WebAssembly.Memory] {}, + table: Table [WebAssembly.Table] {} +} diff --git a/tests/specs/run/wasm_module/table_global_memory/mod.wasm b/tests/specs/run/wasm_module/table_global_memory/mod.wasm new file mode 100644 index 0000000000000000000000000000000000000000..a99e01c5dc23e9d59fbc0c399fe5343f233dde95 GIT binary patch literal 80 zcmWN_yAgmO5Cy>ZyyKjaF6_ik1P4t(96y1Pt;>dsa1{ceat5R$RCxeS+M4mh1mBOU b>$5Md?+|k$tfW%Uw}WlD#*hVrqX7N~p~ws^ literal 0 HcmV?d00001 diff --git a/tests/specs/run/wasm_module/table_global_memory/mod.wat b/tests/specs/run/wasm_module/table_global_memory/mod.wat new file mode 100644 index 0000000000..d2a92f0ac1 --- /dev/null +++ b/tests/specs/run/wasm_module/table_global_memory/mod.wat @@ -0,0 +1,6 @@ +(module + (func (export "func") unreachable) + (table (export "table") 0 funcref) + (memory (export "memory") 0) + (global (export "global") i32 i32.const 0) +) From 9c0e6369b2f5d03aa281c1e0df4f9ef590214c70 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 22 Nov 2024 10:59:19 -0500 Subject: [PATCH 144/227] chore(check): add test for Wasm memory and table (#26996) --- .../wasm_module/table_global_memory/__test__.jsonc | 13 +++++++++++-- .../run/wasm_module/table_global_memory/check.out | 14 ++++++++++++++ .../run/wasm_module/table_global_memory/check.ts | 4 ++++ .../run/wasm_module/table_global_memory/main.out | 1 - 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 tests/specs/run/wasm_module/table_global_memory/check.out create mode 100644 tests/specs/run/wasm_module/table_global_memory/check.ts diff --git a/tests/specs/run/wasm_module/table_global_memory/__test__.jsonc b/tests/specs/run/wasm_module/table_global_memory/__test__.jsonc index 1dbb89a020..55f16ed0c2 100644 --- a/tests/specs/run/wasm_module/table_global_memory/__test__.jsonc +++ b/tests/specs/run/wasm_module/table_global_memory/__test__.jsonc @@ -1,4 +1,13 @@ { - "args": "run --check main.js", - "output": "main.out" + "tests": { + "run": { + "args": "run main.js", + "output": "main.out" + }, + "check": { + "args": "check check.ts", + "output": "check.out", + "exitCode": 1 + } + } } diff --git a/tests/specs/run/wasm_module/table_global_memory/check.out b/tests/specs/run/wasm_module/table_global_memory/check.out new file mode 100644 index 0000000000..e335a7c907 --- /dev/null +++ b/tests/specs/run/wasm_module/table_global_memory/check.out @@ -0,0 +1,14 @@ +Check file:///[WILDLINE]/check.ts +error: TS2322 [ERROR]: Type 'Function | null' is not assignable to type 'number'. + Type 'null' is not assignable to type 'number'. +const value1: number = table.get(0); + ~~~~~~ + at file:///[WILDLINE]/check.ts:2:7 + +TS2322 [ERROR]: Type 'ArrayBuffer | SharedArrayBuffer' is not assignable to type 'number'. + Type 'ArrayBuffer' is not assignable to type 'number'. +const value2: number = memory.buffer; + ~~~~~~ + at file:///[WILDLINE]/check.ts:3:7 + +Found 2 errors. diff --git a/tests/specs/run/wasm_module/table_global_memory/check.ts b/tests/specs/run/wasm_module/table_global_memory/check.ts new file mode 100644 index 0000000000..c0e43ed2aa --- /dev/null +++ b/tests/specs/run/wasm_module/table_global_memory/check.ts @@ -0,0 +1,4 @@ +import { memory, table } from "./mod.wasm"; +const value1: number = table.get(0); +const value2: number = memory.buffer; +console.log(value1, value2); diff --git a/tests/specs/run/wasm_module/table_global_memory/main.out b/tests/specs/run/wasm_module/table_global_memory/main.out index 81a5b4b47c..c095b0dd92 100644 --- a/tests/specs/run/wasm_module/table_global_memory/main.out +++ b/tests/specs/run/wasm_module/table_global_memory/main.out @@ -1,4 +1,3 @@ -Check [WILDCARD] [Module: null prototype] { func: [Function: 0], global: Global [WebAssembly.Global] {}, From 4ded7519e97922d12ce3398054db92e7a7b2497e Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 22 Nov 2024 14:26:38 -0500 Subject: [PATCH 145/227] fix(compile): correct buffered reading of assets and files (#27008) Closes #27006 --- cli/standalone/virtual_fs.rs | 25 ++++---- .../include/buffered_reads/__test__.jsonc | 27 +++++++++ .../compile/include/buffered_reads/main.ts | 57 +++++++++++++++++++ .../compile/include/buffered_reads/setup.js | 7 +++ .../data_files}/__test__.jsonc | 0 .../data_files}/data-file.txt | 0 .../data_files}/main.js | 0 .../data_files}/non_existent.out | 0 .../data_files}/output.out | 0 .../folder}/__test__.jsonc | 0 .../folder}/data/a.txt | 0 .../folder}/data/b.txt | 0 .../folder}/main.js | 0 .../folder}/output.out | 0 14 files changed, 104 insertions(+), 12 deletions(-) create mode 100644 tests/specs/compile/include/buffered_reads/__test__.jsonc create mode 100644 tests/specs/compile/include/buffered_reads/main.ts create mode 100644 tests/specs/compile/include/buffered_reads/setup.js rename tests/specs/compile/{include_data_files => include/data_files}/__test__.jsonc (100%) rename tests/specs/compile/{include_data_files => include/data_files}/data-file.txt (100%) rename tests/specs/compile/{include_data_files => include/data_files}/main.js (100%) rename tests/specs/compile/{include_data_files => include/data_files}/non_existent.out (100%) rename tests/specs/compile/{include_data_files => include/data_files}/output.out (100%) rename tests/specs/compile/{include_folder => include/folder}/__test__.jsonc (100%) rename tests/specs/compile/{include_folder => include/folder}/data/a.txt (100%) rename tests/specs/compile/{include_folder => include/folder}/data/b.txt (100%) rename tests/specs/compile/{include_folder => include/folder}/main.js (100%) rename tests/specs/compile/{include_folder => include/folder}/output.out (100%) diff --git a/cli/standalone/virtual_fs.rs b/cli/standalone/virtual_fs.rs index d1084f016c..be7e937ee1 100644 --- a/cli/standalone/virtual_fs.rs +++ b/cli/standalone/virtual_fs.rs @@ -634,7 +634,7 @@ impl FileBackedVfsFile { } fn read_to_buf(&self, buf: &mut [u8]) -> FsResult { - let pos = { + let read_pos = { let mut pos = self.pos.lock(); let read_pos = *pos; // advance the position due to the read @@ -643,12 +643,12 @@ impl FileBackedVfsFile { }; self .vfs - .read_file(&self.file, pos, buf) + .read_file(&self.file, read_pos, buf) .map_err(|err| err.into()) } fn read_to_end(&self) -> FsResult> { - let pos = { + let read_pos = { let mut pos = self.pos.lock(); let read_pos = *pos; // todo(dsherret): should this always set it to the end of the file? @@ -658,12 +658,12 @@ impl FileBackedVfsFile { } read_pos }; - if pos > self.file.len { + if read_pos > self.file.len { return Ok(Vec::new()); } - let size = (self.file.len - pos) as usize; + let size = (self.file.len - read_pos) as usize; let mut buf = vec![0; size]; - self.vfs.read_file(&self.file, pos, &mut buf)?; + self.vfs.read_file(&self.file, read_pos, &mut buf)?; Ok(buf) } } @@ -893,8 +893,9 @@ impl FileBackedVfs { buf: &mut [u8], ) -> std::io::Result { let read_range = self.get_read_range(file, pos, buf.len() as u64)?; - buf.copy_from_slice(&self.vfs_data[read_range]); - Ok(buf.len()) + let read_len = read_range.len(); + buf[..read_len].copy_from_slice(&self.vfs_data[read_range]); + Ok(read_len) } fn get_read_range( @@ -903,15 +904,15 @@ impl FileBackedVfs { pos: u64, len: u64, ) -> std::io::Result> { - let data = &self.vfs_data; - let start = self.fs_root.start_file_offset + file.offset + pos; - let end = start + len; - if end > data.len() as u64 { + if pos > file.len { return Err(std::io::Error::new( std::io::ErrorKind::UnexpectedEof, "unexpected EOF", )); } + let file_offset = self.fs_root.start_file_offset + file.offset; + let start = file_offset + pos; + let end = file_offset + std::cmp::min(pos + len, file.len); Ok(start as usize..end as usize) } diff --git a/tests/specs/compile/include/buffered_reads/__test__.jsonc b/tests/specs/compile/include/buffered_reads/__test__.jsonc new file mode 100644 index 0000000000..7640fed56b --- /dev/null +++ b/tests/specs/compile/include/buffered_reads/__test__.jsonc @@ -0,0 +1,27 @@ +{ + "tempDir": true, + "steps": [{ + "args": "run -A setup.js", + "output": "[WILDCARD]" + }, { + "if": "unix", + "args": "compile --allow-read=data --include data --output main main.ts", + "output": "[WILDCARD]" + }, { + "if": "unix", + "commandName": "./main", + "args": [], + "output": "[WILDCARD]", + "exitCode": 0 + }, { + "if": "windows", + "args": "compile --allow-read=data --include data --output main.exe main.ts", + "output": "[WILDCARD]" + }, { + "if": "windows", + "commandName": "./main.exe", + "args": [], + "output": "[WILDCARD]", + "exitCode": 0 + }] +} diff --git a/tests/specs/compile/include/buffered_reads/main.ts b/tests/specs/compile/include/buffered_reads/main.ts new file mode 100644 index 0000000000..7f78eab612 --- /dev/null +++ b/tests/specs/compile/include/buffered_reads/main.ts @@ -0,0 +1,57 @@ +// buffer larger than file +{ + using file = Deno.openSync(import.meta.dirname + "/data/1.txt"); + const data = new Uint8Array(13); + const len = file.readSync(data); + if (len !== 13) { + throw new Error("Unexpected read length"); + } + if (file.readSync(new Uint8Array(1024)) !== null) { + throw new Error("Unexpected."); + } + const textData = new TextDecoder().decode(data); + if (textData !== "Hello, world!") { + throw new Error("Unexpected file data (1): " + textData); + } +} + +// buffer smaller than file +{ + using file = Deno.openSync(import.meta.dirname + "/data/1.txt"); + const finalData = new Uint8Array(13); + const data = new Uint8Array(2); + let pos = 0; + while (true) { + const len = file.readSync(data); + if (len === 0 || len == null) { + break; + } + finalData.set(data.subarray(0, len), pos); + pos += len; + } + const textData = new TextDecoder().decode(finalData); + if (textData !== "Hello, world!") { + throw new Error("Unexpected file data (2): " + textData); + } +} + +// large amount of data, small reads +{ + const bytes = new Uint8Array((1024 ** 2) * 20); + using file = Deno.openSync(import.meta.dirname + "/data/2.dat"); + const buffer = new Uint8Array(2); + let pos = 0; + while (true) { + const len = file.readSync(buffer); + if (len === 0 || len == null) { + break; + } + bytes.set(buffer.subarray(0, len), pos); + pos += len; + } + for (let i = 0; i < bytes.length; i++) { + if (bytes[i] !== i % 256) { + throw new Error("Unexpected data."); + } + } +} diff --git a/tests/specs/compile/include/buffered_reads/setup.js b/tests/specs/compile/include/buffered_reads/setup.js new file mode 100644 index 0000000000..39cd5cb8b0 --- /dev/null +++ b/tests/specs/compile/include/buffered_reads/setup.js @@ -0,0 +1,7 @@ +Deno.mkdirSync("data"); +Deno.writeTextFileSync("data/1.txt", "Hello, world!"); +const bytes = new Uint8Array((1024 ** 2) * 20); +for (let i = 0; i < bytes.length; i++) { + bytes[i] = i % 256; +} +Deno.writeFileSync("data/2.dat", bytes); diff --git a/tests/specs/compile/include_data_files/__test__.jsonc b/tests/specs/compile/include/data_files/__test__.jsonc similarity index 100% rename from tests/specs/compile/include_data_files/__test__.jsonc rename to tests/specs/compile/include/data_files/__test__.jsonc diff --git a/tests/specs/compile/include_data_files/data-file.txt b/tests/specs/compile/include/data_files/data-file.txt similarity index 100% rename from tests/specs/compile/include_data_files/data-file.txt rename to tests/specs/compile/include/data_files/data-file.txt diff --git a/tests/specs/compile/include_data_files/main.js b/tests/specs/compile/include/data_files/main.js similarity index 100% rename from tests/specs/compile/include_data_files/main.js rename to tests/specs/compile/include/data_files/main.js diff --git a/tests/specs/compile/include_data_files/non_existent.out b/tests/specs/compile/include/data_files/non_existent.out similarity index 100% rename from tests/specs/compile/include_data_files/non_existent.out rename to tests/specs/compile/include/data_files/non_existent.out diff --git a/tests/specs/compile/include_data_files/output.out b/tests/specs/compile/include/data_files/output.out similarity index 100% rename from tests/specs/compile/include_data_files/output.out rename to tests/specs/compile/include/data_files/output.out diff --git a/tests/specs/compile/include_folder/__test__.jsonc b/tests/specs/compile/include/folder/__test__.jsonc similarity index 100% rename from tests/specs/compile/include_folder/__test__.jsonc rename to tests/specs/compile/include/folder/__test__.jsonc diff --git a/tests/specs/compile/include_folder/data/a.txt b/tests/specs/compile/include/folder/data/a.txt similarity index 100% rename from tests/specs/compile/include_folder/data/a.txt rename to tests/specs/compile/include/folder/data/a.txt diff --git a/tests/specs/compile/include_folder/data/b.txt b/tests/specs/compile/include/folder/data/b.txt similarity index 100% rename from tests/specs/compile/include_folder/data/b.txt rename to tests/specs/compile/include/folder/data/b.txt diff --git a/tests/specs/compile/include_folder/main.js b/tests/specs/compile/include/folder/main.js similarity index 100% rename from tests/specs/compile/include_folder/main.js rename to tests/specs/compile/include/folder/main.js diff --git a/tests/specs/compile/include_folder/output.out b/tests/specs/compile/include/folder/output.out similarity index 100% rename from tests/specs/compile/include_folder/output.out rename to tests/specs/compile/include/folder/output.out From 50538ba35d5e8d34eb6833ae8d818ebcb698bc5d Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Fri, 22 Nov 2024 22:42:27 +0100 Subject: [PATCH 146/227] fix(node/fs): missing uv error context for readFile (#27011) Dart's Node wrapper code in `npm:sass` does string slicing on the thrown error message which broke because of our missing uv error context. Code in question: ```js _systemErrorToFileSystemException0(callback) { var error, t1, exception, t2; try { t1 = callback.call$0(); return t1; } catch (exception) { error = A.unwrapException(exception); if (!type$.JsSystemError._is(error)) throw exception; t1 = error; t2 = J.getInterceptor$x(t1); throw A.wrapException(new A.FileSystemException0(J.substring$2$s(t2.get$message(t1), (A.S(t2.get$code(t1)) + ": ").length, J.get$length$asx(t2.get$message(t1)) - (", " + A.S(t2.get$syscall(t1)) + " '" + A.S(t2.get$path(t1)) + "'").length), J.get$path$x(error))); } } ``` Fixes https://github.com/denoland/deno/issues/26994 --- ext/node/polyfills/_fs/_fs_readFile.ts | 4 ++-- tests/unit_node/_fs/_fs_readFile_test.ts | 25 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ext/node/polyfills/_fs/_fs_readFile.ts b/ext/node/polyfills/_fs/_fs_readFile.ts index cf7e0305d8..029e57c502 100644 --- a/ext/node/polyfills/_fs/_fs_readFile.ts +++ b/ext/node/polyfills/_fs/_fs_readFile.ts @@ -88,7 +88,7 @@ export function readFile( } const buffer = maybeDecode(data, encoding); (cb as BinaryCallback)(null, buffer); - }, (err) => cb && cb(denoErrorToNodeError(err))); + }, (err) => cb && cb(denoErrorToNodeError(err, { path, syscall: "open" }))); } } @@ -122,7 +122,7 @@ export function readFileSync( try { data = Deno.readFileSync(path); } catch (err) { - throw denoErrorToNodeError(err); + throw denoErrorToNodeError(err, { path, syscall: "open" }); } const encoding = getEncoding(opt); if (encoding && encoding !== "binary") { diff --git a/tests/unit_node/_fs/_fs_readFile_test.ts b/tests/unit_node/_fs/_fs_readFile_test.ts index ea36b9d866..a75f12d1f6 100644 --- a/tests/unit_node/_fs/_fs_readFile_test.ts +++ b/tests/unit_node/_fs/_fs_readFile_test.ts @@ -2,7 +2,7 @@ import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { promises, readFile, readFileSync } from "node:fs"; import * as path from "@std/path"; -import { assert, assertEquals } from "@std/assert"; +import { assert, assertEquals, assertMatch } from "@std/assert"; const moduleDir = path.dirname(path.fromFileUrl(import.meta.url)); const testData = path.resolve(moduleDir, "testdata", "hello.txt"); @@ -121,3 +121,26 @@ Deno.test("fs.promises.readFile with no arg call rejects with error correctly", // @ts-ignore no arg call needs to be supported await promises.readFile().catch((_e) => {}); }); + +Deno.test("fs.readFile error message contains path + syscall", async () => { + const path = "/does/not/exist"; + const err = await new Promise((resolve) => { + readFile(path, "utf-8", (err) => resolve(err)); + }); + if (err instanceof Error) { + assert(err.message.includes(path), "Path not found in error message"); + assertMatch(err.message, /[,\s]open\s/); + } +}); + +Deno.test("fs.readFileSync error message contains path + syscall", () => { + const path = "/does/not/exist"; + try { + readFileSync(path, "utf-8"); + } catch (err) { + if (err instanceof Error) { + assert(err.message.includes(path), "Path not found in error message"); + assertMatch(err.message, /[,\s]open\s/); + } + } +}); From 5462b5828ddc265dff25add269423d5cbe21024e Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Fri, 22 Nov 2024 22:35:10 +0000 Subject: [PATCH 147/227] fix(lsp): remove stray debug output (#27010) --- cli/lsp/tsc.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index c221a6097b..ae87a9914f 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -4454,11 +4454,7 @@ fn op_load<'s>( == NodeModuleKind::Cjs, }) }; - - lsp_warn!("op_load {} {}", &specifier, maybe_load_response.is_some()); - let serialized = serde_v8::to_v8(scope, maybe_load_response)?; - state.performance.measure(mark); Ok(serialized) } From 9eee2a0e9ef4d11aefba2707e7ef1959df02ac93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Baptista?= <15786310+M4RC3L05@users.noreply.github.com> Date: Fri, 22 Nov 2024 22:57:33 +0000 Subject: [PATCH 148/227] fix(fmt): return `None` if sql fmt result is the same (#27014) Similar with https://github.com/denoland/deno/pull/25848, we need to make `format_sql` to return `None` so we do not flag well formatted sql files as being wrong. Signed-off-by: m4rc3l05 <15786310+M4RC3L05@users.noreply.github.com> --- cli/tools/fmt.rs | 6 +++++- tests/specs/fmt/sql/__test__.jsonc | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index 9c2c709129..c2c2a6bb6b 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -549,7 +549,11 @@ pub fn format_sql( // Add single new line to the end of file. formatted_str.push('\n'); - Ok(Some(formatted_str)) + Ok(if formatted_str == file_text { + None + } else { + Some(formatted_str) + }) } /// Formats a single TS, TSX, JS, JSX, JSONC, JSON, MD, IPYNB or SQL file. diff --git a/tests/specs/fmt/sql/__test__.jsonc b/tests/specs/fmt/sql/__test__.jsonc index a335e79c24..27c08abd83 100644 --- a/tests/specs/fmt/sql/__test__.jsonc +++ b/tests/specs/fmt/sql/__test__.jsonc @@ -7,7 +7,7 @@ }, "flag": { "args": "fmt --unstable-sql", - "output": "[UNORDERED_START]\n[WILDLINE]badly_formatted.sql\n[WILDLINE]well_formatted.sql\n[WILDLINE]wrong_file_ignore.sql\n[UNORDERED_END]\nChecked 7 files\n" + "output": "[UNORDERED_START]\n[WILDLINE]badly_formatted.sql\n[WILDLINE]wrong_file_ignore.sql\n[UNORDERED_END]\nChecked 7 files\n" }, "config_file": { "steps": [{ @@ -18,8 +18,12 @@ "output": "[WILDCARD]" }, { "args": "fmt", - "output": "[UNORDERED_START]\n[WILDLINE]badly_formatted.sql\n[WILDLINE]well_formatted.sql\n[WILDLINE]wrong_file_ignore.sql\n[UNORDERED_END]\nChecked 8 files\n" + "output": "[UNORDERED_START]\n[WILDLINE]badly_formatted.sql\n[WILDLINE]wrong_file_ignore.sql\n[UNORDERED_END]\nChecked 8 files\n" }] + }, + "well_formatted_check": { + "args": "fmt --unstable-sql --check well_formatted.sql", + "output": "Checked 1 file\n" } } } From 9967e75e7e1e1194229a1f1274d1b6f9f30f5ebd Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 22 Nov 2024 18:30:59 -0500 Subject: [PATCH 149/227] chore: update to file_test_runner 0.7.3 (#27016) --- Cargo.lock | 4 ++-- tests/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7947106e66..6e929168f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3086,9 +3086,9 @@ checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" [[package]] name = "file_test_runner" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b23dcc1b671771c6f59fdace6da685735c925f859733e8fd07fba6cae6462a" +checksum = "cf50901549edf2241e33d1715aec0575adc5510a09724877a1e0afe7ffafb0fb" dependencies = [ "anyhow", "crossbeam-channel", diff --git a/tests/Cargo.toml b/tests/Cargo.toml index ede509e380..31cc022ce2 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -45,7 +45,7 @@ deno_semver.workspace = true deno_terminal.workspace = true deno_tls.workspace = true fastwebsockets = { workspace = true, features = ["upgrade", "unstable-split"] } -file_test_runner = "0.7.2" +file_test_runner = "0.7.3" flaky_test = "=0.2.2" hickory-client = "=0.24" hickory-server = "=0.24" From 12b377247be2b74155ded3a678ff2996ef3d7c9f Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Sat, 23 Nov 2024 01:26:30 +0000 Subject: [PATCH 150/227] fix(lsp): wasm file import completions (#27018) --- cli/util/path.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cli/util/path.rs b/cli/util/path.rs index 58bed664f9..173f357c08 100644 --- a/cli/util/path.rs +++ b/cli/util/path.rs @@ -27,7 +27,16 @@ pub fn is_importable_ext(path: &Path) -> bool { if let Some(ext) = get_extension(path) { matches!( ext.as_str(), - "ts" | "tsx" | "js" | "jsx" | "mjs" | "mts" | "cjs" | "cts" | "json" + "ts" + | "tsx" + | "js" + | "jsx" + | "mjs" + | "mts" + | "cjs" + | "cts" + | "json" + | "wasm" ) } else { false @@ -222,6 +231,7 @@ mod test { assert!(is_script_ext(Path::new("foo.cjs"))); assert!(is_script_ext(Path::new("foo.cts"))); assert!(!is_script_ext(Path::new("foo.json"))); + assert!(!is_script_ext(Path::new("foo.wasm"))); assert!(!is_script_ext(Path::new("foo.mjsx"))); } @@ -243,6 +253,7 @@ mod test { assert!(is_importable_ext(Path::new("foo.cjs"))); assert!(is_importable_ext(Path::new("foo.cts"))); assert!(is_importable_ext(Path::new("foo.json"))); + assert!(is_importable_ext(Path::new("foo.wasm"))); assert!(!is_importable_ext(Path::new("foo.mjsx"))); } From 6b7e4c331b5c6b5177a0bb9c76eaf4036e9ed847 Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Mon, 25 Nov 2024 01:02:38 -0500 Subject: [PATCH 151/227] fix(ext/node): add `fs.promises.fstat` and `FileHandle#stat` (#26719) Co-authored-by: Yoshiya Hinosawa --- ext/node/polyfills/_fs/_fs_fstat.ts | 21 +++++++++++++++++++++ ext/node/polyfills/fs.ts | 3 ++- ext/node/polyfills/fs/promises.ts | 1 + ext/node/polyfills/internal/fs/handle.ts | 10 +++++++++- tests/unit_node/_fs/_fs_handle_test.ts | 24 ++++++++++++++++++++++++ 5 files changed, 57 insertions(+), 2 deletions(-) diff --git a/ext/node/polyfills/_fs/_fs_fstat.ts b/ext/node/polyfills/_fs/_fs_fstat.ts index c1722487eb..1a845dfff4 100644 --- a/ext/node/polyfills/_fs/_fs_fstat.ts +++ b/ext/node/polyfills/_fs/_fs_fstat.ts @@ -63,3 +63,24 @@ export function fstatSync( const origin = new FsFile(fd, Symbol.for("Deno.internal.FsFile")).statSync(); return CFISBIS(origin, options?.bigint || false); } + +export function fstatPromise(fd: number): Promise; +export function fstatPromise( + fd: number, + options: { bigint: false }, +): Promise; +export function fstatPromise( + fd: number, + options: { bigint: true }, +): Promise; +export function fstatPromise( + fd: number, + options?: statOptions, +): Stats | BigIntStats { + return new Promise((resolve, reject) => { + fstat(fd, options, (err, stats) => { + if (err) reject(err); + else resolve(stats); + }); + }); +} diff --git a/ext/node/polyfills/fs.ts b/ext/node/polyfills/fs.ts index 7a3cf4e67f..cbdc36afe5 100644 --- a/ext/node/polyfills/fs.ts +++ b/ext/node/polyfills/fs.ts @@ -23,7 +23,7 @@ import Dir from "ext:deno_node/_fs/_fs_dir.ts"; import Dirent from "ext:deno_node/_fs/_fs_dirent.ts"; import { exists, existsSync } from "ext:deno_node/_fs/_fs_exists.ts"; import { fdatasync, fdatasyncSync } from "ext:deno_node/_fs/_fs_fdatasync.ts"; -import { fstat, fstatSync } from "ext:deno_node/_fs/_fs_fstat.ts"; +import { fstat, fstatPromise, fstatSync } from "ext:deno_node/_fs/_fs_fstat.ts"; import { fsync, fsyncSync } from "ext:deno_node/_fs/_fs_fsync.ts"; import { ftruncate, ftruncateSync } from "ext:deno_node/_fs/_fs_ftruncate.ts"; import { futimes, futimesSync } from "ext:deno_node/_fs/_fs_futimes.ts"; @@ -174,6 +174,7 @@ const promises = { lstat: lstatPromise, stat: statPromise, statfs: statfsPromise, + fstat: fstatPromise, link: linkPromise, unlink: unlinkPromise, chmod: chmodPromise, diff --git a/ext/node/polyfills/fs/promises.ts b/ext/node/polyfills/fs/promises.ts index 3e5329dbbe..a5125dac8d 100644 --- a/ext/node/polyfills/fs/promises.ts +++ b/ext/node/polyfills/fs/promises.ts @@ -16,6 +16,7 @@ export const readlink = fsPromises.readlink; export const symlink = fsPromises.symlink; export const lstat = fsPromises.lstat; export const stat = fsPromises.stat; +export const fstat = fsPromises.fstat; export const link = fsPromises.link; export const unlink = fsPromises.unlink; export const chmod = fsPromises.chmod; diff --git a/ext/node/polyfills/internal/fs/handle.ts b/ext/node/polyfills/internal/fs/handle.ts index fc3a7ae205..9ec0fc97e2 100644 --- a/ext/node/polyfills/internal/fs/handle.ts +++ b/ext/node/polyfills/internal/fs/handle.ts @@ -6,6 +6,7 @@ import { EventEmitter } from "node:events"; import { Buffer } from "node:buffer"; import { promises, read, write } from "node:fs"; +export type { BigIntStats, Stats } from "ext:deno_node/_fs/_fs_stat.ts"; import { BinaryOptionsArgument, FileOptionsArgument, @@ -141,6 +142,13 @@ export class FileHandle extends EventEmitter { // Note that Deno.close is not async return Promise.resolve(core.close(this.fd)); } + + stat(): Promise; + stat(options: { bigint: false }): Promise; + stat(options: { bigint: true }): Promise; + stat(options?: { bigint: boolean }): Promise { + return fsCall(promises.fstat, this, options); + } } function fsCall(fn, handle, ...args) { @@ -152,7 +160,7 @@ function fsCall(fn, handle, ...args) { }); } - return fn(handle, ...args); + return fn(handle.fd, ...args); } export default { diff --git a/tests/unit_node/_fs/_fs_handle_test.ts b/tests/unit_node/_fs/_fs_handle_test.ts index 755e091fd7..e26b82aa06 100644 --- a/tests/unit_node/_fs/_fs_handle_test.ts +++ b/tests/unit_node/_fs/_fs_handle_test.ts @@ -93,3 +93,27 @@ Deno.test("[node/fs filehandle.write] Write from string", async function () { assertEquals(res.bytesWritten, 11); assertEquals(decoder.decode(data), "hello world"); }); + +Deno.test("[node/fs filehandle.stat] Get file status", async function () { + const fileHandle = await fs.open(testData); + const stat = await fileHandle.stat(); + + assertEquals(stat.isFile(), true); + assertEquals(stat.size, "hello world".length); + + await fileHandle.close(); +}); + +Deno.test("[node/fs filehandle.writeFile] Write to file", async function () { + const tempFile: string = await Deno.makeTempFile(); + const fileHandle = await fs.open(tempFile, "w"); + + const str = "hello world"; + await fileHandle.writeFile(str); + + const data = Deno.readFileSync(tempFile); + await Deno.remove(tempFile); + await fileHandle.close(); + + assertEquals(decoder.decode(data), "hello world"); +}); From 8ea95c34b5fc7cf0bfe6ea230e4bab9b2504fd2f Mon Sep 17 00:00:00 2001 From: snek Date: Mon, 25 Nov 2024 10:45:06 +0100 Subject: [PATCH 152/227] feat: Instrument Deno.serve (#26964) Add basic trace to Deno.serve. Also updates a bit of the testing infra to make it easier to deal with. --- ext/http/00_serve.ts | 205 ++++++++++++++-------- runtime/js/telemetry.ts | 66 +++---- runtime/ops/otel.rs | 6 +- tests/specs/cli/otel_basic/__test__.jsonc | 12 -- tests/specs/cli/otel_basic/basic.out | 82 +++++++-- tests/specs/cli/otel_basic/main.ts | 35 ++-- 6 files changed, 254 insertions(+), 152 deletions(-) diff --git a/ext/http/00_serve.ts b/ext/http/00_serve.ts index fcdb87d092..766a6d2739 100644 --- a/ext/http/00_serve.ts +++ b/ext/http/00_serve.ts @@ -34,8 +34,11 @@ const { ObjectHasOwn, ObjectPrototypeIsPrototypeOf, PromisePrototypeCatch, + SafePromisePrototypeFinally, PromisePrototypeThen, + String, StringPrototypeIncludes, + StringPrototypeSlice, Symbol, TypeError, TypedArrayPrototypeGetSymbolToStringTag, @@ -513,91 +516,139 @@ function fastSyncResponseOrStream( * This function returns a promise that will only reject in the case of abnormal exit. */ function mapToCallback(context, callback, onError) { - return async function (req) { - const asyncContext = getAsyncContext(); - setAsyncContext(context.asyncContext); - + let mapped = async function (req, span) { + // Get the response from the user-provided callback. If that fails, use onError. If that fails, return a fallback + // 500 error. + let innerRequest; + let response; try { - // Get the response from the user-provided callback. If that fails, use onError. If that fails, return a fallback - // 500 error. - let innerRequest; - let response; - try { - innerRequest = new InnerRequest(req, context); - const request = fromInnerRequest(innerRequest, "immutable"); - innerRequest.request = request; - response = await callback( - request, - new ServeHandlerInfo(innerRequest), - ); + innerRequest = new InnerRequest(req, context); + const request = fromInnerRequest(innerRequest, "immutable"); + innerRequest.request = request; - // Throwing Error if the handler return value is not a Response class + if (span) { + span.updateName(request.method); + span.setAttribute("http.request.method", request.method); + const url = new URL(request.url); + span.setAttribute("url.full", request.url); + span.setAttribute( + "url.scheme", + StringPrototypeSlice(url.protocol, 0, -1), + ); + span.setAttribute("url.path", url.pathname); + span.setAttribute("url.query", StringPrototypeSlice(url.search, 1)); + } + + response = await callback( + request, + new ServeHandlerInfo(innerRequest), + ); + + // Throwing Error if the handler return value is not a Response class + if (!ObjectPrototypeIsPrototypeOf(ResponsePrototype, response)) { + throw new TypeError( + "Return value from serve handler must be a response or a promise resolving to a response", + ); + } + + if (response.type === "error") { + throw new TypeError( + "Return value from serve handler must not be an error response (like Response.error())", + ); + } + + if (response.bodyUsed) { + throw new TypeError( + "The body of the Response returned from the serve handler has already been consumed", + ); + } + } catch (error) { + try { + response = await onError(error); if (!ObjectPrototypeIsPrototypeOf(ResponsePrototype, response)) { throw new TypeError( - "Return value from serve handler must be a response or a promise resolving to a response", - ); - } - - if (response.type === "error") { - throw new TypeError( - "Return value from serve handler must not be an error response (like Response.error())", - ); - } - - if (response.bodyUsed) { - throw new TypeError( - "The body of the Response returned from the serve handler has already been consumed", + "Return value from onError handler must be a response or a promise resolving to a response", ); } } catch (error) { - try { - response = await onError(error); - if (!ObjectPrototypeIsPrototypeOf(ResponsePrototype, response)) { - throw new TypeError( - "Return value from onError handler must be a response or a promise resolving to a response", - ); - } - } catch (error) { - // deno-lint-ignore no-console - console.error("Exception in onError while handling exception", error); - response = internalServerError(); - } + // deno-lint-ignore no-console + console.error("Exception in onError while handling exception", error); + response = internalServerError(); } - const inner = toInnerResponse(response); - if (innerRequest?.[_upgraded]) { - // We're done here as the connection has been upgraded during the callback and no longer requires servicing. - if (response !== UPGRADE_RESPONSE_SENTINEL) { - // deno-lint-ignore no-console - console.error("Upgrade response was not returned from callback"); - context.close(); - } - innerRequest?.[_upgraded](); - return; - } - - // Did everything shut down while we were waiting? - if (context.closed) { - // We're shutting down, so this status shouldn't make it back to the client but "Service Unavailable" seems appropriate - innerRequest?.close(); - op_http_set_promise_complete(req, 503); - return; - } - - const status = inner.status; - const headers = inner.headerList; - if (headers && headers.length > 0) { - if (headers.length == 1) { - op_http_set_response_header(req, headers[0][0], headers[0][1]); - } else { - op_http_set_response_headers(req, headers); - } - } - - fastSyncResponseOrStream(req, inner.body, status, innerRequest); - } finally { - setAsyncContext(asyncContext); } + + if (span) { + span.setAttribute( + "http.response.status_code", + String(response.status), + ); + } + + const inner = toInnerResponse(response); + if (innerRequest?.[_upgraded]) { + // We're done here as the connection has been upgraded during the callback and no longer requires servicing. + if (response !== UPGRADE_RESPONSE_SENTINEL) { + // deno-lint-ignore no-console + console.error("Upgrade response was not returned from callback"); + context.close(); + } + innerRequest?.[_upgraded](); + return; + } + + // Did everything shut down while we were waiting? + if (context.closed) { + // We're shutting down, so this status shouldn't make it back to the client but "Service Unavailable" seems appropriate + innerRequest?.close(); + op_http_set_promise_complete(req, 503); + return; + } + + const status = inner.status; + const headers = inner.headerList; + if (headers && headers.length > 0) { + if (headers.length == 1) { + op_http_set_response_header(req, headers[0][0], headers[0][1]); + } else { + op_http_set_response_headers(req, headers); + } + } + + fastSyncResponseOrStream(req, inner.body, status, innerRequest); }; + + if (internals.telemetry.tracingEnabled) { + const { Span, enterSpan, endSpan } = internals.telemetry; + const origMapped = mapped; + mapped = function (req, _span) { + const oldCtx = getAsyncContext(); + setAsyncContext(context.asyncContext); + const span = new Span("deno.serve"); + try { + enterSpan(span); + return SafePromisePrototypeFinally( + origMapped(req, span), + () => endSpan(span), + ); + } finally { + // equiv to exitSpan. + setAsyncContext(oldCtx); + } + }; + } else { + const origMapped = mapped; + mapped = function (req, span) { + const oldCtx = getAsyncContext(); + setAsyncContext(context.asyncContext); + try { + return origMapped(req, span); + } finally { + setAsyncContext(oldCtx); + } + }; + } + + return mapped; } type RawHandler = ( @@ -795,7 +846,7 @@ function serveHttpOn(context, addr, callback) { // Attempt to pull as many requests out of the queue as possible before awaiting. This API is // a synchronous, non-blocking API that returns u32::MAX if anything goes wrong. while ((req = op_http_try_wait(rid)) !== null) { - PromisePrototypeCatch(callback(req), promiseErrorHandler); + PromisePrototypeCatch(callback(req, undefined), promiseErrorHandler); } currentPromise = op_http_wait(rid); if (!ref) { @@ -815,7 +866,7 @@ function serveHttpOn(context, addr, callback) { if (req === null) { break; } - PromisePrototypeCatch(callback(req), promiseErrorHandler); + PromisePrototypeCatch(callback(req, undefined), promiseErrorHandler); } try { diff --git a/runtime/js/telemetry.ts b/runtime/js/telemetry.ts index ecef3b5e68..96c1c9369f 100644 --- a/runtime/js/telemetry.ts +++ b/runtime/js/telemetry.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { core, primordials } from "ext:core/mod.js"; +import { core, internals, primordials } from "ext:core/mod.js"; import { op_crypto_get_random_values, op_otel_instrumentation_scope_create_and_enter, @@ -32,11 +32,9 @@ const { ObjectDefineProperty, WeakRefPrototypeDeref, String, + StringPrototypePadStart, ObjectPrototypeIsPrototypeOf, - DataView, - DataViewPrototypeSetUint32, SafeWeakRef, - TypedArrayPrototypeGetBuffer, } = primordials; const { AsyncVariable, setAsyncContext } = core; @@ -404,7 +402,7 @@ export class Span { span.#asyncContext = NO_ASYNC_CONTEXT; }; - exitSpan = (span: Span) => { + endSpan = (span: Span) => { const endTime = now(); submit( span.#spanId, @@ -449,39 +447,11 @@ export class Span { const currentSpan: Span | { spanContext(): { traceId: string; spanId: string }; } = CURRENT.get()?.getValue(SPAN_KEY); - if (!currentSpan) { - const buffer = new Uint8Array(TRACE_ID_BYTES + SPAN_ID_BYTES); + if (currentSpan) { if (DETERMINISTIC) { - DataViewPrototypeSetUint32( - new DataView(TypedArrayPrototypeGetBuffer(buffer)), - TRACE_ID_BYTES - 4, - COUNTER, - true, - ); - COUNTER += 1; - DataViewPrototypeSetUint32( - new DataView(TypedArrayPrototypeGetBuffer(buffer)), - TRACE_ID_BYTES + SPAN_ID_BYTES - 4, - COUNTER, - true, - ); - COUNTER += 1; - } else { - op_crypto_get_random_values(buffer); - } - this.#traceId = TypedArrayPrototypeSubarray(buffer, 0, TRACE_ID_BYTES); - this.#spanId = TypedArrayPrototypeSubarray(buffer, TRACE_ID_BYTES); - } else { - this.#spanId = new Uint8Array(SPAN_ID_BYTES); - if (DETERMINISTIC) { - DataViewPrototypeSetUint32( - new DataView(TypedArrayPrototypeGetBuffer(this.#spanId)), - SPAN_ID_BYTES - 4, - COUNTER, - true, - ); - COUNTER += 1; + this.#spanId = StringPrototypePadStart(String(COUNTER++), 16, "0"); } else { + this.#spanId = new Uint8Array(SPAN_ID_BYTES); op_crypto_get_random_values(this.#spanId); } // deno-lint-ignore prefer-primordials @@ -493,6 +463,16 @@ export class Span { this.#traceId = context.traceId; this.#parentSpanId = context.spanId; } + } else { + if (DETERMINISTIC) { + this.#traceId = StringPrototypePadStart(String(COUNTER++), 32, "0"); + this.#spanId = StringPrototypePadStart(String(COUNTER++), 16, "0"); + } else { + const buffer = new Uint8Array(TRACE_ID_BYTES + SPAN_ID_BYTES); + op_crypto_get_random_values(buffer); + this.#traceId = TypedArrayPrototypeSubarray(buffer, 0, TRACE_ID_BYTES); + this.#spanId = TypedArrayPrototypeSubarray(buffer, TRACE_ID_BYTES); + } } } @@ -717,4 +697,16 @@ export function bootstrap( } } -export const telemetry = { SpanExporter, ContextManager }; +export const telemetry = { + SpanExporter, + ContextManager, +}; +internals.telemetry = { + Span, + enterSpan, + exitSpan, + endSpan, + get tracingEnabled() { + return TRACING_ENABLED; + }, +}; diff --git a/runtime/ops/otel.rs b/runtime/ops/otel.rs index 61a7b0ef0d..19f09d9f6d 100644 --- a/runtime/ops/otel.rs +++ b/runtime/ops/otel.rs @@ -835,9 +835,9 @@ fn op_otel_span_set_dropped( #[smi] dropped_events_count: u32, ) { if let Some(temporary_span) = state.try_borrow_mut::() { - temporary_span.0.dropped_attributes_count = dropped_attributes_count; - temporary_span.0.links.dropped_count = dropped_links_count; - temporary_span.0.events.dropped_count = dropped_events_count; + temporary_span.0.dropped_attributes_count += dropped_attributes_count; + temporary_span.0.links.dropped_count += dropped_links_count; + temporary_span.0.events.dropped_count += dropped_events_count; } } diff --git a/tests/specs/cli/otel_basic/__test__.jsonc b/tests/specs/cli/otel_basic/__test__.jsonc index 5a27e92625..991413c3d5 100644 --- a/tests/specs/cli/otel_basic/__test__.jsonc +++ b/tests/specs/cli/otel_basic/__test__.jsonc @@ -2,30 +2,18 @@ "steps": [ { "args": "run -A main.ts basic.ts", - "envs": { - "DENO_UNSTABLE_OTEL_DETERMINISTIC": "1" - }, "output": "basic.out" }, { "args": "run -A main.ts natural_exit.ts", - "envs": { - "DENO_UNSTABLE_OTEL_DETERMINISTIC": "1" - }, "output": "natural_exit.out" }, { "args": "run -A main.ts deno_dot_exit.ts", - "envs": { - "DENO_UNSTABLE_OTEL_DETERMINISTIC": "1" - }, "output": "deno_dot_exit.out" }, { "args": "run -A main.ts uncaught.ts", - "envs": { - "DENO_UNSTABLE_OTEL_DETERMINISTIC": "1" - }, "output": "uncaught.out" } ] diff --git a/tests/specs/cli/otel_basic/basic.out b/tests/specs/cli/otel_basic/basic.out index 3745cb7f35..1883866a1d 100644 --- a/tests/specs/cli/otel_basic/basic.out +++ b/tests/specs/cli/otel_basic/basic.out @@ -1,12 +1,70 @@ { "spans": [ { - "traceId": "10000000000000000000000000000002", - "spanId": "1000000000000003", + "traceId": "00000000000000000000000000000001", + "spanId": "0000000000000002", "traceState": "", - "parentSpanId": "1000000000000001", + "parentSpanId": "", "flags": 1, - "name": "inner span", + "name": "GET", + "kind": 1, + "startTimeUnixNano": "[WILDCARD]", + "endTimeUnixNano": "[WILDCARD]", + "attributes": [ + { + "key": "http.request.method", + "value": { + "stringValue": "GET" + } + }, + { + "key": "url.full", + "value": { + "stringValue": "http://localhost:[WILDCARD]/" + } + }, + { + "key": "url.scheme", + "value": { + "stringValue": "http" + } + }, + { + "key": "url.path", + "value": { + "stringValue": "/" + } + }, + { + "key": "url.query", + "value": { + "stringValue": "" + } + }, + { + "key": "http.response.status_code", + "value": { + "stringValue": "200" + } + } + ], + "droppedAttributesCount": 0, + "events": [], + "droppedEventsCount": 0, + "links": [], + "droppedLinksCount": 0, + "status": { + "message": "", + "code": 0 + } + }, + { + "traceId": "00000000000000000000000000000001", + "spanId": "1000000000000001", + "traceState": "", + "parentSpanId": "0000000000000002", + "flags": 1, + "name": "outer span", "kind": 1, "startTimeUnixNano": "[WILDCARD]", "endTimeUnixNano": "[WILDCARD]", @@ -22,12 +80,12 @@ } }, { - "traceId": "10000000000000000000000000000002", - "spanId": "1000000000000001", + "traceId": "00000000000000000000000000000001", + "spanId": "1000000000000002", "traceState": "", - "parentSpanId": "", + "parentSpanId": "1000000000000001", "flags": 1, - "name": "outer span", + "name": "inner span", "kind": 1, "startTimeUnixNano": "[WILDCARD]", "endTimeUnixNano": "[WILDCARD]", @@ -55,8 +113,8 @@ "attributes": [], "droppedAttributesCount": 0, "flags": 1, - "traceId": "10000000000000000000000000000002", - "spanId": "1000000000000003" + "traceId": "00000000000000000000000000000001", + "spanId": "1000000000000002" }, { "timeUnixNano": "0", @@ -69,8 +127,8 @@ "attributes": [], "droppedAttributesCount": 0, "flags": 1, - "traceId": "10000000000000000000000000000002", - "spanId": "1000000000000003" + "traceId": "00000000000000000000000000000001", + "spanId": "1000000000000002" } ] } diff --git a/tests/specs/cli/otel_basic/main.ts b/tests/specs/cli/otel_basic/main.ts index 5415a7437d..bdbae0cc0e 100644 --- a/tests/specs/cli/otel_basic/main.ts +++ b/tests/specs/cli/otel_basic/main.ts @@ -12,26 +12,39 @@ const server = Deno.serve( const command = new Deno.Command(Deno.execPath(), { args: ["run", "-A", "-q", "--unstable-otel", Deno.args[0]], env: { + DENO_UNSTABLE_OTEL_DETERMINISTIC: "1", OTEL_EXPORTER_OTLP_PROTOCOL: "http/json", OTEL_EXPORTER_OTLP_ENDPOINT: `http://localhost:${port}`, }, stdout: "null", }); const child = command.spawn(); - child.output().then(() => { - server.shutdown(); - - console.log(JSON.stringify(data, null, 2)); - }); + child.output() + .then(() => server.shutdown()) + .then(() => { + data.logs.sort((a, b) => + Number( + BigInt(a.observedTimeUnixNano) - BigInt(b.observedTimeUnixNano), + ) + ); + data.spans.sort((a, b) => + Number(BigInt(`0x${a.spanId}`) - BigInt(`0x${b.spanId}`)) + ); + console.log(JSON.stringify(data, null, 2)); + }); }, async handler(req) { const body = await req.json(); - if (body.resourceLogs) { - data.logs.push(...body.resourceLogs[0].scopeLogs[0].logRecords); - } - if (body.resourceSpans) { - data.spans.push(...body.resourceSpans[0].scopeSpans[0].spans); - } + body.resourceLogs?.forEach((rLogs) => { + rLogs.scopeLogs.forEach((sLogs) => { + data.logs.push(...sLogs.logRecords); + }); + }); + body.resourceSpans?.forEach((rSpans) => { + rSpans.scopeSpans.forEach((sSpans) => { + data.spans.push(...sSpans.spans); + }); + }); return Response.json({ partialSuccess: {} }, { status: 200 }); }, }, From d04d5677d9161373160515ecdabfbbdc4b94d5b7 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Mon, 25 Nov 2024 22:35:53 +0900 Subject: [PATCH 153/227] chore: update node_compat setup script (#27051) This PR updates the node_compat setup script. Now the copied version in each test file is corrected. Also `TODO.md` links to the correct files in Node.js repo. --- tests/node_compat/common.ts | 1 - tests/node_compat/config.jsonc | 1 - tests/node_compat/runner/TODO.md | 6182 ++++++++--------- tests/node_compat/runner/setup.ts | 3 +- tests/node_compat/runner/suite | 2 +- .../node_compat/test/common/child_process.js | 2 +- tests/node_compat/test/common/countdown.js | 2 +- tests/node_compat/test/common/dns.js | 2 +- tests/node_compat/test/common/duplexpair.js | 2 +- tests/node_compat/test/common/fixtures.js | 2 +- tests/node_compat/test/common/hijackstdio.js | 2 +- tests/node_compat/test/common/index.mjs | 2 +- tests/node_compat/test/common/tmpdir.js | 2 +- .../test/fixtures/GH-1899-output.js | 2 +- tests/node_compat/test/fixtures/a.js | 2 +- .../test/fixtures/child-process-persistent.js | 2 +- .../child_process_should_emit_error.js | 2 +- tests/node_compat/test/fixtures/loop.js | 2 +- .../test/internet/test-dns-idna2008.js | 2 +- .../test/internet/test-dns-lookup.js | 2 +- .../internet/test-dns-promises-resolve.js | 2 +- .../test/internet/test-dns-regress-6244.js | 2 +- ...t-dns-setserver-in-callback-of-resolve4.js | 2 +- .../internet/test-http-https-default-ports.js | 2 +- .../test/parallel/test-assert-async.js | 2 +- .../test/parallel/test-assert-fail.js | 2 +- .../parallel/test-assert-strict-exists.js | 2 +- .../test/parallel/test-bad-unicode.js | 2 +- .../test/parallel/test-btoa-atob.js | 2 +- .../test/parallel/test-buffer-ascii.js | 2 +- .../test/parallel/test-buffer-badhex.js | 2 +- .../test/parallel/test-buffer-bigint64.js | 2 +- .../test/parallel/test-buffer-bytelength.js | 2 +- .../parallel/test-buffer-compare-offset.js | 2 +- .../test/parallel/test-buffer-concat.js | 2 +- .../test/parallel/test-buffer-constants.js | 2 +- .../test/parallel/test-buffer-copy.js | 2 +- .../test/parallel/test-buffer-equals.js | 2 +- .../test-buffer-failed-alloc-typed-arrays.js | 2 +- .../test/parallel/test-buffer-fakes.js | 2 +- .../test/parallel/test-buffer-inheritance.js | 2 +- .../test/parallel/test-buffer-isascii.js | 2 +- .../test/parallel/test-buffer-isencoding.js | 2 +- .../test/parallel/test-buffer-isutf8.js | 2 +- .../test/parallel/test-buffer-iterator.js | 2 +- .../test/parallel/test-buffer-new.js | 2 +- .../test-buffer-no-negative-allocation.js | 2 +- .../parallel/test-buffer-nopendingdep-map.js | 2 +- .../parallel/test-buffer-of-no-deprecation.js | 2 +- .../parallel/test-buffer-over-max-length.js | 2 +- .../parallel/test-buffer-parent-property.js | 2 +- .../test/parallel/test-buffer-read.js | 2 +- .../test/parallel/test-buffer-readdouble.js | 2 +- .../test/parallel/test-buffer-readfloat.js | 2 +- .../test/parallel/test-buffer-readint.js | 2 +- .../test/parallel/test-buffer-readuint.js | 2 +- .../test/parallel/test-buffer-safe-unsafe.js | 2 +- .../test/parallel/test-buffer-slice.js | 2 +- .../test/parallel/test-buffer-slow.js | 2 +- .../test/parallel/test-buffer-swap.js | 2 +- .../test/parallel/test-buffer-tojson.js | 2 +- .../parallel/test-buffer-tostring-range.js | 2 +- .../test-buffer-tostring-rangeerror.js | 2 +- .../test/parallel/test-buffer-tostring.js | 2 +- .../test/parallel/test-buffer-writedouble.js | 2 +- .../test/parallel/test-buffer-writefloat.js | 2 +- .../test/parallel/test-buffer-writeint.js | 2 +- .../test/parallel/test-buffer-writeuint.js | 2 +- .../parallel/test-buffer-zero-fill-cli.js | 2 +- .../parallel/test-buffer-zero-fill-reset.js | 2 +- .../test/parallel/test-buffer-zero-fill.js | 2 +- .../test-child-process-default-options.js | 2 +- .../test-child-process-double-pipe.js | 2 +- .../parallel/test-child-process-exec-cwd.js | 2 +- .../parallel/test-child-process-exec-env.js | 2 +- .../parallel/test-child-process-exec-error.js | 2 +- ...-process-exec-stdout-stderr-data-string.js | 2 +- .../test-child-process-execfile-maxbuf.js | 2 +- .../test-child-process-execfilesync-maxbuf.js | 2 +- .../test-child-process-flush-stdio.js | 2 +- .../test-child-process-ipc-next-tick.js | 2 +- .../test/parallel/test-child-process-kill.js | 2 +- .../test-child-process-set-blocking.js | 2 +- .../parallel/test-child-process-spawn-args.js | 2 +- .../test-child-process-spawn-event.js | 2 +- .../test-child-process-spawnsync-args.js | 2 +- .../test-child-process-spawnsync-maxbuf.js | 2 +- ...ild-process-spawnsync-validation-errors.js | 2 +- .../parallel/test-child-process-spawnsync.js | 2 +- .../test-console-async-write-error.js | 2 +- .../test/parallel/test-console-group.js | 2 +- .../test-console-log-stdio-broken-dest.js | 2 +- .../test-console-log-throw-primitive.js | 2 +- .../test-console-no-swallow-stack-overflow.js | 2 +- .../parallel/test-console-sync-write-error.js | 2 +- .../test/parallel/test-console-table.js | 2 +- .../test/parallel/test-console-tty-colors.js | 2 +- .../test/parallel/test-crypto-dh-shared.js | 2 +- .../test/parallel/test-crypto-hash.js | 2 +- .../parallel/test-crypto-secret-keygen.js | 2 +- .../parallel/test-crypto-update-encoding.js | 2 +- .../parallel/test-dgram-close-during-bind.js | 2 +- .../test/parallel/test-dgram-close-signal.js | 2 +- ...est-diagnostics-channel-has-subscribers.js | 2 +- .../parallel/test-diagnostics-channel-net.js | 2 +- ...gnostics-channel-object-channel-pub-sub.js | 2 +- .../test-diagnostics-channel-pub-sub.js | 2 +- .../test-diagnostics-channel-symbol-named.js | 2 +- ...st-diagnostics-channel-sync-unsubscribe.js | 2 +- ...tics-channel-tracing-channel-args-types.js | 2 +- ...nel-tracing-channel-callback-run-stores.js | 2 +- ...nnel-tracing-channel-promise-run-stores.js | 2 +- ...tics-channel-tracing-channel-sync-error.js | 2 +- ...iagnostics-channel-tracing-channel-sync.js | 2 +- .../parallel/test-diagnostics-channel-udp.js | 2 +- .../test/parallel/test-dns-memory-error.js | 2 +- .../test/parallel/test-dns-promises-exists.js | 2 +- .../parallel/test-dns-resolvens-typeerror.js | 2 +- .../test-dns-setservers-type-check.js | 2 +- .../test-eval-strict-referenceerror.js | 2 +- tests/node_compat/test/parallel/test-eval.js | 2 +- .../test-event-emitter-add-listeners.js | 2 +- .../test-event-emitter-emit-context.js | 2 +- .../test-event-emitter-error-monitor.js | 2 +- .../parallel/test-event-emitter-errors.js | 2 +- .../test-event-emitter-get-max-listeners.js | 2 +- .../test-event-emitter-invalid-listener.js | 2 +- .../test-event-emitter-listener-count.js | 2 +- ...st-event-emitter-listeners-side-effects.js | 2 +- .../parallel/test-event-emitter-listeners.js | 2 +- .../test-event-emitter-method-names.js | 2 +- .../test-event-emitter-modify-in-emit.js | 2 +- .../parallel/test-event-emitter-num-args.js | 2 +- .../test/parallel/test-event-emitter-once.js | 2 +- ...test-event-emitter-remove-all-listeners.js | 2 +- .../test-event-emitter-remove-listeners.js | 2 +- ...-emitter-set-max-listeners-side-effects.js | 2 +- .../test-event-emitter-special-event-names.js | 2 +- .../parallel/test-event-emitter-subclass.js | 2 +- .../parallel/test-event-emitter-symbols.js | 2 +- .../test/parallel/test-events-list.js | 2 +- .../parallel/test-events-on-async-iterator.js | 2 +- .../test-events-uncaught-exception-stack.js | 2 +- .../parallel/test-eventtarget-brandcheck.js | 2 +- .../test/parallel/test-exception-handler.js | 2 +- .../test/parallel/test-exception-handler2.js | 2 +- .../test/parallel/test-file-read-noexist.js | 2 +- .../test/parallel/test-file-write-stream.js | 2 +- .../test/parallel/test-file-write-stream2.js | 2 +- .../test/parallel/test-file-write-stream3.js | 2 +- .../test/parallel/test-file-write-stream4.js | 2 +- .../test/parallel/test-fs-access.js | 2 +- .../test/parallel/test-fs-append-file-sync.js | 2 +- .../test/parallel/test-fs-chown-type-check.js | 2 +- .../test/parallel/test-fs-copyfile.js | 2 +- .../test/parallel/test-fs-empty-readStream.js | 2 +- .../test/parallel/test-fs-lchown.js | 2 +- .../test/parallel/test-fs-open-flags.js | 2 +- .../test/parallel/test-fs-open-mode-mask.js | 2 +- .../test/parallel/test-fs-open-no-close.js | 2 +- .../parallel/test-fs-open-numeric-flags.js | 2 +- .../test-fs-promises-writefile-with-fd.js | 2 +- .../parallel/test-fs-read-stream-autoClose.js | 2 +- .../test-fs-read-stream-concurrent-reads.js | 2 +- .../test-fs-read-stream-double-close.js | 2 +- .../parallel/test-fs-read-stream-encoding.js | 2 +- .../test/parallel/test-fs-read-stream-fd.js | 2 +- .../parallel/test-fs-read-stream-inherit.js | 2 +- .../test-fs-read-stream-patch-open.js | 2 +- .../parallel/test-fs-read-stream-resume.js | 2 +- .../test-fs-read-stream-throw-type-error.js | 2 +- .../test/parallel/test-fs-read-type.js | 2 +- .../test/parallel/test-fs-read-zero-length.js | 2 +- .../node_compat/test/parallel/test-fs-read.js | 2 +- .../test-fs-readdir-stack-overflow.js | 2 +- .../test/parallel/test-fs-readdir.js | 2 +- .../test/parallel/test-fs-readfile-empty.js | 2 +- .../test/parallel/test-fs-readv-sync.js | 2 +- .../test/parallel/test-fs-readv.js | 2 +- .../test/parallel/test-fs-realpath-native.js | 2 +- ...fs-rmdir-recursive-sync-warns-not-found.js | 2 +- ...t-fs-rmdir-recursive-sync-warns-on-file.js | 2 +- ...est-fs-rmdir-recursive-throws-not-found.js | 2 +- .../test-fs-rmdir-recursive-throws-on-file.js | 2 +- ...test-fs-rmdir-recursive-warns-not-found.js | 2 +- .../test-fs-rmdir-recursive-warns-on-file.js | 2 +- .../test/parallel/test-fs-rmdir-type-check.js | 2 +- .../test/parallel/test-fs-utimes.js | 2 +- .../test/parallel/test-fs-watchfile.js | 2 +- .../test/parallel/test-fs-write-buffer.js | 2 +- .../parallel/test-fs-write-file-buffer.js | 2 +- .../test-fs-write-file-invalid-path.js | 2 +- .../test/parallel/test-fs-write-file-sync.js | 2 +- .../test/parallel/test-fs-write-no-fd.js | 2 +- .../test-fs-write-stream-autoclose-option.js | 2 +- ...-fs-write-stream-close-without-callback.js | 2 +- .../test-fs-write-stream-double-close.js | 2 +- .../test/parallel/test-fs-write-stream-end.js | 2 +- .../test/parallel/test-fs-write-stream-fs.js | 2 +- .../test-fs-write-stream-throw-type-error.js | 2 +- .../test/parallel/test-fs-write-stream.js | 2 +- .../test/parallel/test-fs-write-sync.js | 2 +- .../test/parallel/test-fs-write.js | 2 +- .../test/parallel/test-fs-writev-sync.js | 2 +- .../parallel/test-handle-wrap-close-abort.js | 2 +- .../test/parallel/test-http-agent-getname.js | 2 +- .../test/parallel/test-http-client-get-url.js | 2 +- .../test-http-client-read-in-error.js | 2 +- .../parallel/test-http-header-validators.js | 2 +- .../test/parallel/test-http-localaddress.js | 2 +- ...tp-outgoing-internal-headernames-getter.js | 2 +- ...tp-outgoing-internal-headernames-setter.js | 2 +- .../test-http-outgoing-internal-headers.js | 2 +- .../test-http-outgoing-renderHeaders.js | 2 +- .../parallel/test-http-outgoing-settimeout.js | 2 +- ....parse-only-support-http-https-protocol.js | 2 +- .../test/parallel/test-icu-transcode.js | 2 +- .../parallel/test-net-access-byteswritten.js | 2 +- ...t-net-better-error-messages-listen-path.js | 2 +- ...net-better-error-messages-port-hostname.js | 2 +- .../test-net-connect-after-destroy.js | 2 +- .../test/parallel/test-net-connect-destroy.js | 2 +- .../test-net-connect-immediate-destroy.js | 2 +- .../test-net-connect-immediate-finish.js | 2 +- .../test/parallel/test-net-connect-no-arg.js | 2 +- .../test/parallel/test-net-dns-error.js | 2 +- .../test/parallel/test-net-during-close.js | 2 +- .../parallel/test-net-end-without-connect.js | 2 +- .../test/parallel/test-net-isip.js | 2 +- .../test/parallel/test-net-isipv4.js | 2 +- .../test/parallel/test-net-isipv6.js | 2 +- ...n-close-server-callback-is-not-function.js | 2 +- .../parallel/test-net-listen-close-server.js | 2 +- .../test/parallel/test-net-listening.js | 2 +- .../test/parallel/test-net-localerror.js | 2 +- .../test/parallel/test-net-options-lookup.js | 2 +- .../parallel/test-net-pipe-connect-errors.js | 2 +- .../test-net-server-listen-options-signal.js | 2 +- .../test-net-server-listen-options.js | 2 +- .../test-net-server-listen-remove-callback.js | 2 +- .../test/parallel/test-net-server-options.js | 2 +- .../test-net-server-unref-persistent.js | 2 +- .../test/parallel/test-net-server-unref.js | 2 +- .../parallel/test-net-socket-destroy-twice.js | 2 +- .../test-net-socket-no-halfopen-enforcer.js | 2 +- .../parallel/test-net-socket-setnodelay.js | 2 +- .../parallel/test-net-timeout-no-handle.js | 2 +- .../parallel/test-next-tick-doesnt-hang.js | 2 +- .../test-next-tick-fixed-queue-regression.js | 2 +- .../test-next-tick-intentional-starvation.js | 2 +- .../test/parallel/test-next-tick-ordering.js | 2 +- .../test/parallel/test-next-tick-ordering2.js | 2 +- .../parallel/test-next-tick-when-exiting.js | 2 +- .../test/parallel/test-next-tick.js | 2 +- .../test/parallel/test-nodeeventtarget.js | 2 +- tests/node_compat/test/parallel/test-os.js | 2 +- .../parallel/test-outgoing-message-destroy.js | 2 +- .../parallel/test-outgoing-message-pipe.js | 2 +- .../test/parallel/test-parse-args.mjs | 2 +- .../test/parallel/test-path-basename.js | 2 +- .../test/parallel/test-path-dirname.js | 2 +- .../test/parallel/test-path-extname.js | 2 +- .../test/parallel/test-path-isabsolute.js | 2 +- .../test/parallel/test-path-join.js | 2 +- .../test/parallel/test-path-makelong.js | 2 +- .../test/parallel/test-path-normalize.js | 2 +- .../test/parallel/test-path-parse-format.js | 2 +- .../test/parallel/test-path-posix-exists.js | 2 +- .../test/parallel/test-path-relative.js | 2 +- .../test/parallel/test-path-win32-exists.js | 2 +- .../parallel/test-path-zero-length-strings.js | 2 +- tests/node_compat/test/parallel/test-path.js | 2 +- .../test/parallel/test-process-beforeexit.js | 2 +- ...ocess-binding-internalbinding-allowlist.js | 2 +- .../test-process-env-allowed-flags.js | 2 +- .../test-process-exit-from-before-exit.js | 2 +- .../parallel/test-process-exit-handler.js | 2 +- .../parallel/test-process-exit-recursive.js | 2 +- .../test/parallel/test-process-exit.js | 2 +- .../test/parallel/test-process-kill-pid.js | 2 +- .../test/parallel/test-process-uptime.js | 2 +- .../parallel/test-promise-unhandled-silent.js | 2 +- .../test-promise-unhandled-throw-handler.js | 2 +- .../test/parallel/test-punycode.js | 2 +- .../test/parallel/test-querystring-escape.js | 2 +- .../test-querystring-maxKeys-non-finite.js | 2 +- .../test-querystring-multichar-separator.js | 2 +- .../test-readline-emit-keypress-events.js | 2 +- ...st-readline-interface-escapecodetimeout.js | 2 +- .../test/parallel/test-readline-keys.js | 2 +- .../test/parallel/test-readline-position.js | 2 +- .../test/parallel/test-readline-reopen.js | 2 +- .../parallel/test-readline-set-raw-mode.js | 2 +- .../test-readline-undefined-columns.js | 2 +- .../test/parallel/test-readline.js | 2 +- .../parallel/test-stream-add-abort-signal.js | 2 +- .../parallel/test-stream-aliases-legacy.js | 2 +- .../test/parallel/test-stream-auto-destroy.js | 2 +- ...riters-in-synchronously-recursion-write.js | 2 +- .../test/parallel/test-stream-backpressure.js | 2 +- .../test/parallel/test-stream-big-packet.js | 2 +- .../test/parallel/test-stream-big-push.js | 2 +- .../test/parallel/test-stream-construct.js | 2 +- .../test-stream-destroy-event-order.js | 2 +- .../parallel/test-stream-duplex-destroy.js | 2 +- .../test/parallel/test-stream-duplex-end.js | 2 +- .../test/parallel/test-stream-duplex-props.js | 2 +- .../test-stream-duplex-readable-end.js | 2 +- .../test-stream-duplex-writable-finished.js | 2 +- .../test/parallel/test-stream-duplex.js | 2 +- .../test/parallel/test-stream-end-paused.js | 2 +- .../test/parallel/test-stream-error-once.js | 2 +- .../parallel/test-stream-events-prepend.js | 2 +- .../test/parallel/test-stream-inheritance.js | 2 +- .../test/parallel/test-stream-ispaused.js | 2 +- .../test-stream-objectmode-undefined.js | 2 +- .../test-stream-once-readable-pipe.js | 2 +- .../parallel/test-stream-pipe-after-end.js | 2 +- ...t-stream-pipe-await-drain-manual-resume.js | 2 +- ...tream-pipe-await-drain-push-while-write.js | 2 +- .../parallel/test-stream-pipe-await-drain.js | 2 +- .../test-stream-pipe-cleanup-pause.js | 2 +- .../test/parallel/test-stream-pipe-cleanup.js | 2 +- .../test-stream-pipe-error-handling.js | 2 +- .../test/parallel/test-stream-pipe-event.js | 2 +- .../test-stream-pipe-flow-after-unpipe.js | 2 +- .../test/parallel/test-stream-pipe-flow.js | 2 +- .../test-stream-pipe-manual-resume.js | 2 +- .../test-stream-pipe-multiple-pipes.js | 2 +- .../parallel/test-stream-pipe-needDrain.js | 2 +- ...test-stream-pipe-same-destination-twice.js | 2 +- .../test-stream-pipe-unpipe-streams.js | 2 +- .../test-stream-pipe-without-listenerCount.js | 2 +- .../test-stream-pipeline-async-iterator.js | 2 +- ...t-stream-pipeline-queued-end-in-destroy.js | 2 +- .../test-stream-pipeline-with-empty-string.js | 2 +- .../test/parallel/test-stream-push-strings.js | 2 +- .../parallel/test-stream-readable-aborted.js | 2 +- ...t-stream-readable-add-chunk-during-data.js | 2 +- ...stream-readable-constructor-set-methods.js | 2 +- .../parallel/test-stream-readable-data.js | 2 +- .../parallel/test-stream-readable-destroy.js | 2 +- .../parallel/test-stream-readable-didRead.js | 2 +- ...eam-readable-emit-readable-short-stream.js | 2 +- .../test-stream-readable-emittedReadable.js | 2 +- .../test-stream-readable-end-destroyed.js | 2 +- .../parallel/test-stream-readable-ended.js | 2 +- .../test-stream-readable-error-end.js | 2 +- .../parallel/test-stream-readable-event.js | 2 +- .../test-stream-readable-flow-recursion.js | 2 +- .../test-stream-readable-hwm-0-async.js | 2 +- ...test-stream-readable-hwm-0-no-flow-data.js | 2 +- .../parallel/test-stream-readable-hwm-0.js | 2 +- .../test-stream-readable-infinite-read.js | 2 +- .../test-stream-readable-invalid-chunk.js | 2 +- .../test-stream-readable-needReadable.js | 2 +- .../test-stream-readable-next-no-null.js | 2 +- ...st-stream-readable-no-unneeded-readable.js | 2 +- ...stream-readable-object-multi-push-async.js | 2 +- .../test-stream-readable-pause-and-resume.js | 2 +- ...st-stream-readable-readable-then-resume.js | 2 +- .../parallel/test-stream-readable-readable.js | 2 +- ...est-stream-readable-reading-readingMore.js | 2 +- .../test-stream-readable-resume-hwm.js | 2 +- .../test-stream-readable-resumeScheduled.js | 2 +- ...m-readable-setEncoding-existing-buffers.js | 2 +- .../test-stream-readable-setEncoding-null.js | 2 +- .../parallel/test-stream-readable-unshift.js | 2 +- ...tream-readable-with-unimplemented-_read.js | 2 +- .../test-stream-readableListening-state.js | 2 +- .../test-stream-transform-callback-twice.js | 2 +- ...tream-transform-constructor-set-methods.js | 2 +- .../parallel/test-stream-transform-destroy.js | 2 +- .../test-stream-transform-final-sync.js | 2 +- .../parallel/test-stream-transform-final.js | 2 +- .../test-stream-transform-flush-data.js | 2 +- ...tream-transform-objectmode-falsey-value.js | 2 +- ...st-stream-transform-split-highwatermark.js | 2 +- .../test-stream-transform-split-objectmode.js | 2 +- .../test/parallel/test-stream-uint8array.js | 2 +- .../test/parallel/test-stream-unpipe-event.js | 2 +- .../test-stream-unshift-empty-chunk.js | 2 +- .../parallel/test-stream-unshift-read-race.js | 2 +- .../parallel/test-stream-writable-aborted.js | 2 +- ...stream-writable-change-default-encoding.js | 2 +- .../test-stream-writable-clear-buffer.js | 2 +- ...stream-writable-constructor-set-methods.js | 2 +- .../test-stream-writable-decoded-encoding.js | 2 +- .../parallel/test-stream-writable-destroy.js | 2 +- .../test-stream-writable-end-cb-error.js | 2 +- .../test-stream-writable-end-multiple.js | 2 +- .../test-stream-writable-ended-state.js | 2 +- .../test-stream-writable-final-async.js | 2 +- .../test-stream-writable-final-destroy.js | 2 +- .../test-stream-writable-final-throw.js | 2 +- .../test-stream-writable-finish-destroyed.js | 2 +- .../test-stream-writable-finished-state.js | 2 +- .../parallel/test-stream-writable-finished.js | 2 +- .../test-stream-writable-invalid-chunk.js | 2 +- .../test-stream-writable-needdrain-state.js | 2 +- .../parallel/test-stream-writable-null.js | 2 +- .../test-stream-writable-properties.js | 2 +- .../parallel/test-stream-writable-writable.js | 2 +- .../test-stream-writable-write-cb-error.js | 2 +- .../test-stream-writable-write-cb-twice.js | 2 +- .../test-stream-writable-write-error.js | 2 +- ...est-stream-writable-write-writev-finish.js | 2 +- .../test-stream-writableState-ending.js | 2 +- ...ableState-uncorked-bufferedRequestCount.js | 2 +- .../parallel/test-stream-write-destroy.js | 2 +- .../test/parallel/test-stream-write-drain.js | 2 +- .../test/parallel/test-stream-write-final.js | 2 +- .../test/parallel/test-stream-writev.js | 2 +- ...est-stream2-base64-single-char-read-end.js | 2 +- .../test/parallel/test-stream2-basic.js | 2 +- .../parallel/test-stream2-compatibility.js | 2 +- .../parallel/test-stream2-decode-partial.js | 2 +- .../test/parallel/test-stream2-finish-pipe.js | 2 +- .../parallel/test-stream2-large-read-stall.js | 2 +- .../test/parallel/test-stream2-objects.js | 2 +- .../test-stream2-pipe-error-handling.js | 2 +- .../test-stream2-pipe-error-once-listener.js | 2 +- .../test/parallel/test-stream2-push.js | 2 +- .../parallel/test-stream2-read-sync-stack.js | 2 +- ...st-stream2-readable-empty-buffer-no-eof.js | 2 +- .../test-stream2-readable-legacy-drain.js | 2 +- .../test-stream2-readable-non-empty-end.js | 2 +- .../test-stream2-readable-wrap-destroy.js | 2 +- .../test-stream2-readable-wrap-empty.js | 2 +- .../test-stream2-readable-wrap-error.js | 2 +- .../parallel/test-stream2-readable-wrap.js | 2 +- .../parallel/test-stream2-set-encoding.js | 2 +- .../test/parallel/test-stream2-transform.js | 2 +- .../parallel/test-stream2-unpipe-drain.js | 2 +- .../test/parallel/test-stream2-unpipe-leak.js | 2 +- .../test/parallel/test-stream2-writable.js | 2 +- .../test/parallel/test-stream3-cork-end.js | 2 +- .../test/parallel/test-stream3-cork-uncork.js | 2 +- .../parallel/test-stream3-pause-then-read.js | 2 +- .../parallel/test-streams-highwatermark.js | 2 +- .../test/parallel/test-string-decoder.js | 2 +- .../test/parallel/test-timers-api-refs.js | 2 +- .../test/parallel/test-timers-args.js | 2 +- ...-timers-clear-null-does-not-throw-error.js | 2 +- ...imers-clear-object-does-not-throw-error.js | 2 +- ...imers-clear-timeout-interval-equivalent.js | 2 +- .../parallel/test-timers-clearImmediate.js | 2 +- .../parallel/test-timers-interval-throw.js | 2 +- .../parallel/test-timers-non-integer-delay.js | 2 +- .../test/parallel/test-timers-refresh.js | 2 +- ...-timers-same-timeout-wrong-list-deleted.js | 2 +- .../test-timers-timeout-with-non-integer.js | 2 +- .../test-timers-uncaught-exception.js | 2 +- .../test-timers-unref-throw-then-ref.js | 2 +- .../test/parallel/test-timers-user-call.js | 2 +- .../test/parallel/test-timers-zero-timeout.js | 2 +- .../test/parallel/test-tty-stdin-end.js | 2 +- .../parallel/test-url-domain-ascii-unicode.js | 2 +- .../test/parallel/test-url-fileurltopath.js | 2 +- .../parallel/test-url-format-invalid-input.js | 2 +- .../test/parallel/test-url-format-whatwg.js | 2 +- .../test/parallel/test-url-format.js | 2 +- .../test/parallel/test-url-parse-query.js | 2 +- .../test/parallel/test-url-pathtofileurl.js | 2 +- .../test/parallel/test-url-relative.js | 2 +- .../test-util-deprecate-invalid-code.js | 2 +- .../test/parallel/test-util-deprecate.js | 2 +- .../test/parallel/test-util-inherits.js | 2 +- .../test-util-inspect-long-running.js | 2 +- .../test/parallel/test-util-types-exists.js | 2 +- .../parallel/test-vm-access-process-env.js | 2 +- ...t-vm-attributes-property-not-on-sandbox.js | 2 +- .../test/parallel/test-vm-codegen.js | 2 +- .../parallel/test-vm-context-async-script.js | 2 +- .../test-vm-context-property-forwarding.js | 2 +- .../test-vm-create-and-run-in-context.js | 2 +- .../test-vm-create-context-accessors.js | 2 +- .../parallel/test-vm-create-context-arg.js | 2 +- ...st-vm-create-context-circular-reference.js | 2 +- .../test/parallel/test-vm-createcacheddata.js | 2 +- .../test/parallel/test-vm-cross-context.js | 2 +- .../test-vm-data-property-writable.js | 2 +- .../parallel/test-vm-deleting-property.js | 2 +- .../parallel/test-vm-function-declaration.js | 2 +- .../parallel/test-vm-function-redefinition.js | 2 +- .../test/parallel/test-vm-getters.js | 2 +- .../parallel/test-vm-global-assignment.js | 2 +- .../test-vm-global-define-property.js | 2 +- .../test/parallel/test-vm-global-identity.js | 2 +- .../test/parallel/test-vm-global-setter.js | 2 +- .../test/parallel/test-vm-harmony-symbols.js | 2 +- .../parallel/test-vm-indexed-properties.js | 2 +- .../parallel/test-vm-inherited_properties.js | 2 +- .../test/parallel/test-vm-is-context.js | 2 +- .../test/parallel/test-vm-low-stack-space.js | 2 +- .../test-vm-new-script-new-context.js | 2 +- .../test-vm-new-script-this-context.js | 2 +- .../test/parallel/test-vm-not-strict.js | 2 +- .../parallel/test-vm-options-validation.js | 2 +- ...st-vm-parse-abort-on-uncaught-exception.js | 2 +- .../parallel/test-vm-preserves-property.js | 2 +- .../test-vm-property-not-on-sandbox.js | 2 +- .../test/parallel/test-vm-proxies.js | 2 +- .../test/parallel/test-vm-proxy-failure-CP.js | 2 +- .../test-vm-script-throw-in-tostring.js | 2 +- .../parallel/test-vm-set-property-proxy.js | 2 +- .../test-vm-set-proto-null-on-globalthis.js | 2 +- .../test/parallel/test-vm-source-map-url.js | 2 +- .../test/parallel/test-vm-static-this.js | 2 +- .../test/parallel/test-vm-strict-mode.js | 2 +- .../test/parallel/test-vm-symbols.js | 2 +- .../test-vm-timeout-escape-promise-2.js | 2 +- .../test-vm-timeout-escape-promise.js | 2 +- .../test/parallel/test-vm-timeout.js | 2 +- .../test-whatwg-encoding-custom-api-basics.js | 2 +- ...g-encoding-custom-textdecoder-ignorebom.js | 2 +- ...g-encoding-custom-textdecoder-streaming.js | 2 +- ...ents-add-event-listener-options-passive.js | 2 +- ...vents-add-event-listener-options-signal.js | 2 +- .../test-whatwg-events-customevent.js | 2 +- .../test-whatwg-url-custom-deepequal.js | 2 +- .../parallel/test-whatwg-url-custom-global.js | 2 +- ...test-whatwg-url-custom-href-side-effect.js | 2 +- .../test-whatwg-url-custom-tostringtag.js | 2 +- .../test-whatwg-url-override-hostname.js | 2 +- ...rker-message-port-infinite-message-loop.js | 2 +- ...essage-port-multiple-sharedarraybuffers.js | 2 +- .../parallel/test-zlib-close-after-error.js | 2 +- .../parallel/test-zlib-close-after-write.js | 2 +- .../test-zlib-deflate-raw-inherits.js | 2 +- .../test/parallel/test-zlib-destroy-pipe.js | 2 +- .../test/parallel/test-zlib-from-string.js | 2 +- .../test/parallel/test-zlib-no-stream.js | 2 +- .../test/parallel/test-zlib-sync-no-event.js | 2 +- .../test/parallel/test-zlib-truncated.js | 2 +- .../test-zlib-unzip-one-byte-chunks.js | 2 +- .../parallel/test-zlib-write-after-end.js | 2 +- .../test/pseudo-tty/console-dumb-tty.js | 2 +- .../test/pseudo-tty/console_colors.js | 2 +- .../test/pseudo-tty/no_dropped_stdio.js | 2 +- .../test/pseudo-tty/no_interleaved_stdio.js | 2 +- .../test-tty-color-support-warning-2.js | 2 +- .../test-tty-color-support-warning.js | 2 +- .../test/pseudo-tty/test-tty-stdin-end.js | 2 +- .../test/pseudo-tty/test-tty-stdout-end.js | 2 +- 545 files changed, 3634 insertions(+), 3635 deletions(-) diff --git a/tests/node_compat/common.ts b/tests/node_compat/common.ts index 9f56744fa7..75a06566a6 100644 --- a/tests/node_compat/common.ts +++ b/tests/node_compat/common.ts @@ -12,7 +12,6 @@ import * as JSONC from "@std/jsonc"; type TestSuites = Record; interface Config { - nodeVersion: string; /** Ignored files won't regenerated by the update script */ ignore: TestSuites; /** diff --git a/tests/node_compat/config.jsonc b/tests/node_compat/config.jsonc index 31b1845050..d163765daa 100644 --- a/tests/node_compat/config.jsonc +++ b/tests/node_compat/config.jsonc @@ -1,5 +1,4 @@ { - "nodeVersion": "18.12.1", "ignore": { "common": ["index.js", "internet.js"], "fixtures": [ diff --git a/tests/node_compat/runner/TODO.md b/tests/node_compat/runner/TODO.md index cb7e6034b9..135d45dd8f 100644 --- a/tests/node_compat/runner/TODO.md +++ b/tests/node_compat/runner/TODO.md @@ -3,3094 +3,3094 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/config.json` and run `deno task setup` in `tests/node_compat/runner` dir instead. -- [abort/test-abort-backtrace.js](https://github.com/nodejs/node/tree/v18.12.1/test/abort/test-abort-backtrace.js) -- [abort/test-abort-fatal-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/abort/test-abort-fatal-error.js) -- [abort/test-abort-uncaught-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/abort/test-abort-uncaught-exception.js) -- [abort/test-addon-register-signal-handler.js](https://github.com/nodejs/node/tree/v18.12.1/test/abort/test-addon-register-signal-handler.js) -- [abort/test-addon-uv-handle-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/abort/test-addon-uv-handle-leak.js) -- [abort/test-http-parser-consume.js](https://github.com/nodejs/node/tree/v18.12.1/test/abort/test-http-parser-consume.js) -- [abort/test-process-abort-exitcode.js](https://github.com/nodejs/node/tree/v18.12.1/test/abort/test-process-abort-exitcode.js) -- [abort/test-signal-handler.js](https://github.com/nodejs/node/tree/v18.12.1/test/abort/test-signal-handler.js) -- [abort/test-worker-abort-uncaught-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/abort/test-worker-abort-uncaught-exception.js) -- [abort/test-zlib-invalid-internals-usage.js](https://github.com/nodejs/node/tree/v18.12.1/test/abort/test-zlib-invalid-internals-usage.js) -- [benchmark/test-bechmark-readline.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-bechmark-readline.js) -- [benchmark/test-benchmark-assert.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-assert.js) -- [benchmark/test-benchmark-async-hooks.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-async-hooks.js) -- [benchmark/test-benchmark-blob.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-blob.js) -- [benchmark/test-benchmark-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-buffer.js) -- [benchmark/test-benchmark-child-process.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-child-process.js) -- [benchmark/test-benchmark-cluster.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-cluster.js) -- [benchmark/test-benchmark-crypto.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-crypto.js) -- [benchmark/test-benchmark-dgram.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-dgram.js) -- [benchmark/test-benchmark-dns.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-dns.js) -- [benchmark/test-benchmark-domain.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-domain.js) -- [benchmark/test-benchmark-es.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-es.js) -- [benchmark/test-benchmark-esm.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-esm.js) -- [benchmark/test-benchmark-events.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-events.js) -- [benchmark/test-benchmark-fs.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-fs.js) -- [benchmark/test-benchmark-http.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-http.js) -- [benchmark/test-benchmark-http2.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-http2.js) -- [benchmark/test-benchmark-mime.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-mime.js) -- [benchmark/test-benchmark-misc.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-misc.js) -- [benchmark/test-benchmark-module.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-module.js) -- [benchmark/test-benchmark-napi.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-napi.js) -- [benchmark/test-benchmark-net.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-net.js) -- [benchmark/test-benchmark-os.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-os.js) -- [benchmark/test-benchmark-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-path.js) -- [benchmark/test-benchmark-policy.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-policy.js) -- [benchmark/test-benchmark-process.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-process.js) -- [benchmark/test-benchmark-querystring.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-querystring.js) -- [benchmark/test-benchmark-streams.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-streams.js) -- [benchmark/test-benchmark-string_decoder.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-string_decoder.js) -- [benchmark/test-benchmark-timers.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-timers.js) -- [benchmark/test-benchmark-tls.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-tls.js) -- [benchmark/test-benchmark-url.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-url.js) -- [benchmark/test-benchmark-util.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-util.js) -- [benchmark/test-benchmark-v8.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-v8.js) -- [benchmark/test-benchmark-validators.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-validators.js) -- [benchmark/test-benchmark-vm.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-vm.js) -- [benchmark/test-benchmark-webstreams.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-webstreams.js) -- [benchmark/test-benchmark-worker.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-worker.js) -- [benchmark/test-benchmark-zlib.js](https://github.com/nodejs/node/tree/v18.12.1/test/benchmark/test-benchmark-zlib.js) -- [es-module/test-cjs-esm-warn.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-cjs-esm-warn.js) -- [es-module/test-cjs-legacyMainResolve-permission.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-cjs-legacyMainResolve-permission.js) -- [es-module/test-cjs-legacyMainResolve.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-cjs-legacyMainResolve.js) -- [es-module/test-cjs-prototype-pollution.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-cjs-prototype-pollution.js) -- [es-module/test-dynamic-import-script-lifetime.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-dynamic-import-script-lifetime.js) -- [es-module/test-esm-assertionless-json-import.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-assertionless-json-import.js) -- [es-module/test-esm-cjs-builtins.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-cjs-builtins.js) -- [es-module/test-esm-cjs-exports.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-cjs-exports.js) -- [es-module/test-esm-cjs-main.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-cjs-main.js) -- [es-module/test-esm-data-urls.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-data-urls.js) -- [es-module/test-esm-dynamic-import-attribute.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-dynamic-import-attribute.js) -- [es-module/test-esm-dynamic-import-commonjs.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-dynamic-import-commonjs.js) -- [es-module/test-esm-dynamic-import-mutating-fs.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-dynamic-import-mutating-fs.js) -- [es-module/test-esm-dynamic-import.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-dynamic-import.js) -- [es-module/test-esm-encoded-path-native.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-encoded-path-native.js) -- [es-module/test-esm-error-cache.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-error-cache.js) -- [es-module/test-esm-import-attributes-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-import-attributes-errors.js) -- [es-module/test-esm-import-attributes-validation.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-import-attributes-validation.js) -- [es-module/test-esm-invalid-data-urls.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-invalid-data-urls.js) -- [es-module/test-esm-invalid-pjson.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-invalid-pjson.js) -- [es-module/test-esm-loader-cache-clearing.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-loader-cache-clearing.js) -- [es-module/test-esm-loader-modulemap.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-loader-modulemap.js) -- [es-module/test-esm-loader-search.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-loader-search.js) -- [es-module/test-esm-named-exports.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-named-exports.js) -- [es-module/test-esm-preserve-symlinks-main.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-preserve-symlinks-main.js) -- [es-module/test-esm-preserve-symlinks.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-preserve-symlinks.js) -- [es-module/test-esm-repl-imports.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-repl-imports.js) -- [es-module/test-esm-repl.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-repl.js) -- [es-module/test-esm-symlink-main.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-symlink-main.js) -- [es-module/test-esm-symlink-type.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-symlink-type.js) -- [es-module/test-esm-symlink.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-symlink.js) -- [es-module/test-esm-type-field-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-type-field-errors.js) -- [es-module/test-esm-undefined-cjs-global-like-variables.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-undefined-cjs-global-like-variables.js) -- [es-module/test-esm-unknown-extension.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-unknown-extension.js) -- [es-module/test-esm-url-extname.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-url-extname.js) -- [es-module/test-esm-windows.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-esm-windows.js) -- [es-module/test-loaders-hidden-from-users.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-loaders-hidden-from-users.js) -- [es-module/test-vm-compile-function-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-vm-compile-function-leak.js) -- [es-module/test-vm-compile-function-lineoffset.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-vm-compile-function-lineoffset.js) -- [es-module/test-vm-contextified-script-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-vm-contextified-script-leak.js) -- [es-module/test-vm-source-text-module-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-vm-source-text-module-leak.js) -- [es-module/test-vm-synthetic-module-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-vm-synthetic-module-leak.js) -- [es-module/test-wasm-memory-out-of-bound.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-wasm-memory-out-of-bound.js) -- [es-module/test-wasm-simple.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-wasm-simple.js) -- [es-module/test-wasm-web-api.js](https://github.com/nodejs/node/tree/v18.12.1/test/es-module/test-wasm-web-api.js) -- [internet/test-corepack-yarn-install.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-corepack-yarn-install.js) -- [internet/test-dgram-broadcast-multi-process.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-dgram-broadcast-multi-process.js) -- [internet/test-dgram-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-dgram-connect.js) -- [internet/test-dgram-membership.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-dgram-membership.js) -- [internet/test-dgram-multicast-multi-process.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-dgram-multicast-multi-process.js) -- [internet/test-dgram-multicast-set-interface-lo.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-dgram-multicast-set-interface-lo.js) -- [internet/test-dgram-multicast-ssm-multi-process.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-dgram-multicast-ssm-multi-process.js) -- [internet/test-dgram-multicast-ssmv6-multi-process.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-dgram-multicast-ssmv6-multi-process.js) -- [internet/test-dns-any.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-dns-any.js) -- [internet/test-dns-cares-domains.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-dns-cares-domains.js) -- [internet/test-dns-getDefaultResultOrder.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-dns-getDefaultResultOrder.js) -- [internet/test-dns-ipv4.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-dns-ipv4.js) -- [internet/test-dns-ipv6.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-dns-ipv6.js) -- [internet/test-dns-txt-sigsegv.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-dns-txt-sigsegv.js) -- [internet/test-dns.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-dns.js) -- [internet/test-http-dns-fail.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-http-dns-fail.js) -- [internet/test-http2-issue-32922.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-http2-issue-32922.js) -- [internet/test-https-autoselectfamily-slow-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-https-autoselectfamily-slow-timeout.js) -- [internet/test-https-issue-43963.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-https-issue-43963.js) -- [internet/test-inspector-help-page.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-inspector-help-page.js) -- [internet/test-net-autoselectfamily-timeout-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-net-autoselectfamily-timeout-close.js) -- [internet/test-net-connect-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-net-connect-timeout.js) -- [internet/test-net-connect-unref.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-net-connect-unref.js) -- [internet/test-snapshot-dns-lookup.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-snapshot-dns-lookup.js) -- [internet/test-snapshot-dns-resolve.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-snapshot-dns-resolve.js) -- [internet/test-tls-add-ca-cert.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-tls-add-ca-cert.js) -- [internet/test-tls-autoselectfamily-backing-socket.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-tls-autoselectfamily-backing-socket.js) -- [internet/test-tls-autoselectfamily-servername.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-tls-autoselectfamily-servername.js) -- [internet/test-trace-events-dns.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-trace-events-dns.js) -- [internet/test-uv-threadpool-schedule.js](https://github.com/nodejs/node/tree/v18.12.1/test/internet/test-uv-threadpool-schedule.js) -- [known_issues/test-cli-print-var-crypto.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-cli-print-var-crypto.js) -- [known_issues/test-cwd-enoent-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-cwd-enoent-file.js) -- [known_issues/test-dgram-bind-shared-ports-after-port-0.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-dgram-bind-shared-ports-after-port-0.js) -- [known_issues/test-fs-writeFileSync-invalid-windows.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-fs-writeFileSync-invalid-windows.js) -- [known_issues/test-http-path-contains-unicode.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-http-path-contains-unicode.js) -- [known_issues/test-inspector-cluster-port-clash.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-inspector-cluster-port-clash.js) -- [known_issues/test-permission-model-path-resolution.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-permission-model-path-resolution.js) -- [known_issues/test-repl-require-context.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-repl-require-context.js) -- [known_issues/test-stdin-is-always-net.socket.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-stdin-is-always-net.socket.js) -- [known_issues/test-stream-writable-sync-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-stream-writable-sync-error.js) -- [known_issues/test-url-parse-conformance.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-url-parse-conformance.js) -- [known_issues/test-vm-function-declaration-uses-define.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-vm-function-declaration-uses-define.js) -- [known_issues/test-vm-ownkeys.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-vm-ownkeys.js) -- [known_issues/test-vm-ownpropertynames.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-vm-ownpropertynames.js) -- [known_issues/test-vm-ownpropertysymbols.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-vm-ownpropertysymbols.js) -- [known_issues/test-vm-timeout-escape-nexttick.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-vm-timeout-escape-nexttick.js) -- [known_issues/test-vm-timeout-escape-queuemicrotask.js](https://github.com/nodejs/node/tree/v18.12.1/test/known_issues/test-vm-timeout-escape-queuemicrotask.js) -- [message/assert_throws_stack.js](https://github.com/nodejs/node/tree/v18.12.1/test/message/assert_throws_stack.js) -- [message/eval_messages.js](https://github.com/nodejs/node/tree/v18.12.1/test/message/eval_messages.js) -- [message/internal_assert.js](https://github.com/nodejs/node/tree/v18.12.1/test/message/internal_assert.js) -- [message/internal_assert_fail.js](https://github.com/nodejs/node/tree/v18.12.1/test/message/internal_assert_fail.js) -- [message/max_tick_depth.js](https://github.com/nodejs/node/tree/v18.12.1/test/message/max_tick_depth.js) -- [message/nexttick_throw.js](https://github.com/nodejs/node/tree/v18.12.1/test/message/nexttick_throw.js) -- [message/stdin_messages.js](https://github.com/nodejs/node/tree/v18.12.1/test/message/stdin_messages.js) -- [message/util-inspect-error-cause.js](https://github.com/nodejs/node/tree/v18.12.1/test/message/util-inspect-error-cause.js) -- [message/util_inspect_error.js](https://github.com/nodejs/node/tree/v18.12.1/test/message/util_inspect_error.js) -- [parallel/test-abortcontroller.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-abortcontroller.js) -- [parallel/test-aborted-util.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-aborted-util.js) -- [parallel/test-abortsignal-cloneable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-abortsignal-cloneable.js) -- [parallel/test-accessor-properties.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-accessor-properties.js) -- [parallel/test-arm-math-illegal-instruction.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-arm-math-illegal-instruction.js) -- [parallel/test-assert-builtins-not-read-from-filesystem.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-assert-builtins-not-read-from-filesystem.js) -- [parallel/test-assert-calltracker-calls.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-assert-calltracker-calls.js) -- [parallel/test-assert-calltracker-getCalls.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-assert-calltracker-getCalls.js) -- [parallel/test-assert-calltracker-report.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-assert-calltracker-report.js) -- [parallel/test-assert-calltracker-verify.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-assert-calltracker-verify.js) -- [parallel/test-assert-checktag.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-assert-checktag.js) -- [parallel/test-assert-deep.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-assert-deep.js) -- [parallel/test-assert-esm-cjs-message-verify.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-assert-esm-cjs-message-verify.js) -- [parallel/test-assert-fail-deprecation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-assert-fail-deprecation.js) -- [parallel/test-assert-first-line.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-assert-first-line.js) -- [parallel/test-assert-if-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-assert-if-error.js) -- [parallel/test-assert-typedarray-deepequal.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-assert-typedarray-deepequal.js) -- [parallel/test-async-hooks-async-await.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-async-await.js) -- [parallel/test-async-hooks-asyncresource-constructor.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-asyncresource-constructor.js) -- [parallel/test-async-hooks-close-during-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-close-during-destroy.js) -- [parallel/test-async-hooks-constructor.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-constructor.js) -- [parallel/test-async-hooks-correctly-switch-promise-hook.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-correctly-switch-promise-hook.js) -- [parallel/test-async-hooks-destroy-on-gc.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-destroy-on-gc.js) -- [parallel/test-async-hooks-disable-during-promise.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-disable-during-promise.js) -- [parallel/test-async-hooks-disable-gc-tracking.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-disable-gc-tracking.js) -- [parallel/test-async-hooks-enable-before-promise-resolve.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-enable-before-promise-resolve.js) -- [parallel/test-async-hooks-enable-disable-enable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-enable-disable-enable.js) -- [parallel/test-async-hooks-enable-disable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-enable-disable.js) -- [parallel/test-async-hooks-enable-during-promise.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-enable-during-promise.js) -- [parallel/test-async-hooks-enable-recursive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-enable-recursive.js) -- [parallel/test-async-hooks-execution-async-resource-await.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-execution-async-resource-await.js) -- [parallel/test-async-hooks-execution-async-resource.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-execution-async-resource.js) -- [parallel/test-async-hooks-fatal-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-fatal-error.js) -- [parallel/test-async-hooks-http-agent-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-http-agent-destroy.js) -- [parallel/test-async-hooks-http-agent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-http-agent.js) -- [parallel/test-async-hooks-http-parser-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-http-parser-destroy.js) -- [parallel/test-async-hooks-prevent-double-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-prevent-double-destroy.js) -- [parallel/test-async-hooks-promise-enable-disable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-promise-enable-disable.js) -- [parallel/test-async-hooks-promise-triggerid.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-promise-triggerid.js) -- [parallel/test-async-hooks-promise.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-promise.js) -- [parallel/test-async-hooks-recursive-stack-runInAsyncScope.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-recursive-stack-runInAsyncScope.js) -- [parallel/test-async-hooks-run-in-async-scope-caught-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-run-in-async-scope-caught-exception.js) -- [parallel/test-async-hooks-run-in-async-scope-this-arg.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-run-in-async-scope-this-arg.js) -- [parallel/test-async-hooks-top-level-clearimmediate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-top-level-clearimmediate.js) -- [parallel/test-async-hooks-vm-gc.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-vm-gc.js) -- [parallel/test-async-hooks-worker-asyncfn-terminate-1.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-worker-asyncfn-terminate-1.js) -- [parallel/test-async-hooks-worker-asyncfn-terminate-2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-worker-asyncfn-terminate-2.js) -- [parallel/test-async-hooks-worker-asyncfn-terminate-3.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-worker-asyncfn-terminate-3.js) -- [parallel/test-async-hooks-worker-asyncfn-terminate-4.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-hooks-worker-asyncfn-terminate-4.js) -- [parallel/test-async-local-storage-bind.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-local-storage-bind.js) -- [parallel/test-async-local-storage-contexts.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-local-storage-contexts.js) -- [parallel/test-async-local-storage-deep-stack.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-local-storage-deep-stack.js) -- [parallel/test-async-local-storage-exit-does-not-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-local-storage-exit-does-not-leak.js) -- [parallel/test-async-local-storage-http-multiclients.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-local-storage-http-multiclients.js) -- [parallel/test-async-local-storage-snapshot.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-local-storage-snapshot.js) -- [parallel/test-async-wrap-constructor.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-wrap-constructor.js) -- [parallel/test-async-wrap-destroyid.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-wrap-destroyid.js) -- [parallel/test-async-wrap-pop-id-during-load.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-wrap-pop-id-during-load.js) -- [parallel/test-async-wrap-promise-after-enabled.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-wrap-promise-after-enabled.js) -- [parallel/test-async-wrap-tlssocket-asyncreset.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-wrap-tlssocket-asyncreset.js) -- [parallel/test-async-wrap-trigger-id.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-wrap-trigger-id.js) -- [parallel/test-async-wrap-uncaughtexception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-async-wrap-uncaughtexception.js) -- [parallel/test-asyncresource-bind.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-asyncresource-bind.js) -- [parallel/test-atomics-wake.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-atomics-wake.js) -- [parallel/test-bash-completion.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-bash-completion.js) -- [parallel/test-beforeexit-event-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-beforeexit-event-exit.js) -- [parallel/test-benchmark-cli.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-benchmark-cli.js) -- [parallel/test-binding-constants.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-binding-constants.js) -- [parallel/test-blob-buffer-too-large.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-blob-buffer-too-large.js) -- [parallel/test-blob-createobjecturl.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-blob-createobjecturl.js) -- [parallel/test-blob-file-backed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-blob-file-backed.js) -- [parallel/test-blob.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-blob.js) -- [parallel/test-blocklist-clone.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-blocklist-clone.js) -- [parallel/test-bootstrap-modules.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-bootstrap-modules.js) -- [parallel/test-broadcastchannel-custom-inspect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-broadcastchannel-custom-inspect.js) -- [parallel/test-buffer-backing-arraybuffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-buffer-backing-arraybuffer.js) -- [parallel/test-buffer-compare.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-buffer-compare.js) -- [parallel/test-buffer-constructor-deprecation-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-buffer-constructor-deprecation-error.js) -- [parallel/test-buffer-constructor-node-modules-paths.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-buffer-constructor-node-modules-paths.js) -- [parallel/test-buffer-constructor-outside-node-modules.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-buffer-constructor-outside-node-modules.js) -- [parallel/test-buffer-fill.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-buffer-fill.js) -- [parallel/test-buffer-inspect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-buffer-inspect.js) -- [parallel/test-buffer-pending-deprecation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-buffer-pending-deprecation.js) -- [parallel/test-buffer-pool-untransferable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-buffer-pool-untransferable.js) -- [parallel/test-buffer-prototype-inspect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-buffer-prototype-inspect.js) -- [parallel/test-buffer-set-inspect-max-bytes.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-buffer-set-inspect-max-bytes.js) -- [parallel/test-buffer-sharedarraybuffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-buffer-sharedarraybuffer.js) -- [parallel/test-buffer-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-buffer-write.js) -- [parallel/test-c-ares.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-c-ares.js) -- [parallel/test-child-process-advanced-serialization-largebuffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-advanced-serialization-largebuffer.js) -- [parallel/test-child-process-advanced-serialization.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-advanced-serialization.js) -- [parallel/test-child-process-bad-stdio.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-bad-stdio.js) -- [parallel/test-child-process-can-write-to-stdout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-can-write-to-stdout.js) -- [parallel/test-child-process-constructor.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-constructor.js) -- [parallel/test-child-process-cwd.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-cwd.js) -- [parallel/test-child-process-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-destroy.js) -- [parallel/test-child-process-detached.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-detached.js) -- [parallel/test-child-process-disconnect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-disconnect.js) -- [parallel/test-child-process-env.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-env.js) -- [parallel/test-child-process-exec-any-shells-windows.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-exec-any-shells-windows.js) -- [parallel/test-child-process-exec-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-exec-encoding.js) -- [parallel/test-child-process-exec-std-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-exec-std-encoding.js) -- [parallel/test-child-process-exec-timeout-expire.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-exec-timeout-expire.js) -- [parallel/test-child-process-exec-timeout-kill.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-exec-timeout-kill.js) -- [parallel/test-child-process-exec-timeout-not-expired.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-exec-timeout-not-expired.js) -- [parallel/test-child-process-execFile-promisified-abortController.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-execFile-promisified-abortController.js) -- [parallel/test-child-process-execfile.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-execfile.js) -- [parallel/test-child-process-exit-code.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-exit-code.js) -- [parallel/test-child-process-fork-abort-signal.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-abort-signal.js) -- [parallel/test-child-process-fork-and-spawn.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-and-spawn.js) -- [parallel/test-child-process-fork-args.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-args.js) -- [parallel/test-child-process-fork-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-close.js) -- [parallel/test-child-process-fork-closed-channel-segfault.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-closed-channel-segfault.js) -- [parallel/test-child-process-fork-detached.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-detached.js) -- [parallel/test-child-process-fork-dgram.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-dgram.js) -- [parallel/test-child-process-fork-exec-argv.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-exec-argv.js) -- [parallel/test-child-process-fork-exec-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-exec-path.js) -- [parallel/test-child-process-fork-getconnections.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-getconnections.js) -- [parallel/test-child-process-fork-net-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-net-server.js) -- [parallel/test-child-process-fork-net-socket.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-net-socket.js) -- [parallel/test-child-process-fork-net.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-net.js) -- [parallel/test-child-process-fork-no-shell.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-no-shell.js) -- [parallel/test-child-process-fork-ref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-ref.js) -- [parallel/test-child-process-fork-ref2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-ref2.js) -- [parallel/test-child-process-fork-stdio-string-variant.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-stdio-string-variant.js) -- [parallel/test-child-process-fork-stdio.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-stdio.js) -- [parallel/test-child-process-fork-timeout-kill-signal.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork-timeout-kill-signal.js) -- [parallel/test-child-process-fork.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork.js) -- [parallel/test-child-process-fork3.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-fork3.js) -- [parallel/test-child-process-http-socket-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-http-socket-leak.js) -- [parallel/test-child-process-internal.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-internal.js) -- [parallel/test-child-process-ipc.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-ipc.js) -- [parallel/test-child-process-no-deprecation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-no-deprecation.js) -- [parallel/test-child-process-pipe-dataflow.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-pipe-dataflow.js) -- [parallel/test-child-process-promisified.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-promisified.js) -- [parallel/test-child-process-recv-handle.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-recv-handle.js) -- [parallel/test-child-process-reject-null-bytes.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-reject-null-bytes.js) -- [parallel/test-child-process-send-after-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-send-after-close.js) -- [parallel/test-child-process-send-cb.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-send-cb.js) -- [parallel/test-child-process-send-keep-open.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-send-keep-open.js) -- [parallel/test-child-process-send-returns-boolean.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-send-returns-boolean.js) -- [parallel/test-child-process-send-type-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-send-type-error.js) -- [parallel/test-child-process-send-utf8.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-send-utf8.js) -- [parallel/test-child-process-server-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-server-close.js) -- [parallel/test-child-process-silent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-silent.js) -- [parallel/test-child-process-spawn-argv0.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-spawn-argv0.js) -- [parallel/test-child-process-spawn-controller.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-spawn-controller.js) -- [parallel/test-child-process-spawn-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-spawn-error.js) -- [parallel/test-child-process-spawn-shell.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-spawn-shell.js) -- [parallel/test-child-process-spawn-timeout-kill-signal.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-spawn-timeout-kill-signal.js) -- [parallel/test-child-process-spawn-typeerror.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-spawn-typeerror.js) -- [parallel/test-child-process-spawnsync-env.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-spawnsync-env.js) -- [parallel/test-child-process-spawnsync-input.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-spawnsync-input.js) -- [parallel/test-child-process-spawnsync-kill-signal.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-spawnsync-kill-signal.js) -- [parallel/test-child-process-spawnsync-shell.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-spawnsync-shell.js) -- [parallel/test-child-process-spawnsync-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-spawnsync-timeout.js) -- [parallel/test-child-process-stdin-ipc.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-stdin-ipc.js) -- [parallel/test-child-process-stdin.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-stdin.js) -- [parallel/test-child-process-stdio-big-write-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-stdio-big-write-end.js) -- [parallel/test-child-process-stdio-inherit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-stdio-inherit.js) -- [parallel/test-child-process-stdio-merge-stdouts-into-cat.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-stdio-merge-stdouts-into-cat.js) -- [parallel/test-child-process-stdio-overlapped.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-stdio-overlapped.js) -- [parallel/test-child-process-stdio-reuse-readable-stdio.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-stdio-reuse-readable-stdio.js) -- [parallel/test-child-process-stdio.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-stdio.js) -- [parallel/test-child-process-stdout-flush-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-stdout-flush-exit.js) -- [parallel/test-child-process-stdout-flush.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-stdout-flush.js) -- [parallel/test-child-process-stdout-ipc.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-stdout-ipc.js) -- [parallel/test-child-process-uid-gid.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-uid-gid.js) -- [parallel/test-child-process-validate-stdio.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-validate-stdio.js) -- [parallel/test-child-process-windows-hide.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-windows-hide.js) -- [parallel/test-cli-bad-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cli-bad-options.js) -- [parallel/test-cli-eval-event.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cli-eval-event.js) -- [parallel/test-cli-eval.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cli-eval.js) -- [parallel/test-cli-node-options-disallowed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cli-node-options-disallowed.js) -- [parallel/test-cli-node-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cli-node-options.js) -- [parallel/test-cli-node-print-help.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cli-node-print-help.js) -- [parallel/test-cli-options-negation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cli-options-negation.js) -- [parallel/test-cli-options-precedence.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cli-options-precedence.js) -- [parallel/test-cli-permission-deny-fs.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cli-permission-deny-fs.js) -- [parallel/test-cli-permission-multiple-allow.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cli-permission-multiple-allow.js) -- [parallel/test-cli-syntax-eval.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cli-syntax-eval.js) -- [parallel/test-cli-syntax-piped-bad.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cli-syntax-piped-bad.js) -- [parallel/test-cli-syntax-piped-good.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cli-syntax-piped-good.js) -- [parallel/test-client-request-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-client-request-destroy.js) -- [parallel/test-cluster-accept-fail.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-accept-fail.js) -- [parallel/test-cluster-advanced-serialization.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-advanced-serialization.js) -- [parallel/test-cluster-basic.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-basic.js) -- [parallel/test-cluster-bind-privileged-port.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-bind-privileged-port.js) -- [parallel/test-cluster-bind-twice.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-bind-twice.js) -- [parallel/test-cluster-call-and-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-call-and-destroy.js) -- [parallel/test-cluster-child-index-dgram.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-child-index-dgram.js) -- [parallel/test-cluster-child-index-net.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-child-index-net.js) -- [parallel/test-cluster-concurrent-disconnect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-concurrent-disconnect.js) -- [parallel/test-cluster-cwd.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-cwd.js) -- [parallel/test-cluster-dgram-1.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-dgram-1.js) -- [parallel/test-cluster-dgram-2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-dgram-2.js) -- [parallel/test-cluster-dgram-bind-fd.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-dgram-bind-fd.js) -- [parallel/test-cluster-dgram-ipv6only.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-dgram-ipv6only.js) -- [parallel/test-cluster-dgram-reuse.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-dgram-reuse.js) -- [parallel/test-cluster-disconnect-before-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-disconnect-before-exit.js) -- [parallel/test-cluster-disconnect-exitedAfterDisconnect-race.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-disconnect-exitedAfterDisconnect-race.js) -- [parallel/test-cluster-disconnect-idle-worker.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-disconnect-idle-worker.js) -- [parallel/test-cluster-disconnect-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-disconnect-leak.js) -- [parallel/test-cluster-disconnect-race.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-disconnect-race.js) -- [parallel/test-cluster-disconnect-unshared-tcp.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-disconnect-unshared-tcp.js) -- [parallel/test-cluster-disconnect-unshared-udp.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-disconnect-unshared-udp.js) -- [parallel/test-cluster-disconnect-with-no-workers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-disconnect-with-no-workers.js) -- [parallel/test-cluster-disconnect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-disconnect.js) -- [parallel/test-cluster-eaccess.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-eaccess.js) -- [parallel/test-cluster-eaddrinuse.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-eaddrinuse.js) -- [parallel/test-cluster-fork-env.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-fork-env.js) -- [parallel/test-cluster-fork-stdio.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-fork-stdio.js) -- [parallel/test-cluster-fork-windowsHide.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-fork-windowsHide.js) -- [parallel/test-cluster-http-pipe.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-http-pipe.js) -- [parallel/test-cluster-invalid-message.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-invalid-message.js) -- [parallel/test-cluster-ipc-throw.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-ipc-throw.js) -- [parallel/test-cluster-kill-disconnect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-kill-disconnect.js) -- [parallel/test-cluster-kill-infinite-loop.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-kill-infinite-loop.js) -- [parallel/test-cluster-listen-pipe-readable-writable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-listen-pipe-readable-writable.js) -- [parallel/test-cluster-listening-port.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-listening-port.js) -- [parallel/test-cluster-message.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-message.js) -- [parallel/test-cluster-net-listen-backlog.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-net-listen-backlog.js) -- [parallel/test-cluster-net-listen-ipv6only-false.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-net-listen-ipv6only-false.js) -- [parallel/test-cluster-net-listen-relative-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-net-listen-relative-path.js) -- [parallel/test-cluster-net-listen.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-net-listen.js) -- [parallel/test-cluster-net-send.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-net-send.js) -- [parallel/test-cluster-net-server-drop-connection.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-net-server-drop-connection.js) -- [parallel/test-cluster-primary-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-primary-error.js) -- [parallel/test-cluster-primary-kill.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-primary-kill.js) -- [parallel/test-cluster-process-disconnect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-process-disconnect.js) -- [parallel/test-cluster-rr-domain-listen.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-rr-domain-listen.js) -- [parallel/test-cluster-rr-handle-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-rr-handle-close.js) -- [parallel/test-cluster-rr-handle-keep-loop-alive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-rr-handle-keep-loop-alive.js) -- [parallel/test-cluster-rr-handle-ref-unref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-rr-handle-ref-unref.js) -- [parallel/test-cluster-rr-ref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-rr-ref.js) -- [parallel/test-cluster-send-deadlock.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-send-deadlock.js) -- [parallel/test-cluster-send-handle-twice.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-send-handle-twice.js) -- [parallel/test-cluster-send-socket-to-worker-http-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-send-socket-to-worker-http-server.js) -- [parallel/test-cluster-server-restart-none.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-server-restart-none.js) -- [parallel/test-cluster-server-restart-rr.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-server-restart-rr.js) -- [parallel/test-cluster-setup-primary-argv.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-setup-primary-argv.js) -- [parallel/test-cluster-setup-primary-cumulative.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-setup-primary-cumulative.js) -- [parallel/test-cluster-setup-primary-emit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-setup-primary-emit.js) -- [parallel/test-cluster-setup-primary-multiple.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-setup-primary-multiple.js) -- [parallel/test-cluster-setup-primary.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-setup-primary.js) -- [parallel/test-cluster-shared-handle-bind-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-shared-handle-bind-error.js) -- [parallel/test-cluster-shared-handle-bind-privileged-port.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-shared-handle-bind-privileged-port.js) -- [parallel/test-cluster-shared-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-shared-leak.js) -- [parallel/test-cluster-uncaught-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-uncaught-exception.js) -- [parallel/test-cluster-worker-constructor.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-worker-constructor.js) -- [parallel/test-cluster-worker-death.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-worker-death.js) -- [parallel/test-cluster-worker-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-worker-destroy.js) -- [parallel/test-cluster-worker-disconnect-on-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-worker-disconnect-on-error.js) -- [parallel/test-cluster-worker-disconnect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-worker-disconnect.js) -- [parallel/test-cluster-worker-events.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-worker-events.js) -- [parallel/test-cluster-worker-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-worker-exit.js) -- [parallel/test-cluster-worker-forced-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-worker-forced-exit.js) -- [parallel/test-cluster-worker-handle-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-worker-handle-close.js) -- [parallel/test-cluster-worker-init.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-worker-init.js) -- [parallel/test-cluster-worker-isconnected.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-worker-isconnected.js) -- [parallel/test-cluster-worker-isdead.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-worker-isdead.js) -- [parallel/test-cluster-worker-kill-signal.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-worker-kill-signal.js) -- [parallel/test-cluster-worker-kill.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-worker-kill.js) -- [parallel/test-cluster-worker-no-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-worker-no-exit.js) -- [parallel/test-cluster-worker-wait-server-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cluster-worker-wait-server-close.js) -- [parallel/test-code-cache.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-code-cache.js) -- [parallel/test-common-countdown.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-common-countdown.js) -- [parallel/test-common-expect-warning.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-common-expect-warning.js) -- [parallel/test-common-gc.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-common-gc.js) -- [parallel/test-common-must-not-call.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-common-must-not-call.js) -- [parallel/test-common.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-common.js) -- [parallel/test-console-assign-undefined.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-console-assign-undefined.js) -- [parallel/test-console-clear.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-console-clear.js) -- [parallel/test-console-count.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-console-count.js) -- [parallel/test-console-formatTime.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-console-formatTime.js) -- [parallel/test-console-instance.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-console-instance.js) -- [parallel/test-console-issue-43095.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-console-issue-43095.js) -- [parallel/test-console-methods.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-console-methods.js) -- [parallel/test-console-not-call-toString.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-console-not-call-toString.js) -- [parallel/test-console-self-assign.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-console-self-assign.js) -- [parallel/test-console-stdio-setters.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-console-stdio-setters.js) -- [parallel/test-console.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-console.js) -- [parallel/test-constants.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-constants.js) -- [parallel/test-corepack-version.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-corepack-version.js) -- [parallel/test-coverage-with-inspector-disabled.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-coverage-with-inspector-disabled.js) -- [parallel/test-crypto-aes-wrap.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-aes-wrap.js) -- [parallel/test-crypto-async-sign-verify.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-async-sign-verify.js) -- [parallel/test-crypto-authenticated-stream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-authenticated-stream.js) -- [parallel/test-crypto-authenticated.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-authenticated.js) -- [parallel/test-crypto-certificate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-certificate.js) -- [parallel/test-crypto-cipher-decipher.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-cipher-decipher.js) -- [parallel/test-crypto-cipheriv-decipheriv.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-cipheriv-decipheriv.js) -- [parallel/test-crypto-classes.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-classes.js) -- [parallel/test-crypto-des3-wrap.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-des3-wrap.js) -- [parallel/test-crypto-dh-constructor.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-dh-constructor.js) -- [parallel/test-crypto-dh-curves.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-dh-curves.js) -- [parallel/test-crypto-dh-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-dh-errors.js) -- [parallel/test-crypto-dh-generate-keys.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-dh-generate-keys.js) -- [parallel/test-crypto-dh-group-setters.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-dh-group-setters.js) -- [parallel/test-crypto-dh-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-dh-leak.js) -- [parallel/test-crypto-dh-modp2-views.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-dh-modp2-views.js) -- [parallel/test-crypto-dh-modp2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-dh-modp2.js) -- [parallel/test-crypto-dh-odd-key.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-dh-odd-key.js) -- [parallel/test-crypto-dh-padding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-dh-padding.js) -- [parallel/test-crypto-dh-stateless.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-dh-stateless.js) -- [parallel/test-crypto-domain.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-domain.js) -- [parallel/test-crypto-domains.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-domains.js) -- [parallel/test-crypto-ecb.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-ecb.js) -- [parallel/test-crypto-ecdh-convert-key.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-ecdh-convert-key.js) -- [parallel/test-crypto-encoding-validation-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-encoding-validation-error.js) -- [parallel/test-crypto-fips.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-fips.js) -- [parallel/test-crypto-from-binary.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-from-binary.js) -- [parallel/test-crypto-getcipherinfo.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-getcipherinfo.js) -- [parallel/test-crypto-hash-stream-pipe.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-hash-stream-pipe.js) -- [parallel/test-crypto-key-objects-messageport.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-key-objects-messageport.js) -- [parallel/test-crypto-key-objects.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-key-objects.js) -- [parallel/test-crypto-keygen-async-dsa-key-object.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-async-dsa-key-object.js) -- [parallel/test-crypto-keygen-async-dsa.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-async-dsa.js) -- [parallel/test-crypto-keygen-async-elliptic-curve-jwk-ec.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-async-elliptic-curve-jwk-ec.js) -- [parallel/test-crypto-keygen-async-elliptic-curve-jwk-rsa.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-async-elliptic-curve-jwk-rsa.js) -- [parallel/test-crypto-keygen-async-elliptic-curve-jwk.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-async-elliptic-curve-jwk.js) -- [parallel/test-crypto-keygen-async-encrypted-private-key-der.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-async-encrypted-private-key-der.js) -- [parallel/test-crypto-keygen-async-encrypted-private-key.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-async-encrypted-private-key.js) -- [parallel/test-crypto-keygen-async-explicit-elliptic-curve-encrypted-p256.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-async-explicit-elliptic-curve-encrypted-p256.js) -- [parallel/test-crypto-keygen-async-explicit-elliptic-curve-encrypted.js.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-async-explicit-elliptic-curve-encrypted.js.js) -- [parallel/test-crypto-keygen-async-explicit-elliptic-curve.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-async-explicit-elliptic-curve.js) -- [parallel/test-crypto-keygen-async-named-elliptic-curve-encrypted-p256.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-async-named-elliptic-curve-encrypted-p256.js) -- [parallel/test-crypto-keygen-async-named-elliptic-curve-encrypted.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-async-named-elliptic-curve-encrypted.js) -- [parallel/test-crypto-keygen-async-named-elliptic-curve.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-async-named-elliptic-curve.js) -- [parallel/test-crypto-keygen-async-rsa.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-async-rsa.js) -- [parallel/test-crypto-keygen-bit-length.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-bit-length.js) -- [parallel/test-crypto-keygen-deprecation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-deprecation.js) -- [parallel/test-crypto-keygen-dh-classic.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-dh-classic.js) -- [parallel/test-crypto-keygen-duplicate-deprecated-option.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-duplicate-deprecated-option.js) -- [parallel/test-crypto-keygen-eddsa.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-eddsa.js) -- [parallel/test-crypto-keygen-empty-passphrase-no-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-empty-passphrase-no-error.js) -- [parallel/test-crypto-keygen-empty-passphrase-no-prompt.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-empty-passphrase-no-prompt.js) -- [parallel/test-crypto-keygen-invalid-parameter-encoding-dsa.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-invalid-parameter-encoding-dsa.js) -- [parallel/test-crypto-keygen-invalid-parameter-encoding-ec.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-invalid-parameter-encoding-ec.js) -- [parallel/test-crypto-keygen-key-object-without-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-key-object-without-encoding.js) -- [parallel/test-crypto-keygen-key-objects.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-key-objects.js) -- [parallel/test-crypto-keygen-missing-oid.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-missing-oid.js) -- [parallel/test-crypto-keygen-no-rsassa-pss-params.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-no-rsassa-pss-params.js) -- [parallel/test-crypto-keygen-non-standard-public-exponent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-non-standard-public-exponent.js) -- [parallel/test-crypto-keygen-promisify.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-promisify.js) -- [parallel/test-crypto-keygen-rfc8017-9-1.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-rfc8017-9-1.js) -- [parallel/test-crypto-keygen-rfc8017-a-2-3.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-rfc8017-a-2-3.js) -- [parallel/test-crypto-keygen-rsa-pss.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-rsa-pss.js) -- [parallel/test-crypto-keygen-sync.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen-sync.js) -- [parallel/test-crypto-keygen.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-keygen.js) -- [parallel/test-crypto-lazy-transform-writable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-lazy-transform-writable.js) -- [parallel/test-crypto-no-algorithm.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-no-algorithm.js) -- [parallel/test-crypto-op-during-process-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-op-during-process-exit.js) -- [parallel/test-crypto-padding-aes256.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-padding-aes256.js) -- [parallel/test-crypto-padding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-padding.js) -- [parallel/test-crypto-private-decrypt-gh32240.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-private-decrypt-gh32240.js) -- [parallel/test-crypto-psychic-signatures.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-psychic-signatures.js) -- [parallel/test-crypto-publicDecrypt-fails-first-time.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-publicDecrypt-fails-first-time.js) -- [parallel/test-crypto-random.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-random.js) -- [parallel/test-crypto-randomfillsync-regression.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-randomfillsync-regression.js) -- [parallel/test-crypto-randomuuid.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-randomuuid.js) -- [parallel/test-crypto-rsa-dsa-revert.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-rsa-dsa-revert.js) -- [parallel/test-crypto-rsa-dsa.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-rsa-dsa.js) -- [parallel/test-crypto-scrypt.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-scrypt.js) -- [parallel/test-crypto-secure-heap.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-secure-heap.js) -- [parallel/test-crypto-sign-verify.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-sign-verify.js) -- [parallel/test-crypto-subtle-zero-length.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-subtle-zero-length.js) -- [parallel/test-crypto-verify-failure.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-verify-failure.js) -- [parallel/test-crypto-webcrypto-aes-decrypt-tag-too-small.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-webcrypto-aes-decrypt-tag-too-small.js) -- [parallel/test-crypto-worker-thread.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto-worker-thread.js) -- [parallel/test-crypto.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-crypto.js) -- [parallel/test-cwd-enoent-preload.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cwd-enoent-preload.js) -- [parallel/test-cwd-enoent-repl.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cwd-enoent-repl.js) -- [parallel/test-cwd-enoent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-cwd-enoent.js) -- [parallel/test-datetime-change-notify.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-datetime-change-notify.js) -- [parallel/test-debugger-backtrace.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-backtrace.js) -- [parallel/test-debugger-break.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-break.js) -- [parallel/test-debugger-breakpoint-exists.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-breakpoint-exists.js) -- [parallel/test-debugger-clear-breakpoints.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-clear-breakpoints.js) -- [parallel/test-debugger-exceptions.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-exceptions.js) -- [parallel/test-debugger-exec.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-exec.js) -- [parallel/test-debugger-heap-profiler.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-heap-profiler.js) -- [parallel/test-debugger-list.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-list.js) -- [parallel/test-debugger-low-level.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-low-level.js) -- [parallel/test-debugger-object-type-remote-object.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-object-type-remote-object.js) -- [parallel/test-debugger-pid.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-pid.js) -- [parallel/test-debugger-preserve-breaks.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-preserve-breaks.js) -- [parallel/test-debugger-profile-command.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-profile-command.js) -- [parallel/test-debugger-profile.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-profile.js) -- [parallel/test-debugger-random-port-with-inspect-port.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-random-port-with-inspect-port.js) -- [parallel/test-debugger-random-port.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-random-port.js) -- [parallel/test-debugger-repeat-last.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-repeat-last.js) -- [parallel/test-debugger-restart-message.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-restart-message.js) -- [parallel/test-debugger-run-after-quit-restart.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-run-after-quit-restart.js) -- [parallel/test-debugger-sb-before-load.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-sb-before-load.js) -- [parallel/test-debugger-scripts.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-scripts.js) -- [parallel/test-debugger-unavailable-port.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-unavailable-port.js) -- [parallel/test-debugger-use-strict.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-use-strict.js) -- [parallel/test-debugger-watch-validation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-watch-validation.js) -- [parallel/test-debugger-websocket-secret-mismatch.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-debugger-websocket-secret-mismatch.js) -- [parallel/test-delayed-require.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-delayed-require.js) -- [parallel/test-dgram-abort-closed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-abort-closed.js) -- [parallel/test-dgram-address.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-address.js) -- [parallel/test-dgram-bind-default-address.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-bind-default-address.js) -- [parallel/test-dgram-bind-error-repeat.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-bind-error-repeat.js) -- [parallel/test-dgram-bind-fd-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-bind-fd-error.js) -- [parallel/test-dgram-bind-fd.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-bind-fd.js) -- [parallel/test-dgram-bind.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-bind.js) -- [parallel/test-dgram-bytes-length.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-bytes-length.js) -- [parallel/test-dgram-close-in-listening.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-close-in-listening.js) -- [parallel/test-dgram-close-is-not-callback.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-close-is-not-callback.js) -- [parallel/test-dgram-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-close.js) -- [parallel/test-dgram-cluster-bind-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-cluster-bind-error.js) -- [parallel/test-dgram-cluster-close-during-bind.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-cluster-close-during-bind.js) -- [parallel/test-dgram-cluster-close-in-listening.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-cluster-close-in-listening.js) -- [parallel/test-dgram-connect-send-callback-buffer-length.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-connect-send-callback-buffer-length.js) -- [parallel/test-dgram-connect-send-callback-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-connect-send-callback-buffer.js) -- [parallel/test-dgram-connect-send-callback-multi-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-connect-send-callback-multi-buffer.js) -- [parallel/test-dgram-connect-send-default-host.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-connect-send-default-host.js) -- [parallel/test-dgram-connect-send-empty-array.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-connect-send-empty-array.js) -- [parallel/test-dgram-connect-send-empty-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-connect-send-empty-buffer.js) -- [parallel/test-dgram-connect-send-empty-packet.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-connect-send-empty-packet.js) -- [parallel/test-dgram-connect-send-multi-buffer-copy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-connect-send-multi-buffer-copy.js) -- [parallel/test-dgram-connect-send-multi-string-array.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-connect-send-multi-string-array.js) -- [parallel/test-dgram-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-connect.js) -- [parallel/test-dgram-create-socket-handle-fd.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-create-socket-handle-fd.js) -- [parallel/test-dgram-create-socket-handle.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-create-socket-handle.js) -- [parallel/test-dgram-createSocket-type.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-createSocket-type.js) -- [parallel/test-dgram-custom-lookup.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-custom-lookup.js) -- [parallel/test-dgram-deprecation-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-deprecation-error.js) -- [parallel/test-dgram-error-message-address.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-error-message-address.js) -- [parallel/test-dgram-exclusive-implicit-bind.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-exclusive-implicit-bind.js) -- [parallel/test-dgram-implicit-bind.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-implicit-bind.js) -- [parallel/test-dgram-ipv6only.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-ipv6only.js) -- [parallel/test-dgram-listen-after-bind.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-listen-after-bind.js) -- [parallel/test-dgram-membership.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-membership.js) -- [parallel/test-dgram-msgsize.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-msgsize.js) -- [parallel/test-dgram-multicast-loopback.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-multicast-loopback.js) -- [parallel/test-dgram-multicast-set-interface.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-multicast-set-interface.js) -- [parallel/test-dgram-multicast-setTTL.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-multicast-setTTL.js) -- [parallel/test-dgram-oob-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-oob-buffer.js) -- [parallel/test-dgram-recv-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-recv-error.js) -- [parallel/test-dgram-ref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-ref.js) -- [parallel/test-dgram-send-address-types.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-address-types.js) -- [parallel/test-dgram-send-bad-arguments.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-bad-arguments.js) -- [parallel/test-dgram-send-callback-buffer-empty-address.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-callback-buffer-empty-address.js) -- [parallel/test-dgram-send-callback-buffer-length-empty-address.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-callback-buffer-length-empty-address.js) -- [parallel/test-dgram-send-callback-buffer-length.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-callback-buffer-length.js) -- [parallel/test-dgram-send-callback-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-callback-buffer.js) -- [parallel/test-dgram-send-callback-multi-buffer-empty-address.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-callback-multi-buffer-empty-address.js) -- [parallel/test-dgram-send-callback-multi-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-callback-multi-buffer.js) -- [parallel/test-dgram-send-callback-recursive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-callback-recursive.js) -- [parallel/test-dgram-send-cb-quelches-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-cb-quelches-error.js) -- [parallel/test-dgram-send-default-host.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-default-host.js) -- [parallel/test-dgram-send-empty-array.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-empty-array.js) -- [parallel/test-dgram-send-empty-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-empty-buffer.js) -- [parallel/test-dgram-send-empty-packet.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-empty-packet.js) -- [parallel/test-dgram-send-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-error.js) -- [parallel/test-dgram-send-invalid-msg-type.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-invalid-msg-type.js) -- [parallel/test-dgram-send-multi-buffer-copy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-multi-buffer-copy.js) -- [parallel/test-dgram-send-multi-string-array.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-multi-string-array.js) -- [parallel/test-dgram-send-queue-info.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-send-queue-info.js) -- [parallel/test-dgram-sendto.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-sendto.js) -- [parallel/test-dgram-setBroadcast.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-setBroadcast.js) -- [parallel/test-dgram-setTTL.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-setTTL.js) -- [parallel/test-dgram-socket-buffer-size.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-socket-buffer-size.js) -- [parallel/test-dgram-udp4.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-udp4.js) -- [parallel/test-dgram-udp6-link-local-address.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-udp6-link-local-address.js) -- [parallel/test-dgram-udp6-send-default-host.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-udp6-send-default-host.js) -- [parallel/test-dgram-unref-in-cluster.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-unref-in-cluster.js) -- [parallel/test-dgram-unref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dgram-unref.js) -- [parallel/test-diagnostics-channel-bind-store.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-diagnostics-channel-bind-store.js) -- [parallel/test-diagnostics-channel-http-server-start.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-diagnostics-channel-http-server-start.js) -- [parallel/test-diagnostics-channel-http.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-diagnostics-channel-http.js) -- [parallel/test-diagnostics-channel-memory-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-diagnostics-channel-memory-leak.js) -- [parallel/test-diagnostics-channel-process.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-diagnostics-channel-process.js) -- [parallel/test-diagnostics-channel-safe-subscriber-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-diagnostics-channel-safe-subscriber-errors.js) -- [parallel/test-diagnostics-channel-tracing-channel-async-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-diagnostics-channel-tracing-channel-async-error.js) -- [parallel/test-diagnostics-channel-tracing-channel-async.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-diagnostics-channel-tracing-channel-async.js) -- [parallel/test-diagnostics-channel-tracing-channel-run-stores.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-diagnostics-channel-tracing-channel-run-stores.js) -- [parallel/test-diagnostics-channel-worker-threads.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-diagnostics-channel-worker-threads.js) -- [parallel/test-directory-import.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-directory-import.js) -- [parallel/test-disable-proto-delete.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-disable-proto-delete.js) -- [parallel/test-disable-proto-throw.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-disable-proto-throw.js) -- [parallel/test-dns-cancel-reverse-lookup.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-cancel-reverse-lookup.js) -- [parallel/test-dns-channel-cancel-promise.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-channel-cancel-promise.js) -- [parallel/test-dns-channel-cancel.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-channel-cancel.js) -- [parallel/test-dns-channel-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-channel-timeout.js) -- [parallel/test-dns-default-verbatim-false.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-default-verbatim-false.js) -- [parallel/test-dns-default-verbatim-true.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-default-verbatim-true.js) -- [parallel/test-dns-get-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-get-server.js) -- [parallel/test-dns-lookup-promises-options-deprecated.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-lookup-promises-options-deprecated.js) -- [parallel/test-dns-lookup-promises.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-lookup-promises.js) -- [parallel/test-dns-lookupService-promises.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-lookupService-promises.js) -- [parallel/test-dns-lookupService.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-lookupService.js) -- [parallel/test-dns-multi-channel.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-multi-channel.js) -- [parallel/test-dns-perf_hooks.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-perf_hooks.js) -- [parallel/test-dns-resolve-promises.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-resolve-promises.js) -- [parallel/test-dns-resolveany-bad-ancount.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-resolveany-bad-ancount.js) -- [parallel/test-dns-resolveany.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-resolveany.js) -- [parallel/test-dns-set-default-order.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-set-default-order.js) -- [parallel/test-dns-setlocaladdress.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-setlocaladdress.js) -- [parallel/test-dns-setserver-when-querying.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns-setserver-when-querying.js) -- [parallel/test-dns.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dns.js) -- [parallel/test-domain-abort-on-uncaught.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-abort-on-uncaught.js) -- [parallel/test-domain-add-remove.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-add-remove.js) -- [parallel/test-domain-async-id-map-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-async-id-map-leak.js) -- [parallel/test-domain-bind-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-bind-timeout.js) -- [parallel/test-domain-crypto.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-crypto.js) -- [parallel/test-domain-dep0097.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-dep0097.js) -- [parallel/test-domain-ee-error-listener.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-ee-error-listener.js) -- [parallel/test-domain-ee-implicit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-ee-implicit.js) -- [parallel/test-domain-ee.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-ee.js) -- [parallel/test-domain-emit-error-handler-stack.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-emit-error-handler-stack.js) -- [parallel/test-domain-enter-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-enter-exit.js) -- [parallel/test-domain-error-types.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-error-types.js) -- [parallel/test-domain-from-timer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-from-timer.js) -- [parallel/test-domain-fs-enoent-stream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-fs-enoent-stream.js) -- [parallel/test-domain-http-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-http-server.js) -- [parallel/test-domain-implicit-binding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-implicit-binding.js) -- [parallel/test-domain-implicit-fs.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-implicit-fs.js) -- [parallel/test-domain-intercept.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-intercept.js) -- [parallel/test-domain-load-after-set-uncaught-exception-capture.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-load-after-set-uncaught-exception-capture.js) -- [parallel/test-domain-multi.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-multi.js) -- [parallel/test-domain-multiple-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-multiple-errors.js) -- [parallel/test-domain-nested-throw.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-nested-throw.js) -- [parallel/test-domain-nested.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-nested.js) -- [parallel/test-domain-nexttick.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-nexttick.js) -- [parallel/test-domain-no-error-handler-abort-on-uncaught-0.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-0.js) -- [parallel/test-domain-no-error-handler-abort-on-uncaught-1.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-1.js) -- [parallel/test-domain-no-error-handler-abort-on-uncaught-2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-2.js) -- [parallel/test-domain-no-error-handler-abort-on-uncaught-3.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-3.js) -- [parallel/test-domain-no-error-handler-abort-on-uncaught-4.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-4.js) -- [parallel/test-domain-no-error-handler-abort-on-uncaught-5.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-5.js) -- [parallel/test-domain-no-error-handler-abort-on-uncaught-6.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-6.js) -- [parallel/test-domain-no-error-handler-abort-on-uncaught-7.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-7.js) -- [parallel/test-domain-no-error-handler-abort-on-uncaught-8.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-8.js) -- [parallel/test-domain-no-error-handler-abort-on-uncaught-9.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-9.js) -- [parallel/test-domain-promise.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-promise.js) -- [parallel/test-domain-run.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-run.js) -- [parallel/test-domain-safe-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-safe-exit.js) -- [parallel/test-domain-set-uncaught-exception-capture-after-load.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-set-uncaught-exception-capture-after-load.js) -- [parallel/test-domain-stack-empty-in-process-uncaughtexception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-stack-empty-in-process-uncaughtexception.js) -- [parallel/test-domain-stack.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-stack.js) -- [parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js) -- [parallel/test-domain-thrown-error-handler-stack.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-thrown-error-handler-stack.js) -- [parallel/test-domain-timer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-timer.js) -- [parallel/test-domain-timers-uncaught-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-timers-uncaught-exception.js) -- [parallel/test-domain-timers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-timers.js) -- [parallel/test-domain-top-level-error-handler-clears-stack.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-top-level-error-handler-clears-stack.js) -- [parallel/test-domain-top-level-error-handler-throw.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-top-level-error-handler-throw.js) -- [parallel/test-domain-uncaught-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-uncaught-exception.js) -- [parallel/test-domain-vm-promise-isolation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-vm-promise-isolation.js) -- [parallel/test-domain-with-abort-on-uncaught-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domain-with-abort-on-uncaught-exception.js) -- [parallel/test-domexception-cause.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-domexception-cause.js) -- [parallel/test-dotenv-edge-cases.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dotenv-edge-cases.js) -- [parallel/test-dotenv-node-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dotenv-node-options.js) -- [parallel/test-dotenv.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dotenv.js) -- [parallel/test-double-tls-client.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-double-tls-client.js) -- [parallel/test-double-tls-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-double-tls-server.js) -- [parallel/test-dsa-fips-invalid-key.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dsa-fips-invalid-key.js) -- [parallel/test-dummy-stdio.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-dummy-stdio.js) -- [parallel/test-emit-after-uncaught-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-emit-after-uncaught-exception.js) -- [parallel/test-env-newprotomethod-remove-unnecessary-prototypes.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-env-newprotomethod-remove-unnecessary-prototypes.js) -- [parallel/test-env-var-no-warnings.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-env-var-no-warnings.js) -- [parallel/test-err-name-deprecation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-err-name-deprecation.js) -- [parallel/test-error-aggregateTwoErrors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-error-aggregateTwoErrors.js) -- [parallel/test-error-format-list.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-error-format-list.js) -- [parallel/test-error-prepare-stack-trace.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-error-prepare-stack-trace.js) -- [parallel/test-error-reporting.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-error-reporting.js) -- [parallel/test-error-serdes.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-error-serdes.js) -- [parallel/test-errors-aborterror.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-errors-aborterror.js) -- [parallel/test-errors-systemerror-frozen-intrinsics.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-errors-systemerror-frozen-intrinsics.js) -- [parallel/test-errors-systemerror-stackTraceLimit-custom-setter.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-errors-systemerror-stackTraceLimit-custom-setter.js) -- [parallel/test-errors-systemerror-stackTraceLimit-deleted-and-Error-sealed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-errors-systemerror-stackTraceLimit-deleted-and-Error-sealed.js) -- [parallel/test-errors-systemerror-stackTraceLimit-deleted.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-errors-systemerror-stackTraceLimit-deleted.js) -- [parallel/test-errors-systemerror-stackTraceLimit-has-only-a-getter.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-errors-systemerror-stackTraceLimit-has-only-a-getter.js) -- [parallel/test-errors-systemerror-stackTraceLimit-not-writable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-errors-systemerror-stackTraceLimit-not-writable.js) -- [parallel/test-errors-systemerror.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-errors-systemerror.js) -- [parallel/test-eslint-alphabetize-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-alphabetize-errors.js) -- [parallel/test-eslint-async-iife-no-unused-result.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-async-iife-no-unused-result.js) -- [parallel/test-eslint-avoid-prototype-pollution.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-avoid-prototype-pollution.js) -- [parallel/test-eslint-crypto-check.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-crypto-check.js) -- [parallel/test-eslint-documented-deprecation-codes.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-documented-deprecation-codes.js) -- [parallel/test-eslint-documented-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-documented-errors.js) -- [parallel/test-eslint-duplicate-requires.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-duplicate-requires.js) -- [parallel/test-eslint-eslint-check.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-eslint-check.js) -- [parallel/test-eslint-inspector-check.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-inspector-check.js) -- [parallel/test-eslint-lowercase-name-for-primitive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-lowercase-name-for-primitive.js) -- [parallel/test-eslint-no-array-destructuring.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-no-array-destructuring.js) -- [parallel/test-eslint-no-unescaped-regexp-dot.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-no-unescaped-regexp-dot.js) -- [parallel/test-eslint-non-ascii-character.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-non-ascii-character.js) -- [parallel/test-eslint-prefer-assert-iferror.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-prefer-assert-iferror.js) -- [parallel/test-eslint-prefer-assert-methods.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-prefer-assert-methods.js) -- [parallel/test-eslint-prefer-common-mustnotcall.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-prefer-common-mustnotcall.js) -- [parallel/test-eslint-prefer-common-mustsucceed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-prefer-common-mustsucceed.js) -- [parallel/test-eslint-prefer-primordials.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-prefer-primordials.js) -- [parallel/test-eslint-prefer-proto.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-prefer-proto.js) -- [parallel/test-eslint-prefer-util-format-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-prefer-util-format-errors.js) -- [parallel/test-eslint-require-common-first.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-require-common-first.js) -- [parallel/test-eslint-required-modules.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eslint-required-modules.js) -- [parallel/test-eval-disallow-code-generation-from-strings.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eval-disallow-code-generation-from-strings.js) -- [parallel/test-event-capture-rejections.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-event-capture-rejections.js) -- [parallel/test-event-emitter-check-listener-leaks.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-event-emitter-check-listener-leaks.js) -- [parallel/test-event-emitter-max-listeners-warning-for-null.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-event-emitter-max-listeners-warning-for-null.js) -- [parallel/test-event-emitter-max-listeners-warning-for-symbol.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-event-emitter-max-listeners-warning-for-symbol.js) -- [parallel/test-event-emitter-max-listeners-warning.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-event-emitter-max-listeners-warning.js) -- [parallel/test-event-target.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-event-target.js) -- [parallel/test-eventemitter-asyncresource.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eventemitter-asyncresource.js) -- [parallel/test-events-customevent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-events-customevent.js) -- [parallel/test-events-getmaxlisteners.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-events-getmaxlisteners.js) -- [parallel/test-events-listener-count-with-listener.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-events-listener-count-with-listener.js) -- [parallel/test-events-static-geteventlisteners.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-events-static-geteventlisteners.js) -- [parallel/test-eventtarget-memoryleakwarning.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eventtarget-memoryleakwarning.js) -- [parallel/test-eventtarget-once-twice.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eventtarget-once-twice.js) -- [parallel/test-eventtarget.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-eventtarget.js) -- [parallel/test-experimental-shared-value-conveyor.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-experimental-shared-value-conveyor.js) -- [parallel/test-file-validate-mode-flag.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-file-validate-mode-flag.js) -- [parallel/test-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-file.js) -- [parallel/test-filehandle-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-filehandle-close.js) -- [parallel/test-filehandle-readablestream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-filehandle-readablestream.js) -- [parallel/test-fixed-queue.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fixed-queue.js) -- [parallel/test-force-repl-with-eval.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-force-repl-with-eval.js) -- [parallel/test-force-repl.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-force-repl.js) -- [parallel/test-freelist.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-freelist.js) -- [parallel/test-freeze-intrinsics.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-freeze-intrinsics.js) -- [parallel/test-fs-append-file-flush.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-append-file-flush.js) -- [parallel/test-fs-assert-encoding-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-assert-encoding-error.js) -- [parallel/test-fs-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-buffer.js) -- [parallel/test-fs-buffertype-writesync.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-buffertype-writesync.js) -- [parallel/test-fs-close-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-close-errors.js) -- [parallel/test-fs-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-close.js) -- [parallel/test-fs-constants.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-constants.js) -- [parallel/test-fs-copyfile-respect-permissions.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-copyfile-respect-permissions.js) -- [parallel/test-fs-error-messages.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-error-messages.js) -- [parallel/test-fs-exists.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-exists.js) -- [parallel/test-fs-existssync-false.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-existssync-false.js) -- [parallel/test-fs-fchmod.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-fchmod.js) -- [parallel/test-fs-fchown.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-fchown.js) -- [parallel/test-fs-filehandle-use-after-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-filehandle-use-after-close.js) -- [parallel/test-fs-filehandle.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-filehandle.js) -- [parallel/test-fs-fmap.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-fmap.js) -- [parallel/test-fs-fsync.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-fsync.js) -- [parallel/test-fs-lchmod.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-lchmod.js) -- [parallel/test-fs-link.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-link.js) -- [parallel/test-fs-long-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-long-path.js) -- [parallel/test-fs-make-callback.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-make-callback.js) -- [parallel/test-fs-makeStatsCallback.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-makeStatsCallback.js) -- [parallel/test-fs-mkdir-mode-mask.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-mkdir-mode-mask.js) -- [parallel/test-fs-mkdir-recursive-eaccess.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-mkdir-recursive-eaccess.js) -- [parallel/test-fs-mkdir-rmdir.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-mkdir-rmdir.js) -- [parallel/test-fs-mkdtemp-prefix-check.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-mkdtemp-prefix-check.js) -- [parallel/test-fs-mkdtemp.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-mkdtemp.js) -- [parallel/test-fs-non-number-arguments-throw.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-non-number-arguments-throw.js) -- [parallel/test-fs-null-bytes.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-null-bytes.js) -- [parallel/test-fs-options-immutable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-options-immutable.js) -- [parallel/test-fs-promises-exists.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-exists.js) -- [parallel/test-fs-promises-file-handle-aggregate-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-file-handle-aggregate-errors.js) -- [parallel/test-fs-promises-file-handle-append-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-file-handle-append-file.js) -- [parallel/test-fs-promises-file-handle-chmod.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-file-handle-chmod.js) -- [parallel/test-fs-promises-file-handle-close-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-file-handle-close-errors.js) -- [parallel/test-fs-promises-file-handle-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-file-handle-close.js) -- [parallel/test-fs-promises-file-handle-dispose.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-file-handle-dispose.js) -- [parallel/test-fs-promises-file-handle-op-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-file-handle-op-errors.js) -- [parallel/test-fs-promises-file-handle-read-worker.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-file-handle-read-worker.js) -- [parallel/test-fs-promises-file-handle-read.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-file-handle-read.js) -- [parallel/test-fs-promises-file-handle-readFile.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-file-handle-readFile.js) -- [parallel/test-fs-promises-file-handle-stat.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-file-handle-stat.js) -- [parallel/test-fs-promises-file-handle-stream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-file-handle-stream.js) -- [parallel/test-fs-promises-file-handle-sync.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-file-handle-sync.js) -- [parallel/test-fs-promises-file-handle-truncate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-file-handle-truncate.js) -- [parallel/test-fs-promises-file-handle-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-file-handle-write.js) -- [parallel/test-fs-promises-file-handle-writeFile.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-file-handle-writeFile.js) -- [parallel/test-fs-promises-readfile-empty.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-readfile-empty.js) -- [parallel/test-fs-promises-readfile-with-fd.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-readfile-with-fd.js) -- [parallel/test-fs-promises-readfile.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-readfile.js) -- [parallel/test-fs-promises-watch.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-watch.js) -- [parallel/test-fs-promises-write-optional-params.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-write-optional-params.js) -- [parallel/test-fs-promises-writefile-typedarray.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-writefile-typedarray.js) -- [parallel/test-fs-promises-writefile.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises-writefile.js) -- [parallel/test-fs-promises.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promises.js) -- [parallel/test-fs-promisified.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-promisified.js) -- [parallel/test-fs-read-empty-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-read-empty-buffer.js) -- [parallel/test-fs-read-file-assert-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-read-file-assert-encoding.js) -- [parallel/test-fs-read-file-sync-hostname.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-read-file-sync-hostname.js) -- [parallel/test-fs-read-file-sync.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-read-file-sync.js) -- [parallel/test-fs-read-offset-null.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-read-offset-null.js) -- [parallel/test-fs-read-optional-params.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-read-optional-params.js) -- [parallel/test-fs-read-promises-optional-params.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-read-promises-optional-params.js) -- [parallel/test-fs-read-stream-err.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-read-stream-err.js) -- [parallel/test-fs-read-stream-fd-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-read-stream-fd-leak.js) -- [parallel/test-fs-read-stream-file-handle.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-read-stream-file-handle.js) -- [parallel/test-fs-read-stream-pos.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-read-stream-pos.js) -- [parallel/test-fs-readSync-optional-params.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readSync-optional-params.js) -- [parallel/test-fs-readdir-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readdir-buffer.js) -- [parallel/test-fs-readdir-types.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readdir-types.js) -- [parallel/test-fs-readdir-ucs2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readdir-ucs2.js) -- [parallel/test-fs-readfile-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readfile-error.js) -- [parallel/test-fs-readfile-fd.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readfile-fd.js) -- [parallel/test-fs-readfile-flags.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readfile-flags.js) -- [parallel/test-fs-readfile-pipe-large.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readfile-pipe-large.js) -- [parallel/test-fs-readfile-pipe.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readfile-pipe.js) -- [parallel/test-fs-readfile-unlink.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readfile-unlink.js) -- [parallel/test-fs-readfile-zero-byte-liar.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readfile-zero-byte-liar.js) -- [parallel/test-fs-readfile.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readfile.js) -- [parallel/test-fs-readfilesync-enoent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readfilesync-enoent.js) -- [parallel/test-fs-readfilesync-pipe-large.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readfilesync-pipe-large.js) -- [parallel/test-fs-readlink-type-check.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readlink-type-check.js) -- [parallel/test-fs-readv-promises.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readv-promises.js) -- [parallel/test-fs-readv-promisify.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-readv-promisify.js) -- [parallel/test-fs-ready-event-stream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-ready-event-stream.js) -- [parallel/test-fs-realpath-buffer-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-realpath-buffer-encoding.js) -- [parallel/test-fs-realpath-on-substed-drive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-realpath-on-substed-drive.js) -- [parallel/test-fs-realpath-pipe.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-realpath-pipe.js) -- [parallel/test-fs-realpath.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-realpath.js) -- [parallel/test-fs-rename-type-check.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-rename-type-check.js) -- [parallel/test-fs-rm.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-rm.js) -- [parallel/test-fs-sir-writes-alot.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-sir-writes-alot.js) -- [parallel/test-fs-stat-bigint.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-stat-bigint.js) -- [parallel/test-fs-stat.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-stat.js) -- [parallel/test-fs-statfs.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-statfs.js) -- [parallel/test-fs-stream-construct-compat-error-read.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-stream-construct-compat-error-read.js) -- [parallel/test-fs-stream-construct-compat-error-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-stream-construct-compat-error-write.js) -- [parallel/test-fs-stream-construct-compat-graceful-fs.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-stream-construct-compat-graceful-fs.js) -- [parallel/test-fs-stream-construct-compat-old-node.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-stream-construct-compat-old-node.js) -- [parallel/test-fs-stream-destroy-emit-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-stream-destroy-emit-error.js) -- [parallel/test-fs-stream-double-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-stream-double-close.js) -- [parallel/test-fs-stream-fs-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-stream-fs-options.js) -- [parallel/test-fs-stream-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-stream-options.js) -- [parallel/test-fs-symlink-buffer-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-symlink-buffer-path.js) -- [parallel/test-fs-symlink-dir-junction-relative.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-symlink-dir-junction-relative.js) -- [parallel/test-fs-symlink-dir-junction.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-symlink-dir-junction.js) -- [parallel/test-fs-symlink-dir.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-symlink-dir.js) -- [parallel/test-fs-symlink-longpath.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-symlink-longpath.js) -- [parallel/test-fs-symlink.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-symlink.js) -- [parallel/test-fs-sync-fd-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-sync-fd-leak.js) -- [parallel/test-fs-syncwritestream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-syncwritestream.js) -- [parallel/test-fs-timestamp-parsing-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-timestamp-parsing-error.js) -- [parallel/test-fs-truncate-clear-file-zero.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-truncate-clear-file-zero.js) -- [parallel/test-fs-truncate-fd.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-truncate-fd.js) -- [parallel/test-fs-truncate-sync.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-truncate-sync.js) -- [parallel/test-fs-truncate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-truncate.js) -- [parallel/test-fs-unlink-type-check.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-unlink-type-check.js) -- [parallel/test-fs-util-validateoffsetlength.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-util-validateoffsetlength.js) -- [parallel/test-fs-utils-get-dirents.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-utils-get-dirents.js) -- [parallel/test-fs-utimes-y2K38.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-utimes-y2K38.js) -- [parallel/test-fs-watch-abort-signal.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-abort-signal.js) -- [parallel/test-fs-watch-close-when-destroyed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-close-when-destroyed.js) -- [parallel/test-fs-watch-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-encoding.js) -- [parallel/test-fs-watch-enoent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-enoent.js) -- [parallel/test-fs-watch-file-enoent-after-deletion.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-file-enoent-after-deletion.js) -- [parallel/test-fs-watch-recursive-add-file-to-existing-subfolder.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-recursive-add-file-to-existing-subfolder.js) -- [parallel/test-fs-watch-recursive-add-file-to-new-folder.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-recursive-add-file-to-new-folder.js) -- [parallel/test-fs-watch-recursive-add-file-with-url.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-recursive-add-file-with-url.js) -- [parallel/test-fs-watch-recursive-add-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-recursive-add-file.js) -- [parallel/test-fs-watch-recursive-add-folder.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-recursive-add-folder.js) -- [parallel/test-fs-watch-recursive-assert-leaks.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-recursive-assert-leaks.js) -- [parallel/test-fs-watch-recursive-promise.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-recursive-promise.js) -- [parallel/test-fs-watch-recursive-symlink.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-recursive-symlink.js) -- [parallel/test-fs-watch-recursive-update-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-recursive-update-file.js) -- [parallel/test-fs-watch-recursive-validate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-recursive-validate.js) -- [parallel/test-fs-watch-recursive-watch-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-recursive-watch-file.js) -- [parallel/test-fs-watch-ref-unref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-ref-unref.js) -- [parallel/test-fs-watch-stop-async.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-stop-async.js) -- [parallel/test-fs-watch-stop-sync.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch-stop-sync.js) -- [parallel/test-fs-watch.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watch.js) -- [parallel/test-fs-watchfile-bigint.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watchfile-bigint.js) -- [parallel/test-fs-watchfile-ref-unref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-watchfile-ref-unref.js) -- [parallel/test-fs-whatwg-url.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-whatwg-url.js) -- [parallel/test-fs-write-buffer-large.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-write-buffer-large.js) -- [parallel/test-fs-write-file-flush.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-write-file-flush.js) -- [parallel/test-fs-write-file-typedarrays.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-write-file-typedarrays.js) -- [parallel/test-fs-write-negativeoffset.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-write-negativeoffset.js) -- [parallel/test-fs-write-optional-params.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-write-optional-params.js) -- [parallel/test-fs-write-reuse-callback.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-write-reuse-callback.js) -- [parallel/test-fs-write-sigxfsz.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-write-sigxfsz.js) -- [parallel/test-fs-write-stream-change-open.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-write-stream-change-open.js) -- [parallel/test-fs-write-stream-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-write-stream-encoding.js) -- [parallel/test-fs-write-stream-err.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-write-stream-err.js) -- [parallel/test-fs-write-stream-file-handle-2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-write-stream-file-handle-2.js) -- [parallel/test-fs-write-stream-file-handle.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-write-stream-file-handle.js) -- [parallel/test-fs-write-stream-flush.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-write-stream-flush.js) -- [parallel/test-fs-write-stream-patch-open.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-write-stream-patch-open.js) -- [parallel/test-fs-write-sync-optional-params.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-write-sync-optional-params.js) -- [parallel/test-fs-writefile-with-fd.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-writefile-with-fd.js) -- [parallel/test-fs-writev-promises.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-writev-promises.js) -- [parallel/test-fs-writev.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-fs-writev.js) -- [parallel/test-gc-http-client-connaborted.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-gc-http-client-connaborted.js) -- [parallel/test-gc-net-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-gc-net-timeout.js) -- [parallel/test-gc-tls-external-memory.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-gc-tls-external-memory.js) -- [parallel/test-global-console-exists.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-global-console-exists.js) -- [parallel/test-global-customevent-disabled.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-global-customevent-disabled.js) -- [parallel/test-global-customevent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-global-customevent.js) -- [parallel/test-global-domexception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-global-domexception.js) -- [parallel/test-global-encoder.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-global-encoder.js) -- [parallel/test-global-setters.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-global-setters.js) -- [parallel/test-global-webcrypto-classes.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-global-webcrypto-classes.js) -- [parallel/test-global-webcrypto-disbled.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-global-webcrypto-disbled.js) -- [parallel/test-global-webcrypto.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-global-webcrypto.js) -- [parallel/test-global-webstreams.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-global-webstreams.js) -- [parallel/test-global.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-global.js) -- [parallel/test-h2-large-header-cause-client-to-hangup.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-h2-large-header-cause-client-to-hangup.js) -- [parallel/test-handle-wrap-hasref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-handle-wrap-hasref.js) -- [parallel/test-heap-prof-basic.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-heap-prof-basic.js) -- [parallel/test-heap-prof-dir-absolute.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-heap-prof-dir-absolute.js) -- [parallel/test-heap-prof-dir-name.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-heap-prof-dir-name.js) -- [parallel/test-heap-prof-dir-relative.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-heap-prof-dir-relative.js) -- [parallel/test-heap-prof-exec-argv.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-heap-prof-exec-argv.js) -- [parallel/test-heap-prof-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-heap-prof-exit.js) -- [parallel/test-heap-prof-interval.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-heap-prof-interval.js) -- [parallel/test-heap-prof-invalid-args.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-heap-prof-invalid-args.js) -- [parallel/test-heap-prof-loop-drained.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-heap-prof-loop-drained.js) -- [parallel/test-heap-prof-name.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-heap-prof-name.js) -- [parallel/test-heap-prof-sigint.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-heap-prof-sigint.js) -- [parallel/test-heapdump-async-hooks-init-promise.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-heapdump-async-hooks-init-promise.js) -- [parallel/test-heapsnapshot-near-heap-limit-by-api-in-worker.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-heapsnapshot-near-heap-limit-by-api-in-worker.js) -- [parallel/test-heapsnapshot-near-heap-limit-worker.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-heapsnapshot-near-heap-limit-worker.js) -- [parallel/test-http-1.0-keep-alive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-1.0-keep-alive.js) -- [parallel/test-http-1.0.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-1.0.js) -- [parallel/test-http-abort-before-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-abort-before-end.js) -- [parallel/test-http-abort-client.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-abort-client.js) -- [parallel/test-http-abort-queued.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-abort-queued.js) -- [parallel/test-http-abort-stream-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-abort-stream-end.js) -- [parallel/test-http-aborted.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-aborted.js) -- [parallel/test-http-addrequest-localaddress.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-addrequest-localaddress.js) -- [parallel/test-http-after-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-after-connect.js) -- [parallel/test-http-agent-abort-controller.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-abort-controller.js) -- [parallel/test-http-agent-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-close.js) -- [parallel/test-http-agent-destroyed-socket.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-destroyed-socket.js) -- [parallel/test-http-agent-domain-reused-gc.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-domain-reused-gc.js) -- [parallel/test-http-agent-error-on-idle.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-error-on-idle.js) -- [parallel/test-http-agent-false.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-false.js) -- [parallel/test-http-agent-keepalive-delay.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-keepalive-delay.js) -- [parallel/test-http-agent-keepalive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-keepalive.js) -- [parallel/test-http-agent-maxsockets-respected.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-maxsockets-respected.js) -- [parallel/test-http-agent-maxsockets.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-maxsockets.js) -- [parallel/test-http-agent-maxtotalsockets.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-maxtotalsockets.js) -- [parallel/test-http-agent-no-protocol.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-no-protocol.js) -- [parallel/test-http-agent-null.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-null.js) -- [parallel/test-http-agent-remove.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-remove.js) -- [parallel/test-http-agent-reuse-drained-socket-only.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-reuse-drained-socket-only.js) -- [parallel/test-http-agent-scheduling.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-scheduling.js) -- [parallel/test-http-agent-timeout-option.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-timeout-option.js) -- [parallel/test-http-agent-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-timeout.js) -- [parallel/test-http-agent-uninitialized-with-handle.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-uninitialized-with-handle.js) -- [parallel/test-http-agent-uninitialized.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent-uninitialized.js) -- [parallel/test-http-agent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-agent.js) -- [parallel/test-http-allow-content-length-304.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-allow-content-length-304.js) -- [parallel/test-http-allow-req-after-204-res.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-allow-req-after-204-res.js) -- [parallel/test-http-automatic-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-automatic-headers.js) -- [parallel/test-http-autoselectfamily.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-autoselectfamily.js) -- [parallel/test-http-bind-twice.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-bind-twice.js) -- [parallel/test-http-blank-header.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-blank-header.js) -- [parallel/test-http-buffer-sanity.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-buffer-sanity.js) -- [parallel/test-http-byteswritten.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-byteswritten.js) -- [parallel/test-http-catch-uncaughtexception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-catch-uncaughtexception.js) -- [parallel/test-http-chunk-extensions-limit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-chunk-extensions-limit.js) -- [parallel/test-http-chunk-problem.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-chunk-problem.js) -- [parallel/test-http-chunked-304.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-chunked-304.js) -- [parallel/test-http-chunked-smuggling.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-chunked-smuggling.js) -- [parallel/test-http-chunked.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-chunked.js) -- [parallel/test-http-client-abort-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-abort-destroy.js) -- [parallel/test-http-client-abort-event.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-abort-event.js) -- [parallel/test-http-client-abort-keep-alive-destroy-res.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-abort-keep-alive-destroy-res.js) -- [parallel/test-http-client-abort-keep-alive-queued-tcp-socket.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-abort-keep-alive-queued-tcp-socket.js) -- [parallel/test-http-client-abort-keep-alive-queued-unix-socket.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-abort-keep-alive-queued-unix-socket.js) -- [parallel/test-http-client-abort-no-agent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-abort-no-agent.js) -- [parallel/test-http-client-abort-response-event.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-abort-response-event.js) -- [parallel/test-http-client-abort-unix-socket.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-abort-unix-socket.js) -- [parallel/test-http-client-abort.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-abort.js) -- [parallel/test-http-client-abort2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-abort2.js) -- [parallel/test-http-client-abort3.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-abort3.js) -- [parallel/test-http-client-aborted-event.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-aborted-event.js) -- [parallel/test-http-client-agent-abort-close-event.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-agent-abort-close-event.js) -- [parallel/test-http-client-agent-end-close-event.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-agent-end-close-event.js) -- [parallel/test-http-client-agent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-agent.js) -- [parallel/test-http-client-check-http-token.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-check-http-token.js) -- [parallel/test-http-client-close-event.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-close-event.js) -- [parallel/test-http-client-close-with-default-agent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-close-with-default-agent.js) -- [parallel/test-http-client-default-headers-exist.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-default-headers-exist.js) -- [parallel/test-http-client-defaults.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-defaults.js) -- [parallel/test-http-client-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-encoding.js) -- [parallel/test-http-client-error-rawbytes.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-error-rawbytes.js) -- [parallel/test-http-client-finished.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-finished.js) -- [parallel/test-http-client-headers-array.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-headers-array.js) -- [parallel/test-http-client-headers-host-array.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-headers-host-array.js) -- [parallel/test-http-client-immediate-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-immediate-error.js) -- [parallel/test-http-client-incomingmessage-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-incomingmessage-destroy.js) -- [parallel/test-http-client-invalid-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-invalid-path.js) -- [parallel/test-http-client-keep-alive-hint.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-keep-alive-hint.js) -- [parallel/test-http-client-keep-alive-release-before-finish.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-keep-alive-release-before-finish.js) -- [parallel/test-http-client-override-global-agent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-override-global-agent.js) -- [parallel/test-http-client-parse-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-parse-error.js) -- [parallel/test-http-client-pipe-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-pipe-end.js) -- [parallel/test-http-client-race-2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-race-2.js) -- [parallel/test-http-client-race.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-race.js) -- [parallel/test-http-client-readable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-readable.js) -- [parallel/test-http-client-reject-chunked-with-content-length.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-reject-chunked-with-content-length.js) -- [parallel/test-http-client-reject-cr-no-lf.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-reject-cr-no-lf.js) -- [parallel/test-http-client-reject-unexpected-agent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-reject-unexpected-agent.js) -- [parallel/test-http-client-req-error-dont-double-fire.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-req-error-dont-double-fire.js) -- [parallel/test-http-client-request-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-request-options.js) -- [parallel/test-http-client-res-destroyed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-res-destroyed.js) -- [parallel/test-http-client-response-domain.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-response-domain.js) -- [parallel/test-http-client-response-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-response-timeout.js) -- [parallel/test-http-client-set-timeout-after-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-set-timeout-after-end.js) -- [parallel/test-http-client-set-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-set-timeout.js) -- [parallel/test-http-client-spurious-aborted.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-spurious-aborted.js) -- [parallel/test-http-client-timeout-agent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-timeout-agent.js) -- [parallel/test-http-client-timeout-connect-listener.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-timeout-connect-listener.js) -- [parallel/test-http-client-timeout-event.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-timeout-event.js) -- [parallel/test-http-client-timeout-on-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-timeout-on-connect.js) -- [parallel/test-http-client-timeout-option-listeners.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-timeout-option-listeners.js) -- [parallel/test-http-client-timeout-option-with-agent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-timeout-option-with-agent.js) -- [parallel/test-http-client-timeout-option.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-timeout-option.js) -- [parallel/test-http-client-timeout-with-data.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-timeout-with-data.js) -- [parallel/test-http-client-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-timeout.js) -- [parallel/test-http-client-unescaped-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-unescaped-path.js) -- [parallel/test-http-client-upload-buf.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-upload-buf.js) -- [parallel/test-http-client-upload.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-client-upload.js) -- [parallel/test-http-common.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-common.js) -- [parallel/test-http-conn-reset.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-conn-reset.js) -- [parallel/test-http-connect-req-res.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-connect-req-res.js) -- [parallel/test-http-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-connect.js) -- [parallel/test-http-content-length-mismatch.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-content-length-mismatch.js) -- [parallel/test-http-content-length.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-content-length.js) -- [parallel/test-http-contentLength0.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-contentLength0.js) -- [parallel/test-http-correct-hostname.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-correct-hostname.js) -- [parallel/test-http-createConnection.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-createConnection.js) -- [parallel/test-http-date-header.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-date-header.js) -- [parallel/test-http-debug.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-debug.js) -- [parallel/test-http-decoded-auth.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-decoded-auth.js) -- [parallel/test-http-default-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-default-encoding.js) -- [parallel/test-http-default-port.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-default-port.js) -- [parallel/test-http-destroyed-socket-write2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-destroyed-socket-write2.js) -- [parallel/test-http-dns-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-dns-error.js) -- [parallel/test-http-double-content-length.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-double-content-length.js) -- [parallel/test-http-dump-req-when-res-ends.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-dump-req-when-res-ends.js) -- [parallel/test-http-early-hints-invalid-argument.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-early-hints-invalid-argument.js) -- [parallel/test-http-early-hints.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-early-hints.js) -- [parallel/test-http-end-throw-socket-handling.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-end-throw-socket-handling.js) -- [parallel/test-http-eof-on-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-eof-on-connect.js) -- [parallel/test-http-exceptions.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-exceptions.js) -- [parallel/test-http-expect-continue.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-expect-continue.js) -- [parallel/test-http-expect-handling.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-expect-handling.js) -- [parallel/test-http-extra-response.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-extra-response.js) -- [parallel/test-http-flush-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-flush-headers.js) -- [parallel/test-http-flush-response-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-flush-response-headers.js) -- [parallel/test-http-full-response.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-full-response.js) -- [parallel/test-http-generic-streams.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-generic-streams.js) -- [parallel/test-http-get-pipeline-problem.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-get-pipeline-problem.js) -- [parallel/test-http-head-request.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-head-request.js) -- [parallel/test-http-head-response-has-no-body-end-implicit-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-head-response-has-no-body-end-implicit-headers.js) -- [parallel/test-http-head-response-has-no-body-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-head-response-has-no-body-end.js) -- [parallel/test-http-head-response-has-no-body.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-head-response-has-no-body.js) -- [parallel/test-http-head-throw-on-response-body-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-head-throw-on-response-body-write.js) -- [parallel/test-http-header-badrequest.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-header-badrequest.js) -- [parallel/test-http-header-obstext.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-header-obstext.js) -- [parallel/test-http-header-overflow.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-header-overflow.js) -- [parallel/test-http-header-owstext.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-header-owstext.js) -- [parallel/test-http-header-read.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-header-read.js) -- [parallel/test-http-hex-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-hex-write.js) -- [parallel/test-http-highwatermark.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-highwatermark.js) -- [parallel/test-http-host-header-ipv6-fail.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-host-header-ipv6-fail.js) -- [parallel/test-http-host-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-host-headers.js) -- [parallel/test-http-hostname-typechecking.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-hostname-typechecking.js) -- [parallel/test-http-incoming-matchKnownFields.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-incoming-matchKnownFields.js) -- [parallel/test-http-incoming-message-connection-setter.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-incoming-message-connection-setter.js) -- [parallel/test-http-incoming-message-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-incoming-message-destroy.js) -- [parallel/test-http-incoming-message-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-incoming-message-options.js) -- [parallel/test-http-incoming-pipelined-socket-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-incoming-pipelined-socket-destroy.js) -- [parallel/test-http-information-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-information-headers.js) -- [parallel/test-http-information-processing.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-information-processing.js) -- [parallel/test-http-insecure-parser-per-stream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-insecure-parser-per-stream.js) -- [parallel/test-http-insecure-parser.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-insecure-parser.js) -- [parallel/test-http-invalid-path-chars.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-invalid-path-chars.js) -- [parallel/test-http-invalid-te.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-invalid-te.js) -- [parallel/test-http-invalid-urls.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-invalid-urls.js) -- [parallel/test-http-invalidheaderfield.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-invalidheaderfield.js) -- [parallel/test-http-invalidheaderfield2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-invalidheaderfield2.js) -- [parallel/test-http-keep-alive-close-on-header.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-keep-alive-close-on-header.js) -- [parallel/test-http-keep-alive-drop-requests.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-keep-alive-drop-requests.js) -- [parallel/test-http-keep-alive-max-requests.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-keep-alive-max-requests.js) -- [parallel/test-http-keep-alive-pipeline-max-requests.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-keep-alive-pipeline-max-requests.js) -- [parallel/test-http-keep-alive-timeout-custom.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-keep-alive-timeout-custom.js) -- [parallel/test-http-keep-alive-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-keep-alive-timeout.js) -- [parallel/test-http-keep-alive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-keep-alive.js) -- [parallel/test-http-keepalive-client.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-keepalive-client.js) -- [parallel/test-http-keepalive-free.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-keepalive-free.js) -- [parallel/test-http-keepalive-override.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-keepalive-override.js) -- [parallel/test-http-keepalive-request.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-keepalive-request.js) -- [parallel/test-http-listening.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-listening.js) -- [parallel/test-http-localaddress-bind-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-localaddress-bind-error.js) -- [parallel/test-http-malformed-request.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-malformed-request.js) -- [parallel/test-http-many-ended-pipelines.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-many-ended-pipelines.js) -- [parallel/test-http-max-header-size-per-stream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-max-header-size-per-stream.js) -- [parallel/test-http-max-header-size.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-max-header-size.js) -- [parallel/test-http-max-headers-count.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-max-headers-count.js) -- [parallel/test-http-max-http-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-max-http-headers.js) -- [parallel/test-http-methods.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-methods.js) -- [parallel/test-http-missing-header-separator-cr.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-missing-header-separator-cr.js) -- [parallel/test-http-missing-header-separator-lf.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-missing-header-separator-lf.js) -- [parallel/test-http-multi-line-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-multi-line-headers.js) -- [parallel/test-http-multiple-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-multiple-headers.js) -- [parallel/test-http-mutable-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-mutable-headers.js) -- [parallel/test-http-no-content-length.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-no-content-length.js) -- [parallel/test-http-no-read-no-dump.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-no-read-no-dump.js) -- [parallel/test-http-nodelay.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-nodelay.js) -- [parallel/test-http-outgoing-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-buffer.js) -- [parallel/test-http-outgoing-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-destroy.js) -- [parallel/test-http-outgoing-destroyed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-destroyed.js) -- [parallel/test-http-outgoing-end-cork.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-end-cork.js) -- [parallel/test-http-outgoing-end-multiple.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-end-multiple.js) -- [parallel/test-http-outgoing-end-types.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-end-types.js) -- [parallel/test-http-outgoing-finish-writable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-finish-writable.js) -- [parallel/test-http-outgoing-finish.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-finish.js) -- [parallel/test-http-outgoing-finished.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-finished.js) -- [parallel/test-http-outgoing-first-chunk-singlebyte-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-first-chunk-singlebyte-encoding.js) -- [parallel/test-http-outgoing-message-capture-rejection.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-message-capture-rejection.js) -- [parallel/test-http-outgoing-message-inheritance.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-message-inheritance.js) -- [parallel/test-http-outgoing-message-write-callback.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-message-write-callback.js) -- [parallel/test-http-outgoing-properties.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-properties.js) -- [parallel/test-http-outgoing-proto.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-proto.js) -- [parallel/test-http-outgoing-writableFinished.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-writableFinished.js) -- [parallel/test-http-outgoing-write-types.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-outgoing-write-types.js) -- [parallel/test-http-parser-bad-ref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-parser-bad-ref.js) -- [parallel/test-http-parser-finish-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-parser-finish-error.js) -- [parallel/test-http-parser-free.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-parser-free.js) -- [parallel/test-http-parser-freed-before-upgrade.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-parser-freed-before-upgrade.js) -- [parallel/test-http-parser-lazy-loaded.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-parser-lazy-loaded.js) -- [parallel/test-http-parser-memory-retention.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-parser-memory-retention.js) -- [parallel/test-http-parser-multiple-execute.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-parser-multiple-execute.js) -- [parallel/test-http-parser-timeout-reset.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-parser-timeout-reset.js) -- [parallel/test-http-parser.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-parser.js) -- [parallel/test-http-pause-no-dump.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-pause-no-dump.js) -- [parallel/test-http-pause-resume-one-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-pause-resume-one-end.js) -- [parallel/test-http-pause.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-pause.js) -- [parallel/test-http-perf_hooks.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-perf_hooks.js) -- [parallel/test-http-pipe-fs.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-pipe-fs.js) -- [parallel/test-http-pipeline-assertionerror-finish.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-pipeline-assertionerror-finish.js) -- [parallel/test-http-pipeline-flood.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-pipeline-flood.js) -- [parallel/test-http-pipeline-requests-connection-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-pipeline-requests-connection-leak.js) -- [parallel/test-http-pipeline-socket-parser-typeerror.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-pipeline-socket-parser-typeerror.js) -- [parallel/test-http-proxy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-proxy.js) -- [parallel/test-http-raw-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-raw-headers.js) -- [parallel/test-http-readable-data-event.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-readable-data-event.js) -- [parallel/test-http-remove-connection-header-persists-connection.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-remove-connection-header-persists-connection.js) -- [parallel/test-http-remove-header-stays-removed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-remove-header-stays-removed.js) -- [parallel/test-http-req-close-robust-from-tampering.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-req-close-robust-from-tampering.js) -- [parallel/test-http-req-res-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-req-res-close.js) -- [parallel/test-http-request-agent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-request-agent.js) -- [parallel/test-http-request-arguments.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-request-arguments.js) -- [parallel/test-http-request-dont-override-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-request-dont-override-options.js) -- [parallel/test-http-request-end-twice.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-request-end-twice.js) -- [parallel/test-http-request-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-request-end.js) -- [parallel/test-http-request-host-header.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-request-host-header.js) -- [parallel/test-http-request-invalid-method-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-request-invalid-method-error.js) -- [parallel/test-http-request-join-authorization-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-request-join-authorization-headers.js) -- [parallel/test-http-request-large-payload.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-request-large-payload.js) -- [parallel/test-http-request-methods.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-request-methods.js) -- [parallel/test-http-request-smuggling-content-length.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-request-smuggling-content-length.js) -- [parallel/test-http-res-write-after-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-res-write-after-end.js) -- [parallel/test-http-res-write-end-dont-take-array.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-res-write-end-dont-take-array.js) -- [parallel/test-http-response-add-header-after-sent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-response-add-header-after-sent.js) -- [parallel/test-http-response-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-response-close.js) -- [parallel/test-http-response-cork.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-response-cork.js) -- [parallel/test-http-response-multi-content-length.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-response-multi-content-length.js) -- [parallel/test-http-response-multiheaders.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-response-multiheaders.js) -- [parallel/test-http-response-no-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-response-no-headers.js) -- [parallel/test-http-response-readable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-response-readable.js) -- [parallel/test-http-response-remove-header-after-sent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-response-remove-header-after-sent.js) -- [parallel/test-http-response-setheaders.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-response-setheaders.js) -- [parallel/test-http-response-splitting.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-response-splitting.js) -- [parallel/test-http-response-status-message.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-response-status-message.js) -- [parallel/test-http-response-statuscode.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-response-statuscode.js) -- [parallel/test-http-response-writehead-returns-this.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-response-writehead-returns-this.js) -- [parallel/test-http-same-map.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-same-map.js) -- [parallel/test-http-server-async-dispose.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-async-dispose.js) -- [parallel/test-http-server-capture-rejections.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-capture-rejections.js) -- [parallel/test-http-server-client-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-client-error.js) -- [parallel/test-http-server-close-all.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-close-all.js) -- [parallel/test-http-server-close-destroy-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-close-destroy-timeout.js) -- [parallel/test-http-server-close-idle-wait-response.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-close-idle-wait-response.js) -- [parallel/test-http-server-close-idle.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-close-idle.js) -- [parallel/test-http-server-connection-list-when-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-connection-list-when-close.js) -- [parallel/test-http-server-connections-checking-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-connections-checking-leak.js) -- [parallel/test-http-server-consumed-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-consumed-timeout.js) -- [parallel/test-http-server-de-chunked-trailer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-de-chunked-trailer.js) -- [parallel/test-http-server-delete-parser.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-delete-parser.js) -- [parallel/test-http-server-destroy-socket-on-client-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-destroy-socket-on-client-error.js) -- [parallel/test-http-server-headers-timeout-delayed-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-headers-timeout-delayed-headers.js) -- [parallel/test-http-server-headers-timeout-interrupted-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-headers-timeout-interrupted-headers.js) -- [parallel/test-http-server-headers-timeout-keepalive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-headers-timeout-keepalive.js) -- [parallel/test-http-server-headers-timeout-pipelining.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-headers-timeout-pipelining.js) -- [parallel/test-http-server-incomingmessage-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-incomingmessage-destroy.js) -- [parallel/test-http-server-keep-alive-defaults.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-keep-alive-defaults.js) -- [parallel/test-http-server-keep-alive-max-requests-null.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-keep-alive-max-requests-null.js) -- [parallel/test-http-server-keep-alive-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-keep-alive-timeout.js) -- [parallel/test-http-server-keepalive-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-keepalive-end.js) -- [parallel/test-http-server-keepalive-req-gc.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-keepalive-req-gc.js) -- [parallel/test-http-server-multiheaders.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-multiheaders.js) -- [parallel/test-http-server-multiheaders2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-multiheaders2.js) -- [parallel/test-http-server-non-utf8-header.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-non-utf8-header.js) -- [parallel/test-http-server-options-highwatermark.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-options-highwatermark.js) -- [parallel/test-http-server-options-incoming-message.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-options-incoming-message.js) -- [parallel/test-http-server-options-server-response.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-options-server-response.js) -- [parallel/test-http-server-reject-chunked-with-content-length.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-reject-chunked-with-content-length.js) -- [parallel/test-http-server-reject-cr-no-lf.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-reject-cr-no-lf.js) -- [parallel/test-http-server-request-timeout-delayed-body.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-request-timeout-delayed-body.js) -- [parallel/test-http-server-request-timeout-delayed-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-request-timeout-delayed-headers.js) -- [parallel/test-http-server-request-timeout-interrupted-body.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-request-timeout-interrupted-body.js) -- [parallel/test-http-server-request-timeout-interrupted-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-request-timeout-interrupted-headers.js) -- [parallel/test-http-server-request-timeout-keepalive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-request-timeout-keepalive.js) -- [parallel/test-http-server-request-timeout-pipelining.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-request-timeout-pipelining.js) -- [parallel/test-http-server-request-timeout-upgrade.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-request-timeout-upgrade.js) -- [parallel/test-http-server-request-timeouts-mixed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-request-timeouts-mixed.js) -- [parallel/test-http-server-response-standalone.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-response-standalone.js) -- [parallel/test-http-server-stale-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-stale-close.js) -- [parallel/test-http-server-timeouts-validation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-timeouts-validation.js) -- [parallel/test-http-server-unconsume-consume.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-unconsume-consume.js) -- [parallel/test-http-server-unconsume.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-unconsume.js) -- [parallel/test-http-server-write-after-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-write-after-end.js) -- [parallel/test-http-server-write-end-after-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server-write-end-after-end.js) -- [parallel/test-http-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-server.js) -- [parallel/test-http-set-cookies.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-set-cookies.js) -- [parallel/test-http-set-header-chain.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-set-header-chain.js) -- [parallel/test-http-set-max-idle-http-parser.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-set-max-idle-http-parser.js) -- [parallel/test-http-set-timeout-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-set-timeout-server.js) -- [parallel/test-http-set-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-set-timeout.js) -- [parallel/test-http-set-trailers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-set-trailers.js) -- [parallel/test-http-should-keep-alive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-should-keep-alive.js) -- [parallel/test-http-socket-encoding-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-socket-encoding-error.js) -- [parallel/test-http-socket-error-listeners.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-socket-error-listeners.js) -- [parallel/test-http-status-code.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-status-code.js) -- [parallel/test-http-status-message.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-status-message.js) -- [parallel/test-http-status-reason-invalid-chars.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-status-reason-invalid-chars.js) -- [parallel/test-http-sync-write-error-during-continue.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-sync-write-error-during-continue.js) -- [parallel/test-http-timeout-client-warning.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-timeout-client-warning.js) -- [parallel/test-http-timeout-overflow.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-timeout-overflow.js) -- [parallel/test-http-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-timeout.js) -- [parallel/test-http-transfer-encoding-repeated-chunked.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-transfer-encoding-repeated-chunked.js) -- [parallel/test-http-transfer-encoding-smuggling.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-transfer-encoding-smuggling.js) -- [parallel/test-http-uncaught-from-request-callback.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-uncaught-from-request-callback.js) -- [parallel/test-http-unix-socket-keep-alive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-unix-socket-keep-alive.js) -- [parallel/test-http-unix-socket.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-unix-socket.js) -- [parallel/test-http-upgrade-advertise.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-upgrade-advertise.js) -- [parallel/test-http-upgrade-agent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-upgrade-agent.js) -- [parallel/test-http-upgrade-binary.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-upgrade-binary.js) -- [parallel/test-http-upgrade-client.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-upgrade-client.js) -- [parallel/test-http-upgrade-client2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-upgrade-client2.js) -- [parallel/test-http-upgrade-reconsume-stream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-upgrade-reconsume-stream.js) -- [parallel/test-http-upgrade-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-upgrade-server.js) -- [parallel/test-http-upgrade-server2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-upgrade-server2.js) -- [parallel/test-http-url.parse-auth-with-header-in-request.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-url.parse-auth-with-header-in-request.js) -- [parallel/test-http-url.parse-auth.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-url.parse-auth.js) -- [parallel/test-http-url.parse-basic.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-url.parse-basic.js) -- [parallel/test-http-url.parse-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-url.parse-path.js) -- [parallel/test-http-url.parse-post.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-url.parse-post.js) -- [parallel/test-http-url.parse-search.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-url.parse-search.js) -- [parallel/test-http-wget.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-wget.js) -- [parallel/test-http-writable-true-after-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-writable-true-after-close.js) -- [parallel/test-http-write-callbacks.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-write-callbacks.js) -- [parallel/test-http-write-empty-string.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-write-empty-string.js) -- [parallel/test-http-write-head-2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-write-head-2.js) -- [parallel/test-http-write-head.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-write-head.js) -- [parallel/test-http-zero-length-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-zero-length-write.js) -- [parallel/test-http-zerolengthbuffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http-zerolengthbuffer.js) -- [parallel/test-http.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http.js) -- [parallel/test-http2-altsvc.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-altsvc.js) -- [parallel/test-http2-autoselect-protocol.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-autoselect-protocol.js) -- [parallel/test-http2-backpressure.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-backpressure.js) -- [parallel/test-http2-binding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-binding.js) -- [parallel/test-http2-buffersize.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-buffersize.js) -- [parallel/test-http2-byteswritten-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-byteswritten-server.js) -- [parallel/test-http2-cancel-while-client-reading.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-cancel-while-client-reading.js) -- [parallel/test-http2-capture-rejection.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-capture-rejection.js) -- [parallel/test-http2-clean-output.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-clean-output.js) -- [parallel/test-http2-client-connection-tunnelling.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-connection-tunnelling.js) -- [parallel/test-http2-client-data-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-data-end.js) -- [parallel/test-http2-client-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-destroy.js) -- [parallel/test-http2-client-http1-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-http1-server.js) -- [parallel/test-http2-client-jsstream-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-jsstream-destroy.js) -- [parallel/test-http2-client-onconnect-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-onconnect-errors.js) -- [parallel/test-http2-client-port-80.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-port-80.js) -- [parallel/test-http2-client-priority-before-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-priority-before-connect.js) -- [parallel/test-http2-client-promisify-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-promisify-connect.js) -- [parallel/test-http2-client-request-listeners-warning.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-request-listeners-warning.js) -- [parallel/test-http2-client-request-options-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-request-options-errors.js) -- [parallel/test-http2-client-rststream-before-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-rststream-before-connect.js) -- [parallel/test-http2-client-set-priority.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-set-priority.js) -- [parallel/test-http2-client-setLocalWindowSize.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-setLocalWindowSize.js) -- [parallel/test-http2-client-setNextStreamID-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-setNextStreamID-errors.js) -- [parallel/test-http2-client-settings-before-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-settings-before-connect.js) -- [parallel/test-http2-client-shutdown-before-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-shutdown-before-connect.js) -- [parallel/test-http2-client-socket-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-socket-destroy.js) -- [parallel/test-http2-client-stream-destroy-before-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-stream-destroy-before-connect.js) -- [parallel/test-http2-client-unescaped-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-unescaped-path.js) -- [parallel/test-http2-client-upload-reject.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-upload-reject.js) -- [parallel/test-http2-client-upload.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-upload.js) -- [parallel/test-http2-client-write-before-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-write-before-connect.js) -- [parallel/test-http2-client-write-empty-string.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-client-write-empty-string.js) -- [parallel/test-http2-close-while-writing.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-close-while-writing.js) -- [parallel/test-http2-compat-aborted.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-aborted.js) -- [parallel/test-http2-compat-client-upload-reject.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-client-upload-reject.js) -- [parallel/test-http2-compat-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-errors.js) -- [parallel/test-http2-compat-expect-continue-check.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-expect-continue-check.js) -- [parallel/test-http2-compat-expect-continue.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-expect-continue.js) -- [parallel/test-http2-compat-expect-handling.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-expect-handling.js) -- [parallel/test-http2-compat-method-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-method-connect.js) -- [parallel/test-http2-compat-serverrequest-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverrequest-end.js) -- [parallel/test-http2-compat-serverrequest-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverrequest-headers.js) -- [parallel/test-http2-compat-serverrequest-host.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverrequest-host.js) -- [parallel/test-http2-compat-serverrequest-pause.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverrequest-pause.js) -- [parallel/test-http2-compat-serverrequest-pipe.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverrequest-pipe.js) -- [parallel/test-http2-compat-serverrequest-settimeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverrequest-settimeout.js) -- [parallel/test-http2-compat-serverrequest-trailers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverrequest-trailers.js) -- [parallel/test-http2-compat-serverrequest.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverrequest.js) -- [parallel/test-http2-compat-serverresponse-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-close.js) -- [parallel/test-http2-compat-serverresponse-createpushresponse.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-createpushresponse.js) -- [parallel/test-http2-compat-serverresponse-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-destroy.js) -- [parallel/test-http2-compat-serverresponse-drain.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-drain.js) -- [parallel/test-http2-compat-serverresponse-end-after-statuses-without-body.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-end-after-statuses-without-body.js) -- [parallel/test-http2-compat-serverresponse-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-end.js) -- [parallel/test-http2-compat-serverresponse-finished.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-finished.js) -- [parallel/test-http2-compat-serverresponse-flushheaders.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-flushheaders.js) -- [parallel/test-http2-compat-serverresponse-headers-after-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-headers-after-destroy.js) -- [parallel/test-http2-compat-serverresponse-headers-send-date.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-headers-send-date.js) -- [parallel/test-http2-compat-serverresponse-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-headers.js) -- [parallel/test-http2-compat-serverresponse-settimeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-settimeout.js) -- [parallel/test-http2-compat-serverresponse-statuscode.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-statuscode.js) -- [parallel/test-http2-compat-serverresponse-statusmessage-property-set.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-statusmessage-property-set.js) -- [parallel/test-http2-compat-serverresponse-statusmessage-property.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-statusmessage-property.js) -- [parallel/test-http2-compat-serverresponse-statusmessage.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-statusmessage.js) -- [parallel/test-http2-compat-serverresponse-trailers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-trailers.js) -- [parallel/test-http2-compat-serverresponse-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-write.js) -- [parallel/test-http2-compat-serverresponse-writehead-array.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-writehead-array.js) -- [parallel/test-http2-compat-serverresponse-writehead.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse-writehead.js) -- [parallel/test-http2-compat-serverresponse.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-serverresponse.js) -- [parallel/test-http2-compat-short-stream-client-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-short-stream-client-server.js) -- [parallel/test-http2-compat-socket-destroy-delayed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-socket-destroy-delayed.js) -- [parallel/test-http2-compat-socket-set.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-socket-set.js) -- [parallel/test-http2-compat-socket.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-socket.js) -- [parallel/test-http2-compat-write-early-hints-invalid-argument-type.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-write-early-hints-invalid-argument-type.js) -- [parallel/test-http2-compat-write-early-hints-invalid-argument-value.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-write-early-hints-invalid-argument-value.js) -- [parallel/test-http2-compat-write-early-hints.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-write-early-hints.js) -- [parallel/test-http2-compat-write-head-destroyed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-compat-write-head-destroyed.js) -- [parallel/test-http2-connect-method-extended-cant-turn-off.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-connect-method-extended-cant-turn-off.js) -- [parallel/test-http2-connect-method-extended.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-connect-method-extended.js) -- [parallel/test-http2-connect-method.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-connect-method.js) -- [parallel/test-http2-connect-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-connect-options.js) -- [parallel/test-http2-connect-tls-with-delay.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-connect-tls-with-delay.js) -- [parallel/test-http2-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-connect.js) -- [parallel/test-http2-cookies.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-cookies.js) -- [parallel/test-http2-create-client-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-create-client-connect.js) -- [parallel/test-http2-create-client-secure-session.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-create-client-secure-session.js) -- [parallel/test-http2-create-client-session.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-create-client-session.js) -- [parallel/test-http2-createsecureserver-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-createsecureserver-options.js) -- [parallel/test-http2-createserver-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-createserver-options.js) -- [parallel/test-http2-createwritereq.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-createwritereq.js) -- [parallel/test-http2-date-header.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-date-header.js) -- [parallel/test-http2-debug.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-debug.js) -- [parallel/test-http2-destroy-after-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-destroy-after-write.js) -- [parallel/test-http2-dont-lose-data.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-dont-lose-data.js) -- [parallel/test-http2-dont-override.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-dont-override.js) -- [parallel/test-http2-empty-frame-without-eof.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-empty-frame-without-eof.js) -- [parallel/test-http2-endafterheaders.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-endafterheaders.js) -- [parallel/test-http2-error-order.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-error-order.js) -- [parallel/test-http2-exceeds-server-trailer-size.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-exceeds-server-trailer-size.js) -- [parallel/test-http2-forget-closed-streams.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-forget-closed-streams.js) -- [parallel/test-http2-generic-streams-sendfile.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-generic-streams-sendfile.js) -- [parallel/test-http2-generic-streams.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-generic-streams.js) -- [parallel/test-http2-getpackedsettings.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-getpackedsettings.js) -- [parallel/test-http2-goaway-delayed-request.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-goaway-delayed-request.js) -- [parallel/test-http2-goaway-opaquedata.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-goaway-opaquedata.js) -- [parallel/test-http2-head-request.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-head-request.js) -- [parallel/test-http2-https-fallback-http-server-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-https-fallback-http-server-options.js) -- [parallel/test-http2-https-fallback.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-https-fallback.js) -- [parallel/test-http2-info-headers-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-info-headers-errors.js) -- [parallel/test-http2-info-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-info-headers.js) -- [parallel/test-http2-invalidargtypes-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-invalidargtypes-errors.js) -- [parallel/test-http2-invalidheaderfield.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-invalidheaderfield.js) -- [parallel/test-http2-invalidheaderfields-client.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-invalidheaderfields-client.js) -- [parallel/test-http2-large-write-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-large-write-close.js) -- [parallel/test-http2-large-write-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-large-write-destroy.js) -- [parallel/test-http2-large-write-multiple-requests.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-large-write-multiple-requests.js) -- [parallel/test-http2-large-writes-session-memory-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-large-writes-session-memory-leak.js) -- [parallel/test-http2-malformed-altsvc.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-malformed-altsvc.js) -- [parallel/test-http2-many-writes-and-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-many-writes-and-destroy.js) -- [parallel/test-http2-max-concurrent-streams.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-max-concurrent-streams.js) -- [parallel/test-http2-max-invalid-frames.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-max-invalid-frames.js) -- [parallel/test-http2-max-session-memory-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-max-session-memory-leak.js) -- [parallel/test-http2-max-settings.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-max-settings.js) -- [parallel/test-http2-methods.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-methods.js) -- [parallel/test-http2-misbehaving-flow-control-paused.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-misbehaving-flow-control-paused.js) -- [parallel/test-http2-misbehaving-flow-control.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-misbehaving-flow-control.js) -- [parallel/test-http2-misbehaving-multiplex.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-misbehaving-multiplex.js) -- [parallel/test-http2-misc-util.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-misc-util.js) -- [parallel/test-http2-misused-pseudoheaders.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-misused-pseudoheaders.js) -- [parallel/test-http2-multi-content-length.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-multi-content-length.js) -- [parallel/test-http2-multiheaders-raw.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-multiheaders-raw.js) -- [parallel/test-http2-multiheaders.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-multiheaders.js) -- [parallel/test-http2-multiplex.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-multiplex.js) -- [parallel/test-http2-multistream-destroy-on-read-tls.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-multistream-destroy-on-read-tls.js) -- [parallel/test-http2-no-more-streams.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-no-more-streams.js) -- [parallel/test-http2-no-wanttrailers-listener.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-no-wanttrailers-listener.js) -- [parallel/test-http2-onping.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-onping.js) -- [parallel/test-http2-options-max-headers-block-length.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-options-max-headers-block-length.js) -- [parallel/test-http2-options-max-headers-exceeds-nghttp2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-options-max-headers-exceeds-nghttp2.js) -- [parallel/test-http2-options-max-reserved-streams.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-options-max-reserved-streams.js) -- [parallel/test-http2-options-server-request.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-options-server-request.js) -- [parallel/test-http2-options-server-response.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-options-server-response.js) -- [parallel/test-http2-origin.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-origin.js) -- [parallel/test-http2-pack-end-stream-flag.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-pack-end-stream-flag.js) -- [parallel/test-http2-padding-aligned.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-padding-aligned.js) -- [parallel/test-http2-perf_hooks.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-perf_hooks.js) -- [parallel/test-http2-ping-settings-heapdump.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-ping-settings-heapdump.js) -- [parallel/test-http2-ping-unsolicited-ack.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-ping-unsolicited-ack.js) -- [parallel/test-http2-ping.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-ping.js) -- [parallel/test-http2-pipe-named-pipe.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-pipe-named-pipe.js) -- [parallel/test-http2-pipe.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-pipe.js) -- [parallel/test-http2-priority-cycle-.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-priority-cycle-.js) -- [parallel/test-http2-priority-event.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-priority-event.js) -- [parallel/test-http2-propagate-session-destroy-code.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-propagate-session-destroy-code.js) -- [parallel/test-http2-removed-header-stays-removed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-removed-header-stays-removed.js) -- [parallel/test-http2-request-remove-connect-listener.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-request-remove-connect-listener.js) -- [parallel/test-http2-request-response-proto.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-request-response-proto.js) -- [parallel/test-http2-res-corked.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-res-corked.js) -- [parallel/test-http2-res-writable-properties.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-res-writable-properties.js) -- [parallel/test-http2-reset-flood.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-reset-flood.js) -- [parallel/test-http2-respond-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-errors.js) -- [parallel/test-http2-respond-file-204.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-file-204.js) -- [parallel/test-http2-respond-file-304.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-file-304.js) -- [parallel/test-http2-respond-file-404.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-file-404.js) -- [parallel/test-http2-respond-file-compat.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-file-compat.js) -- [parallel/test-http2-respond-file-error-dir.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-file-error-dir.js) -- [parallel/test-http2-respond-file-error-pipe-offset.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-file-error-pipe-offset.js) -- [parallel/test-http2-respond-file-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-file-errors.js) -- [parallel/test-http2-respond-file-fd-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-file-fd-errors.js) -- [parallel/test-http2-respond-file-fd-invalid.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-file-fd-invalid.js) -- [parallel/test-http2-respond-file-fd-range.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-file-fd-range.js) -- [parallel/test-http2-respond-file-fd.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-file-fd.js) -- [parallel/test-http2-respond-file-filehandle.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-file-filehandle.js) -- [parallel/test-http2-respond-file-push.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-file-push.js) -- [parallel/test-http2-respond-file-range.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-file-range.js) -- [parallel/test-http2-respond-file-with-pipe.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-file-with-pipe.js) -- [parallel/test-http2-respond-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-file.js) -- [parallel/test-http2-respond-nghttperrors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-nghttperrors.js) -- [parallel/test-http2-respond-no-data.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-no-data.js) -- [parallel/test-http2-respond-with-fd-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-with-fd-errors.js) -- [parallel/test-http2-respond-with-file-connection-abort.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-respond-with-file-connection-abort.js) -- [parallel/test-http2-response-splitting.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-response-splitting.js) -- [parallel/test-http2-sensitive-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-sensitive-headers.js) -- [parallel/test-http2-sent-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-sent-headers.js) -- [parallel/test-http2-serve-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-serve-file.js) -- [parallel/test-http2-server-async-dispose.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-async-dispose.js) -- [parallel/test-http2-server-close-callback.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-close-callback.js) -- [parallel/test-http2-server-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-errors.js) -- [parallel/test-http2-server-http1-client.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-http1-client.js) -- [parallel/test-http2-server-push-disabled.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-push-disabled.js) -- [parallel/test-http2-server-push-stream-errors-args.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-push-stream-errors-args.js) -- [parallel/test-http2-server-push-stream-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-push-stream-errors.js) -- [parallel/test-http2-server-push-stream-head.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-push-stream-head.js) -- [parallel/test-http2-server-push-stream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-push-stream.js) -- [parallel/test-http2-server-rst-before-respond.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-rst-before-respond.js) -- [parallel/test-http2-server-rst-stream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-rst-stream.js) -- [parallel/test-http2-server-session-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-session-destroy.js) -- [parallel/test-http2-server-sessionerror.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-sessionerror.js) -- [parallel/test-http2-server-set-header.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-set-header.js) -- [parallel/test-http2-server-setLocalWindowSize.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-setLocalWindowSize.js) -- [parallel/test-http2-server-settimeout-no-callback.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-settimeout-no-callback.js) -- [parallel/test-http2-server-shutdown-before-respond.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-shutdown-before-respond.js) -- [parallel/test-http2-server-shutdown-options-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-shutdown-options-errors.js) -- [parallel/test-http2-server-shutdown-redundant.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-shutdown-redundant.js) -- [parallel/test-http2-server-socket-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-socket-destroy.js) -- [parallel/test-http2-server-startup.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-startup.js) -- [parallel/test-http2-server-stream-session-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-stream-session-destroy.js) -- [parallel/test-http2-server-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-timeout.js) -- [parallel/test-http2-server-unknown-protocol.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-server-unknown-protocol.js) -- [parallel/test-http2-session-gc-while-write-scheduled.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-session-gc-while-write-scheduled.js) -- [parallel/test-http2-session-settings.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-session-settings.js) -- [parallel/test-http2-session-stream-state.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-session-stream-state.js) -- [parallel/test-http2-session-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-session-timeout.js) -- [parallel/test-http2-session-unref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-session-unref.js) -- [parallel/test-http2-settings-unsolicited-ack.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-settings-unsolicited-ack.js) -- [parallel/test-http2-short-stream-client-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-short-stream-client-server.js) -- [parallel/test-http2-single-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-single-headers.js) -- [parallel/test-http2-socket-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-socket-close.js) -- [parallel/test-http2-socket-proxy-handler-for-has.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-socket-proxy-handler-for-has.js) -- [parallel/test-http2-socket-proxy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-socket-proxy.js) -- [parallel/test-http2-status-code-invalid.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-status-code-invalid.js) -- [parallel/test-http2-status-code.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-status-code.js) -- [parallel/test-http2-stream-client.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-stream-client.js) -- [parallel/test-http2-stream-destroy-event-order.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-stream-destroy-event-order.js) -- [parallel/test-http2-stream-removelisteners-after-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-stream-removelisteners-after-close.js) -- [parallel/test-http2-timeouts.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-timeouts.js) -- [parallel/test-http2-tls-disconnect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-tls-disconnect.js) -- [parallel/test-http2-too-large-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-too-large-headers.js) -- [parallel/test-http2-too-many-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-too-many-headers.js) -- [parallel/test-http2-too-many-settings.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-too-many-settings.js) -- [parallel/test-http2-too-many-streams.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-too-many-streams.js) -- [parallel/test-http2-trailers-after-session-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-trailers-after-session-close.js) -- [parallel/test-http2-trailers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-trailers.js) -- [parallel/test-http2-unbound-socket-proxy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-unbound-socket-proxy.js) -- [parallel/test-http2-update-settings.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-update-settings.js) -- [parallel/test-http2-util-assert-valid-pseudoheader.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-util-assert-valid-pseudoheader.js) -- [parallel/test-http2-util-asserts.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-util-asserts.js) -- [parallel/test-http2-util-headers-list.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-util-headers-list.js) -- [parallel/test-http2-util-nghttp2error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-util-nghttp2error.js) -- [parallel/test-http2-util-update-options-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-util-update-options-buffer.js) -- [parallel/test-http2-window-size.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-window-size.js) -- [parallel/test-http2-write-callbacks.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-write-callbacks.js) -- [parallel/test-http2-write-empty-string.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-write-empty-string.js) -- [parallel/test-http2-write-finishes-after-stream-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-write-finishes-after-stream-destroy.js) -- [parallel/test-http2-zero-length-header.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-zero-length-header.js) -- [parallel/test-http2-zero-length-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-http2-zero-length-write.js) -- [parallel/test-https-abortcontroller.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-abortcontroller.js) -- [parallel/test-https-agent-abort-controller.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-agent-abort-controller.js) -- [parallel/test-https-agent-additional-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-agent-additional-options.js) -- [parallel/test-https-agent-constructor.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-agent-constructor.js) -- [parallel/test-https-agent-create-connection.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-agent-create-connection.js) -- [parallel/test-https-agent-disable-session-reuse.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-agent-disable-session-reuse.js) -- [parallel/test-https-agent-getname.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-agent-getname.js) -- [parallel/test-https-agent-keylog.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-agent-keylog.js) -- [parallel/test-https-agent-servername.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-agent-servername.js) -- [parallel/test-https-agent-session-eviction.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-agent-session-eviction.js) -- [parallel/test-https-agent-session-injection.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-agent-session-injection.js) -- [parallel/test-https-agent-session-reuse.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-agent-session-reuse.js) -- [parallel/test-https-agent-sni.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-agent-sni.js) -- [parallel/test-https-agent-sockets-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-agent-sockets-leak.js) -- [parallel/test-https-agent-unref-socket.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-agent-unref-socket.js) -- [parallel/test-https-agent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-agent.js) -- [parallel/test-https-argument-of-creating.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-argument-of-creating.js) -- [parallel/test-https-autoselectfamily.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-autoselectfamily.js) -- [parallel/test-https-byteswritten.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-byteswritten.js) -- [parallel/test-https-client-checkServerIdentity.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-client-checkServerIdentity.js) -- [parallel/test-https-client-get-url.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-client-get-url.js) -- [parallel/test-https-client-override-global-agent.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-client-override-global-agent.js) -- [parallel/test-https-client-reject.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-client-reject.js) -- [parallel/test-https-client-renegotiation-limit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-client-renegotiation-limit.js) -- [parallel/test-https-client-resume.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-client-resume.js) -- [parallel/test-https-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-close.js) -- [parallel/test-https-connect-address-family.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-connect-address-family.js) -- [parallel/test-https-connecting-to-http.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-connecting-to-http.js) -- [parallel/test-https-drain.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-drain.js) -- [parallel/test-https-eof-for-eom.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-eof-for-eom.js) -- [parallel/test-https-foafssl.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-foafssl.js) -- [parallel/test-https-host-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-host-headers.js) -- [parallel/test-https-hwm.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-hwm.js) -- [parallel/test-https-insecure-parse-per-stream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-insecure-parse-per-stream.js) -- [parallel/test-https-keep-alive-drop-requests.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-keep-alive-drop-requests.js) -- [parallel/test-https-localaddress-bind-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-localaddress-bind-error.js) -- [parallel/test-https-localaddress.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-localaddress.js) -- [parallel/test-https-max-header-size-per-stream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-max-header-size-per-stream.js) -- [parallel/test-https-max-headers-count.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-max-headers-count.js) -- [parallel/test-https-options-boolean-check.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-options-boolean-check.js) -- [parallel/test-https-pfx.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-pfx.js) -- [parallel/test-https-request-arguments.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-request-arguments.js) -- [parallel/test-https-resume-after-renew.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-resume-after-renew.js) -- [parallel/test-https-selfsigned-no-keycertsign-no-crash.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-selfsigned-no-keycertsign-no-crash.js) -- [parallel/test-https-server-async-dispose.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-server-async-dispose.js) -- [parallel/test-https-server-close-all.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-server-close-all.js) -- [parallel/test-https-server-close-destroy-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-server-close-destroy-timeout.js) -- [parallel/test-https-server-close-idle.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-server-close-idle.js) -- [parallel/test-https-server-connections-checking-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-server-connections-checking-leak.js) -- [parallel/test-https-server-headers-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-server-headers-timeout.js) -- [parallel/test-https-server-options-incoming-message.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-server-options-incoming-message.js) -- [parallel/test-https-server-options-server-response.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-server-options-server-response.js) -- [parallel/test-https-server-request-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-server-request-timeout.js) -- [parallel/test-https-set-timeout-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-set-timeout-server.js) -- [parallel/test-https-simple.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-simple.js) -- [parallel/test-https-socket-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-socket-options.js) -- [parallel/test-https-strict.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-strict.js) -- [parallel/test-https-timeout-server-2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-timeout-server-2.js) -- [parallel/test-https-timeout-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-timeout-server.js) -- [parallel/test-https-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-timeout.js) -- [parallel/test-https-truncate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-truncate.js) -- [parallel/test-https-unix-socket-self-signed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-https-unix-socket-self-signed.js) -- [parallel/test-icu-data-dir.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-icu-data-dir.js) -- [parallel/test-icu-env.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-icu-env.js) -- [parallel/test-icu-minimum-version.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-icu-minimum-version.js) -- [parallel/test-icu-punycode.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-icu-punycode.js) -- [parallel/test-icu-stringwidth.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-icu-stringwidth.js) -- [parallel/test-inspect-address-in-use.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspect-address-in-use.js) -- [parallel/test-inspect-async-hook-setup-at-inspect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspect-async-hook-setup-at-inspect.js) -- [parallel/test-inspect-publish-uid.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspect-publish-uid.js) -- [parallel/test-inspect-support-for-node_options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspect-support-for-node_options.js) -- [parallel/test-inspector-already-activated-cli.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-already-activated-cli.js) -- [parallel/test-inspector-async-call-stack-abort.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-async-call-stack-abort.js) -- [parallel/test-inspector-async-call-stack.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-async-call-stack.js) -- [parallel/test-inspector-async-hook-after-done.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-async-hook-after-done.js) -- [parallel/test-inspector-async-hook-setup-at-inspect-brk.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-async-hook-setup-at-inspect-brk.js) -- [parallel/test-inspector-async-hook-setup-at-signal.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-async-hook-setup-at-signal.js) -- [parallel/test-inspector-async-stack-traces-promise-then.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-async-stack-traces-promise-then.js) -- [parallel/test-inspector-async-stack-traces-set-interval.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-async-stack-traces-set-interval.js) -- [parallel/test-inspector-bindings.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-bindings.js) -- [parallel/test-inspector-break-e.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-break-e.js) -- [parallel/test-inspector-break-when-eval.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-break-when-eval.js) -- [parallel/test-inspector-close-worker.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-close-worker.js) -- [parallel/test-inspector-connect-main-thread.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-connect-main-thread.js) -- [parallel/test-inspector-connect-to-main-thread.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-connect-to-main-thread.js) -- [parallel/test-inspector-console-top-frame.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-console-top-frame.js) -- [parallel/test-inspector-console.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-console.js) -- [parallel/test-inspector-contexts.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-contexts.js) -- [parallel/test-inspector-debug-brk-flag.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-debug-brk-flag.js) -- [parallel/test-inspector-debug-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-debug-end.js) -- [parallel/test-inspector-enabled.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-enabled.js) -- [parallel/test-inspector-esm.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-esm.js) -- [parallel/test-inspector-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-exception.js) -- [parallel/test-inspector-has-idle.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-has-idle.js) -- [parallel/test-inspector-has-inspector-false.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-has-inspector-false.js) -- [parallel/test-inspector-heap-allocation-tracker.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-heap-allocation-tracker.js) -- [parallel/test-inspector-heapdump.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-heapdump.js) -- [parallel/test-inspector-inspect-brk-node.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-inspect-brk-node.js) -- [parallel/test-inspector-invalid-args.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-invalid-args.js) -- [parallel/test-inspector-ip-detection.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-ip-detection.js) -- [parallel/test-inspector-module.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-module.js) -- [parallel/test-inspector-multisession-js.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-multisession-js.js) -- [parallel/test-inspector-multisession-ws.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-multisession-ws.js) -- [parallel/test-inspector-not-blocked-on-idle.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-not-blocked-on-idle.js) -- [parallel/test-inspector-open-coverage.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-open-coverage.js) -- [parallel/test-inspector-open-port-integer-overflow.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-open-port-integer-overflow.js) -- [parallel/test-inspector-open.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-open.js) -- [parallel/test-inspector-overwrite-config.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-overwrite-config.js) -- [parallel/test-inspector-port-zero-cluster.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-port-zero-cluster.js) -- [parallel/test-inspector-port-zero.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-port-zero.js) -- [parallel/test-inspector-promises.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-promises.js) -- [parallel/test-inspector-reported-host.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-reported-host.js) -- [parallel/test-inspector-resource-name-to-url.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-resource-name-to-url.js) -- [parallel/test-inspector-runtime-evaluate-with-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-runtime-evaluate-with-timeout.js) -- [parallel/test-inspector-scriptparsed-context.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-scriptparsed-context.js) -- [parallel/test-inspector-stop-profile-after-done.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-stop-profile-after-done.js) -- [parallel/test-inspector-stops-no-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-stops-no-file.js) -- [parallel/test-inspector-stress-http.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-stress-http.js) -- [parallel/test-inspector-tracing-domain.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-tracing-domain.js) -- [parallel/test-inspector-vm-global-accessors-getter-sideeffect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-vm-global-accessors-getter-sideeffect.js) -- [parallel/test-inspector-vm-global-accessors-sideeffects.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-vm-global-accessors-sideeffects.js) -- [parallel/test-inspector-wait-for-connection.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-wait-for-connection.js) -- [parallel/test-inspector-waiting-for-disconnect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-waiting-for-disconnect.js) -- [parallel/test-inspector-workers-flat-list.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector-workers-flat-list.js) -- [parallel/test-inspector.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-inspector.js) -- [parallel/test-instanceof.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-instanceof.js) -- [parallel/test-internal-assert.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-assert.js) -- [parallel/test-internal-error-original-names.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-error-original-names.js) -- [parallel/test-internal-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-errors.js) -- [parallel/test-internal-fs-syncwritestream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-fs-syncwritestream.js) -- [parallel/test-internal-fs.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-fs.js) -- [parallel/test-internal-iterable-weak-map.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-iterable-weak-map.js) -- [parallel/test-internal-module-require.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-module-require.js) -- [parallel/test-internal-module-wrap.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-module-wrap.js) -- [parallel/test-internal-modules.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-modules.js) -- [parallel/test-internal-process-binding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-process-binding.js) -- [parallel/test-internal-socket-list-receive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-socket-list-receive.js) -- [parallel/test-internal-socket-list-send.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-socket-list-send.js) -- [parallel/test-internal-util-assertCrypto.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-util-assertCrypto.js) -- [parallel/test-internal-util-classwrapper.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-util-classwrapper.js) -- [parallel/test-internal-util-decorate-error-stack.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-util-decorate-error-stack.js) -- [parallel/test-internal-util-helpers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-util-helpers.js) -- [parallel/test-internal-util-normalizeencoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-util-normalizeencoding.js) -- [parallel/test-internal-util-objects.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-util-objects.js) -- [parallel/test-internal-util-weakreference.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-util-weakreference.js) -- [parallel/test-internal-validators-validateoneof.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-validators-validateoneof.js) -- [parallel/test-internal-validators-validateport.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-validators-validateport.js) -- [parallel/test-internal-webidl-converttoint.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-internal-webidl-converttoint.js) -- [parallel/test-intl-v8BreakIterator.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-intl-v8BreakIterator.js) -- [parallel/test-intl.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-intl.js) -- [parallel/test-js-stream-call-properties.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-js-stream-call-properties.js) -- [parallel/test-kill-segfault-freebsd.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-kill-segfault-freebsd.js) -- [parallel/test-listen-fd-cluster.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-listen-fd-cluster.js) -- [parallel/test-listen-fd-detached-inherit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-listen-fd-detached-inherit.js) -- [parallel/test-listen-fd-detached.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-listen-fd-detached.js) -- [parallel/test-listen-fd-ebadf.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-listen-fd-ebadf.js) -- [parallel/test-listen-fd-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-listen-fd-server.js) -- [parallel/test-macos-app-sandbox.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-macos-app-sandbox.js) -- [parallel/test-math-random.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-math-random.js) -- [parallel/test-memory-usage-emfile.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-memory-usage-emfile.js) -- [parallel/test-memory-usage.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-memory-usage.js) -- [parallel/test-messagechannel.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-messagechannel.js) -- [parallel/test-messageevent-brandcheck.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-messageevent-brandcheck.js) -- [parallel/test-messageport-hasref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-messageport-hasref.js) -- [parallel/test-messaging-maketransferable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-messaging-maketransferable.js) -- [parallel/test-microtask-queue-integration.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-microtask-queue-integration.js) -- [parallel/test-microtask-queue-run-immediate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-microtask-queue-run-immediate.js) -- [parallel/test-microtask-queue-run.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-microtask-queue-run.js) -- [parallel/test-mime-api.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-mime-api.js) -- [parallel/test-mime-whatwg.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-mime-whatwg.js) -- [parallel/test-module-binding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-binding.js) -- [parallel/test-module-builtin.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-builtin.js) -- [parallel/test-module-cache.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-cache.js) -- [parallel/test-module-children.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-children.js) -- [parallel/test-module-circular-dependency-warning.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-circular-dependency-warning.js) -- [parallel/test-module-circular-symlinks.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-circular-symlinks.js) -- [parallel/test-module-create-require.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-create-require.js) -- [parallel/test-module-globalpaths-nodepath.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-globalpaths-nodepath.js) -- [parallel/test-module-isBuiltin.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-isBuiltin.js) -- [parallel/test-module-loading-deprecated.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-loading-deprecated.js) -- [parallel/test-module-loading-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-loading-error.js) -- [parallel/test-module-loading-globalpaths.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-loading-globalpaths.js) -- [parallel/test-module-main-extension-lookup.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-main-extension-lookup.js) -- [parallel/test-module-main-fail.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-main-fail.js) -- [parallel/test-module-main-preserve-symlinks-fail.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-main-preserve-symlinks-fail.js) -- [parallel/test-module-multi-extensions.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-multi-extensions.js) -- [parallel/test-module-nodemodulepaths.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-nodemodulepaths.js) -- [parallel/test-module-parent-deprecation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-parent-deprecation.js) -- [parallel/test-module-parent-setter-deprecation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-parent-setter-deprecation.js) -- [parallel/test-module-prototype-mutation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-prototype-mutation.js) -- [parallel/test-module-readonly.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-readonly.js) -- [parallel/test-module-relative-lookup.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-relative-lookup.js) -- [parallel/test-module-run-main-monkey-patch.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-run-main-monkey-patch.js) -- [parallel/test-module-stat.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-stat.js) -- [parallel/test-module-symlinked-peer-modules.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-symlinked-peer-modules.js) -- [parallel/test-module-version.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-version.js) -- [parallel/test-module-wrap.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-wrap.js) -- [parallel/test-module-wrapper.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-module-wrapper.js) -- [parallel/test-net-after-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-after-close.js) -- [parallel/test-net-allow-half-open.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-allow-half-open.js) -- [parallel/test-net-autoselectfamily-commandline-option.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-autoselectfamily-commandline-option.js) -- [parallel/test-net-autoselectfamily-default.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-autoselectfamily-default.js) -- [parallel/test-net-autoselectfamily-ipv4first.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-autoselectfamily-ipv4first.js) -- [parallel/test-net-better-error-messages-listen.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-better-error-messages-listen.js) -- [parallel/test-net-binary.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-binary.js) -- [parallel/test-net-bind-twice.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-bind-twice.js) -- [parallel/test-net-buffersize.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-buffersize.js) -- [parallel/test-net-bytes-read.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-bytes-read.js) -- [parallel/test-net-bytes-stats.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-bytes-stats.js) -- [parallel/test-net-bytes-written-large.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-bytes-written-large.js) -- [parallel/test-net-can-reset-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-can-reset-timeout.js) -- [parallel/test-net-child-process-connect-reset.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-child-process-connect-reset.js) -- [parallel/test-net-client-bind-twice.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-client-bind-twice.js) -- [parallel/test-net-connect-abort-controller.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-abort-controller.js) -- [parallel/test-net-connect-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-buffer.js) -- [parallel/test-net-connect-buffer2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-buffer2.js) -- [parallel/test-net-connect-call-socket-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-call-socket-connect.js) -- [parallel/test-net-connect-keepalive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-keepalive.js) -- [parallel/test-net-connect-memleak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-memleak.js) -- [parallel/test-net-connect-nodelay.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-nodelay.js) -- [parallel/test-net-connect-options-allowhalfopen.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-options-allowhalfopen.js) -- [parallel/test-net-connect-options-fd.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-options-fd.js) -- [parallel/test-net-connect-options-invalid.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-options-invalid.js) -- [parallel/test-net-connect-options-ipv6.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-options-ipv6.js) -- [parallel/test-net-connect-options-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-options-path.js) -- [parallel/test-net-connect-options-port.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-options-port.js) -- [parallel/test-net-connect-paused-connection.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-paused-connection.js) -- [parallel/test-net-connect-reset-after-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-reset-after-destroy.js) -- [parallel/test-net-connect-reset-before-connected.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-reset-before-connected.js) -- [parallel/test-net-connect-reset-until-connected.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-reset-until-connected.js) -- [parallel/test-net-connect-reset.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-connect-reset.js) -- [parallel/test-net-deprecated-setsimultaneousaccepts.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-deprecated-setsimultaneousaccepts.js) -- [parallel/test-net-dns-custom-lookup.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-dns-custom-lookup.js) -- [parallel/test-net-dns-lookup-skip.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-dns-lookup-skip.js) -- [parallel/test-net-dns-lookup.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-dns-lookup.js) -- [parallel/test-net-eaddrinuse.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-eaddrinuse.js) -- [parallel/test-net-end-destroyed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-end-destroyed.js) -- [parallel/test-net-error-twice.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-error-twice.js) -- [parallel/test-net-keepalive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-keepalive.js) -- [parallel/test-net-large-string.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-large-string.js) -- [parallel/test-net-listen-after-destroying-stdin.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-listen-after-destroying-stdin.js) -- [parallel/test-net-listen-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-listen-error.js) -- [parallel/test-net-listen-exclusive-random-ports.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-listen-exclusive-random-ports.js) -- [parallel/test-net-listen-fd0.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-listen-fd0.js) -- [parallel/test-net-listen-ipv6only.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-listen-ipv6only.js) -- [parallel/test-net-local-address-port.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-local-address-port.js) -- [parallel/test-net-normalize-args.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-normalize-args.js) -- [parallel/test-net-onread-static-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-onread-static-buffer.js) -- [parallel/test-net-pause-resume-connecting.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-pause-resume-connecting.js) -- [parallel/test-net-perf_hooks.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-perf_hooks.js) -- [parallel/test-net-persistent-keepalive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-persistent-keepalive.js) -- [parallel/test-net-persistent-nodelay.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-persistent-nodelay.js) -- [parallel/test-net-persistent-ref-unref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-persistent-ref-unref.js) -- [parallel/test-net-pingpong.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-pingpong.js) -- [parallel/test-net-reconnect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-reconnect.js) -- [parallel/test-net-remote-address-port.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-remote-address-port.js) -- [parallel/test-net-remote-address.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-remote-address.js) -- [parallel/test-net-server-call-listen-multiple-times.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-server-call-listen-multiple-times.js) -- [parallel/test-net-server-capture-rejection.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-server-capture-rejection.js) -- [parallel/test-net-server-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-server-close.js) -- [parallel/test-net-server-drop-connections.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-server-drop-connections.js) -- [parallel/test-net-server-keepalive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-server-keepalive.js) -- [parallel/test-net-server-listen-handle.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-server-listen-handle.js) -- [parallel/test-net-server-max-connections-close-makes-more-available.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-server-max-connections-close-makes-more-available.js) -- [parallel/test-net-server-max-connections.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-server-max-connections.js) -- [parallel/test-net-server-nodelay.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-server-nodelay.js) -- [parallel/test-net-server-pause-on-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-server-pause-on-connect.js) -- [parallel/test-net-server-reset.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-server-reset.js) -- [parallel/test-net-server-simultaneous-accepts-produce-warning-once.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-server-simultaneous-accepts-produce-warning-once.js) -- [parallel/test-net-server-try-ports.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-server-try-ports.js) -- [parallel/test-net-settimeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-settimeout.js) -- [parallel/test-net-socket-byteswritten.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-byteswritten.js) -- [parallel/test-net-socket-close-after-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-close-after-end.js) -- [parallel/test-net-socket-connect-invalid-autoselectfamily.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-connect-invalid-autoselectfamily.js) -- [parallel/test-net-socket-connect-invalid-autoselectfamilyattempttimeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-connect-invalid-autoselectfamilyattempttimeout.js) -- [parallel/test-net-socket-connect-without-cb.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-connect-without-cb.js) -- [parallel/test-net-socket-connecting.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-connecting.js) -- [parallel/test-net-socket-constructor.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-constructor.js) -- [parallel/test-net-socket-destroy-send.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-destroy-send.js) -- [parallel/test-net-socket-end-before-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-end-before-connect.js) -- [parallel/test-net-socket-end-callback.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-end-callback.js) -- [parallel/test-net-socket-local-address.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-local-address.js) -- [parallel/test-net-socket-ready-without-cb.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-ready-without-cb.js) -- [parallel/test-net-socket-reset-send.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-reset-send.js) -- [parallel/test-net-socket-reset-twice.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-reset-twice.js) -- [parallel/test-net-socket-timeout-unref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-timeout-unref.js) -- [parallel/test-net-socket-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-timeout.js) -- [parallel/test-net-socket-write-after-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-write-after-close.js) -- [parallel/test-net-socket-write-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-write-error.js) -- [parallel/test-net-stream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-stream.js) -- [parallel/test-net-sync-cork.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-sync-cork.js) -- [parallel/test-net-throttle.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-throttle.js) -- [parallel/test-net-writable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-writable.js) -- [parallel/test-net-write-after-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-write-after-close.js) -- [parallel/test-net-write-after-end-nt.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-write-after-end-nt.js) -- [parallel/test-net-write-cb-on-destroy-before-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-write-cb-on-destroy-before-connect.js) -- [parallel/test-net-write-connect-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-write-connect-write.js) -- [parallel/test-net-write-fully-async-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-write-fully-async-buffer.js) -- [parallel/test-net-write-fully-async-hex-string.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-write-fully-async-hex-string.js) -- [parallel/test-net-write-slow.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-write-slow.js) -- [parallel/test-next-tick-domain.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-next-tick-domain.js) -- [parallel/test-next-tick-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-next-tick-errors.js) -- [parallel/test-no-addons-resolution-condition.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-no-addons-resolution-condition.js) -- [parallel/test-no-node-snapshot.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-no-node-snapshot.js) -- [parallel/test-npm-install.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-npm-install.js) -- [parallel/test-npm-version.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-npm-version.js) -- [parallel/test-openssl-ca-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-openssl-ca-options.js) -- [parallel/test-options-binding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-options-binding.js) -- [parallel/test-os-checked-function.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-os-checked-function.js) -- [parallel/test-os-eol.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-os-eol.js) -- [parallel/test-os-homedir-no-envvar.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-os-homedir-no-envvar.js) -- [parallel/test-os-process-priority.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-os-process-priority.js) -- [parallel/test-os-userinfo-handles-getter-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-os-userinfo-handles-getter-errors.js) -- [parallel/test-path-posix-relative-on-windows.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-path-posix-relative-on-windows.js) -- [parallel/test-pending-deprecation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-pending-deprecation.js) -- [parallel/test-perf-gc-crash.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-perf-gc-crash.js) -- [parallel/test-perf-hooks-histogram.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-perf-hooks-histogram.js) -- [parallel/test-perf-hooks-resourcetiming.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-perf-hooks-resourcetiming.js) -- [parallel/test-perf-hooks-usertiming.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-perf-hooks-usertiming.js) -- [parallel/test-perf-hooks-worker-timeorigin.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-perf-hooks-worker-timeorigin.js) -- [parallel/test-performance-eventlooputil.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-performance-eventlooputil.js) -- [parallel/test-performance-function-async.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-performance-function-async.js) -- [parallel/test-performance-function.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-performance-function.js) -- [parallel/test-performance-gc.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-performance-gc.js) -- [parallel/test-performance-global.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-performance-global.js) -- [parallel/test-performance-measure.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-performance-measure.js) -- [parallel/test-performance-nodetiming.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-performance-nodetiming.js) -- [parallel/test-performance-resourcetimingbufferfull.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-performance-resourcetimingbufferfull.js) -- [parallel/test-performance-resourcetimingbuffersize.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-performance-resourcetimingbuffersize.js) -- [parallel/test-performanceobserver-gc.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-performanceobserver-gc.js) -- [parallel/test-performanceobserver.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-performanceobserver.js) -- [parallel/test-permission-allow-child-process-cli.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-allow-child-process-cli.js) -- [parallel/test-permission-allow-worker-cli.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-allow-worker-cli.js) -- [parallel/test-permission-child-process-cli.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-child-process-cli.js) -- [parallel/test-permission-experimental.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-experimental.js) -- [parallel/test-permission-fs-read.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-fs-read.js) -- [parallel/test-permission-fs-relative-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-fs-relative-path.js) -- [parallel/test-permission-fs-supported.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-fs-supported.js) -- [parallel/test-permission-fs-symlink-relative.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-fs-symlink-relative.js) -- [parallel/test-permission-fs-symlink-target-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-fs-symlink-target-write.js) -- [parallel/test-permission-fs-symlink.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-fs-symlink.js) -- [parallel/test-permission-fs-traversal-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-fs-traversal-path.js) -- [parallel/test-permission-fs-wildcard.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-fs-wildcard.js) -- [parallel/test-permission-fs-windows-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-fs-windows-path.js) -- [parallel/test-permission-fs-write-report.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-fs-write-report.js) -- [parallel/test-permission-fs-write-v8.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-fs-write-v8.js) -- [parallel/test-permission-fs-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-fs-write.js) -- [parallel/test-permission-has.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-has.js) -- [parallel/test-permission-inspector.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-inspector.js) -- [parallel/test-permission-processbinding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-processbinding.js) -- [parallel/test-permission-warning-flags.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-warning-flags.js) -- [parallel/test-permission-worker-threads-cli.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-permission-worker-threads-cli.js) -- [parallel/test-pipe-abstract-socket-http.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-pipe-abstract-socket-http.js) -- [parallel/test-pipe-abstract-socket.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-pipe-abstract-socket.js) -- [parallel/test-pipe-address.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-pipe-address.js) -- [parallel/test-pipe-file-to-http.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-pipe-file-to-http.js) -- [parallel/test-pipe-head.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-pipe-head.js) -- [parallel/test-pipe-outgoing-message-data-emitted-after-ended.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-pipe-outgoing-message-data-emitted-after-ended.js) -- [parallel/test-pipe-return-val.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-pipe-return-val.js) -- [parallel/test-pipe-stream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-pipe-stream.js) -- [parallel/test-pipe-unref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-pipe-unref.js) -- [parallel/test-pipe-writev.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-pipe-writev.js) -- [parallel/test-policy-crypto-default-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-policy-crypto-default-encoding.js) -- [parallel/test-policy-crypto-hash-tampering.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-policy-crypto-hash-tampering.js) -- [parallel/test-policy-dependencies.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-policy-dependencies.js) -- [parallel/test-policy-dependency-conditions.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-policy-dependency-conditions.js) -- [parallel/test-policy-integrity-flag.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-policy-integrity-flag.js) -- [parallel/test-policy-manifest.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-policy-manifest.js) -- [parallel/test-policy-parse-integrity.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-policy-parse-integrity.js) -- [parallel/test-policy-process-binding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-policy-process-binding.js) -- [parallel/test-policy-scopes-dependencies.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-policy-scopes-dependencies.js) -- [parallel/test-policy-scopes-integrity.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-policy-scopes-integrity.js) -- [parallel/test-policy-scopes.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-policy-scopes.js) -- [parallel/test-preload-print-process-argv.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-preload-print-process-argv.js) -- [parallel/test-preload-self-referential.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-preload-self-referential.js) -- [parallel/test-preload-worker.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-preload-worker.js) -- [parallel/test-preload.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-preload.js) -- [parallel/test-primordials-apply.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-primordials-apply.js) -- [parallel/test-primordials-promise.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-primordials-promise.js) -- [parallel/test-primordials-regexp.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-primordials-regexp.js) -- [parallel/test-priority-queue.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-priority-queue.js) -- [parallel/test-process-abort.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-abort.js) -- [parallel/test-process-argv-0.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-argv-0.js) -- [parallel/test-process-assert.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-assert.js) -- [parallel/test-process-beforeexit-throw-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-beforeexit-throw-exit.js) -- [parallel/test-process-binding-util.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-binding-util.js) -- [parallel/test-process-binding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-binding.js) -- [parallel/test-process-chdir-errormessage.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-chdir-errormessage.js) -- [parallel/test-process-chdir.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-chdir.js) -- [parallel/test-process-config.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-config.js) -- [parallel/test-process-constants-noatime.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-constants-noatime.js) -- [parallel/test-process-constrained-memory.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-constrained-memory.js) -- [parallel/test-process-cpuUsage.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-cpuUsage.js) -- [parallel/test-process-dlopen-error-message-crash.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-dlopen-error-message-crash.js) -- [parallel/test-process-dlopen-undefined-exports.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-dlopen-undefined-exports.js) -- [parallel/test-process-domain-segfault.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-domain-segfault.js) -- [parallel/test-process-emit-warning-from-native.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-emit-warning-from-native.js) -- [parallel/test-process-emit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-emit.js) -- [parallel/test-process-emitwarning.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-emitwarning.js) -- [parallel/test-process-env-allowed-flags-are-documented.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-env-allowed-flags-are-documented.js) -- [parallel/test-process-env-delete.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-env-delete.js) -- [parallel/test-process-env-deprecation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-env-deprecation.js) -- [parallel/test-process-env-ignore-getter-setter.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-env-ignore-getter-setter.js) -- [parallel/test-process-env-sideeffects.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-env-sideeffects.js) -- [parallel/test-process-env-symbols.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-env-symbols.js) -- [parallel/test-process-env-tz.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-env-tz.js) -- [parallel/test-process-env-windows-error-reset.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-env-windows-error-reset.js) -- [parallel/test-process-env.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-env.js) -- [parallel/test-process-euid-egid.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-euid-egid.js) -- [parallel/test-process-exception-capture-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-exception-capture-errors.js) -- [parallel/test-process-exception-capture-should-abort-on-uncaught-setflagsfromstring.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-exception-capture-should-abort-on-uncaught-setflagsfromstring.js) -- [parallel/test-process-exception-capture-should-abort-on-uncaught.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-exception-capture-should-abort-on-uncaught.js) -- [parallel/test-process-exception-capture.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-exception-capture.js) -- [parallel/test-process-exec-argv.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-exec-argv.js) -- [parallel/test-process-execpath.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-execpath.js) -- [parallel/test-process-exit-code-validation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-exit-code-validation.js) -- [parallel/test-process-exit-code.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-exit-code.js) -- [parallel/test-process-external-stdio-close-spawn.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-external-stdio-close-spawn.js) -- [parallel/test-process-external-stdio-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-external-stdio-close.js) -- [parallel/test-process-features.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-features.js) -- [parallel/test-process-getactivehandles.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-getactivehandles.js) -- [parallel/test-process-getactiverequests.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-getactiverequests.js) -- [parallel/test-process-getactiveresources-track-active-handles.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-getactiveresources-track-active-handles.js) -- [parallel/test-process-getactiveresources-track-active-requests.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-getactiveresources-track-active-requests.js) -- [parallel/test-process-getactiveresources-track-interval-lifetime.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-getactiveresources-track-interval-lifetime.js) -- [parallel/test-process-getactiveresources-track-multiple-timers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-getactiveresources-track-multiple-timers.js) -- [parallel/test-process-getactiveresources-track-timer-lifetime.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-getactiveresources-track-timer-lifetime.js) -- [parallel/test-process-getactiveresources.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-getactiveresources.js) -- [parallel/test-process-getgroups.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-getgroups.js) -- [parallel/test-process-hrtime-bigint.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-hrtime-bigint.js) -- [parallel/test-process-hrtime.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-hrtime.js) -- [parallel/test-process-initgroups.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-initgroups.js) -- [parallel/test-process-kill-null.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-kill-null.js) -- [parallel/test-process-next-tick.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-next-tick.js) -- [parallel/test-process-no-deprecation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-no-deprecation.js) -- [parallel/test-process-ppid.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-ppid.js) -- [parallel/test-process-prototype.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-prototype.js) -- [parallel/test-process-raw-debug.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-raw-debug.js) -- [parallel/test-process-really-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-really-exit.js) -- [parallel/test-process-redirect-warnings-env.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-redirect-warnings-env.js) -- [parallel/test-process-redirect-warnings.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-redirect-warnings.js) -- [parallel/test-process-release.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-release.js) -- [parallel/test-process-remove-all-signal-listeners.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-remove-all-signal-listeners.js) -- [parallel/test-process-setgroups.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-setgroups.js) -- [parallel/test-process-setsourcemapsenabled.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-setsourcemapsenabled.js) -- [parallel/test-process-setuid-io-uring.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-setuid-io-uring.js) -- [parallel/test-process-title-cli.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-title-cli.js) -- [parallel/test-process-uid-gid.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-uid-gid.js) -- [parallel/test-process-umask-mask.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-umask-mask.js) -- [parallel/test-process-umask.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-umask.js) -- [parallel/test-process-uncaught-exception-monitor.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-uncaught-exception-monitor.js) -- [parallel/test-process-versions.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-versions.js) -- [parallel/test-process-warning.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-process-warning.js) -- [parallel/test-promise-handled-rejection-no-warning.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promise-handled-rejection-no-warning.js) -- [parallel/test-promise-hook-create-hook.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promise-hook-create-hook.js) -- [parallel/test-promise-hook-exceptions.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promise-hook-exceptions.js) -- [parallel/test-promise-hook-on-after.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promise-hook-on-after.js) -- [parallel/test-promise-hook-on-before.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promise-hook-on-before.js) -- [parallel/test-promise-hook-on-init.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promise-hook-on-init.js) -- [parallel/test-promise-hook-on-resolve.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promise-hook-on-resolve.js) -- [parallel/test-promise-reject-callback-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promise-reject-callback-exception.js) -- [parallel/test-promise-swallowed-event.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promise-swallowed-event.js) -- [parallel/test-promise-unhandled-default.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promise-unhandled-default.js) -- [parallel/test-promise-unhandled-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promise-unhandled-error.js) -- [parallel/test-promise-unhandled-flag.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promise-unhandled-flag.js) -- [parallel/test-promise-unhandled-silent-no-hook.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promise-unhandled-silent-no-hook.js) -- [parallel/test-promise-unhandled-throw.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promise-unhandled-throw.js) -- [parallel/test-promise-unhandled-warn-no-hook.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promise-unhandled-warn-no-hook.js) -- [parallel/test-promise-unhandled-warn.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promise-unhandled-warn.js) -- [parallel/test-promises-unhandled-proxy-rejections.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promises-unhandled-proxy-rejections.js) -- [parallel/test-promises-unhandled-rejections.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promises-unhandled-rejections.js) -- [parallel/test-promises-unhandled-symbol-rejections.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promises-unhandled-symbol-rejections.js) -- [parallel/test-promises-warning-on-unhandled-rejection.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-promises-warning-on-unhandled-rejection.js) -- [parallel/test-queue-microtask-uncaught-asynchooks.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-queue-microtask-uncaught-asynchooks.js) -- [parallel/test-queue-microtask.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-queue-microtask.js) -- [parallel/test-readable-from-iterator-closing.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readable-from-iterator-closing.js) -- [parallel/test-readable-from-web-enqueue-then-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readable-from-web-enqueue-then-close.js) -- [parallel/test-readable-from.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readable-from.js) -- [parallel/test-readable-large-hwm.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readable-large-hwm.js) -- [parallel/test-readable-single-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readable-single-end.js) -- [parallel/test-readline-async-iterators-backpressure.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readline-async-iterators-backpressure.js) -- [parallel/test-readline-async-iterators-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readline-async-iterators-destroy.js) -- [parallel/test-readline-async-iterators.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readline-async-iterators.js) -- [parallel/test-readline-carriage-return-between-chunks.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readline-carriage-return-between-chunks.js) -- [parallel/test-readline-csi.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readline-csi.js) -- [parallel/test-readline-input-onerror.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readline-input-onerror.js) -- [parallel/test-readline-interface-no-trailing-newline.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readline-interface-no-trailing-newline.js) -- [parallel/test-readline-interface-recursive-writes.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readline-interface-recursive-writes.js) -- [parallel/test-readline-interface.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readline-interface.js) -- [parallel/test-readline-promises-interface.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readline-promises-interface.js) -- [parallel/test-readline-promises-tab-complete.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readline-promises-tab-complete.js) -- [parallel/test-readline-tab-complete.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-readline-tab-complete.js) -- [parallel/test-ref-unref-return.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-ref-unref-return.js) -- [parallel/test-regression-object-prototype.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-regression-object-prototype.js) -- [parallel/test-release-changelog.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-release-changelog.js) -- [parallel/test-release-npm.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-release-npm.js) -- [parallel/test-repl-array-prototype-tempering.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-array-prototype-tempering.js) -- [parallel/test-repl-autocomplete.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-autocomplete.js) -- [parallel/test-repl-autolibs.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-autolibs.js) -- [parallel/test-repl-clear-immediate-crash.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-clear-immediate-crash.js) -- [parallel/test-repl-cli-eval.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-cli-eval.js) -- [parallel/test-repl-colors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-colors.js) -- [parallel/test-repl-context.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-context.js) -- [parallel/test-repl-definecommand.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-definecommand.js) -- [parallel/test-repl-domain.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-domain.js) -- [parallel/test-repl-dynamic-import.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-dynamic-import.js) -- [parallel/test-repl-editor.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-editor.js) -- [parallel/test-repl-empty.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-empty.js) -- [parallel/test-repl-end-emits-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-end-emits-exit.js) -- [parallel/test-repl-envvars.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-envvars.js) -- [parallel/test-repl-eval.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-eval.js) -- [parallel/test-repl-function-definition-edge-case.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-function-definition-edge-case.js) -- [parallel/test-repl-harmony.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-harmony.js) -- [parallel/test-repl-history-navigation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-history-navigation.js) -- [parallel/test-repl-history-perm.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-history-perm.js) -- [parallel/test-repl-import-referrer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-import-referrer.js) -- [parallel/test-repl-inspect-defaults.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-inspect-defaults.js) -- [parallel/test-repl-inspector.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-inspector.js) -- [parallel/test-repl-let-process.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-let-process.js) -- [parallel/test-repl-load-multiline-no-trailing-newline.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-load-multiline-no-trailing-newline.js) -- [parallel/test-repl-load-multiline.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-load-multiline.js) -- [parallel/test-repl-mode.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-mode.js) -- [parallel/test-repl-multiline.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-multiline.js) -- [parallel/test-repl-no-terminal.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-no-terminal.js) -- [parallel/test-repl-null-thrown.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-null-thrown.js) -- [parallel/test-repl-null.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-null.js) -- [parallel/test-repl-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-options.js) -- [parallel/test-repl-permission-model.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-permission-model.js) -- [parallel/test-repl-persistent-history.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-persistent-history.js) -- [parallel/test-repl-preprocess-top-level-await.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-preprocess-top-level-await.js) -- [parallel/test-repl-pretty-custom-stack.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-pretty-custom-stack.js) -- [parallel/test-repl-pretty-stack-custom-writer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-pretty-stack-custom-writer.js) -- [parallel/test-repl-pretty-stack.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-pretty-stack.js) -- [parallel/test-repl-preview.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-preview.js) -- [parallel/test-repl-programmatic-history.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-programmatic-history.js) -- [parallel/test-repl-recoverable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-recoverable.js) -- [parallel/test-repl-require-after-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-require-after-write.js) -- [parallel/test-repl-require-cache.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-require-cache.js) -- [parallel/test-repl-require-context.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-require-context.js) -- [parallel/test-repl-require-self-referential.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-require-self-referential.js) -- [parallel/test-repl-require.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-require.js) -- [parallel/test-repl-reset-event.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-reset-event.js) -- [parallel/test-repl-reverse-search.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-reverse-search.js) -- [parallel/test-repl-save-load.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-save-load.js) -- [parallel/test-repl-setprompt.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-setprompt.js) -- [parallel/test-repl-sigint-nested-eval.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-sigint-nested-eval.js) -- [parallel/test-repl-sigint.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-sigint.js) -- [parallel/test-repl-stdin-push-null.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-stdin-push-null.js) -- [parallel/test-repl-strict-mode-previews.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-strict-mode-previews.js) -- [parallel/test-repl-syntax-error-handling.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-syntax-error-handling.js) -- [parallel/test-repl-syntax-error-stack.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-syntax-error-stack.js) -- [parallel/test-repl-tab-complete-crash.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-tab-complete-crash.js) -- [parallel/test-repl-tab-complete-import.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-tab-complete-import.js) -- [parallel/test-repl-tab-complete-nested-repls.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-tab-complete-nested-repls.js) -- [parallel/test-repl-tab-complete-no-warn.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-tab-complete-no-warn.js) -- [parallel/test-repl-tab-complete-on-editor-mode.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-tab-complete-on-editor-mode.js) -- [parallel/test-repl-tab-complete.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-tab-complete.js) -- [parallel/test-repl-tab.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-tab.js) -- [parallel/test-repl-throw-null-or-undefined.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-throw-null-or-undefined.js) -- [parallel/test-repl-top-level-await.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-top-level-await.js) -- [parallel/test-repl-uncaught-exception-async.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-uncaught-exception-async.js) -- [parallel/test-repl-uncaught-exception-evalcallback.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-uncaught-exception-evalcallback.js) -- [parallel/test-repl-uncaught-exception-standalone.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-uncaught-exception-standalone.js) -- [parallel/test-repl-uncaught-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-uncaught-exception.js) -- [parallel/test-repl-underscore.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-underscore.js) -- [parallel/test-repl-unexpected-token-recoverable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-unexpected-token-recoverable.js) -- [parallel/test-repl-unsafe-array-iteration.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-unsafe-array-iteration.js) -- [parallel/test-repl-unsupported-option.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-unsupported-option.js) -- [parallel/test-repl-use-global.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl-use-global.js) -- [parallel/test-repl.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-repl.js) -- [parallel/test-require-cache.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-cache.js) -- [parallel/test-require-delete-array-iterator.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-delete-array-iterator.js) -- [parallel/test-require-dot.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-dot.js) -- [parallel/test-require-empty-main.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-empty-main.js) -- [parallel/test-require-enoent-dir.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-enoent-dir.js) -- [parallel/test-require-exceptions.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-exceptions.js) -- [parallel/test-require-extension-over-directory.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-extension-over-directory.js) -- [parallel/test-require-extensions-main.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-extensions-main.js) -- [parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js) -- [parallel/test-require-extensions-same-filename-as-dir.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-extensions-same-filename-as-dir.js) -- [parallel/test-require-invalid-main-no-exports.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-invalid-main-no-exports.js) -- [parallel/test-require-invalid-package.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-invalid-package.js) -- [parallel/test-require-json.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-json.js) -- [parallel/test-require-long-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-long-path.js) -- [parallel/test-require-mjs.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-mjs.js) -- [parallel/test-require-node-prefix.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-node-prefix.js) -- [parallel/test-require-nul.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-nul.js) -- [parallel/test-require-process.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-process.js) -- [parallel/test-require-resolve.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-resolve.js) -- [parallel/test-require-symlink.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-symlink.js) -- [parallel/test-require-unicode.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-require-unicode.js) -- [parallel/test-resource-usage.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-resource-usage.js) -- [parallel/test-runner-cli-concurrency.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-cli-concurrency.js) -- [parallel/test-runner-cli-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-cli-timeout.js) -- [parallel/test-runner-cli.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-cli.js) -- [parallel/test-runner-concurrency.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-concurrency.js) -- [parallel/test-runner-coverage.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-coverage.js) -- [parallel/test-runner-exit-code.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-exit-code.js) -- [parallel/test-runner-extraneous-async-activity.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-extraneous-async-activity.js) -- [parallel/test-runner-filetest-location.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-filetest-location.js) -- [parallel/test-runner-import-no-scheme.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-import-no-scheme.js) -- [parallel/test-runner-misc.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-misc.js) -- [parallel/test-runner-mock-timers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-mock-timers.js) -- [parallel/test-runner-mocking.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-mocking.js) -- [parallel/test-runner-option-validation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-option-validation.js) -- [parallel/test-runner-reporters.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-reporters.js) -- [parallel/test-runner-root-after-with-refed-handles.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-root-after-with-refed-handles.js) -- [parallel/test-runner-string-to-regexp.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-string-to-regexp.js) -- [parallel/test-runner-test-filter.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-test-filter.js) -- [parallel/test-runner-typechecking.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-runner-typechecking.js) -- [parallel/test-safe-get-env.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-safe-get-env.js) -- [parallel/test-security-revert-unknown.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-security-revert-unknown.js) -- [parallel/test-set-http-max-http-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-set-http-max-http-headers.js) -- [parallel/test-set-incoming-message-header.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-set-incoming-message-header.js) -- [parallel/test-set-process-debug-port.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-set-process-debug-port.js) -- [parallel/test-setproctitle.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-setproctitle.js) -- [parallel/test-shadow-realm-allowed-builtin-modules.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-shadow-realm-allowed-builtin-modules.js) -- [parallel/test-shadow-realm-custom-loaders.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-shadow-realm-custom-loaders.js) -- [parallel/test-shadow-realm-gc-module.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-shadow-realm-gc-module.js) -- [parallel/test-shadow-realm-gc.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-shadow-realm-gc.js) -- [parallel/test-shadow-realm-globals.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-shadow-realm-globals.js) -- [parallel/test-shadow-realm-import-value-resolve.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-shadow-realm-import-value-resolve.js) -- [parallel/test-shadow-realm-module.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-shadow-realm-module.js) -- [parallel/test-shadow-realm-preload-module.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-shadow-realm-preload-module.js) -- [parallel/test-shadow-realm-prepare-stack-trace.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-shadow-realm-prepare-stack-trace.js) -- [parallel/test-shadow-realm.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-shadow-realm.js) -- [parallel/test-sigint-infinite-loop.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-sigint-infinite-loop.js) -- [parallel/test-signal-args.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-signal-args.js) -- [parallel/test-signal-handler-remove-on-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-signal-handler-remove-on-exit.js) -- [parallel/test-signal-handler.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-signal-handler.js) -- [parallel/test-signal-safety.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-signal-safety.js) -- [parallel/test-signal-unregister.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-signal-unregister.js) -- [parallel/test-single-executable-blob-config-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-single-executable-blob-config-errors.js) -- [parallel/test-single-executable-blob-config.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-single-executable-blob-config.js) -- [parallel/test-snapshot-api.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-api.js) -- [parallel/test-snapshot-argv1.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-argv1.js) -- [parallel/test-snapshot-basic.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-basic.js) -- [parallel/test-snapshot-cjs-main.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-cjs-main.js) -- [parallel/test-snapshot-console.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-console.js) -- [parallel/test-snapshot-cwd.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-cwd.js) -- [parallel/test-snapshot-dns-lookup-localhost-promise.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-dns-lookup-localhost-promise.js) -- [parallel/test-snapshot-dns-lookup-localhost.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-dns-lookup-localhost.js) -- [parallel/test-snapshot-dns-resolve-localhost-promise.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-dns-resolve-localhost-promise.js) -- [parallel/test-snapshot-dns-resolve-localhost.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-dns-resolve-localhost.js) -- [parallel/test-snapshot-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-error.js) -- [parallel/test-snapshot-eval.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-eval.js) -- [parallel/test-snapshot-gzip.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-gzip.js) -- [parallel/test-snapshot-incompatible.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-incompatible.js) -- [parallel/test-snapshot-namespaced-builtin.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-namespaced-builtin.js) -- [parallel/test-snapshot-net.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-net.js) -- [parallel/test-snapshot-typescript.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-typescript.js) -- [parallel/test-snapshot-umd.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-umd.js) -- [parallel/test-snapshot-warning.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-warning.js) -- [parallel/test-snapshot-weak-reference.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-weak-reference.js) -- [parallel/test-snapshot-worker.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-snapshot-worker.js) -- [parallel/test-socket-address.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-socket-address.js) -- [parallel/test-socket-options-invalid.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-socket-options-invalid.js) -- [parallel/test-socket-write-after-fin-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-socket-write-after-fin-error.js) -- [parallel/test-socket-write-after-fin.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-socket-write-after-fin.js) -- [parallel/test-socket-writes-before-passed-to-tls-socket.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-socket-writes-before-passed-to-tls-socket.js) -- [parallel/test-socketaddress.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-socketaddress.js) -- [parallel/test-source-map-api.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-source-map-api.js) -- [parallel/test-source-map-enable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-source-map-enable.js) -- [parallel/test-spawn-cmd-named-pipe.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-spawn-cmd-named-pipe.js) -- [parallel/test-stack-size-limit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stack-size-limit.js) -- [parallel/test-startup-empty-regexp-statics.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-startup-empty-regexp-statics.js) -- [parallel/test-startup-large-pages.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-startup-large-pages.js) -- [parallel/test-stdin-child-proc.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdin-child-proc.js) -- [parallel/test-stdin-from-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdin-from-file.js) -- [parallel/test-stdin-hang.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdin-hang.js) -- [parallel/test-stdin-pause-resume-sync.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdin-pause-resume-sync.js) -- [parallel/test-stdin-pause-resume.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdin-pause-resume.js) -- [parallel/test-stdin-pipe-large.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdin-pipe-large.js) -- [parallel/test-stdin-pipe-resume.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdin-pipe-resume.js) -- [parallel/test-stdin-resume-pause.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdin-resume-pause.js) -- [parallel/test-stdin-script-child-option.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdin-script-child-option.js) -- [parallel/test-stdin-script-child.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdin-script-child.js) -- [parallel/test-stdio-closed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdio-closed.js) -- [parallel/test-stdio-pipe-access.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdio-pipe-access.js) -- [parallel/test-stdio-pipe-redirect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdio-pipe-redirect.js) -- [parallel/test-stdio-pipe-stderr.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdio-pipe-stderr.js) -- [parallel/test-stdio-undestroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdio-undestroy.js) -- [parallel/test-stdout-cannot-be-closed-child-process-pipe.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdout-cannot-be-closed-child-process-pipe.js) -- [parallel/test-stdout-close-catch.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdout-close-catch.js) -- [parallel/test-stdout-close-unref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdout-close-unref.js) -- [parallel/test-stdout-pipeline-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdout-pipeline-destroy.js) -- [parallel/test-stdout-stderr-reading.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdout-stderr-reading.js) -- [parallel/test-stdout-stderr-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdout-stderr-write.js) -- [parallel/test-stdout-to-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stdout-to-file.js) -- [parallel/test-strace-openat-openssl.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-strace-openat-openssl.js) -- [parallel/test-stream-base-prototype-accessors-enumerability.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-base-prototype-accessors-enumerability.js) -- [parallel/test-stream-base-typechecking.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-base-typechecking.js) -- [parallel/test-stream-catch-rejections.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-catch-rejections.js) -- [parallel/test-stream-compose-operator.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-compose-operator.js) -- [parallel/test-stream-compose.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-compose.js) -- [parallel/test-stream-consumers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-consumers.js) -- [parallel/test-stream-decoder-objectmode.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-decoder-objectmode.js) -- [parallel/test-stream-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-destroy.js) -- [parallel/test-stream-drop-take.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-drop-take.js) -- [parallel/test-stream-duplex-readable-writable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-duplex-readable-writable.js) -- [parallel/test-stream-end-of-streams.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-end-of-streams.js) -- [parallel/test-stream-filter.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-filter.js) -- [parallel/test-stream-finished.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-finished.js) -- [parallel/test-stream-flatMap.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-flatMap.js) -- [parallel/test-stream-forEach.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-forEach.js) -- [parallel/test-stream-map.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-map.js) -- [parallel/test-stream-passthrough-drain.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-passthrough-drain.js) -- [parallel/test-stream-pipe-deadlock.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-pipe-deadlock.js) -- [parallel/test-stream-pipe-error-unhandled.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-pipe-error-unhandled.js) -- [parallel/test-stream-pipeline-duplex.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-pipeline-duplex.js) -- [parallel/test-stream-pipeline-http2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-pipeline-http2.js) -- [parallel/test-stream-pipeline-listeners.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-pipeline-listeners.js) -- [parallel/test-stream-pipeline-process.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-pipeline-process.js) -- [parallel/test-stream-pipeline-uncaught.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-pipeline-uncaught.js) -- [parallel/test-stream-pipeline.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-pipeline.js) -- [parallel/test-stream-preprocess.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-preprocess.js) -- [parallel/test-stream-promises.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-promises.js) -- [parallel/test-stream-push-order.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-push-order.js) -- [parallel/test-stream-readable-async-iterators.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-readable-async-iterators.js) -- [parallel/test-stream-readable-default-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-readable-default-encoding.js) -- [parallel/test-stream-readable-dispose.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-readable-dispose.js) -- [parallel/test-stream-readable-strategy-option.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-readable-strategy-option.js) -- [parallel/test-stream-readable-unpipe-resume.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-readable-unpipe-resume.js) -- [parallel/test-stream-reduce.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-reduce.js) -- [parallel/test-stream-set-default-hwm.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-set-default-hwm.js) -- [parallel/test-stream-toArray.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-toArray.js) -- [parallel/test-stream-toWeb-allows-server-response.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-toWeb-allows-server-response.js) -- [parallel/test-stream-transform-hwm0.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-transform-hwm0.js) -- [parallel/test-stream-wrap-drain.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-wrap-drain.js) -- [parallel/test-stream-wrap-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-wrap-encoding.js) -- [parallel/test-stream-wrap.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-wrap.js) -- [parallel/test-stream-writable-end-cb-uncaught.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-writable-end-cb-uncaught.js) -- [parallel/test-stream-writable-samecb-singletick.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream-writable-samecb-singletick.js) -- [parallel/test-stream2-finish-pipe-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream2-finish-pipe-error.js) -- [parallel/test-stream2-httpclient-response-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream2-httpclient-response-end.js) -- [parallel/test-stream3-pipeline-async-iterator.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream3-pipeline-async-iterator.js) -- [parallel/test-string-decoder-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-string-decoder-end.js) -- [parallel/test-string-decoder-fuzz.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-string-decoder-fuzz.js) -- [parallel/test-stringbytes-external.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stringbytes-external.js) -- [parallel/test-structuredClone-global.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-structuredClone-global.js) -- [parallel/test-sync-fileread.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-sync-fileread.js) -- [parallel/test-sync-io-option.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-sync-io-option.js) -- [parallel/test-sys.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-sys.js) -- [parallel/test-tcp-wrap-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tcp-wrap-connect.js) -- [parallel/test-tcp-wrap-listen.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tcp-wrap-listen.js) -- [parallel/test-tcp-wrap.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tcp-wrap.js) -- [parallel/test-tick-processor-arguments.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tick-processor-arguments.js) -- [parallel/test-tick-processor-version-check.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tick-processor-version-check.js) -- [parallel/test-timer-immediate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timer-immediate.js) -- [parallel/test-timers-active.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-active.js) -- [parallel/test-timers-clearImmediate-als.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-clearImmediate-als.js) -- [parallel/test-timers-destroyed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-destroyed.js) -- [parallel/test-timers-dispose.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-dispose.js) -- [parallel/test-timers-enroll-invalid-msecs.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-enroll-invalid-msecs.js) -- [parallel/test-timers-enroll-second-time.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-enroll-second-time.js) -- [parallel/test-timers-immediate-promisified.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-immediate-promisified.js) -- [parallel/test-timers-immediate-queue-throw.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-immediate-queue-throw.js) -- [parallel/test-timers-immediate-queue.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-immediate-queue.js) -- [parallel/test-timers-immediate-unref-nested-once.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-immediate-unref-nested-once.js) -- [parallel/test-timers-immediate-unref-simple.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-immediate-unref-simple.js) -- [parallel/test-timers-immediate-unref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-immediate-unref.js) -- [parallel/test-timers-immediate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-immediate.js) -- [parallel/test-timers-interval-promisified.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-interval-promisified.js) -- [parallel/test-timers-linked-list.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-linked-list.js) -- [parallel/test-timers-max-duration-warning.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-max-duration-warning.js) -- [parallel/test-timers-nested.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-nested.js) -- [parallel/test-timers-next-tick.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-next-tick.js) -- [parallel/test-timers-now.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-now.js) -- [parallel/test-timers-ordering.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-ordering.js) -- [parallel/test-timers-promises-scheduler.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-promises-scheduler.js) -- [parallel/test-timers-refresh-in-callback.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-refresh-in-callback.js) -- [parallel/test-timers-reset-process-domain-on-throw.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-reset-process-domain-on-throw.js) -- [parallel/test-timers-setimmediate-infinite-loop.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-setimmediate-infinite-loop.js) -- [parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js) -- [parallel/test-timers-this.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-this.js) -- [parallel/test-timers-throw-when-cb-not-function.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-throw-when-cb-not-function.js) -- [parallel/test-timers-timeout-promisified.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-timeout-promisified.js) -- [parallel/test-timers-timeout-to-interval.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-timeout-to-interval.js) -- [parallel/test-timers-to-primitive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-to-primitive.js) -- [parallel/test-timers-unenroll-unref-interval.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-unenroll-unref-interval.js) -- [parallel/test-timers-unref-active.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-unref-active.js) -- [parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js) -- [parallel/test-timers-unref-remove-other-unref-timers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-unref-remove-other-unref-timers.js) -- [parallel/test-timers-unref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-unref.js) -- [parallel/test-timers-unrefd-interval-still-fires.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-unrefd-interval-still-fires.js) -- [parallel/test-timers-unrefed-in-beforeexit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-unrefed-in-beforeexit.js) -- [parallel/test-timers-unrefed-in-callback.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers-unrefed-in-callback.js) -- [parallel/test-timers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-timers.js) -- [parallel/test-tls-0-dns-altname.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-0-dns-altname.js) -- [parallel/test-tls-add-context.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-add-context.js) -- [parallel/test-tls-addca.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-addca.js) -- [parallel/test-tls-alert-handling.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-alert-handling.js) -- [parallel/test-tls-alert.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-alert.js) -- [parallel/test-tls-alpn-server-client.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-alpn-server-client.js) -- [parallel/test-tls-async-cb-after-socket-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-async-cb-after-socket-end.js) -- [parallel/test-tls-basic-validations.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-basic-validations.js) -- [parallel/test-tls-buffersize.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-buffersize.js) -- [parallel/test-tls-ca-concat.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-ca-concat.js) -- [parallel/test-tls-canonical-ip.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-canonical-ip.js) -- [parallel/test-tls-cert-chains-concat.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-cert-chains-concat.js) -- [parallel/test-tls-cert-chains-in-ca.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-cert-chains-in-ca.js) -- [parallel/test-tls-cert-ext-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-cert-ext-encoding.js) -- [parallel/test-tls-cert-regression.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-cert-regression.js) -- [parallel/test-tls-check-server-identity.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-check-server-identity.js) -- [parallel/test-tls-cipher-list.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-cipher-list.js) -- [parallel/test-tls-cli-max-version-1.2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-cli-max-version-1.2.js) -- [parallel/test-tls-cli-max-version-1.3.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-cli-max-version-1.3.js) -- [parallel/test-tls-cli-min-max-conflict.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-cli-min-max-conflict.js) -- [parallel/test-tls-cli-min-version-1.0.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-cli-min-version-1.0.js) -- [parallel/test-tls-cli-min-version-1.1.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-cli-min-version-1.1.js) -- [parallel/test-tls-cli-min-version-1.2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-cli-min-version-1.2.js) -- [parallel/test-tls-cli-min-version-1.3.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-cli-min-version-1.3.js) -- [parallel/test-tls-client-abort.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-client-abort.js) -- [parallel/test-tls-client-abort2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-client-abort2.js) -- [parallel/test-tls-client-auth.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-client-auth.js) -- [parallel/test-tls-client-default-ciphers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-client-default-ciphers.js) -- [parallel/test-tls-client-destroy-soon.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-client-destroy-soon.js) -- [parallel/test-tls-client-getephemeralkeyinfo.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-client-getephemeralkeyinfo.js) -- [parallel/test-tls-client-mindhsize.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-client-mindhsize.js) -- [parallel/test-tls-client-reject-12.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-client-reject-12.js) -- [parallel/test-tls-client-reject.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-client-reject.js) -- [parallel/test-tls-client-renegotiation-13.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-client-renegotiation-13.js) -- [parallel/test-tls-client-renegotiation-limit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-client-renegotiation-limit.js) -- [parallel/test-tls-client-resume-12.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-client-resume-12.js) -- [parallel/test-tls-client-resume.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-client-resume.js) -- [parallel/test-tls-client-verify.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-client-verify.js) -- [parallel/test-tls-clientcertengine-invalid-arg-type.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-clientcertengine-invalid-arg-type.js) -- [parallel/test-tls-clientcertengine-unsupported.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-clientcertengine-unsupported.js) -- [parallel/test-tls-close-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-close-error.js) -- [parallel/test-tls-close-event-after-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-close-event-after-write.js) -- [parallel/test-tls-close-notify.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-close-notify.js) -- [parallel/test-tls-cnnic-whitelist.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-cnnic-whitelist.js) -- [parallel/test-tls-connect-abort-controller.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-connect-abort-controller.js) -- [parallel/test-tls-connect-address-family.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-connect-address-family.js) -- [parallel/test-tls-connect-allow-half-open-option.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-connect-allow-half-open-option.js) -- [parallel/test-tls-connect-given-socket.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-connect-given-socket.js) -- [parallel/test-tls-connect-hints-option.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-connect-hints-option.js) -- [parallel/test-tls-connect-hwm-option.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-connect-hwm-option.js) -- [parallel/test-tls-connect-memleak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-connect-memleak.js) -- [parallel/test-tls-connect-no-host.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-connect-no-host.js) -- [parallel/test-tls-connect-pipe.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-connect-pipe.js) -- [parallel/test-tls-connect-secure-context.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-connect-secure-context.js) -- [parallel/test-tls-connect-simple.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-connect-simple.js) -- [parallel/test-tls-connect-stream-writes.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-connect-stream-writes.js) -- [parallel/test-tls-connect-timeout-option.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-connect-timeout-option.js) -- [parallel/test-tls-delayed-attach-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-delayed-attach-error.js) -- [parallel/test-tls-delayed-attach.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-delayed-attach.js) -- [parallel/test-tls-destroy-stream-12.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-destroy-stream-12.js) -- [parallel/test-tls-destroy-stream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-destroy-stream.js) -- [parallel/test-tls-destroy-whilst-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-destroy-whilst-write.js) -- [parallel/test-tls-dhe.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-dhe.js) -- [parallel/test-tls-disable-renegotiation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-disable-renegotiation.js) -- [parallel/test-tls-ecdh-auto.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-ecdh-auto.js) -- [parallel/test-tls-ecdh-multiple.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-ecdh-multiple.js) -- [parallel/test-tls-ecdh.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-ecdh.js) -- [parallel/test-tls-econnreset.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-econnreset.js) -- [parallel/test-tls-empty-sni-context.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-empty-sni-context.js) -- [parallel/test-tls-enable-keylog-cli.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-enable-keylog-cli.js) -- [parallel/test-tls-enable-trace-cli.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-enable-trace-cli.js) -- [parallel/test-tls-enable-trace.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-enable-trace.js) -- [parallel/test-tls-env-bad-extra-ca.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-env-bad-extra-ca.js) -- [parallel/test-tls-env-extra-ca-file-load.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-env-extra-ca-file-load.js) -- [parallel/test-tls-env-extra-ca-no-crypto.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-env-extra-ca-no-crypto.js) -- [parallel/test-tls-env-extra-ca.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-env-extra-ca.js) -- [parallel/test-tls-error-servername.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-error-servername.js) -- [parallel/test-tls-exportkeyingmaterial.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-exportkeyingmaterial.js) -- [parallel/test-tls-external-accessor.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-external-accessor.js) -- [parallel/test-tls-fast-writing.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-fast-writing.js) -- [parallel/test-tls-finished.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-finished.js) -- [parallel/test-tls-friendly-error-message.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-friendly-error-message.js) -- [parallel/test-tls-generic-stream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-generic-stream.js) -- [parallel/test-tls-getcertificate-x509.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-getcertificate-x509.js) -- [parallel/test-tls-getcipher.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-getcipher.js) -- [parallel/test-tls-getprotocol.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-getprotocol.js) -- [parallel/test-tls-handshake-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-handshake-error.js) -- [parallel/test-tls-handshake-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-handshake-exception.js) -- [parallel/test-tls-handshake-nohang.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-handshake-nohang.js) -- [parallel/test-tls-hello-parser-failure.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-hello-parser-failure.js) -- [parallel/test-tls-honorcipherorder.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-honorcipherorder.js) -- [parallel/test-tls-inception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-inception.js) -- [parallel/test-tls-interleave.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-interleave.js) -- [parallel/test-tls-invalid-pfx.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-invalid-pfx.js) -- [parallel/test-tls-invoke-queued.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-invoke-queued.js) -- [parallel/test-tls-ip-servername-deprecation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-ip-servername-deprecation.js) -- [parallel/test-tls-js-stream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-js-stream.js) -- [parallel/test-tls-junk-closes-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-junk-closes-server.js) -- [parallel/test-tls-junk-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-junk-server.js) -- [parallel/test-tls-key-mismatch.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-key-mismatch.js) -- [parallel/test-tls-keyengine-invalid-arg-type.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-keyengine-invalid-arg-type.js) -- [parallel/test-tls-keyengine-unsupported.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-keyengine-unsupported.js) -- [parallel/test-tls-keylog-tlsv13.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-keylog-tlsv13.js) -- [parallel/test-tls-legacy-deprecated.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-legacy-deprecated.js) -- [parallel/test-tls-max-send-fragment.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-max-send-fragment.js) -- [parallel/test-tls-min-max-version.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-min-max-version.js) -- [parallel/test-tls-multi-key.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-multi-key.js) -- [parallel/test-tls-multi-pfx.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-multi-pfx.js) -- [parallel/test-tls-multiple-cas-as-string.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-multiple-cas-as-string.js) -- [parallel/test-tls-net-connect-prefer-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-net-connect-prefer-path.js) -- [parallel/test-tls-net-socket-keepalive-12.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-net-socket-keepalive-12.js) -- [parallel/test-tls-net-socket-keepalive.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-net-socket-keepalive.js) -- [parallel/test-tls-no-cert-required.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-no-cert-required.js) -- [parallel/test-tls-no-rsa-key.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-no-rsa-key.js) -- [parallel/test-tls-no-sslv23.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-no-sslv23.js) -- [parallel/test-tls-no-sslv3.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-no-sslv3.js) -- [parallel/test-tls-ocsp-callback.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-ocsp-callback.js) -- [parallel/test-tls-on-empty-socket.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-on-empty-socket.js) -- [parallel/test-tls-onread-static-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-onread-static-buffer.js) -- [parallel/test-tls-options-boolean-check.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-options-boolean-check.js) -- [parallel/test-tls-over-http-tunnel.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-over-http-tunnel.js) -- [parallel/test-tls-passphrase.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-passphrase.js) -- [parallel/test-tls-pause.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-pause.js) -- [parallel/test-tls-peer-certificate-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-peer-certificate-encoding.js) -- [parallel/test-tls-peer-certificate-multi-keys.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-peer-certificate-multi-keys.js) -- [parallel/test-tls-peer-certificate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-peer-certificate.js) -- [parallel/test-tls-pfx-authorizationerror.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-pfx-authorizationerror.js) -- [parallel/test-tls-psk-circuit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-psk-circuit.js) -- [parallel/test-tls-psk-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-psk-errors.js) -- [parallel/test-tls-psk-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-psk-server.js) -- [parallel/test-tls-reduced-SECLEVEL-in-cipher.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-reduced-SECLEVEL-in-cipher.js) -- [parallel/test-tls-reinitialize-listeners.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-reinitialize-listeners.js) -- [parallel/test-tls-request-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-request-timeout.js) -- [parallel/test-tls-retain-handle-no-abort.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-retain-handle-no-abort.js) -- [parallel/test-tls-reuse-host-from-socket.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-reuse-host-from-socket.js) -- [parallel/test-tls-root-certificates.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-root-certificates.js) -- [parallel/test-tls-secure-context-usage-order.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-secure-context-usage-order.js) -- [parallel/test-tls-secure-session.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-secure-session.js) -- [parallel/test-tls-securepair-fiftharg.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-securepair-fiftharg.js) -- [parallel/test-tls-securepair-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-securepair-leak.js) -- [parallel/test-tls-securepair-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-securepair-server.js) -- [parallel/test-tls-server-capture-rejection.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-server-capture-rejection.js) -- [parallel/test-tls-server-connection-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-server-connection-server.js) -- [parallel/test-tls-server-failed-handshake-emits-clienterror.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-server-failed-handshake-emits-clienterror.js) -- [parallel/test-tls-server-parent-constructor-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-server-parent-constructor-options.js) -- [parallel/test-tls-server-setoptions-clientcertengine.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-server-setoptions-clientcertengine.js) -- [parallel/test-tls-server-verify.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-server-verify.js) -- [parallel/test-tls-session-cache.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-session-cache.js) -- [parallel/test-tls-set-ciphers-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-set-ciphers-error.js) -- [parallel/test-tls-set-ciphers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-set-ciphers.js) -- [parallel/test-tls-set-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-set-encoding.js) -- [parallel/test-tls-set-secure-context.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-set-secure-context.js) -- [parallel/test-tls-set-sigalgs.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-set-sigalgs.js) -- [parallel/test-tls-sni-option.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-sni-option.js) -- [parallel/test-tls-sni-server-client.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-sni-server-client.js) -- [parallel/test-tls-sni-servername.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-sni-servername.js) -- [parallel/test-tls-snicallback-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-snicallback-error.js) -- [parallel/test-tls-socket-allow-half-open-option.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-socket-allow-half-open-option.js) -- [parallel/test-tls-socket-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-socket-close.js) -- [parallel/test-tls-socket-constructor-alpn-options-parsing.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-socket-constructor-alpn-options-parsing.js) -- [parallel/test-tls-socket-default-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-socket-default-options.js) -- [parallel/test-tls-socket-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-socket-destroy.js) -- [parallel/test-tls-socket-failed-handshake-emits-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-socket-failed-handshake-emits-error.js) -- [parallel/test-tls-socket-snicallback-without-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-socket-snicallback-without-server.js) -- [parallel/test-tls-startcom-wosign-whitelist.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-startcom-wosign-whitelist.js) -- [parallel/test-tls-starttls-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-starttls-server.js) -- [parallel/test-tls-streamwrap-buffersize.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-streamwrap-buffersize.js) -- [parallel/test-tls-ticket-12.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-ticket-12.js) -- [parallel/test-tls-ticket-cluster.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-ticket-cluster.js) -- [parallel/test-tls-ticket-invalid-arg.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-ticket-invalid-arg.js) -- [parallel/test-tls-ticket.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-ticket.js) -- [parallel/test-tls-timeout-server-2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-timeout-server-2.js) -- [parallel/test-tls-timeout-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-timeout-server.js) -- [parallel/test-tls-tlswrap-segfault-2.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-tlswrap-segfault-2.js) -- [parallel/test-tls-tlswrap-segfault.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-tlswrap-segfault.js) -- [parallel/test-tls-translate-peer-certificate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-translate-peer-certificate.js) -- [parallel/test-tls-transport-destroy-after-own-gc.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-transport-destroy-after-own-gc.js) -- [parallel/test-tls-use-after-free-regression.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-use-after-free-regression.js) -- [parallel/test-tls-wrap-econnreset-localaddress.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-wrap-econnreset-localaddress.js) -- [parallel/test-tls-wrap-econnreset-pipe.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-wrap-econnreset-pipe.js) -- [parallel/test-tls-wrap-econnreset-socket.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-wrap-econnreset-socket.js) -- [parallel/test-tls-wrap-econnreset.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-wrap-econnreset.js) -- [parallel/test-tls-wrap-event-emmiter.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-wrap-event-emmiter.js) -- [parallel/test-tls-wrap-no-abort.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-wrap-no-abort.js) -- [parallel/test-tls-wrap-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-wrap-timeout.js) -- [parallel/test-tls-write-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-write-error.js) -- [parallel/test-tls-writewrap-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-writewrap-leak.js) -- [parallel/test-tls-zero-clear-in.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tls-zero-clear-in.js) -- [parallel/test-tojson-perf_hooks.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tojson-perf_hooks.js) -- [parallel/test-trace-atomics-wait.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-atomics-wait.js) -- [parallel/test-trace-events-all.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-all.js) -- [parallel/test-trace-events-api-worker-disabled.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-api-worker-disabled.js) -- [parallel/test-trace-events-api.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-api.js) -- [parallel/test-trace-events-async-hooks-dynamic.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-async-hooks-dynamic.js) -- [parallel/test-trace-events-async-hooks-worker.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-async-hooks-worker.js) -- [parallel/test-trace-events-async-hooks.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-async-hooks.js) -- [parallel/test-trace-events-binding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-binding.js) -- [parallel/test-trace-events-bootstrap.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-bootstrap.js) -- [parallel/test-trace-events-category-used.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-category-used.js) -- [parallel/test-trace-events-console.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-console.js) -- [parallel/test-trace-events-dynamic-enable-workers-disabled.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-dynamic-enable-workers-disabled.js) -- [parallel/test-trace-events-dynamic-enable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-dynamic-enable.js) -- [parallel/test-trace-events-environment.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-environment.js) -- [parallel/test-trace-events-file-pattern.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-file-pattern.js) -- [parallel/test-trace-events-fs-async.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-fs-async.js) -- [parallel/test-trace-events-fs-sync.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-fs-sync.js) -- [parallel/test-trace-events-http.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-http.js) -- [parallel/test-trace-events-metadata.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-metadata.js) -- [parallel/test-trace-events-net.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-net.js) -- [parallel/test-trace-events-none.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-none.js) -- [parallel/test-trace-events-process-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-process-exit.js) -- [parallel/test-trace-events-promises.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-promises.js) -- [parallel/test-trace-events-threadpool.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-threadpool.js) -- [parallel/test-trace-events-v8.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-v8.js) -- [parallel/test-trace-events-vm.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-vm.js) -- [parallel/test-trace-events-worker-metadata-with-name.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-worker-metadata-with-name.js) -- [parallel/test-trace-events-worker-metadata.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-events-worker-metadata.js) -- [parallel/test-trace-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-trace-exit.js) -- [parallel/test-tracing-no-crash.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tracing-no-crash.js) -- [parallel/test-tty-backwards-api.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tty-backwards-api.js) -- [parallel/test-tty-stdin-pipe.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tty-stdin-pipe.js) -- [parallel/test-ttywrap-invalid-fd.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-ttywrap-invalid-fd.js) -- [parallel/test-ttywrap-stack.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-ttywrap-stack.js) -- [parallel/test-tz-version.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-tz-version.js) -- [parallel/test-unhandled-exception-rethrow-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-unhandled-exception-rethrow-error.js) -- [parallel/test-unhandled-exception-with-worker-inuse.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-unhandled-exception-with-worker-inuse.js) -- [parallel/test-unicode-node-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-unicode-node-options.js) -- [parallel/test-url-canParse-whatwg.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-url-canParse-whatwg.js) -- [parallel/test-url-is-url.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-url-is-url.js) -- [parallel/test-url-null-char.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-url-null-char.js) -- [parallel/test-url-parse-format.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-url-parse-format.js) -- [parallel/test-utf8-scripts.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-utf8-scripts.js) -- [parallel/test-util-callbackify.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-util-callbackify.js) -- [parallel/test-util-emit-experimental-warning.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-util-emit-experimental-warning.js) -- [parallel/test-util-inspect-getters-accessing-this.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-util-inspect-getters-accessing-this.js) -- [parallel/test-util-internal.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-util-internal.js) -- [parallel/test-util-log.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-util-log.js) -- [parallel/test-util-primordial-monkeypatching.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-util-primordial-monkeypatching.js) -- [parallel/test-util-sigint-watchdog.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-util-sigint-watchdog.js) -- [parallel/test-util-sleep.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-util-sleep.js) -- [parallel/test-uv-binding-constant.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-uv-binding-constant.js) -- [parallel/test-uv-errmap.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-uv-errmap.js) -- [parallel/test-uv-errno.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-uv-errno.js) -- [parallel/test-uv-unmapped-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-uv-unmapped-exception.js) -- [parallel/test-v8-collect-gc-profile-exit-before-stop.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-collect-gc-profile-exit-before-stop.js) -- [parallel/test-v8-collect-gc-profile-in-worker.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-collect-gc-profile-in-worker.js) -- [parallel/test-v8-collect-gc-profile.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-collect-gc-profile.js) -- [parallel/test-v8-coverage.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-coverage.js) -- [parallel/test-v8-deserialize-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-deserialize-buffer.js) -- [parallel/test-v8-flag-pool-size-0.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-flag-pool-size-0.js) -- [parallel/test-v8-flag-type-check.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-flag-type-check.js) -- [parallel/test-v8-flags.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-flags.js) -- [parallel/test-v8-getheapsnapshot-twice.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-getheapsnapshot-twice.js) -- [parallel/test-v8-global-setter.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-global-setter.js) -- [parallel/test-v8-serdes.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-serdes.js) -- [parallel/test-v8-serialize-leak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-serialize-leak.js) -- [parallel/test-v8-startup-snapshot-api.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-startup-snapshot-api.js) -- [parallel/test-v8-stats.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-stats.js) -- [parallel/test-v8-stop-coverage.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-stop-coverage.js) -- [parallel/test-v8-take-coverage-noop.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-take-coverage-noop.js) -- [parallel/test-v8-take-coverage.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-take-coverage.js) -- [parallel/test-v8-version-tag.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-v8-version-tag.js) -- [parallel/test-validators.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-validators.js) -- [parallel/test-vfs.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vfs.js) -- [parallel/test-vm-api-handles-getter-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-api-handles-getter-errors.js) -- [parallel/test-vm-basic.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-basic.js) -- [parallel/test-vm-cached-data.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-cached-data.js) -- [parallel/test-vm-context.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-context.js) -- [parallel/test-vm-dynamic-import-callback-missing-flag.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-dynamic-import-callback-missing-flag.js) -- [parallel/test-vm-global-get-own.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-global-get-own.js) -- [parallel/test-vm-global-non-writable-properties.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-global-non-writable-properties.js) -- [parallel/test-vm-global-property-interceptors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-global-property-interceptors.js) -- [parallel/test-vm-measure-memory-lazy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-measure-memory-lazy.js) -- [parallel/test-vm-measure-memory-multi-context.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-measure-memory-multi-context.js) -- [parallel/test-vm-measure-memory.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-measure-memory.js) -- [parallel/test-vm-module-basic.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-module-basic.js) -- [parallel/test-vm-module-cached-data.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-module-cached-data.js) -- [parallel/test-vm-module-dynamic-import.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-module-dynamic-import.js) -- [parallel/test-vm-module-dynamic-namespace.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-module-dynamic-namespace.js) -- [parallel/test-vm-module-errors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-module-errors.js) -- [parallel/test-vm-module-import-meta.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-module-import-meta.js) -- [parallel/test-vm-module-link.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-module-link.js) -- [parallel/test-vm-module-reevaluate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-module-reevaluate.js) -- [parallel/test-vm-module-synthetic.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-module-synthetic.js) -- [parallel/test-vm-no-dynamic-import-callback.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-no-dynamic-import-callback.js) -- [parallel/test-vm-run-in-new-context.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-run-in-new-context.js) -- [parallel/test-vm-sigint-existing-handler.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-sigint-existing-handler.js) -- [parallel/test-vm-sigint.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-sigint.js) -- [parallel/test-vm-strict-assign.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-strict-assign.js) -- [parallel/test-vm-syntax-error-message.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-syntax-error-message.js) -- [parallel/test-vm-syntax-error-stderr.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-syntax-error-stderr.js) -- [parallel/test-vm-timeout-escape-promise-module.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-vm-timeout-escape-promise-module.js) -- [parallel/test-warn-sigprof.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-warn-sigprof.js) -- [parallel/test-warn-stream-wrap.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-warn-stream-wrap.js) -- [parallel/test-weakref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-weakref.js) -- [parallel/test-webcrypto-constructors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-constructors.js) -- [parallel/test-webcrypto-cryptokey-workers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-cryptokey-workers.js) -- [parallel/test-webcrypto-derivebits-cfrg.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-derivebits-cfrg.js) -- [parallel/test-webcrypto-derivebits-ecdh.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-derivebits-ecdh.js) -- [parallel/test-webcrypto-derivebits-hkdf.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-derivebits-hkdf.js) -- [parallel/test-webcrypto-derivebits.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-derivebits.js) -- [parallel/test-webcrypto-derivekey-cfrg.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-derivekey-cfrg.js) -- [parallel/test-webcrypto-derivekey-ecdh.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-derivekey-ecdh.js) -- [parallel/test-webcrypto-derivekey.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-derivekey.js) -- [parallel/test-webcrypto-digest.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-digest.js) -- [parallel/test-webcrypto-encrypt-decrypt-aes.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-encrypt-decrypt-aes.js) -- [parallel/test-webcrypto-encrypt-decrypt-rsa.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-encrypt-decrypt-rsa.js) -- [parallel/test-webcrypto-encrypt-decrypt.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-encrypt-decrypt.js) -- [parallel/test-webcrypto-export-import-cfrg.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-export-import-cfrg.js) -- [parallel/test-webcrypto-export-import-ec.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-export-import-ec.js) -- [parallel/test-webcrypto-export-import-rsa.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-export-import-rsa.js) -- [parallel/test-webcrypto-export-import.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-export-import.js) -- [parallel/test-webcrypto-getRandomValues.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-getRandomValues.js) -- [parallel/test-webcrypto-keygen.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-keygen.js) -- [parallel/test-webcrypto-random.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-random.js) -- [parallel/test-webcrypto-sign-verify-ecdsa.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-sign-verify-ecdsa.js) -- [parallel/test-webcrypto-sign-verify-eddsa.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-sign-verify-eddsa.js) -- [parallel/test-webcrypto-sign-verify-hmac.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-sign-verify-hmac.js) -- [parallel/test-webcrypto-sign-verify-rsa.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-sign-verify-rsa.js) -- [parallel/test-webcrypto-util.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-util.js) -- [parallel/test-webcrypto-webidl.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-webidl.js) -- [parallel/test-webcrypto-wrap-unwrap.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webcrypto-wrap-unwrap.js) -- [parallel/test-websocket.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-websocket.js) -- [parallel/test-webstream-encoding-inspect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webstream-encoding-inspect.js) -- [parallel/test-webstream-readablestream-pipeto.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webstream-readablestream-pipeto.js) -- [parallel/test-webstream-string-tag.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webstream-string-tag.js) -- [parallel/test-webstreams-abort-controller.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webstreams-abort-controller.js) -- [parallel/test-webstreams-compose.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webstreams-compose.js) -- [parallel/test-webstreams-finished.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webstreams-finished.js) -- [parallel/test-webstreams-pipeline.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-webstreams-pipeline.js) -- [parallel/test-whatwg-encoding-custom-fatal-streaming.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-encoding-custom-fatal-streaming.js) -- [parallel/test-whatwg-encoding-custom-internals.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-encoding-custom-internals.js) -- [parallel/test-whatwg-encoding-custom-interop.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-encoding-custom-interop.js) -- [parallel/test-whatwg-encoding-custom-textdecoder-api-invalid-label.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-encoding-custom-textdecoder-api-invalid-label.js) -- [parallel/test-whatwg-encoding-custom-textdecoder-fatal.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-encoding-custom-textdecoder-fatal.js) -- [parallel/test-whatwg-encoding-custom-textdecoder-invalid-arg.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-encoding-custom-textdecoder-invalid-arg.js) -- [parallel/test-whatwg-encoding-custom-textdecoder-utf16-surrogates.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-encoding-custom-textdecoder-utf16-surrogates.js) -- [parallel/test-whatwg-encoding-custom-textdecoder.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-encoding-custom-textdecoder.js) -- [parallel/test-whatwg-events-event-constructors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-events-event-constructors.js) -- [parallel/test-whatwg-events-eventtarget-this-of-listener.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-events-eventtarget-this-of-listener.js) -- [parallel/test-whatwg-readablebytestream-bad-buffers-and-views.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-readablebytestream-bad-buffers-and-views.js) -- [parallel/test-whatwg-readablebytestream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-readablebytestream.js) -- [parallel/test-whatwg-readablebytestreambyob.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-readablebytestreambyob.js) -- [parallel/test-whatwg-readablestream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-readablestream.js) -- [parallel/test-whatwg-transformstream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-transformstream.js) -- [parallel/test-whatwg-url-canparse.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-canparse.js) -- [parallel/test-whatwg-url-custom-domainto.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-domainto.js) -- [parallel/test-whatwg-url-custom-inspect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-inspect.js) -- [parallel/test-whatwg-url-custom-parsing.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-parsing.js) -- [parallel/test-whatwg-url-custom-properties.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-properties.js) -- [parallel/test-whatwg-url-custom-searchparams-append.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-searchparams-append.js) -- [parallel/test-whatwg-url-custom-searchparams-constructor.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-searchparams-constructor.js) -- [parallel/test-whatwg-url-custom-searchparams-delete.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-searchparams-delete.js) -- [parallel/test-whatwg-url-custom-searchparams-entries.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-searchparams-entries.js) -- [parallel/test-whatwg-url-custom-searchparams-foreach.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-searchparams-foreach.js) -- [parallel/test-whatwg-url-custom-searchparams-get.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-searchparams-get.js) -- [parallel/test-whatwg-url-custom-searchparams-getall.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-searchparams-getall.js) -- [parallel/test-whatwg-url-custom-searchparams-has.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-searchparams-has.js) -- [parallel/test-whatwg-url-custom-searchparams-inspect.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-searchparams-inspect.js) -- [parallel/test-whatwg-url-custom-searchparams-keys.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-searchparams-keys.js) -- [parallel/test-whatwg-url-custom-searchparams-set.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-searchparams-set.js) -- [parallel/test-whatwg-url-custom-searchparams-sort.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-searchparams-sort.js) -- [parallel/test-whatwg-url-custom-searchparams-stringifier.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-searchparams-stringifier.js) -- [parallel/test-whatwg-url-custom-searchparams-values.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-searchparams-values.js) -- [parallel/test-whatwg-url-custom-searchparams.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-searchparams.js) -- [parallel/test-whatwg-url-custom-setters.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-custom-setters.js) -- [parallel/test-whatwg-url-invalidthis.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-invalidthis.js) -- [parallel/test-whatwg-url-toascii.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-url-toascii.js) -- [parallel/test-whatwg-webstreams-adapters-streambase.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-webstreams-adapters-streambase.js) -- [parallel/test-whatwg-webstreams-adapters-to-readablestream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-webstreams-adapters-to-readablestream.js) -- [parallel/test-whatwg-webstreams-adapters-to-readablewritablepair.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-webstreams-adapters-to-readablewritablepair.js) -- [parallel/test-whatwg-webstreams-adapters-to-streamduplex.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-webstreams-adapters-to-streamduplex.js) -- [parallel/test-whatwg-webstreams-adapters-to-streamreadable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-webstreams-adapters-to-streamreadable.js) -- [parallel/test-whatwg-webstreams-adapters-to-streamwritable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-webstreams-adapters-to-streamwritable.js) -- [parallel/test-whatwg-webstreams-adapters-to-writablestream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-webstreams-adapters-to-writablestream.js) -- [parallel/test-whatwg-webstreams-compression.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-webstreams-compression.js) -- [parallel/test-whatwg-webstreams-coverage.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-webstreams-coverage.js) -- [parallel/test-whatwg-webstreams-encoding.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-webstreams-encoding.js) -- [parallel/test-whatwg-webstreams-transfer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-webstreams-transfer.js) -- [parallel/test-whatwg-writablestream.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-whatwg-writablestream.js) -- [parallel/test-windows-abort-exitcode.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-windows-abort-exitcode.js) -- [parallel/test-windows-failed-heap-allocation.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-windows-failed-heap-allocation.js) -- [parallel/test-worker-abort-on-uncaught-exception-terminate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-abort-on-uncaught-exception-terminate.js) -- [parallel/test-worker-abort-on-uncaught-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-abort-on-uncaught-exception.js) -- [parallel/test-worker-arraybuffer-zerofill.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-arraybuffer-zerofill.js) -- [parallel/test-worker-beforeexit-throw-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-beforeexit-throw-exit.js) -- [parallel/test-worker-broadcastchannel-wpt.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-broadcastchannel-wpt.js) -- [parallel/test-worker-broadcastchannel.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-broadcastchannel.js) -- [parallel/test-worker-cjs-workerdata.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-cjs-workerdata.js) -- [parallel/test-worker-cleanexit-with-js.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-cleanexit-with-js.js) -- [parallel/test-worker-cleanexit-with-moduleload.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-cleanexit-with-moduleload.js) -- [parallel/test-worker-cleanup-handles.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-cleanup-handles.js) -- [parallel/test-worker-console-listeners.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-console-listeners.js) -- [parallel/test-worker-crypto-sign-transfer-result.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-crypto-sign-transfer-result.js) -- [parallel/test-worker-data-url.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-data-url.js) -- [parallel/test-worker-debug.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-debug.js) -- [parallel/test-worker-dns-terminate-during-query.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-dns-terminate-during-query.js) -- [parallel/test-worker-dns-terminate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-dns-terminate.js) -- [parallel/test-worker-environmentdata.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-environmentdata.js) -- [parallel/test-worker-error-stack-getter-throws.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-error-stack-getter-throws.js) -- [parallel/test-worker-esm-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-esm-exit.js) -- [parallel/test-worker-esm-missing-main.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-esm-missing-main.js) -- [parallel/test-worker-esmodule.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-esmodule.js) -- [parallel/test-worker-event.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-event.js) -- [parallel/test-worker-execargv-invalid.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-execargv-invalid.js) -- [parallel/test-worker-execargv.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-execargv.js) -- [parallel/test-worker-exit-code.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-exit-code.js) -- [parallel/test-worker-exit-event-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-exit-event-error.js) -- [parallel/test-worker-exit-from-uncaught-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-exit-from-uncaught-exception.js) -- [parallel/test-worker-exit-heapsnapshot.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-exit-heapsnapshot.js) -- [parallel/test-worker-fs-stat-watcher.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-fs-stat-watcher.js) -- [parallel/test-worker-hasref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-hasref.js) -- [parallel/test-worker-heap-snapshot.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-heap-snapshot.js) -- [parallel/test-worker-heapdump-failure.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-heapdump-failure.js) -- [parallel/test-worker-http2-generic-streams-terminate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-http2-generic-streams-terminate.js) -- [parallel/test-worker-http2-stream-terminate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-http2-stream-terminate.js) -- [parallel/test-worker-init-failure.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-init-failure.js) -- [parallel/test-worker-invalid-workerdata.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-invalid-workerdata.js) -- [parallel/test-worker-load-file-with-extension-other-than-js.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-load-file-with-extension-other-than-js.js) -- [parallel/test-worker-memory.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-memory.js) -- [parallel/test-worker-message-channel-sharedarraybuffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-channel-sharedarraybuffer.js) -- [parallel/test-worker-message-channel.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-channel.js) -- [parallel/test-worker-message-event.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-event.js) -- [parallel/test-worker-message-not-serializable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-not-serializable.js) -- [parallel/test-worker-message-port-arraybuffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-arraybuffer.js) -- [parallel/test-worker-message-port-close-while-receiving.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-close-while-receiving.js) -- [parallel/test-worker-message-port-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-close.js) -- [parallel/test-worker-message-port-constructor.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-constructor.js) -- [parallel/test-worker-message-port-drain.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-drain.js) -- [parallel/test-worker-message-port-inspect-during-init-hook.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-inspect-during-init-hook.js) -- [parallel/test-worker-message-port-jstransferable-nested-untransferable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-jstransferable-nested-untransferable.js) -- [parallel/test-worker-message-port-message-before-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-message-before-close.js) -- [parallel/test-worker-message-port-message-port-transferring.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-message-port-transferring.js) -- [parallel/test-worker-message-port-move.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-move.js) -- [parallel/test-worker-message-port-terminate-transfer-list.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-terminate-transfer-list.js) -- [parallel/test-worker-message-port-transfer-closed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-transfer-closed.js) -- [parallel/test-worker-message-port-transfer-duplicate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-transfer-duplicate.js) -- [parallel/test-worker-message-port-transfer-fake-js-transferable-internal.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-transfer-fake-js-transferable-internal.js) -- [parallel/test-worker-message-port-transfer-fake-js-transferable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-transfer-fake-js-transferable.js) -- [parallel/test-worker-message-port-transfer-filehandle.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-transfer-filehandle.js) -- [parallel/test-worker-message-port-transfer-native.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-transfer-native.js) -- [parallel/test-worker-message-port-transfer-self.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-transfer-self.js) -- [parallel/test-worker-message-port-transfer-target.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-transfer-target.js) -- [parallel/test-worker-message-port-transfer-terminate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-transfer-terminate.js) -- [parallel/test-worker-message-port-wasm-module.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-wasm-module.js) -- [parallel/test-worker-message-port-wasm-threads.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port-wasm-threads.js) -- [parallel/test-worker-message-port.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-port.js) -- [parallel/test-worker-message-transfer-port-mark-as-untransferable.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-transfer-port-mark-as-untransferable.js) -- [parallel/test-worker-message-type-unknown.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-message-type-unknown.js) -- [parallel/test-worker-messageport-hasref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-messageport-hasref.js) -- [parallel/test-worker-mjs-workerdata.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-mjs-workerdata.js) -- [parallel/test-worker-name.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-name.js) -- [parallel/test-worker-nearheaplimit-deadlock.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-nearheaplimit-deadlock.js) -- [parallel/test-worker-nested-on-process-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-nested-on-process-exit.js) -- [parallel/test-worker-nested-uncaught.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-nested-uncaught.js) -- [parallel/test-worker-nexttick-terminate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-nexttick-terminate.js) -- [parallel/test-worker-no-atomics.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-no-atomics.js) -- [parallel/test-worker-no-sab.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-no-sab.js) -- [parallel/test-worker-no-stdin-stdout-interaction.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-no-stdin-stdout-interaction.js) -- [parallel/test-worker-non-fatal-uncaught-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-non-fatal-uncaught-exception.js) -- [parallel/test-worker-on-process-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-on-process-exit.js) -- [parallel/test-worker-onmessage-not-a-function.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-onmessage-not-a-function.js) -- [parallel/test-worker-onmessage.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-onmessage.js) -- [parallel/test-worker-parent-port-ref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-parent-port-ref.js) -- [parallel/test-worker-process-argv.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-process-argv.js) -- [parallel/test-worker-process-cwd.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-process-cwd.js) -- [parallel/test-worker-process-env-shared.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-process-env-shared.js) -- [parallel/test-worker-process-env.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-process-env.js) -- [parallel/test-worker-process-exit-async-module.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-process-exit-async-module.js) -- [parallel/test-worker-ref-onexit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-ref-onexit.js) -- [parallel/test-worker-ref.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-ref.js) -- [parallel/test-worker-relative-path-double-dot.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-relative-path-double-dot.js) -- [parallel/test-worker-relative-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-relative-path.js) -- [parallel/test-worker-resource-limits.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-resource-limits.js) -- [parallel/test-worker-safe-getters.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-safe-getters.js) -- [parallel/test-worker-sharedarraybuffer-from-worker-thread.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-sharedarraybuffer-from-worker-thread.js) -- [parallel/test-worker-stack-overflow-stack-size.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-stack-overflow-stack-size.js) -- [parallel/test-worker-stack-overflow.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-stack-overflow.js) -- [parallel/test-worker-stdio-from-preload-module.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-stdio-from-preload-module.js) -- [parallel/test-worker-stdio.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-stdio.js) -- [parallel/test-worker-syntax-error-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-syntax-error-file.js) -- [parallel/test-worker-syntax-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-syntax-error.js) -- [parallel/test-worker-terminate-http2-respond-with-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-terminate-http2-respond-with-file.js) -- [parallel/test-worker-terminate-microtask-loop.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-terminate-microtask-loop.js) -- [parallel/test-worker-terminate-nested.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-terminate-nested.js) -- [parallel/test-worker-terminate-null-handler.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-terminate-null-handler.js) -- [parallel/test-worker-terminate-ref-public-port.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-terminate-ref-public-port.js) -- [parallel/test-worker-terminate-source-map.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-terminate-source-map.js) -- [parallel/test-worker-terminate-timers.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-terminate-timers.js) -- [parallel/test-worker-terminate-unrefed.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-terminate-unrefed.js) -- [parallel/test-worker-track-unmanaged-fds.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-track-unmanaged-fds.js) -- [parallel/test-worker-type-check.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-type-check.js) -- [parallel/test-worker-uncaught-exception-async.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-uncaught-exception-async.js) -- [parallel/test-worker-uncaught-exception.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-uncaught-exception.js) -- [parallel/test-worker-unref-from-message-during-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-unref-from-message-during-exit.js) -- [parallel/test-worker-unsupported-path.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-unsupported-path.js) -- [parallel/test-worker-unsupported-things.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-unsupported-things.js) -- [parallel/test-worker-vm-context-terminate.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-vm-context-terminate.js) -- [parallel/test-worker-voluntarily-exit-followed-by-addition.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-voluntarily-exit-followed-by-addition.js) -- [parallel/test-worker-voluntarily-exit-followed-by-throw.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-voluntarily-exit-followed-by-throw.js) -- [parallel/test-worker-workerdata-messageport.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-workerdata-messageport.js) -- [parallel/test-worker-workerdata-sharedarraybuffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker-workerdata-sharedarraybuffer.js) -- [parallel/test-worker.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-worker.js) -- [parallel/test-wrap-js-stream-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-wrap-js-stream-destroy.js) -- [parallel/test-wrap-js-stream-duplex.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-wrap-js-stream-duplex.js) -- [parallel/test-wrap-js-stream-exceptions.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-wrap-js-stream-exceptions.js) -- [parallel/test-wrap-js-stream-read-stop.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-wrap-js-stream-read-stop.js) -- [parallel/test-x509-escaping.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-x509-escaping.js) -- [parallel/test-zlib-brotli-16GB.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-brotli-16GB.js) -- [parallel/test-zlib-brotli-flush.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-brotli-flush.js) -- [parallel/test-zlib-brotli-from-brotli.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-brotli-from-brotli.js) -- [parallel/test-zlib-brotli-from-string.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-brotli-from-string.js) -- [parallel/test-zlib-brotli-kmaxlength-rangeerror.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-brotli-kmaxlength-rangeerror.js) -- [parallel/test-zlib-brotli.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-brotli.js) -- [parallel/test-zlib-bytes-read.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-bytes-read.js) -- [parallel/test-zlib-close-in-ondata.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-close-in-ondata.js) -- [parallel/test-zlib-const.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-const.js) -- [parallel/test-zlib-create-raw.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-create-raw.js) -- [parallel/test-zlib-deflate-constructors.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-deflate-constructors.js) -- [parallel/test-zlib-destroy.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-destroy.js) -- [parallel/test-zlib-dictionary-fail.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-dictionary-fail.js) -- [parallel/test-zlib-dictionary.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-dictionary.js) -- [parallel/test-zlib-failed-init.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-failed-init.js) -- [parallel/test-zlib-flush-drain-longblock.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-flush-drain-longblock.js) -- [parallel/test-zlib-flush-drain.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-flush-drain.js) -- [parallel/test-zlib-flush-flags.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-flush-flags.js) -- [parallel/test-zlib-flush-write-sync-interleaved.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-flush-write-sync-interleaved.js) -- [parallel/test-zlib-flush.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-flush.js) -- [parallel/test-zlib-from-concatenated-gzip.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-from-concatenated-gzip.js) -- [parallel/test-zlib-from-gzip-with-trailing-garbage.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js) -- [parallel/test-zlib-from-gzip.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-from-gzip.js) -- [parallel/test-zlib-invalid-arg-value-brotli-compress.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-invalid-arg-value-brotli-compress.js) -- [parallel/test-zlib-invalid-input-memory.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-invalid-input-memory.js) -- [parallel/test-zlib-kmaxlength-rangeerror.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-kmaxlength-rangeerror.js) -- [parallel/test-zlib-maxOutputLength.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-maxOutputLength.js) -- [parallel/test-zlib-not-string-or-buffer.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-not-string-or-buffer.js) -- [parallel/test-zlib-object-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-object-write.js) -- [parallel/test-zlib-params.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-params.js) -- [parallel/test-zlib-premature-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-premature-end.js) -- [parallel/test-zlib-reset-before-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-reset-before-write.js) -- [parallel/test-zlib-unused-weak.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-unused-weak.js) -- [parallel/test-zlib-write-after-close.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib-write-after-close.js) -- [parallel/test-zlib.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-zlib.js) -- [pseudo-tty/readline-dumb-tty.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/readline-dumb-tty.js) -- [pseudo-tty/ref_keeps_node_running.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/ref_keeps_node_running.js) -- [pseudo-tty/repl-dumb-tty.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/repl-dumb-tty.js) -- [pseudo-tty/stdin-setrawmode.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/stdin-setrawmode.js) -- [pseudo-tty/test-assert-colors.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-assert-colors.js) -- [pseudo-tty/test-assert-no-color.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-assert-no-color.js) -- [pseudo-tty/test-assert-position-indicator.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-assert-position-indicator.js) -- [pseudo-tty/test-async-wrap-getasyncid-tty.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-async-wrap-getasyncid-tty.js) -- [pseudo-tty/test-fatal-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-fatal-error.js) -- [pseudo-tty/test-handle-wrap-hasref-tty.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-handle-wrap-hasref-tty.js) -- [pseudo-tty/test-readable-tty-keepalive.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-readable-tty-keepalive.js) -- [pseudo-tty/test-repl-external-module.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-repl-external-module.js) -- [pseudo-tty/test-set-raw-mode-reset-process-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-set-raw-mode-reset-process-exit.js) -- [pseudo-tty/test-set-raw-mode-reset-signal.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-set-raw-mode-reset-signal.js) -- [pseudo-tty/test-set-raw-mode-reset.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-set-raw-mode-reset.js) -- [pseudo-tty/test-stderr-stdout-handle-sigwinch.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js) -- [pseudo-tty/test-stdin-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-stdin-write.js) -- [pseudo-tty/test-stdout-read.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-stdout-read.js) -- [pseudo-tty/test-trace-sigint-disabled.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-trace-sigint-disabled.js) -- [pseudo-tty/test-trace-sigint-on-idle.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-trace-sigint-on-idle.js) -- [pseudo-tty/test-trace-sigint.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-trace-sigint.js) -- [pseudo-tty/test-tty-color-support.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-tty-color-support.js) -- [pseudo-tty/test-tty-isatty.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-tty-isatty.js) -- [pseudo-tty/test-tty-stdin-call-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-tty-stdin-call-end.js) -- [pseudo-tty/test-tty-stdout-resize.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-tty-stdout-resize.js) -- [pseudo-tty/test-tty-stream-constructors.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-tty-stream-constructors.js) -- [pseudo-tty/test-tty-window-size.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-tty-window-size.js) -- [pseudo-tty/test-tty-wrap.js](https://github.com/nodejs/node/tree/v18.12.1/test/pseudo-tty/test-tty-wrap.js) -- [pummel/test-child-process-spawn-loop.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-child-process-spawn-loop.js) -- [pummel/test-crypto-dh-hash.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-crypto-dh-hash.js) -- [pummel/test-crypto-dh-keys.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-crypto-dh-keys.js) -- [pummel/test-crypto-timing-safe-equal-benchmarks.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-crypto-timing-safe-equal-benchmarks.js) -- [pummel/test-dh-regr.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-dh-regr.js) -- [pummel/test-fs-largefile.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-fs-largefile.js) -- [pummel/test-fs-readfile-tostring-fail.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-fs-readfile-tostring-fail.js) -- [pummel/test-fs-watch-file-slow.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-fs-watch-file-slow.js) -- [pummel/test-fs-watch-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-fs-watch-file.js) -- [pummel/test-fs-watch-non-recursive.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-fs-watch-non-recursive.js) -- [pummel/test-fs-watch-system-limit.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-fs-watch-system-limit.js) -- [pummel/test-hash-seed.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-hash-seed.js) -- [pummel/test-heapdump-dns.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-heapdump-dns.js) -- [pummel/test-heapdump-env.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-heapdump-env.js) -- [pummel/test-heapdump-fs-promise.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-heapdump-fs-promise.js) -- [pummel/test-heapdump-http2.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-heapdump-http2.js) -- [pummel/test-heapdump-inspector.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-heapdump-inspector.js) -- [pummel/test-heapdump-shadow-realm.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-heapdump-shadow-realm.js) -- [pummel/test-heapdump-tls.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-heapdump-tls.js) -- [pummel/test-heapdump-worker.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-heapdump-worker.js) -- [pummel/test-heapdump-zlib.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-heapdump-zlib.js) -- [pummel/test-heapsnapshot-near-heap-limit-big.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-heapsnapshot-near-heap-limit-big.js) -- [pummel/test-heapsnapshot-near-heap-limit-bounded.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-heapsnapshot-near-heap-limit-bounded.js) -- [pummel/test-heapsnapshot-near-heap-limit-by-api.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-heapsnapshot-near-heap-limit-by-api.js) -- [pummel/test-heapsnapshot-near-heap-limit.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-heapsnapshot-near-heap-limit.js) -- [pummel/test-http-many-keep-alive-connections.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-http-many-keep-alive-connections.js) -- [pummel/test-http-upload-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-http-upload-timeout.js) -- [pummel/test-https-large-response.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-https-large-response.js) -- [pummel/test-https-no-reader.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-https-no-reader.js) -- [pummel/test-keep-alive.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-keep-alive.js) -- [pummel/test-net-many-clients.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-net-many-clients.js) -- [pummel/test-net-pause.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-net-pause.js) -- [pummel/test-net-pingpong-delay.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-net-pingpong-delay.js) -- [pummel/test-net-pingpong.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-net-pingpong.js) -- [pummel/test-net-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-net-timeout.js) -- [pummel/test-net-timeout2.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-net-timeout2.js) -- [pummel/test-net-write-callbacks.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-net-write-callbacks.js) -- [pummel/test-next-tick-infinite-calls.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-next-tick-infinite-calls.js) -- [pummel/test-policy-integrity-dep.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-policy-integrity-dep.js) -- [pummel/test-policy-integrity-parent-commonjs.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-policy-integrity-parent-commonjs.js) -- [pummel/test-policy-integrity-parent-module.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-policy-integrity-parent-module.js) -- [pummel/test-policy-integrity-parent-no-package-json.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-policy-integrity-parent-no-package-json.js) -- [pummel/test-policy-integrity-worker-commonjs.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-policy-integrity-worker-commonjs.js) -- [pummel/test-policy-integrity-worker-module.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-policy-integrity-worker-module.js) -- [pummel/test-policy-integrity-worker-no-package-json.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-policy-integrity-worker-no-package-json.js) -- [pummel/test-process-cpuUsage.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-process-cpuUsage.js) -- [pummel/test-process-hrtime.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-process-hrtime.js) -- [pummel/test-regress-GH-892.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-regress-GH-892.js) -- [pummel/test-stream-pipe-multi.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-stream-pipe-multi.js) -- [pummel/test-timers.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-timers.js) -- [pummel/test-tls-server-large-request.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-tls-server-large-request.js) -- [pummel/test-tls-throttle.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-tls-throttle.js) -- [pummel/test-vm-memleak.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-vm-memleak.js) -- [pummel/test-vm-race.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-vm-race.js) -- [pummel/test-watch-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-watch-file.js) -- [pummel/test-webcrypto-derivebits-pbkdf2.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-webcrypto-derivebits-pbkdf2.js) -- [pummel/test-worker-take-heapsnapshot.js](https://github.com/nodejs/node/tree/v18.12.1/test/pummel/test-worker-take-heapsnapshot.js) -- [sequential/test-async-wrap-getasyncid.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-async-wrap-getasyncid.js) -- [sequential/test-buffer-creation-regression.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-buffer-creation-regression.js) -- [sequential/test-child-process-emfile.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-child-process-emfile.js) -- [sequential/test-child-process-execsync.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-child-process-execsync.js) -- [sequential/test-child-process-pass-fd.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-child-process-pass-fd.js) -- [sequential/test-cli-syntax-bad.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cli-syntax-bad.js) -- [sequential/test-cli-syntax-file-not-found.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cli-syntax-file-not-found.js) -- [sequential/test-cli-syntax-good.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cli-syntax-good.js) -- [sequential/test-cli-syntax-require.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cli-syntax-require.js) -- [sequential/test-cluster-inspect-brk.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cluster-inspect-brk.js) -- [sequential/test-cluster-net-listen-ipv6only-none.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cluster-net-listen-ipv6only-none.js) -- [sequential/test-cluster-net-listen-ipv6only-rr.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cluster-net-listen-ipv6only-rr.js) -- [sequential/test-cluster-send-handle-large-payload.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cluster-send-handle-large-payload.js) -- [sequential/test-cpu-prof-default.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cpu-prof-default.js) -- [sequential/test-cpu-prof-dir-absolute.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cpu-prof-dir-absolute.js) -- [sequential/test-cpu-prof-dir-and-name.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cpu-prof-dir-and-name.js) -- [sequential/test-cpu-prof-dir-relative.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cpu-prof-dir-relative.js) -- [sequential/test-cpu-prof-dir-worker.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cpu-prof-dir-worker.js) -- [sequential/test-cpu-prof-drained.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cpu-prof-drained.js) -- [sequential/test-cpu-prof-exit.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cpu-prof-exit.js) -- [sequential/test-cpu-prof-invalid-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cpu-prof-invalid-options.js) -- [sequential/test-cpu-prof-kill.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cpu-prof-kill.js) -- [sequential/test-cpu-prof-name.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cpu-prof-name.js) -- [sequential/test-cpu-prof-worker-argv.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-cpu-prof-worker-argv.js) -- [sequential/test-crypto-timing-safe-equal.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-crypto-timing-safe-equal.js) -- [sequential/test-debug-prompt.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-debug-prompt.js) -- [sequential/test-debugger-custom-port.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-debugger-custom-port.js) -- [sequential/test-debugger-debug-brk.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-debugger-debug-brk.js) -- [sequential/test-debugger-invalid-args.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-debugger-invalid-args.js) -- [sequential/test-debugger-pid.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-debugger-pid.js) -- [sequential/test-deprecation-flags.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-deprecation-flags.js) -- [sequential/test-dgram-bind-shared-ports.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-dgram-bind-shared-ports.js) -- [sequential/test-dgram-implicit-bind-failure.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-dgram-implicit-bind-failure.js) -- [sequential/test-dgram-pingpong.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-dgram-pingpong.js) -- [sequential/test-diagnostic-dir-cpu-prof.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-diagnostic-dir-cpu-prof.js) -- [sequential/test-diagnostic-dir-heap-prof.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-diagnostic-dir-heap-prof.js) -- [sequential/test-fs-opendir-recursive.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-fs-opendir-recursive.js) -- [sequential/test-fs-readdir-recursive.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-fs-readdir-recursive.js) -- [sequential/test-fs-stat-sync-overflow.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-fs-stat-sync-overflow.js) -- [sequential/test-fs-watch.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-fs-watch.js) -- [sequential/test-gc-http-client-onerror.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-gc-http-client-onerror.js) -- [sequential/test-gc-http-client-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-gc-http-client-timeout.js) -- [sequential/test-gc-http-client.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-gc-http-client.js) -- [sequential/test-get-heapsnapshot-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-get-heapsnapshot-options.js) -- [sequential/test-heapdump-flag-custom-dir.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-heapdump-flag-custom-dir.js) -- [sequential/test-heapdump-flag.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-heapdump-flag.js) -- [sequential/test-heapdump.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-heapdump.js) -- [sequential/test-http-econnrefused.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-http-econnrefused.js) -- [sequential/test-http-keep-alive-large-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-http-keep-alive-large-write.js) -- [sequential/test-http-keepalive-maxsockets.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-http-keepalive-maxsockets.js) -- [sequential/test-http-max-sockets.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-http-max-sockets.js) -- [sequential/test-http-regr-gh-2928.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-http-regr-gh-2928.js) -- [sequential/test-http-server-keep-alive-timeout-slow-client-headers.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-http-server-keep-alive-timeout-slow-client-headers.js) -- [sequential/test-http-server-keep-alive-timeout-slow-server.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-http-server-keep-alive-timeout-slow-server.js) -- [sequential/test-http2-large-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-http2-large-file.js) -- [sequential/test-http2-max-session-memory.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-http2-max-session-memory.js) -- [sequential/test-http2-ping-flood.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-http2-ping-flood.js) -- [sequential/test-http2-settings-flood.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-http2-settings-flood.js) -- [sequential/test-http2-timeout-large-write-file.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-http2-timeout-large-write-file.js) -- [sequential/test-http2-timeout-large-write.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-http2-timeout-large-write.js) -- [sequential/test-https-connect-localport.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-https-connect-localport.js) -- [sequential/test-https-server-keep-alive-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-https-server-keep-alive-timeout.js) -- [sequential/test-init.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-init.js) -- [sequential/test-inspector-port-cluster.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-inspector-port-cluster.js) -- [sequential/test-module-loading.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-module-loading.js) -- [sequential/test-net-GH-5504.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-net-GH-5504.js) -- [sequential/test-net-better-error-messages-port.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-net-better-error-messages-port.js) -- [sequential/test-net-connect-econnrefused.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-net-connect-econnrefused.js) -- [sequential/test-net-connect-handle-econnrefused.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-net-connect-handle-econnrefused.js) -- [sequential/test-net-connect-local-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-net-connect-local-error.js) -- [sequential/test-net-listen-shared-ports.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-net-listen-shared-ports.js) -- [sequential/test-net-localport.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-net-localport.js) -- [sequential/test-net-reconnect-error.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-net-reconnect-error.js) -- [sequential/test-net-response-size.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-net-response-size.js) -- [sequential/test-net-server-address.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-net-server-address.js) -- [sequential/test-net-server-bind.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-net-server-bind.js) -- [sequential/test-next-tick-error-spin.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-next-tick-error-spin.js) -- [sequential/test-perf-hooks.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-perf-hooks.js) -- [sequential/test-performance-eventloopdelay.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-performance-eventloopdelay.js) -- [sequential/test-pipe.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-pipe.js) -- [sequential/test-process-title.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-process-title.js) -- [sequential/test-process-warnings.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-process-warnings.js) -- [sequential/test-repl-timeout-throw.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-repl-timeout-throw.js) -- [sequential/test-require-cache-without-stat.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-require-cache-without-stat.js) -- [sequential/test-resolution-inspect-brk.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-resolution-inspect-brk.js) -- [sequential/test-single-executable-application-disable-experimental-sea-warning.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-single-executable-application-disable-experimental-sea-warning.js) -- [sequential/test-single-executable-application-empty.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-single-executable-application-empty.js) -- [sequential/test-single-executable-application-snapshot-and-code-cache.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-single-executable-application-snapshot-and-code-cache.js) -- [sequential/test-single-executable-application-snapshot.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-single-executable-application-snapshot.js) -- [sequential/test-single-executable-application-use-code-cache.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-single-executable-application-use-code-cache.js) -- [sequential/test-single-executable-application.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-single-executable-application.js) -- [sequential/test-stream2-fs.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-stream2-fs.js) -- [sequential/test-stream2-stderr-sync.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-stream2-stderr-sync.js) -- [sequential/test-timers-block-eventloop.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-timers-block-eventloop.js) -- [sequential/test-timers-set-interval-excludes-callback-duration.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-timers-set-interval-excludes-callback-duration.js) -- [sequential/test-tls-connect.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-tls-connect.js) -- [sequential/test-tls-lookup.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-tls-lookup.js) -- [sequential/test-tls-psk-client.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-tls-psk-client.js) -- [sequential/test-tls-securepair-client.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-tls-securepair-client.js) -- [sequential/test-tls-session-timeout.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-tls-session-timeout.js) -- [sequential/test-util-debug.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-util-debug.js) -- [sequential/test-vm-break-on-sigint.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-vm-break-on-sigint.js) -- [sequential/test-vm-timeout-escape-promise-module-2.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-vm-timeout-escape-promise-module-2.js) -- [sequential/test-vm-timeout-rethrow.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-vm-timeout-rethrow.js) -- [sequential/test-worker-eventlooputil.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-worker-eventlooputil.js) -- [sequential/test-worker-fshandles-error-on-termination.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-worker-fshandles-error-on-termination.js) -- [sequential/test-worker-fshandles-open-close-on-termination.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-worker-fshandles-open-close-on-termination.js) -- [sequential/test-worker-heapsnapshot-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-worker-heapsnapshot-options.js) -- [sequential/test-worker-prof.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-worker-prof.js) -- [sequential/test-write-heapsnapshot-options.js](https://github.com/nodejs/node/tree/v18.12.1/test/sequential/test-write-heapsnapshot-options.js) +- [abort/test-abort-backtrace.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-abort-backtrace.js) +- [abort/test-abort-fatal-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-abort-fatal-error.js) +- [abort/test-abort-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-abort-uncaught-exception.js) +- [abort/test-addon-register-signal-handler.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-addon-register-signal-handler.js) +- [abort/test-addon-uv-handle-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-addon-uv-handle-leak.js) +- [abort/test-http-parser-consume.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-http-parser-consume.js) +- [abort/test-process-abort-exitcode.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-process-abort-exitcode.js) +- [abort/test-signal-handler.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-signal-handler.js) +- [abort/test-worker-abort-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-worker-abort-uncaught-exception.js) +- [abort/test-zlib-invalid-internals-usage.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-zlib-invalid-internals-usage.js) +- [benchmark/test-bechmark-readline.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-bechmark-readline.js) +- [benchmark/test-benchmark-assert.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-assert.js) +- [benchmark/test-benchmark-async-hooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-async-hooks.js) +- [benchmark/test-benchmark-blob.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-blob.js) +- [benchmark/test-benchmark-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-buffer.js) +- [benchmark/test-benchmark-child-process.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-child-process.js) +- [benchmark/test-benchmark-cluster.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-cluster.js) +- [benchmark/test-benchmark-crypto.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-crypto.js) +- [benchmark/test-benchmark-dgram.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-dgram.js) +- [benchmark/test-benchmark-dns.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-dns.js) +- [benchmark/test-benchmark-domain.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-domain.js) +- [benchmark/test-benchmark-es.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-es.js) +- [benchmark/test-benchmark-esm.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-esm.js) +- [benchmark/test-benchmark-events.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-events.js) +- [benchmark/test-benchmark-fs.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-fs.js) +- [benchmark/test-benchmark-http.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-http.js) +- [benchmark/test-benchmark-http2.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-http2.js) +- [benchmark/test-benchmark-mime.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-mime.js) +- [benchmark/test-benchmark-misc.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-misc.js) +- [benchmark/test-benchmark-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-module.js) +- [benchmark/test-benchmark-napi.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-napi.js) +- [benchmark/test-benchmark-net.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-net.js) +- [benchmark/test-benchmark-os.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-os.js) +- [benchmark/test-benchmark-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-path.js) +- [benchmark/test-benchmark-policy.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-policy.js) +- [benchmark/test-benchmark-process.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-process.js) +- [benchmark/test-benchmark-querystring.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-querystring.js) +- [benchmark/test-benchmark-streams.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-streams.js) +- [benchmark/test-benchmark-string_decoder.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-string_decoder.js) +- [benchmark/test-benchmark-timers.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-timers.js) +- [benchmark/test-benchmark-tls.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-tls.js) +- [benchmark/test-benchmark-url.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-url.js) +- [benchmark/test-benchmark-util.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-util.js) +- [benchmark/test-benchmark-v8.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-v8.js) +- [benchmark/test-benchmark-validators.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-validators.js) +- [benchmark/test-benchmark-vm.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-vm.js) +- [benchmark/test-benchmark-webstreams.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-webstreams.js) +- [benchmark/test-benchmark-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-worker.js) +- [benchmark/test-benchmark-zlib.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-zlib.js) +- [es-module/test-cjs-esm-warn.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-cjs-esm-warn.js) +- [es-module/test-cjs-legacyMainResolve-permission.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-cjs-legacyMainResolve-permission.js) +- [es-module/test-cjs-legacyMainResolve.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-cjs-legacyMainResolve.js) +- [es-module/test-cjs-prototype-pollution.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-cjs-prototype-pollution.js) +- [es-module/test-dynamic-import-script-lifetime.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-dynamic-import-script-lifetime.js) +- [es-module/test-esm-assertionless-json-import.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-assertionless-json-import.js) +- [es-module/test-esm-cjs-builtins.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-cjs-builtins.js) +- [es-module/test-esm-cjs-exports.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-cjs-exports.js) +- [es-module/test-esm-cjs-main.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-cjs-main.js) +- [es-module/test-esm-data-urls.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-data-urls.js) +- [es-module/test-esm-dynamic-import-attribute.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-dynamic-import-attribute.js) +- [es-module/test-esm-dynamic-import-commonjs.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-dynamic-import-commonjs.js) +- [es-module/test-esm-dynamic-import-mutating-fs.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-dynamic-import-mutating-fs.js) +- [es-module/test-esm-dynamic-import.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-dynamic-import.js) +- [es-module/test-esm-encoded-path-native.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-encoded-path-native.js) +- [es-module/test-esm-error-cache.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-error-cache.js) +- [es-module/test-esm-import-attributes-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-import-attributes-errors.js) +- [es-module/test-esm-import-attributes-validation.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-import-attributes-validation.js) +- [es-module/test-esm-invalid-data-urls.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-invalid-data-urls.js) +- [es-module/test-esm-invalid-pjson.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-invalid-pjson.js) +- [es-module/test-esm-loader-cache-clearing.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-loader-cache-clearing.js) +- [es-module/test-esm-loader-modulemap.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-loader-modulemap.js) +- [es-module/test-esm-loader-search.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-loader-search.js) +- [es-module/test-esm-named-exports.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-named-exports.js) +- [es-module/test-esm-preserve-symlinks-main.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-preserve-symlinks-main.js) +- [es-module/test-esm-preserve-symlinks.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-preserve-symlinks.js) +- [es-module/test-esm-repl-imports.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-repl-imports.js) +- [es-module/test-esm-repl.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-repl.js) +- [es-module/test-esm-symlink-main.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-symlink-main.js) +- [es-module/test-esm-symlink-type.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-symlink-type.js) +- [es-module/test-esm-symlink.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-symlink.js) +- [es-module/test-esm-type-field-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-type-field-errors.js) +- [es-module/test-esm-undefined-cjs-global-like-variables.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-undefined-cjs-global-like-variables.js) +- [es-module/test-esm-unknown-extension.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-unknown-extension.js) +- [es-module/test-esm-url-extname.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-url-extname.js) +- [es-module/test-esm-windows.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-windows.js) +- [es-module/test-loaders-hidden-from-users.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-loaders-hidden-from-users.js) +- [es-module/test-vm-compile-function-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-vm-compile-function-leak.js) +- [es-module/test-vm-compile-function-lineoffset.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-vm-compile-function-lineoffset.js) +- [es-module/test-vm-contextified-script-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-vm-contextified-script-leak.js) +- [es-module/test-vm-source-text-module-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-vm-source-text-module-leak.js) +- [es-module/test-vm-synthetic-module-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-vm-synthetic-module-leak.js) +- [es-module/test-wasm-memory-out-of-bound.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-wasm-memory-out-of-bound.js) +- [es-module/test-wasm-simple.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-wasm-simple.js) +- [es-module/test-wasm-web-api.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-wasm-web-api.js) +- [internet/test-corepack-yarn-install.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-corepack-yarn-install.js) +- [internet/test-dgram-broadcast-multi-process.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-dgram-broadcast-multi-process.js) +- [internet/test-dgram-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-dgram-connect.js) +- [internet/test-dgram-membership.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-dgram-membership.js) +- [internet/test-dgram-multicast-multi-process.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-dgram-multicast-multi-process.js) +- [internet/test-dgram-multicast-set-interface-lo.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-dgram-multicast-set-interface-lo.js) +- [internet/test-dgram-multicast-ssm-multi-process.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-dgram-multicast-ssm-multi-process.js) +- [internet/test-dgram-multicast-ssmv6-multi-process.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-dgram-multicast-ssmv6-multi-process.js) +- [internet/test-dns-any.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-dns-any.js) +- [internet/test-dns-cares-domains.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-dns-cares-domains.js) +- [internet/test-dns-getDefaultResultOrder.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-dns-getDefaultResultOrder.js) +- [internet/test-dns-ipv4.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-dns-ipv4.js) +- [internet/test-dns-ipv6.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-dns-ipv6.js) +- [internet/test-dns-txt-sigsegv.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-dns-txt-sigsegv.js) +- [internet/test-dns.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-dns.js) +- [internet/test-http-dns-fail.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-http-dns-fail.js) +- [internet/test-http2-issue-32922.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-http2-issue-32922.js) +- [internet/test-https-autoselectfamily-slow-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-https-autoselectfamily-slow-timeout.js) +- [internet/test-https-issue-43963.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-https-issue-43963.js) +- [internet/test-inspector-help-page.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-inspector-help-page.js) +- [internet/test-net-autoselectfamily-timeout-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-net-autoselectfamily-timeout-close.js) +- [internet/test-net-connect-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-net-connect-timeout.js) +- [internet/test-net-connect-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-net-connect-unref.js) +- [internet/test-snapshot-dns-lookup.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-snapshot-dns-lookup.js) +- [internet/test-snapshot-dns-resolve.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-snapshot-dns-resolve.js) +- [internet/test-tls-add-ca-cert.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-tls-add-ca-cert.js) +- [internet/test-tls-autoselectfamily-backing-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-tls-autoselectfamily-backing-socket.js) +- [internet/test-tls-autoselectfamily-servername.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-tls-autoselectfamily-servername.js) +- [internet/test-trace-events-dns.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-trace-events-dns.js) +- [internet/test-uv-threadpool-schedule.js](https://github.com/nodejs/node/tree/v20.11.1/test/internet/test-uv-threadpool-schedule.js) +- [known_issues/test-cli-print-var-crypto.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-cli-print-var-crypto.js) +- [known_issues/test-cwd-enoent-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-cwd-enoent-file.js) +- [known_issues/test-dgram-bind-shared-ports-after-port-0.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-dgram-bind-shared-ports-after-port-0.js) +- [known_issues/test-fs-writeFileSync-invalid-windows.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-fs-writeFileSync-invalid-windows.js) +- [known_issues/test-http-path-contains-unicode.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-http-path-contains-unicode.js) +- [known_issues/test-inspector-cluster-port-clash.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-inspector-cluster-port-clash.js) +- [known_issues/test-permission-model-path-resolution.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-permission-model-path-resolution.js) +- [known_issues/test-repl-require-context.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-repl-require-context.js) +- [known_issues/test-stdin-is-always-net.socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-stdin-is-always-net.socket.js) +- [known_issues/test-stream-writable-sync-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-stream-writable-sync-error.js) +- [known_issues/test-url-parse-conformance.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-url-parse-conformance.js) +- [known_issues/test-vm-function-declaration-uses-define.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-vm-function-declaration-uses-define.js) +- [known_issues/test-vm-ownkeys.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-vm-ownkeys.js) +- [known_issues/test-vm-ownpropertynames.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-vm-ownpropertynames.js) +- [known_issues/test-vm-ownpropertysymbols.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-vm-ownpropertysymbols.js) +- [known_issues/test-vm-timeout-escape-nexttick.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-vm-timeout-escape-nexttick.js) +- [known_issues/test-vm-timeout-escape-queuemicrotask.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-vm-timeout-escape-queuemicrotask.js) +- [message/assert_throws_stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/assert_throws_stack.js) +- [message/eval_messages.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/eval_messages.js) +- [message/internal_assert.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/internal_assert.js) +- [message/internal_assert_fail.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/internal_assert_fail.js) +- [message/max_tick_depth.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/max_tick_depth.js) +- [message/nexttick_throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/nexttick_throw.js) +- [message/stdin_messages.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/stdin_messages.js) +- [message/util-inspect-error-cause.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/util-inspect-error-cause.js) +- [message/util_inspect_error.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/util_inspect_error.js) +- [parallel/test-abortcontroller.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-abortcontroller.js) +- [parallel/test-aborted-util.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-aborted-util.js) +- [parallel/test-abortsignal-cloneable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-abortsignal-cloneable.js) +- [parallel/test-accessor-properties.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-accessor-properties.js) +- [parallel/test-arm-math-illegal-instruction.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-arm-math-illegal-instruction.js) +- [parallel/test-assert-builtins-not-read-from-filesystem.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-assert-builtins-not-read-from-filesystem.js) +- [parallel/test-assert-calltracker-calls.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-assert-calltracker-calls.js) +- [parallel/test-assert-calltracker-getCalls.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-assert-calltracker-getCalls.js) +- [parallel/test-assert-calltracker-report.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-assert-calltracker-report.js) +- [parallel/test-assert-calltracker-verify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-assert-calltracker-verify.js) +- [parallel/test-assert-checktag.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-assert-checktag.js) +- [parallel/test-assert-deep.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-assert-deep.js) +- [parallel/test-assert-esm-cjs-message-verify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-assert-esm-cjs-message-verify.js) +- [parallel/test-assert-fail-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-assert-fail-deprecation.js) +- [parallel/test-assert-first-line.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-assert-first-line.js) +- [parallel/test-assert-if-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-assert-if-error.js) +- [parallel/test-assert-typedarray-deepequal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-assert-typedarray-deepequal.js) +- [parallel/test-async-hooks-async-await.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-async-await.js) +- [parallel/test-async-hooks-asyncresource-constructor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-asyncresource-constructor.js) +- [parallel/test-async-hooks-close-during-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-close-during-destroy.js) +- [parallel/test-async-hooks-constructor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-constructor.js) +- [parallel/test-async-hooks-correctly-switch-promise-hook.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-correctly-switch-promise-hook.js) +- [parallel/test-async-hooks-destroy-on-gc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-destroy-on-gc.js) +- [parallel/test-async-hooks-disable-during-promise.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-disable-during-promise.js) +- [parallel/test-async-hooks-disable-gc-tracking.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-disable-gc-tracking.js) +- [parallel/test-async-hooks-enable-before-promise-resolve.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-enable-before-promise-resolve.js) +- [parallel/test-async-hooks-enable-disable-enable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-enable-disable-enable.js) +- [parallel/test-async-hooks-enable-disable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-enable-disable.js) +- [parallel/test-async-hooks-enable-during-promise.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-enable-during-promise.js) +- [parallel/test-async-hooks-enable-recursive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-enable-recursive.js) +- [parallel/test-async-hooks-execution-async-resource-await.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-execution-async-resource-await.js) +- [parallel/test-async-hooks-execution-async-resource.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-execution-async-resource.js) +- [parallel/test-async-hooks-fatal-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-fatal-error.js) +- [parallel/test-async-hooks-http-agent-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-http-agent-destroy.js) +- [parallel/test-async-hooks-http-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-http-agent.js) +- [parallel/test-async-hooks-http-parser-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-http-parser-destroy.js) +- [parallel/test-async-hooks-prevent-double-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-prevent-double-destroy.js) +- [parallel/test-async-hooks-promise-enable-disable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-promise-enable-disable.js) +- [parallel/test-async-hooks-promise-triggerid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-promise-triggerid.js) +- [parallel/test-async-hooks-promise.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-promise.js) +- [parallel/test-async-hooks-recursive-stack-runInAsyncScope.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-recursive-stack-runInAsyncScope.js) +- [parallel/test-async-hooks-run-in-async-scope-caught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-run-in-async-scope-caught-exception.js) +- [parallel/test-async-hooks-run-in-async-scope-this-arg.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-run-in-async-scope-this-arg.js) +- [parallel/test-async-hooks-top-level-clearimmediate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-top-level-clearimmediate.js) +- [parallel/test-async-hooks-vm-gc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-vm-gc.js) +- [parallel/test-async-hooks-worker-asyncfn-terminate-1.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-worker-asyncfn-terminate-1.js) +- [parallel/test-async-hooks-worker-asyncfn-terminate-2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-worker-asyncfn-terminate-2.js) +- [parallel/test-async-hooks-worker-asyncfn-terminate-3.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-worker-asyncfn-terminate-3.js) +- [parallel/test-async-hooks-worker-asyncfn-terminate-4.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-worker-asyncfn-terminate-4.js) +- [parallel/test-async-local-storage-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-local-storage-bind.js) +- [parallel/test-async-local-storage-contexts.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-local-storage-contexts.js) +- [parallel/test-async-local-storage-deep-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-local-storage-deep-stack.js) +- [parallel/test-async-local-storage-exit-does-not-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-local-storage-exit-does-not-leak.js) +- [parallel/test-async-local-storage-http-multiclients.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-local-storage-http-multiclients.js) +- [parallel/test-async-local-storage-snapshot.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-local-storage-snapshot.js) +- [parallel/test-async-wrap-constructor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-wrap-constructor.js) +- [parallel/test-async-wrap-destroyid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-wrap-destroyid.js) +- [parallel/test-async-wrap-pop-id-during-load.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-wrap-pop-id-during-load.js) +- [parallel/test-async-wrap-promise-after-enabled.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-wrap-promise-after-enabled.js) +- [parallel/test-async-wrap-tlssocket-asyncreset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-wrap-tlssocket-asyncreset.js) +- [parallel/test-async-wrap-trigger-id.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-wrap-trigger-id.js) +- [parallel/test-async-wrap-uncaughtexception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-wrap-uncaughtexception.js) +- [parallel/test-asyncresource-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-asyncresource-bind.js) +- [parallel/test-atomics-wake.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-atomics-wake.js) +- [parallel/test-bash-completion.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-bash-completion.js) +- [parallel/test-beforeexit-event-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-beforeexit-event-exit.js) +- [parallel/test-benchmark-cli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-benchmark-cli.js) +- [parallel/test-binding-constants.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-binding-constants.js) +- [parallel/test-blob-buffer-too-large.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-blob-buffer-too-large.js) +- [parallel/test-blob-createobjecturl.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-blob-createobjecturl.js) +- [parallel/test-blob-file-backed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-blob-file-backed.js) +- [parallel/test-blob.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-blob.js) +- [parallel/test-blocklist-clone.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-blocklist-clone.js) +- [parallel/test-bootstrap-modules.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-bootstrap-modules.js) +- [parallel/test-broadcastchannel-custom-inspect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-broadcastchannel-custom-inspect.js) +- [parallel/test-buffer-backing-arraybuffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-backing-arraybuffer.js) +- [parallel/test-buffer-compare.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-compare.js) +- [parallel/test-buffer-constructor-deprecation-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-constructor-deprecation-error.js) +- [parallel/test-buffer-constructor-node-modules-paths.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-constructor-node-modules-paths.js) +- [parallel/test-buffer-constructor-outside-node-modules.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-constructor-outside-node-modules.js) +- [parallel/test-buffer-fill.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-fill.js) +- [parallel/test-buffer-inspect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-inspect.js) +- [parallel/test-buffer-pending-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-pending-deprecation.js) +- [parallel/test-buffer-pool-untransferable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-pool-untransferable.js) +- [parallel/test-buffer-prototype-inspect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-prototype-inspect.js) +- [parallel/test-buffer-set-inspect-max-bytes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-set-inspect-max-bytes.js) +- [parallel/test-buffer-sharedarraybuffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-sharedarraybuffer.js) +- [parallel/test-buffer-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-write.js) +- [parallel/test-c-ares.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-c-ares.js) +- [parallel/test-child-process-advanced-serialization-largebuffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-advanced-serialization-largebuffer.js) +- [parallel/test-child-process-advanced-serialization.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-advanced-serialization.js) +- [parallel/test-child-process-bad-stdio.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-bad-stdio.js) +- [parallel/test-child-process-can-write-to-stdout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-can-write-to-stdout.js) +- [parallel/test-child-process-constructor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-constructor.js) +- [parallel/test-child-process-cwd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-cwd.js) +- [parallel/test-child-process-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-destroy.js) +- [parallel/test-child-process-detached.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-detached.js) +- [parallel/test-child-process-disconnect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-disconnect.js) +- [parallel/test-child-process-env.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-env.js) +- [parallel/test-child-process-exec-any-shells-windows.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-exec-any-shells-windows.js) +- [parallel/test-child-process-exec-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-exec-encoding.js) +- [parallel/test-child-process-exec-std-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-exec-std-encoding.js) +- [parallel/test-child-process-exec-timeout-expire.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-exec-timeout-expire.js) +- [parallel/test-child-process-exec-timeout-kill.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-exec-timeout-kill.js) +- [parallel/test-child-process-exec-timeout-not-expired.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-exec-timeout-not-expired.js) +- [parallel/test-child-process-execFile-promisified-abortController.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-execFile-promisified-abortController.js) +- [parallel/test-child-process-execfile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-execfile.js) +- [parallel/test-child-process-exit-code.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-exit-code.js) +- [parallel/test-child-process-fork-abort-signal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-abort-signal.js) +- [parallel/test-child-process-fork-and-spawn.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-and-spawn.js) +- [parallel/test-child-process-fork-args.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-args.js) +- [parallel/test-child-process-fork-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-close.js) +- [parallel/test-child-process-fork-closed-channel-segfault.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-closed-channel-segfault.js) +- [parallel/test-child-process-fork-detached.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-detached.js) +- [parallel/test-child-process-fork-dgram.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-dgram.js) +- [parallel/test-child-process-fork-exec-argv.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-exec-argv.js) +- [parallel/test-child-process-fork-exec-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-exec-path.js) +- [parallel/test-child-process-fork-getconnections.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-getconnections.js) +- [parallel/test-child-process-fork-net-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-net-server.js) +- [parallel/test-child-process-fork-net-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-net-socket.js) +- [parallel/test-child-process-fork-net.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-net.js) +- [parallel/test-child-process-fork-no-shell.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-no-shell.js) +- [parallel/test-child-process-fork-ref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-ref.js) +- [parallel/test-child-process-fork-ref2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-ref2.js) +- [parallel/test-child-process-fork-stdio-string-variant.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-stdio-string-variant.js) +- [parallel/test-child-process-fork-stdio.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-stdio.js) +- [parallel/test-child-process-fork-timeout-kill-signal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-timeout-kill-signal.js) +- [parallel/test-child-process-fork.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork.js) +- [parallel/test-child-process-fork3.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork3.js) +- [parallel/test-child-process-http-socket-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-http-socket-leak.js) +- [parallel/test-child-process-internal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-internal.js) +- [parallel/test-child-process-ipc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-ipc.js) +- [parallel/test-child-process-no-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-no-deprecation.js) +- [parallel/test-child-process-pipe-dataflow.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-pipe-dataflow.js) +- [parallel/test-child-process-promisified.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-promisified.js) +- [parallel/test-child-process-recv-handle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-recv-handle.js) +- [parallel/test-child-process-reject-null-bytes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-reject-null-bytes.js) +- [parallel/test-child-process-send-after-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-send-after-close.js) +- [parallel/test-child-process-send-cb.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-send-cb.js) +- [parallel/test-child-process-send-keep-open.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-send-keep-open.js) +- [parallel/test-child-process-send-returns-boolean.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-send-returns-boolean.js) +- [parallel/test-child-process-send-type-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-send-type-error.js) +- [parallel/test-child-process-send-utf8.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-send-utf8.js) +- [parallel/test-child-process-server-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-server-close.js) +- [parallel/test-child-process-silent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-silent.js) +- [parallel/test-child-process-spawn-argv0.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawn-argv0.js) +- [parallel/test-child-process-spawn-controller.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawn-controller.js) +- [parallel/test-child-process-spawn-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawn-error.js) +- [parallel/test-child-process-spawn-shell.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawn-shell.js) +- [parallel/test-child-process-spawn-timeout-kill-signal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawn-timeout-kill-signal.js) +- [parallel/test-child-process-spawn-typeerror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawn-typeerror.js) +- [parallel/test-child-process-spawnsync-env.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawnsync-env.js) +- [parallel/test-child-process-spawnsync-input.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawnsync-input.js) +- [parallel/test-child-process-spawnsync-kill-signal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawnsync-kill-signal.js) +- [parallel/test-child-process-spawnsync-shell.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawnsync-shell.js) +- [parallel/test-child-process-spawnsync-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawnsync-timeout.js) +- [parallel/test-child-process-stdin-ipc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdin-ipc.js) +- [parallel/test-child-process-stdin.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdin.js) +- [parallel/test-child-process-stdio-big-write-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio-big-write-end.js) +- [parallel/test-child-process-stdio-inherit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio-inherit.js) +- [parallel/test-child-process-stdio-merge-stdouts-into-cat.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio-merge-stdouts-into-cat.js) +- [parallel/test-child-process-stdio-overlapped.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio-overlapped.js) +- [parallel/test-child-process-stdio-reuse-readable-stdio.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio-reuse-readable-stdio.js) +- [parallel/test-child-process-stdio.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio.js) +- [parallel/test-child-process-stdout-flush-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdout-flush-exit.js) +- [parallel/test-child-process-stdout-flush.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdout-flush.js) +- [parallel/test-child-process-stdout-ipc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdout-ipc.js) +- [parallel/test-child-process-uid-gid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-uid-gid.js) +- [parallel/test-child-process-validate-stdio.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-validate-stdio.js) +- [parallel/test-child-process-windows-hide.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-windows-hide.js) +- [parallel/test-cli-bad-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cli-bad-options.js) +- [parallel/test-cli-eval-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cli-eval-event.js) +- [parallel/test-cli-eval.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cli-eval.js) +- [parallel/test-cli-node-options-disallowed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cli-node-options-disallowed.js) +- [parallel/test-cli-node-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cli-node-options.js) +- [parallel/test-cli-node-print-help.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cli-node-print-help.js) +- [parallel/test-cli-options-negation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cli-options-negation.js) +- [parallel/test-cli-options-precedence.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cli-options-precedence.js) +- [parallel/test-cli-permission-deny-fs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cli-permission-deny-fs.js) +- [parallel/test-cli-permission-multiple-allow.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cli-permission-multiple-allow.js) +- [parallel/test-cli-syntax-eval.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cli-syntax-eval.js) +- [parallel/test-cli-syntax-piped-bad.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cli-syntax-piped-bad.js) +- [parallel/test-cli-syntax-piped-good.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cli-syntax-piped-good.js) +- [parallel/test-client-request-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-client-request-destroy.js) +- [parallel/test-cluster-accept-fail.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-accept-fail.js) +- [parallel/test-cluster-advanced-serialization.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-advanced-serialization.js) +- [parallel/test-cluster-basic.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-basic.js) +- [parallel/test-cluster-bind-privileged-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-bind-privileged-port.js) +- [parallel/test-cluster-bind-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-bind-twice.js) +- [parallel/test-cluster-call-and-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-call-and-destroy.js) +- [parallel/test-cluster-child-index-dgram.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-child-index-dgram.js) +- [parallel/test-cluster-child-index-net.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-child-index-net.js) +- [parallel/test-cluster-concurrent-disconnect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-concurrent-disconnect.js) +- [parallel/test-cluster-cwd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-cwd.js) +- [parallel/test-cluster-dgram-1.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-dgram-1.js) +- [parallel/test-cluster-dgram-2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-dgram-2.js) +- [parallel/test-cluster-dgram-bind-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-dgram-bind-fd.js) +- [parallel/test-cluster-dgram-ipv6only.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-dgram-ipv6only.js) +- [parallel/test-cluster-dgram-reuse.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-dgram-reuse.js) +- [parallel/test-cluster-disconnect-before-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-disconnect-before-exit.js) +- [parallel/test-cluster-disconnect-exitedAfterDisconnect-race.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-disconnect-exitedAfterDisconnect-race.js) +- [parallel/test-cluster-disconnect-idle-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-disconnect-idle-worker.js) +- [parallel/test-cluster-disconnect-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-disconnect-leak.js) +- [parallel/test-cluster-disconnect-race.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-disconnect-race.js) +- [parallel/test-cluster-disconnect-unshared-tcp.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-disconnect-unshared-tcp.js) +- [parallel/test-cluster-disconnect-unshared-udp.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-disconnect-unshared-udp.js) +- [parallel/test-cluster-disconnect-with-no-workers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-disconnect-with-no-workers.js) +- [parallel/test-cluster-disconnect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-disconnect.js) +- [parallel/test-cluster-eaccess.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-eaccess.js) +- [parallel/test-cluster-eaddrinuse.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-eaddrinuse.js) +- [parallel/test-cluster-fork-env.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-fork-env.js) +- [parallel/test-cluster-fork-stdio.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-fork-stdio.js) +- [parallel/test-cluster-fork-windowsHide.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-fork-windowsHide.js) +- [parallel/test-cluster-http-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-http-pipe.js) +- [parallel/test-cluster-invalid-message.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-invalid-message.js) +- [parallel/test-cluster-ipc-throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-ipc-throw.js) +- [parallel/test-cluster-kill-disconnect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-kill-disconnect.js) +- [parallel/test-cluster-kill-infinite-loop.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-kill-infinite-loop.js) +- [parallel/test-cluster-listen-pipe-readable-writable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-listen-pipe-readable-writable.js) +- [parallel/test-cluster-listening-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-listening-port.js) +- [parallel/test-cluster-message.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-message.js) +- [parallel/test-cluster-net-listen-backlog.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-net-listen-backlog.js) +- [parallel/test-cluster-net-listen-ipv6only-false.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-net-listen-ipv6only-false.js) +- [parallel/test-cluster-net-listen-relative-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-net-listen-relative-path.js) +- [parallel/test-cluster-net-listen.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-net-listen.js) +- [parallel/test-cluster-net-send.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-net-send.js) +- [parallel/test-cluster-net-server-drop-connection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-net-server-drop-connection.js) +- [parallel/test-cluster-primary-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-primary-error.js) +- [parallel/test-cluster-primary-kill.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-primary-kill.js) +- [parallel/test-cluster-process-disconnect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-process-disconnect.js) +- [parallel/test-cluster-rr-domain-listen.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-rr-domain-listen.js) +- [parallel/test-cluster-rr-handle-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-rr-handle-close.js) +- [parallel/test-cluster-rr-handle-keep-loop-alive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-rr-handle-keep-loop-alive.js) +- [parallel/test-cluster-rr-handle-ref-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-rr-handle-ref-unref.js) +- [parallel/test-cluster-rr-ref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-rr-ref.js) +- [parallel/test-cluster-send-deadlock.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-send-deadlock.js) +- [parallel/test-cluster-send-handle-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-send-handle-twice.js) +- [parallel/test-cluster-send-socket-to-worker-http-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-send-socket-to-worker-http-server.js) +- [parallel/test-cluster-server-restart-none.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-server-restart-none.js) +- [parallel/test-cluster-server-restart-rr.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-server-restart-rr.js) +- [parallel/test-cluster-setup-primary-argv.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-setup-primary-argv.js) +- [parallel/test-cluster-setup-primary-cumulative.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-setup-primary-cumulative.js) +- [parallel/test-cluster-setup-primary-emit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-setup-primary-emit.js) +- [parallel/test-cluster-setup-primary-multiple.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-setup-primary-multiple.js) +- [parallel/test-cluster-setup-primary.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-setup-primary.js) +- [parallel/test-cluster-shared-handle-bind-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-shared-handle-bind-error.js) +- [parallel/test-cluster-shared-handle-bind-privileged-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-shared-handle-bind-privileged-port.js) +- [parallel/test-cluster-shared-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-shared-leak.js) +- [parallel/test-cluster-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-uncaught-exception.js) +- [parallel/test-cluster-worker-constructor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-constructor.js) +- [parallel/test-cluster-worker-death.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-death.js) +- [parallel/test-cluster-worker-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-destroy.js) +- [parallel/test-cluster-worker-disconnect-on-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-disconnect-on-error.js) +- [parallel/test-cluster-worker-disconnect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-disconnect.js) +- [parallel/test-cluster-worker-events.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-events.js) +- [parallel/test-cluster-worker-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-exit.js) +- [parallel/test-cluster-worker-forced-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-forced-exit.js) +- [parallel/test-cluster-worker-handle-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-handle-close.js) +- [parallel/test-cluster-worker-init.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-init.js) +- [parallel/test-cluster-worker-isconnected.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-isconnected.js) +- [parallel/test-cluster-worker-isdead.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-isdead.js) +- [parallel/test-cluster-worker-kill-signal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-kill-signal.js) +- [parallel/test-cluster-worker-kill.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-kill.js) +- [parallel/test-cluster-worker-no-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-no-exit.js) +- [parallel/test-cluster-worker-wait-server-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-wait-server-close.js) +- [parallel/test-code-cache.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-code-cache.js) +- [parallel/test-common-countdown.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-common-countdown.js) +- [parallel/test-common-expect-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-common-expect-warning.js) +- [parallel/test-common-gc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-common-gc.js) +- [parallel/test-common-must-not-call.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-common-must-not-call.js) +- [parallel/test-common.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-common.js) +- [parallel/test-console-assign-undefined.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-assign-undefined.js) +- [parallel/test-console-clear.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-clear.js) +- [parallel/test-console-count.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-count.js) +- [parallel/test-console-formatTime.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-formatTime.js) +- [parallel/test-console-instance.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-instance.js) +- [parallel/test-console-issue-43095.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-issue-43095.js) +- [parallel/test-console-methods.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-methods.js) +- [parallel/test-console-not-call-toString.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-not-call-toString.js) +- [parallel/test-console-self-assign.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-self-assign.js) +- [parallel/test-console-stdio-setters.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-stdio-setters.js) +- [parallel/test-console.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console.js) +- [parallel/test-constants.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-constants.js) +- [parallel/test-corepack-version.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-corepack-version.js) +- [parallel/test-coverage-with-inspector-disabled.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-coverage-with-inspector-disabled.js) +- [parallel/test-crypto-aes-wrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-aes-wrap.js) +- [parallel/test-crypto-async-sign-verify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-async-sign-verify.js) +- [parallel/test-crypto-authenticated-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-authenticated-stream.js) +- [parallel/test-crypto-authenticated.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-authenticated.js) +- [parallel/test-crypto-certificate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-certificate.js) +- [parallel/test-crypto-cipher-decipher.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-cipher-decipher.js) +- [parallel/test-crypto-cipheriv-decipheriv.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-cipheriv-decipheriv.js) +- [parallel/test-crypto-classes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-classes.js) +- [parallel/test-crypto-des3-wrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-des3-wrap.js) +- [parallel/test-crypto-dh-constructor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-constructor.js) +- [parallel/test-crypto-dh-curves.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-curves.js) +- [parallel/test-crypto-dh-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-errors.js) +- [parallel/test-crypto-dh-generate-keys.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-generate-keys.js) +- [parallel/test-crypto-dh-group-setters.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-group-setters.js) +- [parallel/test-crypto-dh-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-leak.js) +- [parallel/test-crypto-dh-modp2-views.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-modp2-views.js) +- [parallel/test-crypto-dh-modp2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-modp2.js) +- [parallel/test-crypto-dh-odd-key.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-odd-key.js) +- [parallel/test-crypto-dh-padding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-padding.js) +- [parallel/test-crypto-dh-stateless.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-stateless.js) +- [parallel/test-crypto-domain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-domain.js) +- [parallel/test-crypto-domains.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-domains.js) +- [parallel/test-crypto-ecb.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-ecb.js) +- [parallel/test-crypto-ecdh-convert-key.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-ecdh-convert-key.js) +- [parallel/test-crypto-encoding-validation-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-encoding-validation-error.js) +- [parallel/test-crypto-fips.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-fips.js) +- [parallel/test-crypto-from-binary.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-from-binary.js) +- [parallel/test-crypto-getcipherinfo.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-getcipherinfo.js) +- [parallel/test-crypto-hash-stream-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-hash-stream-pipe.js) +- [parallel/test-crypto-key-objects-messageport.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-key-objects-messageport.js) +- [parallel/test-crypto-key-objects.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-key-objects.js) +- [parallel/test-crypto-keygen-async-dsa-key-object.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-async-dsa-key-object.js) +- [parallel/test-crypto-keygen-async-dsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-async-dsa.js) +- [parallel/test-crypto-keygen-async-elliptic-curve-jwk-ec.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-async-elliptic-curve-jwk-ec.js) +- [parallel/test-crypto-keygen-async-elliptic-curve-jwk-rsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-async-elliptic-curve-jwk-rsa.js) +- [parallel/test-crypto-keygen-async-elliptic-curve-jwk.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-async-elliptic-curve-jwk.js) +- [parallel/test-crypto-keygen-async-encrypted-private-key-der.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-async-encrypted-private-key-der.js) +- [parallel/test-crypto-keygen-async-encrypted-private-key.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-async-encrypted-private-key.js) +- [parallel/test-crypto-keygen-async-explicit-elliptic-curve-encrypted-p256.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-async-explicit-elliptic-curve-encrypted-p256.js) +- [parallel/test-crypto-keygen-async-explicit-elliptic-curve-encrypted.js.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-async-explicit-elliptic-curve-encrypted.js.js) +- [parallel/test-crypto-keygen-async-explicit-elliptic-curve.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-async-explicit-elliptic-curve.js) +- [parallel/test-crypto-keygen-async-named-elliptic-curve-encrypted-p256.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-async-named-elliptic-curve-encrypted-p256.js) +- [parallel/test-crypto-keygen-async-named-elliptic-curve-encrypted.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-async-named-elliptic-curve-encrypted.js) +- [parallel/test-crypto-keygen-async-named-elliptic-curve.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-async-named-elliptic-curve.js) +- [parallel/test-crypto-keygen-async-rsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-async-rsa.js) +- [parallel/test-crypto-keygen-bit-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-bit-length.js) +- [parallel/test-crypto-keygen-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-deprecation.js) +- [parallel/test-crypto-keygen-dh-classic.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-dh-classic.js) +- [parallel/test-crypto-keygen-duplicate-deprecated-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-duplicate-deprecated-option.js) +- [parallel/test-crypto-keygen-eddsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-eddsa.js) +- [parallel/test-crypto-keygen-empty-passphrase-no-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-empty-passphrase-no-error.js) +- [parallel/test-crypto-keygen-empty-passphrase-no-prompt.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-empty-passphrase-no-prompt.js) +- [parallel/test-crypto-keygen-invalid-parameter-encoding-dsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-invalid-parameter-encoding-dsa.js) +- [parallel/test-crypto-keygen-invalid-parameter-encoding-ec.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-invalid-parameter-encoding-ec.js) +- [parallel/test-crypto-keygen-key-object-without-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-key-object-without-encoding.js) +- [parallel/test-crypto-keygen-key-objects.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-key-objects.js) +- [parallel/test-crypto-keygen-missing-oid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-missing-oid.js) +- [parallel/test-crypto-keygen-no-rsassa-pss-params.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-no-rsassa-pss-params.js) +- [parallel/test-crypto-keygen-non-standard-public-exponent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-non-standard-public-exponent.js) +- [parallel/test-crypto-keygen-promisify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-promisify.js) +- [parallel/test-crypto-keygen-rfc8017-9-1.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-rfc8017-9-1.js) +- [parallel/test-crypto-keygen-rfc8017-a-2-3.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-rfc8017-a-2-3.js) +- [parallel/test-crypto-keygen-rsa-pss.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-rsa-pss.js) +- [parallel/test-crypto-keygen-sync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-sync.js) +- [parallel/test-crypto-keygen.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen.js) +- [parallel/test-crypto-lazy-transform-writable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-lazy-transform-writable.js) +- [parallel/test-crypto-no-algorithm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-no-algorithm.js) +- [parallel/test-crypto-op-during-process-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-op-during-process-exit.js) +- [parallel/test-crypto-padding-aes256.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-padding-aes256.js) +- [parallel/test-crypto-padding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-padding.js) +- [parallel/test-crypto-private-decrypt-gh32240.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-private-decrypt-gh32240.js) +- [parallel/test-crypto-psychic-signatures.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-psychic-signatures.js) +- [parallel/test-crypto-publicDecrypt-fails-first-time.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-publicDecrypt-fails-first-time.js) +- [parallel/test-crypto-random.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-random.js) +- [parallel/test-crypto-randomfillsync-regression.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-randomfillsync-regression.js) +- [parallel/test-crypto-randomuuid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-randomuuid.js) +- [parallel/test-crypto-rsa-dsa-revert.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-rsa-dsa-revert.js) +- [parallel/test-crypto-rsa-dsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-rsa-dsa.js) +- [parallel/test-crypto-scrypt.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-scrypt.js) +- [parallel/test-crypto-secure-heap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-secure-heap.js) +- [parallel/test-crypto-sign-verify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-sign-verify.js) +- [parallel/test-crypto-subtle-zero-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-subtle-zero-length.js) +- [parallel/test-crypto-verify-failure.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-verify-failure.js) +- [parallel/test-crypto-webcrypto-aes-decrypt-tag-too-small.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-webcrypto-aes-decrypt-tag-too-small.js) +- [parallel/test-crypto-worker-thread.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-worker-thread.js) +- [parallel/test-crypto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto.js) +- [parallel/test-cwd-enoent-preload.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cwd-enoent-preload.js) +- [parallel/test-cwd-enoent-repl.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cwd-enoent-repl.js) +- [parallel/test-cwd-enoent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cwd-enoent.js) +- [parallel/test-datetime-change-notify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-datetime-change-notify.js) +- [parallel/test-debugger-backtrace.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-backtrace.js) +- [parallel/test-debugger-break.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-break.js) +- [parallel/test-debugger-breakpoint-exists.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-breakpoint-exists.js) +- [parallel/test-debugger-clear-breakpoints.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-clear-breakpoints.js) +- [parallel/test-debugger-exceptions.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-exceptions.js) +- [parallel/test-debugger-exec.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-exec.js) +- [parallel/test-debugger-heap-profiler.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-heap-profiler.js) +- [parallel/test-debugger-list.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-list.js) +- [parallel/test-debugger-low-level.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-low-level.js) +- [parallel/test-debugger-object-type-remote-object.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-object-type-remote-object.js) +- [parallel/test-debugger-pid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-pid.js) +- [parallel/test-debugger-preserve-breaks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-preserve-breaks.js) +- [parallel/test-debugger-profile-command.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-profile-command.js) +- [parallel/test-debugger-profile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-profile.js) +- [parallel/test-debugger-random-port-with-inspect-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-random-port-with-inspect-port.js) +- [parallel/test-debugger-random-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-random-port.js) +- [parallel/test-debugger-repeat-last.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-repeat-last.js) +- [parallel/test-debugger-restart-message.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-restart-message.js) +- [parallel/test-debugger-run-after-quit-restart.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-run-after-quit-restart.js) +- [parallel/test-debugger-sb-before-load.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-sb-before-load.js) +- [parallel/test-debugger-scripts.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-scripts.js) +- [parallel/test-debugger-unavailable-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-unavailable-port.js) +- [parallel/test-debugger-use-strict.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-use-strict.js) +- [parallel/test-debugger-watch-validation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-watch-validation.js) +- [parallel/test-debugger-websocket-secret-mismatch.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-websocket-secret-mismatch.js) +- [parallel/test-delayed-require.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-delayed-require.js) +- [parallel/test-dgram-abort-closed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-abort-closed.js) +- [parallel/test-dgram-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-address.js) +- [parallel/test-dgram-bind-default-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-bind-default-address.js) +- [parallel/test-dgram-bind-error-repeat.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-bind-error-repeat.js) +- [parallel/test-dgram-bind-fd-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-bind-fd-error.js) +- [parallel/test-dgram-bind-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-bind-fd.js) +- [parallel/test-dgram-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-bind.js) +- [parallel/test-dgram-bytes-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-bytes-length.js) +- [parallel/test-dgram-close-in-listening.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-close-in-listening.js) +- [parallel/test-dgram-close-is-not-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-close-is-not-callback.js) +- [parallel/test-dgram-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-close.js) +- [parallel/test-dgram-cluster-bind-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-cluster-bind-error.js) +- [parallel/test-dgram-cluster-close-during-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-cluster-close-during-bind.js) +- [parallel/test-dgram-cluster-close-in-listening.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-cluster-close-in-listening.js) +- [parallel/test-dgram-connect-send-callback-buffer-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-callback-buffer-length.js) +- [parallel/test-dgram-connect-send-callback-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-callback-buffer.js) +- [parallel/test-dgram-connect-send-callback-multi-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-callback-multi-buffer.js) +- [parallel/test-dgram-connect-send-default-host.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-default-host.js) +- [parallel/test-dgram-connect-send-empty-array.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-empty-array.js) +- [parallel/test-dgram-connect-send-empty-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-empty-buffer.js) +- [parallel/test-dgram-connect-send-empty-packet.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-empty-packet.js) +- [parallel/test-dgram-connect-send-multi-buffer-copy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-multi-buffer-copy.js) +- [parallel/test-dgram-connect-send-multi-string-array.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-multi-string-array.js) +- [parallel/test-dgram-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect.js) +- [parallel/test-dgram-create-socket-handle-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-create-socket-handle-fd.js) +- [parallel/test-dgram-create-socket-handle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-create-socket-handle.js) +- [parallel/test-dgram-createSocket-type.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-createSocket-type.js) +- [parallel/test-dgram-custom-lookup.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-custom-lookup.js) +- [parallel/test-dgram-deprecation-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-deprecation-error.js) +- [parallel/test-dgram-error-message-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-error-message-address.js) +- [parallel/test-dgram-exclusive-implicit-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-exclusive-implicit-bind.js) +- [parallel/test-dgram-implicit-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-implicit-bind.js) +- [parallel/test-dgram-ipv6only.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-ipv6only.js) +- [parallel/test-dgram-listen-after-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-listen-after-bind.js) +- [parallel/test-dgram-membership.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-membership.js) +- [parallel/test-dgram-msgsize.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-msgsize.js) +- [parallel/test-dgram-multicast-loopback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-multicast-loopback.js) +- [parallel/test-dgram-multicast-set-interface.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-multicast-set-interface.js) +- [parallel/test-dgram-multicast-setTTL.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-multicast-setTTL.js) +- [parallel/test-dgram-oob-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-oob-buffer.js) +- [parallel/test-dgram-recv-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-recv-error.js) +- [parallel/test-dgram-ref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-ref.js) +- [parallel/test-dgram-send-address-types.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-address-types.js) +- [parallel/test-dgram-send-bad-arguments.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-bad-arguments.js) +- [parallel/test-dgram-send-callback-buffer-empty-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-callback-buffer-empty-address.js) +- [parallel/test-dgram-send-callback-buffer-length-empty-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-callback-buffer-length-empty-address.js) +- [parallel/test-dgram-send-callback-buffer-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-callback-buffer-length.js) +- [parallel/test-dgram-send-callback-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-callback-buffer.js) +- [parallel/test-dgram-send-callback-multi-buffer-empty-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-callback-multi-buffer-empty-address.js) +- [parallel/test-dgram-send-callback-multi-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-callback-multi-buffer.js) +- [parallel/test-dgram-send-callback-recursive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-callback-recursive.js) +- [parallel/test-dgram-send-cb-quelches-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-cb-quelches-error.js) +- [parallel/test-dgram-send-default-host.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-default-host.js) +- [parallel/test-dgram-send-empty-array.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-empty-array.js) +- [parallel/test-dgram-send-empty-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-empty-buffer.js) +- [parallel/test-dgram-send-empty-packet.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-empty-packet.js) +- [parallel/test-dgram-send-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-error.js) +- [parallel/test-dgram-send-invalid-msg-type.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-invalid-msg-type.js) +- [parallel/test-dgram-send-multi-buffer-copy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-multi-buffer-copy.js) +- [parallel/test-dgram-send-multi-string-array.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-multi-string-array.js) +- [parallel/test-dgram-send-queue-info.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-queue-info.js) +- [parallel/test-dgram-sendto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-sendto.js) +- [parallel/test-dgram-setBroadcast.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-setBroadcast.js) +- [parallel/test-dgram-setTTL.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-setTTL.js) +- [parallel/test-dgram-socket-buffer-size.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-socket-buffer-size.js) +- [parallel/test-dgram-udp4.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-udp4.js) +- [parallel/test-dgram-udp6-link-local-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-udp6-link-local-address.js) +- [parallel/test-dgram-udp6-send-default-host.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-udp6-send-default-host.js) +- [parallel/test-dgram-unref-in-cluster.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-unref-in-cluster.js) +- [parallel/test-dgram-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-unref.js) +- [parallel/test-diagnostics-channel-bind-store.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-bind-store.js) +- [parallel/test-diagnostics-channel-http-server-start.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-http-server-start.js) +- [parallel/test-diagnostics-channel-http.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-http.js) +- [parallel/test-diagnostics-channel-memory-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-memory-leak.js) +- [parallel/test-diagnostics-channel-process.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-process.js) +- [parallel/test-diagnostics-channel-safe-subscriber-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-safe-subscriber-errors.js) +- [parallel/test-diagnostics-channel-tracing-channel-async-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-tracing-channel-async-error.js) +- [parallel/test-diagnostics-channel-tracing-channel-async.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-tracing-channel-async.js) +- [parallel/test-diagnostics-channel-tracing-channel-run-stores.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-tracing-channel-run-stores.js) +- [parallel/test-diagnostics-channel-worker-threads.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-worker-threads.js) +- [parallel/test-directory-import.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-directory-import.js) +- [parallel/test-disable-proto-delete.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-disable-proto-delete.js) +- [parallel/test-disable-proto-throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-disable-proto-throw.js) +- [parallel/test-dns-cancel-reverse-lookup.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-cancel-reverse-lookup.js) +- [parallel/test-dns-channel-cancel-promise.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-channel-cancel-promise.js) +- [parallel/test-dns-channel-cancel.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-channel-cancel.js) +- [parallel/test-dns-channel-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-channel-timeout.js) +- [parallel/test-dns-default-verbatim-false.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-default-verbatim-false.js) +- [parallel/test-dns-default-verbatim-true.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-default-verbatim-true.js) +- [parallel/test-dns-get-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-get-server.js) +- [parallel/test-dns-lookup-promises-options-deprecated.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-lookup-promises-options-deprecated.js) +- [parallel/test-dns-lookup-promises.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-lookup-promises.js) +- [parallel/test-dns-lookupService-promises.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-lookupService-promises.js) +- [parallel/test-dns-lookupService.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-lookupService.js) +- [parallel/test-dns-multi-channel.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-multi-channel.js) +- [parallel/test-dns-perf_hooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-perf_hooks.js) +- [parallel/test-dns-resolve-promises.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-resolve-promises.js) +- [parallel/test-dns-resolveany-bad-ancount.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-resolveany-bad-ancount.js) +- [parallel/test-dns-resolveany.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-resolveany.js) +- [parallel/test-dns-set-default-order.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-set-default-order.js) +- [parallel/test-dns-setlocaladdress.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-setlocaladdress.js) +- [parallel/test-dns-setserver-when-querying.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-setserver-when-querying.js) +- [parallel/test-dns.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns.js) +- [parallel/test-domain-abort-on-uncaught.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-abort-on-uncaught.js) +- [parallel/test-domain-add-remove.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-add-remove.js) +- [parallel/test-domain-async-id-map-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-async-id-map-leak.js) +- [parallel/test-domain-bind-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-bind-timeout.js) +- [parallel/test-domain-crypto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-crypto.js) +- [parallel/test-domain-dep0097.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-dep0097.js) +- [parallel/test-domain-ee-error-listener.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-ee-error-listener.js) +- [parallel/test-domain-ee-implicit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-ee-implicit.js) +- [parallel/test-domain-ee.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-ee.js) +- [parallel/test-domain-emit-error-handler-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-emit-error-handler-stack.js) +- [parallel/test-domain-enter-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-enter-exit.js) +- [parallel/test-domain-error-types.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-error-types.js) +- [parallel/test-domain-from-timer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-from-timer.js) +- [parallel/test-domain-fs-enoent-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-fs-enoent-stream.js) +- [parallel/test-domain-http-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-http-server.js) +- [parallel/test-domain-implicit-binding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-implicit-binding.js) +- [parallel/test-domain-implicit-fs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-implicit-fs.js) +- [parallel/test-domain-intercept.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-intercept.js) +- [parallel/test-domain-load-after-set-uncaught-exception-capture.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-load-after-set-uncaught-exception-capture.js) +- [parallel/test-domain-multi.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-multi.js) +- [parallel/test-domain-multiple-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-multiple-errors.js) +- [parallel/test-domain-nested-throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-nested-throw.js) +- [parallel/test-domain-nested.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-nested.js) +- [parallel/test-domain-nexttick.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-nexttick.js) +- [parallel/test-domain-no-error-handler-abort-on-uncaught-0.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-0.js) +- [parallel/test-domain-no-error-handler-abort-on-uncaught-1.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-1.js) +- [parallel/test-domain-no-error-handler-abort-on-uncaught-2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-2.js) +- [parallel/test-domain-no-error-handler-abort-on-uncaught-3.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-3.js) +- [parallel/test-domain-no-error-handler-abort-on-uncaught-4.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-4.js) +- [parallel/test-domain-no-error-handler-abort-on-uncaught-5.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-5.js) +- [parallel/test-domain-no-error-handler-abort-on-uncaught-6.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-6.js) +- [parallel/test-domain-no-error-handler-abort-on-uncaught-7.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-7.js) +- [parallel/test-domain-no-error-handler-abort-on-uncaught-8.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-8.js) +- [parallel/test-domain-no-error-handler-abort-on-uncaught-9.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-9.js) +- [parallel/test-domain-promise.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-promise.js) +- [parallel/test-domain-run.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-run.js) +- [parallel/test-domain-safe-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-safe-exit.js) +- [parallel/test-domain-set-uncaught-exception-capture-after-load.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-set-uncaught-exception-capture-after-load.js) +- [parallel/test-domain-stack-empty-in-process-uncaughtexception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-stack-empty-in-process-uncaughtexception.js) +- [parallel/test-domain-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-stack.js) +- [parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js) +- [parallel/test-domain-thrown-error-handler-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-thrown-error-handler-stack.js) +- [parallel/test-domain-timer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-timer.js) +- [parallel/test-domain-timers-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-timers-uncaught-exception.js) +- [parallel/test-domain-timers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-timers.js) +- [parallel/test-domain-top-level-error-handler-clears-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-top-level-error-handler-clears-stack.js) +- [parallel/test-domain-top-level-error-handler-throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-top-level-error-handler-throw.js) +- [parallel/test-domain-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-uncaught-exception.js) +- [parallel/test-domain-vm-promise-isolation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-vm-promise-isolation.js) +- [parallel/test-domain-with-abort-on-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-with-abort-on-uncaught-exception.js) +- [parallel/test-domexception-cause.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domexception-cause.js) +- [parallel/test-dotenv-edge-cases.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dotenv-edge-cases.js) +- [parallel/test-dotenv-node-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dotenv-node-options.js) +- [parallel/test-dotenv.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dotenv.js) +- [parallel/test-double-tls-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-double-tls-client.js) +- [parallel/test-double-tls-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-double-tls-server.js) +- [parallel/test-dsa-fips-invalid-key.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dsa-fips-invalid-key.js) +- [parallel/test-dummy-stdio.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dummy-stdio.js) +- [parallel/test-emit-after-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-emit-after-uncaught-exception.js) +- [parallel/test-env-newprotomethod-remove-unnecessary-prototypes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-env-newprotomethod-remove-unnecessary-prototypes.js) +- [parallel/test-env-var-no-warnings.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-env-var-no-warnings.js) +- [parallel/test-err-name-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-err-name-deprecation.js) +- [parallel/test-error-aggregateTwoErrors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-error-aggregateTwoErrors.js) +- [parallel/test-error-format-list.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-error-format-list.js) +- [parallel/test-error-prepare-stack-trace.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-error-prepare-stack-trace.js) +- [parallel/test-error-reporting.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-error-reporting.js) +- [parallel/test-error-serdes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-error-serdes.js) +- [parallel/test-errors-aborterror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-errors-aborterror.js) +- [parallel/test-errors-systemerror-frozen-intrinsics.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-errors-systemerror-frozen-intrinsics.js) +- [parallel/test-errors-systemerror-stackTraceLimit-custom-setter.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-errors-systemerror-stackTraceLimit-custom-setter.js) +- [parallel/test-errors-systemerror-stackTraceLimit-deleted-and-Error-sealed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-errors-systemerror-stackTraceLimit-deleted-and-Error-sealed.js) +- [parallel/test-errors-systemerror-stackTraceLimit-deleted.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-errors-systemerror-stackTraceLimit-deleted.js) +- [parallel/test-errors-systemerror-stackTraceLimit-has-only-a-getter.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-errors-systemerror-stackTraceLimit-has-only-a-getter.js) +- [parallel/test-errors-systemerror-stackTraceLimit-not-writable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-errors-systemerror-stackTraceLimit-not-writable.js) +- [parallel/test-errors-systemerror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-errors-systemerror.js) +- [parallel/test-eslint-alphabetize-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-alphabetize-errors.js) +- [parallel/test-eslint-async-iife-no-unused-result.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-async-iife-no-unused-result.js) +- [parallel/test-eslint-avoid-prototype-pollution.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-avoid-prototype-pollution.js) +- [parallel/test-eslint-crypto-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-crypto-check.js) +- [parallel/test-eslint-documented-deprecation-codes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-documented-deprecation-codes.js) +- [parallel/test-eslint-documented-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-documented-errors.js) +- [parallel/test-eslint-duplicate-requires.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-duplicate-requires.js) +- [parallel/test-eslint-eslint-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-eslint-check.js) +- [parallel/test-eslint-inspector-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-inspector-check.js) +- [parallel/test-eslint-lowercase-name-for-primitive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-lowercase-name-for-primitive.js) +- [parallel/test-eslint-no-array-destructuring.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-no-array-destructuring.js) +- [parallel/test-eslint-no-unescaped-regexp-dot.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-no-unescaped-regexp-dot.js) +- [parallel/test-eslint-non-ascii-character.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-non-ascii-character.js) +- [parallel/test-eslint-prefer-assert-iferror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-prefer-assert-iferror.js) +- [parallel/test-eslint-prefer-assert-methods.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-prefer-assert-methods.js) +- [parallel/test-eslint-prefer-common-mustnotcall.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-prefer-common-mustnotcall.js) +- [parallel/test-eslint-prefer-common-mustsucceed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-prefer-common-mustsucceed.js) +- [parallel/test-eslint-prefer-primordials.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-prefer-primordials.js) +- [parallel/test-eslint-prefer-proto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-prefer-proto.js) +- [parallel/test-eslint-prefer-util-format-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-prefer-util-format-errors.js) +- [parallel/test-eslint-require-common-first.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-require-common-first.js) +- [parallel/test-eslint-required-modules.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-required-modules.js) +- [parallel/test-eval-disallow-code-generation-from-strings.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eval-disallow-code-generation-from-strings.js) +- [parallel/test-event-capture-rejections.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-event-capture-rejections.js) +- [parallel/test-event-emitter-check-listener-leaks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-event-emitter-check-listener-leaks.js) +- [parallel/test-event-emitter-max-listeners-warning-for-null.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-event-emitter-max-listeners-warning-for-null.js) +- [parallel/test-event-emitter-max-listeners-warning-for-symbol.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-event-emitter-max-listeners-warning-for-symbol.js) +- [parallel/test-event-emitter-max-listeners-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-event-emitter-max-listeners-warning.js) +- [parallel/test-event-target.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-event-target.js) +- [parallel/test-eventemitter-asyncresource.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eventemitter-asyncresource.js) +- [parallel/test-events-customevent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-events-customevent.js) +- [parallel/test-events-getmaxlisteners.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-events-getmaxlisteners.js) +- [parallel/test-events-listener-count-with-listener.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-events-listener-count-with-listener.js) +- [parallel/test-events-static-geteventlisteners.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-events-static-geteventlisteners.js) +- [parallel/test-eventtarget-memoryleakwarning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eventtarget-memoryleakwarning.js) +- [parallel/test-eventtarget-once-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eventtarget-once-twice.js) +- [parallel/test-eventtarget.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eventtarget.js) +- [parallel/test-experimental-shared-value-conveyor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-experimental-shared-value-conveyor.js) +- [parallel/test-file-validate-mode-flag.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-file-validate-mode-flag.js) +- [parallel/test-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-file.js) +- [parallel/test-filehandle-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-filehandle-close.js) +- [parallel/test-filehandle-readablestream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-filehandle-readablestream.js) +- [parallel/test-fixed-queue.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fixed-queue.js) +- [parallel/test-force-repl-with-eval.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-force-repl-with-eval.js) +- [parallel/test-force-repl.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-force-repl.js) +- [parallel/test-freelist.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-freelist.js) +- [parallel/test-freeze-intrinsics.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-freeze-intrinsics.js) +- [parallel/test-fs-append-file-flush.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-append-file-flush.js) +- [parallel/test-fs-assert-encoding-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-assert-encoding-error.js) +- [parallel/test-fs-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-buffer.js) +- [parallel/test-fs-buffertype-writesync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-buffertype-writesync.js) +- [parallel/test-fs-close-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-close-errors.js) +- [parallel/test-fs-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-close.js) +- [parallel/test-fs-constants.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-constants.js) +- [parallel/test-fs-copyfile-respect-permissions.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-copyfile-respect-permissions.js) +- [parallel/test-fs-error-messages.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-error-messages.js) +- [parallel/test-fs-exists.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-exists.js) +- [parallel/test-fs-existssync-false.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-existssync-false.js) +- [parallel/test-fs-fchmod.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-fchmod.js) +- [parallel/test-fs-fchown.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-fchown.js) +- [parallel/test-fs-filehandle-use-after-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-filehandle-use-after-close.js) +- [parallel/test-fs-filehandle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-filehandle.js) +- [parallel/test-fs-fmap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-fmap.js) +- [parallel/test-fs-fsync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-fsync.js) +- [parallel/test-fs-lchmod.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-lchmod.js) +- [parallel/test-fs-link.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-link.js) +- [parallel/test-fs-long-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-long-path.js) +- [parallel/test-fs-make-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-make-callback.js) +- [parallel/test-fs-makeStatsCallback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-makeStatsCallback.js) +- [parallel/test-fs-mkdir-mode-mask.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-mkdir-mode-mask.js) +- [parallel/test-fs-mkdir-recursive-eaccess.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-mkdir-recursive-eaccess.js) +- [parallel/test-fs-mkdir-rmdir.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-mkdir-rmdir.js) +- [parallel/test-fs-mkdtemp-prefix-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-mkdtemp-prefix-check.js) +- [parallel/test-fs-mkdtemp.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-mkdtemp.js) +- [parallel/test-fs-non-number-arguments-throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-non-number-arguments-throw.js) +- [parallel/test-fs-null-bytes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-null-bytes.js) +- [parallel/test-fs-options-immutable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-options-immutable.js) +- [parallel/test-fs-promises-exists.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-exists.js) +- [parallel/test-fs-promises-file-handle-aggregate-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-aggregate-errors.js) +- [parallel/test-fs-promises-file-handle-append-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-append-file.js) +- [parallel/test-fs-promises-file-handle-chmod.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-chmod.js) +- [parallel/test-fs-promises-file-handle-close-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-close-errors.js) +- [parallel/test-fs-promises-file-handle-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-close.js) +- [parallel/test-fs-promises-file-handle-dispose.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-dispose.js) +- [parallel/test-fs-promises-file-handle-op-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-op-errors.js) +- [parallel/test-fs-promises-file-handle-read-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-read-worker.js) +- [parallel/test-fs-promises-file-handle-read.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-read.js) +- [parallel/test-fs-promises-file-handle-readFile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-readFile.js) +- [parallel/test-fs-promises-file-handle-stat.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-stat.js) +- [parallel/test-fs-promises-file-handle-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-stream.js) +- [parallel/test-fs-promises-file-handle-sync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-sync.js) +- [parallel/test-fs-promises-file-handle-truncate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-truncate.js) +- [parallel/test-fs-promises-file-handle-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-write.js) +- [parallel/test-fs-promises-file-handle-writeFile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-writeFile.js) +- [parallel/test-fs-promises-readfile-empty.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-readfile-empty.js) +- [parallel/test-fs-promises-readfile-with-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-readfile-with-fd.js) +- [parallel/test-fs-promises-readfile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-readfile.js) +- [parallel/test-fs-promises-watch.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-watch.js) +- [parallel/test-fs-promises-write-optional-params.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-write-optional-params.js) +- [parallel/test-fs-promises-writefile-typedarray.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-writefile-typedarray.js) +- [parallel/test-fs-promises-writefile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-writefile.js) +- [parallel/test-fs-promises.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises.js) +- [parallel/test-fs-promisified.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promisified.js) +- [parallel/test-fs-read-empty-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-empty-buffer.js) +- [parallel/test-fs-read-file-assert-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-file-assert-encoding.js) +- [parallel/test-fs-read-file-sync-hostname.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-file-sync-hostname.js) +- [parallel/test-fs-read-file-sync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-file-sync.js) +- [parallel/test-fs-read-offset-null.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-offset-null.js) +- [parallel/test-fs-read-optional-params.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-optional-params.js) +- [parallel/test-fs-read-promises-optional-params.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-promises-optional-params.js) +- [parallel/test-fs-read-stream-err.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-stream-err.js) +- [parallel/test-fs-read-stream-fd-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-stream-fd-leak.js) +- [parallel/test-fs-read-stream-file-handle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-stream-file-handle.js) +- [parallel/test-fs-read-stream-pos.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-stream-pos.js) +- [parallel/test-fs-readSync-optional-params.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readSync-optional-params.js) +- [parallel/test-fs-readdir-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readdir-buffer.js) +- [parallel/test-fs-readdir-types.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readdir-types.js) +- [parallel/test-fs-readdir-ucs2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readdir-ucs2.js) +- [parallel/test-fs-readfile-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-error.js) +- [parallel/test-fs-readfile-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-fd.js) +- [parallel/test-fs-readfile-flags.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-flags.js) +- [parallel/test-fs-readfile-pipe-large.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-pipe-large.js) +- [parallel/test-fs-readfile-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-pipe.js) +- [parallel/test-fs-readfile-unlink.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-unlink.js) +- [parallel/test-fs-readfile-zero-byte-liar.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-zero-byte-liar.js) +- [parallel/test-fs-readfile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile.js) +- [parallel/test-fs-readfilesync-enoent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfilesync-enoent.js) +- [parallel/test-fs-readfilesync-pipe-large.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfilesync-pipe-large.js) +- [parallel/test-fs-readlink-type-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readlink-type-check.js) +- [parallel/test-fs-readv-promises.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readv-promises.js) +- [parallel/test-fs-readv-promisify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readv-promisify.js) +- [parallel/test-fs-ready-event-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-ready-event-stream.js) +- [parallel/test-fs-realpath-buffer-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-realpath-buffer-encoding.js) +- [parallel/test-fs-realpath-on-substed-drive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-realpath-on-substed-drive.js) +- [parallel/test-fs-realpath-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-realpath-pipe.js) +- [parallel/test-fs-realpath.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-realpath.js) +- [parallel/test-fs-rename-type-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-rename-type-check.js) +- [parallel/test-fs-rm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-rm.js) +- [parallel/test-fs-sir-writes-alot.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-sir-writes-alot.js) +- [parallel/test-fs-stat-bigint.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stat-bigint.js) +- [parallel/test-fs-stat.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stat.js) +- [parallel/test-fs-statfs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-statfs.js) +- [parallel/test-fs-stream-construct-compat-error-read.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stream-construct-compat-error-read.js) +- [parallel/test-fs-stream-construct-compat-error-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stream-construct-compat-error-write.js) +- [parallel/test-fs-stream-construct-compat-graceful-fs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stream-construct-compat-graceful-fs.js) +- [parallel/test-fs-stream-construct-compat-old-node.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stream-construct-compat-old-node.js) +- [parallel/test-fs-stream-destroy-emit-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stream-destroy-emit-error.js) +- [parallel/test-fs-stream-double-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stream-double-close.js) +- [parallel/test-fs-stream-fs-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stream-fs-options.js) +- [parallel/test-fs-stream-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stream-options.js) +- [parallel/test-fs-symlink-buffer-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-symlink-buffer-path.js) +- [parallel/test-fs-symlink-dir-junction-relative.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-symlink-dir-junction-relative.js) +- [parallel/test-fs-symlink-dir-junction.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-symlink-dir-junction.js) +- [parallel/test-fs-symlink-dir.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-symlink-dir.js) +- [parallel/test-fs-symlink-longpath.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-symlink-longpath.js) +- [parallel/test-fs-symlink.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-symlink.js) +- [parallel/test-fs-sync-fd-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-sync-fd-leak.js) +- [parallel/test-fs-syncwritestream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-syncwritestream.js) +- [parallel/test-fs-timestamp-parsing-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-timestamp-parsing-error.js) +- [parallel/test-fs-truncate-clear-file-zero.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-truncate-clear-file-zero.js) +- [parallel/test-fs-truncate-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-truncate-fd.js) +- [parallel/test-fs-truncate-sync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-truncate-sync.js) +- [parallel/test-fs-truncate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-truncate.js) +- [parallel/test-fs-unlink-type-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-unlink-type-check.js) +- [parallel/test-fs-util-validateoffsetlength.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-util-validateoffsetlength.js) +- [parallel/test-fs-utils-get-dirents.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-utils-get-dirents.js) +- [parallel/test-fs-utimes-y2K38.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-utimes-y2K38.js) +- [parallel/test-fs-watch-abort-signal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-abort-signal.js) +- [parallel/test-fs-watch-close-when-destroyed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-close-when-destroyed.js) +- [parallel/test-fs-watch-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-encoding.js) +- [parallel/test-fs-watch-enoent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-enoent.js) +- [parallel/test-fs-watch-file-enoent-after-deletion.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-file-enoent-after-deletion.js) +- [parallel/test-fs-watch-recursive-add-file-to-existing-subfolder.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-add-file-to-existing-subfolder.js) +- [parallel/test-fs-watch-recursive-add-file-to-new-folder.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-add-file-to-new-folder.js) +- [parallel/test-fs-watch-recursive-add-file-with-url.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-add-file-with-url.js) +- [parallel/test-fs-watch-recursive-add-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-add-file.js) +- [parallel/test-fs-watch-recursive-add-folder.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-add-folder.js) +- [parallel/test-fs-watch-recursive-assert-leaks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-assert-leaks.js) +- [parallel/test-fs-watch-recursive-promise.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-promise.js) +- [parallel/test-fs-watch-recursive-symlink.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-symlink.js) +- [parallel/test-fs-watch-recursive-update-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-update-file.js) +- [parallel/test-fs-watch-recursive-validate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-validate.js) +- [parallel/test-fs-watch-recursive-watch-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-watch-file.js) +- [parallel/test-fs-watch-ref-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-ref-unref.js) +- [parallel/test-fs-watch-stop-async.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-stop-async.js) +- [parallel/test-fs-watch-stop-sync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-stop-sync.js) +- [parallel/test-fs-watch.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch.js) +- [parallel/test-fs-watchfile-bigint.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watchfile-bigint.js) +- [parallel/test-fs-watchfile-ref-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watchfile-ref-unref.js) +- [parallel/test-fs-whatwg-url.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-whatwg-url.js) +- [parallel/test-fs-write-buffer-large.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-buffer-large.js) +- [parallel/test-fs-write-file-flush.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-file-flush.js) +- [parallel/test-fs-write-file-typedarrays.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-file-typedarrays.js) +- [parallel/test-fs-write-negativeoffset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-negativeoffset.js) +- [parallel/test-fs-write-optional-params.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-optional-params.js) +- [parallel/test-fs-write-reuse-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-reuse-callback.js) +- [parallel/test-fs-write-sigxfsz.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-sigxfsz.js) +- [parallel/test-fs-write-stream-change-open.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-stream-change-open.js) +- [parallel/test-fs-write-stream-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-stream-encoding.js) +- [parallel/test-fs-write-stream-err.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-stream-err.js) +- [parallel/test-fs-write-stream-file-handle-2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-stream-file-handle-2.js) +- [parallel/test-fs-write-stream-file-handle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-stream-file-handle.js) +- [parallel/test-fs-write-stream-flush.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-stream-flush.js) +- [parallel/test-fs-write-stream-patch-open.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-stream-patch-open.js) +- [parallel/test-fs-write-sync-optional-params.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-sync-optional-params.js) +- [parallel/test-fs-writefile-with-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-writefile-with-fd.js) +- [parallel/test-fs-writev-promises.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-writev-promises.js) +- [parallel/test-fs-writev.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-writev.js) +- [parallel/test-gc-http-client-connaborted.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-gc-http-client-connaborted.js) +- [parallel/test-gc-net-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-gc-net-timeout.js) +- [parallel/test-gc-tls-external-memory.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-gc-tls-external-memory.js) +- [parallel/test-global-console-exists.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-console-exists.js) +- [parallel/test-global-customevent-disabled.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-customevent-disabled.js) +- [parallel/test-global-customevent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-customevent.js) +- [parallel/test-global-domexception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-domexception.js) +- [parallel/test-global-encoder.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-encoder.js) +- [parallel/test-global-setters.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-setters.js) +- [parallel/test-global-webcrypto-classes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-webcrypto-classes.js) +- [parallel/test-global-webcrypto-disbled.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-webcrypto-disbled.js) +- [parallel/test-global-webcrypto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-webcrypto.js) +- [parallel/test-global-webstreams.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-webstreams.js) +- [parallel/test-global.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global.js) +- [parallel/test-h2-large-header-cause-client-to-hangup.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-h2-large-header-cause-client-to-hangup.js) +- [parallel/test-handle-wrap-hasref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-handle-wrap-hasref.js) +- [parallel/test-heap-prof-basic.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-heap-prof-basic.js) +- [parallel/test-heap-prof-dir-absolute.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-heap-prof-dir-absolute.js) +- [parallel/test-heap-prof-dir-name.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-heap-prof-dir-name.js) +- [parallel/test-heap-prof-dir-relative.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-heap-prof-dir-relative.js) +- [parallel/test-heap-prof-exec-argv.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-heap-prof-exec-argv.js) +- [parallel/test-heap-prof-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-heap-prof-exit.js) +- [parallel/test-heap-prof-interval.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-heap-prof-interval.js) +- [parallel/test-heap-prof-invalid-args.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-heap-prof-invalid-args.js) +- [parallel/test-heap-prof-loop-drained.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-heap-prof-loop-drained.js) +- [parallel/test-heap-prof-name.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-heap-prof-name.js) +- [parallel/test-heap-prof-sigint.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-heap-prof-sigint.js) +- [parallel/test-heapdump-async-hooks-init-promise.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-heapdump-async-hooks-init-promise.js) +- [parallel/test-heapsnapshot-near-heap-limit-by-api-in-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-heapsnapshot-near-heap-limit-by-api-in-worker.js) +- [parallel/test-heapsnapshot-near-heap-limit-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-heapsnapshot-near-heap-limit-worker.js) +- [parallel/test-http-1.0-keep-alive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-1.0-keep-alive.js) +- [parallel/test-http-1.0.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-1.0.js) +- [parallel/test-http-abort-before-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-abort-before-end.js) +- [parallel/test-http-abort-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-abort-client.js) +- [parallel/test-http-abort-queued.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-abort-queued.js) +- [parallel/test-http-abort-stream-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-abort-stream-end.js) +- [parallel/test-http-aborted.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-aborted.js) +- [parallel/test-http-addrequest-localaddress.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-addrequest-localaddress.js) +- [parallel/test-http-after-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-after-connect.js) +- [parallel/test-http-agent-abort-controller.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-abort-controller.js) +- [parallel/test-http-agent-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-close.js) +- [parallel/test-http-agent-destroyed-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-destroyed-socket.js) +- [parallel/test-http-agent-domain-reused-gc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-domain-reused-gc.js) +- [parallel/test-http-agent-error-on-idle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-error-on-idle.js) +- [parallel/test-http-agent-false.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-false.js) +- [parallel/test-http-agent-keepalive-delay.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-keepalive-delay.js) +- [parallel/test-http-agent-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-keepalive.js) +- [parallel/test-http-agent-maxsockets-respected.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-maxsockets-respected.js) +- [parallel/test-http-agent-maxsockets.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-maxsockets.js) +- [parallel/test-http-agent-maxtotalsockets.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-maxtotalsockets.js) +- [parallel/test-http-agent-no-protocol.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-no-protocol.js) +- [parallel/test-http-agent-null.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-null.js) +- [parallel/test-http-agent-remove.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-remove.js) +- [parallel/test-http-agent-reuse-drained-socket-only.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-reuse-drained-socket-only.js) +- [parallel/test-http-agent-scheduling.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-scheduling.js) +- [parallel/test-http-agent-timeout-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-timeout-option.js) +- [parallel/test-http-agent-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-timeout.js) +- [parallel/test-http-agent-uninitialized-with-handle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-uninitialized-with-handle.js) +- [parallel/test-http-agent-uninitialized.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-uninitialized.js) +- [parallel/test-http-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent.js) +- [parallel/test-http-allow-content-length-304.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-allow-content-length-304.js) +- [parallel/test-http-allow-req-after-204-res.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-allow-req-after-204-res.js) +- [parallel/test-http-automatic-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-automatic-headers.js) +- [parallel/test-http-autoselectfamily.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-autoselectfamily.js) +- [parallel/test-http-bind-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-bind-twice.js) +- [parallel/test-http-blank-header.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-blank-header.js) +- [parallel/test-http-buffer-sanity.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-buffer-sanity.js) +- [parallel/test-http-byteswritten.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-byteswritten.js) +- [parallel/test-http-catch-uncaughtexception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-catch-uncaughtexception.js) +- [parallel/test-http-chunk-extensions-limit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-chunk-extensions-limit.js) +- [parallel/test-http-chunk-problem.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-chunk-problem.js) +- [parallel/test-http-chunked-304.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-chunked-304.js) +- [parallel/test-http-chunked-smuggling.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-chunked-smuggling.js) +- [parallel/test-http-chunked.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-chunked.js) +- [parallel/test-http-client-abort-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort-destroy.js) +- [parallel/test-http-client-abort-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort-event.js) +- [parallel/test-http-client-abort-keep-alive-destroy-res.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort-keep-alive-destroy-res.js) +- [parallel/test-http-client-abort-keep-alive-queued-tcp-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort-keep-alive-queued-tcp-socket.js) +- [parallel/test-http-client-abort-keep-alive-queued-unix-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort-keep-alive-queued-unix-socket.js) +- [parallel/test-http-client-abort-no-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort-no-agent.js) +- [parallel/test-http-client-abort-response-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort-response-event.js) +- [parallel/test-http-client-abort-unix-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort-unix-socket.js) +- [parallel/test-http-client-abort.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort.js) +- [parallel/test-http-client-abort2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort2.js) +- [parallel/test-http-client-abort3.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort3.js) +- [parallel/test-http-client-aborted-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-aborted-event.js) +- [parallel/test-http-client-agent-abort-close-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-agent-abort-close-event.js) +- [parallel/test-http-client-agent-end-close-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-agent-end-close-event.js) +- [parallel/test-http-client-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-agent.js) +- [parallel/test-http-client-check-http-token.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-check-http-token.js) +- [parallel/test-http-client-close-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-close-event.js) +- [parallel/test-http-client-close-with-default-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-close-with-default-agent.js) +- [parallel/test-http-client-default-headers-exist.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-default-headers-exist.js) +- [parallel/test-http-client-defaults.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-defaults.js) +- [parallel/test-http-client-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-encoding.js) +- [parallel/test-http-client-error-rawbytes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-error-rawbytes.js) +- [parallel/test-http-client-finished.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-finished.js) +- [parallel/test-http-client-headers-array.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-headers-array.js) +- [parallel/test-http-client-headers-host-array.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-headers-host-array.js) +- [parallel/test-http-client-immediate-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-immediate-error.js) +- [parallel/test-http-client-incomingmessage-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-incomingmessage-destroy.js) +- [parallel/test-http-client-invalid-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-invalid-path.js) +- [parallel/test-http-client-keep-alive-hint.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-keep-alive-hint.js) +- [parallel/test-http-client-keep-alive-release-before-finish.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-keep-alive-release-before-finish.js) +- [parallel/test-http-client-override-global-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-override-global-agent.js) +- [parallel/test-http-client-parse-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-parse-error.js) +- [parallel/test-http-client-pipe-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-pipe-end.js) +- [parallel/test-http-client-race-2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-race-2.js) +- [parallel/test-http-client-race.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-race.js) +- [parallel/test-http-client-readable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-readable.js) +- [parallel/test-http-client-reject-chunked-with-content-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-reject-chunked-with-content-length.js) +- [parallel/test-http-client-reject-cr-no-lf.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-reject-cr-no-lf.js) +- [parallel/test-http-client-reject-unexpected-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-reject-unexpected-agent.js) +- [parallel/test-http-client-req-error-dont-double-fire.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-req-error-dont-double-fire.js) +- [parallel/test-http-client-request-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-request-options.js) +- [parallel/test-http-client-res-destroyed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-res-destroyed.js) +- [parallel/test-http-client-response-domain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-response-domain.js) +- [parallel/test-http-client-response-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-response-timeout.js) +- [parallel/test-http-client-set-timeout-after-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-set-timeout-after-end.js) +- [parallel/test-http-client-set-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-set-timeout.js) +- [parallel/test-http-client-spurious-aborted.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-spurious-aborted.js) +- [parallel/test-http-client-timeout-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout-agent.js) +- [parallel/test-http-client-timeout-connect-listener.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout-connect-listener.js) +- [parallel/test-http-client-timeout-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout-event.js) +- [parallel/test-http-client-timeout-on-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout-on-connect.js) +- [parallel/test-http-client-timeout-option-listeners.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout-option-listeners.js) +- [parallel/test-http-client-timeout-option-with-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout-option-with-agent.js) +- [parallel/test-http-client-timeout-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout-option.js) +- [parallel/test-http-client-timeout-with-data.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout-with-data.js) +- [parallel/test-http-client-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout.js) +- [parallel/test-http-client-unescaped-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-unescaped-path.js) +- [parallel/test-http-client-upload-buf.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-upload-buf.js) +- [parallel/test-http-client-upload.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-upload.js) +- [parallel/test-http-common.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-common.js) +- [parallel/test-http-conn-reset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-conn-reset.js) +- [parallel/test-http-connect-req-res.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-connect-req-res.js) +- [parallel/test-http-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-connect.js) +- [parallel/test-http-content-length-mismatch.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-content-length-mismatch.js) +- [parallel/test-http-content-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-content-length.js) +- [parallel/test-http-contentLength0.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-contentLength0.js) +- [parallel/test-http-correct-hostname.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-correct-hostname.js) +- [parallel/test-http-createConnection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-createConnection.js) +- [parallel/test-http-date-header.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-date-header.js) +- [parallel/test-http-debug.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-debug.js) +- [parallel/test-http-decoded-auth.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-decoded-auth.js) +- [parallel/test-http-default-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-default-encoding.js) +- [parallel/test-http-default-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-default-port.js) +- [parallel/test-http-destroyed-socket-write2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-destroyed-socket-write2.js) +- [parallel/test-http-dns-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-dns-error.js) +- [parallel/test-http-double-content-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-double-content-length.js) +- [parallel/test-http-dump-req-when-res-ends.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-dump-req-when-res-ends.js) +- [parallel/test-http-early-hints-invalid-argument.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-early-hints-invalid-argument.js) +- [parallel/test-http-early-hints.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-early-hints.js) +- [parallel/test-http-end-throw-socket-handling.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-end-throw-socket-handling.js) +- [parallel/test-http-eof-on-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-eof-on-connect.js) +- [parallel/test-http-exceptions.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-exceptions.js) +- [parallel/test-http-expect-continue.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-expect-continue.js) +- [parallel/test-http-expect-handling.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-expect-handling.js) +- [parallel/test-http-extra-response.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-extra-response.js) +- [parallel/test-http-flush-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-flush-headers.js) +- [parallel/test-http-flush-response-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-flush-response-headers.js) +- [parallel/test-http-full-response.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-full-response.js) +- [parallel/test-http-generic-streams.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-generic-streams.js) +- [parallel/test-http-get-pipeline-problem.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-get-pipeline-problem.js) +- [parallel/test-http-head-request.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-head-request.js) +- [parallel/test-http-head-response-has-no-body-end-implicit-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-head-response-has-no-body-end-implicit-headers.js) +- [parallel/test-http-head-response-has-no-body-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-head-response-has-no-body-end.js) +- [parallel/test-http-head-response-has-no-body.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-head-response-has-no-body.js) +- [parallel/test-http-head-throw-on-response-body-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-head-throw-on-response-body-write.js) +- [parallel/test-http-header-badrequest.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-header-badrequest.js) +- [parallel/test-http-header-obstext.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-header-obstext.js) +- [parallel/test-http-header-overflow.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-header-overflow.js) +- [parallel/test-http-header-owstext.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-header-owstext.js) +- [parallel/test-http-header-read.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-header-read.js) +- [parallel/test-http-hex-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-hex-write.js) +- [parallel/test-http-highwatermark.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-highwatermark.js) +- [parallel/test-http-host-header-ipv6-fail.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-host-header-ipv6-fail.js) +- [parallel/test-http-host-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-host-headers.js) +- [parallel/test-http-hostname-typechecking.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-hostname-typechecking.js) +- [parallel/test-http-incoming-matchKnownFields.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-incoming-matchKnownFields.js) +- [parallel/test-http-incoming-message-connection-setter.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-incoming-message-connection-setter.js) +- [parallel/test-http-incoming-message-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-incoming-message-destroy.js) +- [parallel/test-http-incoming-message-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-incoming-message-options.js) +- [parallel/test-http-incoming-pipelined-socket-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-incoming-pipelined-socket-destroy.js) +- [parallel/test-http-information-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-information-headers.js) +- [parallel/test-http-information-processing.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-information-processing.js) +- [parallel/test-http-insecure-parser-per-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-insecure-parser-per-stream.js) +- [parallel/test-http-insecure-parser.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-insecure-parser.js) +- [parallel/test-http-invalid-path-chars.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-invalid-path-chars.js) +- [parallel/test-http-invalid-te.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-invalid-te.js) +- [parallel/test-http-invalid-urls.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-invalid-urls.js) +- [parallel/test-http-invalidheaderfield.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-invalidheaderfield.js) +- [parallel/test-http-invalidheaderfield2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-invalidheaderfield2.js) +- [parallel/test-http-keep-alive-close-on-header.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keep-alive-close-on-header.js) +- [parallel/test-http-keep-alive-drop-requests.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keep-alive-drop-requests.js) +- [parallel/test-http-keep-alive-max-requests.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keep-alive-max-requests.js) +- [parallel/test-http-keep-alive-pipeline-max-requests.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keep-alive-pipeline-max-requests.js) +- [parallel/test-http-keep-alive-timeout-custom.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keep-alive-timeout-custom.js) +- [parallel/test-http-keep-alive-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keep-alive-timeout.js) +- [parallel/test-http-keep-alive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keep-alive.js) +- [parallel/test-http-keepalive-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keepalive-client.js) +- [parallel/test-http-keepalive-free.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keepalive-free.js) +- [parallel/test-http-keepalive-override.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keepalive-override.js) +- [parallel/test-http-keepalive-request.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keepalive-request.js) +- [parallel/test-http-listening.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-listening.js) +- [parallel/test-http-localaddress-bind-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-localaddress-bind-error.js) +- [parallel/test-http-malformed-request.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-malformed-request.js) +- [parallel/test-http-many-ended-pipelines.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-many-ended-pipelines.js) +- [parallel/test-http-max-header-size-per-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-max-header-size-per-stream.js) +- [parallel/test-http-max-header-size.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-max-header-size.js) +- [parallel/test-http-max-headers-count.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-max-headers-count.js) +- [parallel/test-http-max-http-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-max-http-headers.js) +- [parallel/test-http-methods.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-methods.js) +- [parallel/test-http-missing-header-separator-cr.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-missing-header-separator-cr.js) +- [parallel/test-http-missing-header-separator-lf.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-missing-header-separator-lf.js) +- [parallel/test-http-multi-line-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-multi-line-headers.js) +- [parallel/test-http-multiple-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-multiple-headers.js) +- [parallel/test-http-mutable-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-mutable-headers.js) +- [parallel/test-http-no-content-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-no-content-length.js) +- [parallel/test-http-no-read-no-dump.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-no-read-no-dump.js) +- [parallel/test-http-nodelay.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-nodelay.js) +- [parallel/test-http-outgoing-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-buffer.js) +- [parallel/test-http-outgoing-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-destroy.js) +- [parallel/test-http-outgoing-destroyed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-destroyed.js) +- [parallel/test-http-outgoing-end-cork.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-end-cork.js) +- [parallel/test-http-outgoing-end-multiple.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-end-multiple.js) +- [parallel/test-http-outgoing-end-types.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-end-types.js) +- [parallel/test-http-outgoing-finish-writable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-finish-writable.js) +- [parallel/test-http-outgoing-finish.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-finish.js) +- [parallel/test-http-outgoing-finished.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-finished.js) +- [parallel/test-http-outgoing-first-chunk-singlebyte-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-first-chunk-singlebyte-encoding.js) +- [parallel/test-http-outgoing-message-capture-rejection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-message-capture-rejection.js) +- [parallel/test-http-outgoing-message-inheritance.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-message-inheritance.js) +- [parallel/test-http-outgoing-message-write-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-message-write-callback.js) +- [parallel/test-http-outgoing-properties.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-properties.js) +- [parallel/test-http-outgoing-proto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-proto.js) +- [parallel/test-http-outgoing-writableFinished.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-writableFinished.js) +- [parallel/test-http-outgoing-write-types.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-write-types.js) +- [parallel/test-http-parser-bad-ref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser-bad-ref.js) +- [parallel/test-http-parser-finish-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser-finish-error.js) +- [parallel/test-http-parser-free.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser-free.js) +- [parallel/test-http-parser-freed-before-upgrade.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser-freed-before-upgrade.js) +- [parallel/test-http-parser-lazy-loaded.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser-lazy-loaded.js) +- [parallel/test-http-parser-memory-retention.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser-memory-retention.js) +- [parallel/test-http-parser-multiple-execute.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser-multiple-execute.js) +- [parallel/test-http-parser-timeout-reset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser-timeout-reset.js) +- [parallel/test-http-parser.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser.js) +- [parallel/test-http-pause-no-dump.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-pause-no-dump.js) +- [parallel/test-http-pause-resume-one-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-pause-resume-one-end.js) +- [parallel/test-http-pause.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-pause.js) +- [parallel/test-http-perf_hooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-perf_hooks.js) +- [parallel/test-http-pipe-fs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-pipe-fs.js) +- [parallel/test-http-pipeline-assertionerror-finish.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-pipeline-assertionerror-finish.js) +- [parallel/test-http-pipeline-flood.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-pipeline-flood.js) +- [parallel/test-http-pipeline-requests-connection-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-pipeline-requests-connection-leak.js) +- [parallel/test-http-pipeline-socket-parser-typeerror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-pipeline-socket-parser-typeerror.js) +- [parallel/test-http-proxy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-proxy.js) +- [parallel/test-http-raw-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-raw-headers.js) +- [parallel/test-http-readable-data-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-readable-data-event.js) +- [parallel/test-http-remove-connection-header-persists-connection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-remove-connection-header-persists-connection.js) +- [parallel/test-http-remove-header-stays-removed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-remove-header-stays-removed.js) +- [parallel/test-http-req-close-robust-from-tampering.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-req-close-robust-from-tampering.js) +- [parallel/test-http-req-res-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-req-res-close.js) +- [parallel/test-http-request-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-agent.js) +- [parallel/test-http-request-arguments.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-arguments.js) +- [parallel/test-http-request-dont-override-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-dont-override-options.js) +- [parallel/test-http-request-end-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-end-twice.js) +- [parallel/test-http-request-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-end.js) +- [parallel/test-http-request-host-header.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-host-header.js) +- [parallel/test-http-request-invalid-method-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-invalid-method-error.js) +- [parallel/test-http-request-join-authorization-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-join-authorization-headers.js) +- [parallel/test-http-request-large-payload.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-large-payload.js) +- [parallel/test-http-request-methods.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-methods.js) +- [parallel/test-http-request-smuggling-content-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-smuggling-content-length.js) +- [parallel/test-http-res-write-after-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-res-write-after-end.js) +- [parallel/test-http-res-write-end-dont-take-array.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-res-write-end-dont-take-array.js) +- [parallel/test-http-response-add-header-after-sent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-add-header-after-sent.js) +- [parallel/test-http-response-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-close.js) +- [parallel/test-http-response-cork.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-cork.js) +- [parallel/test-http-response-multi-content-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-multi-content-length.js) +- [parallel/test-http-response-multiheaders.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-multiheaders.js) +- [parallel/test-http-response-no-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-no-headers.js) +- [parallel/test-http-response-readable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-readable.js) +- [parallel/test-http-response-remove-header-after-sent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-remove-header-after-sent.js) +- [parallel/test-http-response-setheaders.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-setheaders.js) +- [parallel/test-http-response-splitting.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-splitting.js) +- [parallel/test-http-response-status-message.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-status-message.js) +- [parallel/test-http-response-statuscode.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-statuscode.js) +- [parallel/test-http-response-writehead-returns-this.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-writehead-returns-this.js) +- [parallel/test-http-same-map.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-same-map.js) +- [parallel/test-http-server-async-dispose.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-async-dispose.js) +- [parallel/test-http-server-capture-rejections.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-capture-rejections.js) +- [parallel/test-http-server-client-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-client-error.js) +- [parallel/test-http-server-close-all.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-close-all.js) +- [parallel/test-http-server-close-destroy-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-close-destroy-timeout.js) +- [parallel/test-http-server-close-idle-wait-response.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-close-idle-wait-response.js) +- [parallel/test-http-server-close-idle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-close-idle.js) +- [parallel/test-http-server-connection-list-when-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-connection-list-when-close.js) +- [parallel/test-http-server-connections-checking-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-connections-checking-leak.js) +- [parallel/test-http-server-consumed-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-consumed-timeout.js) +- [parallel/test-http-server-de-chunked-trailer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-de-chunked-trailer.js) +- [parallel/test-http-server-delete-parser.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-delete-parser.js) +- [parallel/test-http-server-destroy-socket-on-client-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-destroy-socket-on-client-error.js) +- [parallel/test-http-server-headers-timeout-delayed-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-headers-timeout-delayed-headers.js) +- [parallel/test-http-server-headers-timeout-interrupted-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-headers-timeout-interrupted-headers.js) +- [parallel/test-http-server-headers-timeout-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-headers-timeout-keepalive.js) +- [parallel/test-http-server-headers-timeout-pipelining.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-headers-timeout-pipelining.js) +- [parallel/test-http-server-incomingmessage-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-incomingmessage-destroy.js) +- [parallel/test-http-server-keep-alive-defaults.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-keep-alive-defaults.js) +- [parallel/test-http-server-keep-alive-max-requests-null.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-keep-alive-max-requests-null.js) +- [parallel/test-http-server-keep-alive-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-keep-alive-timeout.js) +- [parallel/test-http-server-keepalive-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-keepalive-end.js) +- [parallel/test-http-server-keepalive-req-gc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-keepalive-req-gc.js) +- [parallel/test-http-server-multiheaders.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-multiheaders.js) +- [parallel/test-http-server-multiheaders2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-multiheaders2.js) +- [parallel/test-http-server-non-utf8-header.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-non-utf8-header.js) +- [parallel/test-http-server-options-highwatermark.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-options-highwatermark.js) +- [parallel/test-http-server-options-incoming-message.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-options-incoming-message.js) +- [parallel/test-http-server-options-server-response.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-options-server-response.js) +- [parallel/test-http-server-reject-chunked-with-content-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-reject-chunked-with-content-length.js) +- [parallel/test-http-server-reject-cr-no-lf.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-reject-cr-no-lf.js) +- [parallel/test-http-server-request-timeout-delayed-body.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-request-timeout-delayed-body.js) +- [parallel/test-http-server-request-timeout-delayed-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-request-timeout-delayed-headers.js) +- [parallel/test-http-server-request-timeout-interrupted-body.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-request-timeout-interrupted-body.js) +- [parallel/test-http-server-request-timeout-interrupted-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-request-timeout-interrupted-headers.js) +- [parallel/test-http-server-request-timeout-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-request-timeout-keepalive.js) +- [parallel/test-http-server-request-timeout-pipelining.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-request-timeout-pipelining.js) +- [parallel/test-http-server-request-timeout-upgrade.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-request-timeout-upgrade.js) +- [parallel/test-http-server-request-timeouts-mixed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-request-timeouts-mixed.js) +- [parallel/test-http-server-response-standalone.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-response-standalone.js) +- [parallel/test-http-server-stale-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-stale-close.js) +- [parallel/test-http-server-timeouts-validation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-timeouts-validation.js) +- [parallel/test-http-server-unconsume-consume.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-unconsume-consume.js) +- [parallel/test-http-server-unconsume.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-unconsume.js) +- [parallel/test-http-server-write-after-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-write-after-end.js) +- [parallel/test-http-server-write-end-after-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-write-end-after-end.js) +- [parallel/test-http-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server.js) +- [parallel/test-http-set-cookies.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-set-cookies.js) +- [parallel/test-http-set-header-chain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-set-header-chain.js) +- [parallel/test-http-set-max-idle-http-parser.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-set-max-idle-http-parser.js) +- [parallel/test-http-set-timeout-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-set-timeout-server.js) +- [parallel/test-http-set-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-set-timeout.js) +- [parallel/test-http-set-trailers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-set-trailers.js) +- [parallel/test-http-should-keep-alive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-should-keep-alive.js) +- [parallel/test-http-socket-encoding-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-socket-encoding-error.js) +- [parallel/test-http-socket-error-listeners.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-socket-error-listeners.js) +- [parallel/test-http-status-code.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-status-code.js) +- [parallel/test-http-status-message.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-status-message.js) +- [parallel/test-http-status-reason-invalid-chars.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-status-reason-invalid-chars.js) +- [parallel/test-http-sync-write-error-during-continue.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-sync-write-error-during-continue.js) +- [parallel/test-http-timeout-client-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-timeout-client-warning.js) +- [parallel/test-http-timeout-overflow.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-timeout-overflow.js) +- [parallel/test-http-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-timeout.js) +- [parallel/test-http-transfer-encoding-repeated-chunked.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-transfer-encoding-repeated-chunked.js) +- [parallel/test-http-transfer-encoding-smuggling.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-transfer-encoding-smuggling.js) +- [parallel/test-http-uncaught-from-request-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-uncaught-from-request-callback.js) +- [parallel/test-http-unix-socket-keep-alive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-unix-socket-keep-alive.js) +- [parallel/test-http-unix-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-unix-socket.js) +- [parallel/test-http-upgrade-advertise.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-upgrade-advertise.js) +- [parallel/test-http-upgrade-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-upgrade-agent.js) +- [parallel/test-http-upgrade-binary.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-upgrade-binary.js) +- [parallel/test-http-upgrade-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-upgrade-client.js) +- [parallel/test-http-upgrade-client2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-upgrade-client2.js) +- [parallel/test-http-upgrade-reconsume-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-upgrade-reconsume-stream.js) +- [parallel/test-http-upgrade-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-upgrade-server.js) +- [parallel/test-http-upgrade-server2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-upgrade-server2.js) +- [parallel/test-http-url.parse-auth-with-header-in-request.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-url.parse-auth-with-header-in-request.js) +- [parallel/test-http-url.parse-auth.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-url.parse-auth.js) +- [parallel/test-http-url.parse-basic.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-url.parse-basic.js) +- [parallel/test-http-url.parse-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-url.parse-path.js) +- [parallel/test-http-url.parse-post.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-url.parse-post.js) +- [parallel/test-http-url.parse-search.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-url.parse-search.js) +- [parallel/test-http-wget.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-wget.js) +- [parallel/test-http-writable-true-after-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-writable-true-after-close.js) +- [parallel/test-http-write-callbacks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-write-callbacks.js) +- [parallel/test-http-write-empty-string.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-write-empty-string.js) +- [parallel/test-http-write-head-2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-write-head-2.js) +- [parallel/test-http-write-head.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-write-head.js) +- [parallel/test-http-zero-length-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-zero-length-write.js) +- [parallel/test-http-zerolengthbuffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-zerolengthbuffer.js) +- [parallel/test-http.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http.js) +- [parallel/test-http2-altsvc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-altsvc.js) +- [parallel/test-http2-autoselect-protocol.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-autoselect-protocol.js) +- [parallel/test-http2-backpressure.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-backpressure.js) +- [parallel/test-http2-binding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-binding.js) +- [parallel/test-http2-buffersize.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-buffersize.js) +- [parallel/test-http2-byteswritten-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-byteswritten-server.js) +- [parallel/test-http2-cancel-while-client-reading.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-cancel-while-client-reading.js) +- [parallel/test-http2-capture-rejection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-capture-rejection.js) +- [parallel/test-http2-clean-output.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-clean-output.js) +- [parallel/test-http2-client-connection-tunnelling.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-connection-tunnelling.js) +- [parallel/test-http2-client-data-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-data-end.js) +- [parallel/test-http2-client-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-destroy.js) +- [parallel/test-http2-client-http1-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-http1-server.js) +- [parallel/test-http2-client-jsstream-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-jsstream-destroy.js) +- [parallel/test-http2-client-onconnect-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-onconnect-errors.js) +- [parallel/test-http2-client-port-80.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-port-80.js) +- [parallel/test-http2-client-priority-before-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-priority-before-connect.js) +- [parallel/test-http2-client-promisify-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-promisify-connect.js) +- [parallel/test-http2-client-request-listeners-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-request-listeners-warning.js) +- [parallel/test-http2-client-request-options-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-request-options-errors.js) +- [parallel/test-http2-client-rststream-before-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-rststream-before-connect.js) +- [parallel/test-http2-client-set-priority.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-set-priority.js) +- [parallel/test-http2-client-setLocalWindowSize.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-setLocalWindowSize.js) +- [parallel/test-http2-client-setNextStreamID-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-setNextStreamID-errors.js) +- [parallel/test-http2-client-settings-before-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-settings-before-connect.js) +- [parallel/test-http2-client-shutdown-before-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-shutdown-before-connect.js) +- [parallel/test-http2-client-socket-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-socket-destroy.js) +- [parallel/test-http2-client-stream-destroy-before-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-stream-destroy-before-connect.js) +- [parallel/test-http2-client-unescaped-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-unescaped-path.js) +- [parallel/test-http2-client-upload-reject.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-upload-reject.js) +- [parallel/test-http2-client-upload.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-upload.js) +- [parallel/test-http2-client-write-before-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-write-before-connect.js) +- [parallel/test-http2-client-write-empty-string.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-write-empty-string.js) +- [parallel/test-http2-close-while-writing.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-close-while-writing.js) +- [parallel/test-http2-compat-aborted.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-aborted.js) +- [parallel/test-http2-compat-client-upload-reject.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-client-upload-reject.js) +- [parallel/test-http2-compat-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-errors.js) +- [parallel/test-http2-compat-expect-continue-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-expect-continue-check.js) +- [parallel/test-http2-compat-expect-continue.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-expect-continue.js) +- [parallel/test-http2-compat-expect-handling.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-expect-handling.js) +- [parallel/test-http2-compat-method-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-method-connect.js) +- [parallel/test-http2-compat-serverrequest-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverrequest-end.js) +- [parallel/test-http2-compat-serverrequest-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverrequest-headers.js) +- [parallel/test-http2-compat-serverrequest-host.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverrequest-host.js) +- [parallel/test-http2-compat-serverrequest-pause.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverrequest-pause.js) +- [parallel/test-http2-compat-serverrequest-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverrequest-pipe.js) +- [parallel/test-http2-compat-serverrequest-settimeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverrequest-settimeout.js) +- [parallel/test-http2-compat-serverrequest-trailers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverrequest-trailers.js) +- [parallel/test-http2-compat-serverrequest.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverrequest.js) +- [parallel/test-http2-compat-serverresponse-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-close.js) +- [parallel/test-http2-compat-serverresponse-createpushresponse.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-createpushresponse.js) +- [parallel/test-http2-compat-serverresponse-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-destroy.js) +- [parallel/test-http2-compat-serverresponse-drain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-drain.js) +- [parallel/test-http2-compat-serverresponse-end-after-statuses-without-body.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-end-after-statuses-without-body.js) +- [parallel/test-http2-compat-serverresponse-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-end.js) +- [parallel/test-http2-compat-serverresponse-finished.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-finished.js) +- [parallel/test-http2-compat-serverresponse-flushheaders.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-flushheaders.js) +- [parallel/test-http2-compat-serverresponse-headers-after-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-headers-after-destroy.js) +- [parallel/test-http2-compat-serverresponse-headers-send-date.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-headers-send-date.js) +- [parallel/test-http2-compat-serverresponse-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-headers.js) +- [parallel/test-http2-compat-serverresponse-settimeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-settimeout.js) +- [parallel/test-http2-compat-serverresponse-statuscode.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-statuscode.js) +- [parallel/test-http2-compat-serverresponse-statusmessage-property-set.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-statusmessage-property-set.js) +- [parallel/test-http2-compat-serverresponse-statusmessage-property.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-statusmessage-property.js) +- [parallel/test-http2-compat-serverresponse-statusmessage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-statusmessage.js) +- [parallel/test-http2-compat-serverresponse-trailers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-trailers.js) +- [parallel/test-http2-compat-serverresponse-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-write.js) +- [parallel/test-http2-compat-serverresponse-writehead-array.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-writehead-array.js) +- [parallel/test-http2-compat-serverresponse-writehead.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse-writehead.js) +- [parallel/test-http2-compat-serverresponse.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse.js) +- [parallel/test-http2-compat-short-stream-client-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-short-stream-client-server.js) +- [parallel/test-http2-compat-socket-destroy-delayed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-socket-destroy-delayed.js) +- [parallel/test-http2-compat-socket-set.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-socket-set.js) +- [parallel/test-http2-compat-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-socket.js) +- [parallel/test-http2-compat-write-early-hints-invalid-argument-type.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-write-early-hints-invalid-argument-type.js) +- [parallel/test-http2-compat-write-early-hints-invalid-argument-value.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-write-early-hints-invalid-argument-value.js) +- [parallel/test-http2-compat-write-early-hints.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-write-early-hints.js) +- [parallel/test-http2-compat-write-head-destroyed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-write-head-destroyed.js) +- [parallel/test-http2-connect-method-extended-cant-turn-off.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-connect-method-extended-cant-turn-off.js) +- [parallel/test-http2-connect-method-extended.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-connect-method-extended.js) +- [parallel/test-http2-connect-method.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-connect-method.js) +- [parallel/test-http2-connect-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-connect-options.js) +- [parallel/test-http2-connect-tls-with-delay.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-connect-tls-with-delay.js) +- [parallel/test-http2-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-connect.js) +- [parallel/test-http2-cookies.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-cookies.js) +- [parallel/test-http2-create-client-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-create-client-connect.js) +- [parallel/test-http2-create-client-secure-session.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-create-client-secure-session.js) +- [parallel/test-http2-create-client-session.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-create-client-session.js) +- [parallel/test-http2-createsecureserver-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-createsecureserver-options.js) +- [parallel/test-http2-createserver-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-createserver-options.js) +- [parallel/test-http2-createwritereq.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-createwritereq.js) +- [parallel/test-http2-date-header.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-date-header.js) +- [parallel/test-http2-debug.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-debug.js) +- [parallel/test-http2-destroy-after-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-destroy-after-write.js) +- [parallel/test-http2-dont-lose-data.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-dont-lose-data.js) +- [parallel/test-http2-dont-override.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-dont-override.js) +- [parallel/test-http2-empty-frame-without-eof.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-empty-frame-without-eof.js) +- [parallel/test-http2-endafterheaders.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-endafterheaders.js) +- [parallel/test-http2-error-order.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-error-order.js) +- [parallel/test-http2-exceeds-server-trailer-size.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-exceeds-server-trailer-size.js) +- [parallel/test-http2-forget-closed-streams.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-forget-closed-streams.js) +- [parallel/test-http2-generic-streams-sendfile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-generic-streams-sendfile.js) +- [parallel/test-http2-generic-streams.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-generic-streams.js) +- [parallel/test-http2-getpackedsettings.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-getpackedsettings.js) +- [parallel/test-http2-goaway-delayed-request.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-goaway-delayed-request.js) +- [parallel/test-http2-goaway-opaquedata.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-goaway-opaquedata.js) +- [parallel/test-http2-head-request.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-head-request.js) +- [parallel/test-http2-https-fallback-http-server-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-https-fallback-http-server-options.js) +- [parallel/test-http2-https-fallback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-https-fallback.js) +- [parallel/test-http2-info-headers-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-info-headers-errors.js) +- [parallel/test-http2-info-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-info-headers.js) +- [parallel/test-http2-invalidargtypes-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-invalidargtypes-errors.js) +- [parallel/test-http2-invalidheaderfield.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-invalidheaderfield.js) +- [parallel/test-http2-invalidheaderfields-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-invalidheaderfields-client.js) +- [parallel/test-http2-large-write-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-large-write-close.js) +- [parallel/test-http2-large-write-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-large-write-destroy.js) +- [parallel/test-http2-large-write-multiple-requests.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-large-write-multiple-requests.js) +- [parallel/test-http2-large-writes-session-memory-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-large-writes-session-memory-leak.js) +- [parallel/test-http2-malformed-altsvc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-malformed-altsvc.js) +- [parallel/test-http2-many-writes-and-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-many-writes-and-destroy.js) +- [parallel/test-http2-max-concurrent-streams.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-max-concurrent-streams.js) +- [parallel/test-http2-max-invalid-frames.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-max-invalid-frames.js) +- [parallel/test-http2-max-session-memory-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-max-session-memory-leak.js) +- [parallel/test-http2-max-settings.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-max-settings.js) +- [parallel/test-http2-methods.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-methods.js) +- [parallel/test-http2-misbehaving-flow-control-paused.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-misbehaving-flow-control-paused.js) +- [parallel/test-http2-misbehaving-flow-control.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-misbehaving-flow-control.js) +- [parallel/test-http2-misbehaving-multiplex.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-misbehaving-multiplex.js) +- [parallel/test-http2-misc-util.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-misc-util.js) +- [parallel/test-http2-misused-pseudoheaders.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-misused-pseudoheaders.js) +- [parallel/test-http2-multi-content-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-multi-content-length.js) +- [parallel/test-http2-multiheaders-raw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-multiheaders-raw.js) +- [parallel/test-http2-multiheaders.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-multiheaders.js) +- [parallel/test-http2-multiplex.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-multiplex.js) +- [parallel/test-http2-multistream-destroy-on-read-tls.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-multistream-destroy-on-read-tls.js) +- [parallel/test-http2-no-more-streams.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-no-more-streams.js) +- [parallel/test-http2-no-wanttrailers-listener.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-no-wanttrailers-listener.js) +- [parallel/test-http2-onping.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-onping.js) +- [parallel/test-http2-options-max-headers-block-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-options-max-headers-block-length.js) +- [parallel/test-http2-options-max-headers-exceeds-nghttp2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-options-max-headers-exceeds-nghttp2.js) +- [parallel/test-http2-options-max-reserved-streams.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-options-max-reserved-streams.js) +- [parallel/test-http2-options-server-request.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-options-server-request.js) +- [parallel/test-http2-options-server-response.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-options-server-response.js) +- [parallel/test-http2-origin.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-origin.js) +- [parallel/test-http2-pack-end-stream-flag.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-pack-end-stream-flag.js) +- [parallel/test-http2-padding-aligned.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-padding-aligned.js) +- [parallel/test-http2-perf_hooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-perf_hooks.js) +- [parallel/test-http2-ping-settings-heapdump.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-ping-settings-heapdump.js) +- [parallel/test-http2-ping-unsolicited-ack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-ping-unsolicited-ack.js) +- [parallel/test-http2-ping.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-ping.js) +- [parallel/test-http2-pipe-named-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-pipe-named-pipe.js) +- [parallel/test-http2-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-pipe.js) +- [parallel/test-http2-priority-cycle-.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-priority-cycle-.js) +- [parallel/test-http2-priority-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-priority-event.js) +- [parallel/test-http2-propagate-session-destroy-code.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-propagate-session-destroy-code.js) +- [parallel/test-http2-removed-header-stays-removed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-removed-header-stays-removed.js) +- [parallel/test-http2-request-remove-connect-listener.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-request-remove-connect-listener.js) +- [parallel/test-http2-request-response-proto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-request-response-proto.js) +- [parallel/test-http2-res-corked.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-res-corked.js) +- [parallel/test-http2-res-writable-properties.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-res-writable-properties.js) +- [parallel/test-http2-reset-flood.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-reset-flood.js) +- [parallel/test-http2-respond-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-errors.js) +- [parallel/test-http2-respond-file-204.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-204.js) +- [parallel/test-http2-respond-file-304.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-304.js) +- [parallel/test-http2-respond-file-404.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-404.js) +- [parallel/test-http2-respond-file-compat.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-compat.js) +- [parallel/test-http2-respond-file-error-dir.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-error-dir.js) +- [parallel/test-http2-respond-file-error-pipe-offset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-error-pipe-offset.js) +- [parallel/test-http2-respond-file-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-errors.js) +- [parallel/test-http2-respond-file-fd-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-fd-errors.js) +- [parallel/test-http2-respond-file-fd-invalid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-fd-invalid.js) +- [parallel/test-http2-respond-file-fd-range.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-fd-range.js) +- [parallel/test-http2-respond-file-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-fd.js) +- [parallel/test-http2-respond-file-filehandle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-filehandle.js) +- [parallel/test-http2-respond-file-push.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-push.js) +- [parallel/test-http2-respond-file-range.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-range.js) +- [parallel/test-http2-respond-file-with-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-with-pipe.js) +- [parallel/test-http2-respond-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file.js) +- [parallel/test-http2-respond-nghttperrors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-nghttperrors.js) +- [parallel/test-http2-respond-no-data.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-no-data.js) +- [parallel/test-http2-respond-with-fd-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-with-fd-errors.js) +- [parallel/test-http2-respond-with-file-connection-abort.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-with-file-connection-abort.js) +- [parallel/test-http2-response-splitting.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-response-splitting.js) +- [parallel/test-http2-sensitive-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-sensitive-headers.js) +- [parallel/test-http2-sent-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-sent-headers.js) +- [parallel/test-http2-serve-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-serve-file.js) +- [parallel/test-http2-server-async-dispose.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-async-dispose.js) +- [parallel/test-http2-server-close-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-close-callback.js) +- [parallel/test-http2-server-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-errors.js) +- [parallel/test-http2-server-http1-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-http1-client.js) +- [parallel/test-http2-server-push-disabled.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-push-disabled.js) +- [parallel/test-http2-server-push-stream-errors-args.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-push-stream-errors-args.js) +- [parallel/test-http2-server-push-stream-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-push-stream-errors.js) +- [parallel/test-http2-server-push-stream-head.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-push-stream-head.js) +- [parallel/test-http2-server-push-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-push-stream.js) +- [parallel/test-http2-server-rst-before-respond.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-rst-before-respond.js) +- [parallel/test-http2-server-rst-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-rst-stream.js) +- [parallel/test-http2-server-session-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-session-destroy.js) +- [parallel/test-http2-server-sessionerror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-sessionerror.js) +- [parallel/test-http2-server-set-header.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-set-header.js) +- [parallel/test-http2-server-setLocalWindowSize.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-setLocalWindowSize.js) +- [parallel/test-http2-server-settimeout-no-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-settimeout-no-callback.js) +- [parallel/test-http2-server-shutdown-before-respond.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-shutdown-before-respond.js) +- [parallel/test-http2-server-shutdown-options-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-shutdown-options-errors.js) +- [parallel/test-http2-server-shutdown-redundant.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-shutdown-redundant.js) +- [parallel/test-http2-server-socket-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-socket-destroy.js) +- [parallel/test-http2-server-startup.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-startup.js) +- [parallel/test-http2-server-stream-session-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-stream-session-destroy.js) +- [parallel/test-http2-server-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-timeout.js) +- [parallel/test-http2-server-unknown-protocol.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-server-unknown-protocol.js) +- [parallel/test-http2-session-gc-while-write-scheduled.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-session-gc-while-write-scheduled.js) +- [parallel/test-http2-session-settings.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-session-settings.js) +- [parallel/test-http2-session-stream-state.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-session-stream-state.js) +- [parallel/test-http2-session-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-session-timeout.js) +- [parallel/test-http2-session-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-session-unref.js) +- [parallel/test-http2-settings-unsolicited-ack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-settings-unsolicited-ack.js) +- [parallel/test-http2-short-stream-client-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-short-stream-client-server.js) +- [parallel/test-http2-single-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-single-headers.js) +- [parallel/test-http2-socket-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-socket-close.js) +- [parallel/test-http2-socket-proxy-handler-for-has.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-socket-proxy-handler-for-has.js) +- [parallel/test-http2-socket-proxy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-socket-proxy.js) +- [parallel/test-http2-status-code-invalid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-status-code-invalid.js) +- [parallel/test-http2-status-code.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-status-code.js) +- [parallel/test-http2-stream-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-stream-client.js) +- [parallel/test-http2-stream-destroy-event-order.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-stream-destroy-event-order.js) +- [parallel/test-http2-stream-removelisteners-after-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-stream-removelisteners-after-close.js) +- [parallel/test-http2-timeouts.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-timeouts.js) +- [parallel/test-http2-tls-disconnect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-tls-disconnect.js) +- [parallel/test-http2-too-large-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-too-large-headers.js) +- [parallel/test-http2-too-many-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-too-many-headers.js) +- [parallel/test-http2-too-many-settings.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-too-many-settings.js) +- [parallel/test-http2-too-many-streams.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-too-many-streams.js) +- [parallel/test-http2-trailers-after-session-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-trailers-after-session-close.js) +- [parallel/test-http2-trailers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-trailers.js) +- [parallel/test-http2-unbound-socket-proxy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-unbound-socket-proxy.js) +- [parallel/test-http2-update-settings.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-update-settings.js) +- [parallel/test-http2-util-assert-valid-pseudoheader.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-util-assert-valid-pseudoheader.js) +- [parallel/test-http2-util-asserts.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-util-asserts.js) +- [parallel/test-http2-util-headers-list.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-util-headers-list.js) +- [parallel/test-http2-util-nghttp2error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-util-nghttp2error.js) +- [parallel/test-http2-util-update-options-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-util-update-options-buffer.js) +- [parallel/test-http2-window-size.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-window-size.js) +- [parallel/test-http2-write-callbacks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-write-callbacks.js) +- [parallel/test-http2-write-empty-string.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-write-empty-string.js) +- [parallel/test-http2-write-finishes-after-stream-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-write-finishes-after-stream-destroy.js) +- [parallel/test-http2-zero-length-header.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-zero-length-header.js) +- [parallel/test-http2-zero-length-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-zero-length-write.js) +- [parallel/test-https-abortcontroller.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-abortcontroller.js) +- [parallel/test-https-agent-abort-controller.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-agent-abort-controller.js) +- [parallel/test-https-agent-additional-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-agent-additional-options.js) +- [parallel/test-https-agent-constructor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-agent-constructor.js) +- [parallel/test-https-agent-create-connection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-agent-create-connection.js) +- [parallel/test-https-agent-disable-session-reuse.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-agent-disable-session-reuse.js) +- [parallel/test-https-agent-getname.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-agent-getname.js) +- [parallel/test-https-agent-keylog.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-agent-keylog.js) +- [parallel/test-https-agent-servername.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-agent-servername.js) +- [parallel/test-https-agent-session-eviction.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-agent-session-eviction.js) +- [parallel/test-https-agent-session-injection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-agent-session-injection.js) +- [parallel/test-https-agent-session-reuse.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-agent-session-reuse.js) +- [parallel/test-https-agent-sni.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-agent-sni.js) +- [parallel/test-https-agent-sockets-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-agent-sockets-leak.js) +- [parallel/test-https-agent-unref-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-agent-unref-socket.js) +- [parallel/test-https-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-agent.js) +- [parallel/test-https-argument-of-creating.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-argument-of-creating.js) +- [parallel/test-https-autoselectfamily.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-autoselectfamily.js) +- [parallel/test-https-byteswritten.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-byteswritten.js) +- [parallel/test-https-client-checkServerIdentity.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-client-checkServerIdentity.js) +- [parallel/test-https-client-get-url.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-client-get-url.js) +- [parallel/test-https-client-override-global-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-client-override-global-agent.js) +- [parallel/test-https-client-reject.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-client-reject.js) +- [parallel/test-https-client-renegotiation-limit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-client-renegotiation-limit.js) +- [parallel/test-https-client-resume.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-client-resume.js) +- [parallel/test-https-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-close.js) +- [parallel/test-https-connect-address-family.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-connect-address-family.js) +- [parallel/test-https-connecting-to-http.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-connecting-to-http.js) +- [parallel/test-https-drain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-drain.js) +- [parallel/test-https-eof-for-eom.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-eof-for-eom.js) +- [parallel/test-https-foafssl.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-foafssl.js) +- [parallel/test-https-host-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-host-headers.js) +- [parallel/test-https-hwm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-hwm.js) +- [parallel/test-https-insecure-parse-per-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-insecure-parse-per-stream.js) +- [parallel/test-https-keep-alive-drop-requests.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-keep-alive-drop-requests.js) +- [parallel/test-https-localaddress-bind-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-localaddress-bind-error.js) +- [parallel/test-https-localaddress.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-localaddress.js) +- [parallel/test-https-max-header-size-per-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-max-header-size-per-stream.js) +- [parallel/test-https-max-headers-count.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-max-headers-count.js) +- [parallel/test-https-options-boolean-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-options-boolean-check.js) +- [parallel/test-https-pfx.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-pfx.js) +- [parallel/test-https-request-arguments.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-request-arguments.js) +- [parallel/test-https-resume-after-renew.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-resume-after-renew.js) +- [parallel/test-https-selfsigned-no-keycertsign-no-crash.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-selfsigned-no-keycertsign-no-crash.js) +- [parallel/test-https-server-async-dispose.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-server-async-dispose.js) +- [parallel/test-https-server-close-all.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-server-close-all.js) +- [parallel/test-https-server-close-destroy-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-server-close-destroy-timeout.js) +- [parallel/test-https-server-close-idle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-server-close-idle.js) +- [parallel/test-https-server-connections-checking-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-server-connections-checking-leak.js) +- [parallel/test-https-server-headers-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-server-headers-timeout.js) +- [parallel/test-https-server-options-incoming-message.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-server-options-incoming-message.js) +- [parallel/test-https-server-options-server-response.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-server-options-server-response.js) +- [parallel/test-https-server-request-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-server-request-timeout.js) +- [parallel/test-https-set-timeout-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-set-timeout-server.js) +- [parallel/test-https-simple.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-simple.js) +- [parallel/test-https-socket-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-socket-options.js) +- [parallel/test-https-strict.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-strict.js) +- [parallel/test-https-timeout-server-2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-timeout-server-2.js) +- [parallel/test-https-timeout-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-timeout-server.js) +- [parallel/test-https-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-timeout.js) +- [parallel/test-https-truncate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-truncate.js) +- [parallel/test-https-unix-socket-self-signed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-unix-socket-self-signed.js) +- [parallel/test-icu-data-dir.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-icu-data-dir.js) +- [parallel/test-icu-env.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-icu-env.js) +- [parallel/test-icu-minimum-version.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-icu-minimum-version.js) +- [parallel/test-icu-punycode.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-icu-punycode.js) +- [parallel/test-icu-stringwidth.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-icu-stringwidth.js) +- [parallel/test-inspect-address-in-use.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspect-address-in-use.js) +- [parallel/test-inspect-async-hook-setup-at-inspect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspect-async-hook-setup-at-inspect.js) +- [parallel/test-inspect-publish-uid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspect-publish-uid.js) +- [parallel/test-inspect-support-for-node_options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspect-support-for-node_options.js) +- [parallel/test-inspector-already-activated-cli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-already-activated-cli.js) +- [parallel/test-inspector-async-call-stack-abort.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-async-call-stack-abort.js) +- [parallel/test-inspector-async-call-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-async-call-stack.js) +- [parallel/test-inspector-async-hook-after-done.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-async-hook-after-done.js) +- [parallel/test-inspector-async-hook-setup-at-inspect-brk.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-async-hook-setup-at-inspect-brk.js) +- [parallel/test-inspector-async-hook-setup-at-signal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-async-hook-setup-at-signal.js) +- [parallel/test-inspector-async-stack-traces-promise-then.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-async-stack-traces-promise-then.js) +- [parallel/test-inspector-async-stack-traces-set-interval.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-async-stack-traces-set-interval.js) +- [parallel/test-inspector-bindings.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-bindings.js) +- [parallel/test-inspector-break-e.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-break-e.js) +- [parallel/test-inspector-break-when-eval.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-break-when-eval.js) +- [parallel/test-inspector-close-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-close-worker.js) +- [parallel/test-inspector-connect-main-thread.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-connect-main-thread.js) +- [parallel/test-inspector-connect-to-main-thread.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-connect-to-main-thread.js) +- [parallel/test-inspector-console-top-frame.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-console-top-frame.js) +- [parallel/test-inspector-console.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-console.js) +- [parallel/test-inspector-contexts.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-contexts.js) +- [parallel/test-inspector-debug-brk-flag.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-debug-brk-flag.js) +- [parallel/test-inspector-debug-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-debug-end.js) +- [parallel/test-inspector-enabled.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-enabled.js) +- [parallel/test-inspector-esm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-esm.js) +- [parallel/test-inspector-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-exception.js) +- [parallel/test-inspector-has-idle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-has-idle.js) +- [parallel/test-inspector-has-inspector-false.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-has-inspector-false.js) +- [parallel/test-inspector-heap-allocation-tracker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-heap-allocation-tracker.js) +- [parallel/test-inspector-heapdump.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-heapdump.js) +- [parallel/test-inspector-inspect-brk-node.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-inspect-brk-node.js) +- [parallel/test-inspector-invalid-args.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-invalid-args.js) +- [parallel/test-inspector-ip-detection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-ip-detection.js) +- [parallel/test-inspector-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-module.js) +- [parallel/test-inspector-multisession-js.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-multisession-js.js) +- [parallel/test-inspector-multisession-ws.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-multisession-ws.js) +- [parallel/test-inspector-not-blocked-on-idle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-not-blocked-on-idle.js) +- [parallel/test-inspector-open-coverage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-open-coverage.js) +- [parallel/test-inspector-open-port-integer-overflow.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-open-port-integer-overflow.js) +- [parallel/test-inspector-open.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-open.js) +- [parallel/test-inspector-overwrite-config.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-overwrite-config.js) +- [parallel/test-inspector-port-zero-cluster.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-port-zero-cluster.js) +- [parallel/test-inspector-port-zero.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-port-zero.js) +- [parallel/test-inspector-promises.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-promises.js) +- [parallel/test-inspector-reported-host.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-reported-host.js) +- [parallel/test-inspector-resource-name-to-url.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-resource-name-to-url.js) +- [parallel/test-inspector-runtime-evaluate-with-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-runtime-evaluate-with-timeout.js) +- [parallel/test-inspector-scriptparsed-context.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-scriptparsed-context.js) +- [parallel/test-inspector-stop-profile-after-done.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-stop-profile-after-done.js) +- [parallel/test-inspector-stops-no-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-stops-no-file.js) +- [parallel/test-inspector-stress-http.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-stress-http.js) +- [parallel/test-inspector-tracing-domain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-tracing-domain.js) +- [parallel/test-inspector-vm-global-accessors-getter-sideeffect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-vm-global-accessors-getter-sideeffect.js) +- [parallel/test-inspector-vm-global-accessors-sideeffects.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-vm-global-accessors-sideeffects.js) +- [parallel/test-inspector-wait-for-connection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-wait-for-connection.js) +- [parallel/test-inspector-waiting-for-disconnect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-waiting-for-disconnect.js) +- [parallel/test-inspector-workers-flat-list.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-workers-flat-list.js) +- [parallel/test-inspector.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector.js) +- [parallel/test-instanceof.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-instanceof.js) +- [parallel/test-internal-assert.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-assert.js) +- [parallel/test-internal-error-original-names.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-error-original-names.js) +- [parallel/test-internal-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-errors.js) +- [parallel/test-internal-fs-syncwritestream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-fs-syncwritestream.js) +- [parallel/test-internal-fs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-fs.js) +- [parallel/test-internal-iterable-weak-map.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-iterable-weak-map.js) +- [parallel/test-internal-module-require.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-module-require.js) +- [parallel/test-internal-module-wrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-module-wrap.js) +- [parallel/test-internal-modules.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-modules.js) +- [parallel/test-internal-process-binding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-process-binding.js) +- [parallel/test-internal-socket-list-receive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-socket-list-receive.js) +- [parallel/test-internal-socket-list-send.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-socket-list-send.js) +- [parallel/test-internal-util-assertCrypto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-util-assertCrypto.js) +- [parallel/test-internal-util-classwrapper.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-util-classwrapper.js) +- [parallel/test-internal-util-decorate-error-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-util-decorate-error-stack.js) +- [parallel/test-internal-util-helpers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-util-helpers.js) +- [parallel/test-internal-util-normalizeencoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-util-normalizeencoding.js) +- [parallel/test-internal-util-objects.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-util-objects.js) +- [parallel/test-internal-util-weakreference.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-util-weakreference.js) +- [parallel/test-internal-validators-validateoneof.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-validators-validateoneof.js) +- [parallel/test-internal-validators-validateport.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-validators-validateport.js) +- [parallel/test-internal-webidl-converttoint.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-webidl-converttoint.js) +- [parallel/test-intl-v8BreakIterator.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-intl-v8BreakIterator.js) +- [parallel/test-intl.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-intl.js) +- [parallel/test-js-stream-call-properties.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-js-stream-call-properties.js) +- [parallel/test-kill-segfault-freebsd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-kill-segfault-freebsd.js) +- [parallel/test-listen-fd-cluster.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-listen-fd-cluster.js) +- [parallel/test-listen-fd-detached-inherit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-listen-fd-detached-inherit.js) +- [parallel/test-listen-fd-detached.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-listen-fd-detached.js) +- [parallel/test-listen-fd-ebadf.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-listen-fd-ebadf.js) +- [parallel/test-listen-fd-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-listen-fd-server.js) +- [parallel/test-macos-app-sandbox.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-macos-app-sandbox.js) +- [parallel/test-math-random.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-math-random.js) +- [parallel/test-memory-usage-emfile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-memory-usage-emfile.js) +- [parallel/test-memory-usage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-memory-usage.js) +- [parallel/test-messagechannel.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-messagechannel.js) +- [parallel/test-messageevent-brandcheck.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-messageevent-brandcheck.js) +- [parallel/test-messageport-hasref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-messageport-hasref.js) +- [parallel/test-messaging-maketransferable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-messaging-maketransferable.js) +- [parallel/test-microtask-queue-integration.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-microtask-queue-integration.js) +- [parallel/test-microtask-queue-run-immediate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-microtask-queue-run-immediate.js) +- [parallel/test-microtask-queue-run.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-microtask-queue-run.js) +- [parallel/test-mime-api.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-mime-api.js) +- [parallel/test-mime-whatwg.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-mime-whatwg.js) +- [parallel/test-module-binding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-binding.js) +- [parallel/test-module-builtin.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-builtin.js) +- [parallel/test-module-cache.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-cache.js) +- [parallel/test-module-children.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-children.js) +- [parallel/test-module-circular-dependency-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-circular-dependency-warning.js) +- [parallel/test-module-circular-symlinks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-circular-symlinks.js) +- [parallel/test-module-create-require.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-create-require.js) +- [parallel/test-module-globalpaths-nodepath.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-globalpaths-nodepath.js) +- [parallel/test-module-isBuiltin.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-isBuiltin.js) +- [parallel/test-module-loading-deprecated.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-loading-deprecated.js) +- [parallel/test-module-loading-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-loading-error.js) +- [parallel/test-module-loading-globalpaths.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-loading-globalpaths.js) +- [parallel/test-module-main-extension-lookup.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-main-extension-lookup.js) +- [parallel/test-module-main-fail.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-main-fail.js) +- [parallel/test-module-main-preserve-symlinks-fail.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-main-preserve-symlinks-fail.js) +- [parallel/test-module-multi-extensions.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-multi-extensions.js) +- [parallel/test-module-nodemodulepaths.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-nodemodulepaths.js) +- [parallel/test-module-parent-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-parent-deprecation.js) +- [parallel/test-module-parent-setter-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-parent-setter-deprecation.js) +- [parallel/test-module-prototype-mutation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-prototype-mutation.js) +- [parallel/test-module-readonly.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-readonly.js) +- [parallel/test-module-relative-lookup.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-relative-lookup.js) +- [parallel/test-module-run-main-monkey-patch.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-run-main-monkey-patch.js) +- [parallel/test-module-stat.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-stat.js) +- [parallel/test-module-symlinked-peer-modules.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-symlinked-peer-modules.js) +- [parallel/test-module-version.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-version.js) +- [parallel/test-module-wrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-wrap.js) +- [parallel/test-module-wrapper.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-wrapper.js) +- [parallel/test-net-after-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-after-close.js) +- [parallel/test-net-allow-half-open.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-allow-half-open.js) +- [parallel/test-net-autoselectfamily-commandline-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-autoselectfamily-commandline-option.js) +- [parallel/test-net-autoselectfamily-default.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-autoselectfamily-default.js) +- [parallel/test-net-autoselectfamily-ipv4first.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-autoselectfamily-ipv4first.js) +- [parallel/test-net-better-error-messages-listen.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-better-error-messages-listen.js) +- [parallel/test-net-binary.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-binary.js) +- [parallel/test-net-bind-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-bind-twice.js) +- [parallel/test-net-buffersize.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-buffersize.js) +- [parallel/test-net-bytes-read.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-bytes-read.js) +- [parallel/test-net-bytes-stats.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-bytes-stats.js) +- [parallel/test-net-bytes-written-large.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-bytes-written-large.js) +- [parallel/test-net-can-reset-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-can-reset-timeout.js) +- [parallel/test-net-child-process-connect-reset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-child-process-connect-reset.js) +- [parallel/test-net-client-bind-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-client-bind-twice.js) +- [parallel/test-net-connect-abort-controller.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-abort-controller.js) +- [parallel/test-net-connect-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-buffer.js) +- [parallel/test-net-connect-buffer2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-buffer2.js) +- [parallel/test-net-connect-call-socket-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-call-socket-connect.js) +- [parallel/test-net-connect-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-keepalive.js) +- [parallel/test-net-connect-memleak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-memleak.js) +- [parallel/test-net-connect-nodelay.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-nodelay.js) +- [parallel/test-net-connect-options-allowhalfopen.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-options-allowhalfopen.js) +- [parallel/test-net-connect-options-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-options-fd.js) +- [parallel/test-net-connect-options-invalid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-options-invalid.js) +- [parallel/test-net-connect-options-ipv6.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-options-ipv6.js) +- [parallel/test-net-connect-options-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-options-path.js) +- [parallel/test-net-connect-options-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-options-port.js) +- [parallel/test-net-connect-paused-connection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-paused-connection.js) +- [parallel/test-net-connect-reset-after-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-reset-after-destroy.js) +- [parallel/test-net-connect-reset-before-connected.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-reset-before-connected.js) +- [parallel/test-net-connect-reset-until-connected.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-reset-until-connected.js) +- [parallel/test-net-connect-reset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-reset.js) +- [parallel/test-net-deprecated-setsimultaneousaccepts.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-deprecated-setsimultaneousaccepts.js) +- [parallel/test-net-dns-custom-lookup.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-dns-custom-lookup.js) +- [parallel/test-net-dns-lookup-skip.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-dns-lookup-skip.js) +- [parallel/test-net-dns-lookup.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-dns-lookup.js) +- [parallel/test-net-eaddrinuse.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-eaddrinuse.js) +- [parallel/test-net-end-destroyed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-end-destroyed.js) +- [parallel/test-net-error-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-error-twice.js) +- [parallel/test-net-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-keepalive.js) +- [parallel/test-net-large-string.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-large-string.js) +- [parallel/test-net-listen-after-destroying-stdin.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-listen-after-destroying-stdin.js) +- [parallel/test-net-listen-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-listen-error.js) +- [parallel/test-net-listen-exclusive-random-ports.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-listen-exclusive-random-ports.js) +- [parallel/test-net-listen-fd0.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-listen-fd0.js) +- [parallel/test-net-listen-ipv6only.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-listen-ipv6only.js) +- [parallel/test-net-local-address-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-local-address-port.js) +- [parallel/test-net-normalize-args.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-normalize-args.js) +- [parallel/test-net-onread-static-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-onread-static-buffer.js) +- [parallel/test-net-pause-resume-connecting.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-pause-resume-connecting.js) +- [parallel/test-net-perf_hooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-perf_hooks.js) +- [parallel/test-net-persistent-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-persistent-keepalive.js) +- [parallel/test-net-persistent-nodelay.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-persistent-nodelay.js) +- [parallel/test-net-persistent-ref-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-persistent-ref-unref.js) +- [parallel/test-net-pingpong.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-pingpong.js) +- [parallel/test-net-reconnect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-reconnect.js) +- [parallel/test-net-remote-address-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-remote-address-port.js) +- [parallel/test-net-remote-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-remote-address.js) +- [parallel/test-net-server-call-listen-multiple-times.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-call-listen-multiple-times.js) +- [parallel/test-net-server-capture-rejection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-capture-rejection.js) +- [parallel/test-net-server-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-close.js) +- [parallel/test-net-server-drop-connections.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-drop-connections.js) +- [parallel/test-net-server-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-keepalive.js) +- [parallel/test-net-server-listen-handle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-listen-handle.js) +- [parallel/test-net-server-max-connections-close-makes-more-available.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-max-connections-close-makes-more-available.js) +- [parallel/test-net-server-max-connections.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-max-connections.js) +- [parallel/test-net-server-nodelay.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-nodelay.js) +- [parallel/test-net-server-pause-on-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-pause-on-connect.js) +- [parallel/test-net-server-reset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-reset.js) +- [parallel/test-net-server-simultaneous-accepts-produce-warning-once.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-simultaneous-accepts-produce-warning-once.js) +- [parallel/test-net-server-try-ports.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-try-ports.js) +- [parallel/test-net-settimeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-settimeout.js) +- [parallel/test-net-socket-byteswritten.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-byteswritten.js) +- [parallel/test-net-socket-close-after-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-close-after-end.js) +- [parallel/test-net-socket-connect-invalid-autoselectfamily.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-connect-invalid-autoselectfamily.js) +- [parallel/test-net-socket-connect-invalid-autoselectfamilyattempttimeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-connect-invalid-autoselectfamilyattempttimeout.js) +- [parallel/test-net-socket-connect-without-cb.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-connect-without-cb.js) +- [parallel/test-net-socket-connecting.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-connecting.js) +- [parallel/test-net-socket-constructor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-constructor.js) +- [parallel/test-net-socket-destroy-send.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-destroy-send.js) +- [parallel/test-net-socket-end-before-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-end-before-connect.js) +- [parallel/test-net-socket-end-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-end-callback.js) +- [parallel/test-net-socket-local-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-local-address.js) +- [parallel/test-net-socket-ready-without-cb.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-ready-without-cb.js) +- [parallel/test-net-socket-reset-send.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-reset-send.js) +- [parallel/test-net-socket-reset-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-reset-twice.js) +- [parallel/test-net-socket-timeout-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-timeout-unref.js) +- [parallel/test-net-socket-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-timeout.js) +- [parallel/test-net-socket-write-after-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-write-after-close.js) +- [parallel/test-net-socket-write-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-write-error.js) +- [parallel/test-net-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-stream.js) +- [parallel/test-net-sync-cork.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-sync-cork.js) +- [parallel/test-net-throttle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-throttle.js) +- [parallel/test-net-writable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-writable.js) +- [parallel/test-net-write-after-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-write-after-close.js) +- [parallel/test-net-write-after-end-nt.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-write-after-end-nt.js) +- [parallel/test-net-write-cb-on-destroy-before-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-write-cb-on-destroy-before-connect.js) +- [parallel/test-net-write-connect-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-write-connect-write.js) +- [parallel/test-net-write-fully-async-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-write-fully-async-buffer.js) +- [parallel/test-net-write-fully-async-hex-string.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-write-fully-async-hex-string.js) +- [parallel/test-net-write-slow.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-write-slow.js) +- [parallel/test-next-tick-domain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-next-tick-domain.js) +- [parallel/test-next-tick-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-next-tick-errors.js) +- [parallel/test-no-addons-resolution-condition.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-no-addons-resolution-condition.js) +- [parallel/test-no-node-snapshot.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-no-node-snapshot.js) +- [parallel/test-npm-install.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-npm-install.js) +- [parallel/test-npm-version.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-npm-version.js) +- [parallel/test-openssl-ca-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-openssl-ca-options.js) +- [parallel/test-options-binding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-options-binding.js) +- [parallel/test-os-checked-function.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-os-checked-function.js) +- [parallel/test-os-eol.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-os-eol.js) +- [parallel/test-os-homedir-no-envvar.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-os-homedir-no-envvar.js) +- [parallel/test-os-process-priority.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-os-process-priority.js) +- [parallel/test-os-userinfo-handles-getter-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-os-userinfo-handles-getter-errors.js) +- [parallel/test-path-posix-relative-on-windows.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-path-posix-relative-on-windows.js) +- [parallel/test-pending-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pending-deprecation.js) +- [parallel/test-perf-gc-crash.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-perf-gc-crash.js) +- [parallel/test-perf-hooks-histogram.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-perf-hooks-histogram.js) +- [parallel/test-perf-hooks-resourcetiming.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-perf-hooks-resourcetiming.js) +- [parallel/test-perf-hooks-usertiming.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-perf-hooks-usertiming.js) +- [parallel/test-perf-hooks-worker-timeorigin.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-perf-hooks-worker-timeorigin.js) +- [parallel/test-performance-eventlooputil.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-performance-eventlooputil.js) +- [parallel/test-performance-function-async.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-performance-function-async.js) +- [parallel/test-performance-function.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-performance-function.js) +- [parallel/test-performance-gc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-performance-gc.js) +- [parallel/test-performance-global.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-performance-global.js) +- [parallel/test-performance-measure.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-performance-measure.js) +- [parallel/test-performance-nodetiming.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-performance-nodetiming.js) +- [parallel/test-performance-resourcetimingbufferfull.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-performance-resourcetimingbufferfull.js) +- [parallel/test-performance-resourcetimingbuffersize.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-performance-resourcetimingbuffersize.js) +- [parallel/test-performanceobserver-gc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-performanceobserver-gc.js) +- [parallel/test-performanceobserver.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-performanceobserver.js) +- [parallel/test-permission-allow-child-process-cli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-allow-child-process-cli.js) +- [parallel/test-permission-allow-worker-cli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-allow-worker-cli.js) +- [parallel/test-permission-child-process-cli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-child-process-cli.js) +- [parallel/test-permission-experimental.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-experimental.js) +- [parallel/test-permission-fs-read.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-fs-read.js) +- [parallel/test-permission-fs-relative-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-fs-relative-path.js) +- [parallel/test-permission-fs-supported.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-fs-supported.js) +- [parallel/test-permission-fs-symlink-relative.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-fs-symlink-relative.js) +- [parallel/test-permission-fs-symlink-target-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-fs-symlink-target-write.js) +- [parallel/test-permission-fs-symlink.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-fs-symlink.js) +- [parallel/test-permission-fs-traversal-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-fs-traversal-path.js) +- [parallel/test-permission-fs-wildcard.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-fs-wildcard.js) +- [parallel/test-permission-fs-windows-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-fs-windows-path.js) +- [parallel/test-permission-fs-write-report.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-fs-write-report.js) +- [parallel/test-permission-fs-write-v8.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-fs-write-v8.js) +- [parallel/test-permission-fs-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-fs-write.js) +- [parallel/test-permission-has.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-has.js) +- [parallel/test-permission-inspector.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-inspector.js) +- [parallel/test-permission-processbinding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-processbinding.js) +- [parallel/test-permission-warning-flags.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-warning-flags.js) +- [parallel/test-permission-worker-threads-cli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-worker-threads-cli.js) +- [parallel/test-pipe-abstract-socket-http.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-abstract-socket-http.js) +- [parallel/test-pipe-abstract-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-abstract-socket.js) +- [parallel/test-pipe-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-address.js) +- [parallel/test-pipe-file-to-http.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-file-to-http.js) +- [parallel/test-pipe-head.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-head.js) +- [parallel/test-pipe-outgoing-message-data-emitted-after-ended.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-outgoing-message-data-emitted-after-ended.js) +- [parallel/test-pipe-return-val.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-return-val.js) +- [parallel/test-pipe-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-stream.js) +- [parallel/test-pipe-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-unref.js) +- [parallel/test-pipe-writev.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-writev.js) +- [parallel/test-policy-crypto-default-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-policy-crypto-default-encoding.js) +- [parallel/test-policy-crypto-hash-tampering.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-policy-crypto-hash-tampering.js) +- [parallel/test-policy-dependencies.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-policy-dependencies.js) +- [parallel/test-policy-dependency-conditions.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-policy-dependency-conditions.js) +- [parallel/test-policy-integrity-flag.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-policy-integrity-flag.js) +- [parallel/test-policy-manifest.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-policy-manifest.js) +- [parallel/test-policy-parse-integrity.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-policy-parse-integrity.js) +- [parallel/test-policy-process-binding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-policy-process-binding.js) +- [parallel/test-policy-scopes-dependencies.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-policy-scopes-dependencies.js) +- [parallel/test-policy-scopes-integrity.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-policy-scopes-integrity.js) +- [parallel/test-policy-scopes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-policy-scopes.js) +- [parallel/test-preload-print-process-argv.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-preload-print-process-argv.js) +- [parallel/test-preload-self-referential.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-preload-self-referential.js) +- [parallel/test-preload-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-preload-worker.js) +- [parallel/test-preload.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-preload.js) +- [parallel/test-primordials-apply.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-primordials-apply.js) +- [parallel/test-primordials-promise.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-primordials-promise.js) +- [parallel/test-primordials-regexp.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-primordials-regexp.js) +- [parallel/test-priority-queue.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-priority-queue.js) +- [parallel/test-process-abort.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-abort.js) +- [parallel/test-process-argv-0.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-argv-0.js) +- [parallel/test-process-assert.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-assert.js) +- [parallel/test-process-beforeexit-throw-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-beforeexit-throw-exit.js) +- [parallel/test-process-binding-util.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-binding-util.js) +- [parallel/test-process-binding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-binding.js) +- [parallel/test-process-chdir-errormessage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-chdir-errormessage.js) +- [parallel/test-process-chdir.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-chdir.js) +- [parallel/test-process-config.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-config.js) +- [parallel/test-process-constants-noatime.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-constants-noatime.js) +- [parallel/test-process-constrained-memory.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-constrained-memory.js) +- [parallel/test-process-cpuUsage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-cpuUsage.js) +- [parallel/test-process-dlopen-error-message-crash.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-dlopen-error-message-crash.js) +- [parallel/test-process-dlopen-undefined-exports.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-dlopen-undefined-exports.js) +- [parallel/test-process-domain-segfault.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-domain-segfault.js) +- [parallel/test-process-emit-warning-from-native.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-emit-warning-from-native.js) +- [parallel/test-process-emit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-emit.js) +- [parallel/test-process-emitwarning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-emitwarning.js) +- [parallel/test-process-env-allowed-flags-are-documented.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env-allowed-flags-are-documented.js) +- [parallel/test-process-env-delete.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env-delete.js) +- [parallel/test-process-env-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env-deprecation.js) +- [parallel/test-process-env-ignore-getter-setter.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env-ignore-getter-setter.js) +- [parallel/test-process-env-sideeffects.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env-sideeffects.js) +- [parallel/test-process-env-symbols.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env-symbols.js) +- [parallel/test-process-env-tz.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env-tz.js) +- [parallel/test-process-env-windows-error-reset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env-windows-error-reset.js) +- [parallel/test-process-env.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env.js) +- [parallel/test-process-euid-egid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-euid-egid.js) +- [parallel/test-process-exception-capture-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-exception-capture-errors.js) +- [parallel/test-process-exception-capture-should-abort-on-uncaught-setflagsfromstring.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-exception-capture-should-abort-on-uncaught-setflagsfromstring.js) +- [parallel/test-process-exception-capture-should-abort-on-uncaught.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-exception-capture-should-abort-on-uncaught.js) +- [parallel/test-process-exception-capture.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-exception-capture.js) +- [parallel/test-process-exec-argv.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-exec-argv.js) +- [parallel/test-process-execpath.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-execpath.js) +- [parallel/test-process-exit-code-validation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-exit-code-validation.js) +- [parallel/test-process-exit-code.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-exit-code.js) +- [parallel/test-process-external-stdio-close-spawn.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-external-stdio-close-spawn.js) +- [parallel/test-process-external-stdio-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-external-stdio-close.js) +- [parallel/test-process-features.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-features.js) +- [parallel/test-process-getactivehandles.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-getactivehandles.js) +- [parallel/test-process-getactiverequests.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-getactiverequests.js) +- [parallel/test-process-getactiveresources-track-active-handles.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-getactiveresources-track-active-handles.js) +- [parallel/test-process-getactiveresources-track-active-requests.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-getactiveresources-track-active-requests.js) +- [parallel/test-process-getactiveresources-track-interval-lifetime.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-getactiveresources-track-interval-lifetime.js) +- [parallel/test-process-getactiveresources-track-multiple-timers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-getactiveresources-track-multiple-timers.js) +- [parallel/test-process-getactiveresources-track-timer-lifetime.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-getactiveresources-track-timer-lifetime.js) +- [parallel/test-process-getactiveresources.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-getactiveresources.js) +- [parallel/test-process-getgroups.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-getgroups.js) +- [parallel/test-process-hrtime-bigint.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-hrtime-bigint.js) +- [parallel/test-process-hrtime.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-hrtime.js) +- [parallel/test-process-initgroups.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-initgroups.js) +- [parallel/test-process-kill-null.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-kill-null.js) +- [parallel/test-process-next-tick.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-next-tick.js) +- [parallel/test-process-no-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-no-deprecation.js) +- [parallel/test-process-ppid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-ppid.js) +- [parallel/test-process-prototype.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-prototype.js) +- [parallel/test-process-raw-debug.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-raw-debug.js) +- [parallel/test-process-really-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-really-exit.js) +- [parallel/test-process-redirect-warnings-env.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-redirect-warnings-env.js) +- [parallel/test-process-redirect-warnings.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-redirect-warnings.js) +- [parallel/test-process-release.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-release.js) +- [parallel/test-process-remove-all-signal-listeners.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-remove-all-signal-listeners.js) +- [parallel/test-process-setgroups.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-setgroups.js) +- [parallel/test-process-setsourcemapsenabled.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-setsourcemapsenabled.js) +- [parallel/test-process-setuid-io-uring.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-setuid-io-uring.js) +- [parallel/test-process-title-cli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-title-cli.js) +- [parallel/test-process-uid-gid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-uid-gid.js) +- [parallel/test-process-umask-mask.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-umask-mask.js) +- [parallel/test-process-umask.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-umask.js) +- [parallel/test-process-uncaught-exception-monitor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-uncaught-exception-monitor.js) +- [parallel/test-process-versions.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-versions.js) +- [parallel/test-process-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-warning.js) +- [parallel/test-promise-handled-rejection-no-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-handled-rejection-no-warning.js) +- [parallel/test-promise-hook-create-hook.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-hook-create-hook.js) +- [parallel/test-promise-hook-exceptions.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-hook-exceptions.js) +- [parallel/test-promise-hook-on-after.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-hook-on-after.js) +- [parallel/test-promise-hook-on-before.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-hook-on-before.js) +- [parallel/test-promise-hook-on-init.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-hook-on-init.js) +- [parallel/test-promise-hook-on-resolve.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-hook-on-resolve.js) +- [parallel/test-promise-reject-callback-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-reject-callback-exception.js) +- [parallel/test-promise-swallowed-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-swallowed-event.js) +- [parallel/test-promise-unhandled-default.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-unhandled-default.js) +- [parallel/test-promise-unhandled-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-unhandled-error.js) +- [parallel/test-promise-unhandled-flag.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-unhandled-flag.js) +- [parallel/test-promise-unhandled-silent-no-hook.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-unhandled-silent-no-hook.js) +- [parallel/test-promise-unhandled-throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-unhandled-throw.js) +- [parallel/test-promise-unhandled-warn-no-hook.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-unhandled-warn-no-hook.js) +- [parallel/test-promise-unhandled-warn.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-unhandled-warn.js) +- [parallel/test-promises-unhandled-proxy-rejections.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promises-unhandled-proxy-rejections.js) +- [parallel/test-promises-unhandled-rejections.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promises-unhandled-rejections.js) +- [parallel/test-promises-unhandled-symbol-rejections.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promises-unhandled-symbol-rejections.js) +- [parallel/test-promises-warning-on-unhandled-rejection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promises-warning-on-unhandled-rejection.js) +- [parallel/test-queue-microtask-uncaught-asynchooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-queue-microtask-uncaught-asynchooks.js) +- [parallel/test-queue-microtask.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-queue-microtask.js) +- [parallel/test-readable-from-iterator-closing.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readable-from-iterator-closing.js) +- [parallel/test-readable-from-web-enqueue-then-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readable-from-web-enqueue-then-close.js) +- [parallel/test-readable-from.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readable-from.js) +- [parallel/test-readable-large-hwm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readable-large-hwm.js) +- [parallel/test-readable-single-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readable-single-end.js) +- [parallel/test-readline-async-iterators-backpressure.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-async-iterators-backpressure.js) +- [parallel/test-readline-async-iterators-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-async-iterators-destroy.js) +- [parallel/test-readline-async-iterators.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-async-iterators.js) +- [parallel/test-readline-carriage-return-between-chunks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-carriage-return-between-chunks.js) +- [parallel/test-readline-csi.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-csi.js) +- [parallel/test-readline-input-onerror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-input-onerror.js) +- [parallel/test-readline-interface-no-trailing-newline.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-interface-no-trailing-newline.js) +- [parallel/test-readline-interface-recursive-writes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-interface-recursive-writes.js) +- [parallel/test-readline-interface.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-interface.js) +- [parallel/test-readline-promises-interface.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-promises-interface.js) +- [parallel/test-readline-promises-tab-complete.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-promises-tab-complete.js) +- [parallel/test-readline-tab-complete.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-tab-complete.js) +- [parallel/test-ref-unref-return.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-ref-unref-return.js) +- [parallel/test-regression-object-prototype.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-regression-object-prototype.js) +- [parallel/test-release-changelog.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-release-changelog.js) +- [parallel/test-release-npm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-release-npm.js) +- [parallel/test-repl-array-prototype-tempering.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-array-prototype-tempering.js) +- [parallel/test-repl-autocomplete.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-autocomplete.js) +- [parallel/test-repl-autolibs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-autolibs.js) +- [parallel/test-repl-clear-immediate-crash.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-clear-immediate-crash.js) +- [parallel/test-repl-cli-eval.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-cli-eval.js) +- [parallel/test-repl-colors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-colors.js) +- [parallel/test-repl-context.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-context.js) +- [parallel/test-repl-definecommand.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-definecommand.js) +- [parallel/test-repl-domain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-domain.js) +- [parallel/test-repl-dynamic-import.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-dynamic-import.js) +- [parallel/test-repl-editor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-editor.js) +- [parallel/test-repl-empty.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-empty.js) +- [parallel/test-repl-end-emits-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-end-emits-exit.js) +- [parallel/test-repl-envvars.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-envvars.js) +- [parallel/test-repl-eval.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-eval.js) +- [parallel/test-repl-function-definition-edge-case.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-function-definition-edge-case.js) +- [parallel/test-repl-harmony.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-harmony.js) +- [parallel/test-repl-history-navigation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-history-navigation.js) +- [parallel/test-repl-history-perm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-history-perm.js) +- [parallel/test-repl-import-referrer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-import-referrer.js) +- [parallel/test-repl-inspect-defaults.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-inspect-defaults.js) +- [parallel/test-repl-inspector.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-inspector.js) +- [parallel/test-repl-let-process.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-let-process.js) +- [parallel/test-repl-load-multiline-no-trailing-newline.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-load-multiline-no-trailing-newline.js) +- [parallel/test-repl-load-multiline.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-load-multiline.js) +- [parallel/test-repl-mode.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-mode.js) +- [parallel/test-repl-multiline.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-multiline.js) +- [parallel/test-repl-no-terminal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-no-terminal.js) +- [parallel/test-repl-null-thrown.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-null-thrown.js) +- [parallel/test-repl-null.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-null.js) +- [parallel/test-repl-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-options.js) +- [parallel/test-repl-permission-model.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-permission-model.js) +- [parallel/test-repl-persistent-history.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-persistent-history.js) +- [parallel/test-repl-preprocess-top-level-await.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-preprocess-top-level-await.js) +- [parallel/test-repl-pretty-custom-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-pretty-custom-stack.js) +- [parallel/test-repl-pretty-stack-custom-writer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-pretty-stack-custom-writer.js) +- [parallel/test-repl-pretty-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-pretty-stack.js) +- [parallel/test-repl-preview.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-preview.js) +- [parallel/test-repl-programmatic-history.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-programmatic-history.js) +- [parallel/test-repl-recoverable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-recoverable.js) +- [parallel/test-repl-require-after-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-require-after-write.js) +- [parallel/test-repl-require-cache.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-require-cache.js) +- [parallel/test-repl-require-context.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-require-context.js) +- [parallel/test-repl-require-self-referential.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-require-self-referential.js) +- [parallel/test-repl-require.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-require.js) +- [parallel/test-repl-reset-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-reset-event.js) +- [parallel/test-repl-reverse-search.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-reverse-search.js) +- [parallel/test-repl-save-load.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-save-load.js) +- [parallel/test-repl-setprompt.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-setprompt.js) +- [parallel/test-repl-sigint-nested-eval.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-sigint-nested-eval.js) +- [parallel/test-repl-sigint.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-sigint.js) +- [parallel/test-repl-stdin-push-null.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-stdin-push-null.js) +- [parallel/test-repl-strict-mode-previews.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-strict-mode-previews.js) +- [parallel/test-repl-syntax-error-handling.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-syntax-error-handling.js) +- [parallel/test-repl-syntax-error-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-syntax-error-stack.js) +- [parallel/test-repl-tab-complete-crash.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-tab-complete-crash.js) +- [parallel/test-repl-tab-complete-import.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-tab-complete-import.js) +- [parallel/test-repl-tab-complete-nested-repls.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-tab-complete-nested-repls.js) +- [parallel/test-repl-tab-complete-no-warn.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-tab-complete-no-warn.js) +- [parallel/test-repl-tab-complete-on-editor-mode.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-tab-complete-on-editor-mode.js) +- [parallel/test-repl-tab-complete.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-tab-complete.js) +- [parallel/test-repl-tab.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-tab.js) +- [parallel/test-repl-throw-null-or-undefined.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-throw-null-or-undefined.js) +- [parallel/test-repl-top-level-await.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-top-level-await.js) +- [parallel/test-repl-uncaught-exception-async.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-uncaught-exception-async.js) +- [parallel/test-repl-uncaught-exception-evalcallback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-uncaught-exception-evalcallback.js) +- [parallel/test-repl-uncaught-exception-standalone.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-uncaught-exception-standalone.js) +- [parallel/test-repl-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-uncaught-exception.js) +- [parallel/test-repl-underscore.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-underscore.js) +- [parallel/test-repl-unexpected-token-recoverable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-unexpected-token-recoverable.js) +- [parallel/test-repl-unsafe-array-iteration.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-unsafe-array-iteration.js) +- [parallel/test-repl-unsupported-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-unsupported-option.js) +- [parallel/test-repl-use-global.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-use-global.js) +- [parallel/test-repl.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl.js) +- [parallel/test-require-cache.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-cache.js) +- [parallel/test-require-delete-array-iterator.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-delete-array-iterator.js) +- [parallel/test-require-dot.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-dot.js) +- [parallel/test-require-empty-main.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-empty-main.js) +- [parallel/test-require-enoent-dir.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-enoent-dir.js) +- [parallel/test-require-exceptions.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-exceptions.js) +- [parallel/test-require-extension-over-directory.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-extension-over-directory.js) +- [parallel/test-require-extensions-main.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-extensions-main.js) +- [parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js) +- [parallel/test-require-extensions-same-filename-as-dir.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-extensions-same-filename-as-dir.js) +- [parallel/test-require-invalid-main-no-exports.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-invalid-main-no-exports.js) +- [parallel/test-require-invalid-package.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-invalid-package.js) +- [parallel/test-require-json.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-json.js) +- [parallel/test-require-long-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-long-path.js) +- [parallel/test-require-mjs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-mjs.js) +- [parallel/test-require-node-prefix.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-node-prefix.js) +- [parallel/test-require-nul.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-nul.js) +- [parallel/test-require-process.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-process.js) +- [parallel/test-require-resolve.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-resolve.js) +- [parallel/test-require-symlink.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-symlink.js) +- [parallel/test-require-unicode.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-unicode.js) +- [parallel/test-resource-usage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-resource-usage.js) +- [parallel/test-runner-cli-concurrency.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-cli-concurrency.js) +- [parallel/test-runner-cli-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-cli-timeout.js) +- [parallel/test-runner-cli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-cli.js) +- [parallel/test-runner-concurrency.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-concurrency.js) +- [parallel/test-runner-coverage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-coverage.js) +- [parallel/test-runner-exit-code.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-exit-code.js) +- [parallel/test-runner-extraneous-async-activity.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-extraneous-async-activity.js) +- [parallel/test-runner-filetest-location.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-filetest-location.js) +- [parallel/test-runner-import-no-scheme.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-import-no-scheme.js) +- [parallel/test-runner-misc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-misc.js) +- [parallel/test-runner-mock-timers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-mock-timers.js) +- [parallel/test-runner-mocking.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-mocking.js) +- [parallel/test-runner-option-validation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-option-validation.js) +- [parallel/test-runner-reporters.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-reporters.js) +- [parallel/test-runner-root-after-with-refed-handles.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-root-after-with-refed-handles.js) +- [parallel/test-runner-string-to-regexp.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-string-to-regexp.js) +- [parallel/test-runner-test-filter.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-test-filter.js) +- [parallel/test-runner-typechecking.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-runner-typechecking.js) +- [parallel/test-safe-get-env.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-safe-get-env.js) +- [parallel/test-security-revert-unknown.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-security-revert-unknown.js) +- [parallel/test-set-http-max-http-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-set-http-max-http-headers.js) +- [parallel/test-set-incoming-message-header.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-set-incoming-message-header.js) +- [parallel/test-set-process-debug-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-set-process-debug-port.js) +- [parallel/test-setproctitle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-setproctitle.js) +- [parallel/test-shadow-realm-allowed-builtin-modules.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-shadow-realm-allowed-builtin-modules.js) +- [parallel/test-shadow-realm-custom-loaders.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-shadow-realm-custom-loaders.js) +- [parallel/test-shadow-realm-gc-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-shadow-realm-gc-module.js) +- [parallel/test-shadow-realm-gc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-shadow-realm-gc.js) +- [parallel/test-shadow-realm-globals.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-shadow-realm-globals.js) +- [parallel/test-shadow-realm-import-value-resolve.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-shadow-realm-import-value-resolve.js) +- [parallel/test-shadow-realm-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-shadow-realm-module.js) +- [parallel/test-shadow-realm-preload-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-shadow-realm-preload-module.js) +- [parallel/test-shadow-realm-prepare-stack-trace.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-shadow-realm-prepare-stack-trace.js) +- [parallel/test-shadow-realm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-shadow-realm.js) +- [parallel/test-sigint-infinite-loop.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-sigint-infinite-loop.js) +- [parallel/test-signal-args.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-signal-args.js) +- [parallel/test-signal-handler-remove-on-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-signal-handler-remove-on-exit.js) +- [parallel/test-signal-handler.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-signal-handler.js) +- [parallel/test-signal-safety.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-signal-safety.js) +- [parallel/test-signal-unregister.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-signal-unregister.js) +- [parallel/test-single-executable-blob-config-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-single-executable-blob-config-errors.js) +- [parallel/test-single-executable-blob-config.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-single-executable-blob-config.js) +- [parallel/test-snapshot-api.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-api.js) +- [parallel/test-snapshot-argv1.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-argv1.js) +- [parallel/test-snapshot-basic.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-basic.js) +- [parallel/test-snapshot-cjs-main.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-cjs-main.js) +- [parallel/test-snapshot-console.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-console.js) +- [parallel/test-snapshot-cwd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-cwd.js) +- [parallel/test-snapshot-dns-lookup-localhost-promise.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-dns-lookup-localhost-promise.js) +- [parallel/test-snapshot-dns-lookup-localhost.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-dns-lookup-localhost.js) +- [parallel/test-snapshot-dns-resolve-localhost-promise.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-dns-resolve-localhost-promise.js) +- [parallel/test-snapshot-dns-resolve-localhost.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-dns-resolve-localhost.js) +- [parallel/test-snapshot-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-error.js) +- [parallel/test-snapshot-eval.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-eval.js) +- [parallel/test-snapshot-gzip.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-gzip.js) +- [parallel/test-snapshot-incompatible.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-incompatible.js) +- [parallel/test-snapshot-namespaced-builtin.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-namespaced-builtin.js) +- [parallel/test-snapshot-net.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-net.js) +- [parallel/test-snapshot-typescript.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-typescript.js) +- [parallel/test-snapshot-umd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-umd.js) +- [parallel/test-snapshot-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-warning.js) +- [parallel/test-snapshot-weak-reference.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-weak-reference.js) +- [parallel/test-snapshot-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-worker.js) +- [parallel/test-socket-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-socket-address.js) +- [parallel/test-socket-options-invalid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-socket-options-invalid.js) +- [parallel/test-socket-write-after-fin-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-socket-write-after-fin-error.js) +- [parallel/test-socket-write-after-fin.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-socket-write-after-fin.js) +- [parallel/test-socket-writes-before-passed-to-tls-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-socket-writes-before-passed-to-tls-socket.js) +- [parallel/test-socketaddress.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-socketaddress.js) +- [parallel/test-source-map-api.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-source-map-api.js) +- [parallel/test-source-map-enable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-source-map-enable.js) +- [parallel/test-spawn-cmd-named-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-spawn-cmd-named-pipe.js) +- [parallel/test-stack-size-limit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stack-size-limit.js) +- [parallel/test-startup-empty-regexp-statics.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-startup-empty-regexp-statics.js) +- [parallel/test-startup-large-pages.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-startup-large-pages.js) +- [parallel/test-stdin-child-proc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-child-proc.js) +- [parallel/test-stdin-from-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-from-file.js) +- [parallel/test-stdin-hang.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-hang.js) +- [parallel/test-stdin-pause-resume-sync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-pause-resume-sync.js) +- [parallel/test-stdin-pause-resume.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-pause-resume.js) +- [parallel/test-stdin-pipe-large.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-pipe-large.js) +- [parallel/test-stdin-pipe-resume.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-pipe-resume.js) +- [parallel/test-stdin-resume-pause.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-resume-pause.js) +- [parallel/test-stdin-script-child-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-script-child-option.js) +- [parallel/test-stdin-script-child.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-script-child.js) +- [parallel/test-stdio-closed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdio-closed.js) +- [parallel/test-stdio-pipe-access.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdio-pipe-access.js) +- [parallel/test-stdio-pipe-redirect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdio-pipe-redirect.js) +- [parallel/test-stdio-pipe-stderr.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdio-pipe-stderr.js) +- [parallel/test-stdio-undestroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdio-undestroy.js) +- [parallel/test-stdout-cannot-be-closed-child-process-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdout-cannot-be-closed-child-process-pipe.js) +- [parallel/test-stdout-close-catch.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdout-close-catch.js) +- [parallel/test-stdout-close-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdout-close-unref.js) +- [parallel/test-stdout-pipeline-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdout-pipeline-destroy.js) +- [parallel/test-stdout-stderr-reading.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdout-stderr-reading.js) +- [parallel/test-stdout-stderr-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdout-stderr-write.js) +- [parallel/test-stdout-to-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdout-to-file.js) +- [parallel/test-strace-openat-openssl.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-strace-openat-openssl.js) +- [parallel/test-stream-base-prototype-accessors-enumerability.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-base-prototype-accessors-enumerability.js) +- [parallel/test-stream-base-typechecking.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-base-typechecking.js) +- [parallel/test-stream-catch-rejections.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-catch-rejections.js) +- [parallel/test-stream-compose-operator.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-compose-operator.js) +- [parallel/test-stream-compose.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-compose.js) +- [parallel/test-stream-consumers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-consumers.js) +- [parallel/test-stream-decoder-objectmode.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-decoder-objectmode.js) +- [parallel/test-stream-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-destroy.js) +- [parallel/test-stream-drop-take.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-drop-take.js) +- [parallel/test-stream-duplex-readable-writable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-duplex-readable-writable.js) +- [parallel/test-stream-end-of-streams.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-end-of-streams.js) +- [parallel/test-stream-filter.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-filter.js) +- [parallel/test-stream-finished.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-finished.js) +- [parallel/test-stream-flatMap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-flatMap.js) +- [parallel/test-stream-forEach.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-forEach.js) +- [parallel/test-stream-map.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-map.js) +- [parallel/test-stream-passthrough-drain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-passthrough-drain.js) +- [parallel/test-stream-pipe-deadlock.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-pipe-deadlock.js) +- [parallel/test-stream-pipe-error-unhandled.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-pipe-error-unhandled.js) +- [parallel/test-stream-pipeline-duplex.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-pipeline-duplex.js) +- [parallel/test-stream-pipeline-http2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-pipeline-http2.js) +- [parallel/test-stream-pipeline-listeners.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-pipeline-listeners.js) +- [parallel/test-stream-pipeline-process.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-pipeline-process.js) +- [parallel/test-stream-pipeline-uncaught.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-pipeline-uncaught.js) +- [parallel/test-stream-pipeline.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-pipeline.js) +- [parallel/test-stream-preprocess.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-preprocess.js) +- [parallel/test-stream-promises.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-promises.js) +- [parallel/test-stream-push-order.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-push-order.js) +- [parallel/test-stream-readable-async-iterators.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-readable-async-iterators.js) +- [parallel/test-stream-readable-default-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-readable-default-encoding.js) +- [parallel/test-stream-readable-dispose.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-readable-dispose.js) +- [parallel/test-stream-readable-strategy-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-readable-strategy-option.js) +- [parallel/test-stream-readable-unpipe-resume.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-readable-unpipe-resume.js) +- [parallel/test-stream-reduce.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-reduce.js) +- [parallel/test-stream-set-default-hwm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-set-default-hwm.js) +- [parallel/test-stream-toArray.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-toArray.js) +- [parallel/test-stream-toWeb-allows-server-response.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-toWeb-allows-server-response.js) +- [parallel/test-stream-transform-hwm0.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-transform-hwm0.js) +- [parallel/test-stream-wrap-drain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-wrap-drain.js) +- [parallel/test-stream-wrap-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-wrap-encoding.js) +- [parallel/test-stream-wrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-wrap.js) +- [parallel/test-stream-writable-end-cb-uncaught.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-writable-end-cb-uncaught.js) +- [parallel/test-stream-writable-samecb-singletick.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-writable-samecb-singletick.js) +- [parallel/test-stream2-finish-pipe-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream2-finish-pipe-error.js) +- [parallel/test-stream2-httpclient-response-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream2-httpclient-response-end.js) +- [parallel/test-stream3-pipeline-async-iterator.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream3-pipeline-async-iterator.js) +- [parallel/test-string-decoder-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-string-decoder-end.js) +- [parallel/test-string-decoder-fuzz.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-string-decoder-fuzz.js) +- [parallel/test-stringbytes-external.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stringbytes-external.js) +- [parallel/test-structuredClone-global.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-structuredClone-global.js) +- [parallel/test-sync-fileread.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-sync-fileread.js) +- [parallel/test-sync-io-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-sync-io-option.js) +- [parallel/test-sys.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-sys.js) +- [parallel/test-tcp-wrap-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tcp-wrap-connect.js) +- [parallel/test-tcp-wrap-listen.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tcp-wrap-listen.js) +- [parallel/test-tcp-wrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tcp-wrap.js) +- [parallel/test-tick-processor-arguments.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tick-processor-arguments.js) +- [parallel/test-tick-processor-version-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tick-processor-version-check.js) +- [parallel/test-timer-immediate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timer-immediate.js) +- [parallel/test-timers-active.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-active.js) +- [parallel/test-timers-clearImmediate-als.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-clearImmediate-als.js) +- [parallel/test-timers-destroyed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-destroyed.js) +- [parallel/test-timers-dispose.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-dispose.js) +- [parallel/test-timers-enroll-invalid-msecs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-enroll-invalid-msecs.js) +- [parallel/test-timers-enroll-second-time.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-enroll-second-time.js) +- [parallel/test-timers-immediate-promisified.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-immediate-promisified.js) +- [parallel/test-timers-immediate-queue-throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-immediate-queue-throw.js) +- [parallel/test-timers-immediate-queue.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-immediate-queue.js) +- [parallel/test-timers-immediate-unref-nested-once.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-immediate-unref-nested-once.js) +- [parallel/test-timers-immediate-unref-simple.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-immediate-unref-simple.js) +- [parallel/test-timers-immediate-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-immediate-unref.js) +- [parallel/test-timers-immediate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-immediate.js) +- [parallel/test-timers-interval-promisified.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-interval-promisified.js) +- [parallel/test-timers-linked-list.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-linked-list.js) +- [parallel/test-timers-max-duration-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-max-duration-warning.js) +- [parallel/test-timers-nested.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-nested.js) +- [parallel/test-timers-next-tick.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-next-tick.js) +- [parallel/test-timers-now.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-now.js) +- [parallel/test-timers-ordering.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-ordering.js) +- [parallel/test-timers-promises-scheduler.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-promises-scheduler.js) +- [parallel/test-timers-refresh-in-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-refresh-in-callback.js) +- [parallel/test-timers-reset-process-domain-on-throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-reset-process-domain-on-throw.js) +- [parallel/test-timers-setimmediate-infinite-loop.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-setimmediate-infinite-loop.js) +- [parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js) +- [parallel/test-timers-this.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-this.js) +- [parallel/test-timers-throw-when-cb-not-function.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-throw-when-cb-not-function.js) +- [parallel/test-timers-timeout-promisified.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-timeout-promisified.js) +- [parallel/test-timers-timeout-to-interval.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-timeout-to-interval.js) +- [parallel/test-timers-to-primitive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-to-primitive.js) +- [parallel/test-timers-unenroll-unref-interval.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-unenroll-unref-interval.js) +- [parallel/test-timers-unref-active.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-unref-active.js) +- [parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js) +- [parallel/test-timers-unref-remove-other-unref-timers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-unref-remove-other-unref-timers.js) +- [parallel/test-timers-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-unref.js) +- [parallel/test-timers-unrefd-interval-still-fires.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-unrefd-interval-still-fires.js) +- [parallel/test-timers-unrefed-in-beforeexit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-unrefed-in-beforeexit.js) +- [parallel/test-timers-unrefed-in-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-unrefed-in-callback.js) +- [parallel/test-timers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers.js) +- [parallel/test-tls-0-dns-altname.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-0-dns-altname.js) +- [parallel/test-tls-add-context.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-add-context.js) +- [parallel/test-tls-addca.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-addca.js) +- [parallel/test-tls-alert-handling.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-alert-handling.js) +- [parallel/test-tls-alert.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-alert.js) +- [parallel/test-tls-alpn-server-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-alpn-server-client.js) +- [parallel/test-tls-async-cb-after-socket-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-async-cb-after-socket-end.js) +- [parallel/test-tls-basic-validations.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-basic-validations.js) +- [parallel/test-tls-buffersize.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-buffersize.js) +- [parallel/test-tls-ca-concat.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-ca-concat.js) +- [parallel/test-tls-canonical-ip.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-canonical-ip.js) +- [parallel/test-tls-cert-chains-concat.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-cert-chains-concat.js) +- [parallel/test-tls-cert-chains-in-ca.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-cert-chains-in-ca.js) +- [parallel/test-tls-cert-ext-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-cert-ext-encoding.js) +- [parallel/test-tls-cert-regression.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-cert-regression.js) +- [parallel/test-tls-check-server-identity.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-check-server-identity.js) +- [parallel/test-tls-cipher-list.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-cipher-list.js) +- [parallel/test-tls-cli-max-version-1.2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-cli-max-version-1.2.js) +- [parallel/test-tls-cli-max-version-1.3.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-cli-max-version-1.3.js) +- [parallel/test-tls-cli-min-max-conflict.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-cli-min-max-conflict.js) +- [parallel/test-tls-cli-min-version-1.0.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-cli-min-version-1.0.js) +- [parallel/test-tls-cli-min-version-1.1.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-cli-min-version-1.1.js) +- [parallel/test-tls-cli-min-version-1.2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-cli-min-version-1.2.js) +- [parallel/test-tls-cli-min-version-1.3.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-cli-min-version-1.3.js) +- [parallel/test-tls-client-abort.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-abort.js) +- [parallel/test-tls-client-abort2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-abort2.js) +- [parallel/test-tls-client-auth.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-auth.js) +- [parallel/test-tls-client-default-ciphers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-default-ciphers.js) +- [parallel/test-tls-client-destroy-soon.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-destroy-soon.js) +- [parallel/test-tls-client-getephemeralkeyinfo.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-getephemeralkeyinfo.js) +- [parallel/test-tls-client-mindhsize.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-mindhsize.js) +- [parallel/test-tls-client-reject-12.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-reject-12.js) +- [parallel/test-tls-client-reject.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-reject.js) +- [parallel/test-tls-client-renegotiation-13.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-renegotiation-13.js) +- [parallel/test-tls-client-renegotiation-limit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-renegotiation-limit.js) +- [parallel/test-tls-client-resume-12.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-resume-12.js) +- [parallel/test-tls-client-resume.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-resume.js) +- [parallel/test-tls-client-verify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-verify.js) +- [parallel/test-tls-clientcertengine-invalid-arg-type.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-clientcertengine-invalid-arg-type.js) +- [parallel/test-tls-clientcertengine-unsupported.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-clientcertengine-unsupported.js) +- [parallel/test-tls-close-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-close-error.js) +- [parallel/test-tls-close-event-after-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-close-event-after-write.js) +- [parallel/test-tls-close-notify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-close-notify.js) +- [parallel/test-tls-cnnic-whitelist.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-cnnic-whitelist.js) +- [parallel/test-tls-connect-abort-controller.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-connect-abort-controller.js) +- [parallel/test-tls-connect-address-family.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-connect-address-family.js) +- [parallel/test-tls-connect-allow-half-open-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-connect-allow-half-open-option.js) +- [parallel/test-tls-connect-given-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-connect-given-socket.js) +- [parallel/test-tls-connect-hints-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-connect-hints-option.js) +- [parallel/test-tls-connect-hwm-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-connect-hwm-option.js) +- [parallel/test-tls-connect-memleak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-connect-memleak.js) +- [parallel/test-tls-connect-no-host.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-connect-no-host.js) +- [parallel/test-tls-connect-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-connect-pipe.js) +- [parallel/test-tls-connect-secure-context.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-connect-secure-context.js) +- [parallel/test-tls-connect-simple.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-connect-simple.js) +- [parallel/test-tls-connect-stream-writes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-connect-stream-writes.js) +- [parallel/test-tls-connect-timeout-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-connect-timeout-option.js) +- [parallel/test-tls-delayed-attach-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-delayed-attach-error.js) +- [parallel/test-tls-delayed-attach.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-delayed-attach.js) +- [parallel/test-tls-destroy-stream-12.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-destroy-stream-12.js) +- [parallel/test-tls-destroy-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-destroy-stream.js) +- [parallel/test-tls-destroy-whilst-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-destroy-whilst-write.js) +- [parallel/test-tls-dhe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-dhe.js) +- [parallel/test-tls-disable-renegotiation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-disable-renegotiation.js) +- [parallel/test-tls-ecdh-auto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-ecdh-auto.js) +- [parallel/test-tls-ecdh-multiple.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-ecdh-multiple.js) +- [parallel/test-tls-ecdh.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-ecdh.js) +- [parallel/test-tls-econnreset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-econnreset.js) +- [parallel/test-tls-empty-sni-context.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-empty-sni-context.js) +- [parallel/test-tls-enable-keylog-cli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-enable-keylog-cli.js) +- [parallel/test-tls-enable-trace-cli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-enable-trace-cli.js) +- [parallel/test-tls-enable-trace.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-enable-trace.js) +- [parallel/test-tls-env-bad-extra-ca.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-env-bad-extra-ca.js) +- [parallel/test-tls-env-extra-ca-file-load.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-env-extra-ca-file-load.js) +- [parallel/test-tls-env-extra-ca-no-crypto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-env-extra-ca-no-crypto.js) +- [parallel/test-tls-env-extra-ca.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-env-extra-ca.js) +- [parallel/test-tls-error-servername.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-error-servername.js) +- [parallel/test-tls-exportkeyingmaterial.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-exportkeyingmaterial.js) +- [parallel/test-tls-external-accessor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-external-accessor.js) +- [parallel/test-tls-fast-writing.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-fast-writing.js) +- [parallel/test-tls-finished.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-finished.js) +- [parallel/test-tls-friendly-error-message.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-friendly-error-message.js) +- [parallel/test-tls-generic-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-generic-stream.js) +- [parallel/test-tls-getcertificate-x509.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-getcertificate-x509.js) +- [parallel/test-tls-getcipher.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-getcipher.js) +- [parallel/test-tls-getprotocol.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-getprotocol.js) +- [parallel/test-tls-handshake-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-handshake-error.js) +- [parallel/test-tls-handshake-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-handshake-exception.js) +- [parallel/test-tls-handshake-nohang.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-handshake-nohang.js) +- [parallel/test-tls-hello-parser-failure.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-hello-parser-failure.js) +- [parallel/test-tls-honorcipherorder.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-honorcipherorder.js) +- [parallel/test-tls-inception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-inception.js) +- [parallel/test-tls-interleave.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-interleave.js) +- [parallel/test-tls-invalid-pfx.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-invalid-pfx.js) +- [parallel/test-tls-invoke-queued.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-invoke-queued.js) +- [parallel/test-tls-ip-servername-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-ip-servername-deprecation.js) +- [parallel/test-tls-js-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-js-stream.js) +- [parallel/test-tls-junk-closes-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-junk-closes-server.js) +- [parallel/test-tls-junk-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-junk-server.js) +- [parallel/test-tls-key-mismatch.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-key-mismatch.js) +- [parallel/test-tls-keyengine-invalid-arg-type.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-keyengine-invalid-arg-type.js) +- [parallel/test-tls-keyengine-unsupported.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-keyengine-unsupported.js) +- [parallel/test-tls-keylog-tlsv13.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-keylog-tlsv13.js) +- [parallel/test-tls-legacy-deprecated.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-legacy-deprecated.js) +- [parallel/test-tls-max-send-fragment.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-max-send-fragment.js) +- [parallel/test-tls-min-max-version.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-min-max-version.js) +- [parallel/test-tls-multi-key.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-multi-key.js) +- [parallel/test-tls-multi-pfx.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-multi-pfx.js) +- [parallel/test-tls-multiple-cas-as-string.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-multiple-cas-as-string.js) +- [parallel/test-tls-net-connect-prefer-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-net-connect-prefer-path.js) +- [parallel/test-tls-net-socket-keepalive-12.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-net-socket-keepalive-12.js) +- [parallel/test-tls-net-socket-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-net-socket-keepalive.js) +- [parallel/test-tls-no-cert-required.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-no-cert-required.js) +- [parallel/test-tls-no-rsa-key.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-no-rsa-key.js) +- [parallel/test-tls-no-sslv23.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-no-sslv23.js) +- [parallel/test-tls-no-sslv3.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-no-sslv3.js) +- [parallel/test-tls-ocsp-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-ocsp-callback.js) +- [parallel/test-tls-on-empty-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-on-empty-socket.js) +- [parallel/test-tls-onread-static-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-onread-static-buffer.js) +- [parallel/test-tls-options-boolean-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-options-boolean-check.js) +- [parallel/test-tls-over-http-tunnel.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-over-http-tunnel.js) +- [parallel/test-tls-passphrase.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-passphrase.js) +- [parallel/test-tls-pause.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-pause.js) +- [parallel/test-tls-peer-certificate-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-peer-certificate-encoding.js) +- [parallel/test-tls-peer-certificate-multi-keys.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-peer-certificate-multi-keys.js) +- [parallel/test-tls-peer-certificate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-peer-certificate.js) +- [parallel/test-tls-pfx-authorizationerror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-pfx-authorizationerror.js) +- [parallel/test-tls-psk-circuit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-psk-circuit.js) +- [parallel/test-tls-psk-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-psk-errors.js) +- [parallel/test-tls-psk-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-psk-server.js) +- [parallel/test-tls-reduced-SECLEVEL-in-cipher.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-reduced-SECLEVEL-in-cipher.js) +- [parallel/test-tls-reinitialize-listeners.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-reinitialize-listeners.js) +- [parallel/test-tls-request-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-request-timeout.js) +- [parallel/test-tls-retain-handle-no-abort.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-retain-handle-no-abort.js) +- [parallel/test-tls-reuse-host-from-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-reuse-host-from-socket.js) +- [parallel/test-tls-root-certificates.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-root-certificates.js) +- [parallel/test-tls-secure-context-usage-order.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-secure-context-usage-order.js) +- [parallel/test-tls-secure-session.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-secure-session.js) +- [parallel/test-tls-securepair-fiftharg.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-securepair-fiftharg.js) +- [parallel/test-tls-securepair-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-securepair-leak.js) +- [parallel/test-tls-securepair-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-securepair-server.js) +- [parallel/test-tls-server-capture-rejection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-server-capture-rejection.js) +- [parallel/test-tls-server-connection-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-server-connection-server.js) +- [parallel/test-tls-server-failed-handshake-emits-clienterror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-server-failed-handshake-emits-clienterror.js) +- [parallel/test-tls-server-parent-constructor-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-server-parent-constructor-options.js) +- [parallel/test-tls-server-setoptions-clientcertengine.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-server-setoptions-clientcertengine.js) +- [parallel/test-tls-server-verify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-server-verify.js) +- [parallel/test-tls-session-cache.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-session-cache.js) +- [parallel/test-tls-set-ciphers-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-set-ciphers-error.js) +- [parallel/test-tls-set-ciphers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-set-ciphers.js) +- [parallel/test-tls-set-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-set-encoding.js) +- [parallel/test-tls-set-secure-context.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-set-secure-context.js) +- [parallel/test-tls-set-sigalgs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-set-sigalgs.js) +- [parallel/test-tls-sni-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-sni-option.js) +- [parallel/test-tls-sni-server-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-sni-server-client.js) +- [parallel/test-tls-sni-servername.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-sni-servername.js) +- [parallel/test-tls-snicallback-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-snicallback-error.js) +- [parallel/test-tls-socket-allow-half-open-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-socket-allow-half-open-option.js) +- [parallel/test-tls-socket-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-socket-close.js) +- [parallel/test-tls-socket-constructor-alpn-options-parsing.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-socket-constructor-alpn-options-parsing.js) +- [parallel/test-tls-socket-default-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-socket-default-options.js) +- [parallel/test-tls-socket-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-socket-destroy.js) +- [parallel/test-tls-socket-failed-handshake-emits-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-socket-failed-handshake-emits-error.js) +- [parallel/test-tls-socket-snicallback-without-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-socket-snicallback-without-server.js) +- [parallel/test-tls-startcom-wosign-whitelist.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-startcom-wosign-whitelist.js) +- [parallel/test-tls-starttls-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-starttls-server.js) +- [parallel/test-tls-streamwrap-buffersize.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-streamwrap-buffersize.js) +- [parallel/test-tls-ticket-12.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-ticket-12.js) +- [parallel/test-tls-ticket-cluster.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-ticket-cluster.js) +- [parallel/test-tls-ticket-invalid-arg.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-ticket-invalid-arg.js) +- [parallel/test-tls-ticket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-ticket.js) +- [parallel/test-tls-timeout-server-2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-timeout-server-2.js) +- [parallel/test-tls-timeout-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-timeout-server.js) +- [parallel/test-tls-tlswrap-segfault-2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-tlswrap-segfault-2.js) +- [parallel/test-tls-tlswrap-segfault.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-tlswrap-segfault.js) +- [parallel/test-tls-translate-peer-certificate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-translate-peer-certificate.js) +- [parallel/test-tls-transport-destroy-after-own-gc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-transport-destroy-after-own-gc.js) +- [parallel/test-tls-use-after-free-regression.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-use-after-free-regression.js) +- [parallel/test-tls-wrap-econnreset-localaddress.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-wrap-econnreset-localaddress.js) +- [parallel/test-tls-wrap-econnreset-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-wrap-econnreset-pipe.js) +- [parallel/test-tls-wrap-econnreset-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-wrap-econnreset-socket.js) +- [parallel/test-tls-wrap-econnreset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-wrap-econnreset.js) +- [parallel/test-tls-wrap-event-emmiter.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-wrap-event-emmiter.js) +- [parallel/test-tls-wrap-no-abort.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-wrap-no-abort.js) +- [parallel/test-tls-wrap-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-wrap-timeout.js) +- [parallel/test-tls-write-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-write-error.js) +- [parallel/test-tls-writewrap-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-writewrap-leak.js) +- [parallel/test-tls-zero-clear-in.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-zero-clear-in.js) +- [parallel/test-tojson-perf_hooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tojson-perf_hooks.js) +- [parallel/test-trace-atomics-wait.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-atomics-wait.js) +- [parallel/test-trace-events-all.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-all.js) +- [parallel/test-trace-events-api-worker-disabled.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-api-worker-disabled.js) +- [parallel/test-trace-events-api.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-api.js) +- [parallel/test-trace-events-async-hooks-dynamic.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-async-hooks-dynamic.js) +- [parallel/test-trace-events-async-hooks-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-async-hooks-worker.js) +- [parallel/test-trace-events-async-hooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-async-hooks.js) +- [parallel/test-trace-events-binding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-binding.js) +- [parallel/test-trace-events-bootstrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-bootstrap.js) +- [parallel/test-trace-events-category-used.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-category-used.js) +- [parallel/test-trace-events-console.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-console.js) +- [parallel/test-trace-events-dynamic-enable-workers-disabled.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-dynamic-enable-workers-disabled.js) +- [parallel/test-trace-events-dynamic-enable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-dynamic-enable.js) +- [parallel/test-trace-events-environment.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-environment.js) +- [parallel/test-trace-events-file-pattern.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-file-pattern.js) +- [parallel/test-trace-events-fs-async.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-fs-async.js) +- [parallel/test-trace-events-fs-sync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-fs-sync.js) +- [parallel/test-trace-events-http.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-http.js) +- [parallel/test-trace-events-metadata.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-metadata.js) +- [parallel/test-trace-events-net.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-net.js) +- [parallel/test-trace-events-none.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-none.js) +- [parallel/test-trace-events-process-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-process-exit.js) +- [parallel/test-trace-events-promises.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-promises.js) +- [parallel/test-trace-events-threadpool.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-threadpool.js) +- [parallel/test-trace-events-v8.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-v8.js) +- [parallel/test-trace-events-vm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-vm.js) +- [parallel/test-trace-events-worker-metadata-with-name.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-worker-metadata-with-name.js) +- [parallel/test-trace-events-worker-metadata.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-worker-metadata.js) +- [parallel/test-trace-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-exit.js) +- [parallel/test-tracing-no-crash.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tracing-no-crash.js) +- [parallel/test-tty-backwards-api.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tty-backwards-api.js) +- [parallel/test-tty-stdin-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tty-stdin-pipe.js) +- [parallel/test-ttywrap-invalid-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-ttywrap-invalid-fd.js) +- [parallel/test-ttywrap-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-ttywrap-stack.js) +- [parallel/test-tz-version.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tz-version.js) +- [parallel/test-unhandled-exception-rethrow-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-unhandled-exception-rethrow-error.js) +- [parallel/test-unhandled-exception-with-worker-inuse.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-unhandled-exception-with-worker-inuse.js) +- [parallel/test-unicode-node-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-unicode-node-options.js) +- [parallel/test-url-canParse-whatwg.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-url-canParse-whatwg.js) +- [parallel/test-url-is-url.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-url-is-url.js) +- [parallel/test-url-null-char.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-url-null-char.js) +- [parallel/test-url-parse-format.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-url-parse-format.js) +- [parallel/test-utf8-scripts.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-utf8-scripts.js) +- [parallel/test-util-callbackify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-util-callbackify.js) +- [parallel/test-util-emit-experimental-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-util-emit-experimental-warning.js) +- [parallel/test-util-inspect-getters-accessing-this.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-util-inspect-getters-accessing-this.js) +- [parallel/test-util-internal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-util-internal.js) +- [parallel/test-util-log.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-util-log.js) +- [parallel/test-util-primordial-monkeypatching.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-util-primordial-monkeypatching.js) +- [parallel/test-util-sigint-watchdog.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-util-sigint-watchdog.js) +- [parallel/test-util-sleep.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-util-sleep.js) +- [parallel/test-uv-binding-constant.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-uv-binding-constant.js) +- [parallel/test-uv-errmap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-uv-errmap.js) +- [parallel/test-uv-errno.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-uv-errno.js) +- [parallel/test-uv-unmapped-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-uv-unmapped-exception.js) +- [parallel/test-v8-collect-gc-profile-exit-before-stop.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-collect-gc-profile-exit-before-stop.js) +- [parallel/test-v8-collect-gc-profile-in-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-collect-gc-profile-in-worker.js) +- [parallel/test-v8-collect-gc-profile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-collect-gc-profile.js) +- [parallel/test-v8-coverage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-coverage.js) +- [parallel/test-v8-deserialize-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-deserialize-buffer.js) +- [parallel/test-v8-flag-pool-size-0.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-flag-pool-size-0.js) +- [parallel/test-v8-flag-type-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-flag-type-check.js) +- [parallel/test-v8-flags.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-flags.js) +- [parallel/test-v8-getheapsnapshot-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-getheapsnapshot-twice.js) +- [parallel/test-v8-global-setter.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-global-setter.js) +- [parallel/test-v8-serdes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-serdes.js) +- [parallel/test-v8-serialize-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-serialize-leak.js) +- [parallel/test-v8-startup-snapshot-api.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-startup-snapshot-api.js) +- [parallel/test-v8-stats.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-stats.js) +- [parallel/test-v8-stop-coverage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-stop-coverage.js) +- [parallel/test-v8-take-coverage-noop.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-take-coverage-noop.js) +- [parallel/test-v8-take-coverage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-take-coverage.js) +- [parallel/test-v8-version-tag.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-version-tag.js) +- [parallel/test-validators.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-validators.js) +- [parallel/test-vfs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vfs.js) +- [parallel/test-vm-api-handles-getter-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-api-handles-getter-errors.js) +- [parallel/test-vm-basic.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-basic.js) +- [parallel/test-vm-cached-data.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-cached-data.js) +- [parallel/test-vm-context.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-context.js) +- [parallel/test-vm-dynamic-import-callback-missing-flag.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-dynamic-import-callback-missing-flag.js) +- [parallel/test-vm-global-get-own.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-global-get-own.js) +- [parallel/test-vm-global-non-writable-properties.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-global-non-writable-properties.js) +- [parallel/test-vm-global-property-interceptors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-global-property-interceptors.js) +- [parallel/test-vm-measure-memory-lazy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-measure-memory-lazy.js) +- [parallel/test-vm-measure-memory-multi-context.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-measure-memory-multi-context.js) +- [parallel/test-vm-measure-memory.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-measure-memory.js) +- [parallel/test-vm-module-basic.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-module-basic.js) +- [parallel/test-vm-module-cached-data.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-module-cached-data.js) +- [parallel/test-vm-module-dynamic-import.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-module-dynamic-import.js) +- [parallel/test-vm-module-dynamic-namespace.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-module-dynamic-namespace.js) +- [parallel/test-vm-module-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-module-errors.js) +- [parallel/test-vm-module-import-meta.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-module-import-meta.js) +- [parallel/test-vm-module-link.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-module-link.js) +- [parallel/test-vm-module-reevaluate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-module-reevaluate.js) +- [parallel/test-vm-module-synthetic.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-module-synthetic.js) +- [parallel/test-vm-no-dynamic-import-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-no-dynamic-import-callback.js) +- [parallel/test-vm-run-in-new-context.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-run-in-new-context.js) +- [parallel/test-vm-sigint-existing-handler.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-sigint-existing-handler.js) +- [parallel/test-vm-sigint.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-sigint.js) +- [parallel/test-vm-strict-assign.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-strict-assign.js) +- [parallel/test-vm-syntax-error-message.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-syntax-error-message.js) +- [parallel/test-vm-syntax-error-stderr.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-syntax-error-stderr.js) +- [parallel/test-vm-timeout-escape-promise-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-timeout-escape-promise-module.js) +- [parallel/test-warn-sigprof.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-warn-sigprof.js) +- [parallel/test-warn-stream-wrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-warn-stream-wrap.js) +- [parallel/test-weakref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-weakref.js) +- [parallel/test-webcrypto-constructors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-constructors.js) +- [parallel/test-webcrypto-cryptokey-workers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-cryptokey-workers.js) +- [parallel/test-webcrypto-derivebits-cfrg.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-derivebits-cfrg.js) +- [parallel/test-webcrypto-derivebits-ecdh.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-derivebits-ecdh.js) +- [parallel/test-webcrypto-derivebits-hkdf.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-derivebits-hkdf.js) +- [parallel/test-webcrypto-derivebits.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-derivebits.js) +- [parallel/test-webcrypto-derivekey-cfrg.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-derivekey-cfrg.js) +- [parallel/test-webcrypto-derivekey-ecdh.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-derivekey-ecdh.js) +- [parallel/test-webcrypto-derivekey.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-derivekey.js) +- [parallel/test-webcrypto-digest.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-digest.js) +- [parallel/test-webcrypto-encrypt-decrypt-aes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-encrypt-decrypt-aes.js) +- [parallel/test-webcrypto-encrypt-decrypt-rsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-encrypt-decrypt-rsa.js) +- [parallel/test-webcrypto-encrypt-decrypt.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-encrypt-decrypt.js) +- [parallel/test-webcrypto-export-import-cfrg.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-export-import-cfrg.js) +- [parallel/test-webcrypto-export-import-ec.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-export-import-ec.js) +- [parallel/test-webcrypto-export-import-rsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-export-import-rsa.js) +- [parallel/test-webcrypto-export-import.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-export-import.js) +- [parallel/test-webcrypto-getRandomValues.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-getRandomValues.js) +- [parallel/test-webcrypto-keygen.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-keygen.js) +- [parallel/test-webcrypto-random.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-random.js) +- [parallel/test-webcrypto-sign-verify-ecdsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-sign-verify-ecdsa.js) +- [parallel/test-webcrypto-sign-verify-eddsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-sign-verify-eddsa.js) +- [parallel/test-webcrypto-sign-verify-hmac.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-sign-verify-hmac.js) +- [parallel/test-webcrypto-sign-verify-rsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-sign-verify-rsa.js) +- [parallel/test-webcrypto-util.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-util.js) +- [parallel/test-webcrypto-webidl.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-webidl.js) +- [parallel/test-webcrypto-wrap-unwrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-wrap-unwrap.js) +- [parallel/test-websocket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-websocket.js) +- [parallel/test-webstream-encoding-inspect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webstream-encoding-inspect.js) +- [parallel/test-webstream-readablestream-pipeto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webstream-readablestream-pipeto.js) +- [parallel/test-webstream-string-tag.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webstream-string-tag.js) +- [parallel/test-webstreams-abort-controller.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webstreams-abort-controller.js) +- [parallel/test-webstreams-compose.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webstreams-compose.js) +- [parallel/test-webstreams-finished.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webstreams-finished.js) +- [parallel/test-webstreams-pipeline.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webstreams-pipeline.js) +- [parallel/test-whatwg-encoding-custom-fatal-streaming.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-encoding-custom-fatal-streaming.js) +- [parallel/test-whatwg-encoding-custom-internals.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-encoding-custom-internals.js) +- [parallel/test-whatwg-encoding-custom-interop.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-encoding-custom-interop.js) +- [parallel/test-whatwg-encoding-custom-textdecoder-api-invalid-label.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-encoding-custom-textdecoder-api-invalid-label.js) +- [parallel/test-whatwg-encoding-custom-textdecoder-fatal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-encoding-custom-textdecoder-fatal.js) +- [parallel/test-whatwg-encoding-custom-textdecoder-invalid-arg.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-encoding-custom-textdecoder-invalid-arg.js) +- [parallel/test-whatwg-encoding-custom-textdecoder-utf16-surrogates.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-encoding-custom-textdecoder-utf16-surrogates.js) +- [parallel/test-whatwg-encoding-custom-textdecoder.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-encoding-custom-textdecoder.js) +- [parallel/test-whatwg-events-event-constructors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-events-event-constructors.js) +- [parallel/test-whatwg-events-eventtarget-this-of-listener.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-events-eventtarget-this-of-listener.js) +- [parallel/test-whatwg-readablebytestream-bad-buffers-and-views.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-readablebytestream-bad-buffers-and-views.js) +- [parallel/test-whatwg-readablebytestream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-readablebytestream.js) +- [parallel/test-whatwg-readablebytestreambyob.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-readablebytestreambyob.js) +- [parallel/test-whatwg-readablestream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-readablestream.js) +- [parallel/test-whatwg-transformstream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-transformstream.js) +- [parallel/test-whatwg-url-canparse.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-canparse.js) +- [parallel/test-whatwg-url-custom-domainto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-domainto.js) +- [parallel/test-whatwg-url-custom-inspect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-inspect.js) +- [parallel/test-whatwg-url-custom-parsing.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-parsing.js) +- [parallel/test-whatwg-url-custom-properties.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-properties.js) +- [parallel/test-whatwg-url-custom-searchparams-append.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-searchparams-append.js) +- [parallel/test-whatwg-url-custom-searchparams-constructor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-searchparams-constructor.js) +- [parallel/test-whatwg-url-custom-searchparams-delete.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-searchparams-delete.js) +- [parallel/test-whatwg-url-custom-searchparams-entries.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-searchparams-entries.js) +- [parallel/test-whatwg-url-custom-searchparams-foreach.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-searchparams-foreach.js) +- [parallel/test-whatwg-url-custom-searchparams-get.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-searchparams-get.js) +- [parallel/test-whatwg-url-custom-searchparams-getall.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-searchparams-getall.js) +- [parallel/test-whatwg-url-custom-searchparams-has.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-searchparams-has.js) +- [parallel/test-whatwg-url-custom-searchparams-inspect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-searchparams-inspect.js) +- [parallel/test-whatwg-url-custom-searchparams-keys.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-searchparams-keys.js) +- [parallel/test-whatwg-url-custom-searchparams-set.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-searchparams-set.js) +- [parallel/test-whatwg-url-custom-searchparams-sort.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-searchparams-sort.js) +- [parallel/test-whatwg-url-custom-searchparams-stringifier.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-searchparams-stringifier.js) +- [parallel/test-whatwg-url-custom-searchparams-values.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-searchparams-values.js) +- [parallel/test-whatwg-url-custom-searchparams.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-searchparams.js) +- [parallel/test-whatwg-url-custom-setters.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-custom-setters.js) +- [parallel/test-whatwg-url-invalidthis.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-invalidthis.js) +- [parallel/test-whatwg-url-toascii.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-toascii.js) +- [parallel/test-whatwg-webstreams-adapters-streambase.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-webstreams-adapters-streambase.js) +- [parallel/test-whatwg-webstreams-adapters-to-readablestream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-webstreams-adapters-to-readablestream.js) +- [parallel/test-whatwg-webstreams-adapters-to-readablewritablepair.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-webstreams-adapters-to-readablewritablepair.js) +- [parallel/test-whatwg-webstreams-adapters-to-streamduplex.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-webstreams-adapters-to-streamduplex.js) +- [parallel/test-whatwg-webstreams-adapters-to-streamreadable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-webstreams-adapters-to-streamreadable.js) +- [parallel/test-whatwg-webstreams-adapters-to-streamwritable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-webstreams-adapters-to-streamwritable.js) +- [parallel/test-whatwg-webstreams-adapters-to-writablestream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-webstreams-adapters-to-writablestream.js) +- [parallel/test-whatwg-webstreams-compression.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-webstreams-compression.js) +- [parallel/test-whatwg-webstreams-coverage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-webstreams-coverage.js) +- [parallel/test-whatwg-webstreams-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-webstreams-encoding.js) +- [parallel/test-whatwg-webstreams-transfer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-webstreams-transfer.js) +- [parallel/test-whatwg-writablestream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-writablestream.js) +- [parallel/test-windows-abort-exitcode.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-windows-abort-exitcode.js) +- [parallel/test-windows-failed-heap-allocation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-windows-failed-heap-allocation.js) +- [parallel/test-worker-abort-on-uncaught-exception-terminate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-abort-on-uncaught-exception-terminate.js) +- [parallel/test-worker-abort-on-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-abort-on-uncaught-exception.js) +- [parallel/test-worker-arraybuffer-zerofill.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-arraybuffer-zerofill.js) +- [parallel/test-worker-beforeexit-throw-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-beforeexit-throw-exit.js) +- [parallel/test-worker-broadcastchannel-wpt.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-broadcastchannel-wpt.js) +- [parallel/test-worker-broadcastchannel.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-broadcastchannel.js) +- [parallel/test-worker-cjs-workerdata.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-cjs-workerdata.js) +- [parallel/test-worker-cleanexit-with-js.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-cleanexit-with-js.js) +- [parallel/test-worker-cleanexit-with-moduleload.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-cleanexit-with-moduleload.js) +- [parallel/test-worker-cleanup-handles.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-cleanup-handles.js) +- [parallel/test-worker-console-listeners.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-console-listeners.js) +- [parallel/test-worker-crypto-sign-transfer-result.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-crypto-sign-transfer-result.js) +- [parallel/test-worker-data-url.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-data-url.js) +- [parallel/test-worker-debug.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-debug.js) +- [parallel/test-worker-dns-terminate-during-query.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-dns-terminate-during-query.js) +- [parallel/test-worker-dns-terminate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-dns-terminate.js) +- [parallel/test-worker-environmentdata.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-environmentdata.js) +- [parallel/test-worker-error-stack-getter-throws.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-error-stack-getter-throws.js) +- [parallel/test-worker-esm-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-esm-exit.js) +- [parallel/test-worker-esm-missing-main.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-esm-missing-main.js) +- [parallel/test-worker-esmodule.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-esmodule.js) +- [parallel/test-worker-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-event.js) +- [parallel/test-worker-execargv-invalid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-execargv-invalid.js) +- [parallel/test-worker-execargv.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-execargv.js) +- [parallel/test-worker-exit-code.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-exit-code.js) +- [parallel/test-worker-exit-event-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-exit-event-error.js) +- [parallel/test-worker-exit-from-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-exit-from-uncaught-exception.js) +- [parallel/test-worker-exit-heapsnapshot.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-exit-heapsnapshot.js) +- [parallel/test-worker-fs-stat-watcher.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-fs-stat-watcher.js) +- [parallel/test-worker-hasref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-hasref.js) +- [parallel/test-worker-heap-snapshot.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-heap-snapshot.js) +- [parallel/test-worker-heapdump-failure.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-heapdump-failure.js) +- [parallel/test-worker-http2-generic-streams-terminate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-http2-generic-streams-terminate.js) +- [parallel/test-worker-http2-stream-terminate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-http2-stream-terminate.js) +- [parallel/test-worker-init-failure.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-init-failure.js) +- [parallel/test-worker-invalid-workerdata.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-invalid-workerdata.js) +- [parallel/test-worker-load-file-with-extension-other-than-js.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-load-file-with-extension-other-than-js.js) +- [parallel/test-worker-memory.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-memory.js) +- [parallel/test-worker-message-channel-sharedarraybuffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-channel-sharedarraybuffer.js) +- [parallel/test-worker-message-channel.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-channel.js) +- [parallel/test-worker-message-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-event.js) +- [parallel/test-worker-message-not-serializable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-not-serializable.js) +- [parallel/test-worker-message-port-arraybuffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-arraybuffer.js) +- [parallel/test-worker-message-port-close-while-receiving.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-close-while-receiving.js) +- [parallel/test-worker-message-port-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-close.js) +- [parallel/test-worker-message-port-constructor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-constructor.js) +- [parallel/test-worker-message-port-drain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-drain.js) +- [parallel/test-worker-message-port-inspect-during-init-hook.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-inspect-during-init-hook.js) +- [parallel/test-worker-message-port-jstransferable-nested-untransferable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-jstransferable-nested-untransferable.js) +- [parallel/test-worker-message-port-message-before-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-message-before-close.js) +- [parallel/test-worker-message-port-message-port-transferring.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-message-port-transferring.js) +- [parallel/test-worker-message-port-move.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-move.js) +- [parallel/test-worker-message-port-terminate-transfer-list.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-terminate-transfer-list.js) +- [parallel/test-worker-message-port-transfer-closed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-transfer-closed.js) +- [parallel/test-worker-message-port-transfer-duplicate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-transfer-duplicate.js) +- [parallel/test-worker-message-port-transfer-fake-js-transferable-internal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-transfer-fake-js-transferable-internal.js) +- [parallel/test-worker-message-port-transfer-fake-js-transferable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-transfer-fake-js-transferable.js) +- [parallel/test-worker-message-port-transfer-filehandle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-transfer-filehandle.js) +- [parallel/test-worker-message-port-transfer-native.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-transfer-native.js) +- [parallel/test-worker-message-port-transfer-self.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-transfer-self.js) +- [parallel/test-worker-message-port-transfer-target.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-transfer-target.js) +- [parallel/test-worker-message-port-transfer-terminate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-transfer-terminate.js) +- [parallel/test-worker-message-port-wasm-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-wasm-module.js) +- [parallel/test-worker-message-port-wasm-threads.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port-wasm-threads.js) +- [parallel/test-worker-message-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-port.js) +- [parallel/test-worker-message-transfer-port-mark-as-untransferable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-transfer-port-mark-as-untransferable.js) +- [parallel/test-worker-message-type-unknown.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-message-type-unknown.js) +- [parallel/test-worker-messageport-hasref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-messageport-hasref.js) +- [parallel/test-worker-mjs-workerdata.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-mjs-workerdata.js) +- [parallel/test-worker-name.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-name.js) +- [parallel/test-worker-nearheaplimit-deadlock.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-nearheaplimit-deadlock.js) +- [parallel/test-worker-nested-on-process-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-nested-on-process-exit.js) +- [parallel/test-worker-nested-uncaught.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-nested-uncaught.js) +- [parallel/test-worker-nexttick-terminate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-nexttick-terminate.js) +- [parallel/test-worker-no-atomics.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-no-atomics.js) +- [parallel/test-worker-no-sab.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-no-sab.js) +- [parallel/test-worker-no-stdin-stdout-interaction.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-no-stdin-stdout-interaction.js) +- [parallel/test-worker-non-fatal-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-non-fatal-uncaught-exception.js) +- [parallel/test-worker-on-process-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-on-process-exit.js) +- [parallel/test-worker-onmessage-not-a-function.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-onmessage-not-a-function.js) +- [parallel/test-worker-onmessage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-onmessage.js) +- [parallel/test-worker-parent-port-ref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-parent-port-ref.js) +- [parallel/test-worker-process-argv.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-process-argv.js) +- [parallel/test-worker-process-cwd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-process-cwd.js) +- [parallel/test-worker-process-env-shared.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-process-env-shared.js) +- [parallel/test-worker-process-env.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-process-env.js) +- [parallel/test-worker-process-exit-async-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-process-exit-async-module.js) +- [parallel/test-worker-ref-onexit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-ref-onexit.js) +- [parallel/test-worker-ref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-ref.js) +- [parallel/test-worker-relative-path-double-dot.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-relative-path-double-dot.js) +- [parallel/test-worker-relative-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-relative-path.js) +- [parallel/test-worker-resource-limits.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-resource-limits.js) +- [parallel/test-worker-safe-getters.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-safe-getters.js) +- [parallel/test-worker-sharedarraybuffer-from-worker-thread.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-sharedarraybuffer-from-worker-thread.js) +- [parallel/test-worker-stack-overflow-stack-size.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-stack-overflow-stack-size.js) +- [parallel/test-worker-stack-overflow.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-stack-overflow.js) +- [parallel/test-worker-stdio-from-preload-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-stdio-from-preload-module.js) +- [parallel/test-worker-stdio.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-stdio.js) +- [parallel/test-worker-syntax-error-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-syntax-error-file.js) +- [parallel/test-worker-syntax-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-syntax-error.js) +- [parallel/test-worker-terminate-http2-respond-with-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-terminate-http2-respond-with-file.js) +- [parallel/test-worker-terminate-microtask-loop.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-terminate-microtask-loop.js) +- [parallel/test-worker-terminate-nested.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-terminate-nested.js) +- [parallel/test-worker-terminate-null-handler.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-terminate-null-handler.js) +- [parallel/test-worker-terminate-ref-public-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-terminate-ref-public-port.js) +- [parallel/test-worker-terminate-source-map.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-terminate-source-map.js) +- [parallel/test-worker-terminate-timers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-terminate-timers.js) +- [parallel/test-worker-terminate-unrefed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-terminate-unrefed.js) +- [parallel/test-worker-track-unmanaged-fds.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-track-unmanaged-fds.js) +- [parallel/test-worker-type-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-type-check.js) +- [parallel/test-worker-uncaught-exception-async.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-uncaught-exception-async.js) +- [parallel/test-worker-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-uncaught-exception.js) +- [parallel/test-worker-unref-from-message-during-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-unref-from-message-during-exit.js) +- [parallel/test-worker-unsupported-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-unsupported-path.js) +- [parallel/test-worker-unsupported-things.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-unsupported-things.js) +- [parallel/test-worker-vm-context-terminate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-vm-context-terminate.js) +- [parallel/test-worker-voluntarily-exit-followed-by-addition.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-voluntarily-exit-followed-by-addition.js) +- [parallel/test-worker-voluntarily-exit-followed-by-throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-voluntarily-exit-followed-by-throw.js) +- [parallel/test-worker-workerdata-messageport.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-workerdata-messageport.js) +- [parallel/test-worker-workerdata-sharedarraybuffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-workerdata-sharedarraybuffer.js) +- [parallel/test-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker.js) +- [parallel/test-wrap-js-stream-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-wrap-js-stream-destroy.js) +- [parallel/test-wrap-js-stream-duplex.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-wrap-js-stream-duplex.js) +- [parallel/test-wrap-js-stream-exceptions.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-wrap-js-stream-exceptions.js) +- [parallel/test-wrap-js-stream-read-stop.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-wrap-js-stream-read-stop.js) +- [parallel/test-x509-escaping.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-x509-escaping.js) +- [parallel/test-zlib-brotli-16GB.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-brotli-16GB.js) +- [parallel/test-zlib-brotli-flush.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-brotli-flush.js) +- [parallel/test-zlib-brotli-from-brotli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-brotli-from-brotli.js) +- [parallel/test-zlib-brotli-from-string.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-brotli-from-string.js) +- [parallel/test-zlib-brotli-kmaxlength-rangeerror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-brotli-kmaxlength-rangeerror.js) +- [parallel/test-zlib-brotli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-brotli.js) +- [parallel/test-zlib-bytes-read.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-bytes-read.js) +- [parallel/test-zlib-close-in-ondata.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-close-in-ondata.js) +- [parallel/test-zlib-const.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-const.js) +- [parallel/test-zlib-create-raw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-create-raw.js) +- [parallel/test-zlib-deflate-constructors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-deflate-constructors.js) +- [parallel/test-zlib-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-destroy.js) +- [parallel/test-zlib-dictionary-fail.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-dictionary-fail.js) +- [parallel/test-zlib-dictionary.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-dictionary.js) +- [parallel/test-zlib-failed-init.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-failed-init.js) +- [parallel/test-zlib-flush-drain-longblock.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-flush-drain-longblock.js) +- [parallel/test-zlib-flush-drain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-flush-drain.js) +- [parallel/test-zlib-flush-flags.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-flush-flags.js) +- [parallel/test-zlib-flush-write-sync-interleaved.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-flush-write-sync-interleaved.js) +- [parallel/test-zlib-flush.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-flush.js) +- [parallel/test-zlib-from-concatenated-gzip.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-from-concatenated-gzip.js) +- [parallel/test-zlib-from-gzip-with-trailing-garbage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js) +- [parallel/test-zlib-from-gzip.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-from-gzip.js) +- [parallel/test-zlib-invalid-arg-value-brotli-compress.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-invalid-arg-value-brotli-compress.js) +- [parallel/test-zlib-invalid-input-memory.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-invalid-input-memory.js) +- [parallel/test-zlib-kmaxlength-rangeerror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-kmaxlength-rangeerror.js) +- [parallel/test-zlib-maxOutputLength.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-maxOutputLength.js) +- [parallel/test-zlib-not-string-or-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-not-string-or-buffer.js) +- [parallel/test-zlib-object-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-object-write.js) +- [parallel/test-zlib-params.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-params.js) +- [parallel/test-zlib-premature-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-premature-end.js) +- [parallel/test-zlib-reset-before-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-reset-before-write.js) +- [parallel/test-zlib-unused-weak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-unused-weak.js) +- [parallel/test-zlib-write-after-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-write-after-close.js) +- [parallel/test-zlib.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib.js) +- [pseudo-tty/readline-dumb-tty.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/readline-dumb-tty.js) +- [pseudo-tty/ref_keeps_node_running.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/ref_keeps_node_running.js) +- [pseudo-tty/repl-dumb-tty.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/repl-dumb-tty.js) +- [pseudo-tty/stdin-setrawmode.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/stdin-setrawmode.js) +- [pseudo-tty/test-assert-colors.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-assert-colors.js) +- [pseudo-tty/test-assert-no-color.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-assert-no-color.js) +- [pseudo-tty/test-assert-position-indicator.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-assert-position-indicator.js) +- [pseudo-tty/test-async-wrap-getasyncid-tty.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-async-wrap-getasyncid-tty.js) +- [pseudo-tty/test-fatal-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-fatal-error.js) +- [pseudo-tty/test-handle-wrap-hasref-tty.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-handle-wrap-hasref-tty.js) +- [pseudo-tty/test-readable-tty-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-readable-tty-keepalive.js) +- [pseudo-tty/test-repl-external-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-repl-external-module.js) +- [pseudo-tty/test-set-raw-mode-reset-process-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-set-raw-mode-reset-process-exit.js) +- [pseudo-tty/test-set-raw-mode-reset-signal.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-set-raw-mode-reset-signal.js) +- [pseudo-tty/test-set-raw-mode-reset.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-set-raw-mode-reset.js) +- [pseudo-tty/test-stderr-stdout-handle-sigwinch.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js) +- [pseudo-tty/test-stdin-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-stdin-write.js) +- [pseudo-tty/test-stdout-read.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-stdout-read.js) +- [pseudo-tty/test-trace-sigint-disabled.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-trace-sigint-disabled.js) +- [pseudo-tty/test-trace-sigint-on-idle.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-trace-sigint-on-idle.js) +- [pseudo-tty/test-trace-sigint.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-trace-sigint.js) +- [pseudo-tty/test-tty-color-support.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-tty-color-support.js) +- [pseudo-tty/test-tty-isatty.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-tty-isatty.js) +- [pseudo-tty/test-tty-stdin-call-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-tty-stdin-call-end.js) +- [pseudo-tty/test-tty-stdout-resize.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-tty-stdout-resize.js) +- [pseudo-tty/test-tty-stream-constructors.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-tty-stream-constructors.js) +- [pseudo-tty/test-tty-window-size.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-tty-window-size.js) +- [pseudo-tty/test-tty-wrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-tty-wrap.js) +- [pummel/test-child-process-spawn-loop.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-child-process-spawn-loop.js) +- [pummel/test-crypto-dh-hash.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-crypto-dh-hash.js) +- [pummel/test-crypto-dh-keys.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-crypto-dh-keys.js) +- [pummel/test-crypto-timing-safe-equal-benchmarks.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-crypto-timing-safe-equal-benchmarks.js) +- [pummel/test-dh-regr.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-dh-regr.js) +- [pummel/test-fs-largefile.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-fs-largefile.js) +- [pummel/test-fs-readfile-tostring-fail.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-fs-readfile-tostring-fail.js) +- [pummel/test-fs-watch-file-slow.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-fs-watch-file-slow.js) +- [pummel/test-fs-watch-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-fs-watch-file.js) +- [pummel/test-fs-watch-non-recursive.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-fs-watch-non-recursive.js) +- [pummel/test-fs-watch-system-limit.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-fs-watch-system-limit.js) +- [pummel/test-hash-seed.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-hash-seed.js) +- [pummel/test-heapdump-dns.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapdump-dns.js) +- [pummel/test-heapdump-env.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapdump-env.js) +- [pummel/test-heapdump-fs-promise.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapdump-fs-promise.js) +- [pummel/test-heapdump-http2.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapdump-http2.js) +- [pummel/test-heapdump-inspector.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapdump-inspector.js) +- [pummel/test-heapdump-shadow-realm.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapdump-shadow-realm.js) +- [pummel/test-heapdump-tls.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapdump-tls.js) +- [pummel/test-heapdump-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapdump-worker.js) +- [pummel/test-heapdump-zlib.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapdump-zlib.js) +- [pummel/test-heapsnapshot-near-heap-limit-big.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapsnapshot-near-heap-limit-big.js) +- [pummel/test-heapsnapshot-near-heap-limit-bounded.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapsnapshot-near-heap-limit-bounded.js) +- [pummel/test-heapsnapshot-near-heap-limit-by-api.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapsnapshot-near-heap-limit-by-api.js) +- [pummel/test-heapsnapshot-near-heap-limit.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapsnapshot-near-heap-limit.js) +- [pummel/test-http-many-keep-alive-connections.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-http-many-keep-alive-connections.js) +- [pummel/test-http-upload-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-http-upload-timeout.js) +- [pummel/test-https-large-response.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-https-large-response.js) +- [pummel/test-https-no-reader.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-https-no-reader.js) +- [pummel/test-keep-alive.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-keep-alive.js) +- [pummel/test-net-many-clients.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-net-many-clients.js) +- [pummel/test-net-pause.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-net-pause.js) +- [pummel/test-net-pingpong-delay.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-net-pingpong-delay.js) +- [pummel/test-net-pingpong.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-net-pingpong.js) +- [pummel/test-net-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-net-timeout.js) +- [pummel/test-net-timeout2.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-net-timeout2.js) +- [pummel/test-net-write-callbacks.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-net-write-callbacks.js) +- [pummel/test-next-tick-infinite-calls.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-next-tick-infinite-calls.js) +- [pummel/test-policy-integrity-dep.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-policy-integrity-dep.js) +- [pummel/test-policy-integrity-parent-commonjs.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-policy-integrity-parent-commonjs.js) +- [pummel/test-policy-integrity-parent-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-policy-integrity-parent-module.js) +- [pummel/test-policy-integrity-parent-no-package-json.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-policy-integrity-parent-no-package-json.js) +- [pummel/test-policy-integrity-worker-commonjs.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-policy-integrity-worker-commonjs.js) +- [pummel/test-policy-integrity-worker-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-policy-integrity-worker-module.js) +- [pummel/test-policy-integrity-worker-no-package-json.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-policy-integrity-worker-no-package-json.js) +- [pummel/test-process-cpuUsage.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-process-cpuUsage.js) +- [pummel/test-process-hrtime.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-process-hrtime.js) +- [pummel/test-regress-GH-892.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-regress-GH-892.js) +- [pummel/test-stream-pipe-multi.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-stream-pipe-multi.js) +- [pummel/test-timers.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-timers.js) +- [pummel/test-tls-server-large-request.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-tls-server-large-request.js) +- [pummel/test-tls-throttle.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-tls-throttle.js) +- [pummel/test-vm-memleak.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-vm-memleak.js) +- [pummel/test-vm-race.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-vm-race.js) +- [pummel/test-watch-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-watch-file.js) +- [pummel/test-webcrypto-derivebits-pbkdf2.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-webcrypto-derivebits-pbkdf2.js) +- [pummel/test-worker-take-heapsnapshot.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-worker-take-heapsnapshot.js) +- [sequential/test-async-wrap-getasyncid.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-async-wrap-getasyncid.js) +- [sequential/test-buffer-creation-regression.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-buffer-creation-regression.js) +- [sequential/test-child-process-emfile.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-child-process-emfile.js) +- [sequential/test-child-process-execsync.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-child-process-execsync.js) +- [sequential/test-child-process-pass-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-child-process-pass-fd.js) +- [sequential/test-cli-syntax-bad.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cli-syntax-bad.js) +- [sequential/test-cli-syntax-file-not-found.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cli-syntax-file-not-found.js) +- [sequential/test-cli-syntax-good.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cli-syntax-good.js) +- [sequential/test-cli-syntax-require.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cli-syntax-require.js) +- [sequential/test-cluster-inspect-brk.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cluster-inspect-brk.js) +- [sequential/test-cluster-net-listen-ipv6only-none.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cluster-net-listen-ipv6only-none.js) +- [sequential/test-cluster-net-listen-ipv6only-rr.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cluster-net-listen-ipv6only-rr.js) +- [sequential/test-cluster-send-handle-large-payload.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cluster-send-handle-large-payload.js) +- [sequential/test-cpu-prof-default.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cpu-prof-default.js) +- [sequential/test-cpu-prof-dir-absolute.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cpu-prof-dir-absolute.js) +- [sequential/test-cpu-prof-dir-and-name.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cpu-prof-dir-and-name.js) +- [sequential/test-cpu-prof-dir-relative.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cpu-prof-dir-relative.js) +- [sequential/test-cpu-prof-dir-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cpu-prof-dir-worker.js) +- [sequential/test-cpu-prof-drained.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cpu-prof-drained.js) +- [sequential/test-cpu-prof-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cpu-prof-exit.js) +- [sequential/test-cpu-prof-invalid-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cpu-prof-invalid-options.js) +- [sequential/test-cpu-prof-kill.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cpu-prof-kill.js) +- [sequential/test-cpu-prof-name.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cpu-prof-name.js) +- [sequential/test-cpu-prof-worker-argv.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-cpu-prof-worker-argv.js) +- [sequential/test-crypto-timing-safe-equal.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-crypto-timing-safe-equal.js) +- [sequential/test-debug-prompt.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-debug-prompt.js) +- [sequential/test-debugger-custom-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-debugger-custom-port.js) +- [sequential/test-debugger-debug-brk.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-debugger-debug-brk.js) +- [sequential/test-debugger-invalid-args.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-debugger-invalid-args.js) +- [sequential/test-debugger-pid.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-debugger-pid.js) +- [sequential/test-deprecation-flags.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-deprecation-flags.js) +- [sequential/test-dgram-bind-shared-ports.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-dgram-bind-shared-ports.js) +- [sequential/test-dgram-implicit-bind-failure.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-dgram-implicit-bind-failure.js) +- [sequential/test-dgram-pingpong.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-dgram-pingpong.js) +- [sequential/test-diagnostic-dir-cpu-prof.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-diagnostic-dir-cpu-prof.js) +- [sequential/test-diagnostic-dir-heap-prof.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-diagnostic-dir-heap-prof.js) +- [sequential/test-fs-opendir-recursive.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-fs-opendir-recursive.js) +- [sequential/test-fs-readdir-recursive.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-fs-readdir-recursive.js) +- [sequential/test-fs-stat-sync-overflow.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-fs-stat-sync-overflow.js) +- [sequential/test-fs-watch.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-fs-watch.js) +- [sequential/test-gc-http-client-onerror.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-gc-http-client-onerror.js) +- [sequential/test-gc-http-client-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-gc-http-client-timeout.js) +- [sequential/test-gc-http-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-gc-http-client.js) +- [sequential/test-get-heapsnapshot-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-get-heapsnapshot-options.js) +- [sequential/test-heapdump-flag-custom-dir.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-heapdump-flag-custom-dir.js) +- [sequential/test-heapdump-flag.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-heapdump-flag.js) +- [sequential/test-heapdump.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-heapdump.js) +- [sequential/test-http-econnrefused.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http-econnrefused.js) +- [sequential/test-http-keep-alive-large-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http-keep-alive-large-write.js) +- [sequential/test-http-keepalive-maxsockets.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http-keepalive-maxsockets.js) +- [sequential/test-http-max-sockets.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http-max-sockets.js) +- [sequential/test-http-regr-gh-2928.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http-regr-gh-2928.js) +- [sequential/test-http-server-keep-alive-timeout-slow-client-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http-server-keep-alive-timeout-slow-client-headers.js) +- [sequential/test-http-server-keep-alive-timeout-slow-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http-server-keep-alive-timeout-slow-server.js) +- [sequential/test-http2-large-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http2-large-file.js) +- [sequential/test-http2-max-session-memory.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http2-max-session-memory.js) +- [sequential/test-http2-ping-flood.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http2-ping-flood.js) +- [sequential/test-http2-settings-flood.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http2-settings-flood.js) +- [sequential/test-http2-timeout-large-write-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http2-timeout-large-write-file.js) +- [sequential/test-http2-timeout-large-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http2-timeout-large-write.js) +- [sequential/test-https-connect-localport.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-https-connect-localport.js) +- [sequential/test-https-server-keep-alive-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-https-server-keep-alive-timeout.js) +- [sequential/test-init.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-init.js) +- [sequential/test-inspector-port-cluster.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-inspector-port-cluster.js) +- [sequential/test-module-loading.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-module-loading.js) +- [sequential/test-net-GH-5504.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-GH-5504.js) +- [sequential/test-net-better-error-messages-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-better-error-messages-port.js) +- [sequential/test-net-connect-econnrefused.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-connect-econnrefused.js) +- [sequential/test-net-connect-handle-econnrefused.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-connect-handle-econnrefused.js) +- [sequential/test-net-connect-local-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-connect-local-error.js) +- [sequential/test-net-listen-shared-ports.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-listen-shared-ports.js) +- [sequential/test-net-localport.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-localport.js) +- [sequential/test-net-reconnect-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-reconnect-error.js) +- [sequential/test-net-response-size.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-response-size.js) +- [sequential/test-net-server-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-server-address.js) +- [sequential/test-net-server-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-server-bind.js) +- [sequential/test-next-tick-error-spin.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-next-tick-error-spin.js) +- [sequential/test-perf-hooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-perf-hooks.js) +- [sequential/test-performance-eventloopdelay.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-performance-eventloopdelay.js) +- [sequential/test-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-pipe.js) +- [sequential/test-process-title.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-process-title.js) +- [sequential/test-process-warnings.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-process-warnings.js) +- [sequential/test-repl-timeout-throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-repl-timeout-throw.js) +- [sequential/test-require-cache-without-stat.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-require-cache-without-stat.js) +- [sequential/test-resolution-inspect-brk.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-resolution-inspect-brk.js) +- [sequential/test-single-executable-application-disable-experimental-sea-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-single-executable-application-disable-experimental-sea-warning.js) +- [sequential/test-single-executable-application-empty.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-single-executable-application-empty.js) +- [sequential/test-single-executable-application-snapshot-and-code-cache.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-single-executable-application-snapshot-and-code-cache.js) +- [sequential/test-single-executable-application-snapshot.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-single-executable-application-snapshot.js) +- [sequential/test-single-executable-application-use-code-cache.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-single-executable-application-use-code-cache.js) +- [sequential/test-single-executable-application.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-single-executable-application.js) +- [sequential/test-stream2-fs.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-stream2-fs.js) +- [sequential/test-stream2-stderr-sync.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-stream2-stderr-sync.js) +- [sequential/test-timers-block-eventloop.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-timers-block-eventloop.js) +- [sequential/test-timers-set-interval-excludes-callback-duration.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-timers-set-interval-excludes-callback-duration.js) +- [sequential/test-tls-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-tls-connect.js) +- [sequential/test-tls-lookup.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-tls-lookup.js) +- [sequential/test-tls-psk-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-tls-psk-client.js) +- [sequential/test-tls-securepair-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-tls-securepair-client.js) +- [sequential/test-tls-session-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-tls-session-timeout.js) +- [sequential/test-util-debug.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-util-debug.js) +- [sequential/test-vm-break-on-sigint.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-vm-break-on-sigint.js) +- [sequential/test-vm-timeout-escape-promise-module-2.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-vm-timeout-escape-promise-module-2.js) +- [sequential/test-vm-timeout-rethrow.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-vm-timeout-rethrow.js) +- [sequential/test-worker-eventlooputil.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-worker-eventlooputil.js) +- [sequential/test-worker-fshandles-error-on-termination.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-worker-fshandles-error-on-termination.js) +- [sequential/test-worker-fshandles-open-close-on-termination.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-worker-fshandles-open-close-on-termination.js) +- [sequential/test-worker-heapsnapshot-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-worker-heapsnapshot-options.js) +- [sequential/test-worker-prof.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-worker-prof.js) +- [sequential/test-write-heapsnapshot-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-write-heapsnapshot-options.js) diff --git a/tests/node_compat/runner/setup.ts b/tests/node_compat/runner/setup.ts index 37f1aba9b2..5daa42df76 100755 --- a/tests/node_compat/runner/setup.ts +++ b/tests/node_compat/runner/setup.ts @@ -11,12 +11,13 @@ import { ensureFile } from "@std/fs/ensure-file"; import { writeAll } from "@std/io/write-all"; import { withoutAll } from "@std/collections/without-all"; import { relative } from "@std/path/posix/relative"; +import { version } from "./suite/node_version.ts"; import { config, ignoreList } from "../common.ts"; const encoder = new TextEncoder(); -const NODE_VERSION = config.nodeVersion; +const NODE_VERSION = version; const NODE_IGNORED_TEST_DIRS = [ "addons", diff --git a/tests/node_compat/runner/suite b/tests/node_compat/runner/suite index d12a68fc49..1c9511e584 160000 --- a/tests/node_compat/runner/suite +++ b/tests/node_compat/runner/suite @@ -1 +1 @@ -Subproject commit d12a68fc4930062c0bed26447a6b5245697e77c1 +Subproject commit 1c9511e584eb9d465bcd4b1e6c05ecedf7f15549 diff --git a/tests/node_compat/test/common/child_process.js b/tests/node_compat/test/common/child_process.js index e30ec0c000..fd6676f570 100644 --- a/tests/node_compat/test/common/child_process.js +++ b/tests/node_compat/test/common/child_process.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/common/countdown.js b/tests/node_compat/test/common/countdown.js index 67742db188..1e3512e540 100644 --- a/tests/node_compat/test/common/countdown.js +++ b/tests/node_compat/test/common/countdown.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/common/dns.js b/tests/node_compat/test/common/dns.js index e8301344c1..b3b92a18e0 100644 --- a/tests/node_compat/test/common/dns.js +++ b/tests/node_compat/test/common/dns.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/common/duplexpair.js b/tests/node_compat/test/common/duplexpair.js index fdd77f9dd6..782c467395 100644 --- a/tests/node_compat/test/common/duplexpair.js +++ b/tests/node_compat/test/common/duplexpair.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/common/fixtures.js b/tests/node_compat/test/common/fixtures.js index 08c8fd20cc..6f68d8a0aa 100644 --- a/tests/node_compat/test/common/fixtures.js +++ b/tests/node_compat/test/common/fixtures.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/common/hijackstdio.js b/tests/node_compat/test/common/hijackstdio.js index db35fda565..cb4be687f1 100644 --- a/tests/node_compat/test/common/hijackstdio.js +++ b/tests/node_compat/test/common/hijackstdio.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/common/index.mjs b/tests/node_compat/test/common/index.mjs index d9992e67d7..1ede607315 100644 --- a/tests/node_compat/test/common/index.mjs +++ b/tests/node_compat/test/common/index.mjs @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. import { createRequire } from 'module'; diff --git a/tests/node_compat/test/common/tmpdir.js b/tests/node_compat/test/common/tmpdir.js index 9315b87471..c8951a1992 100644 --- a/tests/node_compat/test/common/tmpdir.js +++ b/tests/node_compat/test/common/tmpdir.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/fixtures/GH-1899-output.js b/tests/node_compat/test/fixtures/GH-1899-output.js index ffb0515cbc..736ce3681e 100644 --- a/tests/node_compat/test/fixtures/GH-1899-output.js +++ b/tests/node_compat/test/fixtures/GH-1899-output.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/fixtures/a.js b/tests/node_compat/test/fixtures/a.js index b63484fe5c..18504e4781 100644 --- a/tests/node_compat/test/fixtures/a.js +++ b/tests/node_compat/test/fixtures/a.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/fixtures/child-process-persistent.js b/tests/node_compat/test/fixtures/child-process-persistent.js index 520c4bebc1..9ca3f6b6a2 100644 --- a/tests/node_compat/test/fixtures/child-process-persistent.js +++ b/tests/node_compat/test/fixtures/child-process-persistent.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. setInterval(function() {}, 9999); diff --git a/tests/node_compat/test/fixtures/child_process_should_emit_error.js b/tests/node_compat/test/fixtures/child_process_should_emit_error.js index e2bbad2dda..e1c42d1d6d 100644 --- a/tests/node_compat/test/fixtures/child_process_should_emit_error.js +++ b/tests/node_compat/test/fixtures/child_process_should_emit_error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/fixtures/loop.js b/tests/node_compat/test/fixtures/loop.js index aad83d0f67..e815aaabd9 100644 --- a/tests/node_compat/test/fixtures/loop.js +++ b/tests/node_compat/test/fixtures/loop.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. var t = 1; diff --git a/tests/node_compat/test/internet/test-dns-idna2008.js b/tests/node_compat/test/internet/test-dns-idna2008.js index 9527ec22fd..2107282937 100644 --- a/tests/node_compat/test/internet/test-dns-idna2008.js +++ b/tests/node_compat/test/internet/test-dns-idna2008.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/internet/test-dns-lookup.js b/tests/node_compat/test/internet/test-dns-lookup.js index ff9c31544c..2f8405d364 100644 --- a/tests/node_compat/test/internet/test-dns-lookup.js +++ b/tests/node_compat/test/internet/test-dns-lookup.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/internet/test-dns-promises-resolve.js b/tests/node_compat/test/internet/test-dns-promises-resolve.js index 130c734229..aa4e1daa0b 100644 --- a/tests/node_compat/test/internet/test-dns-promises-resolve.js +++ b/tests/node_compat/test/internet/test-dns-promises-resolve.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/internet/test-dns-regress-6244.js b/tests/node_compat/test/internet/test-dns-regress-6244.js index 9d37d6c729..76617f685b 100644 --- a/tests/node_compat/test/internet/test-dns-regress-6244.js +++ b/tests/node_compat/test/internet/test-dns-regress-6244.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/internet/test-dns-setserver-in-callback-of-resolve4.js b/tests/node_compat/test/internet/test-dns-setserver-in-callback-of-resolve4.js index e2ecc87868..ab2eac8fe1 100644 --- a/tests/node_compat/test/internet/test-dns-setserver-in-callback-of-resolve4.js +++ b/tests/node_compat/test/internet/test-dns-setserver-in-callback-of-resolve4.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/internet/test-http-https-default-ports.js b/tests/node_compat/test/internet/test-http-https-default-ports.js index 90e0f299a8..92ddbf3656 100644 --- a/tests/node_compat/test/internet/test-http-https-default-ports.js +++ b/tests/node_compat/test/internet/test-http-https-default-ports.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-assert-async.js b/tests/node_compat/test/parallel/test-assert-async.js index db6bfabdcd..111cf44c67 100644 --- a/tests/node_compat/test/parallel/test-assert-async.js +++ b/tests/node_compat/test/parallel/test-assert-async.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-assert-fail.js b/tests/node_compat/test/parallel/test-assert-fail.js index 7c7ceef515..8718a9ea46 100644 --- a/tests/node_compat/test/parallel/test-assert-fail.js +++ b/tests/node_compat/test/parallel/test-assert-fail.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-assert-strict-exists.js b/tests/node_compat/test/parallel/test-assert-strict-exists.js index 7a9c96a941..806cff31f2 100644 --- a/tests/node_compat/test/parallel/test-assert-strict-exists.js +++ b/tests/node_compat/test/parallel/test-assert-strict-exists.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-bad-unicode.js b/tests/node_compat/test/parallel/test-bad-unicode.js index fea7e3cd7a..5b72fd25e5 100644 --- a/tests/node_compat/test/parallel/test-bad-unicode.js +++ b/tests/node_compat/test/parallel/test-bad-unicode.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-btoa-atob.js b/tests/node_compat/test/parallel/test-btoa-atob.js index 22a9affecd..60c5d58c0f 100644 --- a/tests/node_compat/test/parallel/test-btoa-atob.js +++ b/tests/node_compat/test/parallel/test-btoa-atob.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-ascii.js b/tests/node_compat/test/parallel/test-buffer-ascii.js index 5695a275aa..f47a841e78 100644 --- a/tests/node_compat/test/parallel/test-buffer-ascii.js +++ b/tests/node_compat/test/parallel/test-buffer-ascii.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-buffer-badhex.js b/tests/node_compat/test/parallel/test-buffer-badhex.js index 7f1f57a76a..ee227f578e 100644 --- a/tests/node_compat/test/parallel/test-buffer-badhex.js +++ b/tests/node_compat/test/parallel/test-buffer-badhex.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-bigint64.js b/tests/node_compat/test/parallel/test-buffer-bigint64.js index 2ba709bfe7..10fdb761b4 100644 --- a/tests/node_compat/test/parallel/test-buffer-bigint64.js +++ b/tests/node_compat/test/parallel/test-buffer-bigint64.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-bytelength.js b/tests/node_compat/test/parallel/test-buffer-bytelength.js index 858c72f671..781c08a1a1 100644 --- a/tests/node_compat/test/parallel/test-buffer-bytelength.js +++ b/tests/node_compat/test/parallel/test-buffer-bytelength.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-compare-offset.js b/tests/node_compat/test/parallel/test-buffer-compare-offset.js index 9583ded36b..7e8f6d405a 100644 --- a/tests/node_compat/test/parallel/test-buffer-compare-offset.js +++ b/tests/node_compat/test/parallel/test-buffer-compare-offset.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-concat.js b/tests/node_compat/test/parallel/test-buffer-concat.js index cd63be4e4e..ba84bbd6d4 100644 --- a/tests/node_compat/test/parallel/test-buffer-concat.js +++ b/tests/node_compat/test/parallel/test-buffer-concat.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-buffer-constants.js b/tests/node_compat/test/parallel/test-buffer-constants.js index 026ac41d8a..bbe3f579b7 100644 --- a/tests/node_compat/test/parallel/test-buffer-constants.js +++ b/tests/node_compat/test/parallel/test-buffer-constants.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-copy.js b/tests/node_compat/test/parallel/test-buffer-copy.js index 38f32e52fe..8526070c24 100644 --- a/tests/node_compat/test/parallel/test-buffer-copy.js +++ b/tests/node_compat/test/parallel/test-buffer-copy.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-equals.js b/tests/node_compat/test/parallel/test-buffer-equals.js index c7768da1aa..b74b86f652 100644 --- a/tests/node_compat/test/parallel/test-buffer-equals.js +++ b/tests/node_compat/test/parallel/test-buffer-equals.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-failed-alloc-typed-arrays.js b/tests/node_compat/test/parallel/test-buffer-failed-alloc-typed-arrays.js index 89bf780655..6055da4ab7 100644 --- a/tests/node_compat/test/parallel/test-buffer-failed-alloc-typed-arrays.js +++ b/tests/node_compat/test/parallel/test-buffer-failed-alloc-typed-arrays.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-fakes.js b/tests/node_compat/test/parallel/test-buffer-fakes.js index bcd97042a0..e9db549cb2 100644 --- a/tests/node_compat/test/parallel/test-buffer-fakes.js +++ b/tests/node_compat/test/parallel/test-buffer-fakes.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-inheritance.js b/tests/node_compat/test/parallel/test-buffer-inheritance.js index 5c3d5925fa..7c5564ade0 100644 --- a/tests/node_compat/test/parallel/test-buffer-inheritance.js +++ b/tests/node_compat/test/parallel/test-buffer-inheritance.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-isascii.js b/tests/node_compat/test/parallel/test-buffer-isascii.js index 59612bb9d9..6c4abfb71d 100644 --- a/tests/node_compat/test/parallel/test-buffer-isascii.js +++ b/tests/node_compat/test/parallel/test-buffer-isascii.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-isencoding.js b/tests/node_compat/test/parallel/test-buffer-isencoding.js index 8f9089a02f..68bb94d60d 100644 --- a/tests/node_compat/test/parallel/test-buffer-isencoding.js +++ b/tests/node_compat/test/parallel/test-buffer-isencoding.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-isutf8.js b/tests/node_compat/test/parallel/test-buffer-isutf8.js index 02f142db89..3c4d31da4b 100644 --- a/tests/node_compat/test/parallel/test-buffer-isutf8.js +++ b/tests/node_compat/test/parallel/test-buffer-isutf8.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-iterator.js b/tests/node_compat/test/parallel/test-buffer-iterator.js index 279f75ac85..76d5df5e63 100644 --- a/tests/node_compat/test/parallel/test-buffer-iterator.js +++ b/tests/node_compat/test/parallel/test-buffer-iterator.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-new.js b/tests/node_compat/test/parallel/test-buffer-new.js index aaa08f39a6..110de4f3fe 100644 --- a/tests/node_compat/test/parallel/test-buffer-new.js +++ b/tests/node_compat/test/parallel/test-buffer-new.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-no-negative-allocation.js b/tests/node_compat/test/parallel/test-buffer-no-negative-allocation.js index a679f26bb0..2ad0642f7f 100644 --- a/tests/node_compat/test/parallel/test-buffer-no-negative-allocation.js +++ b/tests/node_compat/test/parallel/test-buffer-no-negative-allocation.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-nopendingdep-map.js b/tests/node_compat/test/parallel/test-buffer-nopendingdep-map.js index 54f272c7e0..c94ac5db40 100644 --- a/tests/node_compat/test/parallel/test-buffer-nopendingdep-map.js +++ b/tests/node_compat/test/parallel/test-buffer-nopendingdep-map.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --no-warnings --pending-deprecation diff --git a/tests/node_compat/test/parallel/test-buffer-of-no-deprecation.js b/tests/node_compat/test/parallel/test-buffer-of-no-deprecation.js index 84e0a476df..661201d2ff 100644 --- a/tests/node_compat/test/parallel/test-buffer-of-no-deprecation.js +++ b/tests/node_compat/test/parallel/test-buffer-of-no-deprecation.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-over-max-length.js b/tests/node_compat/test/parallel/test-buffer-over-max-length.js index c53a9d6110..56107e8831 100644 --- a/tests/node_compat/test/parallel/test-buffer-over-max-length.js +++ b/tests/node_compat/test/parallel/test-buffer-over-max-length.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-parent-property.js b/tests/node_compat/test/parallel/test-buffer-parent-property.js index 7c5f4acce5..44c4e83fea 100644 --- a/tests/node_compat/test/parallel/test-buffer-parent-property.js +++ b/tests/node_compat/test/parallel/test-buffer-parent-property.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-read.js b/tests/node_compat/test/parallel/test-buffer-read.js index 0b6db96b11..751572e54f 100644 --- a/tests/node_compat/test/parallel/test-buffer-read.js +++ b/tests/node_compat/test/parallel/test-buffer-read.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-readdouble.js b/tests/node_compat/test/parallel/test-buffer-readdouble.js index 7fe5a48417..ba159661a5 100644 --- a/tests/node_compat/test/parallel/test-buffer-readdouble.js +++ b/tests/node_compat/test/parallel/test-buffer-readdouble.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-readfloat.js b/tests/node_compat/test/parallel/test-buffer-readfloat.js index de7bd6c9b4..56ad624cca 100644 --- a/tests/node_compat/test/parallel/test-buffer-readfloat.js +++ b/tests/node_compat/test/parallel/test-buffer-readfloat.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-readint.js b/tests/node_compat/test/parallel/test-buffer-readint.js index edcba393b0..ccf8e3616d 100644 --- a/tests/node_compat/test/parallel/test-buffer-readint.js +++ b/tests/node_compat/test/parallel/test-buffer-readint.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-readuint.js b/tests/node_compat/test/parallel/test-buffer-readuint.js index 7e1ed1442d..948dc21962 100644 --- a/tests/node_compat/test/parallel/test-buffer-readuint.js +++ b/tests/node_compat/test/parallel/test-buffer-readuint.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-safe-unsafe.js b/tests/node_compat/test/parallel/test-buffer-safe-unsafe.js index 5f810d2e20..f3ca64c5f1 100644 --- a/tests/node_compat/test/parallel/test-buffer-safe-unsafe.js +++ b/tests/node_compat/test/parallel/test-buffer-safe-unsafe.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-slice.js b/tests/node_compat/test/parallel/test-buffer-slice.js index bd3e8bbb44..f67e59a693 100644 --- a/tests/node_compat/test/parallel/test-buffer-slice.js +++ b/tests/node_compat/test/parallel/test-buffer-slice.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-buffer-slow.js b/tests/node_compat/test/parallel/test-buffer-slow.js index 577a92a9f6..16ead49c8a 100644 --- a/tests/node_compat/test/parallel/test-buffer-slow.js +++ b/tests/node_compat/test/parallel/test-buffer-slow.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-swap.js b/tests/node_compat/test/parallel/test-buffer-swap.js index 3885672b5b..7afdaf1db8 100644 --- a/tests/node_compat/test/parallel/test-buffer-swap.js +++ b/tests/node_compat/test/parallel/test-buffer-swap.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-tojson.js b/tests/node_compat/test/parallel/test-buffer-tojson.js index 353eb4746f..b135e655ab 100644 --- a/tests/node_compat/test/parallel/test-buffer-tojson.js +++ b/tests/node_compat/test/parallel/test-buffer-tojson.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-tostring-range.js b/tests/node_compat/test/parallel/test-buffer-tostring-range.js index f4555d5a95..d5ead53b83 100644 --- a/tests/node_compat/test/parallel/test-buffer-tostring-range.js +++ b/tests/node_compat/test/parallel/test-buffer-tostring-range.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-tostring-rangeerror.js b/tests/node_compat/test/parallel/test-buffer-tostring-rangeerror.js index 9ec11056c5..dc0f3afc56 100644 --- a/tests/node_compat/test/parallel/test-buffer-tostring-rangeerror.js +++ b/tests/node_compat/test/parallel/test-buffer-tostring-rangeerror.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-tostring.js b/tests/node_compat/test/parallel/test-buffer-tostring.js index 4a71ce651e..ce018a1b69 100644 --- a/tests/node_compat/test/parallel/test-buffer-tostring.js +++ b/tests/node_compat/test/parallel/test-buffer-tostring.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-writedouble.js b/tests/node_compat/test/parallel/test-buffer-writedouble.js index aaa41fb216..a41a433a0f 100644 --- a/tests/node_compat/test/parallel/test-buffer-writedouble.js +++ b/tests/node_compat/test/parallel/test-buffer-writedouble.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-writefloat.js b/tests/node_compat/test/parallel/test-buffer-writefloat.js index d971fccc3d..56b9a4ebc8 100644 --- a/tests/node_compat/test/parallel/test-buffer-writefloat.js +++ b/tests/node_compat/test/parallel/test-buffer-writefloat.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-writeint.js b/tests/node_compat/test/parallel/test-buffer-writeint.js index 227663b857..df36f6a777 100644 --- a/tests/node_compat/test/parallel/test-buffer-writeint.js +++ b/tests/node_compat/test/parallel/test-buffer-writeint.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-writeuint.js b/tests/node_compat/test/parallel/test-buffer-writeuint.js index 50ab0888de..831c27f602 100644 --- a/tests/node_compat/test/parallel/test-buffer-writeuint.js +++ b/tests/node_compat/test/parallel/test-buffer-writeuint.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-zero-fill-cli.js b/tests/node_compat/test/parallel/test-buffer-zero-fill-cli.js index e886f7baa3..8edddbe418 100644 --- a/tests/node_compat/test/parallel/test-buffer-zero-fill-cli.js +++ b/tests/node_compat/test/parallel/test-buffer-zero-fill-cli.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-zero-fill-reset.js b/tests/node_compat/test/parallel/test-buffer-zero-fill-reset.js index b1dca54ac1..86236f2c33 100644 --- a/tests/node_compat/test/parallel/test-buffer-zero-fill-reset.js +++ b/tests/node_compat/test/parallel/test-buffer-zero-fill-reset.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-buffer-zero-fill.js b/tests/node_compat/test/parallel/test-buffer-zero-fill.js index a891343c6a..9291887523 100644 --- a/tests/node_compat/test/parallel/test-buffer-zero-fill.js +++ b/tests/node_compat/test/parallel/test-buffer-zero-fill.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-child-process-default-options.js b/tests/node_compat/test/parallel/test-child-process-default-options.js index 2dafeb4938..29bbf49a63 100644 --- a/tests/node_compat/test/parallel/test-child-process-default-options.js +++ b/tests/node_compat/test/parallel/test-child-process-default-options.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-child-process-double-pipe.js b/tests/node_compat/test/parallel/test-child-process-double-pipe.js index 5703c9bcdf..ac75915564 100644 --- a/tests/node_compat/test/parallel/test-child-process-double-pipe.js +++ b/tests/node_compat/test/parallel/test-child-process-double-pipe.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-child-process-exec-cwd.js b/tests/node_compat/test/parallel/test-child-process-exec-cwd.js index 34a31615dd..09e06b20a7 100644 --- a/tests/node_compat/test/parallel/test-child-process-exec-cwd.js +++ b/tests/node_compat/test/parallel/test-child-process-exec-cwd.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-child-process-exec-env.js b/tests/node_compat/test/parallel/test-child-process-exec-env.js index ce3ef26134..5e144074b0 100644 --- a/tests/node_compat/test/parallel/test-child-process-exec-env.js +++ b/tests/node_compat/test/parallel/test-child-process-exec-env.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-child-process-exec-error.js b/tests/node_compat/test/parallel/test-child-process-exec-error.js index 8af3bbefa9..ab16bdf7d5 100644 --- a/tests/node_compat/test/parallel/test-child-process-exec-error.js +++ b/tests/node_compat/test/parallel/test-child-process-exec-error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-child-process-exec-stdout-stderr-data-string.js b/tests/node_compat/test/parallel/test-child-process-exec-stdout-stderr-data-string.js index 07a13c888c..7d15e05696 100644 --- a/tests/node_compat/test/parallel/test-child-process-exec-stdout-stderr-data-string.js +++ b/tests/node_compat/test/parallel/test-child-process-exec-stdout-stderr-data-string.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-child-process-execfile-maxbuf.js b/tests/node_compat/test/parallel/test-child-process-execfile-maxbuf.js index ef69cf2d01..a30c8b55ef 100644 --- a/tests/node_compat/test/parallel/test-child-process-execfile-maxbuf.js +++ b/tests/node_compat/test/parallel/test-child-process-execfile-maxbuf.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-child-process-execfilesync-maxbuf.js b/tests/node_compat/test/parallel/test-child-process-execfilesync-maxbuf.js index 4c1d50e2a9..b44160ffcd 100644 --- a/tests/node_compat/test/parallel/test-child-process-execfilesync-maxbuf.js +++ b/tests/node_compat/test/parallel/test-child-process-execfilesync-maxbuf.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-child-process-flush-stdio.js b/tests/node_compat/test/parallel/test-child-process-flush-stdio.js index bb9b10e6dd..3909eca4a7 100644 --- a/tests/node_compat/test/parallel/test-child-process-flush-stdio.js +++ b/tests/node_compat/test/parallel/test-child-process-flush-stdio.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-child-process-ipc-next-tick.js b/tests/node_compat/test/parallel/test-child-process-ipc-next-tick.js index f511d25004..cf37a1c5de 100644 --- a/tests/node_compat/test/parallel/test-child-process-ipc-next-tick.js +++ b/tests/node_compat/test/parallel/test-child-process-ipc-next-tick.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-child-process-kill.js b/tests/node_compat/test/parallel/test-child-process-kill.js index 319fba5df9..a776bff50f 100644 --- a/tests/node_compat/test/parallel/test-child-process-kill.js +++ b/tests/node_compat/test/parallel/test-child-process-kill.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-child-process-set-blocking.js b/tests/node_compat/test/parallel/test-child-process-set-blocking.js index d3d03d7b55..6d3b612033 100644 --- a/tests/node_compat/test/parallel/test-child-process-set-blocking.js +++ b/tests/node_compat/test/parallel/test-child-process-set-blocking.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-child-process-spawn-args.js b/tests/node_compat/test/parallel/test-child-process-spawn-args.js index 1b21fe6163..55f9dbcad8 100644 --- a/tests/node_compat/test/parallel/test-child-process-spawn-args.js +++ b/tests/node_compat/test/parallel/test-child-process-spawn-args.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-child-process-spawn-event.js b/tests/node_compat/test/parallel/test-child-process-spawn-event.js index bf1f26ff0d..0b044a8013 100644 --- a/tests/node_compat/test/parallel/test-child-process-spawn-event.js +++ b/tests/node_compat/test/parallel/test-child-process-spawn-event.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-child-process-spawnsync-args.js b/tests/node_compat/test/parallel/test-child-process-spawnsync-args.js index 8a531007a3..7909eddeff 100644 --- a/tests/node_compat/test/parallel/test-child-process-spawnsync-args.js +++ b/tests/node_compat/test/parallel/test-child-process-spawnsync-args.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-child-process-spawnsync-maxbuf.js b/tests/node_compat/test/parallel/test-child-process-spawnsync-maxbuf.js index 1210218252..df7b4a3058 100644 --- a/tests/node_compat/test/parallel/test-child-process-spawnsync-maxbuf.js +++ b/tests/node_compat/test/parallel/test-child-process-spawnsync-maxbuf.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-child-process-spawnsync-validation-errors.js b/tests/node_compat/test/parallel/test-child-process-spawnsync-validation-errors.js index 09a306c136..5e6ffda9d5 100644 --- a/tests/node_compat/test/parallel/test-child-process-spawnsync-validation-errors.js +++ b/tests/node_compat/test/parallel/test-child-process-spawnsync-validation-errors.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-child-process-spawnsync.js b/tests/node_compat/test/parallel/test-child-process-spawnsync.js index 5fbd994cc2..e6e667a227 100644 --- a/tests/node_compat/test/parallel/test-child-process-spawnsync.js +++ b/tests/node_compat/test/parallel/test-child-process-spawnsync.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-console-async-write-error.js b/tests/node_compat/test/parallel/test-console-async-write-error.js index 1e079292d4..812848f6e5 100644 --- a/tests/node_compat/test/parallel/test-console-async-write-error.js +++ b/tests/node_compat/test/parallel/test-console-async-write-error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-console-group.js b/tests/node_compat/test/parallel/test-console-group.js index 3224ddb1bf..272981e467 100644 --- a/tests/node_compat/test/parallel/test-console-group.js +++ b/tests/node_compat/test/parallel/test-console-group.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-console-log-stdio-broken-dest.js b/tests/node_compat/test/parallel/test-console-log-stdio-broken-dest.js index 153dd9e542..cbbcd9d92b 100644 --- a/tests/node_compat/test/parallel/test-console-log-stdio-broken-dest.js +++ b/tests/node_compat/test/parallel/test-console-log-stdio-broken-dest.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-console-log-throw-primitive.js b/tests/node_compat/test/parallel/test-console-log-throw-primitive.js index 6e1a8c7a7b..3d39759845 100644 --- a/tests/node_compat/test/parallel/test-console-log-throw-primitive.js +++ b/tests/node_compat/test/parallel/test-console-log-throw-primitive.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-console-no-swallow-stack-overflow.js b/tests/node_compat/test/parallel/test-console-no-swallow-stack-overflow.js index 8dcd68d33d..d7fc0269b5 100644 --- a/tests/node_compat/test/parallel/test-console-no-swallow-stack-overflow.js +++ b/tests/node_compat/test/parallel/test-console-no-swallow-stack-overflow.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-console-sync-write-error.js b/tests/node_compat/test/parallel/test-console-sync-write-error.js index 9a9766645b..58fca44ba0 100644 --- a/tests/node_compat/test/parallel/test-console-sync-write-error.js +++ b/tests/node_compat/test/parallel/test-console-sync-write-error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-console-table.js b/tests/node_compat/test/parallel/test-console-table.js index 991521e8e3..6a3de08f21 100644 --- a/tests/node_compat/test/parallel/test-console-table.js +++ b/tests/node_compat/test/parallel/test-console-table.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-console-tty-colors.js b/tests/node_compat/test/parallel/test-console-tty-colors.js index 5d2a994bb4..236ed613f9 100644 --- a/tests/node_compat/test/parallel/test-console-tty-colors.js +++ b/tests/node_compat/test/parallel/test-console-tty-colors.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-crypto-dh-shared.js b/tests/node_compat/test/parallel/test-crypto-dh-shared.js index c087e15d87..d2afeaf38c 100644 --- a/tests/node_compat/test/parallel/test-crypto-dh-shared.js +++ b/tests/node_compat/test/parallel/test-crypto-dh-shared.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-crypto-hash.js b/tests/node_compat/test/parallel/test-crypto-hash.js index 18c57dab74..c24531138c 100644 --- a/tests/node_compat/test/parallel/test-crypto-hash.js +++ b/tests/node_compat/test/parallel/test-crypto-hash.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-crypto-secret-keygen.js b/tests/node_compat/test/parallel/test-crypto-secret-keygen.js index 9e9205e3f2..5f70109f10 100644 --- a/tests/node_compat/test/parallel/test-crypto-secret-keygen.js +++ b/tests/node_compat/test/parallel/test-crypto-secret-keygen.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-crypto-update-encoding.js b/tests/node_compat/test/parallel/test-crypto-update-encoding.js index 8694ca1717..75064d8d14 100644 --- a/tests/node_compat/test/parallel/test-crypto-update-encoding.js +++ b/tests/node_compat/test/parallel/test-crypto-update-encoding.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-dgram-close-during-bind.js b/tests/node_compat/test/parallel/test-dgram-close-during-bind.js index 2a89c45670..0333da5b9e 100644 --- a/tests/node_compat/test/parallel/test-dgram-close-during-bind.js +++ b/tests/node_compat/test/parallel/test-dgram-close-during-bind.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --expose-internals diff --git a/tests/node_compat/test/parallel/test-dgram-close-signal.js b/tests/node_compat/test/parallel/test-dgram-close-signal.js index 108cfd9be3..788018e77c 100644 --- a/tests/node_compat/test/parallel/test-dgram-close-signal.js +++ b/tests/node_compat/test/parallel/test-dgram-close-signal.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-has-subscribers.js b/tests/node_compat/test/parallel/test-diagnostics-channel-has-subscribers.js index 18132783a7..a86dc23675 100644 --- a/tests/node_compat/test/parallel/test-diagnostics-channel-has-subscribers.js +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-has-subscribers.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-net.js b/tests/node_compat/test/parallel/test-diagnostics-channel-net.js index 504c3e5dc8..147030ee62 100644 --- a/tests/node_compat/test/parallel/test-diagnostics-channel-net.js +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-net.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-object-channel-pub-sub.js b/tests/node_compat/test/parallel/test-diagnostics-channel-object-channel-pub-sub.js index efea42371d..2466b67b1f 100644 --- a/tests/node_compat/test/parallel/test-diagnostics-channel-object-channel-pub-sub.js +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-object-channel-pub-sub.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-pub-sub.js b/tests/node_compat/test/parallel/test-diagnostics-channel-pub-sub.js index ef2486f5af..cc21955ca0 100644 --- a/tests/node_compat/test/parallel/test-diagnostics-channel-pub-sub.js +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-pub-sub.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-symbol-named.js b/tests/node_compat/test/parallel/test-diagnostics-channel-symbol-named.js index 34af267988..6c7fd4cfbb 100644 --- a/tests/node_compat/test/parallel/test-diagnostics-channel-symbol-named.js +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-symbol-named.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-sync-unsubscribe.js b/tests/node_compat/test/parallel/test-diagnostics-channel-sync-unsubscribe.js index 767382476b..72b43972b5 100644 --- a/tests/node_compat/test/parallel/test-diagnostics-channel-sync-unsubscribe.js +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-sync-unsubscribe.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-args-types.js b/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-args-types.js index 885c9d76b5..af5d08d790 100644 --- a/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-args-types.js +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-args-types.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-callback-run-stores.js b/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-callback-run-stores.js index 1160e6464a..6f91c361d0 100644 --- a/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-callback-run-stores.js +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-callback-run-stores.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-promise-run-stores.js b/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-promise-run-stores.js index 3f015e192b..0a713e64a0 100644 --- a/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-promise-run-stores.js +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-promise-run-stores.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-sync-error.js b/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-sync-error.js index 09fc103293..0f5d276ac5 100644 --- a/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-sync-error.js +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-sync-error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-sync.js b/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-sync.js index 036bcce3b8..b8c642a9aa 100644 --- a/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-sync.js +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-sync.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-udp.js b/tests/node_compat/test/parallel/test-diagnostics-channel-udp.js index a6ea753c96..6843d0f30e 100644 --- a/tests/node_compat/test/parallel/test-diagnostics-channel-udp.js +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-udp.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-dns-memory-error.js b/tests/node_compat/test/parallel/test-dns-memory-error.js index 74aafa52ff..1131c7f9b7 100644 --- a/tests/node_compat/test/parallel/test-dns-memory-error.js +++ b/tests/node_compat/test/parallel/test-dns-memory-error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --expose-internals diff --git a/tests/node_compat/test/parallel/test-dns-promises-exists.js b/tests/node_compat/test/parallel/test-dns-promises-exists.js index 897c922048..3368abc194 100644 --- a/tests/node_compat/test/parallel/test-dns-promises-exists.js +++ b/tests/node_compat/test/parallel/test-dns-promises-exists.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-dns-resolvens-typeerror.js b/tests/node_compat/test/parallel/test-dns-resolvens-typeerror.js index 925537c600..b271ae34ce 100644 --- a/tests/node_compat/test/parallel/test-dns-resolvens-typeerror.js +++ b/tests/node_compat/test/parallel/test-dns-resolvens-typeerror.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-dns-setservers-type-check.js b/tests/node_compat/test/parallel/test-dns-setservers-type-check.js index 597241604a..6218a1bdfd 100644 --- a/tests/node_compat/test/parallel/test-dns-setservers-type-check.js +++ b/tests/node_compat/test/parallel/test-dns-setservers-type-check.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-eval-strict-referenceerror.js b/tests/node_compat/test/parallel/test-eval-strict-referenceerror.js index 628d03a6f3..2c9943bbe8 100644 --- a/tests/node_compat/test/parallel/test-eval-strict-referenceerror.js +++ b/tests/node_compat/test/parallel/test-eval-strict-referenceerror.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. /* eslint-disable strict */ diff --git a/tests/node_compat/test/parallel/test-eval.js b/tests/node_compat/test/parallel/test-eval.js index 8b3046af79..a6fb713b0b 100644 --- a/tests/node_compat/test/parallel/test-eval.js +++ b/tests/node_compat/test/parallel/test-eval.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-event-emitter-add-listeners.js b/tests/node_compat/test/parallel/test-event-emitter-add-listeners.js index 08f5870bd0..ec1a171230 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-add-listeners.js +++ b/tests/node_compat/test/parallel/test-event-emitter-add-listeners.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-event-emitter-emit-context.js b/tests/node_compat/test/parallel/test-event-emitter-emit-context.js index 76c22aa9a0..03614bab76 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-emit-context.js +++ b/tests/node_compat/test/parallel/test-event-emitter-emit-context.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-event-emitter-error-monitor.js b/tests/node_compat/test/parallel/test-event-emitter-error-monitor.js index e5df20e601..39ba06f365 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-error-monitor.js +++ b/tests/node_compat/test/parallel/test-event-emitter-error-monitor.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-event-emitter-errors.js b/tests/node_compat/test/parallel/test-event-emitter-errors.js index e8bbbb4781..da8b27b39b 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-errors.js +++ b/tests/node_compat/test/parallel/test-event-emitter-errors.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-event-emitter-get-max-listeners.js b/tests/node_compat/test/parallel/test-event-emitter-get-max-listeners.js index 15f04f266b..111bb6b730 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-get-max-listeners.js +++ b/tests/node_compat/test/parallel/test-event-emitter-get-max-listeners.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-event-emitter-invalid-listener.js b/tests/node_compat/test/parallel/test-event-emitter-invalid-listener.js index cb92dc5b2d..5053f399c7 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-invalid-listener.js +++ b/tests/node_compat/test/parallel/test-event-emitter-invalid-listener.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-event-emitter-listener-count.js b/tests/node_compat/test/parallel/test-event-emitter-listener-count.js index cb084166f1..bfe8bcced0 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-listener-count.js +++ b/tests/node_compat/test/parallel/test-event-emitter-listener-count.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-event-emitter-listeners-side-effects.js b/tests/node_compat/test/parallel/test-event-emitter-listeners-side-effects.js index 51c28c35bf..c52acd2dde 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-listeners-side-effects.js +++ b/tests/node_compat/test/parallel/test-event-emitter-listeners-side-effects.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-event-emitter-listeners.js b/tests/node_compat/test/parallel/test-event-emitter-listeners.js index cbfb9471eb..b62aac9f91 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-listeners.js +++ b/tests/node_compat/test/parallel/test-event-emitter-listeners.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-event-emitter-method-names.js b/tests/node_compat/test/parallel/test-event-emitter-method-names.js index 558fb83dfa..f3890b839a 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-method-names.js +++ b/tests/node_compat/test/parallel/test-event-emitter-method-names.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-event-emitter-modify-in-emit.js b/tests/node_compat/test/parallel/test-event-emitter-modify-in-emit.js index c08c0c31c7..564f16246c 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-modify-in-emit.js +++ b/tests/node_compat/test/parallel/test-event-emitter-modify-in-emit.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-event-emitter-num-args.js b/tests/node_compat/test/parallel/test-event-emitter-num-args.js index b1ef4bc0af..6e2cdf42f1 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-num-args.js +++ b/tests/node_compat/test/parallel/test-event-emitter-num-args.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-event-emitter-once.js b/tests/node_compat/test/parallel/test-event-emitter-once.js index eff0861f57..a93a5a43b6 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-once.js +++ b/tests/node_compat/test/parallel/test-event-emitter-once.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-event-emitter-remove-all-listeners.js b/tests/node_compat/test/parallel/test-event-emitter-remove-all-listeners.js index a2bac54c39..cfc76fc2fa 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-remove-all-listeners.js +++ b/tests/node_compat/test/parallel/test-event-emitter-remove-all-listeners.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-event-emitter-remove-listeners.js b/tests/node_compat/test/parallel/test-event-emitter-remove-listeners.js index 966bc46e22..983da177a5 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-remove-listeners.js +++ b/tests/node_compat/test/parallel/test-event-emitter-remove-listeners.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-event-emitter-set-max-listeners-side-effects.js b/tests/node_compat/test/parallel/test-event-emitter-set-max-listeners-side-effects.js index 2923a3ec77..bc50b32cda 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-set-max-listeners-side-effects.js +++ b/tests/node_compat/test/parallel/test-event-emitter-set-max-listeners-side-effects.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-event-emitter-special-event-names.js b/tests/node_compat/test/parallel/test-event-emitter-special-event-names.js index b8bc4d7e61..21455a2428 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-special-event-names.js +++ b/tests/node_compat/test/parallel/test-event-emitter-special-event-names.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-event-emitter-subclass.js b/tests/node_compat/test/parallel/test-event-emitter-subclass.js index 7ef141e93f..46d08041df 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-subclass.js +++ b/tests/node_compat/test/parallel/test-event-emitter-subclass.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-event-emitter-symbols.js b/tests/node_compat/test/parallel/test-event-emitter-symbols.js index 0b8c133b0c..74f43f229a 100644 --- a/tests/node_compat/test/parallel/test-event-emitter-symbols.js +++ b/tests/node_compat/test/parallel/test-event-emitter-symbols.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-events-list.js b/tests/node_compat/test/parallel/test-events-list.js index 0e83894bee..f0b553812f 100644 --- a/tests/node_compat/test/parallel/test-events-list.js +++ b/tests/node_compat/test/parallel/test-events-list.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-events-on-async-iterator.js b/tests/node_compat/test/parallel/test-events-on-async-iterator.js index a0ab2a5b46..2516f1e1d7 100644 --- a/tests/node_compat/test/parallel/test-events-on-async-iterator.js +++ b/tests/node_compat/test/parallel/test-events-on-async-iterator.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --expose-internals --no-warnings diff --git a/tests/node_compat/test/parallel/test-events-uncaught-exception-stack.js b/tests/node_compat/test/parallel/test-events-uncaught-exception-stack.js index 58919ef14e..72a4067b39 100644 --- a/tests/node_compat/test/parallel/test-events-uncaught-exception-stack.js +++ b/tests/node_compat/test/parallel/test-events-uncaught-exception-stack.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-eventtarget-brandcheck.js b/tests/node_compat/test/parallel/test-eventtarget-brandcheck.js index 9084bad3c5..de5592b169 100644 --- a/tests/node_compat/test/parallel/test-eventtarget-brandcheck.js +++ b/tests/node_compat/test/parallel/test-eventtarget-brandcheck.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --expose-internals diff --git a/tests/node_compat/test/parallel/test-exception-handler.js b/tests/node_compat/test/parallel/test-exception-handler.js index f3ea6e5069..18557fbf81 100644 --- a/tests/node_compat/test/parallel/test-exception-handler.js +++ b/tests/node_compat/test/parallel/test-exception-handler.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-exception-handler2.js b/tests/node_compat/test/parallel/test-exception-handler2.js index bf9efd85af..2dce592830 100644 --- a/tests/node_compat/test/parallel/test-exception-handler2.js +++ b/tests/node_compat/test/parallel/test-exception-handler2.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-file-read-noexist.js b/tests/node_compat/test/parallel/test-file-read-noexist.js index 2224315e93..3865ccfdd2 100644 --- a/tests/node_compat/test/parallel/test-file-read-noexist.js +++ b/tests/node_compat/test/parallel/test-file-read-noexist.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-file-write-stream.js b/tests/node_compat/test/parallel/test-file-write-stream.js index 22ebadd1cb..bb247d1fb9 100644 --- a/tests/node_compat/test/parallel/test-file-write-stream.js +++ b/tests/node_compat/test/parallel/test-file-write-stream.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-file-write-stream2.js b/tests/node_compat/test/parallel/test-file-write-stream2.js index 8b23683a75..39d595f3d5 100644 --- a/tests/node_compat/test/parallel/test-file-write-stream2.js +++ b/tests/node_compat/test/parallel/test-file-write-stream2.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-file-write-stream3.js b/tests/node_compat/test/parallel/test-file-write-stream3.js index 2dd5444a65..94775e0ef6 100644 --- a/tests/node_compat/test/parallel/test-file-write-stream3.js +++ b/tests/node_compat/test/parallel/test-file-write-stream3.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-file-write-stream4.js b/tests/node_compat/test/parallel/test-file-write-stream4.js index 9d5cd7d32f..82bd96b469 100644 --- a/tests/node_compat/test/parallel/test-file-write-stream4.js +++ b/tests/node_compat/test/parallel/test-file-write-stream4.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-access.js b/tests/node_compat/test/parallel/test-fs-access.js index 8add7d553e..a9c627b9bf 100644 --- a/tests/node_compat/test/parallel/test-fs-access.js +++ b/tests/node_compat/test/parallel/test-fs-access.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --expose-internals diff --git a/tests/node_compat/test/parallel/test-fs-append-file-sync.js b/tests/node_compat/test/parallel/test-fs-append-file-sync.js index fa79ddb55f..44f62f9a08 100644 --- a/tests/node_compat/test/parallel/test-fs-append-file-sync.js +++ b/tests/node_compat/test/parallel/test-fs-append-file-sync.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-fs-chown-type-check.js b/tests/node_compat/test/parallel/test-fs-chown-type-check.js index 2a0e840990..3431e0a4c4 100644 --- a/tests/node_compat/test/parallel/test-fs-chown-type-check.js +++ b/tests/node_compat/test/parallel/test-fs-chown-type-check.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-copyfile.js b/tests/node_compat/test/parallel/test-fs-copyfile.js index d00a076f31..4135b90678 100644 --- a/tests/node_compat/test/parallel/test-fs-copyfile.js +++ b/tests/node_compat/test/parallel/test-fs-copyfile.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --expose-internals diff --git a/tests/node_compat/test/parallel/test-fs-empty-readStream.js b/tests/node_compat/test/parallel/test-fs-empty-readStream.js index d3c7faf54c..618eca5fbf 100644 --- a/tests/node_compat/test/parallel/test-fs-empty-readStream.js +++ b/tests/node_compat/test/parallel/test-fs-empty-readStream.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-fs-lchown.js b/tests/node_compat/test/parallel/test-fs-lchown.js index ce3333745b..cdb4c7cb14 100644 --- a/tests/node_compat/test/parallel/test-fs-lchown.js +++ b/tests/node_compat/test/parallel/test-fs-lchown.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-open-flags.js b/tests/node_compat/test/parallel/test-fs-open-flags.js index 89f6bdcb62..64967252a7 100644 --- a/tests/node_compat/test/parallel/test-fs-open-flags.js +++ b/tests/node_compat/test/parallel/test-fs-open-flags.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-fs-open-mode-mask.js b/tests/node_compat/test/parallel/test-fs-open-mode-mask.js index 30a2cd354d..a39b1e4bfb 100644 --- a/tests/node_compat/test/parallel/test-fs-open-mode-mask.js +++ b/tests/node_compat/test/parallel/test-fs-open-mode-mask.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-open-no-close.js b/tests/node_compat/test/parallel/test-fs-open-no-close.js index 27e23a1824..4ba8890d9f 100644 --- a/tests/node_compat/test/parallel/test-fs-open-no-close.js +++ b/tests/node_compat/test/parallel/test-fs-open-no-close.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-open-numeric-flags.js b/tests/node_compat/test/parallel/test-fs-open-numeric-flags.js index 025eff60d2..d658e329f0 100644 --- a/tests/node_compat/test/parallel/test-fs-open-numeric-flags.js +++ b/tests/node_compat/test/parallel/test-fs-open-numeric-flags.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-promises-writefile-with-fd.js b/tests/node_compat/test/parallel/test-fs-promises-writefile-with-fd.js index f750c28be7..7812a4a879 100644 --- a/tests/node_compat/test/parallel/test-fs-promises-writefile-with-fd.js +++ b/tests/node_compat/test/parallel/test-fs-promises-writefile-with-fd.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-read-stream-autoClose.js b/tests/node_compat/test/parallel/test-fs-read-stream-autoClose.js index 2ab7b69e33..0719a62c94 100644 --- a/tests/node_compat/test/parallel/test-fs-read-stream-autoClose.js +++ b/tests/node_compat/test/parallel/test-fs-read-stream-autoClose.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-read-stream-concurrent-reads.js b/tests/node_compat/test/parallel/test-fs-read-stream-concurrent-reads.js index df8cead2ab..89325bd322 100644 --- a/tests/node_compat/test/parallel/test-fs-read-stream-concurrent-reads.js +++ b/tests/node_compat/test/parallel/test-fs-read-stream-concurrent-reads.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-read-stream-double-close.js b/tests/node_compat/test/parallel/test-fs-read-stream-double-close.js index 30129532bb..3b17d45ffb 100644 --- a/tests/node_compat/test/parallel/test-fs-read-stream-double-close.js +++ b/tests/node_compat/test/parallel/test-fs-read-stream-double-close.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-read-stream-encoding.js b/tests/node_compat/test/parallel/test-fs-read-stream-encoding.js index f3632dfed6..2b3fe85b0d 100644 --- a/tests/node_compat/test/parallel/test-fs-read-stream-encoding.js +++ b/tests/node_compat/test/parallel/test-fs-read-stream-encoding.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-read-stream-fd.js b/tests/node_compat/test/parallel/test-fs-read-stream-fd.js index ba7c06419a..03a4dd4bf5 100644 --- a/tests/node_compat/test/parallel/test-fs-read-stream-fd.js +++ b/tests/node_compat/test/parallel/test-fs-read-stream-fd.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-fs-read-stream-inherit.js b/tests/node_compat/test/parallel/test-fs-read-stream-inherit.js index 2f8c139e8c..e5ad24fc6c 100644 --- a/tests/node_compat/test/parallel/test-fs-read-stream-inherit.js +++ b/tests/node_compat/test/parallel/test-fs-read-stream-inherit.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-read-stream-patch-open.js b/tests/node_compat/test/parallel/test-fs-read-stream-patch-open.js index c05a4818a1..e662bf2959 100644 --- a/tests/node_compat/test/parallel/test-fs-read-stream-patch-open.js +++ b/tests/node_compat/test/parallel/test-fs-read-stream-patch-open.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-read-stream-resume.js b/tests/node_compat/test/parallel/test-fs-read-stream-resume.js index 2ab23dc790..df89ba23a8 100644 --- a/tests/node_compat/test/parallel/test-fs-read-stream-resume.js +++ b/tests/node_compat/test/parallel/test-fs-read-stream-resume.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-fs-read-stream-throw-type-error.js b/tests/node_compat/test/parallel/test-fs-read-stream-throw-type-error.js index 798627e04d..efc2c796d0 100644 --- a/tests/node_compat/test/parallel/test-fs-read-stream-throw-type-error.js +++ b/tests/node_compat/test/parallel/test-fs-read-stream-throw-type-error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-read-type.js b/tests/node_compat/test/parallel/test-fs-read-type.js index 73653bdaee..d127554b8e 100644 --- a/tests/node_compat/test/parallel/test-fs-read-type.js +++ b/tests/node_compat/test/parallel/test-fs-read-type.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-read-zero-length.js b/tests/node_compat/test/parallel/test-fs-read-zero-length.js index 59eaf2e5a8..062f290a54 100644 --- a/tests/node_compat/test/parallel/test-fs-read-zero-length.js +++ b/tests/node_compat/test/parallel/test-fs-read-zero-length.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-read.js b/tests/node_compat/test/parallel/test-fs-read.js index e8318df1ec..0681e42dce 100644 --- a/tests/node_compat/test/parallel/test-fs-read.js +++ b/tests/node_compat/test/parallel/test-fs-read.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-fs-readdir-stack-overflow.js b/tests/node_compat/test/parallel/test-fs-readdir-stack-overflow.js index e3724c56dc..a466e7e010 100644 --- a/tests/node_compat/test/parallel/test-fs-readdir-stack-overflow.js +++ b/tests/node_compat/test/parallel/test-fs-readdir-stack-overflow.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-readdir.js b/tests/node_compat/test/parallel/test-fs-readdir.js index 319020c933..31e8221ef5 100644 --- a/tests/node_compat/test/parallel/test-fs-readdir.js +++ b/tests/node_compat/test/parallel/test-fs-readdir.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-readfile-empty.js b/tests/node_compat/test/parallel/test-fs-readfile-empty.js index c076223fb3..3f3f9e83e9 100644 --- a/tests/node_compat/test/parallel/test-fs-readfile-empty.js +++ b/tests/node_compat/test/parallel/test-fs-readfile-empty.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-fs-readv-sync.js b/tests/node_compat/test/parallel/test-fs-readv-sync.js index fd0fc8cdaf..2829dbb2c8 100644 --- a/tests/node_compat/test/parallel/test-fs-readv-sync.js +++ b/tests/node_compat/test/parallel/test-fs-readv-sync.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-readv.js b/tests/node_compat/test/parallel/test-fs-readv.js index 42581cfe8b..834d1da63e 100644 --- a/tests/node_compat/test/parallel/test-fs-readv.js +++ b/tests/node_compat/test/parallel/test-fs-readv.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-realpath-native.js b/tests/node_compat/test/parallel/test-fs-realpath-native.js index f4cc649a04..753dfc1613 100644 --- a/tests/node_compat/test/parallel/test-fs-realpath-native.js +++ b/tests/node_compat/test/parallel/test-fs-realpath-native.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-rmdir-recursive-sync-warns-not-found.js b/tests/node_compat/test/parallel/test-fs-rmdir-recursive-sync-warns-not-found.js index 121a66e094..e20f5e622b 100644 --- a/tests/node_compat/test/parallel/test-fs-rmdir-recursive-sync-warns-not-found.js +++ b/tests/node_compat/test/parallel/test-fs-rmdir-recursive-sync-warns-not-found.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-rmdir-recursive-sync-warns-on-file.js b/tests/node_compat/test/parallel/test-fs-rmdir-recursive-sync-warns-on-file.js index b3f4d1fab0..0691083103 100644 --- a/tests/node_compat/test/parallel/test-fs-rmdir-recursive-sync-warns-on-file.js +++ b/tests/node_compat/test/parallel/test-fs-rmdir-recursive-sync-warns-on-file.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-rmdir-recursive-throws-not-found.js b/tests/node_compat/test/parallel/test-fs-rmdir-recursive-throws-not-found.js index 931308aadb..f337af1db2 100644 --- a/tests/node_compat/test/parallel/test-fs-rmdir-recursive-throws-not-found.js +++ b/tests/node_compat/test/parallel/test-fs-rmdir-recursive-throws-not-found.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-rmdir-recursive-throws-on-file.js b/tests/node_compat/test/parallel/test-fs-rmdir-recursive-throws-on-file.js index 6a48678bc6..123ca97755 100644 --- a/tests/node_compat/test/parallel/test-fs-rmdir-recursive-throws-on-file.js +++ b/tests/node_compat/test/parallel/test-fs-rmdir-recursive-throws-on-file.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-rmdir-recursive-warns-not-found.js b/tests/node_compat/test/parallel/test-fs-rmdir-recursive-warns-not-found.js index 2eae8b1e30..f99f413b16 100644 --- a/tests/node_compat/test/parallel/test-fs-rmdir-recursive-warns-not-found.js +++ b/tests/node_compat/test/parallel/test-fs-rmdir-recursive-warns-not-found.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-rmdir-recursive-warns-on-file.js b/tests/node_compat/test/parallel/test-fs-rmdir-recursive-warns-on-file.js index 89250b048f..f1ed786977 100644 --- a/tests/node_compat/test/parallel/test-fs-rmdir-recursive-warns-on-file.js +++ b/tests/node_compat/test/parallel/test-fs-rmdir-recursive-warns-on-file.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-rmdir-type-check.js b/tests/node_compat/test/parallel/test-fs-rmdir-type-check.js index df1d7a84f6..335824b265 100644 --- a/tests/node_compat/test/parallel/test-fs-rmdir-type-check.js +++ b/tests/node_compat/test/parallel/test-fs-rmdir-type-check.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-utimes.js b/tests/node_compat/test/parallel/test-fs-utimes.js index f24e27f367..afc5777607 100644 --- a/tests/node_compat/test/parallel/test-fs-utimes.js +++ b/tests/node_compat/test/parallel/test-fs-utimes.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-fs-watchfile.js b/tests/node_compat/test/parallel/test-fs-watchfile.js index ccbaabe06f..b46e2e5efe 100644 --- a/tests/node_compat/test/parallel/test-fs-watchfile.js +++ b/tests/node_compat/test/parallel/test-fs-watchfile.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-write-buffer.js b/tests/node_compat/test/parallel/test-fs-write-buffer.js index 13ee5f068c..4971a101d5 100644 --- a/tests/node_compat/test/parallel/test-fs-write-buffer.js +++ b/tests/node_compat/test/parallel/test-fs-write-buffer.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-fs-write-file-buffer.js b/tests/node_compat/test/parallel/test-fs-write-file-buffer.js index d0bfd32aa9..155047de8a 100644 --- a/tests/node_compat/test/parallel/test-fs-write-file-buffer.js +++ b/tests/node_compat/test/parallel/test-fs-write-file-buffer.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-fs-write-file-invalid-path.js b/tests/node_compat/test/parallel/test-fs-write-file-invalid-path.js index 063f3e4915..9345923582 100644 --- a/tests/node_compat/test/parallel/test-fs-write-file-invalid-path.js +++ b/tests/node_compat/test/parallel/test-fs-write-file-invalid-path.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-write-file-sync.js b/tests/node_compat/test/parallel/test-fs-write-file-sync.js index e7da852606..01d14b8fd0 100644 --- a/tests/node_compat/test/parallel/test-fs-write-file-sync.js +++ b/tests/node_compat/test/parallel/test-fs-write-file-sync.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-fs-write-no-fd.js b/tests/node_compat/test/parallel/test-fs-write-no-fd.js index 5723e17128..a6fdbf8eeb 100644 --- a/tests/node_compat/test/parallel/test-fs-write-no-fd.js +++ b/tests/node_compat/test/parallel/test-fs-write-no-fd.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-write-stream-autoclose-option.js b/tests/node_compat/test/parallel/test-fs-write-stream-autoclose-option.js index 480f7dcdb3..a38de9119e 100644 --- a/tests/node_compat/test/parallel/test-fs-write-stream-autoclose-option.js +++ b/tests/node_compat/test/parallel/test-fs-write-stream-autoclose-option.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-write-stream-close-without-callback.js b/tests/node_compat/test/parallel/test-fs-write-stream-close-without-callback.js index ad685be77f..10ab6ca769 100644 --- a/tests/node_compat/test/parallel/test-fs-write-stream-close-without-callback.js +++ b/tests/node_compat/test/parallel/test-fs-write-stream-close-without-callback.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-write-stream-double-close.js b/tests/node_compat/test/parallel/test-fs-write-stream-double-close.js index 0f57333081..901a77cea9 100644 --- a/tests/node_compat/test/parallel/test-fs-write-stream-double-close.js +++ b/tests/node_compat/test/parallel/test-fs-write-stream-double-close.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-write-stream-end.js b/tests/node_compat/test/parallel/test-fs-write-stream-end.js index 3221a558e8..d162e9644c 100644 --- a/tests/node_compat/test/parallel/test-fs-write-stream-end.js +++ b/tests/node_compat/test/parallel/test-fs-write-stream-end.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-fs-write-stream-fs.js b/tests/node_compat/test/parallel/test-fs-write-stream-fs.js index 253f5e4252..95fcdde26b 100644 --- a/tests/node_compat/test/parallel/test-fs-write-stream-fs.js +++ b/tests/node_compat/test/parallel/test-fs-write-stream-fs.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-write-stream-throw-type-error.js b/tests/node_compat/test/parallel/test-fs-write-stream-throw-type-error.js index 988512aa3b..d53ec243bc 100644 --- a/tests/node_compat/test/parallel/test-fs-write-stream-throw-type-error.js +++ b/tests/node_compat/test/parallel/test-fs-write-stream-throw-type-error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-fs-write-stream.js b/tests/node_compat/test/parallel/test-fs-write-stream.js index 107f22af04..589308135a 100644 --- a/tests/node_compat/test/parallel/test-fs-write-stream.js +++ b/tests/node_compat/test/parallel/test-fs-write-stream.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-fs-write-sync.js b/tests/node_compat/test/parallel/test-fs-write-sync.js index e65923102e..c846989f3b 100644 --- a/tests/node_compat/test/parallel/test-fs-write-sync.js +++ b/tests/node_compat/test/parallel/test-fs-write-sync.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-fs-write.js b/tests/node_compat/test/parallel/test-fs-write.js index e10db287fb..c8d0c2b53f 100644 --- a/tests/node_compat/test/parallel/test-fs-write.js +++ b/tests/node_compat/test/parallel/test-fs-write.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-fs-writev-sync.js b/tests/node_compat/test/parallel/test-fs-writev-sync.js index 35db3675fd..eb4eee6bc1 100644 --- a/tests/node_compat/test/parallel/test-fs-writev-sync.js +++ b/tests/node_compat/test/parallel/test-fs-writev-sync.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-handle-wrap-close-abort.js b/tests/node_compat/test/parallel/test-handle-wrap-close-abort.js index 92ad796a75..c4cd5a42bc 100644 --- a/tests/node_compat/test/parallel/test-handle-wrap-close-abort.js +++ b/tests/node_compat/test/parallel/test-handle-wrap-close-abort.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-http-agent-getname.js b/tests/node_compat/test/parallel/test-http-agent-getname.js index 530cc1378d..2a41d3813d 100644 --- a/tests/node_compat/test/parallel/test-http-agent-getname.js +++ b/tests/node_compat/test/parallel/test-http-agent-getname.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-http-client-get-url.js b/tests/node_compat/test/parallel/test-http-client-get-url.js index 2aeb0e9024..073bcbe1dc 100644 --- a/tests/node_compat/test/parallel/test-http-client-get-url.js +++ b/tests/node_compat/test/parallel/test-http-client-get-url.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-http-client-read-in-error.js b/tests/node_compat/test/parallel/test-http-client-read-in-error.js index 7f28c07681..0f54b721e4 100644 --- a/tests/node_compat/test/parallel/test-http-client-read-in-error.js +++ b/tests/node_compat/test/parallel/test-http-client-read-in-error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-http-header-validators.js b/tests/node_compat/test/parallel/test-http-header-validators.js index 40f1d8b159..9d896110d7 100644 --- a/tests/node_compat/test/parallel/test-http-header-validators.js +++ b/tests/node_compat/test/parallel/test-http-header-validators.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-http-localaddress.js b/tests/node_compat/test/parallel/test-http-localaddress.js index e4f6c4aefe..149257d43a 100644 --- a/tests/node_compat/test/parallel/test-http-localaddress.js +++ b/tests/node_compat/test/parallel/test-http-localaddress.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-http-outgoing-internal-headernames-getter.js b/tests/node_compat/test/parallel/test-http-outgoing-internal-headernames-getter.js index 490d814b99..dbd7f850a6 100644 --- a/tests/node_compat/test/parallel/test-http-outgoing-internal-headernames-getter.js +++ b/tests/node_compat/test/parallel/test-http-outgoing-internal-headernames-getter.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-http-outgoing-internal-headernames-setter.js b/tests/node_compat/test/parallel/test-http-outgoing-internal-headernames-setter.js index a36b74ed5c..8ecfbc7c3e 100644 --- a/tests/node_compat/test/parallel/test-http-outgoing-internal-headernames-setter.js +++ b/tests/node_compat/test/parallel/test-http-outgoing-internal-headernames-setter.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-http-outgoing-internal-headers.js b/tests/node_compat/test/parallel/test-http-outgoing-internal-headers.js index ac07a197ab..05d6aa64a9 100644 --- a/tests/node_compat/test/parallel/test-http-outgoing-internal-headers.js +++ b/tests/node_compat/test/parallel/test-http-outgoing-internal-headers.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --expose-internals diff --git a/tests/node_compat/test/parallel/test-http-outgoing-renderHeaders.js b/tests/node_compat/test/parallel/test-http-outgoing-renderHeaders.js index 23c61e61d8..c39d62c331 100644 --- a/tests/node_compat/test/parallel/test-http-outgoing-renderHeaders.js +++ b/tests/node_compat/test/parallel/test-http-outgoing-renderHeaders.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-http-outgoing-settimeout.js b/tests/node_compat/test/parallel/test-http-outgoing-settimeout.js index 6e1a51a17c..70373d7c05 100644 --- a/tests/node_compat/test/parallel/test-http-outgoing-settimeout.js +++ b/tests/node_compat/test/parallel/test-http-outgoing-settimeout.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-http-url.parse-only-support-http-https-protocol.js b/tests/node_compat/test/parallel/test-http-url.parse-only-support-http-https-protocol.js index 98b222f391..6e2a25be79 100644 --- a/tests/node_compat/test/parallel/test-http-url.parse-only-support-http-https-protocol.js +++ b/tests/node_compat/test/parallel/test-http-url.parse-only-support-http-https-protocol.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-icu-transcode.js b/tests/node_compat/test/parallel/test-icu-transcode.js index 1f5aeb5355..f34626892d 100644 --- a/tests/node_compat/test/parallel/test-icu-transcode.js +++ b/tests/node_compat/test/parallel/test-icu-transcode.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-access-byteswritten.js b/tests/node_compat/test/parallel/test-net-access-byteswritten.js index 54221f8551..79c005a71a 100644 --- a/tests/node_compat/test/parallel/test-net-access-byteswritten.js +++ b/tests/node_compat/test/parallel/test-net-access-byteswritten.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-better-error-messages-listen-path.js b/tests/node_compat/test/parallel/test-net-better-error-messages-listen-path.js index 73c793b1e2..c254119926 100644 --- a/tests/node_compat/test/parallel/test-net-better-error-messages-listen-path.js +++ b/tests/node_compat/test/parallel/test-net-better-error-messages-listen-path.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-better-error-messages-port-hostname.js b/tests/node_compat/test/parallel/test-net-better-error-messages-port-hostname.js index e1ae0986e8..92720a6101 100644 --- a/tests/node_compat/test/parallel/test-net-better-error-messages-port-hostname.js +++ b/tests/node_compat/test/parallel/test-net-better-error-messages-port-hostname.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-connect-after-destroy.js b/tests/node_compat/test/parallel/test-net-connect-after-destroy.js index 1473877caf..76015e7dad 100644 --- a/tests/node_compat/test/parallel/test-net-connect-after-destroy.js +++ b/tests/node_compat/test/parallel/test-net-connect-after-destroy.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-connect-destroy.js b/tests/node_compat/test/parallel/test-net-connect-destroy.js index 5618765e7e..02126aeb48 100644 --- a/tests/node_compat/test/parallel/test-net-connect-destroy.js +++ b/tests/node_compat/test/parallel/test-net-connect-destroy.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-connect-immediate-destroy.js b/tests/node_compat/test/parallel/test-net-connect-immediate-destroy.js index 004cb86676..8dcc9262b2 100644 --- a/tests/node_compat/test/parallel/test-net-connect-immediate-destroy.js +++ b/tests/node_compat/test/parallel/test-net-connect-immediate-destroy.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-connect-immediate-finish.js b/tests/node_compat/test/parallel/test-net-connect-immediate-finish.js index ef4f3d763a..c7ba46098d 100644 --- a/tests/node_compat/test/parallel/test-net-connect-immediate-finish.js +++ b/tests/node_compat/test/parallel/test-net-connect-immediate-finish.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-net-connect-no-arg.js b/tests/node_compat/test/parallel/test-net-connect-no-arg.js index ad12f7abac..2211cd4f69 100644 --- a/tests/node_compat/test/parallel/test-net-connect-no-arg.js +++ b/tests/node_compat/test/parallel/test-net-connect-no-arg.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-dns-error.js b/tests/node_compat/test/parallel/test-net-dns-error.js index 0b91b0f227..4a78055ccf 100644 --- a/tests/node_compat/test/parallel/test-net-dns-error.js +++ b/tests/node_compat/test/parallel/test-net-dns-error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-net-during-close.js b/tests/node_compat/test/parallel/test-net-during-close.js index d2ea486094..0c4f51cd3d 100644 --- a/tests/node_compat/test/parallel/test-net-during-close.js +++ b/tests/node_compat/test/parallel/test-net-during-close.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-net-end-without-connect.js b/tests/node_compat/test/parallel/test-net-end-without-connect.js index 44885b81bd..644b10de2b 100644 --- a/tests/node_compat/test/parallel/test-net-end-without-connect.js +++ b/tests/node_compat/test/parallel/test-net-end-without-connect.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-net-isip.js b/tests/node_compat/test/parallel/test-net-isip.js index 5ca25fdb9b..a4eaa70ce1 100644 --- a/tests/node_compat/test/parallel/test-net-isip.js +++ b/tests/node_compat/test/parallel/test-net-isip.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-net-isipv4.js b/tests/node_compat/test/parallel/test-net-isipv4.js index cdc9f22ace..05ccc57258 100644 --- a/tests/node_compat/test/parallel/test-net-isipv4.js +++ b/tests/node_compat/test/parallel/test-net-isipv4.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-isipv6.js b/tests/node_compat/test/parallel/test-net-isipv6.js index 752aa5aad7..5791c9fa13 100644 --- a/tests/node_compat/test/parallel/test-net-isipv6.js +++ b/tests/node_compat/test/parallel/test-net-isipv6.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-listen-close-server-callback-is-not-function.js b/tests/node_compat/test/parallel/test-net-listen-close-server-callback-is-not-function.js index 960fe6600c..94ab88407d 100644 --- a/tests/node_compat/test/parallel/test-net-listen-close-server-callback-is-not-function.js +++ b/tests/node_compat/test/parallel/test-net-listen-close-server-callback-is-not-function.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-listen-close-server.js b/tests/node_compat/test/parallel/test-net-listen-close-server.js index 18c4d111c8..df000b2dbe 100644 --- a/tests/node_compat/test/parallel/test-net-listen-close-server.js +++ b/tests/node_compat/test/parallel/test-net-listen-close-server.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-net-listening.js b/tests/node_compat/test/parallel/test-net-listening.js index b11cfa59f6..30d832ec0a 100644 --- a/tests/node_compat/test/parallel/test-net-listening.js +++ b/tests/node_compat/test/parallel/test-net-listening.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-localerror.js b/tests/node_compat/test/parallel/test-net-localerror.js index 30287a55c0..63276fe2bb 100644 --- a/tests/node_compat/test/parallel/test-net-localerror.js +++ b/tests/node_compat/test/parallel/test-net-localerror.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-net-options-lookup.js b/tests/node_compat/test/parallel/test-net-options-lookup.js index e5b0a4c4c8..d285ae6e4a 100644 --- a/tests/node_compat/test/parallel/test-net-options-lookup.js +++ b/tests/node_compat/test/parallel/test-net-options-lookup.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-pipe-connect-errors.js b/tests/node_compat/test/parallel/test-net-pipe-connect-errors.js index 1e3681744a..c1e68f5b70 100644 --- a/tests/node_compat/test/parallel/test-net-pipe-connect-errors.js +++ b/tests/node_compat/test/parallel/test-net-pipe-connect-errors.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-net-server-listen-options-signal.js b/tests/node_compat/test/parallel/test-net-server-listen-options-signal.js index 080dd933c4..b6e93f37ba 100644 --- a/tests/node_compat/test/parallel/test-net-server-listen-options-signal.js +++ b/tests/node_compat/test/parallel/test-net-server-listen-options-signal.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-server-listen-options.js b/tests/node_compat/test/parallel/test-net-server-listen-options.js index 0220a78cbb..982373e871 100644 --- a/tests/node_compat/test/parallel/test-net-server-listen-options.js +++ b/tests/node_compat/test/parallel/test-net-server-listen-options.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-server-listen-remove-callback.js b/tests/node_compat/test/parallel/test-net-server-listen-remove-callback.js index bc9fff8523..9f48ce4f2e 100644 --- a/tests/node_compat/test/parallel/test-net-server-listen-remove-callback.js +++ b/tests/node_compat/test/parallel/test-net-server-listen-remove-callback.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-net-server-options.js b/tests/node_compat/test/parallel/test-net-server-options.js index c8403771cd..3e4c557ddb 100644 --- a/tests/node_compat/test/parallel/test-net-server-options.js +++ b/tests/node_compat/test/parallel/test-net-server-options.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-server-unref-persistent.js b/tests/node_compat/test/parallel/test-net-server-unref-persistent.js index efbf38386f..8cff4eb211 100644 --- a/tests/node_compat/test/parallel/test-net-server-unref-persistent.js +++ b/tests/node_compat/test/parallel/test-net-server-unref-persistent.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-server-unref.js b/tests/node_compat/test/parallel/test-net-server-unref.js index 91e3bfdc40..30f870585c 100644 --- a/tests/node_compat/test/parallel/test-net-server-unref.js +++ b/tests/node_compat/test/parallel/test-net-server-unref.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-net-socket-destroy-twice.js b/tests/node_compat/test/parallel/test-net-socket-destroy-twice.js index 9aad4f0d25..597180bf4e 100644 --- a/tests/node_compat/test/parallel/test-net-socket-destroy-twice.js +++ b/tests/node_compat/test/parallel/test-net-socket-destroy-twice.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-net-socket-no-halfopen-enforcer.js b/tests/node_compat/test/parallel/test-net-socket-no-halfopen-enforcer.js index 1a2e6f63e4..a9c8ef8e803 100644 --- a/tests/node_compat/test/parallel/test-net-socket-no-halfopen-enforcer.js +++ b/tests/node_compat/test/parallel/test-net-socket-no-halfopen-enforcer.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-socket-setnodelay.js b/tests/node_compat/test/parallel/test-net-socket-setnodelay.js index 3d11b84528..ab389c58f7 100644 --- a/tests/node_compat/test/parallel/test-net-socket-setnodelay.js +++ b/tests/node_compat/test/parallel/test-net-socket-setnodelay.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-net-timeout-no-handle.js b/tests/node_compat/test/parallel/test-net-timeout-no-handle.js index eea4602397..7b4e74ff19 100644 --- a/tests/node_compat/test/parallel/test-net-timeout-no-handle.js +++ b/tests/node_compat/test/parallel/test-net-timeout-no-handle.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-next-tick-doesnt-hang.js b/tests/node_compat/test/parallel/test-next-tick-doesnt-hang.js index a08c918063..916e815bc5 100644 --- a/tests/node_compat/test/parallel/test-next-tick-doesnt-hang.js +++ b/tests/node_compat/test/parallel/test-next-tick-doesnt-hang.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-next-tick-fixed-queue-regression.js b/tests/node_compat/test/parallel/test-next-tick-fixed-queue-regression.js index d1b2bd56b6..9129fbbe42 100644 --- a/tests/node_compat/test/parallel/test-next-tick-fixed-queue-regression.js +++ b/tests/node_compat/test/parallel/test-next-tick-fixed-queue-regression.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-next-tick-intentional-starvation.js b/tests/node_compat/test/parallel/test-next-tick-intentional-starvation.js index 3b286b6bda..16623fb6ca 100644 --- a/tests/node_compat/test/parallel/test-next-tick-intentional-starvation.js +++ b/tests/node_compat/test/parallel/test-next-tick-intentional-starvation.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-next-tick-ordering.js b/tests/node_compat/test/parallel/test-next-tick-ordering.js index 3dd4dc2ea2..78f7b3b120 100644 --- a/tests/node_compat/test/parallel/test-next-tick-ordering.js +++ b/tests/node_compat/test/parallel/test-next-tick-ordering.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-next-tick-ordering2.js b/tests/node_compat/test/parallel/test-next-tick-ordering2.js index 90239fb219..6ea41c9079 100644 --- a/tests/node_compat/test/parallel/test-next-tick-ordering2.js +++ b/tests/node_compat/test/parallel/test-next-tick-ordering2.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-next-tick-when-exiting.js b/tests/node_compat/test/parallel/test-next-tick-when-exiting.js index 0ba2a2db3b..c2e9ecdbc3 100644 --- a/tests/node_compat/test/parallel/test-next-tick-when-exiting.js +++ b/tests/node_compat/test/parallel/test-next-tick-when-exiting.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-next-tick.js b/tests/node_compat/test/parallel/test-next-tick.js index 6e4e7bfe79..1e6ceab70c 100644 --- a/tests/node_compat/test/parallel/test-next-tick.js +++ b/tests/node_compat/test/parallel/test-next-tick.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-nodeeventtarget.js b/tests/node_compat/test/parallel/test-nodeeventtarget.js index d78a662879..aa325f6014 100644 --- a/tests/node_compat/test/parallel/test-nodeeventtarget.js +++ b/tests/node_compat/test/parallel/test-nodeeventtarget.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --expose-internals --no-warnings diff --git a/tests/node_compat/test/parallel/test-os.js b/tests/node_compat/test/parallel/test-os.js index f7c24342ad..f3036c2c62 100644 --- a/tests/node_compat/test/parallel/test-os.js +++ b/tests/node_compat/test/parallel/test-os.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-outgoing-message-destroy.js b/tests/node_compat/test/parallel/test-outgoing-message-destroy.js index 1ad4ce2ebf..1e720ab5bc 100644 --- a/tests/node_compat/test/parallel/test-outgoing-message-destroy.js +++ b/tests/node_compat/test/parallel/test-outgoing-message-destroy.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-outgoing-message-pipe.js b/tests/node_compat/test/parallel/test-outgoing-message-pipe.js index d20df11e92..a0f28ae8e6 100644 --- a/tests/node_compat/test/parallel/test-outgoing-message-pipe.js +++ b/tests/node_compat/test/parallel/test-outgoing-message-pipe.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-parse-args.mjs b/tests/node_compat/test/parallel/test-parse-args.mjs index 0d5aa72f63..c03c270e0d 100644 --- a/tests/node_compat/test/parallel/test-parse-args.mjs +++ b/tests/node_compat/test/parallel/test-parse-args.mjs @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. import '../common/index.mjs'; diff --git a/tests/node_compat/test/parallel/test-path-basename.js b/tests/node_compat/test/parallel/test-path-basename.js index 5a5da668e1..8c186bc5cd 100644 --- a/tests/node_compat/test/parallel/test-path-basename.js +++ b/tests/node_compat/test/parallel/test-path-basename.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-path-dirname.js b/tests/node_compat/test/parallel/test-path-dirname.js index b6a59d9991..dffb0e11d1 100644 --- a/tests/node_compat/test/parallel/test-path-dirname.js +++ b/tests/node_compat/test/parallel/test-path-dirname.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-path-extname.js b/tests/node_compat/test/parallel/test-path-extname.js index 8cba90b073..96edd9c6ac 100644 --- a/tests/node_compat/test/parallel/test-path-extname.js +++ b/tests/node_compat/test/parallel/test-path-extname.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-path-isabsolute.js b/tests/node_compat/test/parallel/test-path-isabsolute.js index 8ad2f93f5c..e1820f0718 100644 --- a/tests/node_compat/test/parallel/test-path-isabsolute.js +++ b/tests/node_compat/test/parallel/test-path-isabsolute.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-path-join.js b/tests/node_compat/test/parallel/test-path-join.js index 05e3d86f78..ef794619d6 100644 --- a/tests/node_compat/test/parallel/test-path-join.js +++ b/tests/node_compat/test/parallel/test-path-join.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-path-makelong.js b/tests/node_compat/test/parallel/test-path-makelong.js index a9dbce2a03..afd113538b 100644 --- a/tests/node_compat/test/parallel/test-path-makelong.js +++ b/tests/node_compat/test/parallel/test-path-makelong.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-path-normalize.js b/tests/node_compat/test/parallel/test-path-normalize.js index 2773a6088f..f8c9b47622 100644 --- a/tests/node_compat/test/parallel/test-path-normalize.js +++ b/tests/node_compat/test/parallel/test-path-normalize.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-path-parse-format.js b/tests/node_compat/test/parallel/test-path-parse-format.js index 7f4682899e..b2aeb1fb83 100644 --- a/tests/node_compat/test/parallel/test-path-parse-format.js +++ b/tests/node_compat/test/parallel/test-path-parse-format.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-path-posix-exists.js b/tests/node_compat/test/parallel/test-path-posix-exists.js index 97cb68f0a8..b3c6572644 100644 --- a/tests/node_compat/test/parallel/test-path-posix-exists.js +++ b/tests/node_compat/test/parallel/test-path-posix-exists.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-path-relative.js b/tests/node_compat/test/parallel/test-path-relative.js index bb0ba2ba11..45d7d09231 100644 --- a/tests/node_compat/test/parallel/test-path-relative.js +++ b/tests/node_compat/test/parallel/test-path-relative.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-path-win32-exists.js b/tests/node_compat/test/parallel/test-path-win32-exists.js index 559142bc22..96ef69191c 100644 --- a/tests/node_compat/test/parallel/test-path-win32-exists.js +++ b/tests/node_compat/test/parallel/test-path-win32-exists.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-path-zero-length-strings.js b/tests/node_compat/test/parallel/test-path-zero-length-strings.js index 8b26e9ffeb..8c68bfff1f 100644 --- a/tests/node_compat/test/parallel/test-path-zero-length-strings.js +++ b/tests/node_compat/test/parallel/test-path-zero-length-strings.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-path.js b/tests/node_compat/test/parallel/test-path.js index 2d0a928723..4396246b1b 100644 --- a/tests/node_compat/test/parallel/test-path.js +++ b/tests/node_compat/test/parallel/test-path.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-process-beforeexit.js b/tests/node_compat/test/parallel/test-process-beforeexit.js index 036b88c9f2..27bbe67762 100644 --- a/tests/node_compat/test/parallel/test-process-beforeexit.js +++ b/tests/node_compat/test/parallel/test-process-beforeexit.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-process-binding-internalbinding-allowlist.js b/tests/node_compat/test/parallel/test-process-binding-internalbinding-allowlist.js index 52abd847a1..2747e93743 100644 --- a/tests/node_compat/test/parallel/test-process-binding-internalbinding-allowlist.js +++ b/tests/node_compat/test/parallel/test-process-binding-internalbinding-allowlist.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --no-warnings diff --git a/tests/node_compat/test/parallel/test-process-env-allowed-flags.js b/tests/node_compat/test/parallel/test-process-env-allowed-flags.js index 621f2710f3..cdd847e9fe 100644 --- a/tests/node_compat/test/parallel/test-process-env-allowed-flags.js +++ b/tests/node_compat/test/parallel/test-process-env-allowed-flags.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-process-exit-from-before-exit.js b/tests/node_compat/test/parallel/test-process-exit-from-before-exit.js index 000a7691f5..49705c1f32 100644 --- a/tests/node_compat/test/parallel/test-process-exit-from-before-exit.js +++ b/tests/node_compat/test/parallel/test-process-exit-from-before-exit.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-process-exit-handler.js b/tests/node_compat/test/parallel/test-process-exit-handler.js index c79fb7ceee..c8de3a91e5 100644 --- a/tests/node_compat/test/parallel/test-process-exit-handler.js +++ b/tests/node_compat/test/parallel/test-process-exit-handler.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-process-exit-recursive.js b/tests/node_compat/test/parallel/test-process-exit-recursive.js index 77a34f4f26..979347c8a0 100644 --- a/tests/node_compat/test/parallel/test-process-exit-recursive.js +++ b/tests/node_compat/test/parallel/test-process-exit-recursive.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-process-exit.js b/tests/node_compat/test/parallel/test-process-exit.js index 8e5e4b806b..2ff5fc6dc4 100644 --- a/tests/node_compat/test/parallel/test-process-exit.js +++ b/tests/node_compat/test/parallel/test-process-exit.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-process-kill-pid.js b/tests/node_compat/test/parallel/test-process-kill-pid.js index 12fb72421a..4503615112 100644 --- a/tests/node_compat/test/parallel/test-process-kill-pid.js +++ b/tests/node_compat/test/parallel/test-process-kill-pid.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-process-uptime.js b/tests/node_compat/test/parallel/test-process-uptime.js index 31cbcf26c9..f93ad3d914 100644 --- a/tests/node_compat/test/parallel/test-process-uptime.js +++ b/tests/node_compat/test/parallel/test-process-uptime.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-promise-unhandled-silent.js b/tests/node_compat/test/parallel/test-promise-unhandled-silent.js index 2e265db368..fc953ba33b 100644 --- a/tests/node_compat/test/parallel/test-promise-unhandled-silent.js +++ b/tests/node_compat/test/parallel/test-promise-unhandled-silent.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --unhandled-rejections=none diff --git a/tests/node_compat/test/parallel/test-promise-unhandled-throw-handler.js b/tests/node_compat/test/parallel/test-promise-unhandled-throw-handler.js index 3f039f93f1..b64e5f669b 100644 --- a/tests/node_compat/test/parallel/test-promise-unhandled-throw-handler.js +++ b/tests/node_compat/test/parallel/test-promise-unhandled-throw-handler.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --unhandled-rejections=throw diff --git a/tests/node_compat/test/parallel/test-punycode.js b/tests/node_compat/test/parallel/test-punycode.js index d08a6f1497..10aabaa276 100644 --- a/tests/node_compat/test/parallel/test-punycode.js +++ b/tests/node_compat/test/parallel/test-punycode.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --pending-deprecation diff --git a/tests/node_compat/test/parallel/test-querystring-escape.js b/tests/node_compat/test/parallel/test-querystring-escape.js index 206290b476..bd23596e3d 100644 --- a/tests/node_compat/test/parallel/test-querystring-escape.js +++ b/tests/node_compat/test/parallel/test-querystring-escape.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-querystring-maxKeys-non-finite.js b/tests/node_compat/test/parallel/test-querystring-maxKeys-non-finite.js index 3fb0815be3..b58be5d340 100644 --- a/tests/node_compat/test/parallel/test-querystring-maxKeys-non-finite.js +++ b/tests/node_compat/test/parallel/test-querystring-maxKeys-non-finite.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-querystring-multichar-separator.js b/tests/node_compat/test/parallel/test-querystring-multichar-separator.js index 79ea8dce6b..0626803e19 100644 --- a/tests/node_compat/test/parallel/test-querystring-multichar-separator.js +++ b/tests/node_compat/test/parallel/test-querystring-multichar-separator.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-readline-emit-keypress-events.js b/tests/node_compat/test/parallel/test-readline-emit-keypress-events.js index 8f346be18d..ccb10af70d 100644 --- a/tests/node_compat/test/parallel/test-readline-emit-keypress-events.js +++ b/tests/node_compat/test/parallel/test-readline-emit-keypress-events.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-readline-interface-escapecodetimeout.js b/tests/node_compat/test/parallel/test-readline-interface-escapecodetimeout.js index 284913b374..69a9ded7c3 100644 --- a/tests/node_compat/test/parallel/test-readline-interface-escapecodetimeout.js +++ b/tests/node_compat/test/parallel/test-readline-interface-escapecodetimeout.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-readline-keys.js b/tests/node_compat/test/parallel/test-readline-keys.js index 4487e8d711..fc7feb735f 100644 --- a/tests/node_compat/test/parallel/test-readline-keys.js +++ b/tests/node_compat/test/parallel/test-readline-keys.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-readline-position.js b/tests/node_compat/test/parallel/test-readline-position.js index acc5cf9202..e43851997d 100644 --- a/tests/node_compat/test/parallel/test-readline-position.js +++ b/tests/node_compat/test/parallel/test-readline-position.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --expose-internals diff --git a/tests/node_compat/test/parallel/test-readline-reopen.js b/tests/node_compat/test/parallel/test-readline-reopen.js index b8a9afe859..a193c1eb81 100644 --- a/tests/node_compat/test/parallel/test-readline-reopen.js +++ b/tests/node_compat/test/parallel/test-readline-reopen.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-readline-set-raw-mode.js b/tests/node_compat/test/parallel/test-readline-set-raw-mode.js index 5cf7c68f24..7d31896e26 100644 --- a/tests/node_compat/test/parallel/test-readline-set-raw-mode.js +++ b/tests/node_compat/test/parallel/test-readline-set-raw-mode.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-readline-undefined-columns.js b/tests/node_compat/test/parallel/test-readline-undefined-columns.js index 5946bf7cbe..8de1ce3388 100644 --- a/tests/node_compat/test/parallel/test-readline-undefined-columns.js +++ b/tests/node_compat/test/parallel/test-readline-undefined-columns.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-readline.js b/tests/node_compat/test/parallel/test-readline.js index 91be36bc61..fb2388247a 100644 --- a/tests/node_compat/test/parallel/test-readline.js +++ b/tests/node_compat/test/parallel/test-readline.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-add-abort-signal.js b/tests/node_compat/test/parallel/test-stream-add-abort-signal.js index 684ccff205..1db215a43d 100644 --- a/tests/node_compat/test/parallel/test-stream-add-abort-signal.js +++ b/tests/node_compat/test/parallel/test-stream-add-abort-signal.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --expose-internals diff --git a/tests/node_compat/test/parallel/test-stream-aliases-legacy.js b/tests/node_compat/test/parallel/test-stream-aliases-legacy.js index a62f1f9de6..af966a80c6 100644 --- a/tests/node_compat/test/parallel/test-stream-aliases-legacy.js +++ b/tests/node_compat/test/parallel/test-stream-aliases-legacy.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-auto-destroy.js b/tests/node_compat/test/parallel/test-stream-auto-destroy.js index 651c7e2e5d..f036a6e419 100644 --- a/tests/node_compat/test/parallel/test-stream-auto-destroy.js +++ b/tests/node_compat/test/parallel/test-stream-auto-destroy.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-await-drain-writers-in-synchronously-recursion-write.js b/tests/node_compat/test/parallel/test-stream-await-drain-writers-in-synchronously-recursion-write.js index 597cca8785..1d00048c0e 100644 --- a/tests/node_compat/test/parallel/test-stream-await-drain-writers-in-synchronously-recursion-write.js +++ b/tests/node_compat/test/parallel/test-stream-await-drain-writers-in-synchronously-recursion-write.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-backpressure.js b/tests/node_compat/test/parallel/test-stream-backpressure.js index 6bf0c33612..c88c5228ca 100644 --- a/tests/node_compat/test/parallel/test-stream-backpressure.js +++ b/tests/node_compat/test/parallel/test-stream-backpressure.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-big-packet.js b/tests/node_compat/test/parallel/test-stream-big-packet.js index 2708d99f28..0db08f7e0c 100644 --- a/tests/node_compat/test/parallel/test-stream-big-packet.js +++ b/tests/node_compat/test/parallel/test-stream-big-packet.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-big-push.js b/tests/node_compat/test/parallel/test-stream-big-push.js index 2f6e646cc3..0ccdbc32d5 100644 --- a/tests/node_compat/test/parallel/test-stream-big-push.js +++ b/tests/node_compat/test/parallel/test-stream-big-push.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-construct.js b/tests/node_compat/test/parallel/test-stream-construct.js index be0f605cd5..33a1496662 100644 --- a/tests/node_compat/test/parallel/test-stream-construct.js +++ b/tests/node_compat/test/parallel/test-stream-construct.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-destroy-event-order.js b/tests/node_compat/test/parallel/test-stream-destroy-event-order.js index e974cebc74..83963a9add 100644 --- a/tests/node_compat/test/parallel/test-stream-destroy-event-order.js +++ b/tests/node_compat/test/parallel/test-stream-destroy-event-order.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-duplex-destroy.js b/tests/node_compat/test/parallel/test-stream-duplex-destroy.js index fbc9b6b0e5..9116dfb412 100644 --- a/tests/node_compat/test/parallel/test-stream-duplex-destroy.js +++ b/tests/node_compat/test/parallel/test-stream-duplex-destroy.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-duplex-end.js b/tests/node_compat/test/parallel/test-stream-duplex-end.js index cf5523c51b..c661b9cbd2 100644 --- a/tests/node_compat/test/parallel/test-stream-duplex-end.js +++ b/tests/node_compat/test/parallel/test-stream-duplex-end.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-duplex-props.js b/tests/node_compat/test/parallel/test-stream-duplex-props.js index d12f8fc827..402c9bfd1f 100644 --- a/tests/node_compat/test/parallel/test-stream-duplex-props.js +++ b/tests/node_compat/test/parallel/test-stream-duplex-props.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-duplex-readable-end.js b/tests/node_compat/test/parallel/test-stream-duplex-readable-end.js index 08d831d7f2..b091571788 100644 --- a/tests/node_compat/test/parallel/test-stream-duplex-readable-end.js +++ b/tests/node_compat/test/parallel/test-stream-duplex-readable-end.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-duplex-writable-finished.js b/tests/node_compat/test/parallel/test-stream-duplex-writable-finished.js index dc542a47bd..49b1e7c052 100644 --- a/tests/node_compat/test/parallel/test-stream-duplex-writable-finished.js +++ b/tests/node_compat/test/parallel/test-stream-duplex-writable-finished.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-duplex.js b/tests/node_compat/test/parallel/test-stream-duplex.js index 18013ec3a0..a83ddf5040 100644 --- a/tests/node_compat/test/parallel/test-stream-duplex.js +++ b/tests/node_compat/test/parallel/test-stream-duplex.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-end-paused.js b/tests/node_compat/test/parallel/test-stream-end-paused.js index dd71ee4762..7e316bff64 100644 --- a/tests/node_compat/test/parallel/test-stream-end-paused.js +++ b/tests/node_compat/test/parallel/test-stream-end-paused.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-error-once.js b/tests/node_compat/test/parallel/test-stream-error-once.js index fd36e573fc..60a5cdd4e4 100644 --- a/tests/node_compat/test/parallel/test-stream-error-once.js +++ b/tests/node_compat/test/parallel/test-stream-error-once.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-events-prepend.js b/tests/node_compat/test/parallel/test-stream-events-prepend.js index 1ed5563bed..81de84a26b 100644 --- a/tests/node_compat/test/parallel/test-stream-events-prepend.js +++ b/tests/node_compat/test/parallel/test-stream-events-prepend.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-inheritance.js b/tests/node_compat/test/parallel/test-stream-inheritance.js index ca5d9cbe1b..f055bb70f2 100644 --- a/tests/node_compat/test/parallel/test-stream-inheritance.js +++ b/tests/node_compat/test/parallel/test-stream-inheritance.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-ispaused.js b/tests/node_compat/test/parallel/test-stream-ispaused.js index 796b0d2a82..852cd87535 100644 --- a/tests/node_compat/test/parallel/test-stream-ispaused.js +++ b/tests/node_compat/test/parallel/test-stream-ispaused.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-objectmode-undefined.js b/tests/node_compat/test/parallel/test-stream-objectmode-undefined.js index 6cc8cbb700..6d11c60553 100644 --- a/tests/node_compat/test/parallel/test-stream-objectmode-undefined.js +++ b/tests/node_compat/test/parallel/test-stream-objectmode-undefined.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-once-readable-pipe.js b/tests/node_compat/test/parallel/test-stream-once-readable-pipe.js index e36c77aad0..a02a9eb059 100644 --- a/tests/node_compat/test/parallel/test-stream-once-readable-pipe.js +++ b/tests/node_compat/test/parallel/test-stream-once-readable-pipe.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-pipe-after-end.js b/tests/node_compat/test/parallel/test-stream-pipe-after-end.js index 680c1d0f97..6e71ac7992 100644 --- a/tests/node_compat/test/parallel/test-stream-pipe-after-end.js +++ b/tests/node_compat/test/parallel/test-stream-pipe-after-end.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-pipe-await-drain-manual-resume.js b/tests/node_compat/test/parallel/test-stream-pipe-await-drain-manual-resume.js index 9c9b188fb0..d6fe4d534a 100644 --- a/tests/node_compat/test/parallel/test-stream-pipe-await-drain-manual-resume.js +++ b/tests/node_compat/test/parallel/test-stream-pipe-await-drain-manual-resume.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-pipe-await-drain-push-while-write.js b/tests/node_compat/test/parallel/test-stream-pipe-await-drain-push-while-write.js index 32af6c5171..00337d32ff 100644 --- a/tests/node_compat/test/parallel/test-stream-pipe-await-drain-push-while-write.js +++ b/tests/node_compat/test/parallel/test-stream-pipe-await-drain-push-while-write.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-pipe-await-drain.js b/tests/node_compat/test/parallel/test-stream-pipe-await-drain.js index 75a92e91ca..d54955829b 100644 --- a/tests/node_compat/test/parallel/test-stream-pipe-await-drain.js +++ b/tests/node_compat/test/parallel/test-stream-pipe-await-drain.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-pipe-cleanup-pause.js b/tests/node_compat/test/parallel/test-stream-pipe-cleanup-pause.js index a69b3e5be7..ce750bd01d 100644 --- a/tests/node_compat/test/parallel/test-stream-pipe-cleanup-pause.js +++ b/tests/node_compat/test/parallel/test-stream-pipe-cleanup-pause.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-pipe-cleanup.js b/tests/node_compat/test/parallel/test-stream-pipe-cleanup.js index 908045305b..986871125b 100644 --- a/tests/node_compat/test/parallel/test-stream-pipe-cleanup.js +++ b/tests/node_compat/test/parallel/test-stream-pipe-cleanup.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-pipe-error-handling.js b/tests/node_compat/test/parallel/test-stream-pipe-error-handling.js index 0ef417e875..448cfed936 100644 --- a/tests/node_compat/test/parallel/test-stream-pipe-error-handling.js +++ b/tests/node_compat/test/parallel/test-stream-pipe-error-handling.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-pipe-event.js b/tests/node_compat/test/parallel/test-stream-pipe-event.js index 9b90d89efa..f49a6b0ab0 100644 --- a/tests/node_compat/test/parallel/test-stream-pipe-event.js +++ b/tests/node_compat/test/parallel/test-stream-pipe-event.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-pipe-flow-after-unpipe.js b/tests/node_compat/test/parallel/test-stream-pipe-flow-after-unpipe.js index 9115e79756..f3cf7b7e83 100644 --- a/tests/node_compat/test/parallel/test-stream-pipe-flow-after-unpipe.js +++ b/tests/node_compat/test/parallel/test-stream-pipe-flow-after-unpipe.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-pipe-flow.js b/tests/node_compat/test/parallel/test-stream-pipe-flow.js index d7f516bf85..6d5ddc44a5 100644 --- a/tests/node_compat/test/parallel/test-stream-pipe-flow.js +++ b/tests/node_compat/test/parallel/test-stream-pipe-flow.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-pipe-manual-resume.js b/tests/node_compat/test/parallel/test-stream-pipe-manual-resume.js index 8ea889f1fe..13cf6bc9c7 100644 --- a/tests/node_compat/test/parallel/test-stream-pipe-manual-resume.js +++ b/tests/node_compat/test/parallel/test-stream-pipe-manual-resume.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-pipe-multiple-pipes.js b/tests/node_compat/test/parallel/test-stream-pipe-multiple-pipes.js index 7796eaef14..d9c8a239dc 100644 --- a/tests/node_compat/test/parallel/test-stream-pipe-multiple-pipes.js +++ b/tests/node_compat/test/parallel/test-stream-pipe-multiple-pipes.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-pipe-needDrain.js b/tests/node_compat/test/parallel/test-stream-pipe-needDrain.js index 9e94384442..506b4c727f 100644 --- a/tests/node_compat/test/parallel/test-stream-pipe-needDrain.js +++ b/tests/node_compat/test/parallel/test-stream-pipe-needDrain.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-pipe-same-destination-twice.js b/tests/node_compat/test/parallel/test-stream-pipe-same-destination-twice.js index 251ae2bbbe..f6cf12c952 100644 --- a/tests/node_compat/test/parallel/test-stream-pipe-same-destination-twice.js +++ b/tests/node_compat/test/parallel/test-stream-pipe-same-destination-twice.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-pipe-unpipe-streams.js b/tests/node_compat/test/parallel/test-stream-pipe-unpipe-streams.js index a69b5877e9..caba640696 100644 --- a/tests/node_compat/test/parallel/test-stream-pipe-unpipe-streams.js +++ b/tests/node_compat/test/parallel/test-stream-pipe-unpipe-streams.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-pipe-without-listenerCount.js b/tests/node_compat/test/parallel/test-stream-pipe-without-listenerCount.js index 40cc094394..94bccd59f5 100644 --- a/tests/node_compat/test/parallel/test-stream-pipe-without-listenerCount.js +++ b/tests/node_compat/test/parallel/test-stream-pipe-without-listenerCount.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-pipeline-async-iterator.js b/tests/node_compat/test/parallel/test-stream-pipeline-async-iterator.js index 963bc07685..751c003b66 100644 --- a/tests/node_compat/test/parallel/test-stream-pipeline-async-iterator.js +++ b/tests/node_compat/test/parallel/test-stream-pipeline-async-iterator.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-pipeline-queued-end-in-destroy.js b/tests/node_compat/test/parallel/test-stream-pipeline-queued-end-in-destroy.js index 7060d7da90..305c9f008b 100644 --- a/tests/node_compat/test/parallel/test-stream-pipeline-queued-end-in-destroy.js +++ b/tests/node_compat/test/parallel/test-stream-pipeline-queued-end-in-destroy.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-pipeline-with-empty-string.js b/tests/node_compat/test/parallel/test-stream-pipeline-with-empty-string.js index a85e12a7f2..d372c4ffa2 100644 --- a/tests/node_compat/test/parallel/test-stream-pipeline-with-empty-string.js +++ b/tests/node_compat/test/parallel/test-stream-pipeline-with-empty-string.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-push-strings.js b/tests/node_compat/test/parallel/test-stream-push-strings.js index 2720b6b9ef..d98daadbd8 100644 --- a/tests/node_compat/test/parallel/test-stream-push-strings.js +++ b/tests/node_compat/test/parallel/test-stream-push-strings.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-readable-aborted.js b/tests/node_compat/test/parallel/test-stream-readable-aborted.js index e7664df4d5..3f43426c61 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-aborted.js +++ b/tests/node_compat/test/parallel/test-stream-readable-aborted.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-add-chunk-during-data.js b/tests/node_compat/test/parallel/test-stream-readable-add-chunk-during-data.js index 9358f33b75..5ae8f20469 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-add-chunk-during-data.js +++ b/tests/node_compat/test/parallel/test-stream-readable-add-chunk-during-data.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-constructor-set-methods.js b/tests/node_compat/test/parallel/test-stream-readable-constructor-set-methods.js index 3c4e229e52..89bff31ce4 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-constructor-set-methods.js +++ b/tests/node_compat/test/parallel/test-stream-readable-constructor-set-methods.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-data.js b/tests/node_compat/test/parallel/test-stream-readable-data.js index aadf7efd68..391ded40d8 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-data.js +++ b/tests/node_compat/test/parallel/test-stream-readable-data.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-destroy.js b/tests/node_compat/test/parallel/test-stream-readable-destroy.js index 75cec92dc3..ed0de9f855 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-destroy.js +++ b/tests/node_compat/test/parallel/test-stream-readable-destroy.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-didRead.js b/tests/node_compat/test/parallel/test-stream-readable-didRead.js index ca2a09275a..17a6c683fb 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-didRead.js +++ b/tests/node_compat/test/parallel/test-stream-readable-didRead.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-emit-readable-short-stream.js b/tests/node_compat/test/parallel/test-stream-readable-emit-readable-short-stream.js index a0612cacf8..4cb363fe8f 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-emit-readable-short-stream.js +++ b/tests/node_compat/test/parallel/test-stream-readable-emit-readable-short-stream.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-emittedReadable.js b/tests/node_compat/test/parallel/test-stream-readable-emittedReadable.js index 24a6d96a42..5df4ceb8b4 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-emittedReadable.js +++ b/tests/node_compat/test/parallel/test-stream-readable-emittedReadable.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-end-destroyed.js b/tests/node_compat/test/parallel/test-stream-readable-end-destroyed.js index 655fd145b6..900f457c0c 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-end-destroyed.js +++ b/tests/node_compat/test/parallel/test-stream-readable-end-destroyed.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-ended.js b/tests/node_compat/test/parallel/test-stream-readable-ended.js index aaf06aacc8..26c113d1e1 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-ended.js +++ b/tests/node_compat/test/parallel/test-stream-readable-ended.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-error-end.js b/tests/node_compat/test/parallel/test-stream-readable-error-end.js index 282b4e9008..2a56a35af4 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-error-end.js +++ b/tests/node_compat/test/parallel/test-stream-readable-error-end.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-event.js b/tests/node_compat/test/parallel/test-stream-readable-event.js index 394a42ffb8..11ff7e51f0 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-event.js +++ b/tests/node_compat/test/parallel/test-stream-readable-event.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-readable-flow-recursion.js b/tests/node_compat/test/parallel/test-stream-readable-flow-recursion.js index 34806a2e3b..cebc1af3ab 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-flow-recursion.js +++ b/tests/node_compat/test/parallel/test-stream-readable-flow-recursion.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-readable-hwm-0-async.js b/tests/node_compat/test/parallel/test-stream-readable-hwm-0-async.js index 21f7cdb26f..641ed53e0c 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-hwm-0-async.js +++ b/tests/node_compat/test/parallel/test-stream-readable-hwm-0-async.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-hwm-0-no-flow-data.js b/tests/node_compat/test/parallel/test-stream-readable-hwm-0-no-flow-data.js index 05ac0c71ec..1e4d48cd05 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-hwm-0-no-flow-data.js +++ b/tests/node_compat/test/parallel/test-stream-readable-hwm-0-no-flow-data.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-hwm-0.js b/tests/node_compat/test/parallel/test-stream-readable-hwm-0.js index 94a0657ead..c16ce1e95d 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-hwm-0.js +++ b/tests/node_compat/test/parallel/test-stream-readable-hwm-0.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-infinite-read.js b/tests/node_compat/test/parallel/test-stream-readable-infinite-read.js index 7e235e0589..2fab34f49a 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-infinite-read.js +++ b/tests/node_compat/test/parallel/test-stream-readable-infinite-read.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-invalid-chunk.js b/tests/node_compat/test/parallel/test-stream-readable-invalid-chunk.js index e9a9042fb1..225587e8c1 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-invalid-chunk.js +++ b/tests/node_compat/test/parallel/test-stream-readable-invalid-chunk.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-needReadable.js b/tests/node_compat/test/parallel/test-stream-readable-needReadable.js index 404eb95cd6..1d82a50520 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-needReadable.js +++ b/tests/node_compat/test/parallel/test-stream-readable-needReadable.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-next-no-null.js b/tests/node_compat/test/parallel/test-stream-readable-next-no-null.js index be2edd9d60..da026d9892 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-next-no-null.js +++ b/tests/node_compat/test/parallel/test-stream-readable-next-no-null.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-no-unneeded-readable.js b/tests/node_compat/test/parallel/test-stream-readable-no-unneeded-readable.js index 863bfff30a..f6f7ef292e 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-no-unneeded-readable.js +++ b/tests/node_compat/test/parallel/test-stream-readable-no-unneeded-readable.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-object-multi-push-async.js b/tests/node_compat/test/parallel/test-stream-readable-object-multi-push-async.js index ce153c8229..ba4d932946 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-object-multi-push-async.js +++ b/tests/node_compat/test/parallel/test-stream-readable-object-multi-push-async.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-pause-and-resume.js b/tests/node_compat/test/parallel/test-stream-readable-pause-and-resume.js index 9be474f4ee..1e6cf4410e 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-pause-and-resume.js +++ b/tests/node_compat/test/parallel/test-stream-readable-pause-and-resume.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-readable-then-resume.js b/tests/node_compat/test/parallel/test-stream-readable-readable-then-resume.js index 9fea6d2f60..3626f31bdd 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-readable-then-resume.js +++ b/tests/node_compat/test/parallel/test-stream-readable-readable-then-resume.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-readable.js b/tests/node_compat/test/parallel/test-stream-readable-readable.js index ffa722ba25..6e05275431 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-readable.js +++ b/tests/node_compat/test/parallel/test-stream-readable-readable.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-reading-readingMore.js b/tests/node_compat/test/parallel/test-stream-readable-reading-readingMore.js index 6d12519bfc..cf8afaf327 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-reading-readingMore.js +++ b/tests/node_compat/test/parallel/test-stream-readable-reading-readingMore.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-resume-hwm.js b/tests/node_compat/test/parallel/test-stream-readable-resume-hwm.js index ed4aca0d99..2073592362 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-resume-hwm.js +++ b/tests/node_compat/test/parallel/test-stream-readable-resume-hwm.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-resumeScheduled.js b/tests/node_compat/test/parallel/test-stream-readable-resumeScheduled.js index 0163becb8b..2615b662c2 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-resumeScheduled.js +++ b/tests/node_compat/test/parallel/test-stream-readable-resumeScheduled.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-setEncoding-existing-buffers.js b/tests/node_compat/test/parallel/test-stream-readable-setEncoding-existing-buffers.js index 79b087dc32..2e936cf8ba 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-setEncoding-existing-buffers.js +++ b/tests/node_compat/test/parallel/test-stream-readable-setEncoding-existing-buffers.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-setEncoding-null.js b/tests/node_compat/test/parallel/test-stream-readable-setEncoding-null.js index f4877aa4be..590714c8cb 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-setEncoding-null.js +++ b/tests/node_compat/test/parallel/test-stream-readable-setEncoding-null.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-unshift.js b/tests/node_compat/test/parallel/test-stream-readable-unshift.js index 6904c1a581..e7678eea4a 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-unshift.js +++ b/tests/node_compat/test/parallel/test-stream-readable-unshift.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readable-with-unimplemented-_read.js b/tests/node_compat/test/parallel/test-stream-readable-with-unimplemented-_read.js index df45129d0d..24ae96af8e 100644 --- a/tests/node_compat/test/parallel/test-stream-readable-with-unimplemented-_read.js +++ b/tests/node_compat/test/parallel/test-stream-readable-with-unimplemented-_read.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-readableListening-state.js b/tests/node_compat/test/parallel/test-stream-readableListening-state.js index f53fdee488..9554387c43 100644 --- a/tests/node_compat/test/parallel/test-stream-readableListening-state.js +++ b/tests/node_compat/test/parallel/test-stream-readableListening-state.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-transform-callback-twice.js b/tests/node_compat/test/parallel/test-stream-transform-callback-twice.js index 57702ef77f..47a48c8322 100644 --- a/tests/node_compat/test/parallel/test-stream-transform-callback-twice.js +++ b/tests/node_compat/test/parallel/test-stream-transform-callback-twice.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-transform-constructor-set-methods.js b/tests/node_compat/test/parallel/test-stream-transform-constructor-set-methods.js index c0e4f27dc6..6c47b24452 100644 --- a/tests/node_compat/test/parallel/test-stream-transform-constructor-set-methods.js +++ b/tests/node_compat/test/parallel/test-stream-transform-constructor-set-methods.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-transform-destroy.js b/tests/node_compat/test/parallel/test-stream-transform-destroy.js index a489da81e8..0d29b98ce2 100644 --- a/tests/node_compat/test/parallel/test-stream-transform-destroy.js +++ b/tests/node_compat/test/parallel/test-stream-transform-destroy.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-transform-final-sync.js b/tests/node_compat/test/parallel/test-stream-transform-final-sync.js index 09294b362d..5ff0e2177c 100644 --- a/tests/node_compat/test/parallel/test-stream-transform-final-sync.js +++ b/tests/node_compat/test/parallel/test-stream-transform-final-sync.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-transform-final.js b/tests/node_compat/test/parallel/test-stream-transform-final.js index 2140363d84..e2f01188fd 100644 --- a/tests/node_compat/test/parallel/test-stream-transform-final.js +++ b/tests/node_compat/test/parallel/test-stream-transform-final.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-transform-flush-data.js b/tests/node_compat/test/parallel/test-stream-transform-flush-data.js index 5eecaf645d..33c7747547 100644 --- a/tests/node_compat/test/parallel/test-stream-transform-flush-data.js +++ b/tests/node_compat/test/parallel/test-stream-transform-flush-data.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-transform-objectmode-falsey-value.js b/tests/node_compat/test/parallel/test-stream-transform-objectmode-falsey-value.js index 5481f70e99..571fa74d18 100644 --- a/tests/node_compat/test/parallel/test-stream-transform-objectmode-falsey-value.js +++ b/tests/node_compat/test/parallel/test-stream-transform-objectmode-falsey-value.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-transform-split-highwatermark.js b/tests/node_compat/test/parallel/test-stream-transform-split-highwatermark.js index dddae4aa29..a4117cc913 100644 --- a/tests/node_compat/test/parallel/test-stream-transform-split-highwatermark.js +++ b/tests/node_compat/test/parallel/test-stream-transform-split-highwatermark.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-transform-split-objectmode.js b/tests/node_compat/test/parallel/test-stream-transform-split-objectmode.js index f3400488a1..66d302371d 100644 --- a/tests/node_compat/test/parallel/test-stream-transform-split-objectmode.js +++ b/tests/node_compat/test/parallel/test-stream-transform-split-objectmode.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-uint8array.js b/tests/node_compat/test/parallel/test-stream-uint8array.js index aa8dbd3d82..8820b4f79c 100644 --- a/tests/node_compat/test/parallel/test-stream-uint8array.js +++ b/tests/node_compat/test/parallel/test-stream-uint8array.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-unpipe-event.js b/tests/node_compat/test/parallel/test-stream-unpipe-event.js index 0f7bcdb69d..31cedc514c 100644 --- a/tests/node_compat/test/parallel/test-stream-unpipe-event.js +++ b/tests/node_compat/test/parallel/test-stream-unpipe-event.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-unshift-empty-chunk.js b/tests/node_compat/test/parallel/test-stream-unshift-empty-chunk.js index 0e8337f4c3..e9d8ab81a6 100644 --- a/tests/node_compat/test/parallel/test-stream-unshift-empty-chunk.js +++ b/tests/node_compat/test/parallel/test-stream-unshift-empty-chunk.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-unshift-read-race.js b/tests/node_compat/test/parallel/test-stream-unshift-read-race.js index 6f400a321a..771e3f98ac 100644 --- a/tests/node_compat/test/parallel/test-stream-unshift-read-race.js +++ b/tests/node_compat/test/parallel/test-stream-unshift-read-race.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-writable-aborted.js b/tests/node_compat/test/parallel/test-stream-writable-aborted.js index 89dbcc4ee2..55daa9f213 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-aborted.js +++ b/tests/node_compat/test/parallel/test-stream-writable-aborted.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-change-default-encoding.js b/tests/node_compat/test/parallel/test-stream-writable-change-default-encoding.js index 355cb4d6d9..555e1924dc 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-change-default-encoding.js +++ b/tests/node_compat/test/parallel/test-stream-writable-change-default-encoding.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-writable-clear-buffer.js b/tests/node_compat/test/parallel/test-stream-writable-clear-buffer.js index 58e0ae5dff..3d80c87234 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-clear-buffer.js +++ b/tests/node_compat/test/parallel/test-stream-writable-clear-buffer.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-constructor-set-methods.js b/tests/node_compat/test/parallel/test-stream-writable-constructor-set-methods.js index ca9e1a1d29..c1dda3adc5 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-constructor-set-methods.js +++ b/tests/node_compat/test/parallel/test-stream-writable-constructor-set-methods.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-decoded-encoding.js b/tests/node_compat/test/parallel/test-stream-writable-decoded-encoding.js index d6c77c9a70..d488408262 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-decoded-encoding.js +++ b/tests/node_compat/test/parallel/test-stream-writable-decoded-encoding.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream-writable-destroy.js b/tests/node_compat/test/parallel/test-stream-writable-destroy.js index ac47bb5bc7..6684a581ac 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-destroy.js +++ b/tests/node_compat/test/parallel/test-stream-writable-destroy.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-end-cb-error.js b/tests/node_compat/test/parallel/test-stream-writable-end-cb-error.js index ecb597f159..3d15d8700d 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-end-cb-error.js +++ b/tests/node_compat/test/parallel/test-stream-writable-end-cb-error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-end-multiple.js b/tests/node_compat/test/parallel/test-stream-writable-end-multiple.js index edce899e3a..999f1402da 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-end-multiple.js +++ b/tests/node_compat/test/parallel/test-stream-writable-end-multiple.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-ended-state.js b/tests/node_compat/test/parallel/test-stream-writable-ended-state.js index 57c578037c..369fb9b16d 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-ended-state.js +++ b/tests/node_compat/test/parallel/test-stream-writable-ended-state.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-final-async.js b/tests/node_compat/test/parallel/test-stream-writable-final-async.js index c8fe2057b5..139471f980 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-final-async.js +++ b/tests/node_compat/test/parallel/test-stream-writable-final-async.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-final-destroy.js b/tests/node_compat/test/parallel/test-stream-writable-final-destroy.js index 958a36bfdf..30868200f1 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-final-destroy.js +++ b/tests/node_compat/test/parallel/test-stream-writable-final-destroy.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-final-throw.js b/tests/node_compat/test/parallel/test-stream-writable-final-throw.js index ba7f87b238..f0ec090b77 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-final-throw.js +++ b/tests/node_compat/test/parallel/test-stream-writable-final-throw.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-finish-destroyed.js b/tests/node_compat/test/parallel/test-stream-writable-finish-destroyed.js index 1f5617a34f..8ce5d29a9c 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-finish-destroyed.js +++ b/tests/node_compat/test/parallel/test-stream-writable-finish-destroyed.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-finished-state.js b/tests/node_compat/test/parallel/test-stream-writable-finished-state.js index 23f84187b9..b46b760e8b 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-finished-state.js +++ b/tests/node_compat/test/parallel/test-stream-writable-finished-state.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-finished.js b/tests/node_compat/test/parallel/test-stream-writable-finished.js index 61c363b7e6..07b54233b8 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-finished.js +++ b/tests/node_compat/test/parallel/test-stream-writable-finished.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-invalid-chunk.js b/tests/node_compat/test/parallel/test-stream-writable-invalid-chunk.js index 68760d2c76..b9e90c3378 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-invalid-chunk.js +++ b/tests/node_compat/test/parallel/test-stream-writable-invalid-chunk.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-needdrain-state.js b/tests/node_compat/test/parallel/test-stream-writable-needdrain-state.js index 31c3ba79e7..b456de2953 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-needdrain-state.js +++ b/tests/node_compat/test/parallel/test-stream-writable-needdrain-state.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-null.js b/tests/node_compat/test/parallel/test-stream-writable-null.js index 467efc005c..57f2188c1e 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-null.js +++ b/tests/node_compat/test/parallel/test-stream-writable-null.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-properties.js b/tests/node_compat/test/parallel/test-stream-writable-properties.js index 28a7c2f71d..b7283383a1 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-properties.js +++ b/tests/node_compat/test/parallel/test-stream-writable-properties.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-writable.js b/tests/node_compat/test/parallel/test-stream-writable-writable.js index 0729e6a381..274e6872a0 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-writable.js +++ b/tests/node_compat/test/parallel/test-stream-writable-writable.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-write-cb-error.js b/tests/node_compat/test/parallel/test-stream-writable-write-cb-error.js index cb68a6ee33..c4efbd2ddb 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-write-cb-error.js +++ b/tests/node_compat/test/parallel/test-stream-writable-write-cb-error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-write-cb-twice.js b/tests/node_compat/test/parallel/test-stream-writable-write-cb-twice.js index 696532c2ff..f862ecf0ea 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-write-cb-twice.js +++ b/tests/node_compat/test/parallel/test-stream-writable-write-cb-twice.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-write-error.js b/tests/node_compat/test/parallel/test-stream-writable-write-error.js index a98d9ff8af..2013a68fab 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-write-error.js +++ b/tests/node_compat/test/parallel/test-stream-writable-write-error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writable-write-writev-finish.js b/tests/node_compat/test/parallel/test-stream-writable-write-writev-finish.js index 3370040e5e..d32dfae6ed 100644 --- a/tests/node_compat/test/parallel/test-stream-writable-write-writev-finish.js +++ b/tests/node_compat/test/parallel/test-stream-writable-write-writev-finish.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writableState-ending.js b/tests/node_compat/test/parallel/test-stream-writableState-ending.js index 6533f0b831..ebb1146ce2 100644 --- a/tests/node_compat/test/parallel/test-stream-writableState-ending.js +++ b/tests/node_compat/test/parallel/test-stream-writableState-ending.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writableState-uncorked-bufferedRequestCount.js b/tests/node_compat/test/parallel/test-stream-writableState-uncorked-bufferedRequestCount.js index fe505ccf78..f0a246ac13 100644 --- a/tests/node_compat/test/parallel/test-stream-writableState-uncorked-bufferedRequestCount.js +++ b/tests/node_compat/test/parallel/test-stream-writableState-uncorked-bufferedRequestCount.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-write-destroy.js b/tests/node_compat/test/parallel/test-stream-write-destroy.js index 6cd1fb49d5..ee03edb483 100644 --- a/tests/node_compat/test/parallel/test-stream-write-destroy.js +++ b/tests/node_compat/test/parallel/test-stream-write-destroy.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-write-drain.js b/tests/node_compat/test/parallel/test-stream-write-drain.js index ae1494fa17..c23f33e188 100644 --- a/tests/node_compat/test/parallel/test-stream-write-drain.js +++ b/tests/node_compat/test/parallel/test-stream-write-drain.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-write-final.js b/tests/node_compat/test/parallel/test-stream-write-final.js index b5b1b7a222..2466da0f99 100644 --- a/tests/node_compat/test/parallel/test-stream-write-final.js +++ b/tests/node_compat/test/parallel/test-stream-write-final.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream-writev.js b/tests/node_compat/test/parallel/test-stream-writev.js index f012515c8c..db6031897b 100644 --- a/tests/node_compat/test/parallel/test-stream-writev.js +++ b/tests/node_compat/test/parallel/test-stream-writev.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-base64-single-char-read-end.js b/tests/node_compat/test/parallel/test-stream2-base64-single-char-read-end.js index 8c9f17600a..d59d56ec2a 100644 --- a/tests/node_compat/test/parallel/test-stream2-base64-single-char-read-end.js +++ b/tests/node_compat/test/parallel/test-stream2-base64-single-char-read-end.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-basic.js b/tests/node_compat/test/parallel/test-stream2-basic.js index 04eecd18eb..07942ca300 100644 --- a/tests/node_compat/test/parallel/test-stream2-basic.js +++ b/tests/node_compat/test/parallel/test-stream2-basic.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-compatibility.js b/tests/node_compat/test/parallel/test-stream2-compatibility.js index 3f5293a808..4b3eb67e79 100644 --- a/tests/node_compat/test/parallel/test-stream2-compatibility.js +++ b/tests/node_compat/test/parallel/test-stream2-compatibility.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-decode-partial.js b/tests/node_compat/test/parallel/test-stream2-decode-partial.js index 8566e8cce6..9143ea73c3 100644 --- a/tests/node_compat/test/parallel/test-stream2-decode-partial.js +++ b/tests/node_compat/test/parallel/test-stream2-decode-partial.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream2-finish-pipe.js b/tests/node_compat/test/parallel/test-stream2-finish-pipe.js index 2cd70c62e1..22f17a4355 100644 --- a/tests/node_compat/test/parallel/test-stream2-finish-pipe.js +++ b/tests/node_compat/test/parallel/test-stream2-finish-pipe.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-large-read-stall.js b/tests/node_compat/test/parallel/test-stream2-large-read-stall.js index 37f2f68ec7..aeefcf21a2 100644 --- a/tests/node_compat/test/parallel/test-stream2-large-read-stall.js +++ b/tests/node_compat/test/parallel/test-stream2-large-read-stall.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-objects.js b/tests/node_compat/test/parallel/test-stream2-objects.js index f6bc8b8295..68340e0e54 100644 --- a/tests/node_compat/test/parallel/test-stream2-objects.js +++ b/tests/node_compat/test/parallel/test-stream2-objects.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-pipe-error-handling.js b/tests/node_compat/test/parallel/test-stream2-pipe-error-handling.js index 18e9864c0b..1591f6f4e9 100644 --- a/tests/node_compat/test/parallel/test-stream2-pipe-error-handling.js +++ b/tests/node_compat/test/parallel/test-stream2-pipe-error-handling.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-pipe-error-once-listener.js b/tests/node_compat/test/parallel/test-stream2-pipe-error-once-listener.js index 62fafc5b97..b9d67cd75e 100644 --- a/tests/node_compat/test/parallel/test-stream2-pipe-error-once-listener.js +++ b/tests/node_compat/test/parallel/test-stream2-pipe-error-once-listener.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-push.js b/tests/node_compat/test/parallel/test-stream2-push.js index 4d49d62776..4cb54a01fd 100644 --- a/tests/node_compat/test/parallel/test-stream2-push.js +++ b/tests/node_compat/test/parallel/test-stream2-push.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-read-sync-stack.js b/tests/node_compat/test/parallel/test-stream2-read-sync-stack.js index a5d6eb82ca..0aa654c70d 100644 --- a/tests/node_compat/test/parallel/test-stream2-read-sync-stack.js +++ b/tests/node_compat/test/parallel/test-stream2-read-sync-stack.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-readable-empty-buffer-no-eof.js b/tests/node_compat/test/parallel/test-stream2-readable-empty-buffer-no-eof.js index 772f525555..806f958d8e 100644 --- a/tests/node_compat/test/parallel/test-stream2-readable-empty-buffer-no-eof.js +++ b/tests/node_compat/test/parallel/test-stream2-readable-empty-buffer-no-eof.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-readable-legacy-drain.js b/tests/node_compat/test/parallel/test-stream2-readable-legacy-drain.js index 43a1b6616e..8c3de53988 100644 --- a/tests/node_compat/test/parallel/test-stream2-readable-legacy-drain.js +++ b/tests/node_compat/test/parallel/test-stream2-readable-legacy-drain.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-readable-non-empty-end.js b/tests/node_compat/test/parallel/test-stream2-readable-non-empty-end.js index 0446be665c..be14a8983a 100644 --- a/tests/node_compat/test/parallel/test-stream2-readable-non-empty-end.js +++ b/tests/node_compat/test/parallel/test-stream2-readable-non-empty-end.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-readable-wrap-destroy.js b/tests/node_compat/test/parallel/test-stream2-readable-wrap-destroy.js index 08973898d6..6c24765e0d 100644 --- a/tests/node_compat/test/parallel/test-stream2-readable-wrap-destroy.js +++ b/tests/node_compat/test/parallel/test-stream2-readable-wrap-destroy.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream2-readable-wrap-empty.js b/tests/node_compat/test/parallel/test-stream2-readable-wrap-empty.js index 6bf52923c0..eeb2d79ac4 100644 --- a/tests/node_compat/test/parallel/test-stream2-readable-wrap-empty.js +++ b/tests/node_compat/test/parallel/test-stream2-readable-wrap-empty.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-readable-wrap-error.js b/tests/node_compat/test/parallel/test-stream2-readable-wrap-error.js index ad11369f08..56d80b54a6 100644 --- a/tests/node_compat/test/parallel/test-stream2-readable-wrap-error.js +++ b/tests/node_compat/test/parallel/test-stream2-readable-wrap-error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream2-readable-wrap.js b/tests/node_compat/test/parallel/test-stream2-readable-wrap.js index 65851afb6c..07e4569eb5 100644 --- a/tests/node_compat/test/parallel/test-stream2-readable-wrap.js +++ b/tests/node_compat/test/parallel/test-stream2-readable-wrap.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-set-encoding.js b/tests/node_compat/test/parallel/test-stream2-set-encoding.js index 9f07d52e6d..3304f0ec47 100644 --- a/tests/node_compat/test/parallel/test-stream2-set-encoding.js +++ b/tests/node_compat/test/parallel/test-stream2-set-encoding.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-transform.js b/tests/node_compat/test/parallel/test-stream2-transform.js index 4547f9c8f2..ebca5d33f3 100644 --- a/tests/node_compat/test/parallel/test-stream2-transform.js +++ b/tests/node_compat/test/parallel/test-stream2-transform.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-unpipe-drain.js b/tests/node_compat/test/parallel/test-stream2-unpipe-drain.js index be3023efb3..2e7eb2713f 100644 --- a/tests/node_compat/test/parallel/test-stream2-unpipe-drain.js +++ b/tests/node_compat/test/parallel/test-stream2-unpipe-drain.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-unpipe-leak.js b/tests/node_compat/test/parallel/test-stream2-unpipe-leak.js index a6742f999d..d9b42ad9a8 100644 --- a/tests/node_compat/test/parallel/test-stream2-unpipe-leak.js +++ b/tests/node_compat/test/parallel/test-stream2-unpipe-leak.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream2-writable.js b/tests/node_compat/test/parallel/test-stream2-writable.js index 4f5ba53fce..0145257a33 100644 --- a/tests/node_compat/test/parallel/test-stream2-writable.js +++ b/tests/node_compat/test/parallel/test-stream2-writable.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-stream3-cork-end.js b/tests/node_compat/test/parallel/test-stream3-cork-end.js index 0ae661953a..5453a56169 100644 --- a/tests/node_compat/test/parallel/test-stream3-cork-end.js +++ b/tests/node_compat/test/parallel/test-stream3-cork-end.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream3-cork-uncork.js b/tests/node_compat/test/parallel/test-stream3-cork-uncork.js index fbb50d6aa2..4b0ae80535 100644 --- a/tests/node_compat/test/parallel/test-stream3-cork-uncork.js +++ b/tests/node_compat/test/parallel/test-stream3-cork-uncork.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-stream3-pause-then-read.js b/tests/node_compat/test/parallel/test-stream3-pause-then-read.js index 0c22e81f8e..2a3bdf4bf0 100644 --- a/tests/node_compat/test/parallel/test-stream3-pause-then-read.js +++ b/tests/node_compat/test/parallel/test-stream3-pause-then-read.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-streams-highwatermark.js b/tests/node_compat/test/parallel/test-streams-highwatermark.js index 3498e4296b..451311c2c5 100644 --- a/tests/node_compat/test/parallel/test-streams-highwatermark.js +++ b/tests/node_compat/test/parallel/test-streams-highwatermark.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-string-decoder.js b/tests/node_compat/test/parallel/test-string-decoder.js index 779e5fc1e1..ee7b40d855 100644 --- a/tests/node_compat/test/parallel/test-string-decoder.js +++ b/tests/node_compat/test/parallel/test-string-decoder.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-timers-api-refs.js b/tests/node_compat/test/parallel/test-timers-api-refs.js index ac5bad9bdf..ccbe58eafa 100644 --- a/tests/node_compat/test/parallel/test-timers-api-refs.js +++ b/tests/node_compat/test/parallel/test-timers-api-refs.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-timers-args.js b/tests/node_compat/test/parallel/test-timers-args.js index a7f25609bb..c987830e22 100644 --- a/tests/node_compat/test/parallel/test-timers-args.js +++ b/tests/node_compat/test/parallel/test-timers-args.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-timers-clear-null-does-not-throw-error.js b/tests/node_compat/test/parallel/test-timers-clear-null-does-not-throw-error.js index 01ef84df38..102f04a1e6 100644 --- a/tests/node_compat/test/parallel/test-timers-clear-null-does-not-throw-error.js +++ b/tests/node_compat/test/parallel/test-timers-clear-null-does-not-throw-error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-timers-clear-object-does-not-throw-error.js b/tests/node_compat/test/parallel/test-timers-clear-object-does-not-throw-error.js index 73cd918f16..89a3cc696e 100644 --- a/tests/node_compat/test/parallel/test-timers-clear-object-does-not-throw-error.js +++ b/tests/node_compat/test/parallel/test-timers-clear-object-does-not-throw-error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-timers-clear-timeout-interval-equivalent.js b/tests/node_compat/test/parallel/test-timers-clear-timeout-interval-equivalent.js index c4d1e3fd83..4de5b8a218 100644 --- a/tests/node_compat/test/parallel/test-timers-clear-timeout-interval-equivalent.js +++ b/tests/node_compat/test/parallel/test-timers-clear-timeout-interval-equivalent.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-timers-clearImmediate.js b/tests/node_compat/test/parallel/test-timers-clearImmediate.js index 8460d73c9d..60dfeba4b9 100644 --- a/tests/node_compat/test/parallel/test-timers-clearImmediate.js +++ b/tests/node_compat/test/parallel/test-timers-clearImmediate.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-timers-interval-throw.js b/tests/node_compat/test/parallel/test-timers-interval-throw.js index 5ad1156773..1411e10155 100644 --- a/tests/node_compat/test/parallel/test-timers-interval-throw.js +++ b/tests/node_compat/test/parallel/test-timers-interval-throw.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-timers-non-integer-delay.js b/tests/node_compat/test/parallel/test-timers-non-integer-delay.js index b9371d81b8..8cc292a98d 100644 --- a/tests/node_compat/test/parallel/test-timers-non-integer-delay.js +++ b/tests/node_compat/test/parallel/test-timers-non-integer-delay.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-timers-refresh.js b/tests/node_compat/test/parallel/test-timers-refresh.js index 80e78b56a5..8a5d95a4e6 100644 --- a/tests/node_compat/test/parallel/test-timers-refresh.js +++ b/tests/node_compat/test/parallel/test-timers-refresh.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --expose-internals diff --git a/tests/node_compat/test/parallel/test-timers-same-timeout-wrong-list-deleted.js b/tests/node_compat/test/parallel/test-timers-same-timeout-wrong-list-deleted.js index c8b0021e3c..358f4a38f8 100644 --- a/tests/node_compat/test/parallel/test-timers-same-timeout-wrong-list-deleted.js +++ b/tests/node_compat/test/parallel/test-timers-same-timeout-wrong-list-deleted.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-timers-timeout-with-non-integer.js b/tests/node_compat/test/parallel/test-timers-timeout-with-non-integer.js index 585b750b3a..3bce7f9d21 100644 --- a/tests/node_compat/test/parallel/test-timers-timeout-with-non-integer.js +++ b/tests/node_compat/test/parallel/test-timers-timeout-with-non-integer.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-timers-uncaught-exception.js b/tests/node_compat/test/parallel/test-timers-uncaught-exception.js index 954d776d07..9b3567ab71 100644 --- a/tests/node_compat/test/parallel/test-timers-uncaught-exception.js +++ b/tests/node_compat/test/parallel/test-timers-uncaught-exception.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-timers-unref-throw-then-ref.js b/tests/node_compat/test/parallel/test-timers-unref-throw-then-ref.js index 4b593a9d43..2c98a13eb1 100644 --- a/tests/node_compat/test/parallel/test-timers-unref-throw-then-ref.js +++ b/tests/node_compat/test/parallel/test-timers-unref-throw-then-ref.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-timers-user-call.js b/tests/node_compat/test/parallel/test-timers-user-call.js index 673a0c6f2c..f8d70d7e36 100644 --- a/tests/node_compat/test/parallel/test-timers-user-call.js +++ b/tests/node_compat/test/parallel/test-timers-user-call.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Make sure `setTimeout()` and friends don't throw if the user-supplied diff --git a/tests/node_compat/test/parallel/test-timers-zero-timeout.js b/tests/node_compat/test/parallel/test-timers-zero-timeout.js index aeaf476ec4..9eadfb78bd 100644 --- a/tests/node_compat/test/parallel/test-timers-zero-timeout.js +++ b/tests/node_compat/test/parallel/test-timers-zero-timeout.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-tty-stdin-end.js b/tests/node_compat/test/parallel/test-tty-stdin-end.js index 05054d052f..6ac9b8cb98 100644 --- a/tests/node_compat/test/parallel/test-tty-stdin-end.js +++ b/tests/node_compat/test/parallel/test-tty-stdin-end.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-url-domain-ascii-unicode.js b/tests/node_compat/test/parallel/test-url-domain-ascii-unicode.js index 39f3a0b436..5bb1761683 100644 --- a/tests/node_compat/test/parallel/test-url-domain-ascii-unicode.js +++ b/tests/node_compat/test/parallel/test-url-domain-ascii-unicode.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-url-fileurltopath.js b/tests/node_compat/test/parallel/test-url-fileurltopath.js index ddebca6921..a590fb349b 100644 --- a/tests/node_compat/test/parallel/test-url-fileurltopath.js +++ b/tests/node_compat/test/parallel/test-url-fileurltopath.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-url-format-invalid-input.js b/tests/node_compat/test/parallel/test-url-format-invalid-input.js index 4ea48d0a81..2a4db69c7d 100644 --- a/tests/node_compat/test/parallel/test-url-format-invalid-input.js +++ b/tests/node_compat/test/parallel/test-url-format-invalid-input.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-url-format-whatwg.js b/tests/node_compat/test/parallel/test-url-format-whatwg.js index ff8f1201cf..77101ed96b 100644 --- a/tests/node_compat/test/parallel/test-url-format-whatwg.js +++ b/tests/node_compat/test/parallel/test-url-format-whatwg.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-url-format.js b/tests/node_compat/test/parallel/test-url-format.js index 3162213b8a..fb495328db 100644 --- a/tests/node_compat/test/parallel/test-url-format.js +++ b/tests/node_compat/test/parallel/test-url-format.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-url-parse-query.js b/tests/node_compat/test/parallel/test-url-parse-query.js index 6f6c425bb6..da37e9c4e2 100644 --- a/tests/node_compat/test/parallel/test-url-parse-query.js +++ b/tests/node_compat/test/parallel/test-url-parse-query.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-url-pathtofileurl.js b/tests/node_compat/test/parallel/test-url-pathtofileurl.js index d0f2f4b97e..e862c0c9df 100644 --- a/tests/node_compat/test/parallel/test-url-pathtofileurl.js +++ b/tests/node_compat/test/parallel/test-url-pathtofileurl.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-url-relative.js b/tests/node_compat/test/parallel/test-url-relative.js index 3b8524c2d0..1522809544 100644 --- a/tests/node_compat/test/parallel/test-url-relative.js +++ b/tests/node_compat/test/parallel/test-url-relative.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-util-deprecate-invalid-code.js b/tests/node_compat/test/parallel/test-util-deprecate-invalid-code.js index 96d9425c53..9bf5d197e9 100644 --- a/tests/node_compat/test/parallel/test-util-deprecate-invalid-code.js +++ b/tests/node_compat/test/parallel/test-util-deprecate-invalid-code.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-util-deprecate.js b/tests/node_compat/test/parallel/test-util-deprecate.js index 0a0edd86e4..e69fc3364c 100644 --- a/tests/node_compat/test/parallel/test-util-deprecate.js +++ b/tests/node_compat/test/parallel/test-util-deprecate.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-util-inherits.js b/tests/node_compat/test/parallel/test-util-inherits.js index 3e948619bb..7a2a96982d 100644 --- a/tests/node_compat/test/parallel/test-util-inherits.js +++ b/tests/node_compat/test/parallel/test-util-inherits.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-util-inspect-long-running.js b/tests/node_compat/test/parallel/test-util-inspect-long-running.js index 2ddc5dc7ab..645aaada73 100644 --- a/tests/node_compat/test/parallel/test-util-inspect-long-running.js +++ b/tests/node_compat/test/parallel/test-util-inspect-long-running.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-util-types-exists.js b/tests/node_compat/test/parallel/test-util-types-exists.js index 77e7e7b37e..a58baf725e 100644 --- a/tests/node_compat/test/parallel/test-util-types-exists.js +++ b/tests/node_compat/test/parallel/test-util-types-exists.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-access-process-env.js b/tests/node_compat/test/parallel/test-vm-access-process-env.js index 95f555dac3..d2589b3aa5 100644 --- a/tests/node_compat/test/parallel/test-vm-access-process-env.js +++ b/tests/node_compat/test/parallel/test-vm-access-process-env.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-vm-attributes-property-not-on-sandbox.js b/tests/node_compat/test/parallel/test-vm-attributes-property-not-on-sandbox.js index 940fd4e7fe..ef2d21eb42 100644 --- a/tests/node_compat/test/parallel/test-vm-attributes-property-not-on-sandbox.js +++ b/tests/node_compat/test/parallel/test-vm-attributes-property-not-on-sandbox.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-codegen.js b/tests/node_compat/test/parallel/test-vm-codegen.js index fff9c287f4..7d6fec813d 100644 --- a/tests/node_compat/test/parallel/test-vm-codegen.js +++ b/tests/node_compat/test/parallel/test-vm-codegen.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-context-async-script.js b/tests/node_compat/test/parallel/test-vm-context-async-script.js index 271567ccf1..9ba46ed890 100644 --- a/tests/node_compat/test/parallel/test-vm-context-async-script.js +++ b/tests/node_compat/test/parallel/test-vm-context-async-script.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-vm-context-property-forwarding.js b/tests/node_compat/test/parallel/test-vm-context-property-forwarding.js index f507377718..1ac2b029eb 100644 --- a/tests/node_compat/test/parallel/test-vm-context-property-forwarding.js +++ b/tests/node_compat/test/parallel/test-vm-context-property-forwarding.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-vm-create-and-run-in-context.js b/tests/node_compat/test/parallel/test-vm-create-and-run-in-context.js index 0674c0b7b8..21fdc0c676 100644 --- a/tests/node_compat/test/parallel/test-vm-create-and-run-in-context.js +++ b/tests/node_compat/test/parallel/test-vm-create-and-run-in-context.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-vm-create-context-accessors.js b/tests/node_compat/test/parallel/test-vm-create-context-accessors.js index 4b683d687b..bd79ec12db 100644 --- a/tests/node_compat/test/parallel/test-vm-create-context-accessors.js +++ b/tests/node_compat/test/parallel/test-vm-create-context-accessors.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-vm-create-context-arg.js b/tests/node_compat/test/parallel/test-vm-create-context-arg.js index 6eb0f7cf91..513584a195 100644 --- a/tests/node_compat/test/parallel/test-vm-create-context-arg.js +++ b/tests/node_compat/test/parallel/test-vm-create-context-arg.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-vm-create-context-circular-reference.js b/tests/node_compat/test/parallel/test-vm-create-context-circular-reference.js index 95056a3d96..501c728a77 100644 --- a/tests/node_compat/test/parallel/test-vm-create-context-circular-reference.js +++ b/tests/node_compat/test/parallel/test-vm-create-context-circular-reference.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-vm-createcacheddata.js b/tests/node_compat/test/parallel/test-vm-createcacheddata.js index 0e786364d3..77f5385977 100644 --- a/tests/node_compat/test/parallel/test-vm-createcacheddata.js +++ b/tests/node_compat/test/parallel/test-vm-createcacheddata.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-cross-context.js b/tests/node_compat/test/parallel/test-vm-cross-context.js index 3a1f1678ec..3107be6a61 100644 --- a/tests/node_compat/test/parallel/test-vm-cross-context.js +++ b/tests/node_compat/test/parallel/test-vm-cross-context.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-vm-data-property-writable.js b/tests/node_compat/test/parallel/test-vm-data-property-writable.js index 1ce7648018..f18f1f6596 100644 --- a/tests/node_compat/test/parallel/test-vm-data-property-writable.js +++ b/tests/node_compat/test/parallel/test-vm-data-property-writable.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-deleting-property.js b/tests/node_compat/test/parallel/test-vm-deleting-property.js index df5ac859a7..b01a7b05e1 100644 --- a/tests/node_compat/test/parallel/test-vm-deleting-property.js +++ b/tests/node_compat/test/parallel/test-vm-deleting-property.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-function-declaration.js b/tests/node_compat/test/parallel/test-vm-function-declaration.js index 209720c757..0bbe7589c5 100644 --- a/tests/node_compat/test/parallel/test-vm-function-declaration.js +++ b/tests/node_compat/test/parallel/test-vm-function-declaration.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-vm-function-redefinition.js b/tests/node_compat/test/parallel/test-vm-function-redefinition.js index 7bc62ac0ed..44ba8da11e 100644 --- a/tests/node_compat/test/parallel/test-vm-function-redefinition.js +++ b/tests/node_compat/test/parallel/test-vm-function-redefinition.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-getters.js b/tests/node_compat/test/parallel/test-vm-getters.js index b9c28014ad..8a88abc9ae 100644 --- a/tests/node_compat/test/parallel/test-vm-getters.js +++ b/tests/node_compat/test/parallel/test-vm-getters.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-global-assignment.js b/tests/node_compat/test/parallel/test-vm-global-assignment.js index c8fc516d65..1160dca1d7 100644 --- a/tests/node_compat/test/parallel/test-vm-global-assignment.js +++ b/tests/node_compat/test/parallel/test-vm-global-assignment.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-global-define-property.js b/tests/node_compat/test/parallel/test-vm-global-define-property.js index 28f5070c27..76ad6742e5 100644 --- a/tests/node_compat/test/parallel/test-vm-global-define-property.js +++ b/tests/node_compat/test/parallel/test-vm-global-define-property.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-vm-global-identity.js b/tests/node_compat/test/parallel/test-vm-global-identity.js index 5413ca94a2..68780ca544 100644 --- a/tests/node_compat/test/parallel/test-vm-global-identity.js +++ b/tests/node_compat/test/parallel/test-vm-global-identity.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-vm-global-setter.js b/tests/node_compat/test/parallel/test-vm-global-setter.js index 8f1f862f36..4908ce82ca 100644 --- a/tests/node_compat/test/parallel/test-vm-global-setter.js +++ b/tests/node_compat/test/parallel/test-vm-global-setter.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-harmony-symbols.js b/tests/node_compat/test/parallel/test-vm-harmony-symbols.js index d4713a2e24..c597b1b49c 100644 --- a/tests/node_compat/test/parallel/test-vm-harmony-symbols.js +++ b/tests/node_compat/test/parallel/test-vm-harmony-symbols.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-vm-indexed-properties.js b/tests/node_compat/test/parallel/test-vm-indexed-properties.js index 332905ff74..dda0aa9032 100644 --- a/tests/node_compat/test/parallel/test-vm-indexed-properties.js +++ b/tests/node_compat/test/parallel/test-vm-indexed-properties.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-inherited_properties.js b/tests/node_compat/test/parallel/test-vm-inherited_properties.js index 4994a8ceab..a2366bfef6 100644 --- a/tests/node_compat/test/parallel/test-vm-inherited_properties.js +++ b/tests/node_compat/test/parallel/test-vm-inherited_properties.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-is-context.js b/tests/node_compat/test/parallel/test-vm-is-context.js index fdbaa36d66..95217bc597 100644 --- a/tests/node_compat/test/parallel/test-vm-is-context.js +++ b/tests/node_compat/test/parallel/test-vm-is-context.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-vm-low-stack-space.js b/tests/node_compat/test/parallel/test-vm-low-stack-space.js index d101377246..860bececc4 100644 --- a/tests/node_compat/test/parallel/test-vm-low-stack-space.js +++ b/tests/node_compat/test/parallel/test-vm-low-stack-space.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-new-script-new-context.js b/tests/node_compat/test/parallel/test-vm-new-script-new-context.js index aada162629..b46f99b8f1 100644 --- a/tests/node_compat/test/parallel/test-vm-new-script-new-context.js +++ b/tests/node_compat/test/parallel/test-vm-new-script-new-context.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-vm-new-script-this-context.js b/tests/node_compat/test/parallel/test-vm-new-script-this-context.js index 8774711f4b..6f8247233f 100644 --- a/tests/node_compat/test/parallel/test-vm-new-script-this-context.js +++ b/tests/node_compat/test/parallel/test-vm-new-script-this-context.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-vm-not-strict.js b/tests/node_compat/test/parallel/test-vm-not-strict.js index c5dee3a2c6..725e00a9a6 100644 --- a/tests/node_compat/test/parallel/test-vm-not-strict.js +++ b/tests/node_compat/test/parallel/test-vm-not-strict.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. /* eslint-disable strict, no-var, no-delete-var, no-undef, node-core/required-modules, node-core/require-common-first */ diff --git a/tests/node_compat/test/parallel/test-vm-options-validation.js b/tests/node_compat/test/parallel/test-vm-options-validation.js index d1b215ed70..430414379e 100644 --- a/tests/node_compat/test/parallel/test-vm-options-validation.js +++ b/tests/node_compat/test/parallel/test-vm-options-validation.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-parse-abort-on-uncaught-exception.js b/tests/node_compat/test/parallel/test-vm-parse-abort-on-uncaught-exception.js index e8cae690af..16a5550889 100644 --- a/tests/node_compat/test/parallel/test-vm-parse-abort-on-uncaught-exception.js +++ b/tests/node_compat/test/parallel/test-vm-parse-abort-on-uncaught-exception.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Flags: --abort-on-uncaught-exception diff --git a/tests/node_compat/test/parallel/test-vm-preserves-property.js b/tests/node_compat/test/parallel/test-vm-preserves-property.js index 28f662a1a2..f415aa37d4 100644 --- a/tests/node_compat/test/parallel/test-vm-preserves-property.js +++ b/tests/node_compat/test/parallel/test-vm-preserves-property.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-property-not-on-sandbox.js b/tests/node_compat/test/parallel/test-vm-property-not-on-sandbox.js index 360a5dabf8..8fe3a25843 100644 --- a/tests/node_compat/test/parallel/test-vm-property-not-on-sandbox.js +++ b/tests/node_compat/test/parallel/test-vm-property-not-on-sandbox.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-proxies.js b/tests/node_compat/test/parallel/test-vm-proxies.js index c485e0a62a..a7e8640051 100644 --- a/tests/node_compat/test/parallel/test-vm-proxies.js +++ b/tests/node_compat/test/parallel/test-vm-proxies.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-proxy-failure-CP.js b/tests/node_compat/test/parallel/test-vm-proxy-failure-CP.js index 2f503bd312..850696f7a4 100644 --- a/tests/node_compat/test/parallel/test-vm-proxy-failure-CP.js +++ b/tests/node_compat/test/parallel/test-vm-proxy-failure-CP.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-script-throw-in-tostring.js b/tests/node_compat/test/parallel/test-vm-script-throw-in-tostring.js index c135730864..e64777c292 100644 --- a/tests/node_compat/test/parallel/test-vm-script-throw-in-tostring.js +++ b/tests/node_compat/test/parallel/test-vm-script-throw-in-tostring.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-set-property-proxy.js b/tests/node_compat/test/parallel/test-vm-set-property-proxy.js index 61f80902c9..b1b0909a41 100644 --- a/tests/node_compat/test/parallel/test-vm-set-property-proxy.js +++ b/tests/node_compat/test/parallel/test-vm-set-property-proxy.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-set-proto-null-on-globalthis.js b/tests/node_compat/test/parallel/test-vm-set-proto-null-on-globalthis.js index 7798646680..9b32067890 100644 --- a/tests/node_compat/test/parallel/test-vm-set-proto-null-on-globalthis.js +++ b/tests/node_compat/test/parallel/test-vm-set-proto-null-on-globalthis.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-source-map-url.js b/tests/node_compat/test/parallel/test-vm-source-map-url.js index fb91ff1fc5..f8aafaf3e9 100644 --- a/tests/node_compat/test/parallel/test-vm-source-map-url.js +++ b/tests/node_compat/test/parallel/test-vm-source-map-url.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-static-this.js b/tests/node_compat/test/parallel/test-vm-static-this.js index 58388ba94e..e99c6438cb 100644 --- a/tests/node_compat/test/parallel/test-vm-static-this.js +++ b/tests/node_compat/test/parallel/test-vm-static-this.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-vm-strict-mode.js b/tests/node_compat/test/parallel/test-vm-strict-mode.js index e759bd2c47..9d018216a6 100644 --- a/tests/node_compat/test/parallel/test-vm-strict-mode.js +++ b/tests/node_compat/test/parallel/test-vm-strict-mode.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-symbols.js b/tests/node_compat/test/parallel/test-vm-symbols.js index fbaff6a829..a4317f24a9 100644 --- a/tests/node_compat/test/parallel/test-vm-symbols.js +++ b/tests/node_compat/test/parallel/test-vm-symbols.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-timeout-escape-promise-2.js b/tests/node_compat/test/parallel/test-vm-timeout-escape-promise-2.js index 19ba0a6821..176284eee3 100644 --- a/tests/node_compat/test/parallel/test-vm-timeout-escape-promise-2.js +++ b/tests/node_compat/test/parallel/test-vm-timeout-escape-promise-2.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-timeout-escape-promise.js b/tests/node_compat/test/parallel/test-vm-timeout-escape-promise.js index c2393a852a..0bf90936d9 100644 --- a/tests/node_compat/test/parallel/test-vm-timeout-escape-promise.js +++ b/tests/node_compat/test/parallel/test-vm-timeout-escape-promise.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-vm-timeout.js b/tests/node_compat/test/parallel/test-vm-timeout.js index d345206404..d080dc8eed 100644 --- a/tests/node_compat/test/parallel/test-vm-timeout.js +++ b/tests/node_compat/test/parallel/test-vm-timeout.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-whatwg-encoding-custom-api-basics.js b/tests/node_compat/test/parallel/test-whatwg-encoding-custom-api-basics.js index f1ca3b0bf8..0e743648f7 100644 --- a/tests/node_compat/test/parallel/test-whatwg-encoding-custom-api-basics.js +++ b/tests/node_compat/test/parallel/test-whatwg-encoding-custom-api-basics.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-whatwg-encoding-custom-textdecoder-ignorebom.js b/tests/node_compat/test/parallel/test-whatwg-encoding-custom-textdecoder-ignorebom.js index 39c3a6f9d4..0391378eda 100644 --- a/tests/node_compat/test/parallel/test-whatwg-encoding-custom-textdecoder-ignorebom.js +++ b/tests/node_compat/test/parallel/test-whatwg-encoding-custom-textdecoder-ignorebom.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-whatwg-encoding-custom-textdecoder-streaming.js b/tests/node_compat/test/parallel/test-whatwg-encoding-custom-textdecoder-streaming.js index 05a8988fec..152d084c5a 100644 --- a/tests/node_compat/test/parallel/test-whatwg-encoding-custom-textdecoder-streaming.js +++ b/tests/node_compat/test/parallel/test-whatwg-encoding-custom-textdecoder-streaming.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-whatwg-events-add-event-listener-options-passive.js b/tests/node_compat/test/parallel/test-whatwg-events-add-event-listener-options-passive.js index 98a3c6c49d..f6a9eddf33 100644 --- a/tests/node_compat/test/parallel/test-whatwg-events-add-event-listener-options-passive.js +++ b/tests/node_compat/test/parallel/test-whatwg-events-add-event-listener-options-passive.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-whatwg-events-add-event-listener-options-signal.js b/tests/node_compat/test/parallel/test-whatwg-events-add-event-listener-options-signal.js index 74055b00e6..93a332ab43 100644 --- a/tests/node_compat/test/parallel/test-whatwg-events-add-event-listener-options-signal.js +++ b/tests/node_compat/test/parallel/test-whatwg-events-add-event-listener-options-signal.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-whatwg-events-customevent.js b/tests/node_compat/test/parallel/test-whatwg-events-customevent.js index 1b8584d9c9..44c68a72a4 100644 --- a/tests/node_compat/test/parallel/test-whatwg-events-customevent.js +++ b/tests/node_compat/test/parallel/test-whatwg-events-customevent.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-whatwg-url-custom-deepequal.js b/tests/node_compat/test/parallel/test-whatwg-url-custom-deepequal.js index 26fb76421d..2980f554af 100644 --- a/tests/node_compat/test/parallel/test-whatwg-url-custom-deepequal.js +++ b/tests/node_compat/test/parallel/test-whatwg-url-custom-deepequal.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-whatwg-url-custom-global.js b/tests/node_compat/test/parallel/test-whatwg-url-custom-global.js index 265b0da9e6..39d3cc002d 100644 --- a/tests/node_compat/test/parallel/test-whatwg-url-custom-global.js +++ b/tests/node_compat/test/parallel/test-whatwg-url-custom-global.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-whatwg-url-custom-href-side-effect.js b/tests/node_compat/test/parallel/test-whatwg-url-custom-href-side-effect.js index b23df5bf13..e2fbbca398 100644 --- a/tests/node_compat/test/parallel/test-whatwg-url-custom-href-side-effect.js +++ b/tests/node_compat/test/parallel/test-whatwg-url-custom-href-side-effect.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-whatwg-url-custom-tostringtag.js b/tests/node_compat/test/parallel/test-whatwg-url-custom-tostringtag.js index d8464ad2f9..404d6d8bcf 100644 --- a/tests/node_compat/test/parallel/test-whatwg-url-custom-tostringtag.js +++ b/tests/node_compat/test/parallel/test-whatwg-url-custom-tostringtag.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-whatwg-url-override-hostname.js b/tests/node_compat/test/parallel/test-whatwg-url-override-hostname.js index 79ce9002f7..96a7dfe727 100644 --- a/tests/node_compat/test/parallel/test-whatwg-url-override-hostname.js +++ b/tests/node_compat/test/parallel/test-whatwg-url-override-hostname.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-worker-message-port-infinite-message-loop.js b/tests/node_compat/test/parallel/test-worker-message-port-infinite-message-loop.js index 784f72b9bd..f2a4a3242e 100644 --- a/tests/node_compat/test/parallel/test-worker-message-port-infinite-message-loop.js +++ b/tests/node_compat/test/parallel/test-worker-message-port-infinite-message-loop.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-worker-message-port-multiple-sharedarraybuffers.js b/tests/node_compat/test/parallel/test-worker-message-port-multiple-sharedarraybuffers.js index 38f0d0d4fa..986e7f1fb6 100644 --- a/tests/node_compat/test/parallel/test-worker-message-port-multiple-sharedarraybuffers.js +++ b/tests/node_compat/test/parallel/test-worker-message-port-multiple-sharedarraybuffers.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-zlib-close-after-error.js b/tests/node_compat/test/parallel/test-zlib-close-after-error.js index e0a9e3822b..845a34b39b 100644 --- a/tests/node_compat/test/parallel/test-zlib-close-after-error.js +++ b/tests/node_compat/test/parallel/test-zlib-close-after-error.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-zlib-close-after-write.js b/tests/node_compat/test/parallel/test-zlib-close-after-write.js index 82e08d0f91..76abf5ac68 100644 --- a/tests/node_compat/test/parallel/test-zlib-close-after-write.js +++ b/tests/node_compat/test/parallel/test-zlib-close-after-write.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-zlib-deflate-raw-inherits.js b/tests/node_compat/test/parallel/test-zlib-deflate-raw-inherits.js index 87081f2757..6c884bb001 100644 --- a/tests/node_compat/test/parallel/test-zlib-deflate-raw-inherits.js +++ b/tests/node_compat/test/parallel/test-zlib-deflate-raw-inherits.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-zlib-destroy-pipe.js b/tests/node_compat/test/parallel/test-zlib-destroy-pipe.js index 16c97e7d94..3877b88776 100644 --- a/tests/node_compat/test/parallel/test-zlib-destroy-pipe.js +++ b/tests/node_compat/test/parallel/test-zlib-destroy-pipe.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-zlib-from-string.js b/tests/node_compat/test/parallel/test-zlib-from-string.js index f7dc413ed9..42ccd0f095 100644 --- a/tests/node_compat/test/parallel/test-zlib-from-string.js +++ b/tests/node_compat/test/parallel/test-zlib-from-string.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // Copyright Joyent, Inc. and other Node contributors. diff --git a/tests/node_compat/test/parallel/test-zlib-no-stream.js b/tests/node_compat/test/parallel/test-zlib-no-stream.js index aceaca5166..f26cd4b240 100644 --- a/tests/node_compat/test/parallel/test-zlib-no-stream.js +++ b/tests/node_compat/test/parallel/test-zlib-no-stream.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. /* eslint-disable node-core/required-modules */ diff --git a/tests/node_compat/test/parallel/test-zlib-sync-no-event.js b/tests/node_compat/test/parallel/test-zlib-sync-no-event.js index dfd450a408..f0b7c998ce 100644 --- a/tests/node_compat/test/parallel/test-zlib-sync-no-event.js +++ b/tests/node_compat/test/parallel/test-zlib-sync-no-event.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-zlib-truncated.js b/tests/node_compat/test/parallel/test-zlib-truncated.js index 184d9ddc5d..f73cfd187e 100644 --- a/tests/node_compat/test/parallel/test-zlib-truncated.js +++ b/tests/node_compat/test/parallel/test-zlib-truncated.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-zlib-unzip-one-byte-chunks.js b/tests/node_compat/test/parallel/test-zlib-unzip-one-byte-chunks.js index e5fd62d038..4b295537a2 100644 --- a/tests/node_compat/test/parallel/test-zlib-unzip-one-byte-chunks.js +++ b/tests/node_compat/test/parallel/test-zlib-unzip-one-byte-chunks.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/parallel/test-zlib-write-after-end.js b/tests/node_compat/test/parallel/test-zlib-write-after-end.js index c8c302c220..452fa99c32 100644 --- a/tests/node_compat/test/parallel/test-zlib-write-after-end.js +++ b/tests/node_compat/test/parallel/test-zlib-write-after-end.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/pseudo-tty/console-dumb-tty.js b/tests/node_compat/test/pseudo-tty/console-dumb-tty.js index a9ea518112..9039851e62 100644 --- a/tests/node_compat/test/pseudo-tty/console-dumb-tty.js +++ b/tests/node_compat/test/pseudo-tty/console-dumb-tty.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/pseudo-tty/console_colors.js b/tests/node_compat/test/pseudo-tty/console_colors.js index 5680a7ef2f..c5a6d61ede 100644 --- a/tests/node_compat/test/pseudo-tty/console_colors.js +++ b/tests/node_compat/test/pseudo-tty/console_colors.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/pseudo-tty/no_dropped_stdio.js b/tests/node_compat/test/pseudo-tty/no_dropped_stdio.js index b852083d70..c8ee979aa6 100644 --- a/tests/node_compat/test/pseudo-tty/no_dropped_stdio.js +++ b/tests/node_compat/test/pseudo-tty/no_dropped_stdio.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // https://github.com/nodejs/node/issues/6456#issuecomment-219320599 diff --git a/tests/node_compat/test/pseudo-tty/no_interleaved_stdio.js b/tests/node_compat/test/pseudo-tty/no_interleaved_stdio.js index 1a573c7697..4dd80de3dc 100644 --- a/tests/node_compat/test/pseudo-tty/no_interleaved_stdio.js +++ b/tests/node_compat/test/pseudo-tty/no_interleaved_stdio.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. // https://github.com/nodejs/node/issues/6456#issuecomment-219320599 diff --git a/tests/node_compat/test/pseudo-tty/test-tty-color-support-warning-2.js b/tests/node_compat/test/pseudo-tty/test-tty-color-support-warning-2.js index bcb2ba80b8..f90fc6b4a1 100644 --- a/tests/node_compat/test/pseudo-tty/test-tty-color-support-warning-2.js +++ b/tests/node_compat/test/pseudo-tty/test-tty-color-support-warning-2.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/pseudo-tty/test-tty-color-support-warning.js b/tests/node_compat/test/pseudo-tty/test-tty-color-support-warning.js index 3e4f06d054..cccaa2b6a9 100644 --- a/tests/node_compat/test/pseudo-tty/test-tty-color-support-warning.js +++ b/tests/node_compat/test/pseudo-tty/test-tty-color-support-warning.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/pseudo-tty/test-tty-stdin-end.js b/tests/node_compat/test/pseudo-tty/test-tty-stdin-end.js index 05054d052f..6ac9b8cb98 100644 --- a/tests/node_compat/test/pseudo-tty/test-tty-stdin-end.js +++ b/tests/node_compat/test/pseudo-tty/test-tty-stdin-end.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; diff --git a/tests/node_compat/test/pseudo-tty/test-tty-stdout-end.js b/tests/node_compat/test/pseudo-tty/test-tty-stdout-end.js index 7adba81be2..9b3db4eab6 100644 --- a/tests/node_compat/test/pseudo-tty/test-tty-stdout-end.js +++ b/tests/node_compat/test/pseudo-tty/test-tty-stdout-end.js @@ -2,7 +2,7 @@ // deno-lint-ignore-file // Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 18.12.1 +// Taken from Node 20.11.1 // This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. 'use strict'; From 4365f8d9990fa6c6d8b7d8e5499e352e30e42c26 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 25 Nov 2024 09:37:48 -0500 Subject: [PATCH 154/227] fix(compile): handle TypeScript file included as asset (#27032) Closes #27024 --- cli/standalone/binary.rs | 6 +- cli/standalone/file_system.rs | 4 +- cli/standalone/mod.rs | 17 ++- cli/standalone/virtual_fs.rs | 121 +++++++++++++++--- .../specs/compile/include/self/__test__.jsonc | 24 ++++ tests/specs/compile/include/self/main.ts | 6 + tests/specs/compile/include/self/output.out | 7 + 7 files changed, 158 insertions(+), 27 deletions(-) create mode 100644 tests/specs/compile/include/self/__test__.jsonc create mode 100644 tests/specs/compile/include/self/main.ts create mode 100644 tests/specs/compile/include/self/output.out diff --git a/cli/standalone/binary.rs b/cli/standalone/binary.rs index e35119e0aa..791f5052c0 100644 --- a/cli/standalone/binary.rs +++ b/cli/standalone/binary.rs @@ -87,6 +87,7 @@ use super::serialization::RemoteModulesStore; use super::serialization::RemoteModulesStoreBuilder; use super::virtual_fs::FileBackedVfs; use super::virtual_fs::VfsBuilder; +use super::virtual_fs::VfsFileSubDataKind; use super::virtual_fs::VfsRoot; use super::virtual_fs::VirtualDirectory; @@ -275,7 +276,9 @@ impl StandaloneModules { if specifier.scheme() == "file" { let path = deno_path_util::url_to_file_path(specifier)?; let bytes = match self.vfs.file_entry(&path) { - Ok(entry) => self.vfs.read_file_all(entry)?, + Ok(entry) => self + .vfs + .read_file_all(entry, VfsFileSubDataKind::ModuleGraph)?, Err(err) if err.kind() == ErrorKind::NotFound => { let bytes = match RealFs.read_file_sync(&path, None) { Ok(bytes) => bytes, @@ -691,6 +694,7 @@ impl<'a> DenoCompileBinaryWriter<'a> { Some(source) => source, None => RealFs.read_file_sync(&file_path, None)?, }, + VfsFileSubDataKind::ModuleGraph, ) .with_context(|| { format!("Failed adding '{}'", file_path.display()) diff --git a/cli/standalone/file_system.rs b/cli/standalone/file_system.rs index 712c6ee918..48dc907570 100644 --- a/cli/standalone/file_system.rs +++ b/cli/standalone/file_system.rs @@ -17,6 +17,7 @@ use deno_runtime::deno_io::fs::FsResult; use deno_runtime::deno_io::fs::FsStat; use super::virtual_fs::FileBackedVfs; +use super::virtual_fs::VfsFileSubDataKind; #[derive(Debug, Clone)] pub struct DenoCompileFileSystem(Arc); @@ -36,7 +37,8 @@ impl DenoCompileFileSystem { fn copy_to_real_path(&self, oldpath: &Path, newpath: &Path) -> FsResult<()> { let old_file = self.0.file_entry(oldpath)?; - let old_file_bytes = self.0.read_file_all(old_file)?; + let old_file_bytes = + self.0.read_file_all(old_file, VfsFileSubDataKind::Raw)?; RealFs.write_file_sync( newpath, OpenOptions { diff --git a/cli/standalone/mod.rs b/cli/standalone/mod.rs index b9f0b1d5be..27b03fec63 100644 --- a/cli/standalone/mod.rs +++ b/cli/standalone/mod.rs @@ -56,6 +56,8 @@ use serialization::DenoCompileModuleSource; use std::borrow::Cow; use std::rc::Rc; use std::sync::Arc; +use virtual_fs::FileBackedVfs; +use virtual_fs::VfsFileSubDataKind; use crate::args::create_default_npmrc; use crate::args::get_root_cert_store; @@ -111,6 +113,7 @@ use self::file_system::DenoCompileFileSystem; struct SharedModuleLoaderState { cjs_tracker: Arc, + code_cache: Option>, fs: Arc, modules: StandaloneModules, node_code_translator: Arc, @@ -118,8 +121,8 @@ struct SharedModuleLoaderState { npm_module_loader: Arc, npm_req_resolver: Arc, npm_resolver: Arc, + vfs: Arc, workspace_resolver: WorkspaceResolver, - code_cache: Option>, } impl SharedModuleLoaderState { @@ -514,7 +517,12 @@ impl NodeRequireLoader for EmbeddedModuleLoader { &self, path: &std::path::Path, ) -> Result { - Ok(self.shared.fs.read_text_file_lossy_sync(path, None)?) + let file_entry = self.shared.vfs.file_entry(path)?; + let file_bytes = self + .shared + .vfs + .read_file_all(file_entry, VfsFileSubDataKind::ModuleGraph)?; + Ok(String::from_utf8(file_bytes.into_owned())?) } fn is_maybe_cjs( @@ -817,6 +825,7 @@ pub async fn run(data: StandaloneData) -> Result { let module_loader_factory = StandaloneModuleLoaderFactory { shared: Arc::new(SharedModuleLoaderState { cjs_tracker: cjs_tracker.clone(), + code_cache: code_cache.clone(), fs: fs.clone(), modules, node_code_translator: node_code_translator.clone(), @@ -826,10 +835,10 @@ pub async fn run(data: StandaloneData) -> Result { fs.clone(), node_code_translator, )), - code_cache: code_cache.clone(), npm_resolver: npm_resolver.clone(), - workspace_resolver, npm_req_resolver, + vfs, + workspace_resolver, }), }; diff --git a/cli/standalone/virtual_fs.rs b/cli/standalone/virtual_fs.rs index be7e937ee1..5b8076549d 100644 --- a/cli/standalone/virtual_fs.rs +++ b/cli/standalone/virtual_fs.rs @@ -32,6 +32,15 @@ use thiserror::Error; use crate::util; use crate::util::fs::canonicalize_path; +#[derive(Debug, Copy, Clone)] +pub enum VfsFileSubDataKind { + /// Raw bytes of the file. + Raw, + /// Bytes to use for module loading. For example, for TypeScript + /// files this will be the transpiled JavaScript source. + ModuleGraph, +} + #[derive(Error, Debug)] #[error( "Failed to strip prefix '{}' from '{}'", root_path.display(), target.display() @@ -141,7 +150,11 @@ impl VfsBuilder { // inline the symlink and make the target file let file_bytes = std::fs::read(&target) .with_context(|| format!("Reading {}", path.display()))?; - self.add_file_with_data_inner(&path, file_bytes)?; + self.add_file_with_data_inner( + &path, + file_bytes, + VfsFileSubDataKind::Raw, + )?; } else { log::warn!( "{} Symlink target is outside '{}'. Excluding symlink at '{}' with target '{}'.", @@ -219,25 +232,27 @@ impl VfsBuilder { ) -> Result<(), AnyError> { let file_bytes = std::fs::read(path) .with_context(|| format!("Reading {}", path.display()))?; - self.add_file_with_data_inner(path, file_bytes) + self.add_file_with_data_inner(path, file_bytes, VfsFileSubDataKind::Raw) } pub fn add_file_with_data( &mut self, path: &Path, data: Vec, + sub_data_kind: VfsFileSubDataKind, ) -> Result<(), AnyError> { let target_path = canonicalize_path(path)?; if target_path != path { self.add_symlink(path, &target_path)?; } - self.add_file_with_data_inner(&target_path, data) + self.add_file_with_data_inner(&target_path, data, sub_data_kind) } fn add_file_with_data_inner( &mut self, path: &Path, data: Vec, + sub_data_kind: VfsFileSubDataKind, ) -> Result<(), AnyError> { log::debug!("Adding file '{}'", path.display()); let checksum = util::checksum::gen(&[&data]); @@ -253,8 +268,19 @@ impl VfsBuilder { let name = path.file_name().unwrap().to_string_lossy(); let data_len = data.len(); match dir.entries.binary_search_by(|e| e.name().cmp(&name)) { - Ok(_) => { - // already added, just ignore + Ok(index) => { + let entry = &mut dir.entries[index]; + match entry { + VfsEntry::File(virtual_file) => match sub_data_kind { + VfsFileSubDataKind::Raw => { + virtual_file.offset = offset; + } + VfsFileSubDataKind::ModuleGraph => { + virtual_file.module_graph_offset = offset; + } + }, + VfsEntry::Dir(_) | VfsEntry::Symlink(_) => unreachable!(), + } } Err(insert_index) => { dir.entries.insert( @@ -262,6 +288,7 @@ impl VfsBuilder { VfsEntry::File(VirtualFile { name: name.to_string(), offset, + module_graph_offset: offset, len: data.len() as u64, }), ); @@ -454,6 +481,12 @@ pub struct VirtualDirectory { pub struct VirtualFile { pub name: String, pub offset: u64, + /// Offset file to use for module loading when it differs from the + /// raw file. Often this will be the same offset as above for data + /// such as JavaScript files, but for TypeScript files the `offset` + /// will be the original raw bytes when included as an asset and this + /// offset will be to the transpiled JavaScript source. + pub module_graph_offset: u64, pub len: u64, } @@ -647,7 +680,7 @@ impl FileBackedVfsFile { .map_err(|err| err.into()) } - fn read_to_end(&self) -> FsResult> { + fn read_to_end(&self) -> FsResult> { let read_pos = { let mut pos = self.pos.lock(); let read_pos = *pos; @@ -659,12 +692,20 @@ impl FileBackedVfsFile { read_pos }; if read_pos > self.file.len { - return Ok(Vec::new()); + return Ok(Cow::Borrowed(&[])); + } + if read_pos == 0 { + Ok( + self + .vfs + .read_file_all(&self.file, VfsFileSubDataKind::Raw)?, + ) + } else { + let size = (self.file.len - read_pos) as usize; + let mut buf = vec![0; size]; + self.vfs.read_file(&self.file, read_pos, &mut buf)?; + Ok(Cow::Owned(buf)) } - let size = (self.file.len - read_pos) as usize; - let mut buf = vec![0; size]; - self.vfs.read_file(&self.file, read_pos, &mut buf)?; - Ok(buf) } } @@ -703,11 +744,14 @@ impl deno_io::fs::File for FileBackedVfsFile { } fn read_all_sync(self: Rc) -> FsResult> { - self.read_to_end() + self.read_to_end().map(|bytes| bytes.into_owned()) } async fn read_all_async(self: Rc) -> FsResult> { let inner = (*self).clone(); - tokio::task::spawn_blocking(move || inner.read_to_end()).await? + tokio::task::spawn_blocking(move || { + inner.read_to_end().map(|bytes| bytes.into_owned()) + }) + .await? } fn chmod_sync(self: Rc, _pathmode: u32) -> FsResult<()> { @@ -878,8 +922,9 @@ impl FileBackedVfs { pub fn read_file_all( &self, file: &VirtualFile, + sub_data_kind: VfsFileSubDataKind, ) -> std::io::Result> { - let read_range = self.get_read_range(file, 0, file.len)?; + let read_range = self.get_read_range(file, sub_data_kind, 0, file.len)?; match &self.vfs_data { Cow::Borrowed(data) => Ok(Cow::Borrowed(&data[read_range])), Cow::Owned(data) => Ok(Cow::Owned(data[read_range].to_vec())), @@ -892,7 +937,12 @@ impl FileBackedVfs { pos: u64, buf: &mut [u8], ) -> std::io::Result { - let read_range = self.get_read_range(file, pos, buf.len() as u64)?; + let read_range = self.get_read_range( + file, + VfsFileSubDataKind::Raw, + pos, + buf.len() as u64, + )?; let read_len = read_range.len(); buf[..read_len].copy_from_slice(&self.vfs_data[read_range]); Ok(read_len) @@ -901,6 +951,7 @@ impl FileBackedVfs { fn get_read_range( &self, file: &VirtualFile, + sub_data_kind: VfsFileSubDataKind, pos: u64, len: u64, ) -> std::io::Result> { @@ -910,7 +961,11 @@ impl FileBackedVfs { "unexpected EOF", )); } - let file_offset = self.fs_root.start_file_offset + file.offset; + let offset = match sub_data_kind { + VfsFileSubDataKind::Raw => file.offset, + VfsFileSubDataKind::ModuleGraph => file.module_graph_offset, + }; + let file_offset = self.fs_root.start_file_offset + offset; let start = file_offset + pos; let end = file_offset + std::cmp::min(pos + len, file.len); Ok(start as usize..end as usize) @@ -951,7 +1006,13 @@ mod test { #[track_caller] fn read_file(vfs: &FileBackedVfs, path: &Path) -> String { let file = vfs.file_entry(path).unwrap(); - String::from_utf8(vfs.read_file_all(file).unwrap().into_owned()).unwrap() + String::from_utf8( + vfs + .read_file_all(file, VfsFileSubDataKind::Raw) + .unwrap() + .into_owned(), + ) + .unwrap() } #[test] @@ -964,23 +1025,40 @@ mod test { let src_path = src_path.to_path_buf(); let mut builder = VfsBuilder::new(src_path.clone()).unwrap(); builder - .add_file_with_data_inner(&src_path.join("a.txt"), "data".into()) + .add_file_with_data_inner( + &src_path.join("a.txt"), + "data".into(), + VfsFileSubDataKind::Raw, + ) .unwrap(); builder - .add_file_with_data_inner(&src_path.join("b.txt"), "data".into()) + .add_file_with_data_inner( + &src_path.join("b.txt"), + "data".into(), + VfsFileSubDataKind::Raw, + ) .unwrap(); assert_eq!(builder.files.len(), 1); // because duplicate data builder - .add_file_with_data_inner(&src_path.join("c.txt"), "c".into()) + .add_file_with_data_inner( + &src_path.join("c.txt"), + "c".into(), + VfsFileSubDataKind::Raw, + ) .unwrap(); builder .add_file_with_data_inner( &src_path.join("sub_dir").join("d.txt"), "d".into(), + VfsFileSubDataKind::Raw, ) .unwrap(); builder - .add_file_with_data_inner(&src_path.join("e.txt"), "e".into()) + .add_file_with_data_inner( + &src_path.join("e.txt"), + "e".into(), + VfsFileSubDataKind::Raw, + ) .unwrap(); builder .add_symlink( @@ -1151,6 +1229,7 @@ mod test { .add_file_with_data_inner( temp_path.join("a.txt").as_path(), "0123456789".to_string().into_bytes(), + VfsFileSubDataKind::Raw, ) .unwrap(); let (dest_path, virtual_fs) = into_virtual_fs(builder, &temp_dir); diff --git a/tests/specs/compile/include/self/__test__.jsonc b/tests/specs/compile/include/self/__test__.jsonc new file mode 100644 index 0000000000..5fb74534aa --- /dev/null +++ b/tests/specs/compile/include/self/__test__.jsonc @@ -0,0 +1,24 @@ +{ + "tempDir": true, + "steps": [{ + "if": "unix", + "args": "compile --allow-read=. --include . --output main main.ts", + "output": "[WILDCARD]" + }, { + "if": "unix", + "commandName": "./main", + "args": [], + "output": "output.out", + "exitCode": 0 + }, { + "if": "windows", + "args": "compile --allow-read=. --include . --output main main.ts", + "output": "[WILDCARD]" + }, { + "if": "windows", + "commandName": "./main.exe", + "args": [], + "output": "output.out", + "exitCode": 0 + }] +} diff --git a/tests/specs/compile/include/self/main.ts b/tests/specs/compile/include/self/main.ts new file mode 100644 index 0000000000..d86580e3d8 --- /dev/null +++ b/tests/specs/compile/include/self/main.ts @@ -0,0 +1,6 @@ +function add(a: number, b: number) { + return a + b; +} + +console.log(add(1, 2)); +console.log(Deno.readTextFileSync(import.meta.filename!).trim()); diff --git a/tests/specs/compile/include/self/output.out b/tests/specs/compile/include/self/output.out new file mode 100644 index 0000000000..10c297caba --- /dev/null +++ b/tests/specs/compile/include/self/output.out @@ -0,0 +1,7 @@ +3 +function add(a: number, b: number) { + return a + b; +} + +console.log(add(1, 2)); +console.log(Deno.readTextFileSync(import.meta.filename!).trim()); From 15f14630ff1e44752c6aecc66032b12e5b732da3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 25 Nov 2024 14:42:34 +0000 Subject: [PATCH 155/227] fix(init): always force managed node modules (#27047) Closes https://github.com/denoland/deno/issues/27045 --- cli/tools/init/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli/tools/init/mod.rs b/cli/tools/init/mod.rs index 8f486dad53..25b86cb957 100644 --- a/cli/tools/init/mod.rs +++ b/cli/tools/init/mod.rs @@ -9,6 +9,7 @@ use crate::args::RunFlags; use crate::colors; use color_print::cformat; use color_print::cstr; +use deno_config::deno_json::NodeModulesDirMode; use deno_core::anyhow::Context; use deno_core::error::AnyError; use deno_core::serde_json::json; @@ -288,6 +289,7 @@ async fn init_npm(name: &str, args: Vec) -> Result { }, allow_scripts: PackagesAllowedScripts::All, argv: args, + node_modules_dir: Some(NodeModulesDirMode::Auto), subcommand: DenoSubcommand::Run(RunFlags { script: script_name, ..Default::default() From 08a56763d454738361d275910e652c8b0ea1c671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 25 Nov 2024 15:18:39 +0000 Subject: [PATCH 156/227] chore: upgrade sqlformat-rs to non-forked version (#27063) --- Cargo.lock | 26 +++++++++++++------------- cli/Cargo.toml | 3 +-- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6e929168f5..e7229dcceb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1232,7 +1232,6 @@ dependencies = [ "deno_resolver", "deno_runtime", "deno_semver", - "deno_sqlformat", "deno_task_shell", "deno_terminal 0.2.0", "deno_tower_lsp", @@ -1292,6 +1291,7 @@ dependencies = [ "sha2", "shell-escape", "spki", + "sqlformat", "strsim", "tar", "tempfile", @@ -2147,18 +2147,6 @@ dependencies = [ "url", ] -[[package]] -name = "deno_sqlformat" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e196799ec0cc240fac1fb5c5bf813ef92a9602740a059cfcbb20593b2deee52" -dependencies = [ - "nom 7.1.3", - "once_cell", - "regex", - "unicode_categories", -] - [[package]] name = "deno_task_shell" version = "0.18.1" @@ -6944,6 +6932,18 @@ dependencies = [ "der", ] +[[package]] +name = "sqlformat" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c38684453189293372e6fffa3bed1015d20488ce4cc09a23de050fd7411e46" +dependencies = [ + "nom 7.1.3", + "once_cell", + "regex", + "unicode_categories", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 6a1fc51bc4..ce9dbe9230 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -151,8 +151,7 @@ serde_repr.workspace = true sha2.workspace = true shell-escape = "=0.1.5" spki = { version = "0.7", features = ["pem"] } -# NOTE(bartlomieju): using temporary fork for now, revert back to `sqlformat-rs` later -sqlformat = { package = "deno_sqlformat", version = "0.3.2" } +sqlformat = "=0.3.2" strsim = "0.11.1" tar.workspace = true tempfile.workspace = true From d59bd5e8c9eac0dcf4dadce21a8e30542e80b876 Mon Sep 17 00:00:00 2001 From: snek Date: Mon, 25 Nov 2024 16:38:07 +0100 Subject: [PATCH 157/227] feat(unstable): Instrument fetch (#27057) Add basic tracing to `fetch`. Also fix span kinds so that we can differentiate fetch and serve. --- ext/fetch/26_fetch.js | 218 +++++++++++++++++---------- ext/fetch/lib.rs | 7 + ext/http/00_serve.ts | 4 +- runtime/js/telemetry.ts | 14 +- tests/specs/cli/otel_basic/basic.out | 70 ++++++++- 5 files changed, 223 insertions(+), 90 deletions(-) diff --git a/ext/fetch/26_fetch.js b/ext/fetch/26_fetch.js index 8ac364a931..01be983a37 100644 --- a/ext/fetch/26_fetch.js +++ b/ext/fetch/26_fetch.js @@ -10,9 +10,10 @@ /// /// -import { core, primordials } from "ext:core/mod.js"; +import { core, internals, primordials } from "ext:core/mod.js"; import { op_fetch, + op_fetch_promise_is_settled, op_fetch_send, op_wasm_streaming_feed, op_wasm_streaming_set_url, @@ -28,7 +29,9 @@ const { PromisePrototypeThen, PromisePrototypeCatch, SafeArrayIterator, + SafePromisePrototypeFinally, String, + StringPrototypeSlice, StringPrototypeStartsWith, StringPrototypeToLowerCase, TypeError, @@ -307,93 +310,150 @@ function httpRedirectFetch(request, response, terminator) { * @param {RequestInit} init */ function fetch(input, init = { __proto__: null }) { - // There is an async dispatch later that causes a stack trace disconnect. - // We reconnect it by assigning the result of that dispatch to `opPromise`, - // awaiting `opPromise` in an inner function also named `fetch()` and - // returning the result from that. - let opPromise = undefined; - // 1. - const result = new Promise((resolve, reject) => { - const prefix = "Failed to execute 'fetch'"; - webidl.requiredArguments(arguments.length, 1, prefix); - // 2. - const requestObject = new Request(input, init); - // 3. - const request = toInnerRequest(requestObject); - // 4. - if (requestObject.signal.aborted) { - reject(abortFetch(request, null, requestObject.signal.reason)); - return; + let span; + try { + if (internals.telemetry?.tracingEnabled) { + span = new internals.telemetry.Span("fetch", { kind: 2 }); + internals.telemetry.enterSpan(span); } - // 7. - let responseObject = null; - // 9. - let locallyAborted = false; - // 10. - function onabort() { - locallyAborted = true; - reject( - abortFetch(request, responseObject, requestObject.signal.reason), - ); - } - requestObject.signal[abortSignal.add](onabort); + // There is an async dispatch later that causes a stack trace disconnect. + // We reconnect it by assigning the result of that dispatch to `opPromise`, + // awaiting `opPromise` in an inner function also named `fetch()` and + // returning the result from that. + let opPromise = undefined; + // 1. + const result = new Promise((resolve, reject) => { + const prefix = "Failed to execute 'fetch'"; + webidl.requiredArguments(arguments.length, 1, prefix); + // 2. + const requestObject = new Request(input, init); - if (!requestObject.headers.has("Accept")) { - ArrayPrototypePush(request.headerList, ["Accept", "*/*"]); - } + if (span) { + span.updateName(requestObject.method); + span.setAttribute("http.request.method", requestObject.method); + const url = new URL(requestObject.url); + span.setAttribute("url.full", requestObject.url); + span.setAttribute( + "url.scheme", + StringPrototypeSlice(url.protocol, 0, -1), + ); + span.setAttribute("url.path", url.pathname); + span.setAttribute("url.query", StringPrototypeSlice(url.search, 1)); + } - if (!requestObject.headers.has("Accept-Language")) { - ArrayPrototypePush(request.headerList, ["Accept-Language", "*"]); - } + // 3. + const request = toInnerRequest(requestObject); + // 4. + if (requestObject.signal.aborted) { + reject(abortFetch(request, null, requestObject.signal.reason)); + return; + } + // 7. + let responseObject = null; + // 9. + let locallyAborted = false; + // 10. + function onabort() { + locallyAborted = true; + reject( + abortFetch(request, responseObject, requestObject.signal.reason), + ); + } + requestObject.signal[abortSignal.add](onabort); - // 12. - opPromise = PromisePrototypeCatch( - PromisePrototypeThen( - mainFetch(request, false, requestObject.signal), - (response) => { - // 12.1. - if (locallyAborted) return; - // 12.2. - if (response.aborted) { - reject( - abortFetch( - request, - responseObject, - requestObject.signal.reason, - ), - ); + if (!requestObject.headers.has("Accept")) { + ArrayPrototypePush(request.headerList, ["Accept", "*/*"]); + } + + if (!requestObject.headers.has("Accept-Language")) { + ArrayPrototypePush(request.headerList, ["Accept-Language", "*"]); + } + + // 12. + opPromise = PromisePrototypeCatch( + PromisePrototypeThen( + mainFetch(request, false, requestObject.signal), + (response) => { + // 12.1. + if (locallyAborted) return; + // 12.2. + if (response.aborted) { + reject( + abortFetch( + request, + responseObject, + requestObject.signal.reason, + ), + ); + requestObject.signal[abortSignal.remove](onabort); + return; + } + // 12.3. + if (response.type === "error") { + const err = new TypeError( + "Fetch failed: " + (response.error ?? "unknown error"), + ); + reject(err); + requestObject.signal[abortSignal.remove](onabort); + return; + } + responseObject = fromInnerResponse(response, "immutable"); + + if (span) { + span.setAttribute( + "http.response.status_code", + String(responseObject.status), + ); + } + + resolve(responseObject); requestObject.signal[abortSignal.remove](onabort); - return; - } - // 12.3. - if (response.type === "error") { - const err = new TypeError( - "Fetch failed: " + (response.error ?? "unknown error"), - ); - reject(err); - requestObject.signal[abortSignal.remove](onabort); - return; - } - responseObject = fromInnerResponse(response, "immutable"); - resolve(responseObject); + }, + ), + (err) => { + reject(err); requestObject.signal[abortSignal.remove](onabort); }, - ), - (err) => { - reject(err); - requestObject.signal[abortSignal.remove](onabort); - }, - ); - }); - if (opPromise) { - PromisePrototypeCatch(result, () => {}); - return (async function fetch() { - await opPromise; - return result; - })(); + ); + }); + + if (opPromise) { + PromisePrototypeCatch(result, () => {}); + return (async function fetch() { + try { + await opPromise; + return result; + } finally { + if (span) { + internals.telemetry.endSpan(span); + } + } + })(); + } + // We need to end the span when the promise settles. + // WPT has a test that aborted fetch is settled in the same tick. + // This means we cannot wrap the promise if it is already settled. + // But this is OK, because we can just immediately end the span + // in that case. + if (span) { + // XXX: This should always be true, otherwise `opPromise` would be present. + if (op_fetch_promise_is_settled(result)) { + // It's already settled. + internals.telemetry.endSpan(span); + } else { + // Not settled yet, we can return a new wrapper promise. + return SafePromisePrototypeFinally(result, () => { + internals.telemetry.endSpan(span); + }); + } + } + return result; + } finally { + if (span) { + internals.telemetry.exitSpan(span); + } } - return result; } function abortFetch(request, responseObject, error) { diff --git a/ext/fetch/lib.rs b/ext/fetch/lib.rs index 303c955622..7a525053b3 100644 --- a/ext/fetch/lib.rs +++ b/ext/fetch/lib.rs @@ -27,6 +27,7 @@ use deno_core::futures::TryFutureExt; use deno_core::op2; use deno_core::url; use deno_core::url::Url; +use deno_core::v8; use deno_core::AsyncRefCell; use deno_core::AsyncResult; use deno_core::BufView; @@ -141,6 +142,7 @@ deno_core::extension!(deno_fetch, op_fetch_send, op_utf8_to_byte_string, op_fetch_custom_client, + op_fetch_promise_is_settled, ], esm = [ "20_headers.js", @@ -1206,3 +1208,8 @@ pub fn extract_authority(url: &mut Url) -> Option<(String, Option)> { None } + +#[op2(fast)] +fn op_fetch_promise_is_settled(promise: v8::Local) -> bool { + promise.state() != v8::PromiseState::Pending +} diff --git a/ext/http/00_serve.ts b/ext/http/00_serve.ts index 766a6d2739..027c2710b2 100644 --- a/ext/http/00_serve.ts +++ b/ext/http/00_serve.ts @@ -617,13 +617,13 @@ function mapToCallback(context, callback, onError) { fastSyncResponseOrStream(req, inner.body, status, innerRequest); }; - if (internals.telemetry.tracingEnabled) { + if (internals.telemetry?.tracingEnabled) { const { Span, enterSpan, endSpan } = internals.telemetry; const origMapped = mapped; mapped = function (req, _span) { const oldCtx = getAsyncContext(); setAsyncContext(context.asyncContext); - const span = new Span("deno.serve"); + const span = new Span("deno.serve", { kind: 1 }); try { enterSpan(span); return SafePromisePrototypeFinally( diff --git a/runtime/js/telemetry.ts b/runtime/js/telemetry.ts index 96c1c9369f..a98e5b0a19 100644 --- a/runtime/js/telemetry.ts +++ b/runtime/js/telemetry.ts @@ -41,6 +41,8 @@ const { AsyncVariable, setAsyncContext } = core; let TRACING_ENABLED = false; let DETERMINISTIC = false; +// Note: These start at 0 in the JS library, +// but start at 1 when serialized with JSON. enum SpanKind { INTERNAL = 0, SERVER = 1, @@ -91,6 +93,11 @@ interface Attributes { type SpanAttributes = Attributes; +interface SpanOptions { + attributes?: Attributes; + kind?: SpanKind; +} + interface Link { context: SpanContext; attributes?: SpanAttributes; @@ -354,7 +361,7 @@ export class Span { #recording = TRACING_ENABLED; - #kind: number = 0; + #kind: number = SpanKind.INTERNAL; #name: string; #startTime: number; #status: { code: number; message?: string } | null = null; @@ -429,7 +436,7 @@ export class Span { constructor( name: string, - attributes?: Attributes, + options?: SpanOptions, ) { if (!this.isRecording) { this.#name = ""; @@ -442,7 +449,8 @@ export class Span { this.#name = name; this.#startTime = now(); - this.#attributes = attributes ?? { __proto__: null } as never; + this.#attributes = options?.attributes ?? { __proto__: null } as never; + this.#kind = options?.kind ?? SpanKind.INTERNAL; const currentSpan: Span | { spanContext(): { traceId: string; spanId: string }; diff --git a/tests/specs/cli/otel_basic/basic.out b/tests/specs/cli/otel_basic/basic.out index 1883866a1d..88296a7c04 100644 --- a/tests/specs/cli/otel_basic/basic.out +++ b/tests/specs/cli/otel_basic/basic.out @@ -7,7 +7,7 @@ "parentSpanId": "", "flags": 1, "name": "GET", - "kind": 1, + "kind": 3, "startTimeUnixNano": "[WILDCARD]", "endTimeUnixNano": "[WILDCARD]", "attributes": [ @@ -59,10 +59,68 @@ } }, { - "traceId": "00000000000000000000000000000001", + "traceId": "00000000000000000000000000000003", + "spanId": "0000000000000004", + "traceState": "", + "parentSpanId": "", + "flags": 1, + "name": "GET", + "kind": 2, + "startTimeUnixNano": "[WILDCARD]", + "endTimeUnixNano": "[WILDCARD]", + "attributes": [ + { + "key": "http.request.method", + "value": { + "stringValue": "GET" + } + }, + { + "key": "url.full", + "value": { + "stringValue": "http://localhost:[WILDCARD]/" + } + }, + { + "key": "url.scheme", + "value": { + "stringValue": "http" + } + }, + { + "key": "url.path", + "value": { + "stringValue": "/" + } + }, + { + "key": "url.query", + "value": { + "stringValue": "" + } + }, + { + "key": "http.response.status_code", + "value": { + "stringValue": "200" + } + } + ], + "droppedAttributesCount": 0, + "events": [], + "droppedEventsCount": 0, + "links": [], + "droppedLinksCount": 0, + "status": { + "message": "", + "code": 0 + } + }, + { + "traceId": "00000000000000000000000000000003", "spanId": "1000000000000001", "traceState": "", - "parentSpanId": "0000000000000002", + "parentSpanId": "0000000000000004", "flags": 1, "name": "outer span", "kind": 1, @@ -80,7 +138,7 @@ } }, { - "traceId": "00000000000000000000000000000001", + "traceId": "00000000000000000000000000000003", "spanId": "1000000000000002", "traceState": "", "parentSpanId": "1000000000000001", @@ -113,7 +171,7 @@ "attributes": [], "droppedAttributesCount": 0, "flags": 1, - "traceId": "00000000000000000000000000000001", + "traceId": "00000000000000000000000000000003", "spanId": "1000000000000002" }, { @@ -127,7 +185,7 @@ "attributes": [], "droppedAttributesCount": 0, "flags": 1, - "traceId": "00000000000000000000000000000001", + "traceId": "00000000000000000000000000000003", "spanId": "1000000000000002" } ] From 38b618ce351b0e6432b5912e97e16df259dc36b5 Mon Sep 17 00:00:00 2001 From: ctrl+d <52456860+DanieleAurilio@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:38:52 +0100 Subject: [PATCH 158/227] fix(runtime/ops): Fix watchfs remove event (#27041) Fix related to #26906. Currently, if a file is removed, no event is emitted because the file path no longer exists. As a result, [this check](https://github.com/denoland/deno/blob/12b377247be2b74155ded3a678ff2996ef3d7c9f/runtime/ops/fs_events.rs#L149) returns false. With this PR, an additional check is introduced to verify if the file exists. If the file does not exist, a custom "remove" event is emitted. This change is necessary because, based on tests conducted on macOS and Linux (Ubuntu 24.04.1 LTS), Linux emits a "rename" event instead of a "remove" event when a file is deleted. Introducing a dedicated "remove" event ensures consistent and clearer behavior across platforms. --- runtime/ops/fs_events.rs | 15 +++++++++++++++ tests/unit/fs_events_test.ts | 30 ++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/runtime/ops/fs_events.rs b/runtime/ops/fs_events.rs index a91722f91a..f6e5ceff5c 100644 --- a/runtime/ops/fs_events.rs +++ b/runtime/ops/fs_events.rs @@ -109,6 +109,14 @@ fn starts_with_canonicalized(path: &Path, prefix: &str) -> bool { } } +fn is_file_removed(event_path: &PathBuf) -> bool { + let exists_path = std::fs::exists(event_path); + match exists_path { + Ok(res) => !res, + Err(_) => false, + } +} + #[derive(Debug, thiserror::Error)] pub enum FsEventsError { #[error(transparent)] @@ -150,6 +158,13 @@ fn start_watcher( }) }) { let _ = sender.try_send(Ok(event.clone())); + } else if event.paths.iter().any(is_file_removed) { + let remove_event = FsEvent { + kind: "remove", + paths: event.paths.clone(), + flag: None, + }; + let _ = sender.try_send(Ok(remove_event)); } } } diff --git a/tests/unit/fs_events_test.ts b/tests/unit/fs_events_test.ts index cc2f2cd571..7489626b9f 100644 --- a/tests/unit/fs_events_test.ts +++ b/tests/unit/fs_events_test.ts @@ -45,6 +45,14 @@ async function makeTempDir(): Promise { return testDir; } +async function makeTempFile(): Promise { + const testFile = await Deno.makeTempFile(); + // The watcher sometimes witnesses the creation of it's own root + // directory. Delay a bit. + await delay(100); + return testFile; +} + Deno.test( { permissions: { read: true, write: true } }, async function watchFsBasic() { @@ -155,3 +163,25 @@ Deno.test( assert(done); }, ); + +Deno.test( + { permissions: { read: true, write: true } }, + async function watchFsRemove() { + const testFile = await makeTempFile(); + using watcher = Deno.watchFs(testFile); + async function waitForRemove() { + for await (const event of watcher) { + if (event.kind === "remove") { + return event; + } + } + } + const eventPromise = waitForRemove(); + + await Deno.remove(testFile); + + // Expect zero events. + const event = await eventPromise; + assertEquals(event!.kind, "remove"); + }, +); From 7456255cd10286d71363fc024e51b2662790448a Mon Sep 17 00:00:00 2001 From: Espen Hovlandsdal Date: Mon, 25 Nov 2024 10:07:00 -0800 Subject: [PATCH 159/227] Merge commit from fork MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: drop auth headers, cookies on redirect to different origin * refactor: destructure StringPrototypeEndsWith --------- Co-authored-by: Bartek Iwańczuk --- ext/fetch/26_fetch.js | 46 ++++++++++++++++++++++++++++++++++- tests/unit/fetch_test.ts | 52 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-) diff --git a/ext/fetch/26_fetch.js b/ext/fetch/26_fetch.js index 01be983a37..3a77f6075e 100644 --- a/ext/fetch/26_fetch.js +++ b/ext/fetch/26_fetch.js @@ -31,6 +31,7 @@ const { SafeArrayIterator, SafePromisePrototypeFinally, String, + StringPrototypeEndsWith, StringPrototypeSlice, StringPrototypeStartsWith, StringPrototypeToLowerCase, @@ -66,6 +67,12 @@ const REQUEST_BODY_HEADER_NAMES = [ "content-type", ]; +const REDIRECT_SENSITIVE_HEADER_NAMES = [ + "authorization", + "proxy-authorization", + "cookie", +]; + /** * @param {number} rid * @returns {Promise<{ status: number, statusText: string, headers: [string, string][], url: string, responseRid: number, error: [string, string]? }>} @@ -253,12 +260,14 @@ function httpRedirectFetch(request, response, terminator) { if (locationHeaders.length === 0) { return response; } + + const currentURL = new URL(request.currentUrl()); const locationURL = new URL( locationHeaders[0][1], response.url() ?? undefined, ); if (locationURL.hash === "") { - locationURL.hash = request.currentUrl().hash; + locationURL.hash = currentURL.hash; } if (locationURL.protocol !== "https:" && locationURL.protocol !== "http:") { return networkError("Can not redirect to a non HTTP(s) url"); @@ -297,6 +306,28 @@ function httpRedirectFetch(request, response, terminator) { } } } + + // Drop confidential headers when redirecting to a less secure protocol + // or to a different domain that is not a superdomain + if ( + locationURL.protocol !== currentURL.protocol && + locationURL.protocol !== "https:" || + locationURL.host !== currentURL.host && + !isSubdomain(locationURL.host, currentURL.host) + ) { + for (let i = 0; i < request.headerList.length; i++) { + if ( + ArrayPrototypeIncludes( + REDIRECT_SENSITIVE_HEADER_NAMES, + byteLowerCase(request.headerList[i][0]), + ) + ) { + ArrayPrototypeSplice(request.headerList, i, 1); + i--; + } + } + } + if (request.body !== null) { const res = extractBody(request.body.source); request.body = res.body; @@ -470,6 +501,19 @@ function abortFetch(request, responseObject, error) { return error; } +/** + * Checks if the given string is a subdomain of the given domain. + * + * @param {String} subdomain + * @param {String} domain + * @returns {Boolean} + */ +function isSubdomain(subdomain, domain) { + const dot = subdomain.length - domain.length - 1; + return dot > 0 && subdomain[dot] === "." && + StringPrototypeEndsWith(subdomain, domain); +} + /** * Handle the Response argument to the WebAssembly streaming APIs, after * resolving if it was passed as a promise. This function should be registered diff --git a/tests/unit/fetch_test.ts b/tests/unit/fetch_test.ts index 6d3fd8cc1d..298a266903 100644 --- a/tests/unit/fetch_test.ts +++ b/tests/unit/fetch_test.ts @@ -439,6 +439,58 @@ Deno.test( }, ); +Deno.test( + { + permissions: { net: true }, + }, + async function fetchWithAuthorizationHeaderRedirection() { + const response = await fetch("http://localhost:4546/echo_server", { + headers: { authorization: "Bearer foo" }, + }); + assertEquals(response.status, 200); + assertEquals(response.statusText, "OK"); + assertEquals(response.url, "http://localhost:4545/echo_server"); + assertEquals(response.headers.get("authorization"), null); + assertEquals(await response.text(), ""); + }, +); + +Deno.test( + { + permissions: { net: true }, + }, + async function fetchWithCookieHeaderRedirection() { + const response = await fetch("http://localhost:4546/echo_server", { + headers: { Cookie: "sessionToken=verySecret" }, + }); + assertEquals(response.status, 200); + assertEquals(response.statusText, "OK"); + assertEquals(response.url, "http://localhost:4545/echo_server"); + assertEquals(response.headers.get("cookie"), null); + assertEquals(await response.text(), ""); + }, +); + +Deno.test( + { + permissions: { net: true }, + }, + async function fetchWithProxyAuthorizationHeaderRedirection() { + const response = await fetch("http://localhost:4546/echo_server", { + headers: { + "proxy-authorization": "Basic ZXNwZW46a29rb3M=", + "accept": "application/json", + }, + }); + assertEquals(response.status, 200); + assertEquals(response.statusText, "OK"); + assertEquals(response.url, "http://localhost:4545/echo_server"); + assertEquals(response.headers.get("proxy-authorization"), null); + assertEquals(response.headers.get("accept"), "application/json"); + assertEquals(await response.text(), ""); + }, +); + Deno.test( { permissions: { net: true } }, async function fetchInitStringBody() { From 02b480b171847a736cca9d396481c4693c3cfe4a Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 25 Nov 2024 17:08:06 -0500 Subject: [PATCH 160/227] fix(compile): do not error embedding same symlink via multiple methods (#27015) Closes https://github.com/denoland/deno/issues/27012 --- cli/standalone/virtual_fs.rs | 4 +-- .../include/symlink_twice/__test__.jsonc | 27 +++++++++++++++++++ .../compile/include/symlink_twice/setup.js | 3 +++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 tests/specs/compile/include/symlink_twice/__test__.jsonc create mode 100644 tests/specs/compile/include/symlink_twice/setup.js diff --git a/cli/standalone/virtual_fs.rs b/cli/standalone/virtual_fs.rs index 5b8076549d..b630f629c5 100644 --- a/cli/standalone/virtual_fs.rs +++ b/cli/standalone/virtual_fs.rs @@ -329,7 +329,7 @@ impl VfsBuilder { let dir = self.add_dir(path.parent().unwrap())?; let name = path.file_name().unwrap().to_string_lossy(); match dir.entries.binary_search_by(|e| e.name().cmp(&name)) { - Ok(_) => unreachable!(), + Ok(_) => Ok(()), // previously inserted Err(insert_index) => { dir.entries.insert( insert_index, @@ -341,9 +341,9 @@ impl VfsBuilder { .collect::>(), }), ); + Ok(()) } } - Ok(()) } pub fn into_dir_and_files(self) -> (VirtualDirectory, Vec>) { diff --git a/tests/specs/compile/include/symlink_twice/__test__.jsonc b/tests/specs/compile/include/symlink_twice/__test__.jsonc new file mode 100644 index 0000000000..ebdf824f43 --- /dev/null +++ b/tests/specs/compile/include/symlink_twice/__test__.jsonc @@ -0,0 +1,27 @@ +{ + "tempDir": true, + "steps": [{ + "args": "run -A setup.js", + "output": "[WILDCARD]" + }, { + "if": "unix", + "args": "compile --allow-read=data --include . --output main link.js", + "output": "[WILDCARD]" + }, { + "if": "unix", + "commandName": "./main", + "args": [], + "output": "1\n", + "exitCode": 0 + }, { + "if": "windows", + "args": "compile --allow-read=data --include . --output main.exe link.js", + "output": "[WILDCARD]" + }, { + "if": "windows", + "commandName": "./main.exe", + "args": [], + "output": "1\n", + "exitCode": 0 + }] +} diff --git a/tests/specs/compile/include/symlink_twice/setup.js b/tests/specs/compile/include/symlink_twice/setup.js new file mode 100644 index 0000000000..3e713dd63e --- /dev/null +++ b/tests/specs/compile/include/symlink_twice/setup.js @@ -0,0 +1,3 @@ +Deno.mkdirSync("data"); +Deno.writeTextFileSync("index.js", "console.log(1);"); +Deno.symlinkSync("index.js", "link.js"); From 2b2644458494ce661fdb6ad0a6f753e04c742fac Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 25 Nov 2024 18:57:05 -0500 Subject: [PATCH 161/227] fix(check): support jsdoc `@import` tag (#26991) * https://github.com/denoland/deno_graph/pull/544 Closes https://github.com/denoland/deno/issues/25516 --- Cargo.lock | 4 ++-- cli/Cargo.toml | 2 +- tests/specs/check/jsdoc_import_decl/__test__.jsonc | 5 +++++ tests/specs/check/jsdoc_import_decl/check.out | 6 ++++++ tests/specs/check/jsdoc_import_decl/main.js | 12 ++++++++++++ 5 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 tests/specs/check/jsdoc_import_decl/__test__.jsonc create mode 100644 tests/specs/check/jsdoc_import_decl/check.out create mode 100644 tests/specs/check/jsdoc_import_decl/main.js diff --git a/Cargo.lock b/Cargo.lock index e7229dcceb..98792c58b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1664,9 +1664,9 @@ dependencies = [ [[package]] name = "deno_graph" -version = "0.85.0" +version = "0.85.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d097305aba3f119781fe82b4d5a85a1ad10c586a388ee4d754e5bf82901cc5c" +checksum = "4c11027d9b4e9ff4f8bcb8316a1a5dd5241dc267380507e177457bc491696189" dependencies = [ "anyhow", "async-trait", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index ce9dbe9230..d1ac3e160e 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -73,7 +73,7 @@ deno_cache_dir.workspace = true deno_config.workspace = true deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_doc = { version = "0.160.0", features = ["rust", "comrak"] } -deno_graph = { version = "=0.85.0" } +deno_graph = { version = "=0.85.1" } deno_lint = { version = "=0.68.0", features = ["docs"] } deno_lockfile.workspace = true deno_npm.workspace = true diff --git a/tests/specs/check/jsdoc_import_decl/__test__.jsonc b/tests/specs/check/jsdoc_import_decl/__test__.jsonc new file mode 100644 index 0000000000..fdbb52ab35 --- /dev/null +++ b/tests/specs/check/jsdoc_import_decl/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check --allow-import main.js", + "output": "check.out", + "exitCode": 1 +} diff --git a/tests/specs/check/jsdoc_import_decl/check.out b/tests/specs/check/jsdoc_import_decl/check.out new file mode 100644 index 0000000000..657569bcd4 --- /dev/null +++ b/tests/specs/check/jsdoc_import_decl/check.out @@ -0,0 +1,6 @@ +Download http://localhost:4545/add.ts +Check file:///[WILDLINE]main.js +error: TS2345 [ERROR]: Argument of type 'string' is not assignable to parameter of type '(a: number, b: number) => number'. +addHere(""); + ~~ + at file:///[WILDLINE]main.js:12:9 diff --git a/tests/specs/check/jsdoc_import_decl/main.js b/tests/specs/check/jsdoc_import_decl/main.js new file mode 100644 index 0000000000..accfdb177a --- /dev/null +++ b/tests/specs/check/jsdoc_import_decl/main.js @@ -0,0 +1,12 @@ +// @ts-check + +/** @import { add } from "http://localhost:4545/add.ts" */ + +/** + * @param {typeof add} myValue + */ +export function addHere(myValue) { + return myValue(1, 2); +} + +addHere(""); From d4fe3311a6acf06113f1b8e86182fa4edfae9212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 26 Nov 2024 03:02:39 +0000 Subject: [PATCH 162/227] fix(task): handle multiline descriptions properly (#27069) Closes https://github.com/denoland/deno/issues/27049 --- cli/tools/task.rs | 8 +++----- tests/specs/task/description/deno.json | 4 ++++ tests/specs/task/description/main.out | 4 ++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cli/tools/task.rs b/cli/tools/task.rs index 478853f4e6..65b78f9c9b 100644 --- a/cli/tools/task.rs +++ b/cli/tools/task.rs @@ -721,11 +721,9 @@ fn print_available_tasks( )?; if let Some(description) = &desc.task.description { let slash_slash = colors::italic_gray("//"); - writeln!( - writer, - " {slash_slash} {}", - colors::italic_gray(description) - )?; + for line in description.split('\n') { + writeln!(writer, " {slash_slash} {}", colors::italic_gray(line))?; + } } writeln!(writer, " {}", desc.task.command)?; if !desc.task.dependencies.is_empty() { diff --git a/tests/specs/task/description/deno.json b/tests/specs/task/description/deno.json index a86b7a5dcb..c8a79c00ee 100644 --- a/tests/specs/task/description/deno.json +++ b/tests/specs/task/description/deno.json @@ -3,6 +3,10 @@ "echo_emoji": { "description": "This is some task", "command": "echo 1" + }, + "multiline_description": { + "description": "This is a multiline\ndescription", + "command": "echo 2" } } } diff --git a/tests/specs/task/description/main.out b/tests/specs/task/description/main.out index ed28506567..91cce4adf8 100644 --- a/tests/specs/task/description/main.out +++ b/tests/specs/task/description/main.out @@ -2,3 +2,7 @@ Available tasks: - echo_emoji // This is some task echo 1 +- multiline_description + // This is a multiline + // description + echo 2 From 114fe9bf3eb1734d3774d603b7ede66433c4ce5a Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Tue, 26 Nov 2024 05:57:51 +0000 Subject: [PATCH 163/227] fix(lsp): support task object notation for tasks request (#27076) --- cli/lsp/language_server.rs | 9 +++------ cli/lsp/lsp_custom.rs | 2 -- cli/lsp/mod.rs | 3 --- tests/integration/lsp_tests.rs | 31 ++++++++++++++++++------------- 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index cbe194e14e..9a9531eded 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -3781,14 +3781,11 @@ impl Inner { fn task_definitions(&self) -> LspResult> { let mut result = vec![]; for config_file in self.config.tree.config_files() { - if let Some(tasks) = json!(&config_file.json.tasks).as_object() { - for (name, value) in tasks { - let Some(command) = value.as_str() else { - continue; - }; + if let Some(tasks) = config_file.to_tasks_config().ok().flatten() { + for (name, def) in tasks { result.push(TaskDefinition { name: name.clone(), - command: command.to_string(), + command: def.command.clone(), source_uri: url_to_uri(&config_file.specifier) .map_err(|_| LspError::internal_error())?, }); diff --git a/cli/lsp/lsp_custom.rs b/cli/lsp/lsp_custom.rs index b570b6d0e2..74c6aca88b 100644 --- a/cli/lsp/lsp_custom.rs +++ b/cli/lsp/lsp_custom.rs @@ -14,8 +14,6 @@ pub const LATEST_DIAGNOSTIC_BATCH_INDEX: &str = #[serde(rename_all = "camelCase")] pub struct TaskDefinition { pub name: String, - // TODO(nayeemrmn): Rename this to `command` in vscode_deno. - #[serde(rename = "detail")] pub command: String, pub source_uri: lsp::Uri, } diff --git a/cli/lsp/mod.rs b/cli/lsp/mod.rs index 79aa4d8f07..afb949f68d 100644 --- a/cli/lsp/mod.rs +++ b/cli/lsp/mod.rs @@ -56,9 +56,6 @@ pub async fn start() -> Result<(), AnyError> { LanguageServer::performance_request, ) .custom_method(lsp_custom::TASK_REQUEST, LanguageServer::task_definitions) - // TODO(nayeemrmn): Rename this to `deno/taskDefinitions` in vscode_deno and - // remove this alias. - .custom_method("deno/task", LanguageServer::task_definitions) .custom_method(testing::TEST_RUN_REQUEST, LanguageServer::test_run_request) .custom_method( testing::TEST_RUN_CANCEL_REQUEST, diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index b716aa921e..9ccd33c995 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -1360,26 +1360,31 @@ fn lsp_deno_task() { let temp_dir = context.temp_dir(); temp_dir.write( "deno.jsonc", - r#"{ - "tasks": { - "build": "deno test" - } - }"#, + json!({ + "tasks": { + "build": "deno test", + "serve": { + "description": "Start the dev server", + "command": "deno run -RN server.ts", + }, + }, + }) + .to_string(), ); - let mut client = context.new_lsp_command().build(); - client.initialize(|builder| { - builder.set_config("./deno.jsonc"); - }); - - let res = client.write_request("deno/task", json!(null)); - + client.initialize_default(); + let res = client.write_request("deno/taskDefinitions", json!(null)); assert_eq!( res, json!([ { "name": "build", - "detail": "deno test", + "command": "deno test", + "sourceUri": temp_dir.url().join("deno.jsonc").unwrap(), + }, + { + "name": "serve", + "command": "deno run -RN server.ts", "sourceUri": temp_dir.url().join("deno.jsonc").unwrap(), } ]) From e61cf8d7d6fd157b3d9f166d788626457ff329ba Mon Sep 17 00:00:00 2001 From: snek Date: Tue, 26 Nov 2024 12:22:18 +0100 Subject: [PATCH 164/227] refactor(unstable): move telemetry to own ext (#27067) Move telemetry to its own ext to clean up some code and resolve circular deps. --- Cargo.lock | 30 ++++++++++---- Cargo.toml | 2 + cli/Cargo.toml | 1 + cli/args/flags.rs | 6 +-- cli/args/mod.rs | 2 +- cli/main.rs | 2 +- cli/mainrt.rs | 2 +- cli/standalone/binary.rs | 2 +- cli/util/logger.rs | 2 +- cli/worker.rs | 2 +- ext/fetch/26_fetch.js | 44 ++++++++++----------- ext/http/00_serve.ts | 31 ++++++--------- ext/telemetry/Cargo.toml | 31 +++++++++++++++ ext/telemetry/README.md | 3 ++ runtime/ops/otel.rs => ext/telemetry/lib.rs | 25 ++++++++++-- {runtime/js => ext/telemetry}/telemetry.ts | 13 +----- ext/telemetry/util.ts | 27 +++++++++++++ runtime/Cargo.toml | 8 +--- runtime/js/90_deno_ns.js | 2 +- runtime/js/99_main.js | 2 +- runtime/lib.rs | 2 +- runtime/ops/mod.rs | 1 - runtime/shared.rs | 1 - runtime/snapshot.rs | 2 +- runtime/web_worker.rs | 2 +- runtime/worker.rs | 2 +- runtime/worker_bootstrap.rs | 2 +- tools/core_import_map.json | 3 +- 28 files changed, 164 insertions(+), 88 deletions(-) create mode 100644 ext/telemetry/Cargo.toml create mode 100644 ext/telemetry/README.md rename runtime/ops/otel.rs => ext/telemetry/lib.rs (96%) rename {runtime/js => ext/telemetry}/telemetry.ts (98%) create mode 100644 ext/telemetry/util.ts diff --git a/Cargo.lock b/Cargo.lock index 98792c58b4..00b4da07cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1233,6 +1233,7 @@ dependencies = [ "deno_runtime", "deno_semver", "deno_task_shell", + "deno_telemetry", "deno_terminal 0.2.0", "deno_tower_lsp", "dhat", @@ -2063,7 +2064,6 @@ dependencies = [ name = "deno_runtime" version = "0.188.0" dependencies = [ - "async-trait", "color-print", "deno_ast", "deno_broadcast_channel", @@ -2084,6 +2084,7 @@ dependencies = [ "deno_node", "deno_path_util", "deno_permissions", + "deno_telemetry", "deno_terminal 0.2.0", "deno_tls", "deno_url", @@ -2109,13 +2110,7 @@ dependencies = [ "notify", "ntapi", "once_cell", - "opentelemetry", - "opentelemetry-http", - "opentelemetry-otlp", - "opentelemetry-semantic-conventions", - "opentelemetry_sdk", "percent-encoding", - "pin-project", "regex", "rustyline", "same-file", @@ -2164,6 +2159,27 @@ dependencies = [ "tokio-util", ] +[[package]] +name = "deno_telemetry" +version = "0.1.0" +dependencies = [ + "async-trait", + "deno_core", + "http-body-util", + "hyper 1.4.1", + "hyper-util", + "log", + "once_cell", + "opentelemetry", + "opentelemetry-http", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions", + "opentelemetry_sdk", + "pin-project", + "serde", + "tokio", +] + [[package]] name = "deno_terminal" version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index f72d3c80d3..3fa7a2164a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,7 @@ members = [ "ext/napi/sym", "ext/net", "ext/node", + "ext/telemetry", "ext/url", "ext/web", "ext/webgpu", @@ -82,6 +83,7 @@ deno_kv = { version = "0.87.0", path = "./ext/kv" } deno_napi = { version = "0.110.0", path = "./ext/napi" } deno_net = { version = "0.171.0", path = "./ext/net" } deno_node = { version = "0.116.0", path = "./ext/node" } +deno_telemetry = { version = "0.1.0", path = "./ext/telemetry" } deno_tls = { version = "0.166.0", path = "./ext/tls" } deno_url = { version = "0.179.0", path = "./ext/url" } deno_web = { version = "0.210.0", path = "./ext/web" } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index d1ac3e160e..96bb206d0f 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -83,6 +83,7 @@ deno_resolver.workspace = true deno_runtime = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_semver.workspace = true deno_task_shell = "=0.18.1" +deno_telemetry.workspace = true deno_terminal.workspace = true libsui = "0.5.0" node_resolver.workspace = true diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 5e89f88a91..dde4a8ab77 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -36,7 +36,7 @@ use deno_path_util::normalize_path; use deno_path_util::url_to_file_path; use deno_runtime::deno_permissions::PermissionsOptions; use deno_runtime::deno_permissions::SysDescriptor; -use deno_runtime::ops::otel::OtelConfig; +use deno_telemetry::OtelConfig; use log::debug; use log::Level; use serde::Deserialize; @@ -2662,7 +2662,7 @@ By default, outdated dependencies are only displayed. Display outdated dependencies: deno outdated deno outdated --compatible - + Update dependencies: deno outdated --update deno outdated --update --latest @@ -3047,7 +3047,7 @@ fn task_subcommand() -> Command { List all available tasks: deno task - + Evaluate a task from string deno task --eval \"echo $(pwd)\"" ), diff --git a/cli/args/mod.rs b/cli/args/mod.rs index a1a9c49cbe..0914999411 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -28,8 +28,8 @@ use deno_npm::npm_rc::ResolvedNpmRc; use deno_npm::resolution::ValidSerializedNpmResolutionSnapshot; use deno_npm::NpmSystemInfo; use deno_path_util::normalize_path; -use deno_runtime::ops::otel::OtelConfig; use deno_semver::npm::NpmPackageReqReference; +use deno_telemetry::OtelConfig; use import_map::resolve_import_map_value_from_specifier; pub use deno_config::deno_json::BenchConfig; diff --git a/cli/main.rs b/cli/main.rs index c49c8a83a6..d47f1e363c 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -448,7 +448,7 @@ fn resolve_flags_and_init( }; if let Some(otel_config) = flags.otel_config() { - deno_runtime::ops::otel::init(otel_config)?; + deno_telemetry::init(otel_config)?; } util::logger::init(flags.log_level); diff --git a/cli/mainrt.rs b/cli/mainrt.rs index 2951aa711a..7ad3b3744b 100644 --- a/cli/mainrt.rs +++ b/cli/mainrt.rs @@ -88,7 +88,7 @@ fn main() { match standalone { Ok(Some(data)) => { if let Some(otel_config) = data.metadata.otel_config.clone() { - deno_runtime::ops::otel::init(otel_config)?; + deno_telemetry::init(otel_config)?; } util::logger::init(data.metadata.log_level); load_env_vars(&data.metadata.env_vars_from_env_file); diff --git a/cli/standalone/binary.rs b/cli/standalone/binary.rs index 791f5052c0..b07b8e0823 100644 --- a/cli/standalone/binary.rs +++ b/cli/standalone/binary.rs @@ -47,11 +47,11 @@ use deno_runtime::deno_fs::FileSystem; use deno_runtime::deno_fs::RealFs; use deno_runtime::deno_io::fs::FsError; use deno_runtime::deno_node::PackageJson; -use deno_runtime::ops::otel::OtelConfig; use deno_semver::npm::NpmVersionReqParseError; use deno_semver::package::PackageReq; use deno_semver::Version; use deno_semver::VersionReqSpecifierParseError; +use deno_telemetry::OtelConfig; use indexmap::IndexMap; use log::Level; use serde::Deserialize; diff --git a/cli/util/logger.rs b/cli/util/logger.rs index f76663df2c..2b8987c3e7 100644 --- a/cli/util/logger.rs +++ b/cli/util/logger.rs @@ -29,7 +29,7 @@ impl log::Log for CliLogger { // thread's state DrawThread::hide(); self.0.log(record); - deno_runtime::ops::otel::handle_log(record); + deno_telemetry::handle_log(record); DrawThread::show(); } } diff --git a/cli/worker.rs b/cli/worker.rs index 5761571c5c..e79ed61422 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -30,7 +30,6 @@ use deno_runtime::deno_tls::RootCertStoreProvider; use deno_runtime::deno_web::BlobStore; use deno_runtime::fmt_errors::format_js_error; use deno_runtime::inspector_server::InspectorServer; -use deno_runtime::ops::otel::OtelConfig; use deno_runtime::ops::process::NpmProcessStateProviderRc; use deno_runtime::ops::worker_host::CreateWebWorkerCb; use deno_runtime::web_worker::WebWorker; @@ -43,6 +42,7 @@ use deno_runtime::BootstrapOptions; use deno_runtime::WorkerExecutionMode; use deno_runtime::WorkerLogLevel; use deno_semver::npm::NpmPackageReqReference; +use deno_telemetry::OtelConfig; use deno_terminal::colors; use node_resolver::NodeModuleKind; use node_resolver::NodeResolutionMode; diff --git a/ext/fetch/26_fetch.js b/ext/fetch/26_fetch.js index 3a77f6075e..12b9c4582b 100644 --- a/ext/fetch/26_fetch.js +++ b/ext/fetch/26_fetch.js @@ -10,7 +10,7 @@ /// /// -import { core, internals, primordials } from "ext:core/mod.js"; +import { core, primordials } from "ext:core/mod.js"; import { op_fetch, op_fetch_promise_is_settled, @@ -32,7 +32,6 @@ const { SafePromisePrototypeFinally, String, StringPrototypeEndsWith, - StringPrototypeSlice, StringPrototypeStartsWith, StringPrototypeToLowerCase, TypeError, @@ -59,6 +58,17 @@ import { toInnerResponse, } from "ext:deno_fetch/23_response.js"; import * as abortSignal from "ext:deno_web/03_abort_signal.js"; +import { + endSpan, + enterSpan, + exitSpan, + Span, + TRACING_ENABLED, +} from "ext:deno_telemetry/telemetry.ts"; +import { + updateSpanFromRequest, + updateSpanFromResponse, +} from "ext:deno_telemetry/util.ts"; const REQUEST_BODY_HEADER_NAMES = [ "content-encoding", @@ -343,9 +353,9 @@ function httpRedirectFetch(request, response, terminator) { function fetch(input, init = { __proto__: null }) { let span; try { - if (internals.telemetry?.tracingEnabled) { - span = new internals.telemetry.Span("fetch", { kind: 2 }); - internals.telemetry.enterSpan(span); + if (TRACING_ENABLED) { + span = new Span("fetch", { kind: 2 }); + enterSpan(span); } // There is an async dispatch later that causes a stack trace disconnect. @@ -361,16 +371,7 @@ function fetch(input, init = { __proto__: null }) { const requestObject = new Request(input, init); if (span) { - span.updateName(requestObject.method); - span.setAttribute("http.request.method", requestObject.method); - const url = new URL(requestObject.url); - span.setAttribute("url.full", requestObject.url); - span.setAttribute( - "url.scheme", - StringPrototypeSlice(url.protocol, 0, -1), - ); - span.setAttribute("url.path", url.pathname); - span.setAttribute("url.query", StringPrototypeSlice(url.search, 1)); + updateSpanFromRequest(span, requestObject); } // 3. @@ -432,10 +433,7 @@ function fetch(input, init = { __proto__: null }) { responseObject = fromInnerResponse(response, "immutable"); if (span) { - span.setAttribute( - "http.response.status_code", - String(responseObject.status), - ); + updateSpanFromResponse(span, responseObject); } resolve(responseObject); @@ -457,7 +455,7 @@ function fetch(input, init = { __proto__: null }) { return result; } finally { if (span) { - internals.telemetry.endSpan(span); + endSpan(span); } } })(); @@ -471,18 +469,18 @@ function fetch(input, init = { __proto__: null }) { // XXX: This should always be true, otherwise `opPromise` would be present. if (op_fetch_promise_is_settled(result)) { // It's already settled. - internals.telemetry.endSpan(span); + endSpan(span); } else { // Not settled yet, we can return a new wrapper promise. return SafePromisePrototypeFinally(result, () => { - internals.telemetry.endSpan(span); + endSpan(span); }); } } return result; } finally { if (span) { - internals.telemetry.exitSpan(span); + exitSpan(span); } } } diff --git a/ext/http/00_serve.ts b/ext/http/00_serve.ts index 027c2710b2..446533e910 100644 --- a/ext/http/00_serve.ts +++ b/ext/http/00_serve.ts @@ -36,9 +36,7 @@ const { PromisePrototypeCatch, SafePromisePrototypeFinally, PromisePrototypeThen, - String, StringPrototypeIncludes, - StringPrototypeSlice, Symbol, TypeError, TypedArrayPrototypeGetSymbolToStringTag, @@ -91,6 +89,16 @@ import { } from "ext:deno_net/01_net.js"; import { hasTlsKeyPairOptions, listenTls } from "ext:deno_net/02_tls.js"; import { SymbolAsyncDispose } from "ext:deno_web/00_infra.js"; +import { + endSpan, + enterSpan, + Span, + TRACING_ENABLED, +} from "ext:deno_telemetry/telemetry.ts"; +import { + updateSpanFromRequest, + updateSpanFromResponse, +} from "ext:deno_telemetry/util.ts"; const _upgraded = Symbol("_upgraded"); @@ -527,16 +535,7 @@ function mapToCallback(context, callback, onError) { innerRequest.request = request; if (span) { - span.updateName(request.method); - span.setAttribute("http.request.method", request.method); - const url = new URL(request.url); - span.setAttribute("url.full", request.url); - span.setAttribute( - "url.scheme", - StringPrototypeSlice(url.protocol, 0, -1), - ); - span.setAttribute("url.path", url.pathname); - span.setAttribute("url.query", StringPrototypeSlice(url.search, 1)); + updateSpanFromRequest(span, request); } response = await callback( @@ -578,10 +577,7 @@ function mapToCallback(context, callback, onError) { } if (span) { - span.setAttribute( - "http.response.status_code", - String(response.status), - ); + updateSpanFromResponse(span, response); } const inner = toInnerResponse(response); @@ -617,8 +613,7 @@ function mapToCallback(context, callback, onError) { fastSyncResponseOrStream(req, inner.body, status, innerRequest); }; - if (internals.telemetry?.tracingEnabled) { - const { Span, enterSpan, endSpan } = internals.telemetry; + if (TRACING_ENABLED) { const origMapped = mapped; mapped = function (req, _span) { const oldCtx = getAsyncContext(); diff --git a/ext/telemetry/Cargo.toml b/ext/telemetry/Cargo.toml new file mode 100644 index 0000000000..6e0c40e873 --- /dev/null +++ b/ext/telemetry/Cargo.toml @@ -0,0 +1,31 @@ +# Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +[package] +name = "deno_telemetry" +version = "0.1.0" +authors.workspace = true +edition.workspace = true +license.workspace = true +readme = "README.md" +repository.workspace = true +description = "Telemetry for Deno" + +[lib] +path = "lib.rs" + +[dependencies] +async-trait.workspace = true +deno_core.workspace = true +http-body-util.workspace = true +hyper.workspace = true +hyper-util.workspace = true +log.workspace = true +once_cell.workspace = true +opentelemetry.workspace = true +opentelemetry-http.workspace = true +opentelemetry-otlp.workspace = true +opentelemetry-semantic-conventions.workspace = true +opentelemetry_sdk.workspace = true +pin-project.workspace = true +serde.workspace = true +tokio.workspace = true diff --git a/ext/telemetry/README.md b/ext/telemetry/README.md new file mode 100644 index 0000000000..6931a3b896 --- /dev/null +++ b/ext/telemetry/README.md @@ -0,0 +1,3 @@ +# `deno_telemetry` + +This crate implements telemetry for Deno using OpenTelemetry. diff --git a/runtime/ops/otel.rs b/ext/telemetry/lib.rs similarity index 96% rename from runtime/ops/otel.rs rename to ext/telemetry/lib.rs index 19f09d9f6d..1ce8ac1dcc 100644 --- a/runtime/ops/otel.rs +++ b/ext/telemetry/lib.rs @@ -1,6 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -use crate::tokio_util::create_basic_runtime; use deno_core::anyhow; use deno_core::anyhow::anyhow; use deno_core::futures::channel::mpsc; @@ -59,7 +58,7 @@ type SpanProcessor = BatchSpanProcessor; type LogProcessor = BatchLogProcessor; deno_core::extension!( - deno_otel, + deno_telemetry, ops = [ op_otel_log, op_otel_instrumentation_scope_create_and_enter, @@ -73,6 +72,7 @@ deno_core::extension!( op_otel_span_set_dropped, op_otel_span_flush, ], + esm = ["telemetry.ts", "util.ts"], ); #[derive(Debug, Clone, Serialize, Deserialize)] @@ -111,7 +111,26 @@ fn otel_create_shared_runtime() -> UnboundedSender> { mpsc::unbounded::>(); thread::spawn(move || { - let rt = create_basic_runtime(); + let rt = tokio::runtime::Builder::new_current_thread() + .enable_io() + .enable_time() + // This limits the number of threads for blocking operations (like for + // synchronous fs ops) or CPU bound tasks like when we run dprint in + // parallel for deno fmt. + // The default value is 512, which is an unhelpfully large thread pool. We + // don't ever want to have more than a couple dozen threads. + .max_blocking_threads(if cfg!(windows) { + // on windows, tokio uses blocking tasks for child process IO, make sure + // we have enough available threads for other tasks to run + 4 * std::thread::available_parallelism() + .map(|n| n.get()) + .unwrap_or(8) + } else { + 32 + }) + .build() + .unwrap(); + rt.block_on(async move { while let Some(task) = spawn_task_rx.next().await { tokio::spawn(task); diff --git a/runtime/js/telemetry.ts b/ext/telemetry/telemetry.ts similarity index 98% rename from runtime/js/telemetry.ts rename to ext/telemetry/telemetry.ts index a98e5b0a19..03fbd83e2f 100644 --- a/runtime/js/telemetry.ts +++ b/ext/telemetry/telemetry.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { core, internals, primordials } from "ext:core/mod.js"; +import { core, primordials } from "ext:core/mod.js"; import { op_crypto_get_random_values, op_otel_instrumentation_scope_create_and_enter, @@ -38,7 +38,7 @@ const { } = primordials; const { AsyncVariable, setAsyncContext } = core; -let TRACING_ENABLED = false; +export let TRACING_ENABLED = false; let DETERMINISTIC = false; // Note: These start at 0 in the JS library, @@ -709,12 +709,3 @@ export const telemetry = { SpanExporter, ContextManager, }; -internals.telemetry = { - Span, - enterSpan, - exitSpan, - endSpan, - get tracingEnabled() { - return TRACING_ENABLED; - }, -}; diff --git a/ext/telemetry/util.ts b/ext/telemetry/util.ts new file mode 100644 index 0000000000..7e30d5d859 --- /dev/null +++ b/ext/telemetry/util.ts @@ -0,0 +1,27 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +import { primordials } from "ext:core/mod.js"; +import type { Span } from "ext:deno_telemetry/telemetry.ts"; + +const { String, StringPrototypeSlice } = primordials; + +export function updateSpanFromRequest(span: Span, request: Request) { + span.updateName(request.method); + + span.setAttribute("http.request.method", request.method); + const url = new URL(request.url); + span.setAttribute("url.full", request.url); + span.setAttribute( + "url.scheme", + StringPrototypeSlice(url.protocol, 0, -1), + ); + span.setAttribute("url.path", url.pathname); + span.setAttribute("url.query", StringPrototypeSlice(url.search, 1)); +} + +export function updateSpanFromResponse(span: Span, response: Response) { + span.setAttribute( + "http.response.status_code", + String(response.status), + ); +} diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 94fe4ce02b..1b960c2bdb 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -90,6 +90,7 @@ deno_net.workspace = true deno_node.workspace = true deno_path_util.workspace = true deno_permissions.workspace = true +deno_telemetry.workspace = true deno_terminal.workspace = true deno_tls.workspace = true deno_url.workspace = true @@ -100,7 +101,6 @@ deno_websocket.workspace = true deno_webstorage.workspace = true node_resolver = { workspace = true, features = ["sync"] } -async-trait.workspace = true color-print.workspace = true dlopen2.workspace = true encoding_rs.workspace = true @@ -115,13 +115,7 @@ log.workspace = true netif = "0.1.6" notify.workspace = true once_cell.workspace = true -opentelemetry.workspace = true -opentelemetry-http.workspace = true -opentelemetry-otlp.workspace = true -opentelemetry-semantic-conventions.workspace = true -opentelemetry_sdk.workspace = true percent-encoding.workspace = true -pin-project.workspace = true regex.workspace = true rustyline = { workspace = true, features = ["custom-bindings"] } same-file = "1.0.6" diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index 6300f599d9..a510ee33c4 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -29,7 +29,7 @@ import * as tty from "ext:runtime/40_tty.js"; import * as kv from "ext:deno_kv/01_db.ts"; import * as cron from "ext:deno_cron/01_cron.ts"; import * as webgpuSurface from "ext:deno_webgpu/02_surface.js"; -import * as telemetry from "ext:runtime/telemetry.ts"; +import * as telemetry from "ext:deno_telemetry/telemetry.ts"; const denoNs = { Process: process.Process, diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index eedca3396e..e3b14fdafa 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -86,7 +86,7 @@ import { workerRuntimeGlobalProperties, } from "ext:runtime/98_global_scope_worker.js"; import { SymbolDispose, SymbolMetadata } from "ext:deno_web/00_infra.js"; -import { bootstrap as bootstrapOtel } from "ext:runtime/telemetry.ts"; +import { bootstrap as bootstrapOtel } from "ext:deno_telemetry/telemetry.ts"; // deno-lint-ignore prefer-primordials if (Symbol.metadata) { diff --git a/runtime/lib.rs b/runtime/lib.rs index a6e60ced18..53d4f265e0 100644 --- a/runtime/lib.rs +++ b/runtime/lib.rs @@ -148,7 +148,7 @@ pub static UNSTABLE_GRANULAR_FLAGS: &[UnstableGranularFlag] = &[ ]; pub fn exit(code: i32) -> ! { - crate::ops::otel::flush(); + deno_telemetry::flush(); #[allow(clippy::disallowed_methods)] std::process::exit(code); } diff --git a/runtime/ops/mod.rs b/runtime/ops/mod.rs index c2e402f33c..67065b901b 100644 --- a/runtime/ops/mod.rs +++ b/runtime/ops/mod.rs @@ -4,7 +4,6 @@ pub mod bootstrap; pub mod fs_events; pub mod http; pub mod os; -pub mod otel; pub mod permissions; pub mod process; pub mod runtime; diff --git a/runtime/shared.rs b/runtime/shared.rs index b1f383b03d..f7d76f67a7 100644 --- a/runtime/shared.rs +++ b/runtime/shared.rs @@ -47,7 +47,6 @@ extension!(runtime, "40_signals.js", "40_tty.js", "41_prompt.js", - "telemetry.ts", "90_deno_ns.js", "98_global_scope_shared.js", "98_global_scope_window.js", diff --git a/runtime/snapshot.rs b/runtime/snapshot.rs index 3bf515131f..48c500ef74 100644 --- a/runtime/snapshot.rs +++ b/runtime/snapshot.rs @@ -268,6 +268,7 @@ pub fn create_runtime_snapshot( // `runtime/worker.rs`, `runtime/web_worker.rs` and `runtime/snapshot.rs`! let fs = std::sync::Arc::new(deno_fs::RealFs); let mut extensions: Vec = vec![ + deno_telemetry::deno_telemetry::init_ops_and_esm(), deno_webidl::deno_webidl::init_ops_and_esm(), deno_console::deno_console::init_ops_and_esm(), deno_url::deno_url::init_ops_and_esm(), @@ -314,7 +315,6 @@ pub fn create_runtime_snapshot( ), ops::fs_events::deno_fs_events::init_ops(), ops::os::deno_os::init_ops(Default::default()), - ops::otel::deno_otel::init_ops(), ops::permissions::deno_permissions::init_ops(), ops::process::deno_process::init_ops(None), ops::signal::deno_signal::init_ops(), diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs index 214ae59c80..e3a69b39c0 100644 --- a/runtime/web_worker.rs +++ b/runtime/web_worker.rs @@ -440,6 +440,7 @@ impl WebWorker { // `runtime/worker.rs` and `runtime/snapshot.rs`! let mut extensions = vec![ + deno_telemetry::deno_telemetry::init_ops_and_esm(), // Web APIs deno_webidl::deno_webidl::init_ops_and_esm(), deno_console::deno_console::init_ops_and_esm(), @@ -517,7 +518,6 @@ impl WebWorker { ), ops::fs_events::deno_fs_events::init_ops_and_esm(), ops::os::deno_os_worker::init_ops_and_esm(), - ops::otel::deno_otel::init_ops_and_esm(), ops::permissions::deno_permissions::init_ops_and_esm(), ops::process::deno_process::init_ops_and_esm( services.npm_process_state_provider, diff --git a/runtime/worker.rs b/runtime/worker.rs index 65fc99c766..46fbd7b43f 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -348,6 +348,7 @@ impl MainWorker { // NOTE(bartlomieju): ordering is important here, keep it in sync with // `runtime/web_worker.rs` and `runtime/snapshot.rs`! let mut extensions = vec![ + deno_telemetry::deno_telemetry::init_ops_and_esm(), // Web APIs deno_webidl::deno_webidl::init_ops_and_esm(), deno_console::deno_console::init_ops_and_esm(), @@ -428,7 +429,6 @@ impl MainWorker { ), ops::fs_events::deno_fs_events::init_ops_and_esm(), ops::os::deno_os::init_ops_and_esm(exit_code.clone()), - ops::otel::deno_otel::init_ops_and_esm(), ops::permissions::deno_permissions::init_ops_and_esm(), ops::process::deno_process::init_ops_and_esm( services.npm_process_state_provider, diff --git a/runtime/worker_bootstrap.rs b/runtime/worker_bootstrap.rs index 3f5c245a0f..4a8c5dba86 100644 --- a/runtime/worker_bootstrap.rs +++ b/runtime/worker_bootstrap.rs @@ -1,8 +1,8 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -use crate::ops::otel::OtelConfig; use deno_core::v8; use deno_core::ModuleSpecifier; +use deno_telemetry::OtelConfig; use serde::Serialize; use std::cell::RefCell; use std::thread; diff --git a/tools/core_import_map.json b/tools/core_import_map.json index 38ffe55858..bc0674277e 100644 --- a/tools/core_import_map.json +++ b/tools/core_import_map.json @@ -247,8 +247,9 @@ "ext:runtime/41_prompt.js": "../runtime/js/41_prompt.js", "ext:runtime/90_deno_ns.js": "../runtime/js/90_deno_ns.js", "ext:runtime/98_global_scope.js": "../runtime/js/98_global_scope.js", - "ext:runtime/telemetry.ts": "../runtime/js/telemetry.ts", "ext:deno_node/_util/std_fmt_colors.ts": "../ext/node/polyfills/_util/std_fmt_colors.ts", + "ext:deno_telemetry/telemetry.ts": "../ext/deno_telemetry/telemetry.ts", + "ext:deno_telemetry/util.ts": "../ext/deno_telemetry/util.ts", "@std/archive": "../tests/util/std/archive/mod.ts", "@std/archive/tar": "../tests/util/std/archive/tar.ts", "@std/archive/untar": "../tests/util/std/archive/untar.ts", From 584631d28135cdc82e2781cbf56d12683181fce5 Mon Sep 17 00:00:00 2001 From: hongmengning Date: Tue, 26 Nov 2024 20:07:40 +0800 Subject: [PATCH 165/227] docs(cli): remove redundant word in comment (#27055) --- cli/util/fs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/util/fs.rs b/cli/util/fs.rs index d36c02242c..ba84a0e8f3 100644 --- a/cli/util/fs.rs +++ b/cli/util/fs.rs @@ -659,7 +659,7 @@ impl LaxSingleProcessFsFlag { // // This uses a blocking task because we use a single threaded // runtime and this is time sensitive so we don't want it to update - // at the whims of of whatever is occurring on the runtime thread. + // at the whims of whatever is occurring on the runtime thread. spawn_blocking({ let token = token.clone(); let last_updated_path = last_updated_path.clone(); From 4f776a7d491e3d933f78c01fd9c596d6bf90397e Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Tue, 26 Nov 2024 22:51:57 +0900 Subject: [PATCH 166/227] chore: update node_compat setup script, show remaining percentage (#27053) --- tests/node_compat/runner/TODO.md | 2 ++ tests/node_compat/runner/setup.ts | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/node_compat/runner/TODO.md b/tests/node_compat/runner/TODO.md index 135d45dd8f..ef1f36840a 100644 --- a/tests/node_compat/runner/TODO.md +++ b/tests/node_compat/runner/TODO.md @@ -1,6 +1,8 @@ # Remaining Node Tests +594 tests out of 3681 have been ported from Node 20.11.1 (16.14% ported, 83.97% remaining). + NOTE: This file should not be manually edited. Please edit `tests/node_compat/config.json` and run `deno task setup` in `tests/node_compat/runner` dir instead. - [abort/test-abort-backtrace.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-abort-backtrace.js) diff --git a/tests/node_compat/runner/setup.ts b/tests/node_compat/runner/setup.ts index 5daa42df76..32c0e2a63a 100755 --- a/tests/node_compat/runner/setup.ts +++ b/tests/node_compat/runner/setup.ts @@ -74,15 +74,24 @@ async function updateToDo() { truncate: true, }); - const missingTests = withoutAll(await getNodeTests(), await getDenoTests()); + const nodeTests = await getNodeTests(); + const portedTests = getDenoTests(); + const remainingTests = withoutAll(nodeTests, portedTests); + const numPorted = portedTests.length; + const numMissing = remainingTests.length; + const numTotal = nodeTests.length; + const portedPercentage = (numPorted / numTotal * 100).toFixed(2); + const remainingPercentage = (numMissing / numTotal * 100).toFixed(2); await file.write(encoder.encode(` # Remaining Node Tests +${numPorted} tests out of ${numTotal} have been ported from Node ${NODE_VERSION} (${portedPercentage}% ported, ${remainingPercentage}% remaining). + NOTE: This file should not be manually edited. Please edit \`tests/node_compat/config.json\` and run \`deno task setup\` in \`tests/node_compat/runner\` dir instead. `)); - for (const test of missingTests) { + for (const test of remainingTests) { await file.write( encoder.encode( `- [${test}](https://github.com/nodejs/node/tree/v${NODE_VERSION}/test/${test})\n`, From 4c567677bf4d7ec4b97c14590fd76f2dc9fcd04b Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 26 Nov 2024 09:19:13 -0500 Subject: [PATCH 167/227] chore(node/tests): increase tolerance of timers test on CI (#27077) Increases the tolerance of the interval test on the CI. --- tests/unit_node/timers_test.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/unit_node/timers_test.ts b/tests/unit_node/timers_test.ts index ddc6dc0d85..10c42e892c 100644 --- a/tests/unit_node/timers_test.ts +++ b/tests/unit_node/timers_test.ts @@ -118,7 +118,7 @@ Deno.test({ expectedValue: 42, intervalMs: 100, iterations: 3, - tolerancePercent: 50, + tolerancePercent: Deno.env.get("CI") != null ? 75 : 50, }; const { setInterval } = timersPromises; @@ -200,6 +200,7 @@ Deno.test({ const INTERVAL_MS = 500; const TOTAL_DURATION_MS = 3000; const TOLERANCE_MS = 500; + const DELTA_TOLERANCE_MS = Deno.env.get("CI") != null ? 100 : 50; const abortController = new AbortController(); const { setInterval } = timersPromises; @@ -247,14 +248,14 @@ Deno.test({ ); intervalDeltas.forEach((delta, i) => { - const isIntervalValid = delta >= (INTERVAL_MS - 50) && - delta <= (INTERVAL_MS + 50); + const isIntervalValid = delta >= (INTERVAL_MS - DELTA_TOLERANCE_MS) && + delta <= (INTERVAL_MS + DELTA_TOLERANCE_MS); assertEquals( isIntervalValid, true, `Interval ${ i + 1 - } duration (${delta}ms) should be within ±50ms of ${INTERVAL_MS}ms`, + } duration (${delta}ms) should be within ±${DELTA_TOLERANCE_MS}ms of ${INTERVAL_MS}ms`, ); }); }, From 3a55b6781510d496c6da24e166f6e3c38b91138b Mon Sep 17 00:00:00 2001 From: Ian Bull Date: Tue, 26 Nov 2024 06:23:09 -0800 Subject: [PATCH 168/227] chore(compile): prefer denort binary in target/ directory when available (#27052) Enhances the deno compile workflow for denort development by automatically checking for a denort binary in the same directory as the deno binary, provided both are located within a target/ directory. If found, this denort binary will be used. Key points: - The DENORT_BIN environment variable remains supported for explicitly specifying a custom denort binary path. - Includes additional logic to verify if the deno binary is a symlink pointing to an executable in the target/ directory. --------- Signed-off-by: Ian Bull --- cli/standalone/binary.rs | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/cli/standalone/binary.rs b/cli/standalone/binary.rs index b07b8e0823..6f85266b05 100644 --- a/cli/standalone/binary.rs +++ b/cli/standalone/binary.rs @@ -4,6 +4,7 @@ use std::borrow::Cow; use std::collections::BTreeMap; use std::collections::HashMap; use std::collections::VecDeque; +use std::env; use std::env::current_exe; use std::ffi::OsString; use std::fs; @@ -15,6 +16,7 @@ use std::io::Seek; use std::io::SeekFrom; use std::io::Write; use std::ops::Range; +use std::path::Component; use std::path::Path; use std::path::PathBuf; use std::process::Command; @@ -457,7 +459,7 @@ impl<'a> DenoCompileBinaryWriter<'a> { // // Phase 2 of the 'min sized' deno compile RFC talks // about adding this as a flag. - if let Some(path) = std::env::var_os("DENORT_BIN") { + if let Some(path) = get_dev_binary_path() { return std::fs::read(&path).with_context(|| { format!("Could not find denort at '{}'", path.to_string_lossy()) }); @@ -908,6 +910,31 @@ impl<'a> DenoCompileBinaryWriter<'a> { } } +fn get_denort_path(deno_exe: PathBuf) -> Option { + let mut denort = deno_exe; + denort.set_file_name(if cfg!(windows) { + "denort.exe" + } else { + "denort" + }); + denort.exists().then(|| denort.into_os_string()) +} + +fn get_dev_binary_path() -> Option { + env::var_os("DENORT_BIN").or_else(|| { + env::current_exe().ok().and_then(|exec_path| { + if exec_path + .components() + .any(|component| component == Component::Normal("target".as_ref())) + { + get_denort_path(exec_path) + } else { + None + } + }) + }) +} + /// This function returns the environment variables specified /// in the passed environment file. fn get_file_env_vars( From 93bbbe418446ded1a0f1f98c18053f60c33a7941 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 26 Nov 2024 08:08:46 -0800 Subject: [PATCH 169/227] fix(ext/fetch): don't throw when `bodyUsed` inspect after upgrade (#27088) Fixes https://github.com/denoland/deno/issues/27083 --- ext/fetch/22_body.js | 9 +++++-- tests/unit/serve_test.ts | 52 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/ext/fetch/22_body.js b/ext/fetch/22_body.js index c7e977c0b4..a34758d19a 100644 --- a/ext/fetch/22_body.js +++ b/ext/fetch/22_body.js @@ -286,8 +286,13 @@ function mixinBody(prototype, bodySymbol, mimeTypeSymbol) { */ get() { webidl.assertBranded(this, prototype); - if (this[bodySymbol] !== null) { - return this[bodySymbol].consumed(); + try { + if (this[bodySymbol] !== null) { + return this[bodySymbol].consumed(); + } + } catch (_) { + // Request is closed. + return true; } return false; }, diff --git a/tests/unit/serve_test.ts b/tests/unit/serve_test.ts index 7d8c6ca06d..f5896bc64b 100644 --- a/tests/unit/serve_test.ts +++ b/tests/unit/serve_test.ts @@ -4327,3 +4327,55 @@ Deno.test({ await server.shutdown(); }); + +// https://github.com/denoland/deno/issues/27083 +Deno.test( + { permissions: { net: true } }, + async function httpServerWebSocketInspectRequest() { + const ac = new AbortController(); + const listeningDeferred = Promise.withResolvers(); + const doneDeferred = Promise.withResolvers(); + const server = Deno.serve({ + handler: (request) => { + const { + response, + socket, + } = Deno.upgradeWebSocket(request); + + socket.onopen = () => { + Deno.inspect(request); // should not throw + }; + socket.onerror = (e) => { + console.error(e); + fail(); + }; + socket.onmessage = (m) => { + socket.send(m.data); + socket.close(1001); + }; + socket.onclose = () => doneDeferred.resolve(); + return response; + }, + port: servePort, + signal: ac.signal, + onListen: onListen(listeningDeferred.resolve), + onError: createOnErrorCb(ac), + }); + + await listeningDeferred.promise; + const def = Promise.withResolvers(); + const ws = new WebSocket(`ws://localhost:${servePort}`); + ws.onmessage = (m) => assertEquals(m.data, "foo"); + ws.onerror = (e) => { + console.error(e); + fail(); + }; + ws.onclose = () => def.resolve(); + ws.onopen = () => ws.send("foo"); + + await def.promise; + await doneDeferred.promise; + ac.abort(); + await server.finished; + }, +); From c443ac5d14aec113dde5024e3163fae719439d7f Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Tue, 26 Nov 2024 10:45:18 -0800 Subject: [PATCH 170/227] fix(ext/webgpu): normalize limits to number (#27072) Fixes #22029 --- ext/webgpu/01_webgpu.js | 82 +++++++++++++++++++++++++-------------- tests/unit/webgpu_test.ts | 51 ++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 30 deletions(-) diff --git a/ext/webgpu/01_webgpu.js b/ext/webgpu/01_webgpu.js index cab5cbbdbc..e9dd6c203e 100644 --- a/ext/webgpu/01_webgpu.js +++ b/ext/webgpu/01_webgpu.js @@ -98,6 +98,11 @@ const { ArrayPrototypePush, DataViewPrototypeGetBuffer, Error, + Number, + NumberPOSITIVE_INFINITY, + NumberMAX_SAFE_INTEGER, + NumberNEGATIVE_INFINITY, + NumberMIN_SAFE_INTEGER, MathMax, ObjectDefineProperty, ObjectHasOwn, @@ -614,6 +619,19 @@ function createGPUSupportedLimits(limits) { return adapterFeatures; } +function normalizeLimit(limit) { + if (typeof num === "bigint") { + limit = Number(limit); + if (limit === NumberPOSITIVE_INFINITY) { + limit = NumberMAX_SAFE_INTEGER; + } else if (limit === NumberNEGATIVE_INFINITY) { + limit = NumberMIN_SAFE_INTEGER; + } + } + + return limit; +} + /** * @typedef InnerAdapterLimits * @property {number} maxTextureDimension1D @@ -653,123 +671,127 @@ class GPUSupportedLimits { get maxTextureDimension1D() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxTextureDimension1D; + return normalizeLimit(this[_limits].maxTextureDimension1D); } get maxTextureDimension2D() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxTextureDimension2D; + return normalizeLimit(this[_limits].maxTextureDimension2D); } get maxTextureDimension3D() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxTextureDimension3D; + return normalizeLimit(this[_limits].maxTextureDimension3D); } get maxTextureArrayLayers() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxTextureArrayLayers; + return normalizeLimit(this[_limits].maxTextureArrayLayers); } get maxBindGroups() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxBindGroups; + return normalizeLimit(this[_limits].maxBindGroups); } get maxBindingsPerBindGroup() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxBindingsPerBindGroup; + return normalizeLimit(this[_limits].maxBindingsPerBindGroup); } get maxBufferSize() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxBufferSize; + return normalizeLimit(this[_limits].maxBufferSize); } get maxDynamicUniformBuffersPerPipelineLayout() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxDynamicUniformBuffersPerPipelineLayout; + return normalizeLimit( + this[_limits].maxDynamicUniformBuffersPerPipelineLayout, + ); } get maxDynamicStorageBuffersPerPipelineLayout() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxDynamicStorageBuffersPerPipelineLayout; + return normalizeLimit( + this[_limits].maxDynamicStorageBuffersPerPipelineLayout, + ); } get maxSampledTexturesPerShaderStage() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxSampledTexturesPerShaderStage; + return normalizeLimit(this[_limits].maxSampledTexturesPerShaderStage); } get maxSamplersPerShaderStage() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxSamplersPerShaderStage; + return normalizeLimit(this[_limits].maxSamplersPerShaderStage); } get maxStorageBuffersPerShaderStage() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxStorageBuffersPerShaderStage; + return normalizeLimit(this[_limits].maxStorageBuffersPerShaderStage); } get maxStorageTexturesPerShaderStage() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxStorageTexturesPerShaderStage; + return normalizeLimit(this[_limits].maxStorageTexturesPerShaderStage); } get maxUniformBuffersPerShaderStage() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxUniformBuffersPerShaderStage; + return normalizeLimit(this[_limits].maxUniformBuffersPerShaderStage); } get maxUniformBufferBindingSize() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxUniformBufferBindingSize; + return normalizeLimit(this[_limits].maxUniformBufferBindingSize); } get maxStorageBufferBindingSize() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxStorageBufferBindingSize; + return normalizeLimit(this[_limits].maxStorageBufferBindingSize); } get minUniformBufferOffsetAlignment() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].minUniformBufferOffsetAlignment; + return normalizeLimit(this[_limits].minUniformBufferOffsetAlignment); } get minStorageBufferOffsetAlignment() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].minStorageBufferOffsetAlignment; + return normalizeLimit(this[_limits].minStorageBufferOffsetAlignment); } get maxVertexBuffers() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxVertexBuffers; + return normalizeLimit(this[_limits].maxVertexBuffers); } get maxVertexAttributes() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxVertexAttributes; + return normalizeLimit(this[_limits].maxVertexAttributes); } get maxVertexBufferArrayStride() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxVertexBufferArrayStride; + return normalizeLimit(this[_limits].maxVertexBufferArrayStride); } get maxInterStageShaderComponents() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxInterStageShaderComponents; + return normalizeLimit(this[_limits].maxInterStageShaderComponents); } get maxColorAttachments() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxColorAttachments; + return normalizeLimit(this[_limits].maxColorAttachments); } get maxColorAttachmentBytesPerSample() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxColorAttachmentBytesPerSample; + return normalizeLimit(this[_limits].maxColorAttachmentBytesPerSample); } get maxComputeWorkgroupStorageSize() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxComputeWorkgroupStorageSize; + return normalizeLimit(this[_limits].maxComputeWorkgroupStorageSize); } get maxComputeInvocationsPerWorkgroup() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxComputeInvocationsPerWorkgroup; + return normalizeLimit(this[_limits].maxComputeInvocationsPerWorkgroup); } get maxComputeWorkgroupSizeX() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxComputeWorkgroupSizeX; + return normalizeLimit(this[_limits].maxComputeWorkgroupSizeX); } get maxComputeWorkgroupSizeY() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxComputeWorkgroupSizeY; + return normalizeLimit(this[_limits].maxComputeWorkgroupSizeY); } get maxComputeWorkgroupSizeZ() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxComputeWorkgroupSizeZ; + return normalizeLimit(this[_limits].maxComputeWorkgroupSizeZ); } get maxComputeWorkgroupsPerDimension() { webidl.assertBranded(this, GPUSupportedLimitsPrototype); - return this[_limits].maxComputeWorkgroupsPerDimension; + return normalizeLimit(this[_limits].maxComputeWorkgroupsPerDimension); } [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { diff --git a/tests/unit/webgpu_test.ts b/tests/unit/webgpu_test.ts index 6c91abe4ad..aac75d3420 100644 --- a/tests/unit/webgpu_test.ts +++ b/tests/unit/webgpu_test.ts @@ -553,6 +553,57 @@ Deno.test({ device.destroy(); }); +Deno.test({ + ignore: isWsl || isCIWithoutGPU, +}, async function adapterLimitsAreNumbers() { + const limitNames = [ + "maxTextureDimension1D", + "maxTextureDimension2D", + "maxTextureDimension3D", + "maxTextureArrayLayers", + "maxBindGroups", + "maxDynamicUniformBuffersPerPipelineLayout", + "maxDynamicStorageBuffersPerPipelineLayout", + "maxSampledTexturesPerShaderStage", + "maxSamplersPerShaderStage", + "maxStorageBuffersPerShaderStage", + "maxStorageTexturesPerShaderStage", + "maxUniformBuffersPerShaderStage", + "maxUniformBufferBindingSize", + "maxStorageBufferBindingSize", + "minUniformBufferOffsetAlignment", + "minStorageBufferOffsetAlignment", + "maxVertexBuffers", + "maxVertexAttributes", + "maxVertexBufferArrayStride", + "maxInterStageShaderComponents", + "maxComputeWorkgroupStorageSize", + "maxComputeInvocationsPerWorkgroup", + "maxComputeWorkgroupSizeX", + "maxComputeWorkgroupSizeY", + "maxComputeWorkgroupSizeZ", + "maxComputeWorkgroupsPerDimension", + ]; + + const adapter = await navigator.gpu.requestAdapter(); + assert(adapter); + + for (const limitName of limitNames) { + // deno-lint-ignore ban-ts-comment + // @ts-ignore + assertEquals(typeof adapter.limits[limitName], "number"); + } + + const device = await adapter.requestDevice({ + // deno-lint-ignore ban-ts-comment + // @ts-ignore + requiredLimits: adapter.limits, + }); + assert(device); + + device.destroy(); +}); + async function checkIsWsl() { return Deno.build.os === "linux" && await hasMicrosoftProcVersion(); From 115a3066565c96500ad740a8c6a3b4ef99af7fb0 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 26 Nov 2024 14:38:24 -0500 Subject: [PATCH 171/227] fix(node): correct resolution of dynamic import of esm from cjs (#27071) Ensures a dynamic import in a CJS file will consider the referrer as an import for node resolution. Also adds fixes (adds) support for `"resolution-mode"` in TypeScript. --- Cargo.lock | 153 +-------- cli/Cargo.toml | 4 +- cli/cache/module_info.rs | 24 +- cli/graph_util.rs | 64 ++-- cli/lsp/analysis.rs | 63 ++-- cli/lsp/completions.rs | 52 ++- cli/lsp/diagnostics.rs | 6 +- cli/lsp/documents.rs | 76 +++-- cli/lsp/language_server.rs | 26 +- cli/lsp/resolver.rs | 64 ++-- cli/lsp/tsc.rs | 30 +- cli/module_loader.rs | 27 +- cli/resolver.rs | 40 +-- cli/standalone/mod.rs | 20 +- cli/tools/doc.rs | 28 +- cli/tools/info.rs | 35 +- cli/tools/lint/rules/no_sloppy_imports.rs | 22 +- cli/tools/registry/diagnostics.rs | 14 +- cli/tools/registry/unfurl.rs | 14 +- cli/tools/repl/session.rs | 16 +- cli/tsc/99_main_compiler.js | 73 +++-- cli/tsc/mod.rs | 63 ++-- cli/worker.rs | 8 +- ext/node/ops/require.rs | 16 +- resolvers/deno/cjs.rs | 92 +++--- resolvers/deno/lib.rs | 42 +-- resolvers/deno/npm/mod.rs | 34 +- resolvers/deno/sloppy_imports.rs | 36 ++- resolvers/node/analyze.rs | 20 +- resolvers/node/errors.rs | 32 +- resolvers/node/lib.rs | 4 +- resolvers/node/resolution.rs | 303 ++++++++++-------- .../__test__.jsonc | 44 +++ .../dynamic_import_and_require_dual/check.out | 5 + .../dynamic_import_and_require_dual/index.cts | 8 + .../dynamic_import_and_require_dual/index.mjs | 11 + .../jsdoc_import_decl.js | 12 + .../jsdoc_import_decl.out | 5 + .../node_modules/package/mod.d.mts | 1 + .../node_modules/package/mod.mjs | 1 + .../node_modules/package/package.json | 11 + .../node_modules/package/require.cjs | 1 + .../node_modules/package/require.d.cts | 1 + .../package.json | 6 + .../resolution_mode_import.mts | 6 + .../resolution_mode_import.out | 5 + .../resolution_mode_require.mts | 6 + .../resolution_mode_require.out | 5 + .../resolution_mode_require_import_type.out | 0 .../resolution_mode_require_import_type.ts | 5 + .../resolution_mode_require_jsdoc.js | 12 + .../resolution_mode_require_jsdoc.out | 5 + .../run_cjs.out | 2 + .../run_mts.out | 3 + .../npm/info_chalk_display/__test__.jsonc | 4 +- .../info_chalk_display/cjs_with_deps/main.out | 33 -- .../cjs_with_deps/main_info_json.out | 148 --------- .../cjs_with_deps/main_node_modules.out | 47 --- .../{cjs_with_deps => }/main.js | 0 .../main_info.out | 2 +- .../__test__.jsonc | 4 +- .../cjs_with_deps/main.out | 33 -- .../cjs_with_deps/main_info.out | 22 -- .../cjs_with_deps/main_info_json.out | 148 --------- .../cjs_with_deps/main_node_modules.out | 47 --- .../{cjs_with_deps => }/main.js | 0 .../main_info.out | 2 +- .../specs/npm/info_chalk_json/__test__.jsonc | 4 +- .../info_chalk_json/cjs_with_deps/main.out | 33 -- .../cjs_with_deps/main_node_modules.out | 47 --- .../{cjs_with_deps => }/main.js | 0 .../{cjs_with_deps => }/main_info_json.out | 0 .../__test__.jsonc | 4 +- .../cjs_with_deps/main.out | 33 -- .../cjs_with_deps/main_info.out | 22 -- .../cjs_with_deps/main_node_modules.out | 47 --- .../{cjs_with_deps => }/main.js | 0 .../{cjs_with_deps => }/main_info_json.out | 0 tests/specs/npm/info_peer_deps/__test__.jsonc | 4 +- .../main.ts | 0 .../main_info.out | 2 +- .../peer_deps_with_copied_folders/main.out | 14 - .../main_info_json.out | 97 ------ .../main_node_modules.out | 9 - .../main_node_modules_reload.out | 19 -- .../npm/info_peer_deps_json/__test__.jsonc | 4 +- .../main.ts | 0 .../main_info_json.out | 0 .../peer_deps_with_copied_folders/main.out | 14 - .../main_info.out | 14 - .../main_node_modules.out | 9 - .../main_node_modules_reload.out | 19 -- 92 files changed, 868 insertions(+), 1673 deletions(-) create mode 100644 tests/specs/node/dynamic_import_and_require_dual/__test__.jsonc create mode 100644 tests/specs/node/dynamic_import_and_require_dual/check.out create mode 100644 tests/specs/node/dynamic_import_and_require_dual/index.cts create mode 100644 tests/specs/node/dynamic_import_and_require_dual/index.mjs create mode 100644 tests/specs/node/dynamic_import_and_require_dual/jsdoc_import_decl.js create mode 100644 tests/specs/node/dynamic_import_and_require_dual/jsdoc_import_decl.out create mode 100644 tests/specs/node/dynamic_import_and_require_dual/node_modules/package/mod.d.mts create mode 100644 tests/specs/node/dynamic_import_and_require_dual/node_modules/package/mod.mjs create mode 100644 tests/specs/node/dynamic_import_and_require_dual/node_modules/package/package.json create mode 100644 tests/specs/node/dynamic_import_and_require_dual/node_modules/package/require.cjs create mode 100644 tests/specs/node/dynamic_import_and_require_dual/node_modules/package/require.d.cts create mode 100644 tests/specs/node/dynamic_import_and_require_dual/package.json create mode 100644 tests/specs/node/dynamic_import_and_require_dual/resolution_mode_import.mts create mode 100644 tests/specs/node/dynamic_import_and_require_dual/resolution_mode_import.out create mode 100644 tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require.mts create mode 100644 tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require.out create mode 100644 tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require_import_type.out create mode 100644 tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require_import_type.ts create mode 100644 tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require_jsdoc.js create mode 100644 tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require_jsdoc.out create mode 100644 tests/specs/node/dynamic_import_and_require_dual/run_cjs.out create mode 100644 tests/specs/node/dynamic_import_and_require_dual/run_mts.out delete mode 100644 tests/specs/npm/info_chalk_display/cjs_with_deps/main.out delete mode 100644 tests/specs/npm/info_chalk_display/cjs_with_deps/main_info_json.out delete mode 100644 tests/specs/npm/info_chalk_display/cjs_with_deps/main_node_modules.out rename tests/specs/npm/info_chalk_display/{cjs_with_deps => }/main.js (100%) rename tests/specs/npm/{info_chalk_json/cjs_with_deps => info_chalk_display}/main_info.out (94%) delete mode 100644 tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.out delete mode 100644 tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info.out delete mode 100644 tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info_json.out delete mode 100644 tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_node_modules.out rename tests/specs/npm/info_chalk_display_node_modules_dir/{cjs_with_deps => }/main.js (100%) rename tests/specs/npm/{info_chalk_display/cjs_with_deps => info_chalk_display_node_modules_dir}/main_info.out (94%) delete mode 100644 tests/specs/npm/info_chalk_json/cjs_with_deps/main.out delete mode 100644 tests/specs/npm/info_chalk_json/cjs_with_deps/main_node_modules.out rename tests/specs/npm/info_chalk_json/{cjs_with_deps => }/main.js (100%) rename tests/specs/npm/info_chalk_json/{cjs_with_deps => }/main_info_json.out (100%) delete mode 100644 tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.out delete mode 100644 tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info.out delete mode 100644 tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_node_modules.out rename tests/specs/npm/info_chalk_json_node_modules_dir/{cjs_with_deps => }/main.js (100%) rename tests/specs/npm/info_chalk_json_node_modules_dir/{cjs_with_deps => }/main_info_json.out (100%) rename tests/specs/npm/info_peer_deps/{peer_deps_with_copied_folders => }/main.ts (100%) rename tests/specs/npm/info_peer_deps/{peer_deps_with_copied_folders => }/main_info.out (91%) delete mode 100644 tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.out delete mode 100644 tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info_json.out delete mode 100644 tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules.out delete mode 100644 tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out rename tests/specs/npm/info_peer_deps_json/{peer_deps_with_copied_folders => }/main.ts (100%) rename tests/specs/npm/info_peer_deps_json/{peer_deps_with_copied_folders => }/main_info_json.out (100%) delete mode 100644 tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.out delete mode 100644 tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info.out delete mode 100644 tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules.out delete mode 100644 tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out diff --git a/Cargo.lock b/Cargo.lock index 00b4da07cd..5f59c936e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -128,19 +128,6 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" -[[package]] -name = "ammonia" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab99eae5ee58501ab236beb6f20f6ca39be615267b014899c89b2f0bc18a459" -dependencies = [ - "html5ever", - "maplit", - "once_cell", - "tendril", - "url", -] - [[package]] name = "android_system_properties" version = "0.1.5" @@ -1557,18 +1544,16 @@ dependencies = [ [[package]] name = "deno_doc" -version = "0.160.0" +version = "0.161.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2baa33e5d1ed235209c2990f5fe9644bac6b9e7bcb789dd92894f907b09ad7" +checksum = "32d994915f85e873865fc341e592080a487b0a987d06177016b2d93fd62162f8" dependencies = [ - "ammonia", "anyhow", "cfg-if", "comrak", "deno_ast", "deno_graph", "deno_path_util", - "futures", "handlebars", "html-escape", "import_map", @@ -1665,9 +1650,9 @@ dependencies = [ [[package]] name = "deno_graph" -version = "0.85.1" +version = "0.86.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c11027d9b4e9ff4f8bcb8316a1a5dd5241dc267380507e177457bc491696189" +checksum = "4c3f4be49dad28e794ff4eeb2daaf7956c97f8557097ef6f9c3ff1292e0a5c28" dependencies = [ "anyhow", "async-trait", @@ -3265,16 +3250,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" -[[package]] -name = "futf" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" -dependencies = [ - "mac", - "new_debug_unreachable", -] - [[package]] name = "futures" version = "0.3.30" @@ -3802,20 +3777,6 @@ dependencies = [ "utf8-width", ] -[[package]] -name = "html5ever" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13771afe0e6e846f1e67d038d4cb29998a6779f93c809212e4e9c32efd244d4" -dependencies = [ - "log", - "mac", - "markup5ever", - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "http" version = "0.2.12" @@ -4663,12 +4624,6 @@ dependencies = [ "serde_repr", ] -[[package]] -name = "mac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" - [[package]] name = "malloc_buf" version = "0.0.6" @@ -4691,26 +4646,6 @@ dependencies = [ "tiny_pretty", ] -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - -[[package]] -name = "markup5ever" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ce3abbeba692c8b8441d036ef91aea6df8da2c6b6e21c7e14d3c18e526be45" -dependencies = [ - "log", - "phf", - "phf_codegen", - "string_cache", - "string_cache_codegen", - "tendril", -] - [[package]] name = "markup_fmt" version = "0.16.0" @@ -5468,27 +5403,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ "phf_macros", - "phf_shared 0.11.2", -] - -[[package]] -name = "phf_codegen" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" -dependencies = [ - "phf_generator 0.11.2", - "phf_shared 0.11.2", -] - -[[package]] -name = "phf_generator" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" -dependencies = [ - "phf_shared 0.10.0", - "rand", + "phf_shared", ] [[package]] @@ -5497,7 +5412,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ - "phf_shared 0.11.2", + "phf_shared", "rand", ] @@ -5507,22 +5422,13 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" dependencies = [ - "phf_generator 0.11.2", - "phf_shared 0.11.2", + "phf_generator", + "phf_shared", "proc-macro2", "quote", "syn 2.0.87", ] -[[package]] -name = "phf_shared" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" -dependencies = [ - "siphasher", -] - [[package]] name = "phf_shared" version = "0.11.2" @@ -5645,12 +5551,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - [[package]] name = "pretty_assertions" version = "1.4.0" @@ -6985,32 +6885,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "string_cache" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" -dependencies = [ - "new_debug_unreachable", - "once_cell", - "parking_lot", - "phf_shared 0.10.0", - "precomputed-hash", - "serde", -] - -[[package]] -name = "string_cache_codegen" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" -dependencies = [ - "phf_generator 0.10.0", - "phf_shared 0.10.0", - "proc-macro2", - "quote", -] - [[package]] name = "string_enum" version = "0.4.4" @@ -7598,17 +7472,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "tendril" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" -dependencies = [ - "futf", - "mac", - "utf-8", -] - [[package]] name = "termcolor" version = "1.4.1" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 96bb206d0f..fd28b315d4 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -72,8 +72,8 @@ deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposa deno_cache_dir.workspace = true deno_config.workspace = true deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] } -deno_doc = { version = "0.160.0", features = ["rust", "comrak"] } -deno_graph = { version = "=0.85.1" } +deno_doc = { version = "=0.161.1", features = ["rust", "comrak"] } +deno_graph = { version = "=0.86.2" } deno_lint = { version = "=0.68.0", features = ["docs"] } deno_lockfile.workspace = true deno_npm.workspace = true diff --git a/cli/cache/module_info.rs b/cli/cache/module_info.rs index 060a6f4f0c..469e2fafac 100644 --- a/cli/cache/module_info.rs +++ b/cli/cache/module_info.rs @@ -284,6 +284,7 @@ fn serialize_media_type(media_type: MediaType) -> i64 { #[cfg(test)] mod test { + use deno_graph::JsDocImportInfo; use deno_graph::PositionRange; use deno_graph::SpecifierWithRange; @@ -308,18 +309,21 @@ mod test { ); let mut module_info = ModuleInfo::default(); - module_info.jsdoc_imports.push(SpecifierWithRange { - range: PositionRange { - start: deno_graph::Position { - line: 0, - character: 3, - }, - end: deno_graph::Position { - line: 1, - character: 2, + module_info.jsdoc_imports.push(JsDocImportInfo { + specifier: SpecifierWithRange { + range: PositionRange { + start: deno_graph::Position { + line: 0, + character: 3, + }, + end: deno_graph::Position { + line: 1, + character: 2, + }, }, + text: "test".to_string(), }, - text: "test".to_string(), + resolution_mode: None, }); cache .set_module_info( diff --git a/cli/graph_util.rs b/cli/graph_util.rs index 6ed0506dd7..360021d22d 100644 --- a/cli/graph_util.rs +++ b/cli/graph_util.rs @@ -25,7 +25,7 @@ use deno_config::deno_json::JsxImportSourceConfig; use deno_config::workspace::JsrPackageConfig; use deno_core::anyhow::bail; use deno_graph::source::LoaderChecksum; -use deno_graph::source::ResolutionMode; +use deno_graph::source::ResolutionKind; use deno_graph::FillFromLockfileOptions; use deno_graph::JsrLoadError; use deno_graph::ModuleLoadError; @@ -44,7 +44,7 @@ use deno_graph::ModuleGraphError; use deno_graph::ResolutionError; use deno_graph::SpecifierError; use deno_path_util::url_to_file_path; -use deno_resolver::sloppy_imports::SloppyImportsResolutionMode; +use deno_resolver::sloppy_imports::SloppyImportsResolutionKind; use deno_runtime::deno_fs::FileSystem; use deno_runtime::deno_node; use deno_runtime::deno_permissions::PermissionsContainer; @@ -795,7 +795,7 @@ fn enhanced_sloppy_imports_error_message( ModuleError::LoadingErr(specifier, _, ModuleLoadError::Loader(_)) // ex. "Is a directory" error | ModuleError::Missing(specifier, _) => { let additional_message = CliSloppyImportsResolver::new(SloppyImportsCachedFs::new(fs.clone())) - .resolve(specifier, SloppyImportsResolutionMode::Execution)? + .resolve(specifier, SloppyImportsResolutionKind::Execution)? .as_suggestion_message(); Some(format!( "{} {} or run with --unstable-sloppy-imports", @@ -1100,12 +1100,12 @@ impl<'a> deno_graph::source::FileSystem for DenoGraphFsAdapter<'a> { } } -pub fn format_range_with_colors(range: &deno_graph::Range) -> String { +pub fn format_range_with_colors(referrer: &deno_graph::Range) -> String { format!( "{}:{}:{}", - colors::cyan(range.specifier.as_str()), - colors::yellow(&(range.start.line + 1).to_string()), - colors::yellow(&(range.start.character + 1).to_string()) + colors::cyan(referrer.specifier.as_str()), + colors::yellow(&(referrer.range.start.line + 1).to_string()), + colors::yellow(&(referrer.range.start.character + 1).to_string()) ) } @@ -1195,26 +1195,54 @@ impl<'a> deno_graph::source::Resolver for CliGraphResolver<'a> { &self, raw_specifier: &str, referrer_range: &deno_graph::Range, - mode: ResolutionMode, + resolution_kind: ResolutionKind, ) -> Result { self.resolver.resolve( raw_specifier, - referrer_range, - self - .cjs_tracker - .get_referrer_kind(&referrer_range.specifier), - mode, + &referrer_range.specifier, + referrer_range.range.start, + referrer_range + .resolution_mode + .map(to_node_resolution_mode) + .unwrap_or_else(|| { + self + .cjs_tracker + .get_referrer_kind(&referrer_range.specifier) + }), + to_node_resolution_kind(resolution_kind), ) } } +pub fn to_node_resolution_kind( + kind: ResolutionKind, +) -> node_resolver::NodeResolutionKind { + match kind { + ResolutionKind::Execution => node_resolver::NodeResolutionKind::Execution, + ResolutionKind::Types => node_resolver::NodeResolutionKind::Types, + } +} + +pub fn to_node_resolution_mode( + mode: deno_graph::source::ResolutionMode, +) -> node_resolver::ResolutionMode { + match mode { + deno_graph::source::ResolutionMode::Import => { + node_resolver::ResolutionMode::Import + } + deno_graph::source::ResolutionMode::Require => { + node_resolver::ResolutionMode::Require + } + } +} + #[cfg(test)] mod test { use std::sync::Arc; use deno_ast::ModuleSpecifier; use deno_graph::source::ResolveError; - use deno_graph::Position; + use deno_graph::PositionRange; use deno_graph::Range; use deno_graph::ResolutionError; use deno_graph::SpecifierError; @@ -1235,8 +1263,8 @@ mod test { specifier: input.to_string(), range: Range { specifier, - start: Position::zeroed(), - end: Position::zeroed(), + resolution_mode: None, + range: PositionRange::zeroed(), }, }; assert_eq!(get_resolution_error_bare_node_specifier(&err), output); @@ -1251,8 +1279,8 @@ mod test { let err = ResolutionError::InvalidSpecifier { range: Range { specifier, - start: Position::zeroed(), - end: Position::zeroed(), + resolution_mode: None, + range: PositionRange::zeroed(), }, error: SpecifierError::ImportPrefixMissing { specifier: input.to_string(), diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs index 044b1573b9..eca1f15ed0 100644 --- a/cli/lsp/analysis.rs +++ b/cli/lsp/analysis.rs @@ -15,7 +15,6 @@ use crate::lsp::search::PackageSearchApi; use crate::tools::lint::CliLinter; use crate::util::path::relative_specifier; use deno_config::workspace::MappedResolution; -use deno_graph::source::ResolutionMode; use deno_lint::diagnostic::LintDiagnosticRange; use deno_ast::SourceRange; @@ -39,7 +38,8 @@ use deno_semver::package::PackageReq; use deno_semver::package::PackageReqReference; use deno_semver::Version; use import_map::ImportMap; -use node_resolver::NodeModuleKind; +use node_resolver::NodeResolutionKind; +use node_resolver::ResolutionMode; use once_cell::sync::Lazy; use regex::Regex; use std::borrow::Cow; @@ -467,7 +467,7 @@ impl<'a> TsResponseImportMapper<'a> { &self, specifier: &str, referrer: &ModuleSpecifier, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, ) -> Option { let specifier_stem = specifier.strip_suffix(".js").unwrap_or(specifier); let specifiers = std::iter::once(Cow::Borrowed(specifier)).chain( @@ -481,13 +481,10 @@ impl<'a> TsResponseImportMapper<'a> { .as_cli_resolver(Some(&self.file_referrer)) .resolve( &specifier, - &deno_graph::Range { - specifier: referrer.clone(), - start: deno_graph::Position::zeroed(), - end: deno_graph::Position::zeroed(), - }, - referrer_kind, - ResolutionMode::Types, + referrer, + deno_graph::Position::zeroed(), + resolution_mode, + NodeResolutionKind::Types, ) .ok() .and_then(|s| self.tsc_specifier_map.normalize(s.as_str()).ok()) @@ -509,20 +506,17 @@ impl<'a> TsResponseImportMapper<'a> { &self, specifier_text: &str, referrer: &ModuleSpecifier, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, ) -> bool { self .resolver .as_cli_resolver(Some(&self.file_referrer)) .resolve( specifier_text, - &deno_graph::Range { - specifier: referrer.clone(), - start: deno_graph::Position::zeroed(), - end: deno_graph::Position::zeroed(), - }, - referrer_kind, - deno_graph::source::ResolutionMode::Types, + referrer, + deno_graph::Position::zeroed(), + resolution_mode, + NodeResolutionKind::Types, ) .is_ok() } @@ -590,7 +584,7 @@ fn try_reverse_map_package_json_exports( /// like an import and rewrite the import specifier to include the extension pub fn fix_ts_import_changes( referrer: &ModuleSpecifier, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, changes: &[tsc::FileTextChanges], language_server: &language_server::Inner, ) -> Result, AnyError> { @@ -608,7 +602,7 @@ pub fn fix_ts_import_changes( let specifier = captures.iter().skip(1).find_map(|s| s).unwrap().as_str(); if let Some(new_specifier) = import_mapper - .check_unresolved_specifier(specifier, referrer, referrer_kind) + .check_unresolved_specifier(specifier, referrer, resolution_mode) { line.replace(specifier, &new_specifier) } else { @@ -638,7 +632,7 @@ pub fn fix_ts_import_changes( /// resolution by Deno (includes the extension). fn fix_ts_import_action<'a>( referrer: &ModuleSpecifier, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, action: &'a tsc::CodeFixAction, language_server: &language_server::Inner, ) -> Option> { @@ -657,9 +651,11 @@ fn fix_ts_import_action<'a>( return Some(Cow::Borrowed(action)); }; let import_mapper = language_server.get_ts_response_import_mapper(referrer); - if let Some(new_specifier) = - import_mapper.check_unresolved_specifier(specifier, referrer, referrer_kind) - { + if let Some(new_specifier) = import_mapper.check_unresolved_specifier( + specifier, + referrer, + resolution_mode, + ) { let description = action.description.replace(specifier, &new_specifier); let changes = action .changes @@ -689,7 +685,8 @@ fn fix_ts_import_action<'a>( fix_id: None, fix_all_description: None, })) - } else if !import_mapper.is_valid_import(specifier, referrer, referrer_kind) { + } else if !import_mapper.is_valid_import(specifier, referrer, resolution_mode) + { None } else { Some(Cow::Borrowed(action)) @@ -1023,7 +1020,7 @@ impl CodeActionCollection { pub fn add_ts_fix_action( &mut self, specifier: &ModuleSpecifier, - specifier_kind: NodeModuleKind, + resolution_mode: ResolutionMode, action: &tsc::CodeFixAction, diagnostic: &lsp::Diagnostic, language_server: &language_server::Inner, @@ -1042,7 +1039,7 @@ impl CodeActionCollection { )); } let Some(action) = - fix_ts_import_action(specifier, specifier_kind, action, language_server) + fix_ts_import_action(specifier, resolution_mode, action, language_server) else { return Ok(()); }; @@ -1237,12 +1234,12 @@ impl CodeActionCollection { let text_info = parsed_source.text_info_lazy(); let specifier_range = SourceRange::new( text_info.loc_to_source_pos(LineAndColumnIndex { - line_index: import.specifier_range.start.line, - column_index: import.specifier_range.start.character, + line_index: import.specifier_range.range.start.line, + column_index: import.specifier_range.range.start.character, }), text_info.loc_to_source_pos(LineAndColumnIndex { - line_index: import.specifier_range.end.line, - column_index: import.specifier_range.end.character, + line_index: import.specifier_range.range.end.line, + column_index: import.specifier_range.range.end.character, }), ); @@ -1277,7 +1274,7 @@ impl CodeActionCollection { if json!(i.kind) != json!("es") && json!(i.kind) != json!("tsType") { return None; } - if !i.specifier_range.includes(&position) { + if !i.specifier_range.includes(position) { return None; } @@ -1286,7 +1283,7 @@ impl CodeActionCollection { let referrer = document.specifier(); let referrer_kind = language_server .is_cjs_resolver - .get_doc_module_kind(document); + .get_doc_resolution_mode(document); let file_referrer = document.file_referrer(); let config_data = language_server .config diff --git a/cli/lsp/completions.rs b/cli/lsp/completions.rs index 3ee8ae93e4..a77f3506fd 100644 --- a/cli/lsp/completions.rs +++ b/cli/lsp/completions.rs @@ -14,11 +14,10 @@ use super::resolver::LspResolver; use super::search::PackageSearchApi; use super::tsc; +use crate::graph_util::to_node_resolution_mode; use crate::jsr::JsrFetchResolver; use crate::util::path::is_importable_ext; use crate::util::path::relative_specifier; -use deno_graph::source::ResolutionMode; -use deno_graph::Range; use deno_runtime::deno_node::SUPPORTED_BUILTIN_NODE_MODULES; use deno_ast::LineAndColumnIndex; @@ -36,7 +35,8 @@ use deno_semver::package::PackageNv; use import_map::ImportMap; use indexmap::IndexSet; use lsp_types::CompletionList; -use node_resolver::NodeModuleKind; +use node_resolver::NodeResolutionKind; +use node_resolver::ResolutionMode; use once_cell::sync::Lazy; use regex::Regex; use tower_lsp::lsp_types as lsp; @@ -113,7 +113,7 @@ async fn check_auto_config_registry( /// which we want to ignore when replacing text. fn to_narrow_lsp_range( text_info: &SourceTextInfo, - range: &deno_graph::Range, + range: deno_graph::PositionRange, ) -> lsp::Range { let end_byte_index = text_info .loc_to_source_pos(LineAndColumnIndex { @@ -166,21 +166,21 @@ pub async fn get_import_completions( maybe_import_map: Option<&ImportMap>, ) -> Option { let document = documents.get(specifier)?; - let specifier_kind = is_cjs_resolver.get_doc_module_kind(&document); let file_referrer = document.file_referrer(); - let (text, _, range) = document.get_maybe_dependency(position)?; - let range = to_narrow_lsp_range(document.text_info(), &range); + let (text, _, graph_range) = document.get_maybe_dependency(position)?; + let resolution_mode = graph_range + .resolution_mode + .map(to_node_resolution_mode) + .unwrap_or_else(|| is_cjs_resolver.get_doc_resolution_mode(&document)); + let range = to_narrow_lsp_range(document.text_info(), graph_range.range); let resolved = resolver .as_cli_resolver(file_referrer) .resolve( &text, - &Range { - specifier: specifier.clone(), - start: deno_graph::Position::zeroed(), - end: deno_graph::Position::zeroed(), - }, - specifier_kind, - ResolutionMode::Execution, + specifier, + deno_graph::Position::zeroed(), + resolution_mode, + NodeResolutionKind::Execution, ) .ok(); if let Some(completion_list) = get_jsr_completions( @@ -206,7 +206,7 @@ pub async fn get_import_completions( // completions for import map specifiers Some(lsp::CompletionResponse::List(completion_list)) } else if let Some(completion_list) = - get_local_completions(specifier, specifier_kind, &text, &range, resolver) + get_local_completions(specifier, resolution_mode, &text, &range, resolver) { // completions for local relative modules Some(lsp::CompletionResponse::List(completion_list)) @@ -361,7 +361,7 @@ fn get_import_map_completions( /// Return local completions that are relative to the base specifier. fn get_local_completions( referrer: &ModuleSpecifier, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, text: &str, range: &lsp::Range, resolver: &LspResolver, @@ -374,13 +374,10 @@ fn get_local_completions( .as_cli_resolver(Some(referrer)) .resolve( parent, - &Range { - specifier: referrer.clone(), - start: deno_graph::Position::zeroed(), - end: deno_graph::Position::zeroed(), - }, - referrer_kind, - ResolutionMode::Execution, + referrer, + deno_graph::Position::zeroed(), + resolution_mode, + NodeResolutionKind::Execution, ) .ok()?; let resolved_parent_path = url_to_file_path(&resolved_parent).ok()?; @@ -831,7 +828,6 @@ mod tests { use crate::lsp::documents::LanguageId; use crate::lsp::search::tests::TestPackageSearchApi; use deno_core::resolve_url; - use deno_graph::Range; use pretty_assertions::assert_eq; use std::collections::HashMap; use test_util::TempDir; @@ -912,7 +908,7 @@ mod tests { ModuleSpecifier::from_file_path(file_c).expect("could not create"); let actual = get_local_completions( &specifier, - NodeModuleKind::Esm, + ResolutionMode::Import, "./", &lsp::Range { start: lsp::Position { @@ -1608,8 +1604,7 @@ mod tests { let text_info = SourceTextInfo::from_string(r#""te""#.to_string()); let range = to_narrow_lsp_range( &text_info, - &Range { - specifier: ModuleSpecifier::parse("https://deno.land").unwrap(), + deno_graph::PositionRange { start: deno_graph::Position { line: 0, character: 0, @@ -1632,8 +1627,7 @@ mod tests { let text_info = SourceTextInfo::from_string(r#""te"#.to_string()); let range = to_narrow_lsp_range( &text_info, - &Range { - specifier: ModuleSpecifier::parse("https://deno.land").unwrap(), + deno_graph::PositionRange { start: deno_graph::Position { line: 0, character: 0, diff --git a/cli/lsp/diagnostics.rs b/cli/lsp/diagnostics.rs index e4fb82e58d..1967cdd7c9 100644 --- a/cli/lsp/diagnostics.rs +++ b/cli/lsp/diagnostics.rs @@ -45,7 +45,7 @@ use deno_graph::Resolution; use deno_graph::ResolutionError; use deno_graph::SpecifierError; use deno_resolver::sloppy_imports::SloppyImportsResolution; -use deno_resolver::sloppy_imports::SloppyImportsResolutionMode; +use deno_resolver::sloppy_imports::SloppyImportsResolutionKind; use deno_runtime::deno_fs; use deno_runtime::deno_node; use deno_runtime::tokio_util::create_basic_runtime; @@ -1266,7 +1266,7 @@ impl DenoDiagnostic { Self::NoLocal(specifier) => { let maybe_sloppy_resolution = CliSloppyImportsResolver::new( SloppyImportsCachedFs::new(Arc::new(deno_fs::RealFs)) - ).resolve(specifier, SloppyImportsResolutionMode::Execution); + ).resolve(specifier, SloppyImportsResolutionKind::Execution); let data = maybe_sloppy_resolution.as_ref().map(|res| { json!({ "specifier": specifier, @@ -1531,7 +1531,7 @@ fn diagnose_dependency( && !dependency.imports.iter().any(|i| { dependency .maybe_type - .includes(&i.specifier_range.start) + .includes(i.specifier_range.range.start) .is_some() }); diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs index cdc25f3ac3..96332b4388 100644 --- a/cli/lsp/documents.rs +++ b/cli/lsp/documents.rs @@ -27,7 +27,6 @@ use deno_core::futures::future::Shared; use deno_core::futures::FutureExt; use deno_core::parking_lot::Mutex; use deno_core::ModuleSpecifier; -use deno_graph::source::ResolutionMode; use deno_graph::Resolution; use deno_path_util::url_to_file_path; use deno_runtime::deno_node; @@ -36,7 +35,8 @@ use deno_semver::npm::NpmPackageReqReference; use deno_semver::package::PackageReq; use indexmap::IndexMap; use indexmap::IndexSet; -use node_resolver::NodeModuleKind; +use node_resolver::NodeResolutionKind; +use node_resolver::ResolutionMode; use std::borrow::Cow; use std::collections::BTreeMap; use std::collections::HashMap; @@ -442,8 +442,8 @@ impl Document { config_data.and_then(|d| d.maybe_jsx_import_source_config()); let resolver = SingleReferrerGraphResolver { valid_referrer: &self.specifier, - referrer_kind: is_cjs_resolver - .get_lsp_referrer_kind(&self.specifier, self.is_script), + module_resolution_mode: is_cjs_resolver + .get_lsp_resolution_mode(&self.specifier, self.is_script), cli_resolver, jsx_import_source_config: jsx_import_source_config.as_ref(), }; @@ -768,7 +768,7 @@ impl Document { }; self.dependencies().iter().find_map(|(s, dep)| { dep - .includes(&position) + .includes(position) .map(|r| (s.clone(), dep.clone(), r.clone())) }) } @@ -809,15 +809,15 @@ fn resolve_media_type( MediaType::from_specifier(specifier) } -pub fn to_lsp_range(range: &deno_graph::Range) -> lsp::Range { +pub fn to_lsp_range(referrer: &deno_graph::Range) -> lsp::Range { lsp::Range { start: lsp::Position { - line: range.start.line as u32, - character: range.start.character as u32, + line: referrer.range.start.line as u32, + character: referrer.range.start.character as u32, }, end: lsp::Position { - line: range.end.line as u32, - character: range.end.character as u32, + line: referrer.range.end.line as u32, + character: referrer.range.end.character as u32, }, } } @@ -1271,7 +1271,8 @@ impl Documents { /// tsc when type checking. pub fn resolve( &self, - raw_specifiers: &[String], + // (is_cjs: bool, raw_specifier: String) + raw_specifiers: &[(bool, String)], referrer: &ModuleSpecifier, file_referrer: Option<&ModuleSpecifier>, ) -> Vec> { @@ -1281,11 +1282,12 @@ impl Documents { .and_then(|d| d.file_referrer()) .or(file_referrer); let dependencies = referrer_doc.as_ref().map(|d| d.dependencies()); - let referrer_kind = self - .is_cjs_resolver - .get_maybe_doc_module_kind(referrer, referrer_doc.as_deref()); let mut results = Vec::new(); - for raw_specifier in raw_specifiers { + for (is_cjs, raw_specifier) in raw_specifiers { + let resolution_mode = match is_cjs { + true => ResolutionMode::Require, + false => ResolutionMode::Import, + }; if raw_specifier.starts_with("asset:") { if let Ok(specifier) = ModuleSpecifier::parse(raw_specifier) { let media_type = MediaType::from_specifier(&specifier); @@ -1300,14 +1302,14 @@ impl Documents { results.push(self.resolve_dependency( specifier, referrer, - referrer_kind, + resolution_mode, file_referrer, )); } else if let Some(specifier) = dep.maybe_code.maybe_specifier() { results.push(self.resolve_dependency( specifier, referrer, - referrer_kind, + resolution_mode, file_referrer, )); } else { @@ -1316,19 +1318,16 @@ impl Documents { } else if let Ok(specifier) = self.resolver.as_cli_resolver(file_referrer).resolve( raw_specifier, - &deno_graph::Range { - specifier: referrer.clone(), - start: deno_graph::Position::zeroed(), - end: deno_graph::Position::zeroed(), - }, - referrer_kind, - ResolutionMode::Types, + referrer, + deno_graph::Position::zeroed(), + resolution_mode, + NodeResolutionKind::Types, ) { results.push(self.resolve_dependency( &specifier, referrer, - referrer_kind, + resolution_mode, file_referrer, )); } else { @@ -1477,27 +1476,24 @@ impl Documents { let type_specifier = jsx_config.default_types_specifier.as_ref()?; let code_specifier = jsx_config.default_specifier.as_ref()?; let cli_resolver = self.resolver.as_cli_resolver(Some(scope)); - let range = deno_graph::Range { - specifier: jsx_config.base_url.clone(), - start: deno_graph::Position::zeroed(), - end: deno_graph::Position::zeroed(), - }; let type_specifier = cli_resolver .resolve( type_specifier, - &range, + &jsx_config.base_url, + deno_graph::Position::zeroed(), // todo(dsherret): this is wrong because it doesn't consider CJS referrers - deno_package_json::NodeModuleKind::Esm, - ResolutionMode::Types, + ResolutionMode::Import, + NodeResolutionKind::Types, ) .ok()?; let code_specifier = cli_resolver .resolve( code_specifier, - &range, + &jsx_config.base_url, + deno_graph::Position::zeroed(), // todo(dsherret): this is wrong because it doesn't consider CJS referrers - deno_package_json::NodeModuleKind::Esm, - ResolutionMode::Execution, + ResolutionMode::Import, + NodeResolutionKind::Execution, ) .ok()?; dep_info @@ -1542,7 +1538,7 @@ impl Documents { &self, specifier: &ModuleSpecifier, referrer: &ModuleSpecifier, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, file_referrer: Option<&ModuleSpecifier>, ) -> Option<(ModuleSpecifier, MediaType)> { if let Some(module_name) = specifier.as_str().strip_prefix("node:") { @@ -1559,7 +1555,7 @@ impl Documents { let (s, mt) = self.resolver.npm_to_file_url( &npm_ref, referrer, - referrer_kind, + resolution_mode, file_referrer, )?; specifier = s; @@ -1571,7 +1567,7 @@ impl Documents { return Some((specifier, media_type)); }; if let Some(types) = doc.maybe_types_dependency().maybe_specifier() { - let specifier_kind = self.is_cjs_resolver.get_doc_module_kind(&doc); + let specifier_kind = self.is_cjs_resolver.get_doc_resolution_mode(&doc); self.resolve_dependency(types, &specifier, specifier_kind, file_referrer) } else { Some((doc.specifier().clone(), doc.media_type())) @@ -1688,7 +1684,7 @@ fn analyze_module( config_data.and_then(|d| d.maybe_jsx_import_source_config()); let resolver = SingleReferrerGraphResolver { valid_referrer: &valid_referrer, - referrer_kind: is_cjs_resolver.get_lsp_referrer_kind( + module_resolution_mode: is_cjs_resolver.get_lsp_resolution_mode( &specifier, Some(parsed_source.compute_is_script()), ), diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 9a9531eded..8fccfd0411 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -22,7 +22,8 @@ use deno_semver::jsr::JsrPackageReqReference; use indexmap::Equivalent; use indexmap::IndexSet; use log::error; -use node_resolver::NodeModuleKind; +use node_resolver::NodeResolutionKind; +use node_resolver::ResolutionMode; use serde::Deserialize; use serde_json::from_value; use std::collections::BTreeMap; @@ -993,13 +994,10 @@ impl Inner { let resolver = inner.resolver.as_cli_resolver(Some(&referrer)); let Ok(specifier) = resolver.resolve( &specifier, - &deno_graph::Range { - specifier: referrer.clone(), - start: deno_graph::Position::zeroed(), - end: deno_graph::Position::zeroed(), - }, - NodeModuleKind::Esm, - deno_graph::source::ResolutionMode::Types, + &referrer, + deno_graph::Position::zeroed(), + ResolutionMode::Import, + NodeResolutionKind::Types, ) else { return; }; @@ -1640,8 +1638,8 @@ impl Inner { .get_ts_diagnostics(&specifier, asset_or_doc.document_lsp_version()); let specifier_kind = asset_or_doc .document() - .map(|d| self.is_cjs_resolver.get_doc_module_kind(d)) - .unwrap_or(NodeModuleKind::Esm); + .map(|d| self.is_cjs_resolver.get_doc_resolution_mode(d)) + .unwrap_or(ResolutionMode::Import); let mut includes_no_cache = false; for diagnostic in &fixable_diagnostics { match diagnostic.source.as_deref() { @@ -1864,8 +1862,8 @@ impl Inner { maybe_asset_or_doc .as_ref() .and_then(|d| d.document()) - .map(|d| self.is_cjs_resolver.get_doc_module_kind(d)) - .unwrap_or(NodeModuleKind::Esm), + .map(|d| self.is_cjs_resolver.get_doc_resolution_mode(d)) + .unwrap_or(ResolutionMode::Import), &combined_code_actions.changes, self, ) @@ -1921,8 +1919,8 @@ impl Inner { &action_data.specifier, asset_or_doc .document() - .map(|d| self.is_cjs_resolver.get_doc_module_kind(d)) - .unwrap_or(NodeModuleKind::Esm), + .map(|d| self.is_cjs_resolver.get_doc_resolution_mode(d)) + .unwrap_or(ResolutionMode::Import), &refactor_edit_info.edits, self, ) diff --git a/cli/lsp/resolver.rs b/cli/lsp/resolver.rs index 4ede799227..49203c5bfd 100644 --- a/cli/lsp/resolver.rs +++ b/cli/lsp/resolver.rs @@ -9,7 +9,6 @@ use deno_config::workspace::PackageJsonDepResolution; use deno_config::workspace::WorkspaceResolver; use deno_core::parking_lot::Mutex; use deno_core::url::Url; -use deno_graph::source::ResolutionMode; use deno_graph::GraphImport; use deno_graph::ModuleSpecifier; use deno_graph::Range; @@ -30,8 +29,8 @@ use deno_semver::package::PackageReq; use indexmap::IndexMap; use node_resolver::errors::ClosestPkgJsonError; use node_resolver::InNpmPackageChecker; -use node_resolver::NodeModuleKind; -use node_resolver::NodeResolutionMode; +use node_resolver::NodeResolutionKind; +use node_resolver::ResolutionMode; use std::borrow::Cow; use std::collections::BTreeMap; use std::collections::BTreeSet; @@ -48,6 +47,8 @@ use crate::args::CliLockfile; use crate::args::NpmInstallDepsProvider; use crate::cache::DenoCacheEnvFsAdapter; use crate::factory::Deferred; +use crate::graph_util::to_node_resolution_kind; +use crate::graph_util::to_node_resolution_mode; use crate::graph_util::CliJsrUrlProvider; use crate::http_util::HttpClientProvider; use crate::lsp::config::Config; @@ -146,7 +147,7 @@ impl LspScopeResolver { .map(|(referrer, imports)| { let resolver = SingleReferrerGraphResolver { valid_referrer: &referrer, - referrer_kind: NodeModuleKind::Esm, + module_resolution_mode: ResolutionMode::Import, cli_resolver: &cli_resolver, jsx_import_source_config: maybe_jsx_import_source_config .as_ref(), @@ -180,16 +181,16 @@ impl LspScopeResolver { &req_ref, &referrer, // todo(dsherret): this is wrong because it doesn't consider CJS referrers - NodeModuleKind::Esm, - NodeResolutionMode::Types, + ResolutionMode::Import, + NodeResolutionKind::Types, ) .or_else(|_| { npm_pkg_req_resolver.resolve_req_reference( &req_ref, &referrer, // todo(dsherret): this is wrong because it doesn't consider CJS referrers - NodeModuleKind::Esm, - NodeResolutionMode::Execution, + ResolutionMode::Import, + NodeResolutionKind::Execution, ) }) .ok()?, @@ -424,7 +425,7 @@ impl LspResolver { &self, req_ref: &NpmPackageReqReference, referrer: &ModuleSpecifier, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, file_referrer: Option<&ModuleSpecifier>, ) -> Option<(ModuleSpecifier, MediaType)> { let resolver = self.get_scope_resolver(file_referrer); @@ -434,8 +435,8 @@ impl LspResolver { .resolve_req_reference( req_ref, referrer, - referrer_kind, - NodeResolutionMode::Types, + resolution_mode, + NodeResolutionKind::Types, ) .ok()?, ))) @@ -492,7 +493,7 @@ impl LspResolver { &self, specifier_text: &str, referrer: &ModuleSpecifier, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, ) -> bool { let resolver = self.get_scope_resolver(Some(referrer)); let Some(npm_pkg_req_resolver) = resolver.npm_pkg_req_resolver.as_ref() @@ -503,8 +504,8 @@ impl LspResolver { .resolve_if_for_npm_pkg( specifier_text, referrer, - referrer_kind, - NodeResolutionMode::Types, + resolution_mode, + NodeResolutionKind::Types, ) .ok() .flatten() @@ -868,34 +869,23 @@ impl LspIsCjsResolver { } } - pub fn get_maybe_doc_module_kind( - &self, - specifier: &ModuleSpecifier, - maybe_document: Option<&Document>, - ) -> NodeModuleKind { - self.get_lsp_referrer_kind( - specifier, - maybe_document.and_then(|d| d.is_script()), - ) + pub fn get_doc_resolution_mode(&self, document: &Document) -> ResolutionMode { + self.get_lsp_resolution_mode(document.specifier(), document.is_script()) } - pub fn get_doc_module_kind(&self, document: &Document) -> NodeModuleKind { - self.get_lsp_referrer_kind(document.specifier(), document.is_script()) - } - - pub fn get_lsp_referrer_kind( + pub fn get_lsp_resolution_mode( &self, specifier: &ModuleSpecifier, is_script: Option, - ) -> NodeModuleKind { - self.inner.get_lsp_referrer_kind(specifier, is_script) + ) -> ResolutionMode { + self.inner.get_lsp_resolution_mode(specifier, is_script) } } #[derive(Debug)] pub struct SingleReferrerGraphResolver<'a> { pub valid_referrer: &'a ModuleSpecifier, - pub referrer_kind: NodeModuleKind, + pub module_resolution_mode: ResolutionMode, pub cli_resolver: &'a CliResolver, pub jsx_import_source_config: Option<&'a JsxImportSourceConfig>, } @@ -924,16 +914,20 @@ impl<'a> deno_graph::source::Resolver for SingleReferrerGraphResolver<'a> { &self, specifier_text: &str, referrer_range: &Range, - mode: ResolutionMode, + resolution_kind: deno_graph::source::ResolutionKind, ) -> Result { // this resolver assumes it will only be used with a single referrer // with the provided referrer kind debug_assert_eq!(referrer_range.specifier, *self.valid_referrer); self.cli_resolver.resolve( specifier_text, - referrer_range, - self.referrer_kind, - mode, + &referrer_range.specifier, + referrer_range.range.start, + referrer_range + .resolution_mode + .map(to_node_resolution_mode) + .unwrap_or(self.module_resolution_mode), + to_node_resolution_kind(resolution_kind), ) } } diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index ae87a9914f..cf0107acfd 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -70,7 +70,7 @@ use indexmap::IndexMap; use indexmap::IndexSet; use lazy_regex::lazy_regex; use log::error; -use node_resolver::NodeModuleKind; +use node_resolver::ResolutionMode; use once_cell::sync::Lazy; use regex::Captures; use regex::Regex; @@ -4449,9 +4449,14 @@ fn op_load<'s>( version: state.script_version(&specifier), is_cjs: doc .document() - .map(|d| state.state_snapshot.is_cjs_resolver.get_doc_module_kind(d)) - .unwrap_or(NodeModuleKind::Esm) - == NodeModuleKind::Cjs, + .map(|d| { + state + .state_snapshot + .is_cjs_resolver + .get_doc_resolution_mode(d) + }) + .unwrap_or(ResolutionMode::Import) + == ResolutionMode::Require, }) }; let serialized = serde_v8::to_v8(scope, maybe_load_response)?; @@ -4479,17 +4484,9 @@ fn op_release( fn op_resolve( state: &mut OpState, #[string] base: String, - is_base_cjs: bool, - #[serde] specifiers: Vec, + #[serde] specifiers: Vec<(bool, String)>, ) -> Result>, AnyError> { - op_resolve_inner( - state, - ResolveArgs { - base, - is_base_cjs, - specifiers, - }, - ) + op_resolve_inner(state, ResolveArgs { base, specifiers }) } struct TscRequestArray { @@ -4695,7 +4692,7 @@ fn op_script_names(state: &mut OpState) -> ScriptNames { state .state_snapshot .is_cjs_resolver - .get_doc_module_kind(doc), + .get_doc_resolution_mode(doc), doc.file_referrer(), )?; let types_doc = documents.get_or_load(&types, doc.file_referrer())?; @@ -6430,8 +6427,7 @@ mod tests { &mut state, ResolveArgs { base: temp_dir.url().join("a.ts").unwrap().to_string(), - is_base_cjs: false, - specifiers: vec!["./b.ts".to_string()], + specifiers: vec![(false, "./b.ts".to_string())], }, ) .unwrap(); diff --git a/cli/module_loader.rs b/cli/module_loader.rs index 035ae4264b..3d2dfb2a66 100644 --- a/cli/module_loader.rs +++ b/cli/module_loader.rs @@ -57,9 +57,7 @@ use deno_core::ModuleSourceCode; use deno_core::ModuleSpecifier; use deno_core::ModuleType; use deno_core::RequestedModuleType; -use deno_core::ResolutionKind; use deno_core::SourceCodeCacheInfo; -use deno_graph::source::ResolutionMode; use deno_graph::GraphKind; use deno_graph::JsModule; use deno_graph::JsonModule; @@ -76,7 +74,8 @@ use deno_runtime::deno_permissions::PermissionsContainer; use deno_semver::npm::NpmPackageReqReference; use node_resolver::errors::ClosestPkgJsonError; use node_resolver::InNpmPackageChecker; -use node_resolver::NodeResolutionMode; +use node_resolver::NodeResolutionKind; +use node_resolver::ResolutionMode; pub struct ModuleLoadPreparer { options: Arc, @@ -498,13 +497,11 @@ impl } Resolution::None => Cow::Owned(self.shared.resolver.resolve( raw_specifier, - &deno_graph::Range { - specifier: referrer.clone(), - start: deno_graph::Position::zeroed(), - end: deno_graph::Position::zeroed(), - }, - self.shared.cjs_tracker.get_referrer_kind(referrer), - ResolutionMode::Execution, + referrer, + deno_graph::Position::zeroed(), + // if we're here, that means it's resolving a dynamic import + ResolutionMode::Import, + NodeResolutionKind::Execution, )?), }; @@ -517,8 +514,8 @@ impl .resolve_req_reference( &reference, referrer, - self.shared.cjs_tracker.get_referrer_kind(referrer), - NodeResolutionMode::Execution, + ResolutionMode::Import, + NodeResolutionKind::Execution, ) .map_err(AnyError::from); } @@ -539,8 +536,8 @@ impl &package_folder, module.nv_reference.sub_path(), Some(referrer), - self.shared.cjs_tracker.get_referrer_kind(referrer), - NodeResolutionMode::Execution, + ResolutionMode::Import, + NodeResolutionKind::Execution, ) .with_context(|| { format!("Could not resolve '{}'.", module.nv_reference) @@ -806,7 +803,7 @@ impl ModuleLoader &self, specifier: &str, referrer: &str, - _kind: ResolutionKind, + _kind: deno_core::ResolutionKind, ) -> Result { fn ensure_not_jsr_non_jsr_remote_import( specifier: &ModuleSpecifier, diff --git a/cli/resolver.rs b/cli/resolver.rs index a2dd47430f..7f6dc0b1ac 100644 --- a/cli/resolver.rs +++ b/cli/resolver.rs @@ -12,7 +12,6 @@ use deno_core::error::AnyError; use deno_core::url::Url; use deno_core::ModuleSourceCode; use deno_core::ModuleSpecifier; -use deno_graph::source::ResolutionMode; use deno_graph::source::ResolveError; use deno_graph::source::UnknownBuiltInNodeModuleError; use deno_graph::NpmLoadError; @@ -25,8 +24,8 @@ use deno_runtime::deno_fs::FileSystem; use deno_runtime::deno_node::is_builtin_node_module; use deno_runtime::deno_node::DenoFsNodeResolverEnv; use deno_semver::package::PackageReq; -use node_resolver::NodeModuleKind; -use node_resolver::NodeResolutionMode; +use node_resolver::NodeResolutionKind; +use node_resolver::ResolutionMode; use std::borrow::Cow; use std::path::Path; use std::path::PathBuf; @@ -247,25 +246,14 @@ impl CliResolver { pub fn resolve( &self, raw_specifier: &str, - referrer_range: &deno_graph::Range, - referrer_kind: NodeModuleKind, - mode: ResolutionMode, + referrer: &ModuleSpecifier, + referrer_range_start: deno_graph::Position, + resolution_mode: ResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { - fn to_node_mode(mode: ResolutionMode) -> NodeResolutionMode { - match mode { - ResolutionMode::Execution => NodeResolutionMode::Execution, - ResolutionMode::Types => NodeResolutionMode::Types, - } - } - let resolution = self .deno_resolver - .resolve( - raw_specifier, - &referrer_range.specifier, - referrer_kind, - to_node_mode(mode), - ) + .resolve(raw_specifier, referrer, resolution_mode, resolution_kind) .map_err(|err| match err.into_kind() { deno_resolver::DenoResolveErrorKind::MappedResolution( mapped_resolution_error, @@ -291,10 +279,11 @@ impl CliResolver { } => { if self.warned_pkgs.insert(reference.req().clone()) { log::warn!( - "{} {}\n at {}", + "{} {}\n at {}:{}", colors::yellow("Warning"), diagnostic, - referrer_range + referrer, + referrer_range_start, ); } } @@ -335,13 +324,10 @@ impl<'a> deno_graph::source::NpmResolver for WorkerCliNpmGraphResolver<'a> { module_name: &str, range: &deno_graph::Range, ) { - let deno_graph::Range { - start, specifier, .. - } = range; - let line = start.line + 1; - let column = start.character + 1; + let start = range.range.start; + let specifier = &range.specifier; if !*DENO_DISABLE_PEDANTIC_NODE_WARNINGS { - log::warn!("{} Resolving \"{module_name}\" as \"node:{module_name}\" at {specifier}:{line}:{column}. If you want to use a built-in Node module, add a \"node:\" prefix.", colors::yellow("Warning")) + log::warn!("{} Resolving \"{module_name}\" as \"node:{module_name}\" at {specifier}:{start}. If you want to use a built-in Node module, add a \"node:\" prefix.", colors::yellow("Warning")) } } diff --git a/cli/standalone/mod.rs b/cli/standalone/mod.rs index 27b03fec63..16aa4cde2b 100644 --- a/cli/standalone/mod.rs +++ b/cli/standalone/mod.rs @@ -50,8 +50,8 @@ use deno_semver::npm::NpmPackageReqReference; use import_map::parse_from_json; use node_resolver::analyze::NodeCodeTranslator; use node_resolver::errors::ClosestPkgJsonError; -use node_resolver::NodeModuleKind; -use node_resolver::NodeResolutionMode; +use node_resolver::NodeResolutionKind; +use node_resolver::ResolutionMode; use serialization::DenoCompileModuleSource; use std::borrow::Cow; use std::rc::Rc; @@ -193,9 +193,9 @@ impl ModuleLoader for EmbeddedModuleLoader { .cjs_tracker .is_maybe_cjs(&referrer, MediaType::from_specifier(&referrer))? { - NodeModuleKind::Cjs + ResolutionMode::Require } else { - NodeModuleKind::Esm + ResolutionMode::Import }; if self.shared.node_resolver.in_npm_package(&referrer) { @@ -207,7 +207,7 @@ impl ModuleLoader for EmbeddedModuleLoader { raw_specifier, &referrer, referrer_kind, - NodeResolutionMode::Execution, + NodeResolutionKind::Execution, )? .into_url(), ); @@ -235,7 +235,7 @@ impl ModuleLoader for EmbeddedModuleLoader { sub_path.as_deref(), Some(&referrer), referrer_kind, - NodeResolutionMode::Execution, + NodeResolutionKind::Execution, )?, ), Ok(MappedResolution::PackageJson { @@ -252,7 +252,7 @@ impl ModuleLoader for EmbeddedModuleLoader { sub_path.as_deref(), &referrer, referrer_kind, - NodeResolutionMode::Execution, + NodeResolutionKind::Execution, ) .map_err(AnyError::from), PackageJsonDepValue::Workspace(version_req) => { @@ -272,7 +272,7 @@ impl ModuleLoader for EmbeddedModuleLoader { sub_path.as_deref(), Some(&referrer), referrer_kind, - NodeResolutionMode::Execution, + NodeResolutionKind::Execution, )?, ) } @@ -286,7 +286,7 @@ impl ModuleLoader for EmbeddedModuleLoader { &reference, &referrer, referrer_kind, - NodeResolutionMode::Execution, + NodeResolutionKind::Execution, )?); } @@ -313,7 +313,7 @@ impl ModuleLoader for EmbeddedModuleLoader { raw_specifier, &referrer, referrer_kind, - NodeResolutionMode::Execution, + NodeResolutionKind::Execution, )?; if let Some(res) = maybe_res { return Ok(res.into_url()); diff --git a/cli/tools/doc.rs b/cli/tools/doc.rs index 4487d70fd7..197596167f 100644 --- a/cli/tools/doc.rs +++ b/cli/tools/doc.rs @@ -427,33 +427,7 @@ fn generate_docs_directory( symbol_redirect_map, default_symbol_map, markdown_renderer: deno_doc::html::comrak::create_renderer( - None, - Some(Box::new(|ammonia| { - ammonia.add_allowed_classes( - "code", - &[ - "language-ts", - "language-tsx", - "language-typescript", - "language-js", - "language-jsx", - "language-javascript", - "language-bash", - "language-shell", - "language-md", - "language-markdown", - "language-rs", - "language-rust", - "language-html", - "language-xml", - "language-css", - "language-json", - "language-regex", - "language-svg", - ], - ); - })), - None, + None, None, None, ), markdown_stripper: Rc::new(deno_doc::html::comrak::strip), head_inject: Some(Rc::new(|root| { diff --git a/cli/tools/info.rs b/cli/tools/info.rs index c3c37f0268..fcc9fdcfa1 100644 --- a/cli/tools/info.rs +++ b/cli/tools/info.rs @@ -235,22 +235,31 @@ fn add_npm_packages_to_json( .get_mut("dependencies") .and_then(|d| d.as_array_mut()); if let Some(dependencies) = dependencies { - for dep in dependencies.iter_mut() { - if let serde_json::Value::Object(dep) = dep { - let specifier = dep.get("specifier").and_then(|s| s.as_str()); - if let Some(specifier) = specifier { - if let Ok(npm_ref) = NpmPackageReqReference::from_str(specifier) { - if let Ok(pkg) = - snapshot.resolve_pkg_from_pkg_req(npm_ref.req()) - { - dep.insert( - "npmPackage".to_string(), - pkg.id.as_serialized().into(), - ); - } + for dep in dependencies.iter_mut().flat_map(|d| d.as_object_mut()) { + if let Some(specifier) = dep.get("specifier").and_then(|s| s.as_str()) + { + if let Ok(npm_ref) = NpmPackageReqReference::from_str(specifier) { + if let Ok(pkg) = snapshot.resolve_pkg_from_pkg_req(npm_ref.req()) + { + dep.insert( + "npmPackage".to_string(), + pkg.id.as_serialized().into(), + ); } } } + + // don't show this in the output unless someone needs it + if let Some(code) = + dep.get_mut("code").and_then(|c| c.as_object_mut()) + { + code.remove("resolutionMode"); + } + if let Some(types) = + dep.get_mut("types").and_then(|c| c.as_object_mut()) + { + types.remove("resolutionMode"); + } } } } diff --git a/cli/tools/lint/rules/no_sloppy_imports.rs b/cli/tools/lint/rules/no_sloppy_imports.rs index 94bf9a7c67..1bf7eddf6e 100644 --- a/cli/tools/lint/rules/no_sloppy_imports.rs +++ b/cli/tools/lint/rules/no_sloppy_imports.rs @@ -8,7 +8,7 @@ use std::sync::Arc; use deno_ast::SourceRange; use deno_config::workspace::WorkspaceResolver; use deno_core::anyhow::anyhow; -use deno_graph::source::ResolutionMode; +use deno_graph::source::ResolutionKind; use deno_graph::source::ResolveError; use deno_graph::Range; use deno_lint::diagnostic::LintDiagnosticDetails; @@ -17,7 +17,7 @@ use deno_lint::diagnostic::LintFix; use deno_lint::diagnostic::LintFixChange; use deno_lint::rules::LintRule; use deno_resolver::sloppy_imports::SloppyImportsResolution; -use deno_resolver::sloppy_imports::SloppyImportsResolutionMode; +use deno_resolver::sloppy_imports::SloppyImportsResolutionKind; use text_lines::LineAndColumnIndex; use crate::graph_util::CliJsrUrlProvider; @@ -101,16 +101,16 @@ impl LintRule for NoSloppyImportsRule { maybe_npm_resolver: None, }); - for (range, sloppy_import) in resolver.captures.borrow_mut().drain() { + for (referrer, sloppy_import) in resolver.captures.borrow_mut().drain() { let start_range = context.text_info().loc_to_source_pos(LineAndColumnIndex { - line_index: range.start.line, - column_index: range.start.character, + line_index: referrer.range.start.line, + column_index: referrer.range.start.character, }); let end_range = context.text_info().loc_to_source_pos(LineAndColumnIndex { - line_index: range.end.line, - column_index: range.end.character, + line_index: referrer.range.end.line, + column_index: referrer.range.end.character, }); let source_range = SourceRange::new(start_range, end_range); context.add_diagnostic_details( @@ -183,7 +183,7 @@ impl<'a> deno_graph::source::Resolver for SloppyImportCaptureResolver<'a> { &self, specifier_text: &str, referrer_range: &Range, - mode: ResolutionMode, + resolution_kind: ResolutionKind, ) -> Result { let resolution = self .workspace_resolver @@ -198,9 +198,9 @@ impl<'a> deno_graph::source::Resolver for SloppyImportCaptureResolver<'a> { specifier, .. } => match self.sloppy_imports_resolver.resolve( &specifier, - match mode { - ResolutionMode::Execution => SloppyImportsResolutionMode::Execution, - ResolutionMode::Types => SloppyImportsResolutionMode::Types, + match resolution_kind { + ResolutionKind::Execution => SloppyImportsResolutionKind::Execution, + ResolutionKind::Types => SloppyImportsResolutionKind::Types, }, ) { Some(res) => { diff --git a/cli/tools/registry/diagnostics.rs b/cli/tools/registry/diagnostics.rs index 733a78ddac..f2b630d782 100644 --- a/cli/tools/registry/diagnostics.rs +++ b/cli/tools/registry/diagnostics.rs @@ -234,8 +234,8 @@ impl Diagnostic for PublishDiagnostic { specifier: Cow::Borrowed(&referrer.specifier), text_info: Cow::Borrowed(text_info), source_pos: DiagnosticSourcePos::LineAndCol { - line: referrer.start.line, - column: referrer.start.character, + line: referrer.range.start.line, + column: referrer.range.start.character, }, } } @@ -300,7 +300,7 @@ impl Diagnostic for PublishDiagnostic { text_info: &'a SourceTextInfo, referrer: &'a deno_graph::Range, ) -> Option> { - if referrer.start.line == 0 && referrer.start.character == 0 { + if referrer.range.start.line == 0 && referrer.range.start.character == 0 { return None; // no range, probably a jsxImportSource import } @@ -310,12 +310,12 @@ impl Diagnostic for PublishDiagnostic { style: DiagnosticSnippetHighlightStyle::Error, range: DiagnosticSourceRange { start: DiagnosticSourcePos::LineAndCol { - line: referrer.start.line, - column: referrer.start.character, + line: referrer.range.start.line, + column: referrer.range.start.character, }, end: DiagnosticSourcePos::LineAndCol { - line: referrer.end.line, - column: referrer.end.character, + line: referrer.range.end.line, + column: referrer.range.end.character, }, }, description: Some("the specifier".into()), diff --git a/cli/tools/registry/unfurl.rs b/cli/tools/registry/unfurl.rs index 5ec726a640..90343ac656 100644 --- a/cli/tools/registry/unfurl.rs +++ b/cli/tools/registry/unfurl.rs @@ -12,7 +12,7 @@ use deno_graph::DynamicTemplatePart; use deno_graph::ParserModuleAnalyzer; use deno_graph::TypeScriptReference; use deno_package_json::PackageJsonDepValue; -use deno_resolver::sloppy_imports::SloppyImportsResolutionMode; +use deno_resolver::sloppy_imports::SloppyImportsResolutionKind; use deno_runtime::deno_node::is_builtin_node_module; use crate::resolver::CliSloppyImportsResolver; @@ -180,7 +180,7 @@ impl SpecifierUnfurler { let resolved = if let Some(sloppy_imports_resolver) = &self.sloppy_imports_resolver { sloppy_imports_resolver - .resolve(&resolved, SloppyImportsResolutionMode::Execution) + .resolve(&resolved, SloppyImportsResolutionKind::Execution) .map(|res| res.into_specifier()) .unwrap_or(resolved) } else { @@ -319,8 +319,8 @@ impl SpecifierUnfurler { } for ts_ref in &module_info.ts_references { let specifier_with_range = match ts_ref { - TypeScriptReference::Path(range) => range, - TypeScriptReference::Types(range) => range, + TypeScriptReference::Path(s) => s, + TypeScriptReference::Types { specifier, .. } => specifier, }; analyze_specifier( &specifier_with_range.text, @@ -328,10 +328,10 @@ impl SpecifierUnfurler { &mut text_changes, ); } - for specifier_with_range in &module_info.jsdoc_imports { + for jsdoc in &module_info.jsdoc_imports { analyze_specifier( - &specifier_with_range.text, - &specifier_with_range.range, + &jsdoc.specifier.text, + &jsdoc.specifier.range, &mut text_changes, ); } diff --git a/cli/tools/repl/session.rs b/cli/tools/repl/session.rs index 8e05c4abbc..26e1eeac2f 100644 --- a/cli/tools/repl/session.rs +++ b/cli/tools/repl/session.rs @@ -43,13 +43,13 @@ use deno_core::unsync::spawn; use deno_core::url::Url; use deno_core::LocalInspectorSession; use deno_core::PollEventLoopOptions; -use deno_graph::source::ResolutionMode; use deno_graph::Position; use deno_graph::PositionRange; use deno_graph::SpecifierWithRange; use deno_runtime::worker::MainWorker; use deno_semver::npm::NpmPackageReqReference; -use node_resolver::NodeModuleKind; +use node_resolver::NodeResolutionKind; +use node_resolver::ResolutionMode; use once_cell::sync::Lazy; use regex::Match; use regex::Regex; @@ -701,11 +701,6 @@ impl ReplSession { let mut collector = ImportCollector::new(); program.visit_with(&mut collector); - let referrer_range = deno_graph::Range { - specifier: self.referrer.clone(), - start: deno_graph::Position::zeroed(), - end: deno_graph::Position::zeroed(), - }; let resolved_imports = collector .imports .iter() @@ -714,9 +709,10 @@ impl ReplSession { .resolver .resolve( i, - &referrer_range, - NodeModuleKind::Esm, - ResolutionMode::Execution, + &self.referrer, + deno_graph::Position::zeroed(), + ResolutionMode::Import, + NodeResolutionKind::Execution, ) .ok() .or_else(|| ModuleSpecifier::parse(i).ok()) diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index 93b9e92d89..7e8a407cf9 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -681,14 +681,18 @@ delete Object.prototype.__proto__; getNewLine() { return "\n"; }, - resolveTypeReferenceDirectives( - typeDirectiveNames, + resolveTypeReferenceDirectiveReferences( + typeDirectiveReferences, containingFilePath, redirectedReference, options, - containingFileMode, + containingSourceFile, + _reusedNames, ) { - return typeDirectiveNames.map((arg) => { + const isCjs = + containingSourceFile?.impliedNodeFormat === ts.ModuleKind.CommonJS; + /** @type {Array} */ + const result = typeDirectiveReferences.map((arg) => { /** @type {ts.FileReference} */ const fileReference = typeof arg === "string" ? { @@ -701,16 +705,28 @@ delete Object.prototype.__proto__; /** @type {[string, ts.Extension] | undefined} */ const resolved = ops.op_resolve( containingFilePath, - containingFileMode === ts.ModuleKind.CommonJS, - [fileReference.fileName], + [ + [ + fileReference.resolutionMode == null + ? isCjs + : fileReference.resolutionMode === ts.ModuleKind.CommonJS, + fileReference.fileName, + ], + ], )?.[0]; if (resolved) { return { - primary: true, - resolvedFileName: resolved[0], + resolvedTypeReferenceDirective: { + primary: true, + resolvedFileName: resolved[0], + // todo(dsherret): we should probably be setting this + isExternalLibraryImport: undefined, + }, }; } else { - return undefined; + return { + resolvedTypeReferenceDirective: undefined, + }; } } else { return ts.resolveTypeReferenceDirective( @@ -720,41 +736,56 @@ delete Object.prototype.__proto__; host, redirectedReference, undefined, - containingFileMode ?? fileReference.resolutionMode, - ).resolvedTypeReferenceDirective; + containingSourceFile?.impliedNodeFormat ?? + fileReference.resolutionMode, + ); } }); + return result; }, - resolveModuleNames( - specifiers, + resolveModuleNameLiterals( + moduleLiterals, base, - _reusedNames, _redirectedReference, - _options, + compilerOptions, containingSourceFile, + _reusedNames, ) { + const specifiers = moduleLiterals.map((literal) => [ + ts.getModeForUsageLocation( + containingSourceFile, + literal, + compilerOptions, + ) === ts.ModuleKind.CommonJS, + literal.text, + ]); if (logDebug) { debug(`host.resolveModuleNames()`); debug(` base: ${base}`); - debug(` specifiers: ${specifiers.join(", ")}`); + debug(` specifiers: ${specifiers.map((s) => s[1]).join(", ")}`); } /** @type {Array<[string, ts.Extension] | undefined>} */ const resolved = ops.op_resolve( base, - containingSourceFile?.impliedNodeFormat === ts.ModuleKind.CommonJS, specifiers, ); if (resolved) { + /** @type {Array} */ const result = resolved.map((item) => { if (item) { const [resolvedFileName, extension] = item; return { - resolvedFileName, - extension, - isExternalLibraryImport: false, + resolvedModule: { + resolvedFileName, + extension, + // todo(dsherret): we should probably be setting this + isExternalLibraryImport: false, + }, }; } - return undefined; + return { + resolvedModule: undefined, + }; }); result.length = specifiers.length; return result; diff --git a/cli/tsc/mod.rs b/cli/tsc/mod.rs index 976d407c15..50127b093d 100644 --- a/cli/tsc/mod.rs +++ b/cli/tsc/mod.rs @@ -41,8 +41,8 @@ use deno_semver::npm::NpmPackageReqReference; use node_resolver::errors::NodeJsErrorCode; use node_resolver::errors::NodeJsErrorCoded; use node_resolver::errors::PackageSubpathResolveError; -use node_resolver::NodeModuleKind; -use node_resolver::NodeResolutionMode; +use node_resolver::NodeResolutionKind; +use node_resolver::ResolutionMode; use once_cell::sync::Lazy; use std::borrow::Cow; use std::collections::HashMap; @@ -703,10 +703,9 @@ pub struct ResolveArgs { /// The base specifier that the supplied specifier strings should be resolved /// relative to. pub base: String, - /// If the base is cjs. - pub is_base_cjs: bool, /// A list of specifiers that should be resolved. - pub specifiers: Vec, + /// (is_cjs: bool, raw_specifier: String) + pub specifiers: Vec<(bool, String)>, } #[op2] @@ -714,17 +713,9 @@ pub struct ResolveArgs { fn op_resolve( state: &mut OpState, #[string] base: String, - is_base_cjs: bool, - #[serde] specifiers: Vec, + #[serde] specifiers: Vec<(bool, String)>, ) -> Result, AnyError> { - op_resolve_inner( - state, - ResolveArgs { - base, - is_base_cjs, - specifiers, - }, - ) + op_resolve_inner(state, ResolveArgs { base, specifiers }) } #[inline] @@ -735,11 +726,6 @@ fn op_resolve_inner( let state = state.borrow_mut::(); let mut resolved: Vec<(String, &'static str)> = Vec::with_capacity(args.specifiers.len()); - let referrer_kind = if args.is_base_cjs { - NodeModuleKind::Cjs - } else { - NodeModuleKind::Esm - }; let referrer = if let Some(remapped_specifier) = state.remapped_specifiers.get(&args.base) { @@ -752,7 +738,7 @@ fn op_resolve_inner( )? }; let referrer_module = state.graph.get(&referrer); - for specifier in args.specifiers { + for (is_cjs, specifier) in args.specifiers { if specifier.starts_with("node:") { resolved.push(( MISSING_DEPENDENCY_SPECIFIER.to_string(), @@ -771,13 +757,20 @@ fn op_resolve_inner( .and_then(|m| m.js()) .and_then(|m| m.dependencies_prefer_fast_check().get(&specifier)) .and_then(|d| d.maybe_type.ok().or_else(|| d.maybe_code.ok())); + let resolution_mode = if is_cjs { + ResolutionMode::Require + } else { + ResolutionMode::Import + }; let maybe_result = match resolved_dep { Some(ResolutionResolved { specifier, .. }) => { resolve_graph_specifier_types( specifier, &referrer, - referrer_kind, + // we could get this from the resolved dep, but for now assume + // the value resolved in TypeScript is better + resolution_mode, state, )? } @@ -785,7 +778,7 @@ fn op_resolve_inner( match resolve_non_graph_specifier_types( &specifier, &referrer, - referrer_kind, + resolution_mode, state, ) { Ok(maybe_result) => maybe_result, @@ -852,7 +845,7 @@ fn op_resolve_inner( fn resolve_graph_specifier_types( specifier: &ModuleSpecifier, referrer: &ModuleSpecifier, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, state: &State, ) -> Result, AnyError> { let graph = &state.graph; @@ -908,8 +901,8 @@ fn resolve_graph_specifier_types( &package_folder, module.nv_reference.sub_path(), Some(referrer), - referrer_kind, - NodeResolutionMode::Types, + resolution_mode, + NodeResolutionKind::Types, ); let maybe_url = match res_result { Ok(url) => Some(url), @@ -949,7 +942,7 @@ enum ResolveNonGraphSpecifierTypesError { fn resolve_non_graph_specifier_types( raw_specifier: &str, referrer: &ModuleSpecifier, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, state: &State, ) -> Result< Option<(ModuleSpecifier, MediaType)>, @@ -967,8 +960,8 @@ fn resolve_non_graph_specifier_types( .resolve( raw_specifier, referrer, - referrer_kind, - NodeResolutionMode::Types, + resolution_mode, + NodeResolutionKind::Types, ) .ok() .map(|res| res.into_url()), @@ -976,7 +969,7 @@ fn resolve_non_graph_specifier_types( } else if let Ok(npm_req_ref) = NpmPackageReqReference::from_str(raw_specifier) { - debug_assert_eq!(referrer_kind, NodeModuleKind::Esm); + debug_assert_eq!(resolution_mode, ResolutionMode::Import); // todo(dsherret): add support for injecting this in the graph so // we don't need this special code here. // This could occur when resolving npm:@types/node when it is @@ -988,8 +981,8 @@ fn resolve_non_graph_specifier_types( &package_folder, npm_req_ref.sub_path(), Some(referrer), - referrer_kind, - NodeResolutionMode::Types, + resolution_mode, + NodeResolutionKind::Types, ); let maybe_url = match res_result { Ok(url) => Some(url), @@ -1388,8 +1381,7 @@ mod tests { &mut state, ResolveArgs { base: "https://deno.land/x/a.ts".to_string(), - is_base_cjs: false, - specifiers: vec!["./b.ts".to_string()], + specifiers: vec![(false, "./b.ts".to_string())], }, ) .expect("should have invoked op"); @@ -1408,8 +1400,7 @@ mod tests { &mut state, ResolveArgs { base: "https://deno.land/x/a.ts".to_string(), - is_base_cjs: false, - specifiers: vec!["./bad.ts".to_string()], + specifiers: vec![(false, "./bad.ts".to_string())], }, ) .expect("should have not errored"); diff --git a/cli/worker.rs b/cli/worker.rs index e79ed61422..161d8bcc21 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -44,8 +44,8 @@ use deno_runtime::WorkerLogLevel; use deno_semver::npm::NpmPackageReqReference; use deno_telemetry::OtelConfig; use deno_terminal::colors; -use node_resolver::NodeModuleKind; -use node_resolver::NodeResolutionMode; +use node_resolver::NodeResolutionKind; +use node_resolver::ResolutionMode; use tokio::select; use crate::args::CliLockfile; @@ -698,8 +698,8 @@ impl CliMainWorkerFactory { package_folder, sub_path, /* referrer */ None, - NodeModuleKind::Esm, - NodeResolutionMode::Execution, + ResolutionMode::Import, + NodeResolutionKind::Execution, )?; if specifier .to_file_path() diff --git a/ext/node/ops/require.rs b/ext/node/ops/require.rs index f8de07a3be..64dc4423ae 100644 --- a/ext/node/ops/require.rs +++ b/ext/node/ops/require.rs @@ -8,13 +8,13 @@ use deno_core::v8; use deno_core::JsRuntimeInspector; use deno_core::OpState; use deno_fs::FileSystemRc; -use deno_package_json::NodeModuleKind; use deno_package_json::PackageJsonRc; use deno_path_util::normalize_path; use deno_path_util::url_from_file_path; use deno_path_util::url_to_file_path; use node_resolver::errors::ClosestPkgJsonError; -use node_resolver::NodeResolutionMode; +use node_resolver::NodeResolutionKind; +use node_resolver::ResolutionMode; use node_resolver::REQUIRE_CONDITIONS; use std::borrow::Cow; use std::cell::RefCell; @@ -462,9 +462,9 @@ where &expansion, exports, Some(&referrer), - NodeModuleKind::Cjs, + ResolutionMode::Require, REQUIRE_CONDITIONS, - NodeResolutionMode::Execution, + NodeResolutionKind::Execution, )?; Ok(Some(if r.scheme() == "file" { url_to_file_path_string(&r)? @@ -559,9 +559,9 @@ where &format!(".{expansion}"), exports, referrer.as_ref(), - NodeModuleKind::Cjs, + ResolutionMode::Require, REQUIRE_CONDITIONS, - NodeResolutionMode::Execution, + NodeResolutionKind::Execution, )?; Ok(Some(if r.scheme() == "file" { url_to_file_path_string(&r)? @@ -630,10 +630,10 @@ where let url = node_resolver.package_imports_resolve( &request, Some(&referrer_url), - NodeModuleKind::Cjs, + ResolutionMode::Require, Some(&pkg), REQUIRE_CONDITIONS, - NodeResolutionMode::Execution, + NodeResolutionKind::Execution, )?; Ok(Some(url_to_file_path_string(&url)?)) } else { diff --git a/resolvers/deno/cjs.rs b/resolvers/deno/cjs.rs index dbcbd8b6bf..e322036dfe 100644 --- a/resolvers/deno/cjs.rs +++ b/resolvers/deno/cjs.rs @@ -7,8 +7,8 @@ use deno_media_type::MediaType; use node_resolver::env::NodeResolverEnv; use node_resolver::errors::ClosestPkgJsonError; use node_resolver::InNpmPackageChecker; -use node_resolver::NodeModuleKind; use node_resolver::PackageJsonResolver; +use node_resolver::ResolutionMode; use url::Url; /// Keeps track of what module specifiers were resolved as CJS. @@ -19,7 +19,7 @@ use url::Url; #[derive(Debug)] pub struct CjsTracker { is_cjs_resolver: IsCjsResolver, - known: DashMap, + known: DashMap, } impl CjsTracker { @@ -70,42 +70,42 @@ impl CjsTracker { is_script: Option, ) -> Result { let kind = match self - .get_known_kind_with_is_script(specifier, media_type, is_script) + .get_known_mode_with_is_script(specifier, media_type, is_script) { Some(kind) => kind, None => self.is_cjs_resolver.check_based_on_pkg_json(specifier)?, }; - Ok(kind == NodeModuleKind::Cjs) + Ok(kind == ResolutionMode::Require) } /// Gets the referrer for the specified module specifier. /// /// Generally the referrer should already be tracked by calling /// `is_cjs_with_known_is_script` before calling this method. - pub fn get_referrer_kind(&self, specifier: &Url) -> NodeModuleKind { + pub fn get_referrer_kind(&self, specifier: &Url) -> ResolutionMode { if specifier.scheme() != "file" { - return NodeModuleKind::Esm; + return ResolutionMode::Import; } self - .get_known_kind(specifier, MediaType::from_specifier(specifier)) - .unwrap_or(NodeModuleKind::Esm) + .get_known_mode(specifier, MediaType::from_specifier(specifier)) + .unwrap_or(ResolutionMode::Import) } - fn get_known_kind( + fn get_known_mode( &self, specifier: &Url, media_type: MediaType, - ) -> Option { - self.get_known_kind_with_is_script(specifier, media_type, None) + ) -> Option { + self.get_known_mode_with_is_script(specifier, media_type, None) } - fn get_known_kind_with_is_script( + fn get_known_mode_with_is_script( &self, specifier: &Url, media_type: MediaType, is_script: Option, - ) -> Option { - self.is_cjs_resolver.get_known_kind_with_is_script( + ) -> Option { + self.is_cjs_resolver.get_known_mode_with_is_script( specifier, media_type, is_script, @@ -141,25 +141,25 @@ impl IsCjsResolver { } } - /// Gets the referrer kind for a script in the LSP. - pub fn get_lsp_referrer_kind( + /// Gets the resolution mode for a module in the LSP. + pub fn get_lsp_resolution_mode( &self, specifier: &Url, is_script: Option, - ) -> NodeModuleKind { + ) -> ResolutionMode { if specifier.scheme() != "file" { - return NodeModuleKind::Esm; + return ResolutionMode::Import; } match MediaType::from_specifier(specifier) { - MediaType::Mts | MediaType::Mjs | MediaType::Dmts => NodeModuleKind::Esm, - MediaType::Cjs | MediaType::Cts | MediaType::Dcts => NodeModuleKind::Cjs, + MediaType::Mts | MediaType::Mjs | MediaType::Dmts => ResolutionMode::Import, + MediaType::Cjs | MediaType::Cts | MediaType::Dcts => ResolutionMode::Require, MediaType::Dts => { // dts files are always determined based on the package.json because // they contain imports/exports even when considered CJS - self.check_based_on_pkg_json(specifier).unwrap_or(NodeModuleKind::Esm) + self.check_based_on_pkg_json(specifier).unwrap_or(ResolutionMode::Import) } MediaType::Wasm | - MediaType::Json => NodeModuleKind::Esm, + MediaType::Json => ResolutionMode::Import, MediaType::JavaScript | MediaType::Jsx | MediaType::TypeScript @@ -169,27 +169,27 @@ impl IsCjsResolver { | MediaType::SourceMap | MediaType::Unknown => { match is_script { - Some(true) => self.check_based_on_pkg_json(specifier).unwrap_or(NodeModuleKind::Esm), - Some(false) | None => NodeModuleKind::Esm, + Some(true) => self.check_based_on_pkg_json(specifier).unwrap_or(ResolutionMode::Import), + Some(false) | None => ResolutionMode::Import, } } } } - fn get_known_kind_with_is_script( + fn get_known_mode_with_is_script( &self, specifier: &Url, media_type: MediaType, is_script: Option, - known_cache: &DashMap, - ) -> Option { + known_cache: &DashMap, + ) -> Option { if specifier.scheme() != "file" { - return Some(NodeModuleKind::Esm); + return Some(ResolutionMode::Import); } match media_type { - MediaType::Mts | MediaType::Mjs | MediaType::Dmts => Some(NodeModuleKind::Esm), - MediaType::Cjs | MediaType::Cts | MediaType::Dcts => Some(NodeModuleKind::Cjs), + MediaType::Mts | MediaType::Mjs | MediaType::Dmts => Some(ResolutionMode::Import), + MediaType::Cjs | MediaType::Cts | MediaType::Dcts => Some(ResolutionMode::Require), MediaType::Dts => { // dts files are always determined based on the package.json because // they contain imports/exports even when considered CJS @@ -200,11 +200,11 @@ impl IsCjsResolver { if let Some(value) = value { known_cache.insert(specifier.clone(), value); } - Some(value.unwrap_or(NodeModuleKind::Esm)) + Some(value.unwrap_or(ResolutionMode::Import)) } } MediaType::Wasm | - MediaType::Json => Some(NodeModuleKind::Esm), + MediaType::Json => Some(ResolutionMode::Import), MediaType::JavaScript | MediaType::Jsx | MediaType::TypeScript @@ -214,17 +214,17 @@ impl IsCjsResolver { | MediaType::SourceMap | MediaType::Unknown => { if let Some(value) = known_cache.get(specifier).map(|v| *v) { - if value == NodeModuleKind::Cjs && is_script == Some(false) { + if value == ResolutionMode::Require && is_script == Some(false) { // we now know this is actually esm - known_cache.insert(specifier.clone(), NodeModuleKind::Esm); - Some(NodeModuleKind::Esm) + known_cache.insert(specifier.clone(), ResolutionMode::Import); + Some(ResolutionMode::Import) } else { Some(value) } } else if is_script == Some(false) { // we know this is esm - known_cache.insert(specifier.clone(), NodeModuleKind::Esm); - Some(NodeModuleKind::Esm) + known_cache.insert(specifier.clone(), ResolutionMode::Import); + Some(ResolutionMode::Import) } else { None } @@ -235,19 +235,19 @@ impl IsCjsResolver { fn check_based_on_pkg_json( &self, specifier: &Url, - ) -> Result { + ) -> Result { if self.in_npm_pkg_checker.in_npm_package(specifier) { if let Some(pkg_json) = self.pkg_json_resolver.get_closest_package_json(specifier)? { let is_file_location_cjs = pkg_json.typ != "module"; Ok(if is_file_location_cjs { - NodeModuleKind::Cjs + ResolutionMode::Require } else { - NodeModuleKind::Esm + ResolutionMode::Import }) } else { - Ok(NodeModuleKind::Cjs) + Ok(ResolutionMode::Require) } } else if self.options.detect_cjs || self.options.is_node_main { if let Some(pkg_json) = @@ -256,17 +256,17 @@ impl IsCjsResolver { let is_cjs_type = pkg_json.typ == "commonjs" || self.options.is_node_main && pkg_json.typ == "none"; Ok(if is_cjs_type { - NodeModuleKind::Cjs + ResolutionMode::Require } else { - NodeModuleKind::Esm + ResolutionMode::Import }) } else if self.options.is_node_main { - Ok(NodeModuleKind::Cjs) + Ok(ResolutionMode::Require) } else { - Ok(NodeModuleKind::Esm) + Ok(ResolutionMode::Import) } } else { - Ok(NodeModuleKind::Esm) + Ok(ResolutionMode::Import) } } } diff --git a/resolvers/deno/lib.rs b/resolvers/deno/lib.rs index 303a827102..661caf836d 100644 --- a/resolvers/deno/lib.rs +++ b/resolvers/deno/lib.rs @@ -20,10 +20,10 @@ use node_resolver::env::NodeResolverEnv; use node_resolver::errors::NodeResolveError; use node_resolver::errors::PackageSubpathResolveError; use node_resolver::InNpmPackageChecker; -use node_resolver::NodeModuleKind; use node_resolver::NodeResolution; -use node_resolver::NodeResolutionMode; +use node_resolver::NodeResolutionKind; use node_resolver::NodeResolver; +use node_resolver::ResolutionMode; use npm::MissingPackageNodeModulesFolderError; use npm::NodeModulesOutOfDateError; use npm::NpmReqResolver; @@ -31,7 +31,7 @@ use npm::ResolveIfForNpmPackageErrorKind; use npm::ResolvePkgFolderFromDenoReqError; use npm::ResolveReqWithSubPathErrorKind; use sloppy_imports::SloppyImportResolverFs; -use sloppy_imports::SloppyImportsResolutionMode; +use sloppy_imports::SloppyImportsResolutionKind; use sloppy_imports::SloppyImportsResolver; use thiserror::Error; use url::Url; @@ -145,8 +145,8 @@ impl< &self, raw_specifier: &str, referrer: &Url, - referrer_kind: NodeModuleKind, - mode: NodeResolutionMode, + resolution_mode: ResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { let mut found_package_json_dep = false; let mut maybe_diagnostic = None; @@ -157,7 +157,7 @@ impl< && self.in_npm_pkg_checker.in_npm_package(referrer) { return node_resolver - .resolve(raw_specifier, referrer, referrer_kind, mode) + .resolve(raw_specifier, referrer, resolution_mode, resolution_kind) .map(|res| DenoResolution { url: res.into_url(), found_package_json_dep, @@ -189,12 +189,12 @@ impl< sloppy_imports_resolver .resolve( &specifier, - match mode { - NodeResolutionMode::Execution => { - SloppyImportsResolutionMode::Execution + match resolution_kind { + NodeResolutionKind::Execution => { + SloppyImportsResolutionKind::Execution } - NodeResolutionMode::Types => { - SloppyImportsResolutionMode::Types + NodeResolutionKind::Types => { + SloppyImportsResolutionKind::Types } }, ) @@ -221,8 +221,8 @@ impl< pkg_json.dir_path(), sub_path.as_deref(), Some(referrer), - referrer_kind, - mode, + resolution_mode, + resolution_kind, ) .map_err(|e| e.into()), MappedResolution::PackageJson { @@ -272,8 +272,8 @@ impl< pkg_folder, sub_path.as_deref(), Some(referrer), - referrer_kind, - mode, + resolution_mode, + resolution_kind, ) .map_err(|e| { DenoResolveErrorKind::PackageSubpathResolve(e).into_box() @@ -328,8 +328,8 @@ impl< pkg_folder, npm_req_ref.sub_path(), Some(referrer), - referrer_kind, - mode, + resolution_mode, + resolution_kind, ) .map(|url| DenoResolution { url, @@ -345,8 +345,8 @@ impl< .resolve_req_reference( &npm_req_ref, referrer, - referrer_kind, - mode, + resolution_mode, + resolution_kind, ) .map(|url| DenoResolution { url, @@ -384,8 +384,8 @@ impl< .resolve_if_for_npm_pkg( raw_specifier, referrer, - referrer_kind, - mode, + resolution_mode, + resolution_kind, ) .map_err(|e| match e.into_kind() { ResolveIfForNpmPackageErrorKind::NodeResolve(e) => { diff --git a/resolvers/deno/npm/mod.rs b/resolvers/deno/npm/mod.rs index 09e35b15c3..83db04480a 100644 --- a/resolvers/deno/npm/mod.rs +++ b/resolvers/deno/npm/mod.rs @@ -16,10 +16,10 @@ use node_resolver::errors::PackageNotFoundError; use node_resolver::errors::PackageResolveErrorKind; use node_resolver::errors::PackageSubpathResolveError; use node_resolver::InNpmPackageChecker; -use node_resolver::NodeModuleKind; use node_resolver::NodeResolution; -use node_resolver::NodeResolutionMode; +use node_resolver::NodeResolutionKind; use node_resolver::NodeResolver; +use node_resolver::ResolutionMode; use thiserror::Error; use url::Url; @@ -132,15 +132,15 @@ impl &self, req_ref: &NpmPackageReqReference, referrer: &Url, - referrer_kind: NodeModuleKind, - mode: NodeResolutionMode, + resolution_mode: ResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { self.resolve_req_with_sub_path( req_ref.req(), req_ref.sub_path(), referrer, - referrer_kind, - mode, + resolution_mode, + resolution_kind, ) } @@ -149,8 +149,8 @@ impl req: &PackageReq, sub_path: Option<&str>, referrer: &Url, - referrer_kind: NodeModuleKind, - mode: NodeResolutionMode, + resolution_mode: ResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { let package_folder = self .npm_resolver @@ -160,8 +160,8 @@ impl &package_folder, sub_path, Some(referrer), - referrer_kind, - mode, + resolution_mode, + resolution_kind, ); match resolution_result { Ok(url) => Ok(url), @@ -183,13 +183,15 @@ impl &self, specifier: &str, referrer: &Url, - referrer_kind: NodeModuleKind, - mode: NodeResolutionMode, + resolution_mode: ResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result, ResolveIfForNpmPackageError> { - let resolution_result = - self - .node_resolver - .resolve(specifier, referrer, referrer_kind, mode); + let resolution_result = self.node_resolver.resolve( + specifier, + referrer, + resolution_mode, + resolution_kind, + ); match resolution_result { Ok(res) => Ok(Some(res)), Err(err) => { diff --git a/resolvers/deno/sloppy_imports.rs b/resolvers/deno/sloppy_imports.rs index 7aba5b771a..ccaa547435 100644 --- a/resolvers/deno/sloppy_imports.rs +++ b/resolvers/deno/sloppy_imports.rs @@ -80,16 +80,16 @@ impl SloppyImportsResolution { /// The kind of resolution currently being done. #[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum SloppyImportsResolutionMode { +pub enum SloppyImportsResolutionKind { /// Resolving for code that will be executed. Execution, /// Resolving for code that will be used for type information. Types, } -impl SloppyImportsResolutionMode { +impl SloppyImportsResolutionKind { pub fn is_types(&self) -> bool { - *self == SloppyImportsResolutionMode::Types + *self == SloppyImportsResolutionKind::Types } } @@ -114,7 +114,7 @@ impl SloppyImportsResolver { pub fn resolve( &self, specifier: &Url, - mode: SloppyImportsResolutionMode, + resolution_kind: SloppyImportsResolutionKind, ) -> Option { fn path_without_ext( path: &Path, @@ -167,7 +167,7 @@ impl SloppyImportsResolver { let probe_paths: Vec<(PathBuf, SloppyImportsResolutionReason)> = match self.fs.stat_sync(&path) { Some(SloppyImportsFsEntry::File) => { - if mode.is_types() { + if resolution_kind.is_types() { let media_type = MediaType::from_specifier(specifier); // attempt to resolve the .d.ts file before the .js file let probe_media_type_types = match media_type { @@ -197,7 +197,7 @@ impl SloppyImportsResolver { let media_type = MediaType::from_specifier(specifier); let probe_media_type_types = match media_type { MediaType::JavaScript => ( - if mode.is_types() { + if resolution_kind.is_types() { vec![MediaType::TypeScript, MediaType::Tsx, MediaType::Dts] } else { vec![MediaType::TypeScript, MediaType::Tsx] @@ -208,7 +208,7 @@ impl SloppyImportsResolver { (vec![MediaType::Tsx], SloppyImportsResolutionReason::JsToTs) } MediaType::Mjs => ( - if mode.is_types() { + if resolution_kind.is_types() { vec![MediaType::Mts, MediaType::Dmts, MediaType::Dts] } else { vec![MediaType::Mts] @@ -216,7 +216,7 @@ impl SloppyImportsResolver { SloppyImportsResolutionReason::JsToTs, ), MediaType::Cjs => ( - if mode.is_types() { + if resolution_kind.is_types() { vec![MediaType::Cts, MediaType::Dcts, MediaType::Dts] } else { vec![MediaType::Cts] @@ -237,7 +237,7 @@ impl SloppyImportsResolver { return None; } MediaType::Unknown => ( - if mode.is_types() { + if resolution_kind.is_types() { vec![ MediaType::TypeScript, MediaType::Tsx, @@ -274,7 +274,7 @@ impl SloppyImportsResolver { if matches!(entry, Some(SloppyImportsFsEntry::Dir)) { // try to resolve at the index file - if mode.is_types() { + if resolution_kind.is_types() { probe_paths.push(( path.join("index.ts"), SloppyImportsResolutionReason::Directory, @@ -373,16 +373,22 @@ mod test { #[test] fn test_unstable_sloppy_imports() { fn resolve(specifier: &Url) -> Option { - resolve_with_mode(specifier, SloppyImportsResolutionMode::Execution) + resolve_with_resolution_kind( + specifier, + SloppyImportsResolutionKind::Execution, + ) } fn resolve_types(specifier: &Url) -> Option { - resolve_with_mode(specifier, SloppyImportsResolutionMode::Types) + resolve_with_resolution_kind( + specifier, + SloppyImportsResolutionKind::Types, + ) } - fn resolve_with_mode( + fn resolve_with_resolution_kind( specifier: &Url, - mode: SloppyImportsResolutionMode, + resolution_kind: SloppyImportsResolutionKind, ) -> Option { struct RealSloppyImportsResolverFs; impl SloppyImportResolverFs for RealSloppyImportsResolverFs { @@ -400,7 +406,7 @@ mod test { } SloppyImportsResolver::new(RealSloppyImportsResolverFs) - .resolve(specifier, mode) + .resolve(specifier, resolution_kind) } let context = TestContext::default(); diff --git a/resolvers/node/analyze.rs b/resolvers/node/analyze.rs index 9126890805..a444f4d923 100644 --- a/resolvers/node/analyze.rs +++ b/resolvers/node/analyze.rs @@ -21,11 +21,11 @@ use url::Url; use crate::env::NodeResolverEnv; use crate::npm::InNpmPackageCheckerRc; use crate::resolution::NodeResolverRc; -use crate::NodeModuleKind; -use crate::NodeResolutionMode; +use crate::NodeResolutionKind; use crate::NpmPackageFolderResolverRc; use crate::PackageJsonResolverRc; use crate::PathClean; +use crate::ResolutionMode; #[derive(Debug, Clone)] pub enum CjsAnalysis<'a> { @@ -209,7 +209,7 @@ impl // FIXME(bartlomieju): check if these conditions are okay, probably // should be `deno-require`, because `deno` is already used in `esm_resolver.rs` &["deno", "node", "require", "default"], - NodeResolutionMode::Execution, + NodeResolutionKind::Execution, ); let reexport_specifier = match result { Ok(Some(specifier)) => specifier, @@ -303,7 +303,7 @@ impl specifier: &str, referrer: &Url, conditions: &[&str], - mode: NodeResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result, AnyError> { if specifier.starts_with('/') { todo!(); @@ -354,9 +354,9 @@ impl &package_subpath, exports, Some(referrer), - NodeModuleKind::Esm, + ResolutionMode::Import, conditions, - mode, + resolution_kind, ) .map_err(AnyError::from), ) @@ -373,7 +373,9 @@ impl .pkg_json_resolver .load_package_json(&package_json_path)?; if let Some(package_json) = maybe_package_json { - if let Some(main) = package_json.main(NodeModuleKind::Cjs) { + if let Some(main) = + package_json.main(deno_package_json::NodeModuleKind::Cjs) + { return Ok(Some(url_from_file_path(&d.join(main).clean())?)); } } @@ -384,7 +386,9 @@ impl .file_extension_probe(d, &referrer_path) .and_then(|p| url_from_file_path(&p).map_err(AnyError::from)) .map(Some); - } else if let Some(main) = package_json.main(NodeModuleKind::Cjs) { + } else if let Some(main) = + package_json.main(deno_package_json::NodeModuleKind::Cjs) + { return Ok(Some(url_from_file_path(&module_dir.join(main).clean())?)); } else { return Ok(Some(url_from_file_path( diff --git a/resolvers/node/errors.rs b/resolvers/node/errors.rs index 0f332d2c93..600a365a8f 100644 --- a/resolvers/node/errors.rs +++ b/resolvers/node/errors.rs @@ -8,8 +8,8 @@ use boxed_error::Boxed; use thiserror::Error; use url::Url; -use crate::NodeModuleKind; -use crate::NodeResolutionMode; +use crate::NodeResolutionKind; +use crate::ResolutionMode; #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] #[allow(non_camel_case_types)] @@ -203,24 +203,24 @@ pub enum PackageSubpathResolveErrorKind { maybe_referrer.as_ref().map(|r| format!( " from{} referrer {}", - match referrer_kind { - NodeModuleKind::Esm => "", - NodeModuleKind::Cjs => " cjs", + match resolution_mode { + ResolutionMode::Import => "", + ResolutionMode::Require => " cjs", }, r ) ).unwrap_or_default(), - match mode { - NodeResolutionMode::Execution => "", - NodeResolutionMode::Types => " for types", + match resolution_kind { + NodeResolutionKind::Execution => "", + NodeResolutionKind::Types => " for types", } )] pub struct PackageTargetNotFoundError { pub pkg_json_path: PathBuf, pub target: String, pub maybe_referrer: Option, - pub referrer_kind: NodeModuleKind, - pub mode: NodeResolutionMode, + pub resolution_mode: ResolutionMode, + pub resolution_kind: NodeResolutionKind, } impl NodeJsErrorCoded for PackageTargetNotFoundError { @@ -586,7 +586,7 @@ pub struct PackagePathNotExportedError { pub pkg_json_path: PathBuf, pub subpath: String, pub maybe_referrer: Option, - pub mode: NodeResolutionMode, + pub resolution_kind: NodeResolutionKind, } impl NodeJsErrorCoded for PackagePathNotExportedError { @@ -603,9 +603,9 @@ impl std::fmt::Display for PackagePathNotExportedError { f.write_str(self.code().as_str())?; f.write_char(']')?; - let types_msg = match self.mode { - NodeResolutionMode::Execution => String::new(), - NodeResolutionMode::Types => " for types".to_string(), + let types_msg = match self.resolution_kind { + NodeResolutionKind::Execution => String::new(), + NodeResolutionKind::Types => " for types".to_string(), }; if self.subpath == "." { write!( @@ -678,7 +678,7 @@ mod test { pkg_json_path: PathBuf::from("test_path").join("package.json"), subpath: "./jsx-runtime".to_string(), maybe_referrer: None, - mode: NodeResolutionMode::Types + resolution_kind: NodeResolutionKind::Types }.to_string(), format!("[ERR_PACKAGE_PATH_NOT_EXPORTED] Package subpath './jsx-runtime' is not defined for types by \"exports\" in 'test_path{separator_char}package.json'") ); @@ -687,7 +687,7 @@ mod test { pkg_json_path: PathBuf::from("test_path").join("package.json"), subpath: ".".to_string(), maybe_referrer: None, - mode: NodeResolutionMode::Types + resolution_kind: NodeResolutionKind::Types }.to_string(), format!("[ERR_PACKAGE_PATH_NOT_EXPORTED] No \"exports\" main defined for types in 'test_path{separator_char}package.json'") ); diff --git a/resolvers/node/lib.rs b/resolvers/node/lib.rs index 87bd629946..8da20c421e 100644 --- a/resolvers/node/lib.rs +++ b/resolvers/node/lib.rs @@ -23,9 +23,9 @@ pub use package_json::PackageJsonThreadLocalCache; pub use path::PathClean; pub use resolution::parse_npm_pkg_name; pub use resolution::resolve_specifier_into_node_modules; -pub use resolution::NodeModuleKind; pub use resolution::NodeResolution; -pub use resolution::NodeResolutionMode; +pub use resolution::NodeResolutionKind; pub use resolution::NodeResolver; +pub use resolution::ResolutionMode; pub use resolution::DEFAULT_CONDITIONS; pub use resolution::REQUIRE_CONDITIONS; diff --git a/resolvers/node/resolution.rs b/resolvers/node/resolution.rs index c2ec25aca4..5f87698cd6 100644 --- a/resolvers/node/resolution.rs +++ b/resolvers/node/resolution.rs @@ -50,26 +50,30 @@ pub static DEFAULT_CONDITIONS: &[&str] = &["deno", "node", "import"]; pub static REQUIRE_CONDITIONS: &[&str] = &["require", "node"]; static TYPES_ONLY_CONDITIONS: &[&str] = &["types"]; -fn conditions_from_module_kind( - kind: NodeModuleKind, +fn conditions_from_resolution_mode( + resolution_mode: ResolutionMode, ) -> &'static [&'static str] { - match kind { - NodeModuleKind::Esm => DEFAULT_CONDITIONS, - NodeModuleKind::Cjs => REQUIRE_CONDITIONS, + match resolution_mode { + ResolutionMode::Import => DEFAULT_CONDITIONS, + ResolutionMode::Require => REQUIRE_CONDITIONS, } } -pub type NodeModuleKind = deno_package_json::NodeModuleKind; +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum ResolutionMode { + Import, + Require, +} -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum NodeResolutionMode { +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub enum NodeResolutionKind { Execution, Types, } -impl NodeResolutionMode { +impl NodeResolutionKind { pub fn is_types(&self) -> bool { - matches!(self, NodeResolutionMode::Types) + matches!(self, NodeResolutionKind::Types) } } @@ -130,8 +134,8 @@ impl NodeResolver { &self, specifier: &str, referrer: &Url, - referrer_kind: NodeModuleKind, - mode: NodeResolutionMode, + resolution_mode: ResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { // Note: if we are here, then the referrer is an esm module // TODO(bartlomieju): skipped "policy" part as we don't plan to support it @@ -174,14 +178,18 @@ impl NodeResolver { let url = self.module_resolve( specifier, referrer, - referrer_kind, - conditions_from_module_kind(referrer_kind), - mode, + resolution_mode, + conditions_from_resolution_mode(resolution_mode), + resolution_kind, )?; - let url = if mode.is_types() { + let url = if resolution_kind.is_types() { let file_path = to_file_path(&url); - self.path_to_declaration_url(&file_path, Some(referrer), referrer_kind)? + self.path_to_declaration_url( + &file_path, + Some(referrer), + resolution_mode, + )? } else { url }; @@ -197,9 +205,9 @@ impl NodeResolver { &self, specifier: &str, referrer: &Url, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, conditions: &[&str], - mode: NodeResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { if should_be_treated_as_relative_or_absolute_path(specifier) { Ok(node_join_url(referrer, specifier).map_err(|err| { @@ -218,10 +226,10 @@ impl NodeResolver { Ok(self.package_imports_resolve( specifier, Some(referrer), - referrer_kind, + resolution_mode, pkg_config.as_deref(), conditions, - mode, + resolution_kind, )?) } else if let Ok(resolved) = Url::parse(specifier) { Ok(resolved) @@ -229,9 +237,9 @@ impl NodeResolver { Ok(self.package_resolve( specifier, referrer, - referrer_kind, + resolution_mode, conditions, - mode, + resolution_kind, )?) } } @@ -307,8 +315,8 @@ impl NodeResolver { package_dir: &Path, package_subpath: Option<&str>, maybe_referrer: Option<&Url>, - referrer_kind: NodeModuleKind, - mode: NodeResolutionMode, + resolution_mode: ResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { let package_subpath = package_subpath .map(|s| format!("./{s}")) @@ -317,9 +325,9 @@ impl NodeResolver { package_dir, &package_subpath, maybe_referrer, - referrer_kind, - conditions_from_module_kind(referrer_kind), - mode, + resolution_mode, + conditions_from_resolution_mode(resolution_mode), + resolution_kind, )?; // TODO(bartlomieju): skipped checking errors for commonJS resolution and // "preserveSymlinksMain"/"preserveSymlinks" options. @@ -385,13 +393,13 @@ impl NodeResolver { &self, path: &Path, maybe_referrer: Option<&Url>, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, ) -> Result { fn probe_extensions( fs: &TEnv, path: &Path, lowercase_path: &str, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, ) -> Option { let mut searched_for_d_mts = false; let mut searched_for_d_cts = false; @@ -414,11 +422,11 @@ impl NodeResolver { return Some(dts_path); } - let specific_dts_path = match referrer_kind { - NodeModuleKind::Cjs if !searched_for_d_cts => { + let specific_dts_path = match resolution_mode { + ResolutionMode::Require if !searched_for_d_cts => { Some(with_known_extension(path, "d.cts")) } - NodeModuleKind::Esm if !searched_for_d_mts => { + ResolutionMode::Import if !searched_for_d_mts => { Some(with_known_extension(path, "d.mts")) } _ => None, // already searched above @@ -439,7 +447,7 @@ impl NodeResolver { return Ok(url_from_file_path(path).unwrap()); } if let Some(path) = - probe_extensions(&self.env, path, &lowercase_path, referrer_kind) + probe_extensions(&self.env, path, &lowercase_path, resolution_mode) { return Ok(url_from_file_path(&path).unwrap()); } @@ -448,9 +456,9 @@ impl NodeResolver { path, /* sub path */ ".", maybe_referrer, - referrer_kind, - conditions_from_module_kind(referrer_kind), - NodeResolutionMode::Types, + resolution_mode, + conditions_from_resolution_mode(resolution_mode), + NodeResolutionKind::Types, ); if let Ok(resolution) = resolution_result { return Ok(resolution); @@ -460,7 +468,7 @@ impl NodeResolver { &self.env, &index_path, &index_path.to_string_lossy().to_lowercase(), - referrer_kind, + resolution_mode, ) { return Ok(url_from_file_path(&path).unwrap()); } @@ -480,10 +488,10 @@ impl NodeResolver { &self, name: &str, maybe_referrer: Option<&Url>, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, referrer_pkg_json: Option<&PackageJson>, conditions: &[&str], - mode: NodeResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { if name == "#" || name.starts_with("#/") || name.ends_with('/') { let reason = "is not a valid internal imports specifier name"; @@ -509,11 +517,11 @@ impl NodeResolver { "", name, maybe_referrer, - referrer_kind, + resolution_mode, false, true, conditions, - mode, + resolution_kind, )?; if let Some(resolved) = maybe_resolved { return Ok(resolved); @@ -549,11 +557,11 @@ impl NodeResolver { best_match_subpath.unwrap(), best_match, maybe_referrer, - referrer_kind, + resolution_mode, true, true, conditions, - mode, + resolution_kind, )?; if let Some(resolved) = maybe_resolved { return Ok(resolved); @@ -581,11 +589,11 @@ impl NodeResolver { match_: &str, package_json_path: &Path, maybe_referrer: Option<&Url>, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, pattern: bool, internal: bool, conditions: &[&str], - mode: NodeResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { if !subpath.is_empty() && !pattern && !target.ends_with('/') { return Err( @@ -626,9 +634,9 @@ impl NodeResolver { let result = match self.package_resolve( &export_target, &package_json_url, - referrer_kind, + resolution_mode, conditions, - mode, + resolution_kind, ) { Ok(url) => Ok(url), Err(err) => match err.code() { @@ -649,8 +657,8 @@ impl NodeResolver { pkg_json_path: package_json_path.to_path_buf(), target: export_target.to_string(), maybe_referrer: maybe_referrer.map(ToOwned::to_owned), - referrer_kind, - mode, + resolution_mode, + resolution_kind, }, ) .into(), @@ -746,11 +754,11 @@ impl NodeResolver { subpath: &str, package_subpath: &str, maybe_referrer: Option<&Url>, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, pattern: bool, internal: bool, conditions: &[&str], - mode: NodeResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result, PackageTargetResolveError> { let result = self.resolve_package_target_inner( package_json_path, @@ -758,16 +766,16 @@ impl NodeResolver { subpath, package_subpath, maybe_referrer, - referrer_kind, + resolution_mode, pattern, internal, conditions, - mode, + resolution_kind, ); match result { Ok(maybe_resolved) => Ok(maybe_resolved), Err(err) => { - if mode.is_types() + if resolution_kind.is_types() && err.code() == NodeJsErrorCode::ERR_TYPES_NOT_FOUND && conditions != TYPES_ONLY_CONDITIONS { @@ -779,11 +787,11 @@ impl NodeResolver { subpath, package_subpath, maybe_referrer, - referrer_kind, + resolution_mode, pattern, internal, TYPES_ONLY_CONDITIONS, - mode, + resolution_kind, ) { return Ok(Some(resolved)); } @@ -802,11 +810,11 @@ impl NodeResolver { subpath: &str, package_subpath: &str, maybe_referrer: Option<&Url>, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, pattern: bool, internal: bool, conditions: &[&str], - mode: NodeResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result, PackageTargetResolveError> { if let Some(target) = target.as_str() { let url = self.resolve_package_target_string( @@ -815,18 +823,18 @@ impl NodeResolver { package_subpath, package_json_path, maybe_referrer, - referrer_kind, + resolution_mode, pattern, internal, conditions, - mode, + resolution_kind, )?; - if mode.is_types() && url.scheme() == "file" { + if resolution_kind.is_types() && url.scheme() == "file" { let path = deno_path_util::url_to_file_path(&url).unwrap(); return Ok(Some(self.path_to_declaration_url( &path, maybe_referrer, - referrer_kind, + resolution_mode, )?)); } else { return Ok(Some(url)); @@ -844,11 +852,11 @@ impl NodeResolver { subpath, package_subpath, maybe_referrer, - referrer_kind, + resolution_mode, pattern, internal, conditions, - mode, + resolution_kind, ); match resolved_result { @@ -882,7 +890,7 @@ impl NodeResolver { if key == "default" || conditions.contains(&key.as_str()) - || mode.is_types() && key.as_str() == "types" + || resolution_kind.is_types() && key.as_str() == "types" { let condition_target = target_obj.get(key).unwrap(); @@ -892,11 +900,11 @@ impl NodeResolver { subpath, package_subpath, maybe_referrer, - referrer_kind, + resolution_mode, pattern, internal, conditions, - mode, + resolution_kind, )?; match resolved { Some(resolved) => return Ok(Some(resolved)), @@ -929,9 +937,9 @@ impl NodeResolver { package_subpath: &str, package_exports: &Map, maybe_referrer: Option<&Url>, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, conditions: &[&str], - mode: NodeResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { if package_exports.contains_key(package_subpath) && package_subpath.find('*').is_none() @@ -944,11 +952,11 @@ impl NodeResolver { "", package_subpath, maybe_referrer, - referrer_kind, + resolution_mode, false, false, conditions, - mode, + resolution_kind, )?; return match resolved { Some(resolved) => Ok(resolved), @@ -957,7 +965,7 @@ impl NodeResolver { pkg_json_path: package_json_path.to_path_buf(), subpath: package_subpath.to_string(), maybe_referrer: maybe_referrer.map(ToOwned::to_owned), - mode, + resolution_kind, } .into(), ), @@ -1006,11 +1014,11 @@ impl NodeResolver { &best_match_subpath.unwrap(), best_match, maybe_referrer, - referrer_kind, + resolution_mode, true, false, conditions, - mode, + resolution_kind, )?; if let Some(resolved) = maybe_resolved { return Ok(resolved); @@ -1020,7 +1028,7 @@ impl NodeResolver { pkg_json_path: package_json_path.to_path_buf(), subpath: package_subpath.to_string(), maybe_referrer: maybe_referrer.map(ToOwned::to_owned), - mode, + resolution_kind, } .into(), ); @@ -1032,7 +1040,7 @@ impl NodeResolver { pkg_json_path: package_json_path.to_path_buf(), subpath: package_subpath.to_string(), maybe_referrer: maybe_referrer.map(ToOwned::to_owned), - mode, + resolution_kind, } .into(), ) @@ -1042,9 +1050,9 @@ impl NodeResolver { &self, specifier: &str, referrer: &Url, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, conditions: &[&str], - mode: NodeResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { let (package_name, package_subpath, _is_scoped) = parse_npm_pkg_name(specifier, referrer)?; @@ -1061,9 +1069,9 @@ impl NodeResolver { &package_subpath, exports, Some(referrer), - referrer_kind, + resolution_mode, conditions, - mode, + resolution_kind, ) .map_err(|err| err.into()); } @@ -1074,9 +1082,9 @@ impl NodeResolver { &package_name, &package_subpath, referrer, - referrer_kind, + resolution_mode, conditions, - mode, + resolution_kind, ) } @@ -1086,28 +1094,28 @@ impl NodeResolver { package_name: &str, package_subpath: &str, referrer: &Url, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, conditions: &[&str], - mode: NodeResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { let result = self.resolve_package_subpath_for_package_inner( package_name, package_subpath, referrer, - referrer_kind, + resolution_mode, conditions, - mode, + resolution_kind, ); - if mode.is_types() && !matches!(result, Ok(Url { .. })) { + if resolution_kind.is_types() && !matches!(result, Ok(Url { .. })) { // try to resolve with the @types package let package_name = types_package_name(package_name); if let Ok(result) = self.resolve_package_subpath_for_package_inner( &package_name, package_subpath, referrer, - referrer_kind, + resolution_mode, conditions, - mode, + resolution_kind, ) { return Ok(result); } @@ -1121,9 +1129,9 @@ impl NodeResolver { package_name: &str, package_subpath: &str, referrer: &Url, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, conditions: &[&str], - mode: NodeResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { let package_dir_path = self .npm_pkg_folder_resolver @@ -1148,9 +1156,9 @@ impl NodeResolver { &package_dir_path, package_subpath, Some(referrer), - referrer_kind, + resolution_mode, conditions, - mode, + resolution_kind, ) .map_err(|err| err.into()) } @@ -1161,9 +1169,9 @@ impl NodeResolver { package_dir_path: &Path, package_subpath: &str, maybe_referrer: Option<&Url>, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, conditions: &[&str], - mode: NodeResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { let package_json_path = package_dir_path.join("package.json"); match self @@ -1174,17 +1182,17 @@ impl NodeResolver { &pkg_json, package_subpath, maybe_referrer, - referrer_kind, + resolution_mode, conditions, - mode, + resolution_kind, ), None => self .resolve_package_subpath_no_pkg_json( package_dir_path, package_subpath, maybe_referrer, - referrer_kind, - mode, + resolution_mode, + resolution_kind, ) .map_err(|err| { PackageSubpathResolveErrorKind::LegacyResolve(err).into() @@ -1198,9 +1206,9 @@ impl NodeResolver { package_json: &PackageJson, package_subpath: &str, referrer: Option<&Url>, - referrer_kind: NodeModuleKind, + resolution_mode: ResolutionMode, conditions: &[&str], - mode: NodeResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { if let Some(exports) = &package_json.exports { let result = self.package_exports_resolve( @@ -1208,16 +1216,21 @@ impl NodeResolver { package_subpath, exports, referrer, - referrer_kind, + resolution_mode, conditions, - mode, + resolution_kind, ); match result { Ok(found) => return Ok(found), Err(exports_err) => { - if mode.is_types() && package_subpath == "." { + if resolution_kind.is_types() && package_subpath == "." { return self - .legacy_main_resolve(package_json, referrer, referrer_kind, mode) + .legacy_main_resolve( + package_json, + referrer, + resolution_mode, + resolution_kind, + ) .map_err(|err| { PackageSubpathResolveErrorKind::LegacyResolve(err).into() }); @@ -1231,7 +1244,12 @@ impl NodeResolver { if package_subpath == "." { return self - .legacy_main_resolve(package_json, referrer, referrer_kind, mode) + .legacy_main_resolve( + package_json, + referrer, + resolution_mode, + resolution_kind, + ) .map_err(|err| { PackageSubpathResolveErrorKind::LegacyResolve(err).into() }); @@ -1242,8 +1260,8 @@ impl NodeResolver { package_json.path.parent().unwrap(), package_subpath, referrer, - referrer_kind, - mode, + resolution_mode, + resolution_kind, ) .map_err(|err| { PackageSubpathResolveErrorKind::LegacyResolve(err.into()).into() @@ -1255,13 +1273,13 @@ impl NodeResolver { directory: &Path, package_subpath: &str, referrer: Option<&Url>, - referrer_kind: NodeModuleKind, - mode: NodeResolutionMode, + resolution_mode: ResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { assert_ne!(package_subpath, "."); let file_path = directory.join(package_subpath); - if mode.is_types() { - Ok(self.path_to_declaration_url(&file_path, referrer, referrer_kind)?) + if resolution_kind.is_types() { + Ok(self.path_to_declaration_url(&file_path, referrer, resolution_mode)?) } else { Ok(url_from_file_path(&file_path).unwrap()) } @@ -1272,19 +1290,24 @@ impl NodeResolver { directory: &Path, package_subpath: &str, maybe_referrer: Option<&Url>, - referrer_kind: NodeModuleKind, - mode: NodeResolutionMode, + resolution_mode: ResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { if package_subpath == "." { - self.legacy_index_resolve(directory, maybe_referrer, referrer_kind, mode) + self.legacy_index_resolve( + directory, + maybe_referrer, + resolution_mode, + resolution_kind, + ) } else { self .resolve_subpath_exact( directory, package_subpath, maybe_referrer, - referrer_kind, - mode, + resolution_mode, + resolution_kind, ) .map_err(|err| err.into()) } @@ -1294,21 +1317,25 @@ impl NodeResolver { &self, package_json: &PackageJson, maybe_referrer: Option<&Url>, - referrer_kind: NodeModuleKind, - mode: NodeResolutionMode, + resolution_mode: ResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { - let maybe_main = if mode.is_types() { + let pkg_json_kind = match resolution_mode { + ResolutionMode::Require => deno_package_json::NodeModuleKind::Cjs, + ResolutionMode::Import => deno_package_json::NodeModuleKind::Esm, + }; + let maybe_main = if resolution_kind.is_types() { match package_json.types.as_ref() { Some(types) => Some(types.as_str()), None => { // fallback to checking the main entrypoint for // a corresponding declaration file - if let Some(main) = package_json.main(referrer_kind) { + if let Some(main) = package_json.main(pkg_json_kind) { let main = package_json.path.parent().unwrap().join(main).clean(); let decl_url_result = self.path_to_declaration_url( &main, maybe_referrer, - referrer_kind, + resolution_mode, ); // don't surface errors, fallback to checking the index now if let Ok(url) = decl_url_result { @@ -1319,7 +1346,7 @@ impl NodeResolver { } } } else { - package_json.main(referrer_kind) + package_json.main(pkg_json_kind) }; if let Some(main) = maybe_main { @@ -1329,12 +1356,12 @@ impl NodeResolver { } // todo(dsherret): investigate exactly how node and typescript handles this - let endings = if mode.is_types() { - match referrer_kind { - NodeModuleKind::Cjs => { + let endings = if resolution_kind.is_types() { + match resolution_mode { + ResolutionMode::Require => { vec![".d.ts", ".d.cts", "/index.d.ts", "/index.d.cts"] } - NodeModuleKind::Esm => vec![ + ResolutionMode::Import => vec![ ".d.ts", ".d.mts", "/index.d.ts", @@ -1363,8 +1390,8 @@ impl NodeResolver { self.legacy_index_resolve( package_json.path.parent().unwrap(), maybe_referrer, - referrer_kind, - mode, + resolution_mode, + resolution_kind, ) } @@ -1372,14 +1399,16 @@ impl NodeResolver { &self, directory: &Path, maybe_referrer: Option<&Url>, - referrer_kind: NodeModuleKind, - mode: NodeResolutionMode, + resolution_mode: ResolutionMode, + resolution_kind: NodeResolutionKind, ) -> Result { - let index_file_names = if mode.is_types() { + let index_file_names = if resolution_kind.is_types() { // todo(dsherret): investigate exactly how typescript does this - match referrer_kind { - NodeModuleKind::Cjs => vec!["index.d.ts", "index.d.cts"], - NodeModuleKind::Esm => vec!["index.d.ts", "index.d.mts", "index.d.cts"], + match resolution_mode { + ResolutionMode::Require => vec!["index.d.ts", "index.d.cts"], + ResolutionMode::Import => { + vec!["index.d.ts", "index.d.mts", "index.d.cts"] + } } } else { vec!["index.js"] @@ -1392,7 +1421,7 @@ impl NodeResolver { } } - if mode.is_types() { + if resolution_kind.is_types() { Err( TypesNotFoundError(Box::new(TypesNotFoundErrorData { code_specifier: url_from_file_path(&directory.join("index.js")) diff --git a/tests/specs/node/dynamic_import_and_require_dual/__test__.jsonc b/tests/specs/node/dynamic_import_and_require_dual/__test__.jsonc new file mode 100644 index 0000000000..8e03984f0b --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/__test__.jsonc @@ -0,0 +1,44 @@ +{ + "tests": { + "cjs_check": { + "args": "check index.cts", + "output": "check.out", + "exitCode": 1 + }, + "cjs_run": { + "args": "run index.cts", + "output": "run_cjs.out" + }, + "mjs_run": { + "args": "run index.mjs", + "output": "run_mts.out" + }, + "jsdoc_import_decl": { + "args": "check jsdoc_import_decl.js", + "output": "jsdoc_import_decl.out", + "exitCode": 1 + }, + "resolution_mode_import": { + "args": "check resolution_mode_import.mts", + "output": "resolution_mode_import.out", + "exitCode": 1 + }, + "resolution_mode_require": { + "args": "check resolution_mode_require.mts", + "output": "resolution_mode_require.out", + "exitCode": 1 + }, + "resolution_mode_require_jsdoc": { + "args": "check resolution_mode_require_jsdoc.js", + "output": "resolution_mode_require_jsdoc.out", + "exitCode": 1 + }, + "resolution_mode_require_import_type": { + // waiting on https://github.com/swc-project/swc/issues/9377 + "ignore": true, + "args": "check resolution_mode_require_import_type.ts", + "output": "resolution_mode_require_import_type.out", + "exitCode": 1 + } + } +} diff --git a/tests/specs/node/dynamic_import_and_require_dual/check.out b/tests/specs/node/dynamic_import_and_require_dual/check.out new file mode 100644 index 0000000000..bbea340cce --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/check.out @@ -0,0 +1,5 @@ +Check file:///[WILDLINE]/index.cts +error: TS2322 [ERROR]: Type '"mjs"' is not assignable to type '"value"'. + const value: "value" = mod.kind; + ~~~~~ + at file:///[WILDLINE]/index.cts:3:9 diff --git a/tests/specs/node/dynamic_import_and_require_dual/index.cts b/tests/specs/node/dynamic_import_and_require_dual/index.cts new file mode 100644 index 0000000000..d3bc653c65 --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/index.cts @@ -0,0 +1,8 @@ +async function main() { + const mod = await import("package"); + const value: "value" = mod.kind; + console.log(value); + console.log(mod); +} + +main(); diff --git a/tests/specs/node/dynamic_import_and_require_dual/index.mjs b/tests/specs/node/dynamic_import_and_require_dual/index.mjs new file mode 100644 index 0000000000..76f21fec90 --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/index.mjs @@ -0,0 +1,11 @@ +import { createRequire } from "node:module"; +{ + const mod = await import("package"); + console.log(mod.kind); + console.log(mod); +} +{ + const require = createRequire(import.meta.url); + const mod = require("package"); + console.log(mod); +} diff --git a/tests/specs/node/dynamic_import_and_require_dual/jsdoc_import_decl.js b/tests/specs/node/dynamic_import_and_require_dual/jsdoc_import_decl.js new file mode 100644 index 0000000000..153b9fe3a6 --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/jsdoc_import_decl.js @@ -0,0 +1,12 @@ +// @ts-check + +/** @import { kind } from "package" */ + +/** + * @param {typeof kind} myValue + */ +export function log(myValue) { + console.log(myValue); +} + +log("value"); diff --git a/tests/specs/node/dynamic_import_and_require_dual/jsdoc_import_decl.out b/tests/specs/node/dynamic_import_and_require_dual/jsdoc_import_decl.out new file mode 100644 index 0000000000..655d47117f --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/jsdoc_import_decl.out @@ -0,0 +1,5 @@ +Check file:///[WILDLINE]/jsdoc_import_decl.js +error: TS2345 [ERROR]: Argument of type '"value"' is not assignable to parameter of type '"mjs"'. +log("value"); + ~~~~~~~ + at file:///[WILDLINE]/jsdoc_import_decl.js:12:5 diff --git a/tests/specs/node/dynamic_import_and_require_dual/node_modules/package/mod.d.mts b/tests/specs/node/dynamic_import_and_require_dual/node_modules/package/mod.d.mts new file mode 100644 index 0000000000..bd4baa5919 --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/node_modules/package/mod.d.mts @@ -0,0 +1 @@ +export const kind: "mjs"; diff --git a/tests/specs/node/dynamic_import_and_require_dual/node_modules/package/mod.mjs b/tests/specs/node/dynamic_import_and_require_dual/node_modules/package/mod.mjs new file mode 100644 index 0000000000..cd2f5f05cb --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/node_modules/package/mod.mjs @@ -0,0 +1 @@ +export const kind = "esm"; diff --git a/tests/specs/node/dynamic_import_and_require_dual/node_modules/package/package.json b/tests/specs/node/dynamic_import_and_require_dual/node_modules/package/package.json new file mode 100644 index 0000000000..f4adc7925e --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/node_modules/package/package.json @@ -0,0 +1,11 @@ +{ + "name": "package", + "version": "1.0.0", + "type": "module", + "exports": { + ".": { + "import": "./mod.mjs", + "require": "./require.cjs" + } + } +} \ No newline at end of file diff --git a/tests/specs/node/dynamic_import_and_require_dual/node_modules/package/require.cjs b/tests/specs/node/dynamic_import_and_require_dual/node_modules/package/require.cjs new file mode 100644 index 0000000000..2b7ebd9693 --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/node_modules/package/require.cjs @@ -0,0 +1 @@ +module.exports.kind = "cjs"; diff --git a/tests/specs/node/dynamic_import_and_require_dual/node_modules/package/require.d.cts b/tests/specs/node/dynamic_import_and_require_dual/node_modules/package/require.d.cts new file mode 100644 index 0000000000..604f6136b4 --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/node_modules/package/require.d.cts @@ -0,0 +1 @@ +export const kind: "cjs"; diff --git a/tests/specs/node/dynamic_import_and_require_dual/package.json b/tests/specs/node/dynamic_import_and_require_dual/package.json new file mode 100644 index 0000000000..ab1ab85da2 --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/package.json @@ -0,0 +1,6 @@ +{ + "type": "commonjs", + "dependencies": { + "package": "*" + } +} diff --git a/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_import.mts b/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_import.mts new file mode 100644 index 0000000000..86b06fb832 --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_import.mts @@ -0,0 +1,6 @@ +import type { kind } from "package" with { + "resolution-mode": "import", +}; + +const test: typeof kind = "other"; +console.log(test); diff --git a/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_import.out b/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_import.out new file mode 100644 index 0000000000..735cfe53ac --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_import.out @@ -0,0 +1,5 @@ +Check file:///[WILDLINE]/resolution_mode_import.mts +error: TS2322 [ERROR]: Type '"other"' is not assignable to type '"mjs"'. +const test: typeof kind = "other"; + ~~~~ + at file:///[WILDLINE]/resolution_mode_import.mts:5:7 diff --git a/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require.mts b/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require.mts new file mode 100644 index 0000000000..1695f29ade --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require.mts @@ -0,0 +1,6 @@ +import type { kind } from "package" with { + "resolution-mode": "require", +}; + +const test: typeof kind = "other"; +console.log(test); diff --git a/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require.out b/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require.out new file mode 100644 index 0000000000..32cdd86f0d --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require.out @@ -0,0 +1,5 @@ +Check file:///[WILDLINE]/resolution_mode_require.mts +error: TS2322 [ERROR]: Type '"other"' is not assignable to type '"cjs"'. +const test: typeof kind = "other"; + ~~~~ + at file:///[WILDLINE]/resolution_mode_require.mts:5:7 diff --git a/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require_import_type.out b/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require_import_type.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require_import_type.ts b/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require_import_type.ts new file mode 100644 index 0000000000..295bab0e9c --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require_import_type.ts @@ -0,0 +1,5 @@ +// deno-fmt-ignore-file +type Value = typeof import("package", { with: { 'resolution-mode': 'require' } }).kind; + +const value: Value = "value"; +console.log(value); \ No newline at end of file diff --git a/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require_jsdoc.js b/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require_jsdoc.js new file mode 100644 index 0000000000..0d0040513f --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require_jsdoc.js @@ -0,0 +1,12 @@ +// @ts-check + +/** @import { kind } from "package" with { 'resolution-mode': 'require' } */ + +/** + * @param {typeof kind} myValue + */ +export function log(myValue) { + console.log(myValue); +} + +log("value"); diff --git a/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require_jsdoc.out b/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require_jsdoc.out new file mode 100644 index 0000000000..924681fe80 --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/resolution_mode_require_jsdoc.out @@ -0,0 +1,5 @@ +Check file:///[WILDLINE]/resolution_mode_require_jsdoc.js +error: TS2345 [ERROR]: Argument of type '"value"' is not assignable to parameter of type '"cjs"'. +log("value"); + ~~~~~~~ + at file:///[WILDLINE]/resolution_mode_require_jsdoc.js:12:5 diff --git a/tests/specs/node/dynamic_import_and_require_dual/run_cjs.out b/tests/specs/node/dynamic_import_and_require_dual/run_cjs.out new file mode 100644 index 0000000000..d64c24da5d --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/run_cjs.out @@ -0,0 +1,2 @@ +esm +[Module: null prototype] { kind: "esm" } diff --git a/tests/specs/node/dynamic_import_and_require_dual/run_mts.out b/tests/specs/node/dynamic_import_and_require_dual/run_mts.out new file mode 100644 index 0000000000..afd3f2e277 --- /dev/null +++ b/tests/specs/node/dynamic_import_and_require_dual/run_mts.out @@ -0,0 +1,3 @@ +esm +[Module: null prototype] { kind: "esm" } +{ kind: "cjs" } diff --git a/tests/specs/npm/info_chalk_display/__test__.jsonc b/tests/specs/npm/info_chalk_display/__test__.jsonc index 54b5b74396..717f1f9a15 100644 --- a/tests/specs/npm/info_chalk_display/__test__.jsonc +++ b/tests/specs/npm/info_chalk_display/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "info --quiet cjs_with_deps/main.js", - "output": "cjs_with_deps/main_info.out", + "args": "info --quiet main.js", + "output": "main_info.out", "exitCode": 0 } diff --git a/tests/specs/npm/info_chalk_display/cjs_with_deps/main.out b/tests/specs/npm/info_chalk_display/cjs_with_deps/main.out deleted file mode 100644 index 7051c23953..0000000000 --- a/tests/specs/npm/info_chalk_display/cjs_with_deps/main.out +++ /dev/null @@ -1,33 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Download http://localhost:4260/chai/chai-4.3.6.tgz -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm/info_chalk_display/cjs_with_deps/main_info_json.out b/tests/specs/npm/info_chalk_display/cjs_with_deps/main_info_json.out deleted file mode 100644 index 137b9f8ce5..0000000000 --- a/tests/specs/npm/info_chalk_display/cjs_with_deps/main_info_json.out +++ /dev/null @@ -1,148 +0,0 @@ -{ - "version": 1, - "roots": [ - "file://[WILDCARD]/main.js" - ], - "modules": [ - { - "kind": "esm", - "dependencies": [ - { - "specifier": "npm:chalk@4", - "code": { - "specifier": "npm:chalk@4", - "span": { - "start": { - "line": 0, - "character": 18 - }, - "end": { - "line": 0, - "character": 31 - } - } - }, - "npmPackage": "chalk@4.1.2" - }, - { - "specifier": "npm:chai@4.3", - "code": { - "specifier": "npm:chai@4.3", - "span": { - "start": { - "line": 1, - "character": 23 - }, - "end": { - "line": 1, - "character": 37 - } - } - }, - "npmPackage": "chai@4.3.6" - } - ], - "local": "[WILDCARD]main.js", - "size": 325, - "mediaType": "JavaScript", - "specifier": "[WILDCARD]/main.js" - } - ], - "redirects": { - "npm:chai@4.3": "npm:/chai@4.3.6", - "npm:chalk@4": "npm:/chalk@4.1.2" - }, - "npmPackages": { - "ansi-styles@4.3.0": { - "name": "ansi-styles", - "version": "4.3.0", - "dependencies": [ - "color-convert@2.0.1" - ] - }, - "assertion-error@1.1.0": { - "name": "assertion-error", - "version": "1.1.0", - "dependencies": [] - }, - "chai@4.3.6": { - "name": "chai", - "version": "4.3.6", - "dependencies": [ - "assertion-error@1.1.0", - "check-error@1.0.2", - "deep-eql@3.0.1", - "get-func-name@2.0.0", - "loupe@2.3.4", - "pathval@1.1.1", - "type-detect@4.0.8" - ] - }, - "chalk@4.1.2": { - "name": "chalk", - "version": "4.1.2", - "dependencies": [ - "ansi-styles@4.3.0", - "supports-color@7.2.0" - ] - }, - "check-error@1.0.2": { - "name": "check-error", - "version": "1.0.2", - "dependencies": [] - }, - "color-convert@2.0.1": { - "name": "color-convert", - "version": "2.0.1", - "dependencies": [ - "color-name@1.1.4" - ] - }, - "color-name@1.1.4": { - "name": "color-name", - "version": "1.1.4", - "dependencies": [] - }, - "deep-eql@3.0.1": { - "name": "deep-eql", - "version": "3.0.1", - "dependencies": [ - "type-detect@4.0.8" - ] - }, - "get-func-name@2.0.0": { - "name": "get-func-name", - "version": "2.0.0", - "dependencies": [] - }, - "has-flag@4.0.0": { - "name": "has-flag", - "version": "4.0.0", - "dependencies": [] - }, - "loupe@2.3.4": { - "name": "loupe", - "version": "2.3.4", - "dependencies": [ - "get-func-name@2.0.0" - ] - }, - "pathval@1.1.1": { - "name": "pathval", - "version": "1.1.1", - "dependencies": [] - }, - "supports-color@7.2.0": { - "name": "supports-color", - "version": "7.2.0", - "dependencies": [ - "has-flag@4.0.0" - ] - }, - "type-detect@4.0.8": { - "name": "type-detect", - "version": "4.0.8", - "dependencies": [] - } - } -} diff --git a/tests/specs/npm/info_chalk_display/cjs_with_deps/main_node_modules.out b/tests/specs/npm/info_chalk_display/cjs_with_deps/main_node_modules.out deleted file mode 100644 index 1ab3679521..0000000000 --- a/tests/specs/npm/info_chalk_display/cjs_with_deps/main_node_modules.out +++ /dev/null @@ -1,47 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Initialize ansi-styles@4.3.0 -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Initialize assertion-error@1.1.0 -Download http://localhost:4260/chai/chai-4.3.6.tgz -Initialize chai@4.3.6 -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Initialize chalk@4.1.2 -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Initialize check-error@1.0.2 -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Initialize color-convert@2.0.1 -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Initialize color-name@1.1.4 -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Initialize deep-eql@3.0.1 -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Initialize get-func-name@2.0.0 -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Initialize has-flag@4.0.0 -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Initialize loupe@2.3.4 -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Initialize pathval@1.1.1 -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Initialize supports-color@7.2.0 -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -Initialize type-detect@4.0.8 -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm/info_chalk_display/cjs_with_deps/main.js b/tests/specs/npm/info_chalk_display/main.js similarity index 100% rename from tests/specs/npm/info_chalk_display/cjs_with_deps/main.js rename to tests/specs/npm/info_chalk_display/main.js diff --git a/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info.out b/tests/specs/npm/info_chalk_display/main_info.out similarity index 94% rename from tests/specs/npm/info_chalk_json/cjs_with_deps/main_info.out rename to tests/specs/npm/info_chalk_display/main_info.out index 8e37c88eb0..f1271ec1f1 100644 --- a/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info.out +++ b/tests/specs/npm/info_chalk_display/main_info.out @@ -3,7 +3,7 @@ type: JavaScript dependencies: 14 unique size: [WILDCARD] -file:///[WILDCARD]/cjs_with_deps/main.js ([WILDCARD]) +file:///[WILDCARD]/main.js ([WILDCARD]) ├─┬ npm:/chalk@4.1.2 ([WILDCARD]) │ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) │ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) diff --git a/tests/specs/npm/info_chalk_display_node_modules_dir/__test__.jsonc b/tests/specs/npm/info_chalk_display_node_modules_dir/__test__.jsonc index 4358f64883..b5c36dc6c1 100644 --- a/tests/specs/npm/info_chalk_display_node_modules_dir/__test__.jsonc +++ b/tests/specs/npm/info_chalk_display_node_modules_dir/__test__.jsonc @@ -1,6 +1,6 @@ { "tempDir": true, - "args": "info --quiet --node-modules-dir cjs_with_deps/main.js", - "output": "cjs_with_deps/main_info.out", + "args": "info --quiet --node-modules-dir main.js", + "output": "main_info.out", "exitCode": 0 } diff --git a/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.out b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.out deleted file mode 100644 index 7051c23953..0000000000 --- a/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.out +++ /dev/null @@ -1,33 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Download http://localhost:4260/chai/chai-4.3.6.tgz -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info.out b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info.out deleted file mode 100644 index 8e37c88eb0..0000000000 --- a/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info.out +++ /dev/null @@ -1,22 +0,0 @@ -local: [WILDCARD]main.js -type: JavaScript -dependencies: 14 unique -size: [WILDCARD] - -file:///[WILDCARD]/cjs_with_deps/main.js ([WILDCARD]) -├─┬ npm:/chalk@4.1.2 ([WILDCARD]) -│ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) -│ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) -│ │ └── npm:/color-name@1.1.4 ([WILDCARD]) -│ └─┬ npm:/supports-color@7.2.0 ([WILDCARD]) -│ └── npm:/has-flag@4.0.0 ([WILDCARD]) -└─┬ npm:/chai@4.3.6 ([WILDCARD]) - ├── npm:/assertion-error@1.1.0 ([WILDCARD]) - ├── npm:/check-error@1.0.2 ([WILDCARD]) - ├─┬ npm:/deep-eql@3.0.1 ([WILDCARD]) - │ └── npm:/type-detect@4.0.8 ([WILDCARD]) - ├── npm:/get-func-name@2.0.0 ([WILDCARD]) - ├─┬ npm:/loupe@2.3.4 ([WILDCARD]) - │ └── npm:/get-func-name@2.0.0 ([WILDCARD]) - ├── npm:/pathval@1.1.1 ([WILDCARD]) - └── npm:/type-detect@4.0.8 ([WILDCARD]) diff --git a/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info_json.out b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info_json.out deleted file mode 100644 index 137b9f8ce5..0000000000 --- a/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info_json.out +++ /dev/null @@ -1,148 +0,0 @@ -{ - "version": 1, - "roots": [ - "file://[WILDCARD]/main.js" - ], - "modules": [ - { - "kind": "esm", - "dependencies": [ - { - "specifier": "npm:chalk@4", - "code": { - "specifier": "npm:chalk@4", - "span": { - "start": { - "line": 0, - "character": 18 - }, - "end": { - "line": 0, - "character": 31 - } - } - }, - "npmPackage": "chalk@4.1.2" - }, - { - "specifier": "npm:chai@4.3", - "code": { - "specifier": "npm:chai@4.3", - "span": { - "start": { - "line": 1, - "character": 23 - }, - "end": { - "line": 1, - "character": 37 - } - } - }, - "npmPackage": "chai@4.3.6" - } - ], - "local": "[WILDCARD]main.js", - "size": 325, - "mediaType": "JavaScript", - "specifier": "[WILDCARD]/main.js" - } - ], - "redirects": { - "npm:chai@4.3": "npm:/chai@4.3.6", - "npm:chalk@4": "npm:/chalk@4.1.2" - }, - "npmPackages": { - "ansi-styles@4.3.0": { - "name": "ansi-styles", - "version": "4.3.0", - "dependencies": [ - "color-convert@2.0.1" - ] - }, - "assertion-error@1.1.0": { - "name": "assertion-error", - "version": "1.1.0", - "dependencies": [] - }, - "chai@4.3.6": { - "name": "chai", - "version": "4.3.6", - "dependencies": [ - "assertion-error@1.1.0", - "check-error@1.0.2", - "deep-eql@3.0.1", - "get-func-name@2.0.0", - "loupe@2.3.4", - "pathval@1.1.1", - "type-detect@4.0.8" - ] - }, - "chalk@4.1.2": { - "name": "chalk", - "version": "4.1.2", - "dependencies": [ - "ansi-styles@4.3.0", - "supports-color@7.2.0" - ] - }, - "check-error@1.0.2": { - "name": "check-error", - "version": "1.0.2", - "dependencies": [] - }, - "color-convert@2.0.1": { - "name": "color-convert", - "version": "2.0.1", - "dependencies": [ - "color-name@1.1.4" - ] - }, - "color-name@1.1.4": { - "name": "color-name", - "version": "1.1.4", - "dependencies": [] - }, - "deep-eql@3.0.1": { - "name": "deep-eql", - "version": "3.0.1", - "dependencies": [ - "type-detect@4.0.8" - ] - }, - "get-func-name@2.0.0": { - "name": "get-func-name", - "version": "2.0.0", - "dependencies": [] - }, - "has-flag@4.0.0": { - "name": "has-flag", - "version": "4.0.0", - "dependencies": [] - }, - "loupe@2.3.4": { - "name": "loupe", - "version": "2.3.4", - "dependencies": [ - "get-func-name@2.0.0" - ] - }, - "pathval@1.1.1": { - "name": "pathval", - "version": "1.1.1", - "dependencies": [] - }, - "supports-color@7.2.0": { - "name": "supports-color", - "version": "7.2.0", - "dependencies": [ - "has-flag@4.0.0" - ] - }, - "type-detect@4.0.8": { - "name": "type-detect", - "version": "4.0.8", - "dependencies": [] - } - } -} diff --git a/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_node_modules.out b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_node_modules.out deleted file mode 100644 index 1ab3679521..0000000000 --- a/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_node_modules.out +++ /dev/null @@ -1,47 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Initialize ansi-styles@4.3.0 -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Initialize assertion-error@1.1.0 -Download http://localhost:4260/chai/chai-4.3.6.tgz -Initialize chai@4.3.6 -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Initialize chalk@4.1.2 -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Initialize check-error@1.0.2 -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Initialize color-convert@2.0.1 -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Initialize color-name@1.1.4 -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Initialize deep-eql@3.0.1 -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Initialize get-func-name@2.0.0 -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Initialize has-flag@4.0.0 -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Initialize loupe@2.3.4 -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Initialize pathval@1.1.1 -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Initialize supports-color@7.2.0 -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -Initialize type-detect@4.0.8 -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.js b/tests/specs/npm/info_chalk_display_node_modules_dir/main.js similarity index 100% rename from tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.js rename to tests/specs/npm/info_chalk_display_node_modules_dir/main.js diff --git a/tests/specs/npm/info_chalk_display/cjs_with_deps/main_info.out b/tests/specs/npm/info_chalk_display_node_modules_dir/main_info.out similarity index 94% rename from tests/specs/npm/info_chalk_display/cjs_with_deps/main_info.out rename to tests/specs/npm/info_chalk_display_node_modules_dir/main_info.out index 8e37c88eb0..f1271ec1f1 100644 --- a/tests/specs/npm/info_chalk_display/cjs_with_deps/main_info.out +++ b/tests/specs/npm/info_chalk_display_node_modules_dir/main_info.out @@ -3,7 +3,7 @@ type: JavaScript dependencies: 14 unique size: [WILDCARD] -file:///[WILDCARD]/cjs_with_deps/main.js ([WILDCARD]) +file:///[WILDCARD]/main.js ([WILDCARD]) ├─┬ npm:/chalk@4.1.2 ([WILDCARD]) │ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) │ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) diff --git a/tests/specs/npm/info_chalk_json/__test__.jsonc b/tests/specs/npm/info_chalk_json/__test__.jsonc index c6e65db94b..c5a4a95bf7 100644 --- a/tests/specs/npm/info_chalk_json/__test__.jsonc +++ b/tests/specs/npm/info_chalk_json/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "info --quiet --json cjs_with_deps/main.js", - "output": "cjs_with_deps/main_info_json.out", + "args": "info --quiet --json main.js", + "output": "main_info_json.out", "exitCode": 0 } diff --git a/tests/specs/npm/info_chalk_json/cjs_with_deps/main.out b/tests/specs/npm/info_chalk_json/cjs_with_deps/main.out deleted file mode 100644 index 7051c23953..0000000000 --- a/tests/specs/npm/info_chalk_json/cjs_with_deps/main.out +++ /dev/null @@ -1,33 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Download http://localhost:4260/chai/chai-4.3.6.tgz -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm/info_chalk_json/cjs_with_deps/main_node_modules.out b/tests/specs/npm/info_chalk_json/cjs_with_deps/main_node_modules.out deleted file mode 100644 index 1ab3679521..0000000000 --- a/tests/specs/npm/info_chalk_json/cjs_with_deps/main_node_modules.out +++ /dev/null @@ -1,47 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Initialize ansi-styles@4.3.0 -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Initialize assertion-error@1.1.0 -Download http://localhost:4260/chai/chai-4.3.6.tgz -Initialize chai@4.3.6 -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Initialize chalk@4.1.2 -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Initialize check-error@1.0.2 -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Initialize color-convert@2.0.1 -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Initialize color-name@1.1.4 -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Initialize deep-eql@3.0.1 -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Initialize get-func-name@2.0.0 -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Initialize has-flag@4.0.0 -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Initialize loupe@2.3.4 -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Initialize pathval@1.1.1 -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Initialize supports-color@7.2.0 -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -Initialize type-detect@4.0.8 -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm/info_chalk_json/cjs_with_deps/main.js b/tests/specs/npm/info_chalk_json/main.js similarity index 100% rename from tests/specs/npm/info_chalk_json/cjs_with_deps/main.js rename to tests/specs/npm/info_chalk_json/main.js diff --git a/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info_json.out b/tests/specs/npm/info_chalk_json/main_info_json.out similarity index 100% rename from tests/specs/npm/info_chalk_json/cjs_with_deps/main_info_json.out rename to tests/specs/npm/info_chalk_json/main_info_json.out diff --git a/tests/specs/npm/info_chalk_json_node_modules_dir/__test__.jsonc b/tests/specs/npm/info_chalk_json_node_modules_dir/__test__.jsonc index 29c5e8bdff..ed9a96606e 100644 --- a/tests/specs/npm/info_chalk_json_node_modules_dir/__test__.jsonc +++ b/tests/specs/npm/info_chalk_json_node_modules_dir/__test__.jsonc @@ -1,6 +1,6 @@ { "tempDir": true, - "args": "info --quiet --node-modules-dir --json cjs_with_deps/main.js", - "output": "cjs_with_deps/main_info_json.out", + "args": "info --quiet --node-modules-dir --json main.js", + "output": "main_info_json.out", "exitCode": 0 } diff --git a/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.out b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.out deleted file mode 100644 index 7051c23953..0000000000 --- a/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.out +++ /dev/null @@ -1,33 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Download http://localhost:4260/chai/chai-4.3.6.tgz -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info.out b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info.out deleted file mode 100644 index 8e37c88eb0..0000000000 --- a/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info.out +++ /dev/null @@ -1,22 +0,0 @@ -local: [WILDCARD]main.js -type: JavaScript -dependencies: 14 unique -size: [WILDCARD] - -file:///[WILDCARD]/cjs_with_deps/main.js ([WILDCARD]) -├─┬ npm:/chalk@4.1.2 ([WILDCARD]) -│ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) -│ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) -│ │ └── npm:/color-name@1.1.4 ([WILDCARD]) -│ └─┬ npm:/supports-color@7.2.0 ([WILDCARD]) -│ └── npm:/has-flag@4.0.0 ([WILDCARD]) -└─┬ npm:/chai@4.3.6 ([WILDCARD]) - ├── npm:/assertion-error@1.1.0 ([WILDCARD]) - ├── npm:/check-error@1.0.2 ([WILDCARD]) - ├─┬ npm:/deep-eql@3.0.1 ([WILDCARD]) - │ └── npm:/type-detect@4.0.8 ([WILDCARD]) - ├── npm:/get-func-name@2.0.0 ([WILDCARD]) - ├─┬ npm:/loupe@2.3.4 ([WILDCARD]) - │ └── npm:/get-func-name@2.0.0 ([WILDCARD]) - ├── npm:/pathval@1.1.1 ([WILDCARD]) - └── npm:/type-detect@4.0.8 ([WILDCARD]) diff --git a/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_node_modules.out b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_node_modules.out deleted file mode 100644 index 1ab3679521..0000000000 --- a/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_node_modules.out +++ /dev/null @@ -1,47 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Initialize ansi-styles@4.3.0 -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Initialize assertion-error@1.1.0 -Download http://localhost:4260/chai/chai-4.3.6.tgz -Initialize chai@4.3.6 -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Initialize chalk@4.1.2 -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Initialize check-error@1.0.2 -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Initialize color-convert@2.0.1 -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Initialize color-name@1.1.4 -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Initialize deep-eql@3.0.1 -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Initialize get-func-name@2.0.0 -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Initialize has-flag@4.0.0 -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Initialize loupe@2.3.4 -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Initialize pathval@1.1.1 -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Initialize supports-color@7.2.0 -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -Initialize type-detect@4.0.8 -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.js b/tests/specs/npm/info_chalk_json_node_modules_dir/main.js similarity index 100% rename from tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.js rename to tests/specs/npm/info_chalk_json_node_modules_dir/main.js diff --git a/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out b/tests/specs/npm/info_chalk_json_node_modules_dir/main_info_json.out similarity index 100% rename from tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out rename to tests/specs/npm/info_chalk_json_node_modules_dir/main_info_json.out diff --git a/tests/specs/npm/info_peer_deps/__test__.jsonc b/tests/specs/npm/info_peer_deps/__test__.jsonc index 00dfbc98b7..b726c50db1 100644 --- a/tests/specs/npm/info_peer_deps/__test__.jsonc +++ b/tests/specs/npm/info_peer_deps/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "info --quiet peer_deps_with_copied_folders/main.ts", - "output": "peer_deps_with_copied_folders/main_info.out", + "args": "info --quiet main.ts", + "output": "main_info.out", "exitCode": 0 } diff --git a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.ts b/tests/specs/npm/info_peer_deps/main.ts similarity index 100% rename from tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.ts rename to tests/specs/npm/info_peer_deps/main.ts diff --git a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info.out b/tests/specs/npm/info_peer_deps/main_info.out similarity index 91% rename from tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info.out rename to tests/specs/npm/info_peer_deps/main_info.out index e8b92399df..1269b1c1db 100644 --- a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info.out +++ b/tests/specs/npm/info_peer_deps/main_info.out @@ -3,7 +3,7 @@ type: TypeScript dependencies: 6 unique size: [WILDCARD] -file:///[WILDCARD]/peer_deps_with_copied_folders/main.ts (171B) +file:///[WILDCARD]/main.ts (171B) ├─┬ npm:/@denotest/peer-dep-test-child@1.0.0 ([WILDCARD]) │ ├─┬ npm:/@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0 ([WILDCARD]) │ │ └── npm:/@denotest/peer-dep-test-peer@1.0.0 ([WILDCARD]) diff --git a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.out deleted file mode 100644 index b7a5835577..0000000000 --- a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.out +++ /dev/null @@ -1,14 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest%2fpeer-dep-test-child -Download http://localhost:4260/@denotest%2fpeer-dep-test-grandchild -Download http://localhost:4260/@denotest%2fpeer-dep-test-peer -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child/1.0.0.tgz -Download http://localhost:4260/@denotest/peer-dep-test-child/2.0.0.tgz -Download http://localhost:4260/@denotest/peer-dep-test-grandchild/1.0.0.tgz -Download http://localhost:4260/@denotest/peer-dep-test-peer/1.0.0.tgz -Download http://localhost:4260/@denotest/peer-dep-test-peer/2.0.0.tgz -[UNORDERED_END] -1 -2 diff --git a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info_json.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info_json.out deleted file mode 100644 index 46cc35c650..0000000000 --- a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info_json.out +++ /dev/null @@ -1,97 +0,0 @@ -{ - "version": 1, - "roots": [ - "[WILDCARD]/peer_deps_with_copied_folders/main.ts" - ], - "modules": [ - { - "kind": "esm", - "dependencies": [ - { - "specifier": "npm:@denotest/peer-dep-test-child@1", - "code": { - "specifier": "npm:@denotest/peer-dep-test-child@1", - "span": { - "start": { - "line": 0, - "character": 21 - }, - "end": { - "line": 0, - "character": 58 - } - } - }, - "npmPackage": "@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0" - }, - { - "specifier": "npm:@denotest/peer-dep-test-child@2", - "code": { - "specifier": "npm:@denotest/peer-dep-test-child@2", - "span": { - "start": { - "line": 1, - "character": 21 - }, - "end": { - "line": 1, - "character": 58 - } - } - }, - "npmPackage": "@denotest/peer-dep-test-child@2.0.0_@denotest+peer-dep-test-peer@2.0.0" - } - ], - "local": "[WILDCARD]main.ts", - "size": 171, - "mediaType": "TypeScript", - "specifier": "file://[WILDCARD]/main.ts" - } - ], - "redirects": { - "npm:@denotest/peer-dep-test-child@1": "npm:/@denotest/peer-dep-test-child@1.0.0", - "npm:@denotest/peer-dep-test-child@2": "npm:/@denotest/peer-dep-test-child@2.0.0" - }, - "npmPackages": { - "@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0": { - "name": "@denotest/peer-dep-test-child", - "version": "1.0.0", - "dependencies": [ - "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0", - "@denotest/peer-dep-test-peer@1.0.0" - ] - }, - "@denotest/peer-dep-test-child@2.0.0_@denotest+peer-dep-test-peer@2.0.0": { - "name": "@denotest/peer-dep-test-child", - "version": "2.0.0", - "dependencies": [ - "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0", - "@denotest/peer-dep-test-peer@2.0.0" - ] - }, - "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0": { - "name": "@denotest/peer-dep-test-grandchild", - "version": "1.0.0", - "dependencies": [ - "@denotest/peer-dep-test-peer@1.0.0" - ] - }, - "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0": { - "name": "@denotest/peer-dep-test-grandchild", - "version": "1.0.0", - "dependencies": [ - "@denotest/peer-dep-test-peer@2.0.0" - ] - }, - "@denotest/peer-dep-test-peer@1.0.0": { - "name": "@denotest/peer-dep-test-peer", - "version": "1.0.0", - "dependencies": [] - }, - "@denotest/peer-dep-test-peer@2.0.0": { - "name": "@denotest/peer-dep-test-peer", - "version": "2.0.0", - "dependencies": [] - } - } -} diff --git a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules.out deleted file mode 100644 index 02b5cbafd6..0000000000 --- a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules.out +++ /dev/null @@ -1,9 +0,0 @@ -[UNORDERED_START] -Initialize @denotest/peer-dep-test-child@1.0.0 -Initialize @denotest/peer-dep-test-child@2.0.0 -Initialize @denotest/peer-dep-test-grandchild@1.0.0 -Initialize @denotest/peer-dep-test-peer@1.0.0 -Initialize @denotest/peer-dep-test-peer@2.0.0 -[UNORDERED_END] -1 -2 diff --git a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out deleted file mode 100644 index 18d7f7865b..0000000000 --- a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out +++ /dev/null @@ -1,19 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest%2fpeer-dep-test-child -Download http://localhost:4260/@denotest%2fpeer-dep-test-grandchild -Download http://localhost:4260/@denotest%2fpeer-dep-test-peer -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child/1.0.0.tgz -Initialize @denotest/peer-dep-test-child@1.0.0 -Download http://localhost:4260/@denotest/peer-dep-test-child/2.0.0.tgz -Initialize @denotest/peer-dep-test-child@2.0.0 -Download http://localhost:4260/@denotest/peer-dep-test-grandchild/1.0.0.tgz -Initialize @denotest/peer-dep-test-grandchild@1.0.0 -Download http://localhost:4260/@denotest/peer-dep-test-peer/1.0.0.tgz -Initialize @denotest/peer-dep-test-peer@1.0.0 -Download http://localhost:4260/@denotest/peer-dep-test-peer/2.0.0.tgz -Initialize @denotest/peer-dep-test-peer@2.0.0 -[UNORDERED_END] -1 -2 diff --git a/tests/specs/npm/info_peer_deps_json/__test__.jsonc b/tests/specs/npm/info_peer_deps_json/__test__.jsonc index 5dd08c325f..6950448398 100644 --- a/tests/specs/npm/info_peer_deps_json/__test__.jsonc +++ b/tests/specs/npm/info_peer_deps_json/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "info --quiet --json peer_deps_with_copied_folders/main.ts", - "output": "peer_deps_with_copied_folders/main_info_json.out", + "args": "info --quiet --json main.ts", + "output": "main_info_json.out", "exitCode": 0 } diff --git a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.ts b/tests/specs/npm/info_peer_deps_json/main.ts similarity index 100% rename from tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.ts rename to tests/specs/npm/info_peer_deps_json/main.ts diff --git a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out b/tests/specs/npm/info_peer_deps_json/main_info_json.out similarity index 100% rename from tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out rename to tests/specs/npm/info_peer_deps_json/main_info_json.out diff --git a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.out deleted file mode 100644 index b7a5835577..0000000000 --- a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.out +++ /dev/null @@ -1,14 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest%2fpeer-dep-test-child -Download http://localhost:4260/@denotest%2fpeer-dep-test-grandchild -Download http://localhost:4260/@denotest%2fpeer-dep-test-peer -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child/1.0.0.tgz -Download http://localhost:4260/@denotest/peer-dep-test-child/2.0.0.tgz -Download http://localhost:4260/@denotest/peer-dep-test-grandchild/1.0.0.tgz -Download http://localhost:4260/@denotest/peer-dep-test-peer/1.0.0.tgz -Download http://localhost:4260/@denotest/peer-dep-test-peer/2.0.0.tgz -[UNORDERED_END] -1 -2 diff --git a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info.out deleted file mode 100644 index e8b92399df..0000000000 --- a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info.out +++ /dev/null @@ -1,14 +0,0 @@ -local: [WILDCARD]main.ts -type: TypeScript -dependencies: 6 unique -size: [WILDCARD] - -file:///[WILDCARD]/peer_deps_with_copied_folders/main.ts (171B) -├─┬ npm:/@denotest/peer-dep-test-child@1.0.0 ([WILDCARD]) -│ ├─┬ npm:/@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0 ([WILDCARD]) -│ │ └── npm:/@denotest/peer-dep-test-peer@1.0.0 ([WILDCARD]) -│ └── npm:/@denotest/peer-dep-test-peer@1.0.0 ([WILDCARD]) -└─┬ npm:/@denotest/peer-dep-test-child@2.0.0 ([WILDCARD]) - ├─┬ npm:/@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0 ([WILDCARD]) - │ └── npm:/@denotest/peer-dep-test-peer@2.0.0 ([WILDCARD]) - └── npm:/@denotest/peer-dep-test-peer@2.0.0 ([WILDCARD]) diff --git a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules.out deleted file mode 100644 index 02b5cbafd6..0000000000 --- a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules.out +++ /dev/null @@ -1,9 +0,0 @@ -[UNORDERED_START] -Initialize @denotest/peer-dep-test-child@1.0.0 -Initialize @denotest/peer-dep-test-child@2.0.0 -Initialize @denotest/peer-dep-test-grandchild@1.0.0 -Initialize @denotest/peer-dep-test-peer@1.0.0 -Initialize @denotest/peer-dep-test-peer@2.0.0 -[UNORDERED_END] -1 -2 diff --git a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out deleted file mode 100644 index 18d7f7865b..0000000000 --- a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out +++ /dev/null @@ -1,19 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest%2fpeer-dep-test-child -Download http://localhost:4260/@denotest%2fpeer-dep-test-grandchild -Download http://localhost:4260/@denotest%2fpeer-dep-test-peer -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child/1.0.0.tgz -Initialize @denotest/peer-dep-test-child@1.0.0 -Download http://localhost:4260/@denotest/peer-dep-test-child/2.0.0.tgz -Initialize @denotest/peer-dep-test-child@2.0.0 -Download http://localhost:4260/@denotest/peer-dep-test-grandchild/1.0.0.tgz -Initialize @denotest/peer-dep-test-grandchild@1.0.0 -Download http://localhost:4260/@denotest/peer-dep-test-peer/1.0.0.tgz -Initialize @denotest/peer-dep-test-peer@1.0.0 -Download http://localhost:4260/@denotest/peer-dep-test-peer/2.0.0.tgz -Initialize @denotest/peer-dep-test-peer@2.0.0 -[UNORDERED_END] -1 -2 From 4330ef553f6fb5c478916947654859853221a9b3 Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Wed, 27 Nov 2024 04:42:54 +0900 Subject: [PATCH 172/227] fix(streams): reject `string` in `ReadableStream.from` type (#25116) WebIDL `async iterable` type rejects `string` Ref https://github.com/whatwg/webidl/pull/1397, #24623 --- cli/tsc/dts/lib.dom.d.ts | 2 +- ext/web/06_streams.js | 4 ++-- ext/web/06_streams_types.d.ts | 4 ++-- ext/web/lib.deno_web.d.ts | 2 +- .../reject_string_in_readable_stream_from/__test__.jsonc | 5 +++++ .../check/reject_string_in_readable_stream_from/main.out | 5 +++++ .../check/reject_string_in_readable_stream_from/main.ts | 1 + tests/unit/streams_test.ts | 1 + 8 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 tests/specs/check/reject_string_in_readable_stream_from/__test__.jsonc create mode 100644 tests/specs/check/reject_string_in_readable_stream_from/main.out create mode 100644 tests/specs/check/reject_string_in_readable_stream_from/main.ts diff --git a/cli/tsc/dts/lib.dom.d.ts b/cli/tsc/dts/lib.dom.d.ts index 0a2f9b9eda..2684735597 100644 --- a/cli/tsc/dts/lib.dom.d.ts +++ b/cli/tsc/dts/lib.dom.d.ts @@ -18277,7 +18277,7 @@ declare var ReadableStream: { new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number }): ReadableStream; new(underlyingSource: UnderlyingDefaultSource, strategy?: QueuingStrategy): ReadableStream; new(underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; - from(asyncIterable: AsyncIterable | Iterable>): ReadableStream; + from(asyncIterable: AsyncIterable | Iterable> & object): ReadableStream; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */ diff --git a/ext/web/06_streams.js b/ext/web/06_streams.js index f29e5f2040..57a437e4f5 100644 --- a/ext/web/06_streams.js +++ b/ext/web/06_streams.js @@ -2922,7 +2922,7 @@ function readableStreamPipeTo( } /** - * @param {ReadableStreamGenericReader | ReadableStreamBYOBReader} reader + * @param {ReadableStreamGenericReader | ReadableStreamBYOBReader} reader * @param {any} reason * @returns {Promise} */ @@ -2955,7 +2955,7 @@ function readableStreamReaderGenericInitialize(reader, stream) { /** * @template R - * @param {ReadableStreamGenericReader | ReadableStreamBYOBReader} reader + * @param {ReadableStreamGenericReader | ReadableStreamBYOBReader} reader */ function readableStreamReaderGenericRelease(reader) { const stream = reader[_stream]; diff --git a/ext/web/06_streams_types.d.ts b/ext/web/06_streams_types.d.ts index e04f568d26..fe05ee6e65 100644 --- a/ext/web/06_streams_types.d.ts +++ b/ext/web/06_streams_types.d.ts @@ -60,8 +60,8 @@ interface VoidFunction { (): void; } -interface ReadableStreamGenericReader { - readonly closed: Promise; +interface ReadableStreamGenericReader { + readonly closed: Promise; // deno-lint-ignore no-explicit-any cancel(reason?: any): Promise; } diff --git a/ext/web/lib.deno_web.d.ts b/ext/web/lib.deno_web.d.ts index 2ad97ac7d1..8aafbad535 100644 --- a/ext/web/lib.deno_web.d.ts +++ b/ext/web/lib.deno_web.d.ts @@ -882,7 +882,7 @@ declare var ReadableStream: { strategy?: QueuingStrategy, ): ReadableStream; from( - asyncIterable: AsyncIterable | Iterable>, + asyncIterable: AsyncIterable | Iterable> & object, ): ReadableStream; }; diff --git a/tests/specs/check/reject_string_in_readable_stream_from/__test__.jsonc b/tests/specs/check/reject_string_in_readable_stream_from/__test__.jsonc new file mode 100644 index 0000000000..634dbac850 --- /dev/null +++ b/tests/specs/check/reject_string_in_readable_stream_from/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check ./main.ts", + "output": "main.out", + "exitCode": 1 +} diff --git a/tests/specs/check/reject_string_in_readable_stream_from/main.out b/tests/specs/check/reject_string_in_readable_stream_from/main.out new file mode 100644 index 0000000000..577c1fb059 --- /dev/null +++ b/tests/specs/check/reject_string_in_readable_stream_from/main.out @@ -0,0 +1,5 @@ +Check [WILDCARD]/main.ts +error: TS2345 [ERROR]: Argument of type 'string' is not assignable to parameter of type 'AsyncIterable | (Iterable> & object)'. +ReadableStream.from("string"); + ~~~~~~~~ + at [WILDCARD]/main.ts:1:21 diff --git a/tests/specs/check/reject_string_in_readable_stream_from/main.ts b/tests/specs/check/reject_string_in_readable_stream_from/main.ts new file mode 100644 index 0000000000..5e7fc9c956 --- /dev/null +++ b/tests/specs/check/reject_string_in_readable_stream_from/main.ts @@ -0,0 +1 @@ +ReadableStream.from("string"); diff --git a/tests/unit/streams_test.ts b/tests/unit/streams_test.ts index 73f9a60953..53225a1553 100644 --- a/tests/unit/streams_test.ts +++ b/tests/unit/streams_test.ts @@ -541,6 +541,7 @@ Deno.test(async function decompressionStreamInvalidGzipStillReported() { Deno.test(function readableStreamFromWithStringThrows() { assertThrows( + // @ts-expect-error: primitives are not acceptable () => ReadableStream.from("string"), TypeError, "Failed to execute 'ReadableStream.from': Argument 1 can not be converted to async iterable.", From a750314e0452cb8bd4688f274c95fec14556a91b Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:29:46 -0800 Subject: [PATCH 173/227] fix(install): don't re-set up node_modules if running lifecycle script (#26984) Fixes https://github.com/denoland/deno/issues/26904 If using `nodeModulesDir: "auto"`, it's possible for the lifecycle script subprocess to try to set up the node_modules dir (despite the fact that we're already doing that). If it does that, it hangs trying to acquire the file lock on the node_modules dir. As a fix, don't try to set up node_modules if we're running as part of a lifecycle script. Ideally we'd have better control over when we do and don't set up node_modules automatically (that's the underlying problem behind #25782 as well) --- .../managed/resolvers/common/lifecycle_scripts.rs | 13 +++++++++++++ cli/npm/managed/resolvers/local.rs | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/cli/npm/managed/resolvers/common/lifecycle_scripts.rs b/cli/npm/managed/resolvers/common/lifecycle_scripts.rs index 5c5755c819..f8b9e8a7e8 100644 --- a/cli/npm/managed/resolvers/common/lifecycle_scripts.rs +++ b/cli/npm/managed/resolvers/common/lifecycle_scripts.rs @@ -182,6 +182,12 @@ impl<'a> LifecycleScripts<'a> { ); let mut env_vars = crate::task_runner::real_env_vars(); + // so the subprocess can detect that it is running as part of a lifecycle script, + // and avoid trying to set up node_modules again + env_vars.insert( + LIFECYCLE_SCRIPTS_RUNNING_ENV_VAR.to_string(), + "1".to_string(), + ); // we want to pass the current state of npm resolution down to the deno subprocess // (that may be running as part of the script). we do this with an inherited temp file // @@ -303,6 +309,13 @@ impl<'a> LifecycleScripts<'a> { } } +const LIFECYCLE_SCRIPTS_RUNNING_ENV_VAR: &str = + "DENO_INTERNAL_IS_LIFECYCLE_SCRIPT"; + +pub fn is_running_lifecycle_script() -> bool { + std::env::var(LIFECYCLE_SCRIPTS_RUNNING_ENV_VAR).is_ok() +} + // take in all (non copy) packages from snapshot, // and resolve the set of available binaries to create // custom commands available to the task runner diff --git a/cli/npm/managed/resolvers/local.rs b/cli/npm/managed/resolvers/local.rs index 50c5bd2689..ca7867425d 100644 --- a/cli/npm/managed/resolvers/local.rs +++ b/cli/npm/managed/resolvers/local.rs @@ -298,6 +298,12 @@ async fn sync_resolution_with_fs( return Ok(()); // don't create the directory } + // don't set up node_modules (and more importantly try to acquire the file lock) + // if we're running as part of a lifecycle script + if super::common::lifecycle_scripts::is_running_lifecycle_script() { + return Ok(()); + } + let deno_local_registry_dir = root_node_modules_dir_path.join(".deno"); let deno_node_modules_dir = deno_local_registry_dir.join("node_modules"); fs::create_dir_all(&deno_node_modules_dir).with_context(|| { From e2f7e031b3155d43f8ba073d0abdb551ce227a29 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 26 Nov 2024 19:32:30 -0500 Subject: [PATCH 174/227] chore: fix flaky `specs::publish::npm_workspace_jsr_pkg_with_npm_dep::dep_and_workspace_dep` (#27098) Closes https://github.com/denoland/deno/issues/27097 --- tests/specs/mod.rs | 18 ++++-------------- .../__test__.jsonc | 1 + .../node_modules/.deno/.deno.lock | 0 .../node_modules/.deno/.deno.lock.poll | 1 - .../node_modules/.deno/.setup-cache.bin | Bin 24 -> 0 bytes .../node_modules/add | 1 - .../node_modules/add-dep | 1 - 7 files changed, 5 insertions(+), 17 deletions(-) delete mode 100644 tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/.deno/.deno.lock delete mode 100644 tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/.deno/.deno.lock.poll delete mode 100644 tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/.deno/.setup-cache.bin delete mode 120000 tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/add delete mode 120000 tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/add-dep diff --git a/tests/specs/mod.rs b/tests/specs/mod.rs index b4c8781d31..f5820e4d88 100644 --- a/tests/specs/mod.rs +++ b/tests/specs/mod.rs @@ -17,7 +17,6 @@ use file_test_runner::collection::CollectTestsError; use file_test_runner::collection::CollectedCategoryOrTest; use file_test_runner::collection::CollectedTest; use file_test_runner::collection::CollectedTestCategory; -use file_test_runner::SubTestResult; use file_test_runner::TestResult; use once_cell::sync::Lazy; use serde::Deserialize; @@ -256,19 +255,10 @@ fn run_test(test: &CollectedTest) -> TestResult { if metadata.ignore { TestResult::Ignored } else if let Some(repeat) = metadata.repeat { - TestResult::SubTests( - (0..repeat) - .map(|i| { - let diagnostic_logger = diagnostic_logger.clone(); - SubTestResult { - name: format!("run {}", i + 1), - result: TestResult::from_maybe_panic(AssertUnwindSafe(|| { - run_test_inner(&metadata, &cwd, diagnostic_logger); - })), - } - }) - .collect(), - ) + for _ in 0..repeat { + run_test_inner(&metadata, &cwd, diagnostic_logger.clone()); + } + TestResult::Passed } else { run_test_inner(&metadata, &cwd, diagnostic_logger.clone()); TestResult::Passed diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/__test__.jsonc b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/__test__.jsonc index 91408a7302..b0ec621436 100644 --- a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/__test__.jsonc +++ b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/__test__.jsonc @@ -1,4 +1,5 @@ { + "tempDir": true, "tests": { "dep_and_workspace_dep": { "steps": [{ diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/.deno/.deno.lock b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/.deno/.deno.lock deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/.deno/.deno.lock.poll b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/.deno/.deno.lock.poll deleted file mode 100644 index 56a6051ca2..0000000000 --- a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/.deno/.deno.lock.poll +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/.deno/.setup-cache.bin b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/.deno/.setup-cache.bin deleted file mode 100644 index 4ac5fc6cf890b46738523c4d4d9d964e312f368f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24 KcmZQzzzzTa7ytnP diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/add b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/add deleted file mode 120000 index 7b086589df..0000000000 --- a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/add +++ /dev/null @@ -1 +0,0 @@ -../add \ No newline at end of file diff --git a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/add-dep b/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/add-dep deleted file mode 120000 index 7b086589df..0000000000 --- a/tests/specs/publish/npm_workspace_jsr_pkg_with_npm_dep/node_modules/add-dep +++ /dev/null @@ -1 +0,0 @@ -../add \ No newline at end of file From 4700f12ddc5427797333278d2a1d3a8e1195ebfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 27 Nov 2024 01:12:47 +0000 Subject: [PATCH 175/227] fix(task): handle carriage return in task description (#27099) Ref https://github.com/denoland/deno/pull/27069#discussion_r1857702814 --- cli/tools/task.rs | 2 +- tests/specs/task/description/deno.json | 4 ++++ tests/specs/task/description/main.out | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cli/tools/task.rs b/cli/tools/task.rs index 65b78f9c9b..1b83422ba9 100644 --- a/cli/tools/task.rs +++ b/cli/tools/task.rs @@ -721,7 +721,7 @@ fn print_available_tasks( )?; if let Some(description) = &desc.task.description { let slash_slash = colors::italic_gray("//"); - for line in description.split('\n') { + for line in description.lines() { writeln!(writer, " {slash_slash} {}", colors::italic_gray(line))?; } } diff --git a/tests/specs/task/description/deno.json b/tests/specs/task/description/deno.json index c8a79c00ee..028ae86210 100644 --- a/tests/specs/task/description/deno.json +++ b/tests/specs/task/description/deno.json @@ -7,6 +7,10 @@ "multiline_description": { "description": "This is a multiline\ndescription", "command": "echo 2" + }, + "multiline_description_carriage_return": { + "description": "This is a multiline\r\ndescription\r\n", + "command": "echo 3" } } } diff --git a/tests/specs/task/description/main.out b/tests/specs/task/description/main.out index 91cce4adf8..edc7535f2c 100644 --- a/tests/specs/task/description/main.out +++ b/tests/specs/task/description/main.out @@ -6,3 +6,7 @@ Available tasks: // This is a multiline // description echo 2 +- multiline_description_carriage_return + // This is a multiline + // description + echo 3 From 42b71d82db238b0a3e9ccb31cb7ac57f0685e8a6 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Tue, 26 Nov 2024 20:53:20 -0800 Subject: [PATCH 176/227] chore(lint): add .out file reference checker (#27078) Co-authored-by: David Sherret --- .../check/check_exclude_option/__test__.jsonc | 19 +++++ .../deno.exclude_dir.json | 0 .../deno.exclude_glob.json | 0 .../deno.json | 0 .../exclude_option.ts.error.out | 0 .../ignored/index.ts | 0 .../index.ts | 0 .../check_node_builtin_modules/__test__.jsonc | 14 ++++ .../mod.js | 0 .../mod.js.out | 2 +- .../mod.ts | 0 .../mod.ts.out | 4 +- .../__test__.jsonc | 5 -- .../node_builtin_modules/mod.js.out | 5 -- .../__test__.jsonc | 5 -- .../node_builtin_modules/mod.js | 3 - .../node_builtin_modules/mod.ts | 9 --- .../node_builtin_modules/mod.ts.out | 13 ---- .../__test__.jsonc | 5 -- .../__test__.jsonc | 5 -- .../exclude_option/deno.exclude_dir.json | 5 -- .../exclude_option/deno.exclude_glob.json | 5 -- .../exclude_option/deno.json | 3 - .../exclude_option.ts.error.out | 4 - .../exclude_option/ignored/index.ts | 1 - .../exclude_option/index.ts | 5 -- .../__test__.jsonc | 5 -- .../exclude_option/deno.exclude_dir.json | 5 -- .../exclude_option/deno.exclude_glob.json | 5 -- .../exclude_option/deno.json | 3 - .../exclude_option.ts.error.out | 4 - .../exclude_option/ignored/index.ts | 1 - .../exclude_option/index.ts | 5 -- tests/specs/lint/no_slow_types/__test__.jsonc | 39 ++++++---- .../no_slow_types_entrypoint/__test__.jsonc | 5 -- .../specs/lint/no_slow_types_entrypoint/a.ts | 3 - .../specs/lint/no_slow_types_entrypoint/b.ts | 5 -- .../specs/lint/no_slow_types_entrypoint/c.ts | 4 - .../specs/lint/no_slow_types_entrypoint/d.ts | 4 - .../lint/no_slow_types_entrypoint/deno.json | 8 -- .../deno.non-package.json | 2 - .../no_slow_types.out | 35 --------- .../no_slow_types_entrypoint.out | 38 --------- .../config_file_lock_path/lock_check_err2.out | 11 --- tests/specs/npm/byonm/__test__.jsonc | 2 +- tests/specs/npm/check_all/__test__.jsonc | 5 -- .../npm/check_all/check_errors/main_local.out | 7 -- .../specs/npm/check_all_local/__test__.jsonc | 14 ++++ .../check_errors => check_all_local}/main.ts | 0 .../main_all.out | 8 +- .../main_local.out | 4 +- tests/specs/npm/check_local/__test__.jsonc | 5 -- .../npm/check_local/check_errors/main.ts | 3 - .../npm/check_local/check_errors/main_all.out | 19 ----- tests/specs/npm/cjs_with_deps/__test__.jsonc | 36 ++++++++- .../cjs_with_deps/{cjs_with_deps => }/main.js | 0 .../{cjs_with_deps => }/main.out | 0 .../{cjs_with_deps => }/main_info.out | 0 .../cjs_with_deps/main_info_json.out | 54 +++++++++---- .../{cjs_with_deps => }/main_node_modules.out | 0 .../specs/npm/directory_import/__test__.jsonc | 14 ++++ .../directory_import/folder_index_js.out | 0 .../directory_import/folder_index_js.ts | 0 .../directory_import/folder_no_index.out | 0 .../directory_import/folder_no_index.ts | 0 .../__test__.jsonc | 5 -- .../__test__.jsonc | 5 -- .../directory_import/folder_index_js.out | 7 -- .../directory_import/folder_index_js.ts | 2 - .../directory_import/folder_no_index.out | 6 -- .../directory_import/folder_no_index.ts | 2 - .../npm/imports_package_json/__test__.jsonc | 18 ++++- .../import_not_defined.js | 0 .../import_not_defined.out | 0 .../{imports_package_json => }/main.js | 0 .../{imports_package_json => }/main.out | 0 .../{imports_package_json => }/package.json | 0 .../sub_path_import_not_defined.js | 0 .../sub_path_import_not_defined.out | 0 .../__test__.jsonc | 5 -- .../import_not_defined.js | 3 - .../import_not_defined.out | 3 - .../imports_package_json/main.js | 7 -- .../imports_package_json/main.out | 7 -- .../imports_package_json/package.json | 6 -- .../sub_path_import_not_defined.js | 3 - .../sub_path_import_not_defined.out | 3 - .../__test__.jsonc | 5 -- .../import_not_defined.js | 3 - .../import_not_defined.out | 3 - .../imports_package_json/main.js | 7 -- .../imports_package_json/main.out | 7 -- .../imports_package_json/package.json | 6 -- .../sub_path_import_not_defined.js | 3 - .../sub_path_import_not_defined.out | 3 - .../npm/info_cli_chalk_display/__test__.jsonc | 5 -- .../info/chalk_json.out | 57 -------------- .../npm/info_cli_chalk_json/__test__.jsonc | 15 +++- .../info => info_cli_chalk_json}/chalk.out | 0 .../{info => }/chalk_json.out | 0 .../npm/info_cli_chalk_json/info/chalk.out | 9 --- .../future_install_all_lifecycles.out | 3 - .../mixed_case_package_name/__test__.jsonc | 15 ++++ .../mixed_case_package_name/global.out | 0 .../mixed_case_package_name/global.ts | 0 .../mixed_case_package_name/local.out | 0 .../mixed_case_package_name/local.ts | 0 .../__test__.jsonc | 5 -- .../__test__.jsonc | 6 -- .../mixed_case_package_name/global.out | 9 --- .../mixed_case_package_name/global.ts | 2 - .../mixed_case_package_name/local.out | 13 ---- .../mixed_case_package_name/local.ts | 18 ----- .../node_modules_dir_with_deps/__test__.jsonc | 39 +++++++++- .../{cjs_with_deps => }/main.js | 0 .../{cjs_with_deps => }/main.out | 0 .../{cjs_with_deps => }/main_info.out | 2 +- .../main_info_json.out | 52 +++++++++---- .../{cjs_with_deps => }/main_node_modules.out | 0 .../npm/types_ambient_module/__test__.jsonc | 15 +++- .../__test__.jsonc | 5 -- .../types_ambient_module/import_map.json | 5 -- .../types_ambient_module/main.out | 21 ----- .../types_ambient_module/main.ts | 7 -- .../types_ambient_module/main_import_map.out | 9 --- .../types_ambient_module/main_import_map.ts | 4 - .../decorators/experimental/__test__.jsonc | 16 ++++ .../decorators/experimental/deno.json | 0 .../decorators/experimental/no_check/main.out | 0 .../decorators/experimental/no_check/main.ts | 0 .../decorators/experimental/runtime/main.out | 0 .../decorators/experimental/runtime/main.ts | 0 .../decorators/experimental/ts/main.out | 0 .../decorators/experimental/ts/main.ts | 0 .../decorators/tc39_proposal/__test__.jsonc | 4 + .../decorators/tc39_proposal/main.out | 0 .../decorators/tc39_proposal/main.ts | 0 .../decorators_tc39_proposal/__test__.jsonc | 4 - .../import_maps/test_data.ts | 1 - .../import_maps/test_data.ts.out | 1 - .../run/jsx_import_source/__test__.jsonc | 77 +++++++++++++++++++ .../jsx/deno-jsx-error.jsonc | 0 .../jsx/deno-jsx-import-map.jsonc | 0 .../jsx/deno-jsx-precompile-skip.jsonc | 0 .../jsx/deno-jsx-precompile.jsonc | 0 .../jsx/deno-jsx.json | 0 .../jsx/deno-jsx.jsonc | 0 .../jsx/deno-jsxdev-import-map.jsonc | 0 .../jsx/deno-jsxdev.jsonc | 0 .../jsx/deno.lock | 0 .../jsx/import-map-scoped.json | 0 .../jsx/import-map.json | 0 .../jsx/jsx-dev-runtime/index.ts | 0 .../jsx/jsx-precompile/index.ts | 0 .../jsx/jsx-runtime/index.ts | 0 .../jsx_import_source.out | 0 .../jsx_import_source_dev.out | 0 .../jsx_import_source_error.out | 0 .../jsx_import_source_import_map.out | 0 .../jsx_import_source_import_map_dev.out | 0 .../jsx_import_source_no_pragma.tsx | 0 .../jsx_import_source_pragma.tsx | 0 .../jsx_import_source_pragma_import_map.tsx | 0 .../jsx_precompile/no_pragma.out | 0 .../jsx_precompile/no_pragma.tsx | 0 .../jsx_precompile/skip.out | 0 .../jsx_precompile/skip.tsx | 0 .../jsx_import_source_error/__test__.jsonc | 5 -- .../__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx_import_source_no_pragma.tsx | 7 -- .../__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx_import_source_no_pragma.tsx | 7 -- .../__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx_import_source_import_map.out | 2 - .../jsx_import_source_no_pragma.tsx | 7 -- .../__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx_import_source_no_pragma/jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx_import_source_no_pragma.tsx | 7 -- .../__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx_import_source_no_pragma.tsx | 7 -- .../__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx_import_source.out | 2 - .../jsx_import_source_no_pragma.tsx | 7 -- .../jsx_import_source_pragma/__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx_import_source_pragma/jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx_import_source.out | 2 - .../__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx_import_source_import_map.out | 2 - .../__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx_import_source_import_map_dev.out | 2 - .../jsx_import_source_pragma_import_map.tsx | 9 --- .../__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx_import_source_import_map.out | 2 - .../jsx_import_source_pragma_import_map.tsx | 9 --- .../__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx_import_source.out | 2 - .../jsx_import_source_pragma.tsx | 9 --- .../__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx_import_source.out | 2 - .../jsx_import_source_pragma.tsx | 9 --- .../__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx_import_source.out | 2 - .../jsx_import_source_pragma.tsx | 9 --- .../__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx/#jsx-runtime_62ac8.js | 11 --- .../jsx/vendor/manifest.json | 9 --- .../jsx_import_source.out | 2 - .../jsx_import_source_pragma.tsx | 9 --- .../__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx_import_source_dev.out | 2 - .../jsx_import_source_pragma.tsx | 9 --- .../__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx_precompile/skip.out | 3 - .../__test__.jsonc | 4 - .../jsx/deno-jsx-error.jsonc | 6 -- .../jsx/deno-jsx-import-map.jsonc | 6 -- .../jsx/deno-jsx-precompile-skip.jsonc | 7 -- .../jsx/deno-jsx-precompile.jsonc | 6 -- .../jsx/deno-jsx.json | 6 -- .../jsx/deno-jsx.jsonc | 6 -- .../jsx/deno-jsxdev-import-map.jsonc | 6 -- .../jsx/deno-jsxdev.jsonc | 6 -- .../jsx/deno.lock | 6 -- .../jsx/import-map-scoped.json | 8 -- .../jsx/import-map.json | 7 -- .../jsx/jsx-dev-runtime/index.ts | 12 --- .../jsx/jsx-precompile/index.ts | 23 ------ .../jsx/jsx-runtime/index.ts | 12 --- .../jsx_precompile/no_pragma.out | 3 - .../jsx_precompile/no_pragma.tsx | 3 - .../jsx_precompile/skip.tsx | 9 --- .../run/no_check_decorators/__test__.jsonc | 4 - .../decorators/experimental/deno.json | 5 -- .../decorators/experimental/no_check/main.out | 3 - .../decorators/experimental/no_check/main.ts | 21 ----- .../decorators/experimental/runtime/main.out | 7 -- .../decorators/experimental/runtime/main.ts | 42 ---------- .../decorators/experimental/ts/main.out | 3 - .../decorators/experimental/ts/main.ts | 14 ---- .../decorators/tc39_proposal/main.out | 3 - .../decorators/tc39_proposal/main.ts | 21 ----- .../package_json/invalid_value/__test__.jsonc | 5 ++ .../run/runtime_decorators/__test__.jsonc | 4 - .../decorators/experimental/deno.json | 5 -- .../decorators/experimental/no_check/main.out | 3 - .../decorators/experimental/no_check/main.ts | 21 ----- .../decorators/experimental/runtime/main.out | 7 -- .../decorators/experimental/runtime/main.ts | 42 ---------- .../decorators/experimental/ts/main.out | 3 - .../decorators/experimental/ts/main.ts | 14 ---- .../decorators/tc39_proposal/main.out | 3 - .../decorators/tc39_proposal/main.ts | 21 ----- .../specs/run/top_level_await/__test__.jsonc | 42 +++++++++- .../{top_level_await => }/circular.js | 0 .../{top_level_await => }/circular.out | 0 tests/specs/run/top_level_await/hello.txt | 2 +- .../top_level_await/loop.js | 4 +- .../{top_level_await => }/loop.out | 0 .../{top_level_await => }/nested.out | 0 .../{top_level_await => }/nested/a.js | 0 .../{top_level_await => }/nested/b.js | 0 .../{top_level_await => }/nested/main.js | 0 .../{top_level_await => }/order.js | 0 .../{top_level_await => }/order.out | 0 .../{top_level_await => }/tla/a.js | 0 .../{top_level_await => }/tla/b.js | 0 .../{top_level_await => }/tla/c.js | 0 .../{top_level_await => }/tla/d.js | 0 .../{top_level_await => }/tla/order.js | 0 .../{top_level_await => }/tla/parent.js | 0 .../{top_level_await => }/tla2/a.js | 0 .../{top_level_await => }/tla2/b.js | 0 .../{top_level_await => }/tla3/b.js | 0 .../tla3/timeout_loop.js | 0 .../{top_level_await => }/top_level_await.js | 0 .../{top_level_await => }/top_level_await.out | 3 +- .../top_level_await/top_level_await.ts | 0 .../top_level_await/top_level_await/loop.js | 20 ----- .../top_level_await/top_level_await.ts | 3 - .../top_level_for_await.js | 0 .../top_level_for_await.out | 0 .../top_level_for_await.ts | 0 .../{top_level_await => }/unresolved.js | 0 .../{top_level_await => }/unresolved.out | 0 .../top_level_await_circular/__test__.jsonc | 5 -- .../top_level_await/circular.js | 8 -- .../top_level_await/circular.out | 10 --- .../top_level_await/loop.out | 5 -- .../top_level_await/nested.out | 5 -- .../top_level_await/nested/a.js | 3 - .../top_level_await/nested/b.js | 1 - .../top_level_await/nested/main.js | 3 - .../top_level_await/order.js | 21 ----- .../top_level_await/order.out | 2 - .../top_level_await/tla/a.js | 3 - .../top_level_await/tla/b.js | 7 -- .../top_level_await/tla/c.js | 3 - .../top_level_await/tla/d.js | 8 -- .../top_level_await/tla/order.js | 1 - .../top_level_await/tla/parent.js | 9 --- .../top_level_await/tla2/a.js | 5 -- .../top_level_await/tla2/b.js | 5 -- .../top_level_await/tla3/b.js | 7 -- .../top_level_await/tla3/timeout_loop.js | 23 ------ .../top_level_await/top_level_await.js | 3 - .../top_level_await/top_level_await.out | 3 - .../top_level_await/top_level_await.ts | 3 - .../top_level_await/top_level_for_await.js | 10 --- .../top_level_await/top_level_for_await.out | 3 - .../top_level_await/top_level_for_await.ts | 10 --- .../top_level_await/unresolved.js | 1 - .../top_level_await/unresolved.out | 4 - .../run/top_level_await_loop/__test__.jsonc | 4 - .../top_level_await/circular.js | 8 -- .../top_level_await/circular.out | 10 --- .../top_level_await/loop.js | 20 ----- .../top_level_await/loop.out | 5 -- .../top_level_await/nested.out | 5 -- .../top_level_await/nested/a.js | 3 - .../top_level_await/nested/b.js | 1 - .../top_level_await/nested/main.js | 3 - .../top_level_await/order.js | 21 ----- .../top_level_await/order.out | 2 - .../top_level_await/tla/a.js | 3 - .../top_level_await/tla/b.js | 7 -- .../top_level_await/tla/c.js | 3 - .../top_level_await/tla/d.js | 8 -- .../top_level_await/tla/order.js | 1 - .../top_level_await/tla/parent.js | 9 --- .../top_level_await/tla2/a.js | 5 -- .../top_level_await/tla2/b.js | 5 -- .../top_level_await/tla3/b.js | 7 -- .../top_level_await/tla3/timeout_loop.js | 23 ------ .../top_level_await/top_level_await.js | 3 - .../top_level_await/top_level_await.out | 3 - .../top_level_await/top_level_await.ts | 3 - .../top_level_await/top_level_for_await.js | 10 --- .../top_level_await/top_level_for_await.out | 3 - .../top_level_await/top_level_for_await.ts | 10 --- .../top_level_await/unresolved.js | 1 - .../top_level_await/unresolved.out | 4 - .../run/top_level_await_nested/__test__.jsonc | 4 - .../top_level_await/circular.js | 8 -- .../top_level_await/circular.out | 10 --- .../top_level_await/loop.js | 20 ----- .../top_level_await/loop.out | 5 -- .../top_level_await/nested.out | 5 -- .../top_level_await/nested/a.js | 3 - .../top_level_await/nested/b.js | 1 - .../top_level_await/nested/main.js | 3 - .../top_level_await/order.js | 21 ----- .../top_level_await/order.out | 2 - .../top_level_await/tla/a.js | 3 - .../top_level_await/tla/b.js | 7 -- .../top_level_await/tla/c.js | 3 - .../top_level_await/tla/d.js | 8 -- .../top_level_await/tla/order.js | 1 - .../top_level_await/tla/parent.js | 9 --- .../top_level_await/tla2/a.js | 5 -- .../top_level_await/tla2/b.js | 5 -- .../top_level_await/tla3/b.js | 7 -- .../top_level_await/tla3/timeout_loop.js | 23 ------ .../top_level_await/top_level_await.js | 3 - .../top_level_await/top_level_await.out | 3 - .../top_level_await/top_level_await.ts | 3 - .../top_level_await/top_level_for_await.js | 10 --- .../top_level_await/top_level_for_await.out | 3 - .../top_level_await/top_level_for_await.ts | 10 --- .../top_level_await/unresolved.js | 1 - .../top_level_await/unresolved.out | 4 - .../run/top_level_await_order/__test__.jsonc | 4 - .../top_level_await/circular.js | 8 -- .../top_level_await/circular.out | 10 --- .../top_level_await/loop.js | 20 ----- .../top_level_await/loop.out | 5 -- .../top_level_await/nested.out | 5 -- .../top_level_await/nested/a.js | 3 - .../top_level_await/nested/b.js | 1 - .../top_level_await/nested/main.js | 3 - .../top_level_await/order.js | 21 ----- .../top_level_await/order.out | 2 - .../top_level_await/tla/a.js | 3 - .../top_level_await/tla/b.js | 7 -- .../top_level_await/tla/c.js | 3 - .../top_level_await/tla/d.js | 8 -- .../top_level_await/tla/order.js | 1 - .../top_level_await/tla/parent.js | 9 --- .../top_level_await/tla2/a.js | 5 -- .../top_level_await/tla2/b.js | 5 -- .../top_level_await/tla3/b.js | 7 -- .../top_level_await/tla3/timeout_loop.js | 23 ------ .../top_level_await/top_level_await.js | 3 - .../top_level_await/top_level_await.out | 3 - .../top_level_await/top_level_await.ts | 3 - .../top_level_await/top_level_for_await.js | 10 --- .../top_level_await/top_level_for_await.out | 3 - .../top_level_await/top_level_for_await.ts | 10 --- .../top_level_await/unresolved.js | 1 - .../top_level_await/unresolved.out | 4 - .../run/top_level_await_ts/__test__.jsonc | 4 - tests/specs/run/top_level_await_ts/hello.txt | 1 - .../top_level_await/circular.js | 8 -- .../top_level_await/circular.out | 10 --- .../top_level_await/loop.js | 20 ----- .../top_level_await/loop.out | 5 -- .../top_level_await/nested.out | 5 -- .../top_level_await/nested/a.js | 3 - .../top_level_await/nested/b.js | 1 - .../top_level_await/nested/main.js | 3 - .../top_level_await/order.js | 21 ----- .../top_level_await/order.out | 2 - .../top_level_await/tla/a.js | 3 - .../top_level_await/tla/b.js | 7 -- .../top_level_await/tla/c.js | 3 - .../top_level_await/tla/d.js | 8 -- .../top_level_await/tla/order.js | 1 - .../top_level_await/tla/parent.js | 9 --- .../top_level_await/tla2/a.js | 5 -- .../top_level_await/tla2/b.js | 5 -- .../top_level_await/tla3/b.js | 7 -- .../top_level_await/tla3/timeout_loop.js | 23 ------ .../top_level_await/top_level_await.js | 3 - .../top_level_await/top_level_await.out | 3 - .../top_level_await/top_level_for_await.js | 10 --- .../top_level_await/top_level_for_await.out | 3 - .../top_level_await/top_level_for_await.ts | 10 --- .../top_level_await/unresolved.js | 1 - .../top_level_await/unresolved.out | 4 - .../top_level_await_unresolved/__test__.jsonc | 5 -- .../top_level_await/circular.js | 8 -- .../top_level_await/circular.out | 10 --- .../top_level_await/loop.js | 20 ----- .../top_level_await/loop.out | 5 -- .../top_level_await/nested.out | 5 -- .../top_level_await/nested/a.js | 3 - .../top_level_await/nested/b.js | 1 - .../top_level_await/nested/main.js | 3 - .../top_level_await/order.js | 21 ----- .../top_level_await/order.out | 2 - .../top_level_await/tla/a.js | 3 - .../top_level_await/tla/b.js | 7 -- .../top_level_await/tla/c.js | 3 - .../top_level_await/tla/d.js | 8 -- .../top_level_await/tla/order.js | 1 - .../top_level_await/tla/parent.js | 9 --- .../top_level_await/tla2/a.js | 5 -- .../top_level_await/tla2/b.js | 5 -- .../top_level_await/tla3/b.js | 7 -- .../top_level_await/tla3/timeout_loop.js | 23 ------ .../top_level_await/top_level_await.js | 3 - .../top_level_await/top_level_await.out | 3 - .../top_level_await/top_level_await.ts | 3 - .../top_level_await/top_level_for_await.js | 10 --- .../top_level_await/top_level_for_await.out | 3 - .../top_level_await/top_level_for_await.ts | 10 --- .../top_level_await/unresolved.js | 1 - .../top_level_await/unresolved.out | 4 - .../run/top_level_for_await/__test__.jsonc | 4 - .../top_level_await/circular.js | 8 -- .../top_level_await/circular.out | 10 --- .../top_level_await/loop.js | 20 ----- .../top_level_await/loop.out | 5 -- .../top_level_await/nested.out | 5 -- .../top_level_await/nested/a.js | 3 - .../top_level_await/nested/b.js | 1 - .../top_level_await/nested/main.js | 3 - .../top_level_await/order.js | 21 ----- .../top_level_await/order.out | 2 - .../top_level_await/tla/a.js | 3 - .../top_level_await/tla/b.js | 7 -- .../top_level_await/tla/c.js | 3 - .../top_level_await/tla/d.js | 8 -- .../top_level_await/tla/order.js | 1 - .../top_level_await/tla/parent.js | 9 --- .../top_level_await/tla2/a.js | 5 -- .../top_level_await/tla2/b.js | 5 -- .../top_level_await/tla3/b.js | 7 -- .../top_level_await/tla3/timeout_loop.js | 23 ------ .../top_level_await/top_level_await.js | 3 - .../top_level_await/top_level_await.out | 3 - .../top_level_await/top_level_await.ts | 3 - .../top_level_await/top_level_for_await.js | 10 --- .../top_level_await/top_level_for_await.out | 3 - .../top_level_await/top_level_for_await.ts | 10 --- .../top_level_await/unresolved.js | 1 - .../top_level_await/unresolved.out | 4 - .../run/top_level_for_await_ts/__test__.jsonc | 4 - .../top_level_await/circular.js | 8 -- .../top_level_await/circular.out | 10 --- .../top_level_await/loop.js | 20 ----- .../top_level_await/loop.out | 5 -- .../top_level_await/nested.out | 5 -- .../top_level_await/nested/a.js | 3 - .../top_level_await/nested/b.js | 1 - .../top_level_await/nested/main.js | 3 - .../top_level_await/order.js | 21 ----- .../top_level_await/order.out | 2 - .../top_level_await/tla/a.js | 3 - .../top_level_await/tla/b.js | 7 -- .../top_level_await/tla/c.js | 3 - .../top_level_await/tla/d.js | 8 -- .../top_level_await/tla/order.js | 1 - .../top_level_await/tla/parent.js | 9 --- .../top_level_await/tla2/a.js | 5 -- .../top_level_await/tla2/b.js | 5 -- .../top_level_await/tla3/b.js | 7 -- .../top_level_await/tla3/timeout_loop.js | 23 ------ .../top_level_await/top_level_await.js | 3 - .../top_level_await/top_level_await.out | 3 - .../top_level_await/top_level_await.ts | 3 - .../top_level_await/top_level_for_await.js | 10 --- .../top_level_await/top_level_for_await.out | 3 - .../top_level_await/top_level_for_await.ts | 10 --- .../top_level_await/unresolved.js | 1 - .../top_level_await/unresolved.out | 4 - tests/specs/run/ts_decorators/__test__.jsonc | 4 - .../decorators/experimental/deno.json | 5 -- .../decorators/experimental/no_check/main.out | 3 - .../decorators/experimental/no_check/main.ts | 21 ----- .../decorators/experimental/runtime/main.out | 7 -- .../decorators/experimental/runtime/main.ts | 42 ---------- .../decorators/experimental/ts/main.out | 3 - .../decorators/experimental/ts/main.ts | 14 ---- .../decorators/tc39_proposal/main.out | 3 - .../decorators/tc39_proposal/main.ts | 21 ----- tests/specs/run/unsafe_proto/__test__.jsonc | 4 +- .../unsafe_proto/{unsafe_proto => }/main.js | 0 .../unsafe_proto/{unsafe_proto => }/main.out | 0 .../unsafe_proto/{unsafe_proto => }/worker.js | 0 .../run/unsafe_proto_flag/__test__.jsonc | 4 +- .../{unsafe_proto => }/main.js | 0 .../main_with_unsafe_proto_flag.out | 0 .../unsafe_proto_flag/unsafe_proto/main.out | 2 - .../main_with_unsafe_proto_flag.out | 2 - .../{unsafe_proto => }/worker.js | 0 .../task/bin_pkg_with_scope_auto/bin_none.out | 12 --- tests/specs/task/filter/deno_multi.out | 0 tests/testdata/cache/037_fetch_multiple.out | 5 -- .../file_extensions/ts_with_extension.out | 1 - ...cted_fmt_check_verbose_formatted_files.out | 1 - .../testdata/fmt/fmt_with_config_default.out | 2 - tools/lint.js | 58 +++++++++++++- tools/util.js | 14 +++- 765 files changed, 517 insertions(+), 4766 deletions(-) create mode 100644 tests/specs/check/check_exclude_option/__test__.jsonc rename tests/specs/check/{check_with_exclude_option_by_dir/exclude_option => check_exclude_option}/deno.exclude_dir.json (100%) rename tests/specs/check/{check_with_exclude_option_by_dir/exclude_option => check_exclude_option}/deno.exclude_glob.json (100%) rename tests/specs/check/{check_with_exclude_option_by_dir/exclude_option => check_exclude_option}/deno.json (100%) rename tests/specs/check/{check_with_exclude_option_by_dir/exclude_option => check_exclude_option}/exclude_option.ts.error.out (100%) rename tests/specs/check/{check_with_exclude_option_by_dir/exclude_option => check_exclude_option}/ignored/index.ts (100%) rename tests/specs/check/{check_with_exclude_option_by_dir/exclude_option => check_exclude_option}/index.ts (100%) create mode 100644 tests/specs/check/check_node_builtin_modules/__test__.jsonc rename tests/specs/check/{check_node_builtin_modules_js/node_builtin_modules => check_node_builtin_modules}/mod.js (100%) rename tests/specs/check/{check_node_builtin_modules_ts/node_builtin_modules => check_node_builtin_modules}/mod.js.out (75%) rename tests/specs/check/{check_node_builtin_modules_js/node_builtin_modules => check_node_builtin_modules}/mod.ts (100%) rename tests/specs/check/{check_node_builtin_modules_js/node_builtin_modules => check_node_builtin_modules}/mod.ts.out (76%) delete mode 100644 tests/specs/check/check_node_builtin_modules_js/__test__.jsonc delete mode 100644 tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.js.out delete mode 100644 tests/specs/check/check_node_builtin_modules_ts/__test__.jsonc delete mode 100644 tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.js delete mode 100644 tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.ts delete mode 100644 tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.ts.out delete mode 100644 tests/specs/check/check_with_exclude_option_by_dir/__test__.jsonc delete mode 100644 tests/specs/check/check_with_exclude_option_by_glob/__test__.jsonc delete mode 100644 tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.exclude_dir.json delete mode 100644 tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.exclude_glob.json delete mode 100644 tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.json delete mode 100644 tests/specs/check/check_with_exclude_option_by_glob/exclude_option/exclude_option.ts.error.out delete mode 100644 tests/specs/check/check_with_exclude_option_by_glob/exclude_option/ignored/index.ts delete mode 100644 tests/specs/check/check_with_exclude_option_by_glob/exclude_option/index.ts delete mode 100644 tests/specs/check/check_without_exclude_option/__test__.jsonc delete mode 100644 tests/specs/check/check_without_exclude_option/exclude_option/deno.exclude_dir.json delete mode 100644 tests/specs/check/check_without_exclude_option/exclude_option/deno.exclude_glob.json delete mode 100644 tests/specs/check/check_without_exclude_option/exclude_option/deno.json delete mode 100644 tests/specs/check/check_without_exclude_option/exclude_option/exclude_option.ts.error.out delete mode 100644 tests/specs/check/check_without_exclude_option/exclude_option/ignored/index.ts delete mode 100644 tests/specs/check/check_without_exclude_option/exclude_option/index.ts delete mode 100644 tests/specs/lint/no_slow_types_entrypoint/__test__.jsonc delete mode 100644 tests/specs/lint/no_slow_types_entrypoint/a.ts delete mode 100644 tests/specs/lint/no_slow_types_entrypoint/b.ts delete mode 100644 tests/specs/lint/no_slow_types_entrypoint/c.ts delete mode 100644 tests/specs/lint/no_slow_types_entrypoint/d.ts delete mode 100644 tests/specs/lint/no_slow_types_entrypoint/deno.json delete mode 100644 tests/specs/lint/no_slow_types_entrypoint/deno.non-package.json delete mode 100644 tests/specs/lint/no_slow_types_entrypoint/no_slow_types.out delete mode 100644 tests/specs/lint/no_slow_types_entrypoint/no_slow_types_entrypoint.out delete mode 100644 tests/specs/lockfile/config_file_lock_path/lock_check_err2.out delete mode 100644 tests/specs/npm/check_all/__test__.jsonc delete mode 100644 tests/specs/npm/check_all/check_errors/main_local.out create mode 100644 tests/specs/npm/check_all_local/__test__.jsonc rename tests/specs/npm/{check_all/check_errors => check_all_local}/main.ts (100%) rename tests/specs/npm/{check_all/check_errors => check_all_local}/main_all.out (74%) rename tests/specs/npm/{check_local/check_errors => check_all_local}/main_local.out (76%) delete mode 100644 tests/specs/npm/check_local/__test__.jsonc delete mode 100644 tests/specs/npm/check_local/check_errors/main.ts delete mode 100644 tests/specs/npm/check_local/check_errors/main_all.out rename tests/specs/npm/cjs_with_deps/{cjs_with_deps => }/main.js (100%) rename tests/specs/npm/cjs_with_deps/{cjs_with_deps => }/main.out (100%) rename tests/specs/npm/cjs_with_deps/{cjs_with_deps => }/main_info.out (100%) rename tests/specs/npm/{node_modules_dir_with_deps => }/cjs_with_deps/main_info_json.out (71%) rename tests/specs/npm/cjs_with_deps/{cjs_with_deps => }/main_node_modules.out (100%) create mode 100644 tests/specs/npm/directory_import/__test__.jsonc rename tests/specs/npm/{directory_import_folder_index_js => }/directory_import/folder_index_js.out (100%) rename tests/specs/npm/{directory_import_folder_index_js => }/directory_import/folder_index_js.ts (100%) rename tests/specs/npm/{directory_import_folder_index_js => }/directory_import/folder_no_index.out (100%) rename tests/specs/npm/{directory_import_folder_index_js => }/directory_import/folder_no_index.ts (100%) delete mode 100644 tests/specs/npm/directory_import_folder_index_js/__test__.jsonc delete mode 100644 tests/specs/npm/directory_import_folder_no_index/__test__.jsonc delete mode 100644 tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.out delete mode 100644 tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.ts delete mode 100644 tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.out delete mode 100644 tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.ts rename tests/specs/npm/imports_package_json/{imports_package_json => }/import_not_defined.js (100%) rename tests/specs/npm/imports_package_json/{imports_package_json => }/import_not_defined.out (100%) rename tests/specs/npm/imports_package_json/{imports_package_json => }/main.js (100%) rename tests/specs/npm/imports_package_json/{imports_package_json => }/main.out (100%) rename tests/specs/npm/imports_package_json/{imports_package_json => }/package.json (100%) rename tests/specs/npm/imports_package_json/{imports_package_json => }/sub_path_import_not_defined.js (100%) rename tests/specs/npm/imports_package_json/{imports_package_json => }/sub_path_import_not_defined.out (100%) delete mode 100644 tests/specs/npm/imports_package_json_import_not_defined/__test__.jsonc delete mode 100644 tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.js delete mode 100644 tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out delete mode 100644 tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.js delete mode 100644 tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.out delete mode 100644 tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/package.json delete mode 100644 tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.js delete mode 100644 tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out delete mode 100644 tests/specs/npm/imports_package_json_sub_path_import_not_defined/__test__.jsonc delete mode 100644 tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.js delete mode 100644 tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out delete mode 100644 tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.js delete mode 100644 tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out delete mode 100644 tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/package.json delete mode 100644 tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.js delete mode 100644 tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out delete mode 100644 tests/specs/npm/info_cli_chalk_display/__test__.jsonc delete mode 100644 tests/specs/npm/info_cli_chalk_display/info/chalk_json.out rename tests/specs/npm/{info_cli_chalk_display/info => info_cli_chalk_json}/chalk.out (100%) rename tests/specs/npm/info_cli_chalk_json/{info => }/chalk_json.out (100%) delete mode 100644 tests/specs/npm/info_cli_chalk_json/info/chalk.out delete mode 100644 tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles.out create mode 100644 tests/specs/npm/mixed_case_package_name/__test__.jsonc rename tests/specs/npm/{mixed_case_package_name_global_dir => }/mixed_case_package_name/global.out (100%) rename tests/specs/npm/{mixed_case_package_name_global_dir => }/mixed_case_package_name/global.ts (100%) rename tests/specs/npm/{mixed_case_package_name_global_dir => }/mixed_case_package_name/local.out (100%) rename tests/specs/npm/{mixed_case_package_name_global_dir => }/mixed_case_package_name/local.ts (100%) delete mode 100644 tests/specs/npm/mixed_case_package_name_global_dir/__test__.jsonc delete mode 100644 tests/specs/npm/mixed_case_package_name_local_dir/__test__.jsonc delete mode 100644 tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.out delete mode 100644 tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.ts delete mode 100644 tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.out delete mode 100644 tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.ts rename tests/specs/npm/node_modules_dir_with_deps/{cjs_with_deps => }/main.js (100%) rename tests/specs/npm/node_modules_dir_with_deps/{cjs_with_deps => }/main.out (100%) rename tests/specs/npm/node_modules_dir_with_deps/{cjs_with_deps => }/main_info.out (92%) rename tests/specs/npm/{cjs_with_deps/cjs_with_deps => node_modules_dir_with_deps}/main_info_json.out (73%) rename tests/specs/npm/node_modules_dir_with_deps/{cjs_with_deps => }/main_node_modules.out (100%) delete mode 100644 tests/specs/npm/types_ambient_module_import_map/__test__.jsonc delete mode 100644 tests/specs/npm/types_ambient_module_import_map/types_ambient_module/import_map.json delete mode 100644 tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.out delete mode 100644 tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.ts delete mode 100644 tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.out delete mode 100644 tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.ts create mode 100644 tests/specs/run/decorators/experimental/__test__.jsonc rename tests/specs/run/{decorators_tc39_proposal => }/decorators/experimental/deno.json (100%) rename tests/specs/run/{decorators_tc39_proposal => }/decorators/experimental/no_check/main.out (100%) rename tests/specs/run/{decorators_tc39_proposal => }/decorators/experimental/no_check/main.ts (100%) rename tests/specs/run/{decorators_tc39_proposal => }/decorators/experimental/runtime/main.out (100%) rename tests/specs/run/{decorators_tc39_proposal => }/decorators/experimental/runtime/main.ts (100%) rename tests/specs/run/{decorators_tc39_proposal => }/decorators/experimental/ts/main.out (100%) rename tests/specs/run/{decorators_tc39_proposal => }/decorators/experimental/ts/main.ts (100%) create mode 100644 tests/specs/run/decorators/tc39_proposal/__test__.jsonc rename tests/specs/run/{decorators_tc39_proposal => }/decorators/tc39_proposal/main.out (100%) rename tests/specs/run/{decorators_tc39_proposal => }/decorators/tc39_proposal/main.ts (100%) delete mode 100644 tests/specs/run/decorators_tc39_proposal/__test__.jsonc delete mode 100644 tests/specs/run/error_import_map_unable_to_load/import_maps/test_data.ts delete mode 100644 tests/specs/run/error_import_map_unable_to_load/import_maps/test_data.ts.out create mode 100644 tests/specs/run/jsx_import_source/__test__.jsonc rename tests/specs/run/{jsx_import_source_error => jsx_import_source}/jsx/deno-jsx-error.jsonc (100%) rename tests/specs/run/{jsx_import_source_error => jsx_import_source}/jsx/deno-jsx-import-map.jsonc (100%) rename tests/specs/run/{jsx_import_source_error => jsx_import_source}/jsx/deno-jsx-precompile-skip.jsonc (100%) rename tests/specs/run/{jsx_import_source_error => jsx_import_source}/jsx/deno-jsx-precompile.jsonc (100%) rename tests/specs/run/{jsx_import_source_error => jsx_import_source}/jsx/deno-jsx.json (100%) rename tests/specs/run/{jsx_import_source_error => jsx_import_source}/jsx/deno-jsx.jsonc (100%) rename tests/specs/run/{jsx_import_source_error => jsx_import_source}/jsx/deno-jsxdev-import-map.jsonc (100%) rename tests/specs/run/{jsx_import_source_error => jsx_import_source}/jsx/deno-jsxdev.jsonc (100%) rename tests/specs/run/{jsx_import_source_error => jsx_import_source}/jsx/deno.lock (100%) rename tests/specs/run/{jsx_import_source_error => jsx_import_source}/jsx/import-map-scoped.json (100%) rename tests/specs/run/{jsx_import_source_error => jsx_import_source}/jsx/import-map.json (100%) rename tests/specs/run/{jsx_import_source_error => jsx_import_source}/jsx/jsx-dev-runtime/index.ts (100%) rename tests/specs/run/{jsx_import_source_error => jsx_import_source}/jsx/jsx-precompile/index.ts (100%) rename tests/specs/run/{jsx_import_source_error => jsx_import_source}/jsx/jsx-runtime/index.ts (100%) rename tests/specs/run/{jsx_import_source_no_pragma => jsx_import_source}/jsx_import_source.out (100%) rename tests/specs/run/{jsx_import_source_no_pragma_dev => jsx_import_source}/jsx_import_source_dev.out (100%) rename tests/specs/run/{jsx_import_source_error => jsx_import_source}/jsx_import_source_error.out (100%) rename tests/specs/run/{jsx_import_source_import_map => jsx_import_source}/jsx_import_source_import_map.out (100%) rename tests/specs/run/{jsx_import_source_import_map_dev => jsx_import_source}/jsx_import_source_import_map_dev.out (100%) rename tests/specs/run/{jsx_import_source_error => jsx_import_source}/jsx_import_source_no_pragma.tsx (100%) rename tests/specs/run/{jsx_import_source_pragma => jsx_import_source}/jsx_import_source_pragma.tsx (100%) rename tests/specs/run/{jsx_import_source_pragma_import_map => jsx_import_source}/jsx_import_source_pragma_import_map.tsx (100%) rename tests/specs/run/{jsx_import_source_precompile_import_map => jsx_import_source}/jsx_precompile/no_pragma.out (100%) rename tests/specs/run/{jsx_import_source_precompile_import_map => jsx_import_source}/jsx_precompile/no_pragma.tsx (100%) rename tests/specs/run/{jsx_import_source_precompile_import_map_skip_element => jsx_import_source}/jsx_precompile/skip.out (100%) rename tests/specs/run/{jsx_import_source_precompile_import_map => jsx_import_source}/jsx_precompile/skip.tsx (100%) delete mode 100644 tests/specs/run/jsx_import_source_error/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_import_map/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_import_map/jsx_import_source_no_pragma.tsx delete mode 100644 tests/specs/run/jsx_import_source_import_map_dev/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_import_map_dev/jsx_import_source_no_pragma.tsx delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx_import_source_import_map.out delete mode 100644 tests/specs/run/jsx_import_source_import_map_no_check/jsx_import_source_no_pragma.tsx delete mode 100644 tests/specs/run/jsx_import_source_no_pragma/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx_import_source_no_pragma.tsx delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx_import_source_no_pragma.tsx delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx_import_source.out delete mode 100644 tests/specs/run/jsx_import_source_no_pragma_no_check/jsx_import_source_no_pragma.tsx delete mode 100644 tests/specs/run/jsx_import_source_pragma/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma/jsx_import_source.out delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx_import_source_import_map.out delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx_import_source_import_map_dev.out delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx_import_source_pragma_import_map.tsx delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx_import_source_import_map.out delete mode 100644 tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx_import_source_pragma_import_map.tsx delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx_import_source.out delete mode 100644 tests/specs/run/jsx_import_source_pragma_no_check/jsx_import_source_pragma.tsx delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx_import_source.out delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config/jsx_import_source_pragma.tsx delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx_import_source.out delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx_import_source_pragma.tsx delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/vendor/http_localhost_4545/jsx/#jsx-runtime_62ac8.js delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/vendor/manifest.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx_import_source.out delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx_import_source_pragma.tsx delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx_import_source_dev.out delete mode 100644 tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx_import_source_pragma.tsx delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/skip.out delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/__test__.jsonc delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-error.jsonc delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-precompile-skip.jsonc delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-precompile.jsonc delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx.json delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx.jsonc delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsxdev-import-map.jsonc delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsxdev.jsonc delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno.lock delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/import-map-scoped.json delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/import-map.json delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-dev-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-precompile/index.ts delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-runtime/index.ts delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/no_pragma.out delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/no_pragma.tsx delete mode 100644 tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/skip.tsx delete mode 100644 tests/specs/run/no_check_decorators/__test__.jsonc delete mode 100644 tests/specs/run/no_check_decorators/decorators/experimental/deno.json delete mode 100644 tests/specs/run/no_check_decorators/decorators/experimental/no_check/main.out delete mode 100644 tests/specs/run/no_check_decorators/decorators/experimental/no_check/main.ts delete mode 100644 tests/specs/run/no_check_decorators/decorators/experimental/runtime/main.out delete mode 100644 tests/specs/run/no_check_decorators/decorators/experimental/runtime/main.ts delete mode 100644 tests/specs/run/no_check_decorators/decorators/experimental/ts/main.out delete mode 100644 tests/specs/run/no_check_decorators/decorators/experimental/ts/main.ts delete mode 100644 tests/specs/run/no_check_decorators/decorators/tc39_proposal/main.out delete mode 100644 tests/specs/run/no_check_decorators/decorators/tc39_proposal/main.ts delete mode 100644 tests/specs/run/runtime_decorators/__test__.jsonc delete mode 100644 tests/specs/run/runtime_decorators/decorators/experimental/deno.json delete mode 100644 tests/specs/run/runtime_decorators/decorators/experimental/no_check/main.out delete mode 100644 tests/specs/run/runtime_decorators/decorators/experimental/no_check/main.ts delete mode 100644 tests/specs/run/runtime_decorators/decorators/experimental/runtime/main.out delete mode 100644 tests/specs/run/runtime_decorators/decorators/experimental/runtime/main.ts delete mode 100644 tests/specs/run/runtime_decorators/decorators/experimental/ts/main.out delete mode 100644 tests/specs/run/runtime_decorators/decorators/experimental/ts/main.ts delete mode 100644 tests/specs/run/runtime_decorators/decorators/tc39_proposal/main.out delete mode 100644 tests/specs/run/runtime_decorators/decorators/tc39_proposal/main.ts rename tests/specs/run/top_level_await/{top_level_await => }/circular.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/circular.out (100%) rename tests/specs/run/{top_level_await_circular => }/top_level_await/loop.js (74%) rename tests/specs/run/top_level_await/{top_level_await => }/loop.out (100%) rename tests/specs/run/top_level_await/{top_level_await => }/nested.out (100%) rename tests/specs/run/top_level_await/{top_level_await => }/nested/a.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/nested/b.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/nested/main.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/order.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/order.out (100%) rename tests/specs/run/top_level_await/{top_level_await => }/tla/a.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/tla/b.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/tla/c.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/tla/d.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/tla/order.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/tla/parent.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/tla2/a.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/tla2/b.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/tla3/b.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/tla3/timeout_loop.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/top_level_await.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/top_level_await.out (58%) rename tests/specs/run/{top_level_await_ts => }/top_level_await/top_level_await.ts (100%) delete mode 100644 tests/specs/run/top_level_await/top_level_await/loop.js delete mode 100644 tests/specs/run/top_level_await/top_level_await/top_level_await.ts rename tests/specs/run/top_level_await/{top_level_await => }/top_level_for_await.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/top_level_for_await.out (100%) rename tests/specs/run/top_level_await/{top_level_await => }/top_level_for_await.ts (100%) rename tests/specs/run/top_level_await/{top_level_await => }/unresolved.js (100%) rename tests/specs/run/top_level_await/{top_level_await => }/unresolved.out (100%) delete mode 100644 tests/specs/run/top_level_await_circular/__test__.jsonc delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/circular.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/circular.out delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/loop.out delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/nested.out delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/nested/a.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/nested/b.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/nested/main.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/order.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/order.out delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla/a.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla/b.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla/c.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla/d.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla/order.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla/parent.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla2/a.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla2/b.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla3/b.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/tla3/timeout_loop.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/top_level_await.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/top_level_await.out delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/top_level_await.ts delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.out delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.ts delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/unresolved.js delete mode 100644 tests/specs/run/top_level_await_circular/top_level_await/unresolved.out delete mode 100644 tests/specs/run/top_level_await_loop/__test__.jsonc delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/circular.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/circular.out delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/loop.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/loop.out delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/nested.out delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/nested/a.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/nested/b.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/nested/main.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/order.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/order.out delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla/a.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla/b.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla/c.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla/d.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla/order.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla/parent.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla2/a.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla2/b.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla3/b.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/tla3/timeout_loop.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/top_level_await.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/top_level_await.out delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/top_level_await.ts delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.out delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.ts delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/unresolved.js delete mode 100644 tests/specs/run/top_level_await_loop/top_level_await/unresolved.out delete mode 100644 tests/specs/run/top_level_await_nested/__test__.jsonc delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/circular.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/circular.out delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/loop.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/loop.out delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/nested.out delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/nested/a.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/nested/b.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/nested/main.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/order.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/order.out delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla/a.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla/b.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla/c.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla/d.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla/order.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla/parent.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla2/a.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla2/b.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla3/b.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/tla3/timeout_loop.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/top_level_await.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/top_level_await.out delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/top_level_await.ts delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.out delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.ts delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/unresolved.js delete mode 100644 tests/specs/run/top_level_await_nested/top_level_await/unresolved.out delete mode 100644 tests/specs/run/top_level_await_order/__test__.jsonc delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/circular.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/circular.out delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/loop.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/loop.out delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/nested.out delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/nested/a.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/nested/b.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/nested/main.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/order.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/order.out delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla/a.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla/b.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla/c.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla/d.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla/order.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla/parent.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla2/a.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla2/b.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla3/b.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/tla3/timeout_loop.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/top_level_await.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/top_level_await.out delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/top_level_await.ts delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.out delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.ts delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/unresolved.js delete mode 100644 tests/specs/run/top_level_await_order/top_level_await/unresolved.out delete mode 100644 tests/specs/run/top_level_await_ts/__test__.jsonc delete mode 100644 tests/specs/run/top_level_await_ts/hello.txt delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/circular.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/circular.out delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/loop.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/loop.out delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/nested.out delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/nested/a.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/nested/b.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/nested/main.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/order.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/order.out delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla/a.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla/b.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla/c.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla/d.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla/order.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla/parent.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla2/a.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla2/b.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla3/b.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/tla3/timeout_loop.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/top_level_await.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/top_level_await.out delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.out delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.ts delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/unresolved.js delete mode 100644 tests/specs/run/top_level_await_ts/top_level_await/unresolved.out delete mode 100644 tests/specs/run/top_level_await_unresolved/__test__.jsonc delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/circular.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/circular.out delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/loop.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/loop.out delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/nested.out delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/nested/a.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/nested/b.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/nested/main.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/order.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/order.out delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla/a.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla/b.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla/c.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla/d.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla/order.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla/parent.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla2/a.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla2/b.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla3/b.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/tla3/timeout_loop.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.out delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.ts delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.out delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.ts delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/unresolved.js delete mode 100644 tests/specs/run/top_level_await_unresolved/top_level_await/unresolved.out delete mode 100644 tests/specs/run/top_level_for_await/__test__.jsonc delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/circular.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/circular.out delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/loop.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/loop.out delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/nested.out delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/nested/a.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/nested/b.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/nested/main.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/order.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/order.out delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla/a.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla/b.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla/c.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla/d.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla/order.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla/parent.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla2/a.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla2/b.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla3/b.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/tla3/timeout_loop.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/top_level_await.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/top_level_await.out delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/top_level_await.ts delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.out delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.ts delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/unresolved.js delete mode 100644 tests/specs/run/top_level_for_await/top_level_await/unresolved.out delete mode 100644 tests/specs/run/top_level_for_await_ts/__test__.jsonc delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/circular.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/circular.out delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/loop.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/loop.out delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/nested.out delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/nested/a.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/nested/b.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/nested/main.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/order.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/order.out delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla/a.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla/b.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla/c.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla/d.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla/order.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla/parent.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla2/a.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla2/b.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla3/b.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/tla3/timeout_loop.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.out delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.ts delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.out delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.ts delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/unresolved.js delete mode 100644 tests/specs/run/top_level_for_await_ts/top_level_await/unresolved.out delete mode 100644 tests/specs/run/ts_decorators/__test__.jsonc delete mode 100644 tests/specs/run/ts_decorators/decorators/experimental/deno.json delete mode 100644 tests/specs/run/ts_decorators/decorators/experimental/no_check/main.out delete mode 100644 tests/specs/run/ts_decorators/decorators/experimental/no_check/main.ts delete mode 100644 tests/specs/run/ts_decorators/decorators/experimental/runtime/main.out delete mode 100644 tests/specs/run/ts_decorators/decorators/experimental/runtime/main.ts delete mode 100644 tests/specs/run/ts_decorators/decorators/experimental/ts/main.out delete mode 100644 tests/specs/run/ts_decorators/decorators/experimental/ts/main.ts delete mode 100644 tests/specs/run/ts_decorators/decorators/tc39_proposal/main.out delete mode 100644 tests/specs/run/ts_decorators/decorators/tc39_proposal/main.ts rename tests/specs/run/unsafe_proto/{unsafe_proto => }/main.js (100%) rename tests/specs/run/unsafe_proto/{unsafe_proto => }/main.out (100%) rename tests/specs/run/unsafe_proto/{unsafe_proto => }/worker.js (100%) rename tests/specs/run/unsafe_proto_flag/{unsafe_proto => }/main.js (100%) rename tests/specs/run/{unsafe_proto/unsafe_proto => unsafe_proto_flag}/main_with_unsafe_proto_flag.out (100%) delete mode 100644 tests/specs/run/unsafe_proto_flag/unsafe_proto/main.out delete mode 100644 tests/specs/run/unsafe_proto_flag/unsafe_proto/main_with_unsafe_proto_flag.out rename tests/specs/run/unsafe_proto_flag/{unsafe_proto => }/worker.js (100%) delete mode 100644 tests/specs/task/bin_pkg_with_scope_auto/bin_none.out delete mode 100644 tests/specs/task/filter/deno_multi.out delete mode 100644 tests/testdata/cache/037_fetch_multiple.out delete mode 100644 tests/testdata/file_extensions/ts_with_extension.out delete mode 100644 tests/testdata/fmt/expected_fmt_check_verbose_formatted_files.out delete mode 100644 tests/testdata/fmt/fmt_with_config_default.out diff --git a/tests/specs/check/check_exclude_option/__test__.jsonc b/tests/specs/check/check_exclude_option/__test__.jsonc new file mode 100644 index 0000000000..d8e41403c2 --- /dev/null +++ b/tests/specs/check/check_exclude_option/__test__.jsonc @@ -0,0 +1,19 @@ +{ + "tests": { + "by_dir": { + "args": "check --quiet --config deno.exclude_dir.json ignored/index.ts", + "output": "", + "exitCode": 0 + }, + "by_glob": { + "args": "check --quiet --config deno.exclude_glob.json ignored/index.ts", + "output": "", + "exitCode": 0 + }, + "without": { + "args": "check --quiet --config deno.json ignored/index.ts", + "output": "exclude_option.ts.error.out", + "exitCode": 1 + } + } +} diff --git a/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.exclude_dir.json b/tests/specs/check/check_exclude_option/deno.exclude_dir.json similarity index 100% rename from tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.exclude_dir.json rename to tests/specs/check/check_exclude_option/deno.exclude_dir.json diff --git a/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.exclude_glob.json b/tests/specs/check/check_exclude_option/deno.exclude_glob.json similarity index 100% rename from tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.exclude_glob.json rename to tests/specs/check/check_exclude_option/deno.exclude_glob.json diff --git a/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.json b/tests/specs/check/check_exclude_option/deno.json similarity index 100% rename from tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.json rename to tests/specs/check/check_exclude_option/deno.json diff --git a/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/exclude_option.ts.error.out b/tests/specs/check/check_exclude_option/exclude_option.ts.error.out similarity index 100% rename from tests/specs/check/check_with_exclude_option_by_dir/exclude_option/exclude_option.ts.error.out rename to tests/specs/check/check_exclude_option/exclude_option.ts.error.out diff --git a/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/ignored/index.ts b/tests/specs/check/check_exclude_option/ignored/index.ts similarity index 100% rename from tests/specs/check/check_with_exclude_option_by_dir/exclude_option/ignored/index.ts rename to tests/specs/check/check_exclude_option/ignored/index.ts diff --git a/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/index.ts b/tests/specs/check/check_exclude_option/index.ts similarity index 100% rename from tests/specs/check/check_with_exclude_option_by_dir/exclude_option/index.ts rename to tests/specs/check/check_exclude_option/index.ts diff --git a/tests/specs/check/check_node_builtin_modules/__test__.jsonc b/tests/specs/check/check_node_builtin_modules/__test__.jsonc new file mode 100644 index 0000000000..eb56845a19 --- /dev/null +++ b/tests/specs/check/check_node_builtin_modules/__test__.jsonc @@ -0,0 +1,14 @@ +{ + "tests": { + "js": { + "args": "check --quiet mod.js", + "output": "mod.js.out", + "exitCode": 1 + }, + "ts": { + "args": "check --quiet mod.ts", + "output": "mod.ts.out", + "exitCode": 1 + } + } +} diff --git a/tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.js b/tests/specs/check/check_node_builtin_modules/mod.js similarity index 100% rename from tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.js rename to tests/specs/check/check_node_builtin_modules/mod.js diff --git a/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.js.out b/tests/specs/check/check_node_builtin_modules/mod.js.out similarity index 75% rename from tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.js.out rename to tests/specs/check/check_node_builtin_modules/mod.js.out index 97786ebaeb..646a2e5cc4 100644 --- a/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.js.out +++ b/tests/specs/check/check_node_builtin_modules/mod.js.out @@ -2,4 +2,4 @@ error: TS2769 [ERROR]: No overload matches this call. [WILDCARD] const _data = fs.readFileSync("./node_builtin.js", 123); ~~~ - at file:///[WILDCARD]/node_builtin_modules/mod.js:3:52 + at file:///[WILDCARD]/mod.js:3:52 diff --git a/tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.ts b/tests/specs/check/check_node_builtin_modules/mod.ts similarity index 100% rename from tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.ts rename to tests/specs/check/check_node_builtin_modules/mod.ts diff --git a/tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.ts.out b/tests/specs/check/check_node_builtin_modules/mod.ts.out similarity index 76% rename from tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.ts.out rename to tests/specs/check/check_node_builtin_modules/mod.ts.out index 49b762cff8..38eef5edc7 100644 --- a/tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.ts.out +++ b/tests/specs/check/check_node_builtin_modules/mod.ts.out @@ -2,12 +2,12 @@ error: TS2769 [ERROR]: No overload matches this call. [WILDCARD] const _data = fs.readFileSync("./node_builtin.js", 123); ~~~ - at file:///[WILDCARD]/node_builtin_modules/mod.ts:2:52 + at file:///[WILDCARD]/mod.ts:2:52 TS2322 [ERROR]: Type 'string[]' is not assignable to type 'number[]'. Type 'string' is not assignable to type 'number'. const _testString: number[] = builtinModules; ~~~~~~~~~~~ - at file:///[WILDCARD]/node_builtin_modules/mod.ts:9:7 + at file:///[WILDCARD]/mod.ts:9:7 Found 2 errors. diff --git a/tests/specs/check/check_node_builtin_modules_js/__test__.jsonc b/tests/specs/check/check_node_builtin_modules_js/__test__.jsonc deleted file mode 100644 index 8f7a2a65a6..0000000000 --- a/tests/specs/check/check_node_builtin_modules_js/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "check --quiet node_builtin_modules/mod.js", - "output": "node_builtin_modules/mod.js.out", - "exitCode": 1 -} diff --git a/tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.js.out b/tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.js.out deleted file mode 100644 index 97786ebaeb..0000000000 --- a/tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.js.out +++ /dev/null @@ -1,5 +0,0 @@ -error: TS2769 [ERROR]: No overload matches this call. - [WILDCARD] -const _data = fs.readFileSync("./node_builtin.js", 123); - ~~~ - at file:///[WILDCARD]/node_builtin_modules/mod.js:3:52 diff --git a/tests/specs/check/check_node_builtin_modules_ts/__test__.jsonc b/tests/specs/check/check_node_builtin_modules_ts/__test__.jsonc deleted file mode 100644 index 736885f2ec..0000000000 --- a/tests/specs/check/check_node_builtin_modules_ts/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "check --quiet node_builtin_modules/mod.ts", - "output": "node_builtin_modules/mod.ts.out", - "exitCode": 1 -} diff --git a/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.js b/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.js deleted file mode 100644 index 196fb9be98..0000000000 --- a/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.js +++ /dev/null @@ -1,3 +0,0 @@ -// @ts-check -import fs from "node:fs"; -const _data = fs.readFileSync("./node_builtin.js", 123); diff --git a/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.ts b/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.ts deleted file mode 100644 index 0e62353fec..0000000000 --- a/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.ts +++ /dev/null @@ -1,9 +0,0 @@ -import fs from "node:fs"; -const _data = fs.readFileSync("./node_builtin.js", 123); - -// check node:module specifically because for deno check it should -// resolve to the @types/node package, but at runtime it uses a different -// builtin object than deno_std -import { builtinModules } from "node:module"; -// should error about being string[] -const _testString: number[] = builtinModules; diff --git a/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.ts.out b/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.ts.out deleted file mode 100644 index 49b762cff8..0000000000 --- a/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.ts.out +++ /dev/null @@ -1,13 +0,0 @@ -error: TS2769 [ERROR]: No overload matches this call. - [WILDCARD] -const _data = fs.readFileSync("./node_builtin.js", 123); - ~~~ - at file:///[WILDCARD]/node_builtin_modules/mod.ts:2:52 - -TS2322 [ERROR]: Type 'string[]' is not assignable to type 'number[]'. - Type 'string' is not assignable to type 'number'. -const _testString: number[] = builtinModules; - ~~~~~~~~~~~ - at file:///[WILDCARD]/node_builtin_modules/mod.ts:9:7 - -Found 2 errors. diff --git a/tests/specs/check/check_with_exclude_option_by_dir/__test__.jsonc b/tests/specs/check/check_with_exclude_option_by_dir/__test__.jsonc deleted file mode 100644 index c7fe285da8..0000000000 --- a/tests/specs/check/check_with_exclude_option_by_dir/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "check --quiet --config exclude_option/deno.exclude_dir.json exclude_option/ignored/index.ts", - "output": "", - "exitCode": 0 -} diff --git a/tests/specs/check/check_with_exclude_option_by_glob/__test__.jsonc b/tests/specs/check/check_with_exclude_option_by_glob/__test__.jsonc deleted file mode 100644 index 54700ca3d8..0000000000 --- a/tests/specs/check/check_with_exclude_option_by_glob/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "check --quiet --config exclude_option/deno.exclude_glob.json exclude_option/ignored/index.ts", - "output": "", - "exitCode": 0 -} diff --git a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.exclude_dir.json b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.exclude_dir.json deleted file mode 100644 index 2019f8953d..0000000000 --- a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.exclude_dir.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "exclude": [ - "ignored" - ] -} diff --git a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.exclude_glob.json b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.exclude_glob.json deleted file mode 100644 index 1d203ba089..0000000000 --- a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.exclude_glob.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "exclude": [ - "ignored/**/*" - ] -} diff --git a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.json b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.json deleted file mode 100644 index a9eca74ca4..0000000000 --- a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "exclude": [] -} diff --git a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/exclude_option.ts.error.out b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/exclude_option.ts.error.out deleted file mode 100644 index abd1c12586..0000000000 --- a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/exclude_option.ts.error.out +++ /dev/null @@ -1,4 +0,0 @@ -error: TS2304 [ERROR]: Cannot find name 'nothing'. -export { nothing }; - ~~~~~~~ - at [WILDCARD] diff --git a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/ignored/index.ts b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/ignored/index.ts deleted file mode 100644 index 0419cf073c..0000000000 --- a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/ignored/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { nothing }; diff --git a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/index.ts b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/index.ts deleted file mode 100644 index 8335ca3a2e..0000000000 --- a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { nothing } from "./ignored/index.ts"; - -const foo = 1; - -export { foo, nothing }; diff --git a/tests/specs/check/check_without_exclude_option/__test__.jsonc b/tests/specs/check/check_without_exclude_option/__test__.jsonc deleted file mode 100644 index 801786fa3d..0000000000 --- a/tests/specs/check/check_without_exclude_option/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "check --quiet --config exclude_option/deno.json exclude_option/ignored/index.ts", - "output": "exclude_option/exclude_option.ts.error.out", - "exitCode": 1 -} diff --git a/tests/specs/check/check_without_exclude_option/exclude_option/deno.exclude_dir.json b/tests/specs/check/check_without_exclude_option/exclude_option/deno.exclude_dir.json deleted file mode 100644 index 2019f8953d..0000000000 --- a/tests/specs/check/check_without_exclude_option/exclude_option/deno.exclude_dir.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "exclude": [ - "ignored" - ] -} diff --git a/tests/specs/check/check_without_exclude_option/exclude_option/deno.exclude_glob.json b/tests/specs/check/check_without_exclude_option/exclude_option/deno.exclude_glob.json deleted file mode 100644 index 1d203ba089..0000000000 --- a/tests/specs/check/check_without_exclude_option/exclude_option/deno.exclude_glob.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "exclude": [ - "ignored/**/*" - ] -} diff --git a/tests/specs/check/check_without_exclude_option/exclude_option/deno.json b/tests/specs/check/check_without_exclude_option/exclude_option/deno.json deleted file mode 100644 index a9eca74ca4..0000000000 --- a/tests/specs/check/check_without_exclude_option/exclude_option/deno.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "exclude": [] -} diff --git a/tests/specs/check/check_without_exclude_option/exclude_option/exclude_option.ts.error.out b/tests/specs/check/check_without_exclude_option/exclude_option/exclude_option.ts.error.out deleted file mode 100644 index abd1c12586..0000000000 --- a/tests/specs/check/check_without_exclude_option/exclude_option/exclude_option.ts.error.out +++ /dev/null @@ -1,4 +0,0 @@ -error: TS2304 [ERROR]: Cannot find name 'nothing'. -export { nothing }; - ~~~~~~~ - at [WILDCARD] diff --git a/tests/specs/check/check_without_exclude_option/exclude_option/ignored/index.ts b/tests/specs/check/check_without_exclude_option/exclude_option/ignored/index.ts deleted file mode 100644 index 0419cf073c..0000000000 --- a/tests/specs/check/check_without_exclude_option/exclude_option/ignored/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { nothing }; diff --git a/tests/specs/check/check_without_exclude_option/exclude_option/index.ts b/tests/specs/check/check_without_exclude_option/exclude_option/index.ts deleted file mode 100644 index 8335ca3a2e..0000000000 --- a/tests/specs/check/check_without_exclude_option/exclude_option/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { nothing } from "./ignored/index.ts"; - -const foo = 1; - -export { foo, nothing }; diff --git a/tests/specs/lint/no_slow_types/__test__.jsonc b/tests/specs/lint/no_slow_types/__test__.jsonc index 2a5a340328..9d0358c836 100644 --- a/tests/specs/lint/no_slow_types/__test__.jsonc +++ b/tests/specs/lint/no_slow_types/__test__.jsonc @@ -1,17 +1,26 @@ { - "steps": [{ - "args": "lint", - "output": "no_slow_types.out", - "exitCode": 1 - }, { - "args": "lint --rules-exclude=no-slow-types", - "output": "Checked 4 files\n" - }, { - "args": "lint --config=deno.non-package.json", - "output": "Checked 4 files\n" - }, { - // non-entrypoint - "args": "lint d.ts", - "output": "Checked 1 file\n" - }] + "tests": { + "no_entrypoint": { + "steps": [{ + "args": "lint", + "output": "no_slow_types.out", + "exitCode": 1 + }, { + "args": "lint --rules-exclude=no-slow-types", + "output": "Checked 4 files\n" + }, { + "args": "lint --config=deno.non-package.json", + "output": "Checked 4 files\n" + }, { + // non-entrypoint + "args": "lint d.ts", + "output": "Checked 1 file\n" + }] + }, + "entrypoint": { + "args": "lint a.ts", + "output": "no_slow_types_entrypoint.out", + "exitCode": 1 + } + } } diff --git a/tests/specs/lint/no_slow_types_entrypoint/__test__.jsonc b/tests/specs/lint/no_slow_types_entrypoint/__test__.jsonc deleted file mode 100644 index 2ba74c03fd..0000000000 --- a/tests/specs/lint/no_slow_types_entrypoint/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "lint a.ts", - "output": "no_slow_types_entrypoint.out", - "exitCode": 1 -} diff --git a/tests/specs/lint/no_slow_types_entrypoint/a.ts b/tests/specs/lint/no_slow_types_entrypoint/a.ts deleted file mode 100644 index 3b399665dc..0000000000 --- a/tests/specs/lint/no_slow_types_entrypoint/a.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function add(a: number, b: number) { - return a + b; -} diff --git a/tests/specs/lint/no_slow_types_entrypoint/b.ts b/tests/specs/lint/no_slow_types_entrypoint/b.ts deleted file mode 100644 index b96a794894..0000000000 --- a/tests/specs/lint/no_slow_types_entrypoint/b.ts +++ /dev/null @@ -1,5 +0,0 @@ -export function addB(a: number, b: number) { - return a + b; -} - -export * from "./d.ts"; diff --git a/tests/specs/lint/no_slow_types_entrypoint/c.ts b/tests/specs/lint/no_slow_types_entrypoint/c.ts deleted file mode 100644 index 517aa3d211..0000000000 --- a/tests/specs/lint/no_slow_types_entrypoint/c.ts +++ /dev/null @@ -1,4 +0,0 @@ -// this one won't error because it's not an export -export function addC(a: number, b: number) { - return a + b; -} diff --git a/tests/specs/lint/no_slow_types_entrypoint/d.ts b/tests/specs/lint/no_slow_types_entrypoint/d.ts deleted file mode 100644 index babe9d81b5..0000000000 --- a/tests/specs/lint/no_slow_types_entrypoint/d.ts +++ /dev/null @@ -1,4 +0,0 @@ -// this one is re-exported via b.ts -export function addD(a: number, b: number) { - return a + b; -} diff --git a/tests/specs/lint/no_slow_types_entrypoint/deno.json b/tests/specs/lint/no_slow_types_entrypoint/deno.json deleted file mode 100644 index 2fd0af5f0f..0000000000 --- a/tests/specs/lint/no_slow_types_entrypoint/deno.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@pkg/pkg", - "version": "1.0.0", - "exports": { - "./a": "./a.ts", - "./b": "./b.ts" - } -} diff --git a/tests/specs/lint/no_slow_types_entrypoint/deno.non-package.json b/tests/specs/lint/no_slow_types_entrypoint/deno.non-package.json deleted file mode 100644 index 2c63c08510..0000000000 --- a/tests/specs/lint/no_slow_types_entrypoint/deno.non-package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} diff --git a/tests/specs/lint/no_slow_types_entrypoint/no_slow_types.out b/tests/specs/lint/no_slow_types_entrypoint/no_slow_types.out deleted file mode 100644 index 5828906e76..0000000000 --- a/tests/specs/lint/no_slow_types_entrypoint/no_slow_types.out +++ /dev/null @@ -1,35 +0,0 @@ -error[no-slow-types]: missing explicit return type in the public API - --> [WILDCARD]a.ts:1:17 - | -1 | export function add(a: number, b: number) { - | ^^^ this function is missing an explicit return type - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - - -error[no-slow-types]: missing explicit return type in the public API - --> [WILDCARD]b.ts:1:17 - | -1 | export function addB(a: number, b: number) { - | ^^^^ this function is missing an explicit return type - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - - -error[no-slow-types]: missing explicit return type in the public API - --> [WILDCARD]d.ts:2:17 - | -2 | export function addD(a: number, b: number) { - | ^^^^ this function is missing an explicit return type - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - - -Found 3 problems -Checked 4 files diff --git a/tests/specs/lint/no_slow_types_entrypoint/no_slow_types_entrypoint.out b/tests/specs/lint/no_slow_types_entrypoint/no_slow_types_entrypoint.out deleted file mode 100644 index 895dcb6cd9..0000000000 --- a/tests/specs/lint/no_slow_types_entrypoint/no_slow_types_entrypoint.out +++ /dev/null @@ -1,38 +0,0 @@ -error[no-slow-types]: missing explicit return type in the public API - --> [WILDCARD]a.ts:1:17 - | -1 | export function add(a: number, b: number) { - | ^^^ this function is missing an explicit return type - | - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - - -error[no-slow-types]: missing explicit return type in the public API - --> [WILDCARD]b.ts:1:17 - | -1 | export function addB(a: number, b: number) { - | ^^^^ this function is missing an explicit return type - | - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - - -error[no-slow-types]: missing explicit return type in the public API - --> [WILDCARD]d.ts:2:17 - | -2 | export function addD(a: number, b: number) { - | ^^^^ this function is missing an explicit return type - | - = hint: add an explicit return type to the function - - info: all functions in the public API must have an explicit return type - docs: https://jsr.io/go/slow-type-missing-explicit-return-type - - -Found 3 problems -Checked 1 file diff --git a/tests/specs/lockfile/config_file_lock_path/lock_check_err2.out b/tests/specs/lockfile/config_file_lock_path/lock_check_err2.out deleted file mode 100644 index 3043b102a5..0000000000 --- a/tests/specs/lockfile/config_file_lock_path/lock_check_err2.out +++ /dev/null @@ -1,11 +0,0 @@ -[WILDCARD]Integrity check failed for remote specifier. The source code is invalid, as it does not match the expected hash in the lock file. - - Specifier: http://localhost:4545/subdir/mt_text_ecmascript.j3.js - Actual: 3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18 - Expected: bad - -This could be caused by: - * the lock file may be corrupt - * the source itself may be corrupt - -Investigate the lockfile; delete it to regenerate the lockfile or --reload to reload the source code from the server. diff --git a/tests/specs/npm/byonm/__test__.jsonc b/tests/specs/npm/byonm/__test__.jsonc index 011b4b6c82..aa9dcb1351 100644 --- a/tests/specs/npm/byonm/__test__.jsonc +++ b/tests/specs/npm/byonm/__test__.jsonc @@ -14,7 +14,7 @@ "output": "[WILDCARD]" }, { "args": "run -A invalid_sub_path.ts", - "output": "invalid_sub_path.out", + "output": "future_invalid_sub_path.out", "exitCode": 1 }] }, diff --git a/tests/specs/npm/check_all/__test__.jsonc b/tests/specs/npm/check_all/__test__.jsonc deleted file mode 100644 index e78f7e67d8..0000000000 --- a/tests/specs/npm/check_all/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "check --all check_errors/main.ts", - "output": "check_errors/main_all.out", - "exitCode": 1 -} diff --git a/tests/specs/npm/check_all/check_errors/main_local.out b/tests/specs/npm/check_all/check_errors/main_local.out deleted file mode 100644 index ac58a29c76..0000000000 --- a/tests/specs/npm/check_all/check_errors/main_local.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest%2fcheck-error -Download http://localhost:4260/@denotest/check-error/1.0.0.tgz -Check file:///[WILDCARD]/check_errors/main.ts -error: TS2339 [ERROR]: Property 'Asdf' does not exist on type 'typeof import("file:///[WILDCARD]/@denotest/check-error/1.0.0/index.d.ts")'. -console.log(test.Asdf); // should error - ~~~~ - at file:///[WILDCARD]/npm/check_errors/main.ts:3:18 diff --git a/tests/specs/npm/check_all_local/__test__.jsonc b/tests/specs/npm/check_all_local/__test__.jsonc new file mode 100644 index 0000000000..aaa0939b42 --- /dev/null +++ b/tests/specs/npm/check_all_local/__test__.jsonc @@ -0,0 +1,14 @@ +{ + "tests": { + "all": { + "args": "check --all main.ts", + "output": "main_all.out", + "exitCode": 1 + }, + "local": { + "args": "check main.ts", + "output": "main_local.out", + "exitCode": 1 + } + } +} diff --git a/tests/specs/npm/check_all/check_errors/main.ts b/tests/specs/npm/check_all_local/main.ts similarity index 100% rename from tests/specs/npm/check_all/check_errors/main.ts rename to tests/specs/npm/check_all_local/main.ts diff --git a/tests/specs/npm/check_all/check_errors/main_all.out b/tests/specs/npm/check_all_local/main_all.out similarity index 74% rename from tests/specs/npm/check_all/check_errors/main_all.out rename to tests/specs/npm/check_all_local/main_all.out index c7797e43d2..a418396ee5 100644 --- a/tests/specs/npm/check_all/check_errors/main_all.out +++ b/tests/specs/npm/check_all_local/main_all.out @@ -1,19 +1,19 @@ Download http://localhost:4260/@denotest%2fcheck-error Download http://localhost:4260/@denotest/check-error/1.0.0.tgz -Check file:///[WILDCARD]/check_errors/main.ts +Check file:///[WILDCARD]/main.ts error: TS2506 [ERROR]: 'Class1' is referenced directly or indirectly in its own base expression. export class Class1 extends Class2 { ~~~~~~ - at file:///[WILDCARD]/check-error/1.0.0/index.d.ts:2:14 + at file:///[WILDCARD]/1.0.0/index.d.ts:2:14 TS2506 [ERROR]: 'Class2' is referenced directly or indirectly in its own base expression. export class Class2 extends Class1 { ~~~~~~ - at file:///[WILDCARD]/check-error/1.0.0/index.d.ts:5:14 + at file:///[WILDCARD]/1.0.0/index.d.ts:5:14 TS2339 [ERROR]: Property 'Asdf' does not exist on type 'typeof import("file:///[WILDCARD]/@denotest/check-error/1.0.0/index.d.ts")'. console.log(test.Asdf); // should error ~~~~ - at file:///[WILDCARD]/check_errors/main.ts:3:18 + at file:///[WILDCARD]/main.ts:3:18 Found 3 errors. diff --git a/tests/specs/npm/check_local/check_errors/main_local.out b/tests/specs/npm/check_all_local/main_local.out similarity index 76% rename from tests/specs/npm/check_local/check_errors/main_local.out rename to tests/specs/npm/check_all_local/main_local.out index 1eb8eef9fe..24b183b7ad 100644 --- a/tests/specs/npm/check_local/check_errors/main_local.out +++ b/tests/specs/npm/check_all_local/main_local.out @@ -1,7 +1,7 @@ Download http://localhost:4260/@denotest%2fcheck-error Download http://localhost:4260/@denotest/check-error/1.0.0.tgz -Check file:///[WILDCARD]/check_errors/main.ts +Check file:///[WILDCARD]/main.ts error: TS2339 [ERROR]: Property 'Asdf' does not exist on type 'typeof import("file:///[WILDCARD]/@denotest/check-error/1.0.0/index.d.ts")'. console.log(test.Asdf); // should error ~~~~ - at file:///[WILDCARD]/check_errors/main.ts:3:18 + at file:///[WILDCARD]/main.ts:3:18 diff --git a/tests/specs/npm/check_local/__test__.jsonc b/tests/specs/npm/check_local/__test__.jsonc deleted file mode 100644 index 2cf3ae5ef0..0000000000 --- a/tests/specs/npm/check_local/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "check check_errors/main.ts", - "output": "check_errors/main_local.out", - "exitCode": 1 -} diff --git a/tests/specs/npm/check_local/check_errors/main.ts b/tests/specs/npm/check_local/check_errors/main.ts deleted file mode 100644 index 4b86841956..0000000000 --- a/tests/specs/npm/check_local/check_errors/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as test from "npm:@denotest/check-error"; - -console.log(test.Asdf); // should error diff --git a/tests/specs/npm/check_local/check_errors/main_all.out b/tests/specs/npm/check_local/check_errors/main_all.out deleted file mode 100644 index c7797e43d2..0000000000 --- a/tests/specs/npm/check_local/check_errors/main_all.out +++ /dev/null @@ -1,19 +0,0 @@ -Download http://localhost:4260/@denotest%2fcheck-error -Download http://localhost:4260/@denotest/check-error/1.0.0.tgz -Check file:///[WILDCARD]/check_errors/main.ts -error: TS2506 [ERROR]: 'Class1' is referenced directly or indirectly in its own base expression. -export class Class1 extends Class2 { - ~~~~~~ - at file:///[WILDCARD]/check-error/1.0.0/index.d.ts:2:14 - -TS2506 [ERROR]: 'Class2' is referenced directly or indirectly in its own base expression. -export class Class2 extends Class1 { - ~~~~~~ - at file:///[WILDCARD]/check-error/1.0.0/index.d.ts:5:14 - -TS2339 [ERROR]: Property 'Asdf' does not exist on type 'typeof import("file:///[WILDCARD]/@denotest/check-error/1.0.0/index.d.ts")'. -console.log(test.Asdf); // should error - ~~~~ - at file:///[WILDCARD]/check_errors/main.ts:3:18 - -Found 3 errors. diff --git a/tests/specs/npm/cjs_with_deps/__test__.jsonc b/tests/specs/npm/cjs_with_deps/__test__.jsonc index e79fda5c77..a09f172053 100644 --- a/tests/specs/npm/cjs_with_deps/__test__.jsonc +++ b/tests/specs/npm/cjs_with_deps/__test__.jsonc @@ -1,4 +1,36 @@ { - "args": "run --allow-read --allow-env cjs_with_deps/main.js", - "output": "cjs_with_deps/main.out" + "tests": { + "cjs_with_deps": { + "args": "run --allow-read --allow-env main.js", + "output": "main.out" + }, + "cjs_with_deps_node_modules": { + "args": "run --allow-read --allow-env --node-modules-dir=auto main.js", + "output": "main_node_modules.out" + }, + "cjs_with_deps_info": { + "steps": [ + { + "args": "cache main.js", + "output": "[WILDCARD]" + }, + { + "args": "info main.js", + "output": "main_info.out" + } + ] + }, + "cjs_with_deps_info_json": { + "steps": [ + { + "args": "cache main.js", + "output": "[WILDCARD]" + }, + { + "args": "info --json main.js", + "output": "main_info_json.out" + } + ] + } + } } diff --git a/tests/specs/npm/cjs_with_deps/cjs_with_deps/main.js b/tests/specs/npm/cjs_with_deps/main.js similarity index 100% rename from tests/specs/npm/cjs_with_deps/cjs_with_deps/main.js rename to tests/specs/npm/cjs_with_deps/main.js diff --git a/tests/specs/npm/cjs_with_deps/cjs_with_deps/main.out b/tests/specs/npm/cjs_with_deps/main.out similarity index 100% rename from tests/specs/npm/cjs_with_deps/cjs_with_deps/main.out rename to tests/specs/npm/cjs_with_deps/main.out diff --git a/tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info.out b/tests/specs/npm/cjs_with_deps/main_info.out similarity index 100% rename from tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info.out rename to tests/specs/npm/cjs_with_deps/main_info.out diff --git a/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info_json.out b/tests/specs/npm/cjs_with_deps/main_info_json.out similarity index 71% rename from tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info_json.out rename to tests/specs/npm/cjs_with_deps/main_info_json.out index 137b9f8ce5..393e4a221a 100644 --- a/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info_json.out +++ b/tests/specs/npm/cjs_with_deps/main_info_json.out @@ -45,7 +45,17 @@ "local": "[WILDCARD]main.js", "size": 325, "mediaType": "JavaScript", - "specifier": "[WILDCARD]/main.js" + "specifier": "file:///[WILDCARD]/main.js" + }, + { + "kind": "npm", + "specifier": "npm:/chai@4.3.6", + "npmPackage": "chai@4.3.6" + }, + { + "kind": "npm", + "specifier": "npm:/chalk@4.1.2", + "npmPackage": "chalk@4.1.2" } ], "redirects": { @@ -58,12 +68,14 @@ "version": "4.3.0", "dependencies": [ "color-convert@2.0.1" - ] + ], + "registryUrl": "http://localhost:4260/" }, "assertion-error@1.1.0": { "name": "assertion-error", "version": "1.1.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "chai@4.3.6": { "name": "chai", @@ -76,7 +88,8 @@ "loupe@2.3.4", "pathval@1.1.1", "type-detect@4.0.8" - ] + ], + "registryUrl": "http://localhost:4260/" }, "chalk@4.1.2": { "name": "chalk", @@ -84,65 +97,76 @@ "dependencies": [ "ansi-styles@4.3.0", "supports-color@7.2.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "check-error@1.0.2": { "name": "check-error", "version": "1.0.2", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "color-convert@2.0.1": { "name": "color-convert", "version": "2.0.1", "dependencies": [ "color-name@1.1.4" - ] + ], + "registryUrl": "http://localhost:4260/" }, "color-name@1.1.4": { "name": "color-name", "version": "1.1.4", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "deep-eql@3.0.1": { "name": "deep-eql", "version": "3.0.1", "dependencies": [ "type-detect@4.0.8" - ] + ], + "registryUrl": "http://localhost:4260/" }, "get-func-name@2.0.0": { "name": "get-func-name", "version": "2.0.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "has-flag@4.0.0": { "name": "has-flag", "version": "4.0.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "loupe@2.3.4": { "name": "loupe", "version": "2.3.4", "dependencies": [ "get-func-name@2.0.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "pathval@1.1.1": { "name": "pathval", "version": "1.1.1", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "supports-color@7.2.0": { "name": "supports-color", "version": "7.2.0", "dependencies": [ "has-flag@4.0.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "type-detect@4.0.8": { "name": "type-detect", "version": "4.0.8", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" } } } diff --git a/tests/specs/npm/cjs_with_deps/cjs_with_deps/main_node_modules.out b/tests/specs/npm/cjs_with_deps/main_node_modules.out similarity index 100% rename from tests/specs/npm/cjs_with_deps/cjs_with_deps/main_node_modules.out rename to tests/specs/npm/cjs_with_deps/main_node_modules.out diff --git a/tests/specs/npm/directory_import/__test__.jsonc b/tests/specs/npm/directory_import/__test__.jsonc new file mode 100644 index 0000000000..b1aea547ba --- /dev/null +++ b/tests/specs/npm/directory_import/__test__.jsonc @@ -0,0 +1,14 @@ +{ + "tests": { + "directory_import": { + "args": "run folder_index_js.ts", + "output": "folder_index_js.out", + "exitCode": 1 + }, + "directory_import_folder_no_index": { + "args": "run folder_no_index.ts", + "output": "folder_no_index.out", + "exitCode": 1 + } + } +} diff --git a/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.out b/tests/specs/npm/directory_import/folder_index_js.out similarity index 100% rename from tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.out rename to tests/specs/npm/directory_import/folder_index_js.out diff --git a/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.ts b/tests/specs/npm/directory_import/folder_index_js.ts similarity index 100% rename from tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.ts rename to tests/specs/npm/directory_import/folder_index_js.ts diff --git a/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.out b/tests/specs/npm/directory_import/folder_no_index.out similarity index 100% rename from tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.out rename to tests/specs/npm/directory_import/folder_no_index.out diff --git a/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.ts b/tests/specs/npm/directory_import/folder_no_index.ts similarity index 100% rename from tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.ts rename to tests/specs/npm/directory_import/folder_no_index.ts diff --git a/tests/specs/npm/directory_import_folder_index_js/__test__.jsonc b/tests/specs/npm/directory_import_folder_index_js/__test__.jsonc deleted file mode 100644 index b3f7b64cbd..0000000000 --- a/tests/specs/npm/directory_import_folder_index_js/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "run directory_import/folder_index_js.ts", - "output": "directory_import/folder_index_js.out", - "exitCode": 1 -} diff --git a/tests/specs/npm/directory_import_folder_no_index/__test__.jsonc b/tests/specs/npm/directory_import_folder_no_index/__test__.jsonc deleted file mode 100644 index e0bb868ad8..0000000000 --- a/tests/specs/npm/directory_import_folder_no_index/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "run directory_import/folder_no_index.ts", - "output": "directory_import/folder_no_index.out", - "exitCode": 1 -} diff --git a/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.out b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.out deleted file mode 100644 index c1eb2a4801..0000000000 --- a/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest%2fsub-folders -Download http://localhost:4260/@denotest/sub-folders/1.0.0.tgz -error: Directory import [WILDCARD]folder_index_js is not supported resolving import from file:///[WILDCARD]/directory_import/folder_index_js.ts -Did you mean to import index.js within the directory? - -Caused by: - [WILDCARD] diff --git a/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.ts b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.ts deleted file mode 100644 index b0d51fcd97..0000000000 --- a/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.ts +++ /dev/null @@ -1,2 +0,0 @@ -import test from "npm:@denotest/sub-folders/folder_index_js"; -console.log(test); diff --git a/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.out b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.out deleted file mode 100644 index c19c4bcaa4..0000000000 --- a/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.out +++ /dev/null @@ -1,6 +0,0 @@ -Download http://localhost:4260/@denotest%2fsub-folders -Download http://localhost:4260/@denotest/sub-folders/1.0.0.tgz -error: Directory import [WILDCARD]folder_no_index is not supported resolving import from file:///[WILDCARD]/folder_no_index.ts - -Caused by: - [WILDCARD] diff --git a/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.ts b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.ts deleted file mode 100644 index 4c5fb7ec09..0000000000 --- a/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.ts +++ /dev/null @@ -1,2 +0,0 @@ -import test from "npm:@denotest/sub-folders/folder_no_index"; -console.log(test); diff --git a/tests/specs/npm/imports_package_json/__test__.jsonc b/tests/specs/npm/imports_package_json/__test__.jsonc index 35eabd4e15..068c62d8f5 100644 --- a/tests/specs/npm/imports_package_json/__test__.jsonc +++ b/tests/specs/npm/imports_package_json/__test__.jsonc @@ -1,4 +1,18 @@ { - "args": "run --no-lock --node-modules-dir=none imports_package_json/main.js", - "output": "imports_package_json/main.out" + "tests": { + "imports_package_json": { + "args": "run --no-lock --node-modules-dir=none main.js", + "output": "main.out" + }, + "imports_package_json_import_not_defined": { + "args": "run --no-lock --node-modules-dir=none import_not_defined.js", + "output": "import_not_defined.out", + "exitCode": 1 + }, + "imports_package_json_sub_path_import_not_defined": { + "args": "run --no-lock --node-modules-dir=none sub_path_import_not_defined.js", + "output": "sub_path_import_not_defined.out", + "exitCode": 1 + } + } } diff --git a/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.js b/tests/specs/npm/imports_package_json/import_not_defined.js similarity index 100% rename from tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.js rename to tests/specs/npm/imports_package_json/import_not_defined.js diff --git a/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.out b/tests/specs/npm/imports_package_json/import_not_defined.out similarity index 100% rename from tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.out rename to tests/specs/npm/imports_package_json/import_not_defined.out diff --git a/tests/specs/npm/imports_package_json/imports_package_json/main.js b/tests/specs/npm/imports_package_json/main.js similarity index 100% rename from tests/specs/npm/imports_package_json/imports_package_json/main.js rename to tests/specs/npm/imports_package_json/main.js diff --git a/tests/specs/npm/imports_package_json/imports_package_json/main.out b/tests/specs/npm/imports_package_json/main.out similarity index 100% rename from tests/specs/npm/imports_package_json/imports_package_json/main.out rename to tests/specs/npm/imports_package_json/main.out diff --git a/tests/specs/npm/imports_package_json/imports_package_json/package.json b/tests/specs/npm/imports_package_json/package.json similarity index 100% rename from tests/specs/npm/imports_package_json/imports_package_json/package.json rename to tests/specs/npm/imports_package_json/package.json diff --git a/tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.js b/tests/specs/npm/imports_package_json/sub_path_import_not_defined.js similarity index 100% rename from tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.js rename to tests/specs/npm/imports_package_json/sub_path_import_not_defined.js diff --git a/tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.out b/tests/specs/npm/imports_package_json/sub_path_import_not_defined.out similarity index 100% rename from tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.out rename to tests/specs/npm/imports_package_json/sub_path_import_not_defined.out diff --git a/tests/specs/npm/imports_package_json_import_not_defined/__test__.jsonc b/tests/specs/npm/imports_package_json_import_not_defined/__test__.jsonc deleted file mode 100644 index 983ec31263..0000000000 --- a/tests/specs/npm/imports_package_json_import_not_defined/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "run --no-lock --node-modules-dir=none imports_package_json/import_not_defined.js", - "output": "imports_package_json/import_not_defined.out", - "exitCode": 1 -} diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.js b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.js deleted file mode 100644 index dc4d2df165..0000000000 --- a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.js +++ /dev/null @@ -1,3 +0,0 @@ -import data from "@denotest/imports-package-json/import-not-defined"; - -console.log(data); diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out deleted file mode 100644 index abfa414030..0000000000 --- a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest%2fimports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#not-defined" is not defined in package [WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.js b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.js deleted file mode 100644 index 53090dd948..0000000000 --- a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.js +++ /dev/null @@ -1,7 +0,0 @@ -import data from "@denotest/imports-package-json"; - -console.log(data.hi); -console.log(data.bye); -console.log(typeof data.fs.readFile); -console.log(typeof data.path.join); -console.log(typeof data.fs2.writeFile); diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.out b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.out deleted file mode 100644 index 70d787b251..0000000000 --- a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest%2fimports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -hi -bye -function -function -function diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/package.json b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/package.json deleted file mode 100644 index cb6a08d1a5..0000000000 --- a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "my-test", - "dependencies": { - "@denotest/imports-package-json": "1.0.0" - } -} diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.js b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.js deleted file mode 100644 index f1097aa064..0000000000 --- a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.js +++ /dev/null @@ -1,3 +0,0 @@ -import data from "@denotest/imports-package-json/sub-path-import-not-defined"; - -console.log(data); diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out deleted file mode 100644 index 95524202ae..0000000000 --- a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest%2fimports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#hi" is not defined in package [WILDCARD]sub_path[WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/__test__.jsonc b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/__test__.jsonc deleted file mode 100644 index cd9b260f48..0000000000 --- a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "run --no-lock --node-modules-dir=none imports_package_json/sub_path_import_not_defined.js", - "output": "imports_package_json/sub_path_import_not_defined.out", - "exitCode": 1 -} diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.js b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.js deleted file mode 100644 index dc4d2df165..0000000000 --- a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.js +++ /dev/null @@ -1,3 +0,0 @@ -import data from "@denotest/imports-package-json/import-not-defined"; - -console.log(data); diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out deleted file mode 100644 index abfa414030..0000000000 --- a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest%2fimports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#not-defined" is not defined in package [WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.js b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.js deleted file mode 100644 index 53090dd948..0000000000 --- a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.js +++ /dev/null @@ -1,7 +0,0 @@ -import data from "@denotest/imports-package-json"; - -console.log(data.hi); -console.log(data.bye); -console.log(typeof data.fs.readFile); -console.log(typeof data.path.join); -console.log(typeof data.fs2.writeFile); diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out deleted file mode 100644 index 70d787b251..0000000000 --- a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest%2fimports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -hi -bye -function -function -function diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/package.json b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/package.json deleted file mode 100644 index cb6a08d1a5..0000000000 --- a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "my-test", - "dependencies": { - "@denotest/imports-package-json": "1.0.0" - } -} diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.js b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.js deleted file mode 100644 index f1097aa064..0000000000 --- a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.js +++ /dev/null @@ -1,3 +0,0 @@ -import data from "@denotest/imports-package-json/sub-path-import-not-defined"; - -console.log(data); diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out deleted file mode 100644 index 95524202ae..0000000000 --- a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest%2fimports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#hi" is not defined in package [WILDCARD]sub_path[WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm/info_cli_chalk_display/__test__.jsonc b/tests/specs/npm/info_cli_chalk_display/__test__.jsonc deleted file mode 100644 index 902bb2dae6..0000000000 --- a/tests/specs/npm/info_cli_chalk_display/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "info --quiet npm:chalk@4", - "output": "info/chalk.out", - "exitCode": 0 -} diff --git a/tests/specs/npm/info_cli_chalk_display/info/chalk_json.out b/tests/specs/npm/info_cli_chalk_display/info/chalk_json.out deleted file mode 100644 index 21fc7edf1a..0000000000 --- a/tests/specs/npm/info_cli_chalk_display/info/chalk_json.out +++ /dev/null @@ -1,57 +0,0 @@ -{ - "version": 1, - "roots": [ - "npm:chalk@4" - ], - "modules": [ - { - "kind": "npm", - "specifier": "npm:/chalk@4.1.2", - "npmPackage": "chalk@4.1.2" - } - ], - "redirects": { - "npm:chalk@4": "npm:/chalk@4.1.2" - }, - "npmPackages": { - "ansi-styles@4.3.0": { - "name": "ansi-styles", - "version": "4.3.0", - "dependencies": [ - "color-convert@2.0.1" - ] - }, - "chalk@4.1.2": { - "name": "chalk", - "version": "4.1.2", - "dependencies": [ - "ansi-styles@4.3.0", - "supports-color@7.2.0" - ] - }, - "color-convert@2.0.1": { - "name": "color-convert", - "version": "2.0.1", - "dependencies": [ - "color-name@1.1.4" - ] - }, - "color-name@1.1.4": { - "name": "color-name", - "version": "1.1.4", - "dependencies": [] - }, - "has-flag@4.0.0": { - "name": "has-flag", - "version": "4.0.0", - "dependencies": [] - }, - "supports-color@7.2.0": { - "name": "supports-color", - "version": "7.2.0", - "dependencies": [ - "has-flag@4.0.0" - ] - } - } -} diff --git a/tests/specs/npm/info_cli_chalk_json/__test__.jsonc b/tests/specs/npm/info_cli_chalk_json/__test__.jsonc index ee34abae7f..b4b042dbdb 100644 --- a/tests/specs/npm/info_cli_chalk_json/__test__.jsonc +++ b/tests/specs/npm/info_cli_chalk_json/__test__.jsonc @@ -1,5 +1,14 @@ { - "args": "info --quiet --json npm:chalk@4", - "output": "info/chalk_json.out", - "exitCode": 0 + "tests": { + "info_cli_chalk": { + "args": "info --quiet npm:chalk@4", + "output": "chalk.out", + "exitCode": 0 + }, + "info_cli_chalk_json": { + "args": "info --quiet --json npm:chalk@4", + "output": "chalk_json.out", + "exitCode": 0 + } + } } diff --git a/tests/specs/npm/info_cli_chalk_display/info/chalk.out b/tests/specs/npm/info_cli_chalk_json/chalk.out similarity index 100% rename from tests/specs/npm/info_cli_chalk_display/info/chalk.out rename to tests/specs/npm/info_cli_chalk_json/chalk.out diff --git a/tests/specs/npm/info_cli_chalk_json/info/chalk_json.out b/tests/specs/npm/info_cli_chalk_json/chalk_json.out similarity index 100% rename from tests/specs/npm/info_cli_chalk_json/info/chalk_json.out rename to tests/specs/npm/info_cli_chalk_json/chalk_json.out diff --git a/tests/specs/npm/info_cli_chalk_json/info/chalk.out b/tests/specs/npm/info_cli_chalk_json/info/chalk.out deleted file mode 100644 index 63fa20da54..0000000000 --- a/tests/specs/npm/info_cli_chalk_json/info/chalk.out +++ /dev/null @@ -1,9 +0,0 @@ -dependencies: 5 unique -size: [WILDCARD] - -npm:/chalk@4.1.2 ([WILDCARD]) -├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) -│ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) -│ └── npm:/color-name@1.1.4 ([WILDCARD]) -└─┬ npm:/supports-color@7.2.0 ([WILDCARD]) - └── npm:/has-flag@4.0.0 ([WILDCARD]) diff --git a/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles.out b/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles.out deleted file mode 100644 index bdbb2b08ea..0000000000 --- a/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles.out +++ /dev/null @@ -1,3 +0,0 @@ -Initialize @denotest/node-lifecycle-scripts@1.0.0: running 'preinstall' script -Initialize @denotest/node-lifecycle-scripts@1.0.0: running 'install' script -Initialize @denotest/node-lifecycle-scripts@1.0.0: running 'postinstall' script diff --git a/tests/specs/npm/mixed_case_package_name/__test__.jsonc b/tests/specs/npm/mixed_case_package_name/__test__.jsonc new file mode 100644 index 0000000000..ca688f0914 --- /dev/null +++ b/tests/specs/npm/mixed_case_package_name/__test__.jsonc @@ -0,0 +1,15 @@ +{ + "tempDir": true, + "tests": { + "mixed_case_package_name": { + "args": "run --node-modules-dir=auto -A local.ts", + "output": "local.out", + "exitCode": 0 + }, + "mixed_case_package_name_global_dir": { + "args": "run global.ts", + "output": "global.out", + "exitCode": 0 + } + } +} diff --git a/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.out b/tests/specs/npm/mixed_case_package_name/global.out similarity index 100% rename from tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.out rename to tests/specs/npm/mixed_case_package_name/global.out diff --git a/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.ts b/tests/specs/npm/mixed_case_package_name/global.ts similarity index 100% rename from tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.ts rename to tests/specs/npm/mixed_case_package_name/global.ts diff --git a/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.out b/tests/specs/npm/mixed_case_package_name/local.out similarity index 100% rename from tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.out rename to tests/specs/npm/mixed_case_package_name/local.out diff --git a/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.ts b/tests/specs/npm/mixed_case_package_name/local.ts similarity index 100% rename from tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.ts rename to tests/specs/npm/mixed_case_package_name/local.ts diff --git a/tests/specs/npm/mixed_case_package_name_global_dir/__test__.jsonc b/tests/specs/npm/mixed_case_package_name_global_dir/__test__.jsonc deleted file mode 100644 index db980472de..0000000000 --- a/tests/specs/npm/mixed_case_package_name_global_dir/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "run mixed_case_package_name/global.ts", - "output": "mixed_case_package_name/global.out", - "exitCode": 0 -} diff --git a/tests/specs/npm/mixed_case_package_name_local_dir/__test__.jsonc b/tests/specs/npm/mixed_case_package_name_local_dir/__test__.jsonc deleted file mode 100644 index a214b6f4a3..0000000000 --- a/tests/specs/npm/mixed_case_package_name_local_dir/__test__.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "tempDir": true, - "args": "run --node-modules-dir=auto -A mixed_case_package_name/local.ts", - "output": "mixed_case_package_name/local.out", - "exitCode": 0 -} diff --git a/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.out b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.out deleted file mode 100644 index a1d3a6e2c5..0000000000 --- a/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.out +++ /dev/null @@ -1,9 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest%2fMixedCase -Download http://localhost:4260/@denotest%2fCAPITALS -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/CAPITALS/1.0.0.tgz -Download http://localhost:4260/@denotest/MixedCase/1.0.0.tgz -[UNORDERED_END] -5 diff --git a/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.ts b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.ts deleted file mode 100644 index a721b3d784..0000000000 --- a/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.ts +++ /dev/null @@ -1,2 +0,0 @@ -import value from "npm:@denotest/MixedCase"; -console.log(value); diff --git a/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.out b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.out deleted file mode 100644 index c8c9ed396c..0000000000 --- a/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.out +++ /dev/null @@ -1,13 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest%2fMixedCase -Download http://localhost:4260/@denotest%2fCAPITALS -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/CAPITALS/1.0.0.tgz -Initialize @denotest/CAPITALS@1.0.0 -Download http://localhost:4260/@denotest/MixedCase/1.0.0.tgz -Initialize @denotest/MixedCase@1.0.0 -[UNORDERED_END] -5 -true -true diff --git a/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.ts b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.ts deleted file mode 100644 index 6ca6cb581a..0000000000 --- a/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.ts +++ /dev/null @@ -1,18 +0,0 @@ -import value from "npm:@denotest/MixedCase"; -console.log(value); -console.log(pathExists("./node_modules/.deno")); -console.log( - pathExists("./node_modules/.deno/_ibsgk3tporsxg5bpinavaskuifgfg@1.0.0"), -); - -function pathExists(filePath: string) { - try { - Deno.lstatSync(filePath); - return true; - } catch (error) { - if (error instanceof Deno.errors.NotFound) { - return false; - } - throw error; - } -} diff --git a/tests/specs/npm/node_modules_dir_with_deps/__test__.jsonc b/tests/specs/npm/node_modules_dir_with_deps/__test__.jsonc index 945a3f4d4b..27809f2d0b 100644 --- a/tests/specs/npm/node_modules_dir_with_deps/__test__.jsonc +++ b/tests/specs/npm/node_modules_dir_with_deps/__test__.jsonc @@ -1,5 +1,38 @@ { - "tempDir": true, - "args": "run --allow-read --allow-env --node-modules-dir=auto cjs_with_deps/main.js", - "output": "cjs_with_deps/main_node_modules.out" + "tests": { + "cjs_with_deps": { + "tempDir": true, + "args": "run --allow-read --allow-env main.js", + "output": "main.out" + }, + "cjs_with_deps_node_modules": { + "tempDir": true, + "args": "run --allow-read --allow-env --node-modules-dir=auto main.js", + "output": "main_node_modules.out" + }, + "cjs_with_deps_info": { + "steps": [ + { + "args": "cache main.js", + "output": "[WILDCARD]" + }, + { + "args": "info main.js", + "output": "main_info.out" + } + ] + }, + "cjs_with_deps_info_json": { + "steps": [ + { + "args": "cache main.js", + "output": "[WILDCARD]" + }, + { + "args": "info --json main.js", + "output": "main_info_json.out" + } + ] + } + } } diff --git a/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main.js b/tests/specs/npm/node_modules_dir_with_deps/main.js similarity index 100% rename from tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main.js rename to tests/specs/npm/node_modules_dir_with_deps/main.js diff --git a/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main.out b/tests/specs/npm/node_modules_dir_with_deps/main.out similarity index 100% rename from tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main.out rename to tests/specs/npm/node_modules_dir_with_deps/main.out diff --git a/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info.out b/tests/specs/npm/node_modules_dir_with_deps/main_info.out similarity index 92% rename from tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info.out rename to tests/specs/npm/node_modules_dir_with_deps/main_info.out index bcaaf1eecf..dd283c3540 100644 --- a/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info.out +++ b/tests/specs/npm/node_modules_dir_with_deps/main_info.out @@ -3,7 +3,7 @@ type: JavaScript dependencies: 14 unique size: [WILDCARD] -file:///[WILDCARD]/npm/cjs_with_deps/main.js ([WILDCARD]) +file:///[WILDCARD]/npm/node_modules_dir_with_deps/main.js ([WILDCARD]) ├─┬ npm:/chalk@4.1.2 ([WILDCARD]) │ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) │ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) diff --git a/tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info_json.out b/tests/specs/npm/node_modules_dir_with_deps/main_info_json.out similarity index 73% rename from tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info_json.out rename to tests/specs/npm/node_modules_dir_with_deps/main_info_json.out index 137b9f8ce5..2f7dde2d98 100644 --- a/tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info_json.out +++ b/tests/specs/npm/node_modules_dir_with_deps/main_info_json.out @@ -46,6 +46,16 @@ "size": 325, "mediaType": "JavaScript", "specifier": "[WILDCARD]/main.js" + }, + { + "kind": "npm", + "specifier": "npm:/chai@4.3.6", + "npmPackage": "chai@4.3.6" + }, + { + "kind": "npm", + "specifier": "npm:/chalk@4.1.2", + "npmPackage": "chalk@4.1.2" } ], "redirects": { @@ -58,12 +68,14 @@ "version": "4.3.0", "dependencies": [ "color-convert@2.0.1" - ] + ], + "registryUrl": "http://localhost:4260/" }, "assertion-error@1.1.0": { "name": "assertion-error", "version": "1.1.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "chai@4.3.6": { "name": "chai", @@ -76,7 +88,8 @@ "loupe@2.3.4", "pathval@1.1.1", "type-detect@4.0.8" - ] + ], + "registryUrl": "http://localhost:4260/" }, "chalk@4.1.2": { "name": "chalk", @@ -84,65 +97,76 @@ "dependencies": [ "ansi-styles@4.3.0", "supports-color@7.2.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "check-error@1.0.2": { "name": "check-error", "version": "1.0.2", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "color-convert@2.0.1": { "name": "color-convert", "version": "2.0.1", "dependencies": [ "color-name@1.1.4" - ] + ], + "registryUrl": "http://localhost:4260/" }, "color-name@1.1.4": { "name": "color-name", "version": "1.1.4", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "deep-eql@3.0.1": { "name": "deep-eql", "version": "3.0.1", "dependencies": [ "type-detect@4.0.8" - ] + ], + "registryUrl": "http://localhost:4260/" }, "get-func-name@2.0.0": { "name": "get-func-name", "version": "2.0.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "has-flag@4.0.0": { "name": "has-flag", "version": "4.0.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "loupe@2.3.4": { "name": "loupe", "version": "2.3.4", "dependencies": [ "get-func-name@2.0.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "pathval@1.1.1": { "name": "pathval", "version": "1.1.1", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "supports-color@7.2.0": { "name": "supports-color", "version": "7.2.0", "dependencies": [ "has-flag@4.0.0" - ] + ], + "registryUrl": "http://localhost:4260/" }, "type-detect@4.0.8": { "name": "type-detect", "version": "4.0.8", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" } } } diff --git a/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_node_modules.out b/tests/specs/npm/node_modules_dir_with_deps/main_node_modules.out similarity index 100% rename from tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_node_modules.out rename to tests/specs/npm/node_modules_dir_with_deps/main_node_modules.out diff --git a/tests/specs/npm/types_ambient_module/__test__.jsonc b/tests/specs/npm/types_ambient_module/__test__.jsonc index 966d8d8ed4..e69c163d5d 100644 --- a/tests/specs/npm/types_ambient_module/__test__.jsonc +++ b/tests/specs/npm/types_ambient_module/__test__.jsonc @@ -1,5 +1,14 @@ { - "args": "check --quiet types_ambient_module/main.ts", - "output": "types_ambient_module/main.out", - "exitCode": 1 + "tests": { + "types_ambient_module": { + "args": "check --quiet types_ambient_module/main.ts", + "output": "types_ambient_module/main.out", + "exitCode": 1 + }, + "types_ambient_module_import_map": { + "args": "check --quiet --import-map=types_ambient_module/import_map.json types_ambient_module/main_import_map.ts", + "output": "types_ambient_module/main_import_map.out", + "exitCode": 1 + } + } } diff --git a/tests/specs/npm/types_ambient_module_import_map/__test__.jsonc b/tests/specs/npm/types_ambient_module_import_map/__test__.jsonc deleted file mode 100644 index bbfa93a99b..0000000000 --- a/tests/specs/npm/types_ambient_module_import_map/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "check --quiet --import-map=types_ambient_module/import_map.json types_ambient_module/main_import_map.ts", - "output": "types_ambient_module/main_import_map.out", - "exitCode": 1 -} diff --git a/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/import_map.json b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/import_map.json deleted file mode 100644 index f61d99b474..0000000000 --- a/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/import_map.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "imports": { - "types-ambient": "npm:@denotest/types-ambient" - } -} diff --git a/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.out b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.out deleted file mode 100644 index c84130707e..0000000000 --- a/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.out +++ /dev/null @@ -1,21 +0,0 @@ -error: TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? -console.log(import1.Test2); // should error - ~~~~~ - at file:///[WILDCARD]/types_ambient_module/main.ts:5:21 - - 'Test' is declared here. - class Test { - ~~~~ - at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 - -TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? -console.log(import2.Test2); // should error - ~~~~~ - at file:///[WILDCARD]/types_ambient_module/main.ts:7:21 - - 'Test' is declared here. - class Test { - ~~~~ - at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 - -Found 2 errors. diff --git a/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.ts b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.ts deleted file mode 100644 index 8f77cabe8e..0000000000 --- a/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as import1 from "npm:@denotest/types-ambient"; -import * as import2 from "npm:@denotest/types-ambient@1"; - -console.log(import1.Test); -console.log(import1.Test2); // should error -console.log(import2.Test); -console.log(import2.Test2); // should error diff --git a/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.out b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.out deleted file mode 100644 index 548f9b479c..0000000000 --- a/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.out +++ /dev/null @@ -1,9 +0,0 @@ -error: TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? -console.log(mod.Test2); // should error - ~~~~~ - at file:///[WILDCARD]/main_import_map.ts:4:17 - - 'Test' is declared here. - class Test { - ~~~~ - at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 diff --git a/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.ts b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.ts deleted file mode 100644 index 2694c94b7a..0000000000 --- a/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as mod from "npm:@denotest/types-ambient"; - -console.log(mod.Test); -console.log(mod.Test2); // should error diff --git a/tests/specs/run/decorators/experimental/__test__.jsonc b/tests/specs/run/decorators/experimental/__test__.jsonc new file mode 100644 index 0000000000..c84a16bbaa --- /dev/null +++ b/tests/specs/run/decorators/experimental/__test__.jsonc @@ -0,0 +1,16 @@ +{ + "tests": { + "no_check": { + "args": "run --quiet --reload --no-check no_check/main.ts", + "output": "no_check/main.out" + }, + "ts": { + "args": "run --reload --check ts/main.ts", + "output": "ts/main.out" + }, + "runtime": { + "args": "run --quiet --reload --no-check runtime/main.ts", + "output": "runtime/main.out" + } + } +} diff --git a/tests/specs/run/decorators_tc39_proposal/decorators/experimental/deno.json b/tests/specs/run/decorators/experimental/deno.json similarity index 100% rename from tests/specs/run/decorators_tc39_proposal/decorators/experimental/deno.json rename to tests/specs/run/decorators/experimental/deno.json diff --git a/tests/specs/run/decorators_tc39_proposal/decorators/experimental/no_check/main.out b/tests/specs/run/decorators/experimental/no_check/main.out similarity index 100% rename from tests/specs/run/decorators_tc39_proposal/decorators/experimental/no_check/main.out rename to tests/specs/run/decorators/experimental/no_check/main.out diff --git a/tests/specs/run/decorators_tc39_proposal/decorators/experimental/no_check/main.ts b/tests/specs/run/decorators/experimental/no_check/main.ts similarity index 100% rename from tests/specs/run/decorators_tc39_proposal/decorators/experimental/no_check/main.ts rename to tests/specs/run/decorators/experimental/no_check/main.ts diff --git a/tests/specs/run/decorators_tc39_proposal/decorators/experimental/runtime/main.out b/tests/specs/run/decorators/experimental/runtime/main.out similarity index 100% rename from tests/specs/run/decorators_tc39_proposal/decorators/experimental/runtime/main.out rename to tests/specs/run/decorators/experimental/runtime/main.out diff --git a/tests/specs/run/decorators_tc39_proposal/decorators/experimental/runtime/main.ts b/tests/specs/run/decorators/experimental/runtime/main.ts similarity index 100% rename from tests/specs/run/decorators_tc39_proposal/decorators/experimental/runtime/main.ts rename to tests/specs/run/decorators/experimental/runtime/main.ts diff --git a/tests/specs/run/decorators_tc39_proposal/decorators/experimental/ts/main.out b/tests/specs/run/decorators/experimental/ts/main.out similarity index 100% rename from tests/specs/run/decorators_tc39_proposal/decorators/experimental/ts/main.out rename to tests/specs/run/decorators/experimental/ts/main.out diff --git a/tests/specs/run/decorators_tc39_proposal/decorators/experimental/ts/main.ts b/tests/specs/run/decorators/experimental/ts/main.ts similarity index 100% rename from tests/specs/run/decorators_tc39_proposal/decorators/experimental/ts/main.ts rename to tests/specs/run/decorators/experimental/ts/main.ts diff --git a/tests/specs/run/decorators/tc39_proposal/__test__.jsonc b/tests/specs/run/decorators/tc39_proposal/__test__.jsonc new file mode 100644 index 0000000000..4ee3c2207a --- /dev/null +++ b/tests/specs/run/decorators/tc39_proposal/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --quiet --reload --check main.ts", + "output": "main.out" +} diff --git a/tests/specs/run/decorators_tc39_proposal/decorators/tc39_proposal/main.out b/tests/specs/run/decorators/tc39_proposal/main.out similarity index 100% rename from tests/specs/run/decorators_tc39_proposal/decorators/tc39_proposal/main.out rename to tests/specs/run/decorators/tc39_proposal/main.out diff --git a/tests/specs/run/decorators_tc39_proposal/decorators/tc39_proposal/main.ts b/tests/specs/run/decorators/tc39_proposal/main.ts similarity index 100% rename from tests/specs/run/decorators_tc39_proposal/decorators/tc39_proposal/main.ts rename to tests/specs/run/decorators/tc39_proposal/main.ts diff --git a/tests/specs/run/decorators_tc39_proposal/__test__.jsonc b/tests/specs/run/decorators_tc39_proposal/__test__.jsonc deleted file mode 100644 index 8e529695d9..0000000000 --- a/tests/specs/run/decorators_tc39_proposal/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --quiet --reload --check decorators/tc39_proposal/main.ts", - "output": "decorators/tc39_proposal/main.out" -} diff --git a/tests/specs/run/error_import_map_unable_to_load/import_maps/test_data.ts b/tests/specs/run/error_import_map_unable_to_load/import_maps/test_data.ts deleted file mode 100644 index 5e8efea69b..0000000000 --- a/tests/specs/run/error_import_map_unable_to_load/import_maps/test_data.ts +++ /dev/null @@ -1 +0,0 @@ -import "test_server/import_maps/lodash/lodash.ts"; diff --git a/tests/specs/run/error_import_map_unable_to_load/import_maps/test_data.ts.out b/tests/specs/run/error_import_map_unable_to_load/import_maps/test_data.ts.out deleted file mode 100644 index da996dc0d9..0000000000 --- a/tests/specs/run/error_import_map_unable_to_load/import_maps/test_data.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello from remapped lodash! diff --git a/tests/specs/run/jsx_import_source/__test__.jsonc b/tests/specs/run/jsx_import_source/__test__.jsonc new file mode 100644 index 0000000000..55a895fc8f --- /dev/null +++ b/tests/specs/run/jsx_import_source/__test__.jsonc @@ -0,0 +1,77 @@ +{ + "tests": { + "jsx_import_source_error": { + "args": "run --config jsx/deno-jsx-error.jsonc --check jsx_import_source_no_pragma.tsx", + "output": "jsx_import_source_error.out", + "exitCode": 1 + }, + "jsx_import_source_precompile_import_map": { + "args": "run --allow-import --reload --check --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-precompile.jsonc jsx_precompile/no_pragma.tsx", + "output": "jsx_precompile/no_pragma.out" + }, + "jsx_import_source_precompile_import_map_skip_element": { + "args": "run --allow-import --reload --check --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-precompile-skip.jsonc jsx_precompile/skip.tsx", + "output": "jsx_precompile/skip.out" + }, + "jsx_import_source_pragma_with_dev_config": { + "args": "run --reload --allow-import --config jsx/deno-jsxdev.jsonc --no-lock jsx_import_source_pragma.tsx", + "output": "jsx_import_source_dev.out" + }, + "jsx_import_source_pragma_with_config_vendor_dir": { + "args": "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --vendor jsx_import_source_pragma.tsx", + "output": "jsx_import_source.out" + }, + "jsx_import_source_pragma_with_config_no_check": { + "args": "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --no-check jsx_import_source_pragma.tsx", + "output": "jsx_import_source.out" + }, + "jsx_import_source_pragma_with_config": { + "args": "run --reload --allow-import --config jsx/deno-jsx.jsonc --no-lock jsx_import_source_pragma.tsx", + "output": "jsx_import_source.out" + }, + "jsx_import_source_pragma_no_check": { + "args": "run --allow-import --reload --no-check jsx_import_source_pragma.tsx", + "output": "jsx_import_source.out" + }, + "jsx_import_source_pragma_import_map_no_check": { + "args": "run --allow-import --reload --import-map jsx/import-map.json --no-check jsx_import_source_pragma_import_map.tsx", + "output": "jsx_import_source_import_map.out" + }, + "jsx_import_source_pragma_import_map_dev": { + "args": "run --allow-import --reload --import-map jsx/import-map.json --config jsx/deno-jsxdev-import-map.jsonc jsx_import_source_pragma_import_map.tsx", + "output": "jsx_import_source_import_map_dev.out" + }, + "jsx_import_source_pragma_import_map": { + "args": "run --allow-import --reload --import-map jsx/import-map.json jsx_import_source_pragma_import_map.tsx", + "output": "jsx_import_source_import_map.out" + }, + "jsx_import_source_pragma": { + "args": "run --reload --allow-import jsx_import_source_pragma.tsx", + "output": "jsx_import_source.out" + }, + "jsx_import_source_no_pragma_no_check": { + "args": "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --no-check jsx_import_source_no_pragma.tsx", + "output": "jsx_import_source.out" + }, + "jsx_import_source_no_pragma_dev": { + "args": "run --allow-import --reload --config jsx/deno-jsxdev.jsonc --no-lock jsx_import_source_no_pragma.tsx", + "output": "jsx_import_source_dev.out" + }, + "jsx_import_source_no_pragma": { + "args": "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock jsx_import_source_no_pragma.tsx", + "output": "jsx_import_source.out" + }, + "jsx_import_source_import_map_no_check": { + "args": "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-import-map.jsonc --no-check jsx_import_source_no_pragma.tsx", + "output": "jsx_import_source_import_map.out" + }, + "jsx_import_source_import_map_dev": { + "args": "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsxdev-import-map.jsonc jsx_import_source_no_pragma.tsx", + "output": "jsx_import_source_import_map_dev.out" + }, + "jsx_import_source_import_map": { + "args": "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-import-map.jsonc jsx_import_source_no_pragma.tsx", + "output": "jsx_import_source_import_map.out" + } + } +} diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source/jsx/deno-jsx-error.jsonc similarity index 100% rename from tests/specs/run/jsx_import_source_error/jsx/deno-jsx-error.jsonc rename to tests/specs/run/jsx_import_source/jsx/deno-jsx-error.jsonc diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source/jsx/deno-jsx-import-map.jsonc similarity index 100% rename from tests/specs/run/jsx_import_source_error/jsx/deno-jsx-import-map.jsonc rename to tests/specs/run/jsx_import_source/jsx/deno-jsx-import-map.jsonc diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source/jsx/deno-jsx-precompile-skip.jsonc similarity index 100% rename from tests/specs/run/jsx_import_source_error/jsx/deno-jsx-precompile-skip.jsonc rename to tests/specs/run/jsx_import_source/jsx/deno-jsx-precompile-skip.jsonc diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source/jsx/deno-jsx-precompile.jsonc similarity index 100% rename from tests/specs/run/jsx_import_source_error/jsx/deno-jsx-precompile.jsonc rename to tests/specs/run/jsx_import_source/jsx/deno-jsx-precompile.jsonc diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source/jsx/deno-jsx.json similarity index 100% rename from tests/specs/run/jsx_import_source_error/jsx/deno-jsx.json rename to tests/specs/run/jsx_import_source/jsx/deno-jsx.json diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source/jsx/deno-jsx.jsonc similarity index 100% rename from tests/specs/run/jsx_import_source_error/jsx/deno-jsx.jsonc rename to tests/specs/run/jsx_import_source/jsx/deno-jsx.jsonc diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source/jsx/deno-jsxdev-import-map.jsonc similarity index 100% rename from tests/specs/run/jsx_import_source_error/jsx/deno-jsxdev-import-map.jsonc rename to tests/specs/run/jsx_import_source/jsx/deno-jsxdev-import-map.jsonc diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source/jsx/deno-jsxdev.jsonc similarity index 100% rename from tests/specs/run/jsx_import_source_error/jsx/deno-jsxdev.jsonc rename to tests/specs/run/jsx_import_source/jsx/deno-jsxdev.jsonc diff --git a/tests/specs/run/jsx_import_source_error/jsx/deno.lock b/tests/specs/run/jsx_import_source/jsx/deno.lock similarity index 100% rename from tests/specs/run/jsx_import_source_error/jsx/deno.lock rename to tests/specs/run/jsx_import_source/jsx/deno.lock diff --git a/tests/specs/run/jsx_import_source_error/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source/jsx/import-map-scoped.json similarity index 100% rename from tests/specs/run/jsx_import_source_error/jsx/import-map-scoped.json rename to tests/specs/run/jsx_import_source/jsx/import-map-scoped.json diff --git a/tests/specs/run/jsx_import_source_error/jsx/import-map.json b/tests/specs/run/jsx_import_source/jsx/import-map.json similarity index 100% rename from tests/specs/run/jsx_import_source_error/jsx/import-map.json rename to tests/specs/run/jsx_import_source/jsx/import-map.json diff --git a/tests/specs/run/jsx_import_source_error/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source/jsx/jsx-dev-runtime/index.ts similarity index 100% rename from tests/specs/run/jsx_import_source_error/jsx/jsx-dev-runtime/index.ts rename to tests/specs/run/jsx_import_source/jsx/jsx-dev-runtime/index.ts diff --git a/tests/specs/run/jsx_import_source_error/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source/jsx/jsx-precompile/index.ts similarity index 100% rename from tests/specs/run/jsx_import_source_error/jsx/jsx-precompile/index.ts rename to tests/specs/run/jsx_import_source/jsx/jsx-precompile/index.ts diff --git a/tests/specs/run/jsx_import_source_error/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source/jsx/jsx-runtime/index.ts similarity index 100% rename from tests/specs/run/jsx_import_source_error/jsx/jsx-runtime/index.ts rename to tests/specs/run/jsx_import_source/jsx/jsx-runtime/index.ts diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx_import_source.out b/tests/specs/run/jsx_import_source/jsx_import_source.out similarity index 100% rename from tests/specs/run/jsx_import_source_no_pragma/jsx_import_source.out rename to tests/specs/run/jsx_import_source/jsx_import_source.out diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx_import_source_dev.out b/tests/specs/run/jsx_import_source/jsx_import_source_dev.out similarity index 100% rename from tests/specs/run/jsx_import_source_no_pragma_dev/jsx_import_source_dev.out rename to tests/specs/run/jsx_import_source/jsx_import_source_dev.out diff --git a/tests/specs/run/jsx_import_source_error/jsx_import_source_error.out b/tests/specs/run/jsx_import_source/jsx_import_source_error.out similarity index 100% rename from tests/specs/run/jsx_import_source_error/jsx_import_source_error.out rename to tests/specs/run/jsx_import_source/jsx_import_source_error.out diff --git a/tests/specs/run/jsx_import_source_import_map/jsx_import_source_import_map.out b/tests/specs/run/jsx_import_source/jsx_import_source_import_map.out similarity index 100% rename from tests/specs/run/jsx_import_source_import_map/jsx_import_source_import_map.out rename to tests/specs/run/jsx_import_source/jsx_import_source_import_map.out diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx_import_source_import_map_dev.out b/tests/specs/run/jsx_import_source/jsx_import_source_import_map_dev.out similarity index 100% rename from tests/specs/run/jsx_import_source_import_map_dev/jsx_import_source_import_map_dev.out rename to tests/specs/run/jsx_import_source/jsx_import_source_import_map_dev.out diff --git a/tests/specs/run/jsx_import_source_error/jsx_import_source_no_pragma.tsx b/tests/specs/run/jsx_import_source/jsx_import_source_no_pragma.tsx similarity index 100% rename from tests/specs/run/jsx_import_source_error/jsx_import_source_no_pragma.tsx rename to tests/specs/run/jsx_import_source/jsx_import_source_no_pragma.tsx diff --git a/tests/specs/run/jsx_import_source_pragma/jsx_import_source_pragma.tsx b/tests/specs/run/jsx_import_source/jsx_import_source_pragma.tsx similarity index 100% rename from tests/specs/run/jsx_import_source_pragma/jsx_import_source_pragma.tsx rename to tests/specs/run/jsx_import_source/jsx_import_source_pragma.tsx diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx_import_source_pragma_import_map.tsx b/tests/specs/run/jsx_import_source/jsx_import_source_pragma_import_map.tsx similarity index 100% rename from tests/specs/run/jsx_import_source_pragma_import_map/jsx_import_source_pragma_import_map.tsx rename to tests/specs/run/jsx_import_source/jsx_import_source_pragma_import_map.tsx diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/no_pragma.out b/tests/specs/run/jsx_import_source/jsx_precompile/no_pragma.out similarity index 100% rename from tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/no_pragma.out rename to tests/specs/run/jsx_import_source/jsx_precompile/no_pragma.out diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/no_pragma.tsx b/tests/specs/run/jsx_import_source/jsx_precompile/no_pragma.tsx similarity index 100% rename from tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/no_pragma.tsx rename to tests/specs/run/jsx_import_source/jsx_precompile/no_pragma.tsx diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/skip.out b/tests/specs/run/jsx_import_source/jsx_precompile/skip.out similarity index 100% rename from tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/skip.out rename to tests/specs/run/jsx_import_source/jsx_precompile/skip.out diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/skip.tsx b/tests/specs/run/jsx_import_source/jsx_precompile/skip.tsx similarity index 100% rename from tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/skip.tsx rename to tests/specs/run/jsx_import_source/jsx_precompile/skip.tsx diff --git a/tests/specs/run/jsx_import_source_error/__test__.jsonc b/tests/specs/run/jsx_import_source_error/__test__.jsonc deleted file mode 100644 index 22b1d29cab..0000000000 --- a/tests/specs/run/jsx_import_source_error/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "run --config jsx/deno-jsx-error.jsonc --check jsx_import_source_no_pragma.tsx", - "output": "jsx_import_source_error.out", - "exitCode": 1 -} diff --git a/tests/specs/run/jsx_import_source_import_map/__test__.jsonc b/tests/specs/run/jsx_import_source_import_map/__test__.jsonc deleted file mode 100644 index 8a62c5243b..0000000000 --- a/tests/specs/run/jsx_import_source_import_map/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-import-map.jsonc jsx_import_source_no_pragma.tsx", - "output": "jsx_import_source_import_map.out" -} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_import_map/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/deno.lock b/tests/specs/run/jsx_import_source_import_map/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_import_map/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_import_map/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_import_map/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/import-map.json b/tests/specs/run/jsx_import_source_import_map/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_import_map/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_import_map/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_import_map/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_import_map/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_import_map/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_import_map/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_import_map/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_import_map/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_import_map/jsx_import_source_no_pragma.tsx b/tests/specs/run/jsx_import_source_import_map/jsx_import_source_no_pragma.tsx deleted file mode 100644 index 2c756054fb..0000000000 --- a/tests/specs/run/jsx_import_source_import_map/jsx_import_source_no_pragma.tsx +++ /dev/null @@ -1,7 +0,0 @@ -function A() { - return "hello"; -} - -export function B() { - return ; -} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/__test__.jsonc b/tests/specs/run/jsx_import_source_import_map_dev/__test__.jsonc deleted file mode 100644 index b62e7cb6f3..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_dev/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsxdev-import-map.jsonc jsx_import_source_no_pragma.tsx", - "output": "jsx_import_source_import_map_dev.out" -} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno.lock b/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_dev/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_import_map_dev/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_dev/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/import-map.json b/tests/specs/run/jsx_import_source_import_map_dev/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_dev/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_dev/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_import_map_dev/jsx_import_source_no_pragma.tsx b/tests/specs/run/jsx_import_source_import_map_dev/jsx_import_source_no_pragma.tsx deleted file mode 100644 index 2c756054fb..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_dev/jsx_import_source_no_pragma.tsx +++ /dev/null @@ -1,7 +0,0 @@ -function A() { - return "hello"; -} - -export function B() { - return ; -} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/__test__.jsonc b/tests/specs/run/jsx_import_source_import_map_no_check/__test__.jsonc deleted file mode 100644 index ea42654848..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-import-map.jsonc --no-check jsx_import_source_no_pragma.tsx", - "output": "jsx_import_source_import_map.out" -} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno.lock b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/import-map.json b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx_import_source_import_map.out b/tests/specs/run/jsx_import_source_import_map_no_check/jsx_import_source_import_map.out deleted file mode 100644 index 0d32389677..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/jsx_import_source_import_map.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -imported http://localhost:4545/jsx/jsx-runtime/index.ts diff --git a/tests/specs/run/jsx_import_source_import_map_no_check/jsx_import_source_no_pragma.tsx b/tests/specs/run/jsx_import_source_import_map_no_check/jsx_import_source_no_pragma.tsx deleted file mode 100644 index 2c756054fb..0000000000 --- a/tests/specs/run/jsx_import_source_import_map_no_check/jsx_import_source_no_pragma.tsx +++ /dev/null @@ -1,7 +0,0 @@ -function A() { - return "hello"; -} - -export function B() { - return ; -} diff --git a/tests/specs/run/jsx_import_source_no_pragma/__test__.jsonc b/tests/specs/run/jsx_import_source_no_pragma/__test__.jsonc deleted file mode 100644 index 7678e18f46..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock jsx_import_source_no_pragma.tsx", - "output": "jsx_import_source.out" -} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno.lock b/tests/specs/run/jsx_import_source_no_pragma/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_no_pragma/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/import-map.json b/tests/specs/run/jsx_import_source_no_pragma/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_no_pragma/jsx_import_source_no_pragma.tsx b/tests/specs/run/jsx_import_source_no_pragma/jsx_import_source_no_pragma.tsx deleted file mode 100644 index 2c756054fb..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma/jsx_import_source_no_pragma.tsx +++ /dev/null @@ -1,7 +0,0 @@ -function A() { - return "hello"; -} - -export function B() { - return ; -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/__test__.jsonc b/tests/specs/run/jsx_import_source_no_pragma_dev/__test__.jsonc deleted file mode 100644 index 8f9ee81f69..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_dev/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-import --reload --config jsx/deno-jsxdev.jsonc --no-lock jsx_import_source_no_pragma.tsx", - "output": "jsx_import_source_dev.out" -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno.lock b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/import-map.json b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx_import_source_no_pragma.tsx b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx_import_source_no_pragma.tsx deleted file mode 100644 index 2c756054fb..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_dev/jsx_import_source_no_pragma.tsx +++ /dev/null @@ -1,7 +0,0 @@ -function A() { - return "hello"; -} - -export function B() { - return ; -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/__test__.jsonc b/tests/specs/run/jsx_import_source_no_pragma_no_check/__test__.jsonc deleted file mode 100644 index 12cc9b0764..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --no-check jsx_import_source_no_pragma.tsx", - "output": "jsx_import_source.out" -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno.lock b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/import-map.json b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx_import_source.out b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx_import_source.out deleted file mode 100644 index b9555987a6..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx_import_source.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -imported http://localhost:4545/jsx/jsx-runtime diff --git a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx_import_source_no_pragma.tsx b/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx_import_source_no_pragma.tsx deleted file mode 100644 index 2c756054fb..0000000000 --- a/tests/specs/run/jsx_import_source_no_pragma_no_check/jsx_import_source_no_pragma.tsx +++ /dev/null @@ -1,7 +0,0 @@ -function A() { - return "hello"; -} - -export function B() { - return ; -} diff --git a/tests/specs/run/jsx_import_source_pragma/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma/__test__.jsonc deleted file mode 100644 index 9d704c0650..0000000000 --- a/tests/specs/run/jsx_import_source_pragma/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --reload --allow-import jsx_import_source_pragma.tsx", - "output": "jsx_import_source.out" -} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_pragma/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_pragma/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_pragma/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_pragma/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_pragma/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma/jsx_import_source.out b/tests/specs/run/jsx_import_source_pragma/jsx_import_source.out deleted file mode 100644 index b9555987a6..0000000000 --- a/tests/specs/run/jsx_import_source_pragma/jsx_import_source.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -imported http://localhost:4545/jsx/jsx-runtime diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/__test__.jsonc deleted file mode 100644 index 9eafe51968..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-import --reload --import-map jsx/import-map.json jsx_import_source_pragma_import_map.tsx", - "output": "jsx_import_source_import_map.out" -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_import_map/jsx_import_source_import_map.out b/tests/specs/run/jsx_import_source_pragma_import_map/jsx_import_source_import_map.out deleted file mode 100644 index 0d32389677..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map/jsx_import_source_import_map.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -imported http://localhost:4545/jsx/jsx-runtime/index.ts diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/__test__.jsonc deleted file mode 100644 index bb271c0eef..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-import --reload --import-map jsx/import-map.json --config jsx/deno-jsxdev-import-map.jsonc jsx_import_source_pragma_import_map.tsx", - "output": "jsx_import_source_import_map_dev.out" -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx_import_source_import_map_dev.out b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx_import_source_import_map_dev.out deleted file mode 100644 index 56f514d90c..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx_import_source_import_map_dev.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -imported http://localhost:4545/jsx/jsx-dev-runtime/index.ts diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx_import_source_pragma_import_map.tsx b/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx_import_source_pragma_import_map.tsx deleted file mode 100644 index 548365f182..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_dev/jsx_import_source_pragma_import_map.tsx +++ /dev/null @@ -1,9 +0,0 @@ -/** @jsxImportSource jsx */ - -function A() { - return "hello"; -} - -export function B() { - return ; -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/__test__.jsonc deleted file mode 100644 index dd42b71fda..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-import --reload --import-map jsx/import-map.json --no-check jsx_import_source_pragma_import_map.tsx", - "output": "jsx_import_source_import_map.out" -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx_import_source_import_map.out b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx_import_source_import_map.out deleted file mode 100644 index 0d32389677..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx_import_source_import_map.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -imported http://localhost:4545/jsx/jsx-runtime/index.ts diff --git a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx_import_source_pragma_import_map.tsx b/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx_import_source_pragma_import_map.tsx deleted file mode 100644 index 548365f182..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_import_map_no_check/jsx_import_source_pragma_import_map.tsx +++ /dev/null @@ -1,9 +0,0 @@ -/** @jsxImportSource jsx */ - -function A() { - return "hello"; -} - -export function B() { - return ; -} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_no_check/__test__.jsonc deleted file mode 100644 index 0956b94a76..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-import --reload --no-check jsx_import_source_pragma.tsx", - "output": "jsx_import_source.out" -} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx_import_source.out b/tests/specs/run/jsx_import_source_pragma_no_check/jsx_import_source.out deleted file mode 100644 index b9555987a6..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/jsx_import_source.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -imported http://localhost:4545/jsx/jsx-runtime diff --git a/tests/specs/run/jsx_import_source_pragma_no_check/jsx_import_source_pragma.tsx b/tests/specs/run/jsx_import_source_pragma_no_check/jsx_import_source_pragma.tsx deleted file mode 100644 index c19e53d4ff..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_no_check/jsx_import_source_pragma.tsx +++ /dev/null @@ -1,9 +0,0 @@ -/** @jsxImportSource http://localhost:4545/jsx */ - -function A() { - return "hello"; -} - -export function B() { - return ; -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config/__test__.jsonc deleted file mode 100644 index aeaf209c3a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --reload --allow-import --config jsx/deno-jsx.jsonc --no-lock jsx_import_source_pragma.tsx", - "output": "jsx_import_source.out" -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx_import_source.out b/tests/specs/run/jsx_import_source_pragma_with_config/jsx_import_source.out deleted file mode 100644 index b9555987a6..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/jsx_import_source.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -imported http://localhost:4545/jsx/jsx-runtime diff --git a/tests/specs/run/jsx_import_source_pragma_with_config/jsx_import_source_pragma.tsx b/tests/specs/run/jsx_import_source_pragma_with_config/jsx_import_source_pragma.tsx deleted file mode 100644 index c19e53d4ff..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config/jsx_import_source_pragma.tsx +++ /dev/null @@ -1,9 +0,0 @@ -/** @jsxImportSource http://localhost:4545/jsx */ - -function A() { - return "hello"; -} - -export function B() { - return ; -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/__test__.jsonc deleted file mode 100644 index 3e8089fd2c..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --no-check jsx_import_source_pragma.tsx", - "output": "jsx_import_source.out" -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx_import_source.out b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx_import_source.out deleted file mode 100644 index b9555987a6..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx_import_source.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -imported http://localhost:4545/jsx/jsx-runtime diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx_import_source_pragma.tsx b/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx_import_source_pragma.tsx deleted file mode 100644 index c19e53d4ff..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_no_check/jsx_import_source_pragma.tsx +++ /dev/null @@ -1,9 +0,0 @@ -/** @jsxImportSource http://localhost:4545/jsx */ - -function A() { - return "hello"; -} - -export function B() { - return ; -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/__test__.jsonc deleted file mode 100644 index 03ed1af1b6..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --vendor jsx_import_source_pragma.tsx", - "output": "jsx_import_source.out" -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/vendor/http_localhost_4545/jsx/#jsx-runtime_62ac8.js b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/vendor/http_localhost_4545/jsx/#jsx-runtime_62ac8.js deleted file mode 100644 index c8f0a908db..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/vendor/http_localhost_4545/jsx/#jsx-runtime_62ac8.js +++ /dev/null @@ -1,11 +0,0 @@ -export function jsx( - _type, - _props, - _key, - _source, - _self, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/vendor/manifest.json b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/vendor/manifest.json deleted file mode 100644 index a770c33669..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx/vendor/manifest.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "modules": { - "http://localhost:4545/jsx/jsx-runtime": { - "headers": { - "content-type": "application/javascript" - } - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx_import_source.out b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx_import_source.out deleted file mode 100644 index b9555987a6..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx_import_source.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -imported http://localhost:4545/jsx/jsx-runtime diff --git a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx_import_source_pragma.tsx b/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx_import_source_pragma.tsx deleted file mode 100644 index c19e53d4ff..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_config_vendor_dir/jsx_import_source_pragma.tsx +++ /dev/null @@ -1,9 +0,0 @@ -/** @jsxImportSource http://localhost:4545/jsx */ - -function A() { - return "hello"; -} - -export function B() { - return ; -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_with_dev_config/__test__.jsonc deleted file mode 100644 index 56734e4678..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --reload --allow-import --config jsx/deno-jsxdev.jsonc --no-lock jsx_import_source_pragma.tsx", - "output": "jsx_import_source_dev.out" -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno.lock b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/import-map.json b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx_import_source_dev.out b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx_import_source_dev.out deleted file mode 100644 index 38d7a12f05..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx_import_source_dev.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -imported http://localhost:4545/jsx/jsx-dev-runtime diff --git a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx_import_source_pragma.tsx b/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx_import_source_pragma.tsx deleted file mode 100644 index c19e53d4ff..0000000000 --- a/tests/specs/run/jsx_import_source_pragma_with_dev_config/jsx_import_source_pragma.tsx +++ /dev/null @@ -1,9 +0,0 @@ -/** @jsxImportSource http://localhost:4545/jsx */ - -function A() { - return "hello"; -} - -export function B() { - return ; -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/__test__.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map/__test__.jsonc deleted file mode 100644 index c795a9d8e6..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-import --reload --check --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-precompile.jsonc jsx_precompile/no_pragma.tsx", - "output": "jsx_precompile/no_pragma.out" -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno.lock b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/import-map.json b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/skip.out b/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/skip.out deleted file mode 100644 index a32b616f06..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/skip.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4545/jsx/jsx-precompile/index.ts -Check file:///[WILDCARD]/run/jsx_precompile/skip.tsx -imported http://localhost:4545/jsx/jsx-precompile/index.ts diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/__test__.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/__test__.jsonc deleted file mode 100644 index 7163c83d00..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-import --reload --check --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-precompile-skip.jsonc jsx_precompile/skip.tsx", - "output": "jsx_precompile/skip.out" -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-error.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-error.jsonc deleted file mode 100644 index 37cb4dd912..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-error.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "./nonexistent" - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-import-map.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-import-map.jsonc deleted file mode 100644 index 5adbfa8b5a..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-precompile-skip.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-precompile-skip.jsonc deleted file mode 100644 index 3c9e4fa1f8..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-precompile-skip.jsonc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile", - "jsxPrecompileSkipElements": ["a", "img"] - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-precompile.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-precompile.jsonc deleted file mode 100644 index 95ae1b9f31..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx-precompile.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "precompile", - "jsxImportSource": "jsx-precompile" - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx.json b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx.json deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx.jsonc deleted file mode 100644 index 311409ea37..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsx.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsxdev-import-map.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsxdev-import-map.jsonc deleted file mode 100644 index 7481d5a2d8..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsxdev-import-map.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsxdev.jsonc b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsxdev.jsonc deleted file mode 100644 index ae5bdf9f16..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno-jsxdev.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsxdev", - "jsxImportSource": "http://localhost:4545/jsx" - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno.lock b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno.lock deleted file mode 100644 index 011e8fe108..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/deno.lock +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/jsx/jsx-dev-runtime/index.ts": "183c5bf1cfb82b15fc1e8cca15593d4816035759532d851abd4476df378c8412" - } -} \ No newline at end of file diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/import-map-scoped.json b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/import-map-scoped.json deleted file mode 100644 index 9b2005128f..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/import-map-scoped.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scopes": { - "../subdir/": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts" - } - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/import-map.json b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/import-map.json deleted file mode 100644 index 1bfa04e2f0..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/import-map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts", - "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts", - "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts" - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-dev-runtime/index.ts b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-dev-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-dev-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-precompile/index.ts b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-precompile/index.ts deleted file mode 100644 index 0d56095e0b..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-precompile/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -// deno-lint-ignore-file no-explicit-any -export const jsxAttr = (name: string, value: any) => `${name}="${value}"`; -// deno-lint-ignore-file no-explicit-any -export const jsxTemplate = (_template: string[], ..._exprs: any[]) => ""; -// deno-lint-ignore-file no-explicit-any -export const jsxEscape = (_value: any) => ""; -console.log("imported", import.meta.url); - -declare global { - namespace JSX { - interface IntrinsicElements { - [tagName: string]: Record; - } - } -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-runtime/index.ts b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-runtime/index.ts deleted file mode 100644 index 15e2029c8a..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx/jsx-runtime/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file no-explicit-any -export function jsx( - _type: any, - _props: any, - _key: any, - _source: any, - _self: any, -) {} -export const jsxs = jsx; -export const jsxDEV = jsx; -export const Fragment = Symbol("Fragment"); -console.log("imported", import.meta.url); diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/no_pragma.out b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/no_pragma.out deleted file mode 100644 index f26984258c..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/no_pragma.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4545/jsx/jsx-precompile/index.ts -Check file:///[WILDCARD]/jsx_precompile/no_pragma.tsx -imported http://localhost:4545/jsx/jsx-precompile/index.ts diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/no_pragma.tsx b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/no_pragma.tsx deleted file mode 100644 index 7ba21d80d2..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/no_pragma.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export function A() { - return

hello

; -} diff --git a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/skip.tsx b/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/skip.tsx deleted file mode 100644 index 49bc4e2b7a..0000000000 --- a/tests/specs/run/jsx_import_source_precompile_import_map_skip_element/jsx_precompile/skip.tsx +++ /dev/null @@ -1,9 +0,0 @@ -export function A() { - return ( -
- foo -

hello

- -
- ); -} diff --git a/tests/specs/run/no_check_decorators/__test__.jsonc b/tests/specs/run/no_check_decorators/__test__.jsonc deleted file mode 100644 index da50d30a05..0000000000 --- a/tests/specs/run/no_check_decorators/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --quiet --reload --no-check decorators/experimental/no_check/main.ts", - "output": "decorators/experimental/no_check/main.out" -} diff --git a/tests/specs/run/no_check_decorators/decorators/experimental/deno.json b/tests/specs/run/no_check_decorators/decorators/experimental/deno.json deleted file mode 100644 index 504cd646e1..0000000000 --- a/tests/specs/run/no_check_decorators/decorators/experimental/deno.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "experimentalDecorators": true - } -} diff --git a/tests/specs/run/no_check_decorators/decorators/experimental/no_check/main.out b/tests/specs/run/no_check_decorators/decorators/experimental/no_check/main.out deleted file mode 100644 index 015f7076e8..0000000000 --- a/tests/specs/run/no_check_decorators/decorators/experimental/no_check/main.out +++ /dev/null @@ -1,3 +0,0 @@ -a(): evaluated -a(): called -method diff --git a/tests/specs/run/no_check_decorators/decorators/experimental/no_check/main.ts b/tests/specs/run/no_check_decorators/decorators/experimental/no_check/main.ts deleted file mode 100644 index 9f7ec550d5..0000000000 --- a/tests/specs/run/no_check_decorators/decorators/experimental/no_check/main.ts +++ /dev/null @@ -1,21 +0,0 @@ -// deno-lint-ignore-file -function a() { - console.log("a(): evaluated"); - return ( - _target: any, - _propertyKey: string, - _descriptor: PropertyDescriptor, - ) => { - console.log("a(): called"); - }; -} - -class B { - @a() - method() { - console.log("method"); - } -} - -const b = new B(); -b.method(); diff --git a/tests/specs/run/no_check_decorators/decorators/experimental/runtime/main.out b/tests/specs/run/no_check_decorators/decorators/experimental/runtime/main.out deleted file mode 100644 index 0fc1d4590e..0000000000 --- a/tests/specs/run/no_check_decorators/decorators/experimental/runtime/main.out +++ /dev/null @@ -1,7 +0,0 @@ -@A evaluated -@B evaluated -@B called -@A called -fn() called from @A -fn() called from @B -C.test() called diff --git a/tests/specs/run/no_check_decorators/decorators/experimental/runtime/main.ts b/tests/specs/run/no_check_decorators/decorators/experimental/runtime/main.ts deleted file mode 100644 index 40a26bbd4d..0000000000 --- a/tests/specs/run/no_check_decorators/decorators/experimental/runtime/main.ts +++ /dev/null @@ -1,42 +0,0 @@ -// deno-lint-ignore-file -function a() { - console.log("@A evaluated"); - return function ( - target: any, - propertyKey: string, - descriptor: PropertyDescriptor, - ) { - console.log("@A called"); - const fn = descriptor.value; - descriptor.value = function () { - console.log("fn() called from @A"); - fn(); - }; - }; -} - -function b() { - console.log("@B evaluated"); - return function ( - target: any, - propertyKey: string, - descriptor: PropertyDescriptor, - ) { - console.log("@B called"); - const fn = descriptor.value; - descriptor.value = function () { - console.log("fn() called from @B"); - fn(); - }; - }; -} - -class C { - @a() - @b() - static test() { - console.log("C.test() called"); - } -} - -C.test(); diff --git a/tests/specs/run/no_check_decorators/decorators/experimental/ts/main.out b/tests/specs/run/no_check_decorators/decorators/experimental/ts/main.out deleted file mode 100644 index ea64fbaa63..0000000000 --- a/tests/specs/run/no_check_decorators/decorators/experimental/ts/main.out +++ /dev/null @@ -1,3 +0,0 @@ -Warning experimentalDecorators compiler option is deprecated and may be removed at any time -Check [WILDCARD] -SomeClass { someField: "asdf" } diff --git a/tests/specs/run/no_check_decorators/decorators/experimental/ts/main.ts b/tests/specs/run/no_check_decorators/decorators/experimental/ts/main.ts deleted file mode 100644 index 95fba6cd48..0000000000 --- a/tests/specs/run/no_check_decorators/decorators/experimental/ts/main.ts +++ /dev/null @@ -1,14 +0,0 @@ -// deno-lint-ignore-file - -function Decorate() { - return function (constructor: any): any { - return class extends constructor { - protected someField: string = "asdf"; - }; - }; -} - -@Decorate() -class SomeClass {} - -console.log(new SomeClass()); diff --git a/tests/specs/run/no_check_decorators/decorators/tc39_proposal/main.out b/tests/specs/run/no_check_decorators/decorators/tc39_proposal/main.out deleted file mode 100644 index 39394952e8..0000000000 --- a/tests/specs/run/no_check_decorators/decorators/tc39_proposal/main.out +++ /dev/null @@ -1,3 +0,0 @@ -starting m with arguments 1 -C.m 1 -ending m diff --git a/tests/specs/run/no_check_decorators/decorators/tc39_proposal/main.ts b/tests/specs/run/no_check_decorators/decorators/tc39_proposal/main.ts deleted file mode 100644 index 00c8a85025..0000000000 --- a/tests/specs/run/no_check_decorators/decorators/tc39_proposal/main.ts +++ /dev/null @@ -1,21 +0,0 @@ -// deno-lint-ignore no-explicit-any -function logged(value: any, { kind, name }: { kind: string; name: string }) { - if (kind === "method") { - return function (...args: unknown[]) { - console.log(`starting ${name} with arguments ${args.join(", ")}`); - // @ts-ignore this has implicit any type - const ret = value.call(this, ...args); - console.log(`ending ${name}`); - return ret; - }; - } -} - -class C { - @logged - m(arg: number) { - console.log("C.m", arg); - } -} - -new C().m(1); diff --git a/tests/specs/run/package_json/invalid_value/__test__.jsonc b/tests/specs/run/package_json/invalid_value/__test__.jsonc index 195734d95f..9752f32143 100644 --- a/tests/specs/run/package_json/invalid_value/__test__.jsonc +++ b/tests/specs/run/package_json/invalid_value/__test__.jsonc @@ -12,6 +12,11 @@ "exitCode": 1, "output": "error_auto.out" }, + "run_error": { + "args": "run error.ts", + "exitCode": 1, + "output": "error.out" + }, "install_error_byonm": { "args": "install", "output": "install.out", diff --git a/tests/specs/run/runtime_decorators/__test__.jsonc b/tests/specs/run/runtime_decorators/__test__.jsonc deleted file mode 100644 index 286fd377d8..0000000000 --- a/tests/specs/run/runtime_decorators/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --quiet --reload --no-check decorators/experimental/runtime/main.ts", - "output": "decorators/experimental/runtime/main.out" -} diff --git a/tests/specs/run/runtime_decorators/decorators/experimental/deno.json b/tests/specs/run/runtime_decorators/decorators/experimental/deno.json deleted file mode 100644 index 504cd646e1..0000000000 --- a/tests/specs/run/runtime_decorators/decorators/experimental/deno.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "experimentalDecorators": true - } -} diff --git a/tests/specs/run/runtime_decorators/decorators/experimental/no_check/main.out b/tests/specs/run/runtime_decorators/decorators/experimental/no_check/main.out deleted file mode 100644 index 015f7076e8..0000000000 --- a/tests/specs/run/runtime_decorators/decorators/experimental/no_check/main.out +++ /dev/null @@ -1,3 +0,0 @@ -a(): evaluated -a(): called -method diff --git a/tests/specs/run/runtime_decorators/decorators/experimental/no_check/main.ts b/tests/specs/run/runtime_decorators/decorators/experimental/no_check/main.ts deleted file mode 100644 index 9f7ec550d5..0000000000 --- a/tests/specs/run/runtime_decorators/decorators/experimental/no_check/main.ts +++ /dev/null @@ -1,21 +0,0 @@ -// deno-lint-ignore-file -function a() { - console.log("a(): evaluated"); - return ( - _target: any, - _propertyKey: string, - _descriptor: PropertyDescriptor, - ) => { - console.log("a(): called"); - }; -} - -class B { - @a() - method() { - console.log("method"); - } -} - -const b = new B(); -b.method(); diff --git a/tests/specs/run/runtime_decorators/decorators/experimental/runtime/main.out b/tests/specs/run/runtime_decorators/decorators/experimental/runtime/main.out deleted file mode 100644 index 0fc1d4590e..0000000000 --- a/tests/specs/run/runtime_decorators/decorators/experimental/runtime/main.out +++ /dev/null @@ -1,7 +0,0 @@ -@A evaluated -@B evaluated -@B called -@A called -fn() called from @A -fn() called from @B -C.test() called diff --git a/tests/specs/run/runtime_decorators/decorators/experimental/runtime/main.ts b/tests/specs/run/runtime_decorators/decorators/experimental/runtime/main.ts deleted file mode 100644 index 40a26bbd4d..0000000000 --- a/tests/specs/run/runtime_decorators/decorators/experimental/runtime/main.ts +++ /dev/null @@ -1,42 +0,0 @@ -// deno-lint-ignore-file -function a() { - console.log("@A evaluated"); - return function ( - target: any, - propertyKey: string, - descriptor: PropertyDescriptor, - ) { - console.log("@A called"); - const fn = descriptor.value; - descriptor.value = function () { - console.log("fn() called from @A"); - fn(); - }; - }; -} - -function b() { - console.log("@B evaluated"); - return function ( - target: any, - propertyKey: string, - descriptor: PropertyDescriptor, - ) { - console.log("@B called"); - const fn = descriptor.value; - descriptor.value = function () { - console.log("fn() called from @B"); - fn(); - }; - }; -} - -class C { - @a() - @b() - static test() { - console.log("C.test() called"); - } -} - -C.test(); diff --git a/tests/specs/run/runtime_decorators/decorators/experimental/ts/main.out b/tests/specs/run/runtime_decorators/decorators/experimental/ts/main.out deleted file mode 100644 index ea64fbaa63..0000000000 --- a/tests/specs/run/runtime_decorators/decorators/experimental/ts/main.out +++ /dev/null @@ -1,3 +0,0 @@ -Warning experimentalDecorators compiler option is deprecated and may be removed at any time -Check [WILDCARD] -SomeClass { someField: "asdf" } diff --git a/tests/specs/run/runtime_decorators/decorators/experimental/ts/main.ts b/tests/specs/run/runtime_decorators/decorators/experimental/ts/main.ts deleted file mode 100644 index 95fba6cd48..0000000000 --- a/tests/specs/run/runtime_decorators/decorators/experimental/ts/main.ts +++ /dev/null @@ -1,14 +0,0 @@ -// deno-lint-ignore-file - -function Decorate() { - return function (constructor: any): any { - return class extends constructor { - protected someField: string = "asdf"; - }; - }; -} - -@Decorate() -class SomeClass {} - -console.log(new SomeClass()); diff --git a/tests/specs/run/runtime_decorators/decorators/tc39_proposal/main.out b/tests/specs/run/runtime_decorators/decorators/tc39_proposal/main.out deleted file mode 100644 index 39394952e8..0000000000 --- a/tests/specs/run/runtime_decorators/decorators/tc39_proposal/main.out +++ /dev/null @@ -1,3 +0,0 @@ -starting m with arguments 1 -C.m 1 -ending m diff --git a/tests/specs/run/runtime_decorators/decorators/tc39_proposal/main.ts b/tests/specs/run/runtime_decorators/decorators/tc39_proposal/main.ts deleted file mode 100644 index 00c8a85025..0000000000 --- a/tests/specs/run/runtime_decorators/decorators/tc39_proposal/main.ts +++ /dev/null @@ -1,21 +0,0 @@ -// deno-lint-ignore no-explicit-any -function logged(value: any, { kind, name }: { kind: string; name: string }) { - if (kind === "method") { - return function (...args: unknown[]) { - console.log(`starting ${name} with arguments ${args.join(", ")}`); - // @ts-ignore this has implicit any type - const ret = value.call(this, ...args); - console.log(`ending ${name}`); - return ret; - }; - } -} - -class C { - @logged - m(arg: number) { - console.log("C.m", arg); - } -} - -new C().m(1); diff --git a/tests/specs/run/top_level_await/__test__.jsonc b/tests/specs/run/top_level_await/__test__.jsonc index 25537db5f4..c05786075a 100644 --- a/tests/specs/run/top_level_await/__test__.jsonc +++ b/tests/specs/run/top_level_await/__test__.jsonc @@ -1,4 +1,42 @@ { - "args": "run --allow-read top_level_await/top_level_await.js", - "output": "top_level_await/top_level_await.out" + "tests": { + "top_level_for_await": { + "args": "run --quiet top_level_for_await.js", + "output": "top_level_for_await.out" + }, + "top_level_for_await_ts": { + "args": "run --quiet top_level_for_await.ts", + "output": "top_level_for_await.out" + }, + "top_level_await_unresolved": { + "args": "run unresolved.js", + "output": "unresolved.out", + "exitCode": 1 + }, + "top_level_await": { + "args": "run --allow-read top_level_await.js", + "output": "top_level_await.out" + }, + "top_level_await_ts": { + "args": "run --quiet --allow-read top_level_await.ts", + "output": "top_level_await.out" + }, + "top_level_await_order": { + "args": "run --allow-read order.js", + "output": "order.out" + }, + "top_level_await_nested": { + "args": "run --allow-read nested/main.js", + "output": "nested.out" + }, + "top_level_await_loop": { + "args": "run --allow-read loop.js", + "output": "loop.out" + }, + "top_level_await_circular": { + "args": "run --allow-read circular.js", + "output": "circular.out", + "exitCode": 1 + } + } } diff --git a/tests/specs/run/top_level_await/top_level_await/circular.js b/tests/specs/run/top_level_await/circular.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/circular.js rename to tests/specs/run/top_level_await/circular.js diff --git a/tests/specs/run/top_level_await/top_level_await/circular.out b/tests/specs/run/top_level_await/circular.out similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/circular.out rename to tests/specs/run/top_level_await/circular.out diff --git a/tests/specs/run/top_level_await/hello.txt b/tests/specs/run/top_level_await/hello.txt index 6769dd60bd..cd0875583a 100644 --- a/tests/specs/run/top_level_await/hello.txt +++ b/tests/specs/run/top_level_await/hello.txt @@ -1 +1 @@ -Hello world! \ No newline at end of file +Hello world! diff --git a/tests/specs/run/top_level_await_circular/top_level_await/loop.js b/tests/specs/run/top_level_await/loop.js similarity index 74% rename from tests/specs/run/top_level_await_circular/top_level_await/loop.js rename to tests/specs/run/top_level_await/loop.js index f229e03f61..401ef0ecd2 100644 --- a/tests/specs/run/top_level_await_circular/top_level_await/loop.js +++ b/tests/specs/run/top_level_await/loop.js @@ -1,11 +1,11 @@ const importsDir = Deno.readDirSync( - Deno.realPathSync("./top_level_await/tla2"), + Deno.realPathSync("./tla2"), ); const resolvedPaths = []; for (const { name } of importsDir) { - const filePath = Deno.realPathSync(`./top_level_await/tla2/${name}`); + const filePath = Deno.realPathSync(`./tla2/${name}`); resolvedPaths.push(filePath); } diff --git a/tests/specs/run/top_level_await/top_level_await/loop.out b/tests/specs/run/top_level_await/loop.out similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/loop.out rename to tests/specs/run/top_level_await/loop.out diff --git a/tests/specs/run/top_level_await/top_level_await/nested.out b/tests/specs/run/top_level_await/nested.out similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/nested.out rename to tests/specs/run/top_level_await/nested.out diff --git a/tests/specs/run/top_level_await/top_level_await/nested/a.js b/tests/specs/run/top_level_await/nested/a.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/nested/a.js rename to tests/specs/run/top_level_await/nested/a.js diff --git a/tests/specs/run/top_level_await/top_level_await/nested/b.js b/tests/specs/run/top_level_await/nested/b.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/nested/b.js rename to tests/specs/run/top_level_await/nested/b.js diff --git a/tests/specs/run/top_level_await/top_level_await/nested/main.js b/tests/specs/run/top_level_await/nested/main.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/nested/main.js rename to tests/specs/run/top_level_await/nested/main.js diff --git a/tests/specs/run/top_level_await/top_level_await/order.js b/tests/specs/run/top_level_await/order.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/order.js rename to tests/specs/run/top_level_await/order.js diff --git a/tests/specs/run/top_level_await/top_level_await/order.out b/tests/specs/run/top_level_await/order.out similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/order.out rename to tests/specs/run/top_level_await/order.out diff --git a/tests/specs/run/top_level_await/top_level_await/tla/a.js b/tests/specs/run/top_level_await/tla/a.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/tla/a.js rename to tests/specs/run/top_level_await/tla/a.js diff --git a/tests/specs/run/top_level_await/top_level_await/tla/b.js b/tests/specs/run/top_level_await/tla/b.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/tla/b.js rename to tests/specs/run/top_level_await/tla/b.js diff --git a/tests/specs/run/top_level_await/top_level_await/tla/c.js b/tests/specs/run/top_level_await/tla/c.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/tla/c.js rename to tests/specs/run/top_level_await/tla/c.js diff --git a/tests/specs/run/top_level_await/top_level_await/tla/d.js b/tests/specs/run/top_level_await/tla/d.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/tla/d.js rename to tests/specs/run/top_level_await/tla/d.js diff --git a/tests/specs/run/top_level_await/top_level_await/tla/order.js b/tests/specs/run/top_level_await/tla/order.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/tla/order.js rename to tests/specs/run/top_level_await/tla/order.js diff --git a/tests/specs/run/top_level_await/top_level_await/tla/parent.js b/tests/specs/run/top_level_await/tla/parent.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/tla/parent.js rename to tests/specs/run/top_level_await/tla/parent.js diff --git a/tests/specs/run/top_level_await/top_level_await/tla2/a.js b/tests/specs/run/top_level_await/tla2/a.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/tla2/a.js rename to tests/specs/run/top_level_await/tla2/a.js diff --git a/tests/specs/run/top_level_await/top_level_await/tla2/b.js b/tests/specs/run/top_level_await/tla2/b.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/tla2/b.js rename to tests/specs/run/top_level_await/tla2/b.js diff --git a/tests/specs/run/top_level_await/top_level_await/tla3/b.js b/tests/specs/run/top_level_await/tla3/b.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/tla3/b.js rename to tests/specs/run/top_level_await/tla3/b.js diff --git a/tests/specs/run/top_level_await/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_await/tla3/timeout_loop.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/tla3/timeout_loop.js rename to tests/specs/run/top_level_await/tla3/timeout_loop.js diff --git a/tests/specs/run/top_level_await/top_level_await/top_level_await.js b/tests/specs/run/top_level_await/top_level_await.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/top_level_await.js rename to tests/specs/run/top_level_await/top_level_await.js diff --git a/tests/specs/run/top_level_await/top_level_await/top_level_await.out b/tests/specs/run/top_level_await/top_level_await.out similarity index 58% rename from tests/specs/run/top_level_await/top_level_await/top_level_await.out rename to tests/specs/run/top_level_await/top_level_await.out index 4b65d15fe3..ae1f5594ea 100644 --- a/tests/specs/run/top_level_await/top_level_await/top_level_await.out +++ b/tests/specs/run/top_level_await/top_level_await.out @@ -1,3 +1,4 @@ Hello world! -write 12 + +write 13 diff --git a/tests/specs/run/top_level_await_ts/top_level_await/top_level_await.ts b/tests/specs/run/top_level_await/top_level_await.ts similarity index 100% rename from tests/specs/run/top_level_await_ts/top_level_await/top_level_await.ts rename to tests/specs/run/top_level_await/top_level_await.ts diff --git a/tests/specs/run/top_level_await/top_level_await/loop.js b/tests/specs/run/top_level_await/top_level_await/loop.js deleted file mode 100644 index f229e03f61..0000000000 --- a/tests/specs/run/top_level_await/top_level_await/loop.js +++ /dev/null @@ -1,20 +0,0 @@ -const importsDir = Deno.readDirSync( - Deno.realPathSync("./top_level_await/tla2"), -); - -const resolvedPaths = []; - -for (const { name } of importsDir) { - const filePath = Deno.realPathSync(`./top_level_await/tla2/${name}`); - resolvedPaths.push(filePath); -} - -resolvedPaths.sort(); - -for (const filePath of resolvedPaths) { - console.log("loading", filePath); - const mod = await import(`file://${filePath}`); - console.log("loaded", mod); -} - -console.log("all loaded"); diff --git a/tests/specs/run/top_level_await/top_level_await/top_level_await.ts b/tests/specs/run/top_level_await/top_level_await/top_level_await.ts deleted file mode 100644 index 8d47ceb21e..0000000000 --- a/tests/specs/run/top_level_await/top_level_await/top_level_await.ts +++ /dev/null @@ -1,3 +0,0 @@ -const buf: Uint8Array = await Deno.readFile("./assets/hello.txt"); -const n: number = await Deno.stdout.write(buf); -console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_await/top_level_for_await.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/top_level_for_await.js rename to tests/specs/run/top_level_await/top_level_for_await.js diff --git a/tests/specs/run/top_level_await/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_await/top_level_for_await.out similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/top_level_for_await.out rename to tests/specs/run/top_level_await/top_level_for_await.out diff --git a/tests/specs/run/top_level_await/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_await/top_level_for_await.ts similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/top_level_for_await.ts rename to tests/specs/run/top_level_await/top_level_for_await.ts diff --git a/tests/specs/run/top_level_await/top_level_await/unresolved.js b/tests/specs/run/top_level_await/unresolved.js similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/unresolved.js rename to tests/specs/run/top_level_await/unresolved.js diff --git a/tests/specs/run/top_level_await/top_level_await/unresolved.out b/tests/specs/run/top_level_await/unresolved.out similarity index 100% rename from tests/specs/run/top_level_await/top_level_await/unresolved.out rename to tests/specs/run/top_level_await/unresolved.out diff --git a/tests/specs/run/top_level_await_circular/__test__.jsonc b/tests/specs/run/top_level_await_circular/__test__.jsonc deleted file mode 100644 index 3e236b2107..0000000000 --- a/tests/specs/run/top_level_await_circular/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "run --allow-read top_level_await/circular.js", - "output": "top_level_await/circular.out", - "exitCode": 1 -} diff --git a/tests/specs/run/top_level_await_circular/top_level_await/circular.js b/tests/specs/run/top_level_await_circular/top_level_await/circular.js deleted file mode 100644 index ff2964b6a5..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/circular.js +++ /dev/null @@ -1,8 +0,0 @@ -import { foo } from "./tla3/timeout_loop.js"; - -export const collection = []; - -const mod = await import("./tla3/b.js"); - -console.log("foo in main", foo); -console.log("mod", mod); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/circular.out b/tests/specs/run/top_level_await_circular/top_level_await/circular.out deleted file mode 100644 index c889789613..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/circular.out +++ /dev/null @@ -1,10 +0,0 @@ -timeout loop 0 -timeout loop 1 -timeout loop 2 -timeout loop 3 -timeout loop 4 -timeout loop 5 -error: Top-level await promise never resolved -const mod = await import("./tla3/b.js"); - ^ - at ([WILDCARD]/top_level_await/circular.js:5:13) diff --git a/tests/specs/run/top_level_await_circular/top_level_await/loop.out b/tests/specs/run/top_level_await_circular/top_level_await/loop.out deleted file mode 100644 index 1bdffbf660..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/loop.out +++ /dev/null @@ -1,5 +0,0 @@ -loading [WILDCARD]a.js -loaded [Module: null prototype] { default: [class Foo] } -loading [WILDCARD]b.js -loaded [Module: null prototype] { default: [class Bar] } -all loaded diff --git a/tests/specs/run/top_level_await_circular/top_level_await/nested.out b/tests/specs/run/top_level_await_circular/top_level_await/nested.out deleted file mode 100644 index 8a1218a102..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/nested.out +++ /dev/null @@ -1,5 +0,0 @@ -1 -2 -3 -4 -5 diff --git a/tests/specs/run/top_level_await_circular/top_level_await/nested/a.js b/tests/specs/run/top_level_await_circular/top_level_await/nested/a.js deleted file mode 100644 index 74837d4ba1..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/nested/a.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log(2); -await import("./b.js"); -console.log(4); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/nested/b.js b/tests/specs/run/top_level_await_circular/top_level_await/nested/b.js deleted file mode 100644 index 3bd241b50e..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/nested/b.js +++ /dev/null @@ -1 +0,0 @@ -console.log(3); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/nested/main.js b/tests/specs/run/top_level_await_circular/top_level_await/nested/main.js deleted file mode 100644 index ed46a47175..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/nested/main.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log(1); -await import("./a.js"); -console.log(5); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/order.js b/tests/specs/run/top_level_await_circular/top_level_await/order.js deleted file mode 100644 index 30659cdfbf..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/order.js +++ /dev/null @@ -1,21 +0,0 @@ -// Ported from Node -// https://github.com/nodejs/node/blob/54746bb763ebea0dc7e99d88ff4b379bcd680964/test/es-module/test-esm-tla.mjs - -const { default: order } = await import("./tla/parent.js"); - -console.log("order", JSON.stringify(order)); - -if ( - !( - order[0] === "order" && - order[1] === "b" && - order[2] === "c" && - order[3] === "d" && - order[4] === "a" && - order[5] === "parent" - ) -) { - throw new Error("TLA wrong order"); -} - -console.log("TLA order correct"); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/order.out b/tests/specs/run/top_level_await_circular/top_level_await/order.out deleted file mode 100644 index 4cc27858cf..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/order.out +++ /dev/null @@ -1,2 +0,0 @@ -order ["order","b","c","d","a","parent"] -TLA order correct diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla/a.js b/tests/specs/run/top_level_await_circular/top_level_await/tla/a.js deleted file mode 100644 index c3ef3f7dbc..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/tla/a.js +++ /dev/null @@ -1,3 +0,0 @@ -import order from "./order.js"; - -order.push("b"); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla/b.js b/tests/specs/run/top_level_await_circular/top_level_await/tla/b.js deleted file mode 100644 index 3271c92d8f..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/tla/b.js +++ /dev/null @@ -1,7 +0,0 @@ -import order from "./order.js"; - -await new Promise((resolve) => { - setTimeout(resolve, 200); -}); - -order.push("a"); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla/c.js b/tests/specs/run/top_level_await_circular/top_level_await/tla/c.js deleted file mode 100644 index 806eb0a8be..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/tla/c.js +++ /dev/null @@ -1,3 +0,0 @@ -import order from "./order.js"; - -order.push("c"); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla/d.js b/tests/specs/run/top_level_await_circular/top_level_await/tla/d.js deleted file mode 100644 index 283ebf817f..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/tla/d.js +++ /dev/null @@ -1,8 +0,0 @@ -import order from "./order.js"; - -const end = Date.now() + 500; -while (end < Date.now()) { - // pass -} - -order.push("d"); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla/order.js b/tests/specs/run/top_level_await_circular/top_level_await/tla/order.js deleted file mode 100644 index f213a562ce..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/tla/order.js +++ /dev/null @@ -1 +0,0 @@ -export default ["order"]; diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla/parent.js b/tests/specs/run/top_level_await_circular/top_level_await/tla/parent.js deleted file mode 100644 index 1ecc154634..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/tla/parent.js +++ /dev/null @@ -1,9 +0,0 @@ -import order from "./order.js"; -import "./a.js"; -import "./b.js"; -import "./c.js"; -import "./d.js"; - -order.push("parent"); - -export default order; diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla2/a.js b/tests/specs/run/top_level_await_circular/top_level_await/tla2/a.js deleted file mode 100644 index d07bcb94db..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/tla2/a.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Foo { - constructor(message) { - this.message = message; - } -} diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla2/b.js b/tests/specs/run/top_level_await_circular/top_level_await/tla2/b.js deleted file mode 100644 index 68e357c1e9..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/tla2/b.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Bar { - constructor(message) { - this.message = message; - } -} diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla3/b.js b/tests/specs/run/top_level_await_circular/top_level_await/tla3/b.js deleted file mode 100644 index d0349545e9..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/tla3/b.js +++ /dev/null @@ -1,7 +0,0 @@ -import { foo } from "./timeout_loop.js"; -import { collection } from "../circular.js"; - -console.log("collection in b", collection); -console.log("foo in b", foo); - -export const a = "a"; diff --git a/tests/specs/run/top_level_await_circular/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_await_circular/top_level_await/tla3/timeout_loop.js deleted file mode 100644 index 860e6cd2ae..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/tla3/timeout_loop.js +++ /dev/null @@ -1,23 +0,0 @@ -export const foo = "foo"; - -export function delay(ms) { - return new Promise((res) => - setTimeout(() => { - res(); - }, ms) - ); -} - -let i = 0; - -async function timeoutLoop() { - await delay(1000); - console.log("timeout loop", i); - i++; - if (i > 5) { - return; - } - timeoutLoop(); -} - -timeoutLoop(); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/top_level_await.js b/tests/specs/run/top_level_await_circular/top_level_await/top_level_await.js deleted file mode 100644 index ea319ea124..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/top_level_await.js +++ /dev/null @@ -1,3 +0,0 @@ -const buf = await Deno.readFile("./assets/hello.txt"); -const n = await Deno.stdout.write(buf); -console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/top_level_await.out b/tests/specs/run/top_level_await_circular/top_level_await/top_level_await.out deleted file mode 100644 index 4b65d15fe3..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/top_level_await.out +++ /dev/null @@ -1,3 +0,0 @@ -Hello world! - -write 12 diff --git a/tests/specs/run/top_level_await_circular/top_level_await/top_level_await.ts b/tests/specs/run/top_level_await_circular/top_level_await/top_level_await.ts deleted file mode 100644 index 8d47ceb21e..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/top_level_await.ts +++ /dev/null @@ -1,3 +0,0 @@ -const buf: Uint8Array = await Deno.readFile("./assets/hello.txt"); -const n: number = await Deno.stdout.write(buf); -console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.js deleted file mode 100644 index a330f6c711..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.js +++ /dev/null @@ -1,10 +0,0 @@ -function* asyncGenerator() { - let i = 0; - while (i < 3) { - yield i++; - } -} - -for await (const num of asyncGenerator()) { - console.log(num); -} diff --git a/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.out deleted file mode 100644 index 4539bbf2d2..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.out +++ /dev/null @@ -1,3 +0,0 @@ -0 -1 -2 diff --git a/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.ts deleted file mode 100644 index 9179322d78..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/top_level_for_await.ts +++ /dev/null @@ -1,10 +0,0 @@ -async function* asyncGenerator(): AsyncIterableIterator { - let i = 0; - while (i < 3) { - yield i++; - } -} - -for await (const num of asyncGenerator()) { - console.log(num); -} diff --git a/tests/specs/run/top_level_await_circular/top_level_await/unresolved.js b/tests/specs/run/top_level_await_circular/top_level_await/unresolved.js deleted file mode 100644 index 231a8cd634..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/unresolved.js +++ /dev/null @@ -1 +0,0 @@ -await new Promise(() => {}); diff --git a/tests/specs/run/top_level_await_circular/top_level_await/unresolved.out b/tests/specs/run/top_level_await_circular/top_level_await/unresolved.out deleted file mode 100644 index 1f4ea5d382..0000000000 --- a/tests/specs/run/top_level_await_circular/top_level_await/unresolved.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Top-level await promise never resolved -await new Promise(() => {}); -^ - at ([WILDCARD]top_level_await/unresolved.js:1:1) diff --git a/tests/specs/run/top_level_await_loop/__test__.jsonc b/tests/specs/run/top_level_await_loop/__test__.jsonc deleted file mode 100644 index b2f5c84c03..0000000000 --- a/tests/specs/run/top_level_await_loop/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-read top_level_await/loop.js", - "output": "top_level_await/loop.out" -} diff --git a/tests/specs/run/top_level_await_loop/top_level_await/circular.js b/tests/specs/run/top_level_await_loop/top_level_await/circular.js deleted file mode 100644 index ff2964b6a5..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/circular.js +++ /dev/null @@ -1,8 +0,0 @@ -import { foo } from "./tla3/timeout_loop.js"; - -export const collection = []; - -const mod = await import("./tla3/b.js"); - -console.log("foo in main", foo); -console.log("mod", mod); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/circular.out b/tests/specs/run/top_level_await_loop/top_level_await/circular.out deleted file mode 100644 index c889789613..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/circular.out +++ /dev/null @@ -1,10 +0,0 @@ -timeout loop 0 -timeout loop 1 -timeout loop 2 -timeout loop 3 -timeout loop 4 -timeout loop 5 -error: Top-level await promise never resolved -const mod = await import("./tla3/b.js"); - ^ - at ([WILDCARD]/top_level_await/circular.js:5:13) diff --git a/tests/specs/run/top_level_await_loop/top_level_await/loop.js b/tests/specs/run/top_level_await_loop/top_level_await/loop.js deleted file mode 100644 index f229e03f61..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/loop.js +++ /dev/null @@ -1,20 +0,0 @@ -const importsDir = Deno.readDirSync( - Deno.realPathSync("./top_level_await/tla2"), -); - -const resolvedPaths = []; - -for (const { name } of importsDir) { - const filePath = Deno.realPathSync(`./top_level_await/tla2/${name}`); - resolvedPaths.push(filePath); -} - -resolvedPaths.sort(); - -for (const filePath of resolvedPaths) { - console.log("loading", filePath); - const mod = await import(`file://${filePath}`); - console.log("loaded", mod); -} - -console.log("all loaded"); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/loop.out b/tests/specs/run/top_level_await_loop/top_level_await/loop.out deleted file mode 100644 index 1bdffbf660..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/loop.out +++ /dev/null @@ -1,5 +0,0 @@ -loading [WILDCARD]a.js -loaded [Module: null prototype] { default: [class Foo] } -loading [WILDCARD]b.js -loaded [Module: null prototype] { default: [class Bar] } -all loaded diff --git a/tests/specs/run/top_level_await_loop/top_level_await/nested.out b/tests/specs/run/top_level_await_loop/top_level_await/nested.out deleted file mode 100644 index 8a1218a102..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/nested.out +++ /dev/null @@ -1,5 +0,0 @@ -1 -2 -3 -4 -5 diff --git a/tests/specs/run/top_level_await_loop/top_level_await/nested/a.js b/tests/specs/run/top_level_await_loop/top_level_await/nested/a.js deleted file mode 100644 index 74837d4ba1..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/nested/a.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log(2); -await import("./b.js"); -console.log(4); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/nested/b.js b/tests/specs/run/top_level_await_loop/top_level_await/nested/b.js deleted file mode 100644 index 3bd241b50e..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/nested/b.js +++ /dev/null @@ -1 +0,0 @@ -console.log(3); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/nested/main.js b/tests/specs/run/top_level_await_loop/top_level_await/nested/main.js deleted file mode 100644 index ed46a47175..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/nested/main.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log(1); -await import("./a.js"); -console.log(5); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/order.js b/tests/specs/run/top_level_await_loop/top_level_await/order.js deleted file mode 100644 index 30659cdfbf..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/order.js +++ /dev/null @@ -1,21 +0,0 @@ -// Ported from Node -// https://github.com/nodejs/node/blob/54746bb763ebea0dc7e99d88ff4b379bcd680964/test/es-module/test-esm-tla.mjs - -const { default: order } = await import("./tla/parent.js"); - -console.log("order", JSON.stringify(order)); - -if ( - !( - order[0] === "order" && - order[1] === "b" && - order[2] === "c" && - order[3] === "d" && - order[4] === "a" && - order[5] === "parent" - ) -) { - throw new Error("TLA wrong order"); -} - -console.log("TLA order correct"); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/order.out b/tests/specs/run/top_level_await_loop/top_level_await/order.out deleted file mode 100644 index 4cc27858cf..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/order.out +++ /dev/null @@ -1,2 +0,0 @@ -order ["order","b","c","d","a","parent"] -TLA order correct diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla/a.js b/tests/specs/run/top_level_await_loop/top_level_await/tla/a.js deleted file mode 100644 index c3ef3f7dbc..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/tla/a.js +++ /dev/null @@ -1,3 +0,0 @@ -import order from "./order.js"; - -order.push("b"); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla/b.js b/tests/specs/run/top_level_await_loop/top_level_await/tla/b.js deleted file mode 100644 index 3271c92d8f..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/tla/b.js +++ /dev/null @@ -1,7 +0,0 @@ -import order from "./order.js"; - -await new Promise((resolve) => { - setTimeout(resolve, 200); -}); - -order.push("a"); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla/c.js b/tests/specs/run/top_level_await_loop/top_level_await/tla/c.js deleted file mode 100644 index 806eb0a8be..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/tla/c.js +++ /dev/null @@ -1,3 +0,0 @@ -import order from "./order.js"; - -order.push("c"); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla/d.js b/tests/specs/run/top_level_await_loop/top_level_await/tla/d.js deleted file mode 100644 index 283ebf817f..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/tla/d.js +++ /dev/null @@ -1,8 +0,0 @@ -import order from "./order.js"; - -const end = Date.now() + 500; -while (end < Date.now()) { - // pass -} - -order.push("d"); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla/order.js b/tests/specs/run/top_level_await_loop/top_level_await/tla/order.js deleted file mode 100644 index f213a562ce..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/tla/order.js +++ /dev/null @@ -1 +0,0 @@ -export default ["order"]; diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla/parent.js b/tests/specs/run/top_level_await_loop/top_level_await/tla/parent.js deleted file mode 100644 index 1ecc154634..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/tla/parent.js +++ /dev/null @@ -1,9 +0,0 @@ -import order from "./order.js"; -import "./a.js"; -import "./b.js"; -import "./c.js"; -import "./d.js"; - -order.push("parent"); - -export default order; diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla2/a.js b/tests/specs/run/top_level_await_loop/top_level_await/tla2/a.js deleted file mode 100644 index d07bcb94db..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/tla2/a.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Foo { - constructor(message) { - this.message = message; - } -} diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla2/b.js b/tests/specs/run/top_level_await_loop/top_level_await/tla2/b.js deleted file mode 100644 index 68e357c1e9..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/tla2/b.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Bar { - constructor(message) { - this.message = message; - } -} diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla3/b.js b/tests/specs/run/top_level_await_loop/top_level_await/tla3/b.js deleted file mode 100644 index d0349545e9..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/tla3/b.js +++ /dev/null @@ -1,7 +0,0 @@ -import { foo } from "./timeout_loop.js"; -import { collection } from "../circular.js"; - -console.log("collection in b", collection); -console.log("foo in b", foo); - -export const a = "a"; diff --git a/tests/specs/run/top_level_await_loop/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_await_loop/top_level_await/tla3/timeout_loop.js deleted file mode 100644 index 860e6cd2ae..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/tla3/timeout_loop.js +++ /dev/null @@ -1,23 +0,0 @@ -export const foo = "foo"; - -export function delay(ms) { - return new Promise((res) => - setTimeout(() => { - res(); - }, ms) - ); -} - -let i = 0; - -async function timeoutLoop() { - await delay(1000); - console.log("timeout loop", i); - i++; - if (i > 5) { - return; - } - timeoutLoop(); -} - -timeoutLoop(); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.js b/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.js deleted file mode 100644 index ea319ea124..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.js +++ /dev/null @@ -1,3 +0,0 @@ -const buf = await Deno.readFile("./assets/hello.txt"); -const n = await Deno.stdout.write(buf); -console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.out b/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.out deleted file mode 100644 index 4b65d15fe3..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.out +++ /dev/null @@ -1,3 +0,0 @@ -Hello world! - -write 12 diff --git a/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.ts b/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.ts deleted file mode 100644 index 8d47ceb21e..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/top_level_await.ts +++ /dev/null @@ -1,3 +0,0 @@ -const buf: Uint8Array = await Deno.readFile("./assets/hello.txt"); -const n: number = await Deno.stdout.write(buf); -console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.js deleted file mode 100644 index a330f6c711..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.js +++ /dev/null @@ -1,10 +0,0 @@ -function* asyncGenerator() { - let i = 0; - while (i < 3) { - yield i++; - } -} - -for await (const num of asyncGenerator()) { - console.log(num); -} diff --git a/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.out deleted file mode 100644 index 4539bbf2d2..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.out +++ /dev/null @@ -1,3 +0,0 @@ -0 -1 -2 diff --git a/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.ts deleted file mode 100644 index 9179322d78..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/top_level_for_await.ts +++ /dev/null @@ -1,10 +0,0 @@ -async function* asyncGenerator(): AsyncIterableIterator { - let i = 0; - while (i < 3) { - yield i++; - } -} - -for await (const num of asyncGenerator()) { - console.log(num); -} diff --git a/tests/specs/run/top_level_await_loop/top_level_await/unresolved.js b/tests/specs/run/top_level_await_loop/top_level_await/unresolved.js deleted file mode 100644 index 231a8cd634..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/unresolved.js +++ /dev/null @@ -1 +0,0 @@ -await new Promise(() => {}); diff --git a/tests/specs/run/top_level_await_loop/top_level_await/unresolved.out b/tests/specs/run/top_level_await_loop/top_level_await/unresolved.out deleted file mode 100644 index 1f4ea5d382..0000000000 --- a/tests/specs/run/top_level_await_loop/top_level_await/unresolved.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Top-level await promise never resolved -await new Promise(() => {}); -^ - at ([WILDCARD]top_level_await/unresolved.js:1:1) diff --git a/tests/specs/run/top_level_await_nested/__test__.jsonc b/tests/specs/run/top_level_await_nested/__test__.jsonc deleted file mode 100644 index 376180ecdc..0000000000 --- a/tests/specs/run/top_level_await_nested/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-read top_level_await/nested/main.js", - "output": "top_level_await/nested.out" -} diff --git a/tests/specs/run/top_level_await_nested/top_level_await/circular.js b/tests/specs/run/top_level_await_nested/top_level_await/circular.js deleted file mode 100644 index ff2964b6a5..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/circular.js +++ /dev/null @@ -1,8 +0,0 @@ -import { foo } from "./tla3/timeout_loop.js"; - -export const collection = []; - -const mod = await import("./tla3/b.js"); - -console.log("foo in main", foo); -console.log("mod", mod); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/circular.out b/tests/specs/run/top_level_await_nested/top_level_await/circular.out deleted file mode 100644 index c889789613..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/circular.out +++ /dev/null @@ -1,10 +0,0 @@ -timeout loop 0 -timeout loop 1 -timeout loop 2 -timeout loop 3 -timeout loop 4 -timeout loop 5 -error: Top-level await promise never resolved -const mod = await import("./tla3/b.js"); - ^ - at ([WILDCARD]/top_level_await/circular.js:5:13) diff --git a/tests/specs/run/top_level_await_nested/top_level_await/loop.js b/tests/specs/run/top_level_await_nested/top_level_await/loop.js deleted file mode 100644 index 415db5ec78..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/loop.js +++ /dev/null @@ -1,20 +0,0 @@ -const importsDir = Deno.readDirSync( - Deno.realPathSync("./run/top_level_await/tla2"), -); - -const resolvedPaths = []; - -for (const { name } of importsDir) { - const filePath = Deno.realPathSync(`./run/top_level_await/tla2/${name}`); - resolvedPaths.push(filePath); -} - -resolvedPaths.sort(); - -for (const filePath of resolvedPaths) { - console.log("loading", filePath); - const mod = await import(`file://${filePath}`); - console.log("loaded", mod); -} - -console.log("all loaded"); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/loop.out b/tests/specs/run/top_level_await_nested/top_level_await/loop.out deleted file mode 100644 index 1bdffbf660..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/loop.out +++ /dev/null @@ -1,5 +0,0 @@ -loading [WILDCARD]a.js -loaded [Module: null prototype] { default: [class Foo] } -loading [WILDCARD]b.js -loaded [Module: null prototype] { default: [class Bar] } -all loaded diff --git a/tests/specs/run/top_level_await_nested/top_level_await/nested.out b/tests/specs/run/top_level_await_nested/top_level_await/nested.out deleted file mode 100644 index 8a1218a102..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/nested.out +++ /dev/null @@ -1,5 +0,0 @@ -1 -2 -3 -4 -5 diff --git a/tests/specs/run/top_level_await_nested/top_level_await/nested/a.js b/tests/specs/run/top_level_await_nested/top_level_await/nested/a.js deleted file mode 100644 index 74837d4ba1..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/nested/a.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log(2); -await import("./b.js"); -console.log(4); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/nested/b.js b/tests/specs/run/top_level_await_nested/top_level_await/nested/b.js deleted file mode 100644 index 3bd241b50e..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/nested/b.js +++ /dev/null @@ -1 +0,0 @@ -console.log(3); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/nested/main.js b/tests/specs/run/top_level_await_nested/top_level_await/nested/main.js deleted file mode 100644 index ed46a47175..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/nested/main.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log(1); -await import("./a.js"); -console.log(5); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/order.js b/tests/specs/run/top_level_await_nested/top_level_await/order.js deleted file mode 100644 index 30659cdfbf..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/order.js +++ /dev/null @@ -1,21 +0,0 @@ -// Ported from Node -// https://github.com/nodejs/node/blob/54746bb763ebea0dc7e99d88ff4b379bcd680964/test/es-module/test-esm-tla.mjs - -const { default: order } = await import("./tla/parent.js"); - -console.log("order", JSON.stringify(order)); - -if ( - !( - order[0] === "order" && - order[1] === "b" && - order[2] === "c" && - order[3] === "d" && - order[4] === "a" && - order[5] === "parent" - ) -) { - throw new Error("TLA wrong order"); -} - -console.log("TLA order correct"); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/order.out b/tests/specs/run/top_level_await_nested/top_level_await/order.out deleted file mode 100644 index 4cc27858cf..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/order.out +++ /dev/null @@ -1,2 +0,0 @@ -order ["order","b","c","d","a","parent"] -TLA order correct diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla/a.js b/tests/specs/run/top_level_await_nested/top_level_await/tla/a.js deleted file mode 100644 index c3ef3f7dbc..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/tla/a.js +++ /dev/null @@ -1,3 +0,0 @@ -import order from "./order.js"; - -order.push("b"); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla/b.js b/tests/specs/run/top_level_await_nested/top_level_await/tla/b.js deleted file mode 100644 index 3271c92d8f..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/tla/b.js +++ /dev/null @@ -1,7 +0,0 @@ -import order from "./order.js"; - -await new Promise((resolve) => { - setTimeout(resolve, 200); -}); - -order.push("a"); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla/c.js b/tests/specs/run/top_level_await_nested/top_level_await/tla/c.js deleted file mode 100644 index 806eb0a8be..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/tla/c.js +++ /dev/null @@ -1,3 +0,0 @@ -import order from "./order.js"; - -order.push("c"); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla/d.js b/tests/specs/run/top_level_await_nested/top_level_await/tla/d.js deleted file mode 100644 index 283ebf817f..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/tla/d.js +++ /dev/null @@ -1,8 +0,0 @@ -import order from "./order.js"; - -const end = Date.now() + 500; -while (end < Date.now()) { - // pass -} - -order.push("d"); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla/order.js b/tests/specs/run/top_level_await_nested/top_level_await/tla/order.js deleted file mode 100644 index f213a562ce..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/tla/order.js +++ /dev/null @@ -1 +0,0 @@ -export default ["order"]; diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla/parent.js b/tests/specs/run/top_level_await_nested/top_level_await/tla/parent.js deleted file mode 100644 index 1ecc154634..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/tla/parent.js +++ /dev/null @@ -1,9 +0,0 @@ -import order from "./order.js"; -import "./a.js"; -import "./b.js"; -import "./c.js"; -import "./d.js"; - -order.push("parent"); - -export default order; diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla2/a.js b/tests/specs/run/top_level_await_nested/top_level_await/tla2/a.js deleted file mode 100644 index d07bcb94db..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/tla2/a.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Foo { - constructor(message) { - this.message = message; - } -} diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla2/b.js b/tests/specs/run/top_level_await_nested/top_level_await/tla2/b.js deleted file mode 100644 index 68e357c1e9..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/tla2/b.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Bar { - constructor(message) { - this.message = message; - } -} diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla3/b.js b/tests/specs/run/top_level_await_nested/top_level_await/tla3/b.js deleted file mode 100644 index d0349545e9..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/tla3/b.js +++ /dev/null @@ -1,7 +0,0 @@ -import { foo } from "./timeout_loop.js"; -import { collection } from "../circular.js"; - -console.log("collection in b", collection); -console.log("foo in b", foo); - -export const a = "a"; diff --git a/tests/specs/run/top_level_await_nested/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_await_nested/top_level_await/tla3/timeout_loop.js deleted file mode 100644 index 860e6cd2ae..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/tla3/timeout_loop.js +++ /dev/null @@ -1,23 +0,0 @@ -export const foo = "foo"; - -export function delay(ms) { - return new Promise((res) => - setTimeout(() => { - res(); - }, ms) - ); -} - -let i = 0; - -async function timeoutLoop() { - await delay(1000); - console.log("timeout loop", i); - i++; - if (i > 5) { - return; - } - timeoutLoop(); -} - -timeoutLoop(); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.js b/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.js deleted file mode 100644 index ea319ea124..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.js +++ /dev/null @@ -1,3 +0,0 @@ -const buf = await Deno.readFile("./assets/hello.txt"); -const n = await Deno.stdout.write(buf); -console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.out b/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.out deleted file mode 100644 index 4b65d15fe3..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.out +++ /dev/null @@ -1,3 +0,0 @@ -Hello world! - -write 12 diff --git a/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.ts b/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.ts deleted file mode 100644 index 8d47ceb21e..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/top_level_await.ts +++ /dev/null @@ -1,3 +0,0 @@ -const buf: Uint8Array = await Deno.readFile("./assets/hello.txt"); -const n: number = await Deno.stdout.write(buf); -console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.js deleted file mode 100644 index a330f6c711..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.js +++ /dev/null @@ -1,10 +0,0 @@ -function* asyncGenerator() { - let i = 0; - while (i < 3) { - yield i++; - } -} - -for await (const num of asyncGenerator()) { - console.log(num); -} diff --git a/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.out deleted file mode 100644 index 4539bbf2d2..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.out +++ /dev/null @@ -1,3 +0,0 @@ -0 -1 -2 diff --git a/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.ts deleted file mode 100644 index 9179322d78..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/top_level_for_await.ts +++ /dev/null @@ -1,10 +0,0 @@ -async function* asyncGenerator(): AsyncIterableIterator { - let i = 0; - while (i < 3) { - yield i++; - } -} - -for await (const num of asyncGenerator()) { - console.log(num); -} diff --git a/tests/specs/run/top_level_await_nested/top_level_await/unresolved.js b/tests/specs/run/top_level_await_nested/top_level_await/unresolved.js deleted file mode 100644 index 231a8cd634..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/unresolved.js +++ /dev/null @@ -1 +0,0 @@ -await new Promise(() => {}); diff --git a/tests/specs/run/top_level_await_nested/top_level_await/unresolved.out b/tests/specs/run/top_level_await_nested/top_level_await/unresolved.out deleted file mode 100644 index 1f4ea5d382..0000000000 --- a/tests/specs/run/top_level_await_nested/top_level_await/unresolved.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Top-level await promise never resolved -await new Promise(() => {}); -^ - at ([WILDCARD]top_level_await/unresolved.js:1:1) diff --git a/tests/specs/run/top_level_await_order/__test__.jsonc b/tests/specs/run/top_level_await_order/__test__.jsonc deleted file mode 100644 index 65d00d607d..0000000000 --- a/tests/specs/run/top_level_await_order/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-read top_level_await/order.js", - "output": "top_level_await/order.out" -} diff --git a/tests/specs/run/top_level_await_order/top_level_await/circular.js b/tests/specs/run/top_level_await_order/top_level_await/circular.js deleted file mode 100644 index ff2964b6a5..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/circular.js +++ /dev/null @@ -1,8 +0,0 @@ -import { foo } from "./tla3/timeout_loop.js"; - -export const collection = []; - -const mod = await import("./tla3/b.js"); - -console.log("foo in main", foo); -console.log("mod", mod); diff --git a/tests/specs/run/top_level_await_order/top_level_await/circular.out b/tests/specs/run/top_level_await_order/top_level_await/circular.out deleted file mode 100644 index c889789613..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/circular.out +++ /dev/null @@ -1,10 +0,0 @@ -timeout loop 0 -timeout loop 1 -timeout loop 2 -timeout loop 3 -timeout loop 4 -timeout loop 5 -error: Top-level await promise never resolved -const mod = await import("./tla3/b.js"); - ^ - at ([WILDCARD]/top_level_await/circular.js:5:13) diff --git a/tests/specs/run/top_level_await_order/top_level_await/loop.js b/tests/specs/run/top_level_await_order/top_level_await/loop.js deleted file mode 100644 index 415db5ec78..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/loop.js +++ /dev/null @@ -1,20 +0,0 @@ -const importsDir = Deno.readDirSync( - Deno.realPathSync("./run/top_level_await/tla2"), -); - -const resolvedPaths = []; - -for (const { name } of importsDir) { - const filePath = Deno.realPathSync(`./run/top_level_await/tla2/${name}`); - resolvedPaths.push(filePath); -} - -resolvedPaths.sort(); - -for (const filePath of resolvedPaths) { - console.log("loading", filePath); - const mod = await import(`file://${filePath}`); - console.log("loaded", mod); -} - -console.log("all loaded"); diff --git a/tests/specs/run/top_level_await_order/top_level_await/loop.out b/tests/specs/run/top_level_await_order/top_level_await/loop.out deleted file mode 100644 index 1bdffbf660..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/loop.out +++ /dev/null @@ -1,5 +0,0 @@ -loading [WILDCARD]a.js -loaded [Module: null prototype] { default: [class Foo] } -loading [WILDCARD]b.js -loaded [Module: null prototype] { default: [class Bar] } -all loaded diff --git a/tests/specs/run/top_level_await_order/top_level_await/nested.out b/tests/specs/run/top_level_await_order/top_level_await/nested.out deleted file mode 100644 index 8a1218a102..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/nested.out +++ /dev/null @@ -1,5 +0,0 @@ -1 -2 -3 -4 -5 diff --git a/tests/specs/run/top_level_await_order/top_level_await/nested/a.js b/tests/specs/run/top_level_await_order/top_level_await/nested/a.js deleted file mode 100644 index 74837d4ba1..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/nested/a.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log(2); -await import("./b.js"); -console.log(4); diff --git a/tests/specs/run/top_level_await_order/top_level_await/nested/b.js b/tests/specs/run/top_level_await_order/top_level_await/nested/b.js deleted file mode 100644 index 3bd241b50e..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/nested/b.js +++ /dev/null @@ -1 +0,0 @@ -console.log(3); diff --git a/tests/specs/run/top_level_await_order/top_level_await/nested/main.js b/tests/specs/run/top_level_await_order/top_level_await/nested/main.js deleted file mode 100644 index ed46a47175..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/nested/main.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log(1); -await import("./a.js"); -console.log(5); diff --git a/tests/specs/run/top_level_await_order/top_level_await/order.js b/tests/specs/run/top_level_await_order/top_level_await/order.js deleted file mode 100644 index 30659cdfbf..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/order.js +++ /dev/null @@ -1,21 +0,0 @@ -// Ported from Node -// https://github.com/nodejs/node/blob/54746bb763ebea0dc7e99d88ff4b379bcd680964/test/es-module/test-esm-tla.mjs - -const { default: order } = await import("./tla/parent.js"); - -console.log("order", JSON.stringify(order)); - -if ( - !( - order[0] === "order" && - order[1] === "b" && - order[2] === "c" && - order[3] === "d" && - order[4] === "a" && - order[5] === "parent" - ) -) { - throw new Error("TLA wrong order"); -} - -console.log("TLA order correct"); diff --git a/tests/specs/run/top_level_await_order/top_level_await/order.out b/tests/specs/run/top_level_await_order/top_level_await/order.out deleted file mode 100644 index 4cc27858cf..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/order.out +++ /dev/null @@ -1,2 +0,0 @@ -order ["order","b","c","d","a","parent"] -TLA order correct diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla/a.js b/tests/specs/run/top_level_await_order/top_level_await/tla/a.js deleted file mode 100644 index c3ef3f7dbc..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/tla/a.js +++ /dev/null @@ -1,3 +0,0 @@ -import order from "./order.js"; - -order.push("b"); diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla/b.js b/tests/specs/run/top_level_await_order/top_level_await/tla/b.js deleted file mode 100644 index 3271c92d8f..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/tla/b.js +++ /dev/null @@ -1,7 +0,0 @@ -import order from "./order.js"; - -await new Promise((resolve) => { - setTimeout(resolve, 200); -}); - -order.push("a"); diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla/c.js b/tests/specs/run/top_level_await_order/top_level_await/tla/c.js deleted file mode 100644 index 806eb0a8be..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/tla/c.js +++ /dev/null @@ -1,3 +0,0 @@ -import order from "./order.js"; - -order.push("c"); diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla/d.js b/tests/specs/run/top_level_await_order/top_level_await/tla/d.js deleted file mode 100644 index 283ebf817f..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/tla/d.js +++ /dev/null @@ -1,8 +0,0 @@ -import order from "./order.js"; - -const end = Date.now() + 500; -while (end < Date.now()) { - // pass -} - -order.push("d"); diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla/order.js b/tests/specs/run/top_level_await_order/top_level_await/tla/order.js deleted file mode 100644 index f213a562ce..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/tla/order.js +++ /dev/null @@ -1 +0,0 @@ -export default ["order"]; diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla/parent.js b/tests/specs/run/top_level_await_order/top_level_await/tla/parent.js deleted file mode 100644 index 1ecc154634..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/tla/parent.js +++ /dev/null @@ -1,9 +0,0 @@ -import order from "./order.js"; -import "./a.js"; -import "./b.js"; -import "./c.js"; -import "./d.js"; - -order.push("parent"); - -export default order; diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla2/a.js b/tests/specs/run/top_level_await_order/top_level_await/tla2/a.js deleted file mode 100644 index d07bcb94db..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/tla2/a.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Foo { - constructor(message) { - this.message = message; - } -} diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla2/b.js b/tests/specs/run/top_level_await_order/top_level_await/tla2/b.js deleted file mode 100644 index 68e357c1e9..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/tla2/b.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Bar { - constructor(message) { - this.message = message; - } -} diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla3/b.js b/tests/specs/run/top_level_await_order/top_level_await/tla3/b.js deleted file mode 100644 index d0349545e9..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/tla3/b.js +++ /dev/null @@ -1,7 +0,0 @@ -import { foo } from "./timeout_loop.js"; -import { collection } from "../circular.js"; - -console.log("collection in b", collection); -console.log("foo in b", foo); - -export const a = "a"; diff --git a/tests/specs/run/top_level_await_order/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_await_order/top_level_await/tla3/timeout_loop.js deleted file mode 100644 index 860e6cd2ae..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/tla3/timeout_loop.js +++ /dev/null @@ -1,23 +0,0 @@ -export const foo = "foo"; - -export function delay(ms) { - return new Promise((res) => - setTimeout(() => { - res(); - }, ms) - ); -} - -let i = 0; - -async function timeoutLoop() { - await delay(1000); - console.log("timeout loop", i); - i++; - if (i > 5) { - return; - } - timeoutLoop(); -} - -timeoutLoop(); diff --git a/tests/specs/run/top_level_await_order/top_level_await/top_level_await.js b/tests/specs/run/top_level_await_order/top_level_await/top_level_await.js deleted file mode 100644 index ea319ea124..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/top_level_await.js +++ /dev/null @@ -1,3 +0,0 @@ -const buf = await Deno.readFile("./assets/hello.txt"); -const n = await Deno.stdout.write(buf); -console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_order/top_level_await/top_level_await.out b/tests/specs/run/top_level_await_order/top_level_await/top_level_await.out deleted file mode 100644 index 4b65d15fe3..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/top_level_await.out +++ /dev/null @@ -1,3 +0,0 @@ -Hello world! - -write 12 diff --git a/tests/specs/run/top_level_await_order/top_level_await/top_level_await.ts b/tests/specs/run/top_level_await_order/top_level_await/top_level_await.ts deleted file mode 100644 index 8d47ceb21e..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/top_level_await.ts +++ /dev/null @@ -1,3 +0,0 @@ -const buf: Uint8Array = await Deno.readFile("./assets/hello.txt"); -const n: number = await Deno.stdout.write(buf); -console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.js deleted file mode 100644 index a330f6c711..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.js +++ /dev/null @@ -1,10 +0,0 @@ -function* asyncGenerator() { - let i = 0; - while (i < 3) { - yield i++; - } -} - -for await (const num of asyncGenerator()) { - console.log(num); -} diff --git a/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.out deleted file mode 100644 index 4539bbf2d2..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.out +++ /dev/null @@ -1,3 +0,0 @@ -0 -1 -2 diff --git a/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.ts deleted file mode 100644 index 9179322d78..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/top_level_for_await.ts +++ /dev/null @@ -1,10 +0,0 @@ -async function* asyncGenerator(): AsyncIterableIterator { - let i = 0; - while (i < 3) { - yield i++; - } -} - -for await (const num of asyncGenerator()) { - console.log(num); -} diff --git a/tests/specs/run/top_level_await_order/top_level_await/unresolved.js b/tests/specs/run/top_level_await_order/top_level_await/unresolved.js deleted file mode 100644 index 231a8cd634..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/unresolved.js +++ /dev/null @@ -1 +0,0 @@ -await new Promise(() => {}); diff --git a/tests/specs/run/top_level_await_order/top_level_await/unresolved.out b/tests/specs/run/top_level_await_order/top_level_await/unresolved.out deleted file mode 100644 index 1f4ea5d382..0000000000 --- a/tests/specs/run/top_level_await_order/top_level_await/unresolved.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Top-level await promise never resolved -await new Promise(() => {}); -^ - at ([WILDCARD]top_level_await/unresolved.js:1:1) diff --git a/tests/specs/run/top_level_await_ts/__test__.jsonc b/tests/specs/run/top_level_await_ts/__test__.jsonc deleted file mode 100644 index 15f937df19..0000000000 --- a/tests/specs/run/top_level_await_ts/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --quiet --allow-read top_level_await/top_level_await.ts", - "output": "top_level_await/top_level_await.out" -} diff --git a/tests/specs/run/top_level_await_ts/hello.txt b/tests/specs/run/top_level_await_ts/hello.txt deleted file mode 100644 index 6769dd60bd..0000000000 --- a/tests/specs/run/top_level_await_ts/hello.txt +++ /dev/null @@ -1 +0,0 @@ -Hello world! \ No newline at end of file diff --git a/tests/specs/run/top_level_await_ts/top_level_await/circular.js b/tests/specs/run/top_level_await_ts/top_level_await/circular.js deleted file mode 100644 index ff2964b6a5..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/circular.js +++ /dev/null @@ -1,8 +0,0 @@ -import { foo } from "./tla3/timeout_loop.js"; - -export const collection = []; - -const mod = await import("./tla3/b.js"); - -console.log("foo in main", foo); -console.log("mod", mod); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/circular.out b/tests/specs/run/top_level_await_ts/top_level_await/circular.out deleted file mode 100644 index c889789613..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/circular.out +++ /dev/null @@ -1,10 +0,0 @@ -timeout loop 0 -timeout loop 1 -timeout loop 2 -timeout loop 3 -timeout loop 4 -timeout loop 5 -error: Top-level await promise never resolved -const mod = await import("./tla3/b.js"); - ^ - at ([WILDCARD]/top_level_await/circular.js:5:13) diff --git a/tests/specs/run/top_level_await_ts/top_level_await/loop.js b/tests/specs/run/top_level_await_ts/top_level_await/loop.js deleted file mode 100644 index 415db5ec78..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/loop.js +++ /dev/null @@ -1,20 +0,0 @@ -const importsDir = Deno.readDirSync( - Deno.realPathSync("./run/top_level_await/tla2"), -); - -const resolvedPaths = []; - -for (const { name } of importsDir) { - const filePath = Deno.realPathSync(`./run/top_level_await/tla2/${name}`); - resolvedPaths.push(filePath); -} - -resolvedPaths.sort(); - -for (const filePath of resolvedPaths) { - console.log("loading", filePath); - const mod = await import(`file://${filePath}`); - console.log("loaded", mod); -} - -console.log("all loaded"); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/loop.out b/tests/specs/run/top_level_await_ts/top_level_await/loop.out deleted file mode 100644 index 1bdffbf660..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/loop.out +++ /dev/null @@ -1,5 +0,0 @@ -loading [WILDCARD]a.js -loaded [Module: null prototype] { default: [class Foo] } -loading [WILDCARD]b.js -loaded [Module: null prototype] { default: [class Bar] } -all loaded diff --git a/tests/specs/run/top_level_await_ts/top_level_await/nested.out b/tests/specs/run/top_level_await_ts/top_level_await/nested.out deleted file mode 100644 index 8a1218a102..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/nested.out +++ /dev/null @@ -1,5 +0,0 @@ -1 -2 -3 -4 -5 diff --git a/tests/specs/run/top_level_await_ts/top_level_await/nested/a.js b/tests/specs/run/top_level_await_ts/top_level_await/nested/a.js deleted file mode 100644 index 74837d4ba1..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/nested/a.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log(2); -await import("./b.js"); -console.log(4); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/nested/b.js b/tests/specs/run/top_level_await_ts/top_level_await/nested/b.js deleted file mode 100644 index 3bd241b50e..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/nested/b.js +++ /dev/null @@ -1 +0,0 @@ -console.log(3); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/nested/main.js b/tests/specs/run/top_level_await_ts/top_level_await/nested/main.js deleted file mode 100644 index ed46a47175..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/nested/main.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log(1); -await import("./a.js"); -console.log(5); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/order.js b/tests/specs/run/top_level_await_ts/top_level_await/order.js deleted file mode 100644 index 30659cdfbf..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/order.js +++ /dev/null @@ -1,21 +0,0 @@ -// Ported from Node -// https://github.com/nodejs/node/blob/54746bb763ebea0dc7e99d88ff4b379bcd680964/test/es-module/test-esm-tla.mjs - -const { default: order } = await import("./tla/parent.js"); - -console.log("order", JSON.stringify(order)); - -if ( - !( - order[0] === "order" && - order[1] === "b" && - order[2] === "c" && - order[3] === "d" && - order[4] === "a" && - order[5] === "parent" - ) -) { - throw new Error("TLA wrong order"); -} - -console.log("TLA order correct"); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/order.out b/tests/specs/run/top_level_await_ts/top_level_await/order.out deleted file mode 100644 index 4cc27858cf..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/order.out +++ /dev/null @@ -1,2 +0,0 @@ -order ["order","b","c","d","a","parent"] -TLA order correct diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla/a.js b/tests/specs/run/top_level_await_ts/top_level_await/tla/a.js deleted file mode 100644 index c3ef3f7dbc..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/tla/a.js +++ /dev/null @@ -1,3 +0,0 @@ -import order from "./order.js"; - -order.push("b"); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla/b.js b/tests/specs/run/top_level_await_ts/top_level_await/tla/b.js deleted file mode 100644 index 3271c92d8f..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/tla/b.js +++ /dev/null @@ -1,7 +0,0 @@ -import order from "./order.js"; - -await new Promise((resolve) => { - setTimeout(resolve, 200); -}); - -order.push("a"); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla/c.js b/tests/specs/run/top_level_await_ts/top_level_await/tla/c.js deleted file mode 100644 index 806eb0a8be..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/tla/c.js +++ /dev/null @@ -1,3 +0,0 @@ -import order from "./order.js"; - -order.push("c"); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla/d.js b/tests/specs/run/top_level_await_ts/top_level_await/tla/d.js deleted file mode 100644 index 283ebf817f..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/tla/d.js +++ /dev/null @@ -1,8 +0,0 @@ -import order from "./order.js"; - -const end = Date.now() + 500; -while (end < Date.now()) { - // pass -} - -order.push("d"); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla/order.js b/tests/specs/run/top_level_await_ts/top_level_await/tla/order.js deleted file mode 100644 index f213a562ce..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/tla/order.js +++ /dev/null @@ -1 +0,0 @@ -export default ["order"]; diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla/parent.js b/tests/specs/run/top_level_await_ts/top_level_await/tla/parent.js deleted file mode 100644 index 1ecc154634..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/tla/parent.js +++ /dev/null @@ -1,9 +0,0 @@ -import order from "./order.js"; -import "./a.js"; -import "./b.js"; -import "./c.js"; -import "./d.js"; - -order.push("parent"); - -export default order; diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla2/a.js b/tests/specs/run/top_level_await_ts/top_level_await/tla2/a.js deleted file mode 100644 index d07bcb94db..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/tla2/a.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Foo { - constructor(message) { - this.message = message; - } -} diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla2/b.js b/tests/specs/run/top_level_await_ts/top_level_await/tla2/b.js deleted file mode 100644 index 68e357c1e9..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/tla2/b.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Bar { - constructor(message) { - this.message = message; - } -} diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla3/b.js b/tests/specs/run/top_level_await_ts/top_level_await/tla3/b.js deleted file mode 100644 index d0349545e9..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/tla3/b.js +++ /dev/null @@ -1,7 +0,0 @@ -import { foo } from "./timeout_loop.js"; -import { collection } from "../circular.js"; - -console.log("collection in b", collection); -console.log("foo in b", foo); - -export const a = "a"; diff --git a/tests/specs/run/top_level_await_ts/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_await_ts/top_level_await/tla3/timeout_loop.js deleted file mode 100644 index 860e6cd2ae..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/tla3/timeout_loop.js +++ /dev/null @@ -1,23 +0,0 @@ -export const foo = "foo"; - -export function delay(ms) { - return new Promise((res) => - setTimeout(() => { - res(); - }, ms) - ); -} - -let i = 0; - -async function timeoutLoop() { - await delay(1000); - console.log("timeout loop", i); - i++; - if (i > 5) { - return; - } - timeoutLoop(); -} - -timeoutLoop(); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/top_level_await.js b/tests/specs/run/top_level_await_ts/top_level_await/top_level_await.js deleted file mode 100644 index ea319ea124..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/top_level_await.js +++ /dev/null @@ -1,3 +0,0 @@ -const buf = await Deno.readFile("./assets/hello.txt"); -const n = await Deno.stdout.write(buf); -console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/top_level_await.out b/tests/specs/run/top_level_await_ts/top_level_await/top_level_await.out deleted file mode 100644 index 4b65d15fe3..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/top_level_await.out +++ /dev/null @@ -1,3 +0,0 @@ -Hello world! - -write 12 diff --git a/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.js deleted file mode 100644 index a330f6c711..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.js +++ /dev/null @@ -1,10 +0,0 @@ -function* asyncGenerator() { - let i = 0; - while (i < 3) { - yield i++; - } -} - -for await (const num of asyncGenerator()) { - console.log(num); -} diff --git a/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.out deleted file mode 100644 index 4539bbf2d2..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.out +++ /dev/null @@ -1,3 +0,0 @@ -0 -1 -2 diff --git a/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.ts deleted file mode 100644 index 9179322d78..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/top_level_for_await.ts +++ /dev/null @@ -1,10 +0,0 @@ -async function* asyncGenerator(): AsyncIterableIterator { - let i = 0; - while (i < 3) { - yield i++; - } -} - -for await (const num of asyncGenerator()) { - console.log(num); -} diff --git a/tests/specs/run/top_level_await_ts/top_level_await/unresolved.js b/tests/specs/run/top_level_await_ts/top_level_await/unresolved.js deleted file mode 100644 index 231a8cd634..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/unresolved.js +++ /dev/null @@ -1 +0,0 @@ -await new Promise(() => {}); diff --git a/tests/specs/run/top_level_await_ts/top_level_await/unresolved.out b/tests/specs/run/top_level_await_ts/top_level_await/unresolved.out deleted file mode 100644 index 1f4ea5d382..0000000000 --- a/tests/specs/run/top_level_await_ts/top_level_await/unresolved.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Top-level await promise never resolved -await new Promise(() => {}); -^ - at ([WILDCARD]top_level_await/unresolved.js:1:1) diff --git a/tests/specs/run/top_level_await_unresolved/__test__.jsonc b/tests/specs/run/top_level_await_unresolved/__test__.jsonc deleted file mode 100644 index a92774c1b8..0000000000 --- a/tests/specs/run/top_level_await_unresolved/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "run top_level_await/unresolved.js", - "output": "top_level_await/unresolved.out", - "exitCode": 1 -} diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/circular.js b/tests/specs/run/top_level_await_unresolved/top_level_await/circular.js deleted file mode 100644 index ff2964b6a5..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/circular.js +++ /dev/null @@ -1,8 +0,0 @@ -import { foo } from "./tla3/timeout_loop.js"; - -export const collection = []; - -const mod = await import("./tla3/b.js"); - -console.log("foo in main", foo); -console.log("mod", mod); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/circular.out b/tests/specs/run/top_level_await_unresolved/top_level_await/circular.out deleted file mode 100644 index c889789613..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/circular.out +++ /dev/null @@ -1,10 +0,0 @@ -timeout loop 0 -timeout loop 1 -timeout loop 2 -timeout loop 3 -timeout loop 4 -timeout loop 5 -error: Top-level await promise never resolved -const mod = await import("./tla3/b.js"); - ^ - at ([WILDCARD]/top_level_await/circular.js:5:13) diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/loop.js b/tests/specs/run/top_level_await_unresolved/top_level_await/loop.js deleted file mode 100644 index 415db5ec78..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/loop.js +++ /dev/null @@ -1,20 +0,0 @@ -const importsDir = Deno.readDirSync( - Deno.realPathSync("./run/top_level_await/tla2"), -); - -const resolvedPaths = []; - -for (const { name } of importsDir) { - const filePath = Deno.realPathSync(`./run/top_level_await/tla2/${name}`); - resolvedPaths.push(filePath); -} - -resolvedPaths.sort(); - -for (const filePath of resolvedPaths) { - console.log("loading", filePath); - const mod = await import(`file://${filePath}`); - console.log("loaded", mod); -} - -console.log("all loaded"); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/loop.out b/tests/specs/run/top_level_await_unresolved/top_level_await/loop.out deleted file mode 100644 index 1bdffbf660..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/loop.out +++ /dev/null @@ -1,5 +0,0 @@ -loading [WILDCARD]a.js -loaded [Module: null prototype] { default: [class Foo] } -loading [WILDCARD]b.js -loaded [Module: null prototype] { default: [class Bar] } -all loaded diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/nested.out b/tests/specs/run/top_level_await_unresolved/top_level_await/nested.out deleted file mode 100644 index 8a1218a102..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/nested.out +++ /dev/null @@ -1,5 +0,0 @@ -1 -2 -3 -4 -5 diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/nested/a.js b/tests/specs/run/top_level_await_unresolved/top_level_await/nested/a.js deleted file mode 100644 index 74837d4ba1..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/nested/a.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log(2); -await import("./b.js"); -console.log(4); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/nested/b.js b/tests/specs/run/top_level_await_unresolved/top_level_await/nested/b.js deleted file mode 100644 index 3bd241b50e..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/nested/b.js +++ /dev/null @@ -1 +0,0 @@ -console.log(3); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/nested/main.js b/tests/specs/run/top_level_await_unresolved/top_level_await/nested/main.js deleted file mode 100644 index ed46a47175..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/nested/main.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log(1); -await import("./a.js"); -console.log(5); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/order.js b/tests/specs/run/top_level_await_unresolved/top_level_await/order.js deleted file mode 100644 index 30659cdfbf..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/order.js +++ /dev/null @@ -1,21 +0,0 @@ -// Ported from Node -// https://github.com/nodejs/node/blob/54746bb763ebea0dc7e99d88ff4b379bcd680964/test/es-module/test-esm-tla.mjs - -const { default: order } = await import("./tla/parent.js"); - -console.log("order", JSON.stringify(order)); - -if ( - !( - order[0] === "order" && - order[1] === "b" && - order[2] === "c" && - order[3] === "d" && - order[4] === "a" && - order[5] === "parent" - ) -) { - throw new Error("TLA wrong order"); -} - -console.log("TLA order correct"); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/order.out b/tests/specs/run/top_level_await_unresolved/top_level_await/order.out deleted file mode 100644 index 4cc27858cf..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/order.out +++ /dev/null @@ -1,2 +0,0 @@ -order ["order","b","c","d","a","parent"] -TLA order correct diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/a.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/a.js deleted file mode 100644 index c3ef3f7dbc..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/a.js +++ /dev/null @@ -1,3 +0,0 @@ -import order from "./order.js"; - -order.push("b"); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/b.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/b.js deleted file mode 100644 index 3271c92d8f..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/b.js +++ /dev/null @@ -1,7 +0,0 @@ -import order from "./order.js"; - -await new Promise((resolve) => { - setTimeout(resolve, 200); -}); - -order.push("a"); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/c.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/c.js deleted file mode 100644 index 806eb0a8be..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/c.js +++ /dev/null @@ -1,3 +0,0 @@ -import order from "./order.js"; - -order.push("c"); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/d.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/d.js deleted file mode 100644 index 283ebf817f..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/d.js +++ /dev/null @@ -1,8 +0,0 @@ -import order from "./order.js"; - -const end = Date.now() + 500; -while (end < Date.now()) { - // pass -} - -order.push("d"); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/order.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/order.js deleted file mode 100644 index f213a562ce..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/order.js +++ /dev/null @@ -1 +0,0 @@ -export default ["order"]; diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/parent.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla/parent.js deleted file mode 100644 index 1ecc154634..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/tla/parent.js +++ /dev/null @@ -1,9 +0,0 @@ -import order from "./order.js"; -import "./a.js"; -import "./b.js"; -import "./c.js"; -import "./d.js"; - -order.push("parent"); - -export default order; diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla2/a.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla2/a.js deleted file mode 100644 index d07bcb94db..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/tla2/a.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Foo { - constructor(message) { - this.message = message; - } -} diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla2/b.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla2/b.js deleted file mode 100644 index 68e357c1e9..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/tla2/b.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Bar { - constructor(message) { - this.message = message; - } -} diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla3/b.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla3/b.js deleted file mode 100644 index d0349545e9..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/tla3/b.js +++ /dev/null @@ -1,7 +0,0 @@ -import { foo } from "./timeout_loop.js"; -import { collection } from "../circular.js"; - -console.log("collection in b", collection); -console.log("foo in b", foo); - -export const a = "a"; diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_await_unresolved/top_level_await/tla3/timeout_loop.js deleted file mode 100644 index 860e6cd2ae..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/tla3/timeout_loop.js +++ /dev/null @@ -1,23 +0,0 @@ -export const foo = "foo"; - -export function delay(ms) { - return new Promise((res) => - setTimeout(() => { - res(); - }, ms) - ); -} - -let i = 0; - -async function timeoutLoop() { - await delay(1000); - console.log("timeout loop", i); - i++; - if (i > 5) { - return; - } - timeoutLoop(); -} - -timeoutLoop(); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.js b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.js deleted file mode 100644 index ea319ea124..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.js +++ /dev/null @@ -1,3 +0,0 @@ -const buf = await Deno.readFile("./assets/hello.txt"); -const n = await Deno.stdout.write(buf); -console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.out b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.out deleted file mode 100644 index 4b65d15fe3..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.out +++ /dev/null @@ -1,3 +0,0 @@ -Hello world! - -write 12 diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.ts b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.ts deleted file mode 100644 index 8d47ceb21e..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_await.ts +++ /dev/null @@ -1,3 +0,0 @@ -const buf: Uint8Array = await Deno.readFile("./assets/hello.txt"); -const n: number = await Deno.stdout.write(buf); -console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.js deleted file mode 100644 index a330f6c711..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.js +++ /dev/null @@ -1,10 +0,0 @@ -function* asyncGenerator() { - let i = 0; - while (i < 3) { - yield i++; - } -} - -for await (const num of asyncGenerator()) { - console.log(num); -} diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.out deleted file mode 100644 index 4539bbf2d2..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.out +++ /dev/null @@ -1,3 +0,0 @@ -0 -1 -2 diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.ts deleted file mode 100644 index 9179322d78..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/top_level_for_await.ts +++ /dev/null @@ -1,10 +0,0 @@ -async function* asyncGenerator(): AsyncIterableIterator { - let i = 0; - while (i < 3) { - yield i++; - } -} - -for await (const num of asyncGenerator()) { - console.log(num); -} diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/unresolved.js b/tests/specs/run/top_level_await_unresolved/top_level_await/unresolved.js deleted file mode 100644 index 231a8cd634..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/unresolved.js +++ /dev/null @@ -1 +0,0 @@ -await new Promise(() => {}); diff --git a/tests/specs/run/top_level_await_unresolved/top_level_await/unresolved.out b/tests/specs/run/top_level_await_unresolved/top_level_await/unresolved.out deleted file mode 100644 index 1f4ea5d382..0000000000 --- a/tests/specs/run/top_level_await_unresolved/top_level_await/unresolved.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Top-level await promise never resolved -await new Promise(() => {}); -^ - at ([WILDCARD]top_level_await/unresolved.js:1:1) diff --git a/tests/specs/run/top_level_for_await/__test__.jsonc b/tests/specs/run/top_level_for_await/__test__.jsonc deleted file mode 100644 index 198008560b..0000000000 --- a/tests/specs/run/top_level_for_await/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --quiet top_level_await/top_level_for_await.js", - "output": "top_level_await/top_level_for_await.out" -} diff --git a/tests/specs/run/top_level_for_await/top_level_await/circular.js b/tests/specs/run/top_level_for_await/top_level_await/circular.js deleted file mode 100644 index ff2964b6a5..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/circular.js +++ /dev/null @@ -1,8 +0,0 @@ -import { foo } from "./tla3/timeout_loop.js"; - -export const collection = []; - -const mod = await import("./tla3/b.js"); - -console.log("foo in main", foo); -console.log("mod", mod); diff --git a/tests/specs/run/top_level_for_await/top_level_await/circular.out b/tests/specs/run/top_level_for_await/top_level_await/circular.out deleted file mode 100644 index c889789613..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/circular.out +++ /dev/null @@ -1,10 +0,0 @@ -timeout loop 0 -timeout loop 1 -timeout loop 2 -timeout loop 3 -timeout loop 4 -timeout loop 5 -error: Top-level await promise never resolved -const mod = await import("./tla3/b.js"); - ^ - at ([WILDCARD]/top_level_await/circular.js:5:13) diff --git a/tests/specs/run/top_level_for_await/top_level_await/loop.js b/tests/specs/run/top_level_for_await/top_level_await/loop.js deleted file mode 100644 index 415db5ec78..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/loop.js +++ /dev/null @@ -1,20 +0,0 @@ -const importsDir = Deno.readDirSync( - Deno.realPathSync("./run/top_level_await/tla2"), -); - -const resolvedPaths = []; - -for (const { name } of importsDir) { - const filePath = Deno.realPathSync(`./run/top_level_await/tla2/${name}`); - resolvedPaths.push(filePath); -} - -resolvedPaths.sort(); - -for (const filePath of resolvedPaths) { - console.log("loading", filePath); - const mod = await import(`file://${filePath}`); - console.log("loaded", mod); -} - -console.log("all loaded"); diff --git a/tests/specs/run/top_level_for_await/top_level_await/loop.out b/tests/specs/run/top_level_for_await/top_level_await/loop.out deleted file mode 100644 index 1bdffbf660..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/loop.out +++ /dev/null @@ -1,5 +0,0 @@ -loading [WILDCARD]a.js -loaded [Module: null prototype] { default: [class Foo] } -loading [WILDCARD]b.js -loaded [Module: null prototype] { default: [class Bar] } -all loaded diff --git a/tests/specs/run/top_level_for_await/top_level_await/nested.out b/tests/specs/run/top_level_for_await/top_level_await/nested.out deleted file mode 100644 index 8a1218a102..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/nested.out +++ /dev/null @@ -1,5 +0,0 @@ -1 -2 -3 -4 -5 diff --git a/tests/specs/run/top_level_for_await/top_level_await/nested/a.js b/tests/specs/run/top_level_for_await/top_level_await/nested/a.js deleted file mode 100644 index 74837d4ba1..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/nested/a.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log(2); -await import("./b.js"); -console.log(4); diff --git a/tests/specs/run/top_level_for_await/top_level_await/nested/b.js b/tests/specs/run/top_level_for_await/top_level_await/nested/b.js deleted file mode 100644 index 3bd241b50e..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/nested/b.js +++ /dev/null @@ -1 +0,0 @@ -console.log(3); diff --git a/tests/specs/run/top_level_for_await/top_level_await/nested/main.js b/tests/specs/run/top_level_for_await/top_level_await/nested/main.js deleted file mode 100644 index ed46a47175..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/nested/main.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log(1); -await import("./a.js"); -console.log(5); diff --git a/tests/specs/run/top_level_for_await/top_level_await/order.js b/tests/specs/run/top_level_for_await/top_level_await/order.js deleted file mode 100644 index 30659cdfbf..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/order.js +++ /dev/null @@ -1,21 +0,0 @@ -// Ported from Node -// https://github.com/nodejs/node/blob/54746bb763ebea0dc7e99d88ff4b379bcd680964/test/es-module/test-esm-tla.mjs - -const { default: order } = await import("./tla/parent.js"); - -console.log("order", JSON.stringify(order)); - -if ( - !( - order[0] === "order" && - order[1] === "b" && - order[2] === "c" && - order[3] === "d" && - order[4] === "a" && - order[5] === "parent" - ) -) { - throw new Error("TLA wrong order"); -} - -console.log("TLA order correct"); diff --git a/tests/specs/run/top_level_for_await/top_level_await/order.out b/tests/specs/run/top_level_for_await/top_level_await/order.out deleted file mode 100644 index 4cc27858cf..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/order.out +++ /dev/null @@ -1,2 +0,0 @@ -order ["order","b","c","d","a","parent"] -TLA order correct diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla/a.js b/tests/specs/run/top_level_for_await/top_level_await/tla/a.js deleted file mode 100644 index c3ef3f7dbc..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/tla/a.js +++ /dev/null @@ -1,3 +0,0 @@ -import order from "./order.js"; - -order.push("b"); diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla/b.js b/tests/specs/run/top_level_for_await/top_level_await/tla/b.js deleted file mode 100644 index 3271c92d8f..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/tla/b.js +++ /dev/null @@ -1,7 +0,0 @@ -import order from "./order.js"; - -await new Promise((resolve) => { - setTimeout(resolve, 200); -}); - -order.push("a"); diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla/c.js b/tests/specs/run/top_level_for_await/top_level_await/tla/c.js deleted file mode 100644 index 806eb0a8be..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/tla/c.js +++ /dev/null @@ -1,3 +0,0 @@ -import order from "./order.js"; - -order.push("c"); diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla/d.js b/tests/specs/run/top_level_for_await/top_level_await/tla/d.js deleted file mode 100644 index 283ebf817f..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/tla/d.js +++ /dev/null @@ -1,8 +0,0 @@ -import order from "./order.js"; - -const end = Date.now() + 500; -while (end < Date.now()) { - // pass -} - -order.push("d"); diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla/order.js b/tests/specs/run/top_level_for_await/top_level_await/tla/order.js deleted file mode 100644 index f213a562ce..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/tla/order.js +++ /dev/null @@ -1 +0,0 @@ -export default ["order"]; diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla/parent.js b/tests/specs/run/top_level_for_await/top_level_await/tla/parent.js deleted file mode 100644 index 1ecc154634..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/tla/parent.js +++ /dev/null @@ -1,9 +0,0 @@ -import order from "./order.js"; -import "./a.js"; -import "./b.js"; -import "./c.js"; -import "./d.js"; - -order.push("parent"); - -export default order; diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla2/a.js b/tests/specs/run/top_level_for_await/top_level_await/tla2/a.js deleted file mode 100644 index d07bcb94db..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/tla2/a.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Foo { - constructor(message) { - this.message = message; - } -} diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla2/b.js b/tests/specs/run/top_level_for_await/top_level_await/tla2/b.js deleted file mode 100644 index 68e357c1e9..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/tla2/b.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Bar { - constructor(message) { - this.message = message; - } -} diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla3/b.js b/tests/specs/run/top_level_for_await/top_level_await/tla3/b.js deleted file mode 100644 index d0349545e9..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/tla3/b.js +++ /dev/null @@ -1,7 +0,0 @@ -import { foo } from "./timeout_loop.js"; -import { collection } from "../circular.js"; - -console.log("collection in b", collection); -console.log("foo in b", foo); - -export const a = "a"; diff --git a/tests/specs/run/top_level_for_await/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_for_await/top_level_await/tla3/timeout_loop.js deleted file mode 100644 index 860e6cd2ae..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/tla3/timeout_loop.js +++ /dev/null @@ -1,23 +0,0 @@ -export const foo = "foo"; - -export function delay(ms) { - return new Promise((res) => - setTimeout(() => { - res(); - }, ms) - ); -} - -let i = 0; - -async function timeoutLoop() { - await delay(1000); - console.log("timeout loop", i); - i++; - if (i > 5) { - return; - } - timeoutLoop(); -} - -timeoutLoop(); diff --git a/tests/specs/run/top_level_for_await/top_level_await/top_level_await.js b/tests/specs/run/top_level_for_await/top_level_await/top_level_await.js deleted file mode 100644 index ea319ea124..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/top_level_await.js +++ /dev/null @@ -1,3 +0,0 @@ -const buf = await Deno.readFile("./assets/hello.txt"); -const n = await Deno.stdout.write(buf); -console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_for_await/top_level_await/top_level_await.out b/tests/specs/run/top_level_for_await/top_level_await/top_level_await.out deleted file mode 100644 index 4b65d15fe3..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/top_level_await.out +++ /dev/null @@ -1,3 +0,0 @@ -Hello world! - -write 12 diff --git a/tests/specs/run/top_level_for_await/top_level_await/top_level_await.ts b/tests/specs/run/top_level_for_await/top_level_await/top_level_await.ts deleted file mode 100644 index 8d47ceb21e..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/top_level_await.ts +++ /dev/null @@ -1,3 +0,0 @@ -const buf: Uint8Array = await Deno.readFile("./assets/hello.txt"); -const n: number = await Deno.stdout.write(buf); -console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.js deleted file mode 100644 index a330f6c711..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.js +++ /dev/null @@ -1,10 +0,0 @@ -function* asyncGenerator() { - let i = 0; - while (i < 3) { - yield i++; - } -} - -for await (const num of asyncGenerator()) { - console.log(num); -} diff --git a/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.out deleted file mode 100644 index 4539bbf2d2..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.out +++ /dev/null @@ -1,3 +0,0 @@ -0 -1 -2 diff --git a/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.ts deleted file mode 100644 index 9179322d78..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/top_level_for_await.ts +++ /dev/null @@ -1,10 +0,0 @@ -async function* asyncGenerator(): AsyncIterableIterator { - let i = 0; - while (i < 3) { - yield i++; - } -} - -for await (const num of asyncGenerator()) { - console.log(num); -} diff --git a/tests/specs/run/top_level_for_await/top_level_await/unresolved.js b/tests/specs/run/top_level_for_await/top_level_await/unresolved.js deleted file mode 100644 index 231a8cd634..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/unresolved.js +++ /dev/null @@ -1 +0,0 @@ -await new Promise(() => {}); diff --git a/tests/specs/run/top_level_for_await/top_level_await/unresolved.out b/tests/specs/run/top_level_for_await/top_level_await/unresolved.out deleted file mode 100644 index 1f4ea5d382..0000000000 --- a/tests/specs/run/top_level_for_await/top_level_await/unresolved.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Top-level await promise never resolved -await new Promise(() => {}); -^ - at ([WILDCARD]top_level_await/unresolved.js:1:1) diff --git a/tests/specs/run/top_level_for_await_ts/__test__.jsonc b/tests/specs/run/top_level_for_await_ts/__test__.jsonc deleted file mode 100644 index 22314e8e0d..0000000000 --- a/tests/specs/run/top_level_for_await_ts/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --quiet top_level_await/top_level_for_await.ts", - "output": "top_level_await/top_level_for_await.out" -} diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/circular.js b/tests/specs/run/top_level_for_await_ts/top_level_await/circular.js deleted file mode 100644 index ff2964b6a5..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/circular.js +++ /dev/null @@ -1,8 +0,0 @@ -import { foo } from "./tla3/timeout_loop.js"; - -export const collection = []; - -const mod = await import("./tla3/b.js"); - -console.log("foo in main", foo); -console.log("mod", mod); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/circular.out b/tests/specs/run/top_level_for_await_ts/top_level_await/circular.out deleted file mode 100644 index c889789613..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/circular.out +++ /dev/null @@ -1,10 +0,0 @@ -timeout loop 0 -timeout loop 1 -timeout loop 2 -timeout loop 3 -timeout loop 4 -timeout loop 5 -error: Top-level await promise never resolved -const mod = await import("./tla3/b.js"); - ^ - at ([WILDCARD]/top_level_await/circular.js:5:13) diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/loop.js b/tests/specs/run/top_level_for_await_ts/top_level_await/loop.js deleted file mode 100644 index 415db5ec78..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/loop.js +++ /dev/null @@ -1,20 +0,0 @@ -const importsDir = Deno.readDirSync( - Deno.realPathSync("./run/top_level_await/tla2"), -); - -const resolvedPaths = []; - -for (const { name } of importsDir) { - const filePath = Deno.realPathSync(`./run/top_level_await/tla2/${name}`); - resolvedPaths.push(filePath); -} - -resolvedPaths.sort(); - -for (const filePath of resolvedPaths) { - console.log("loading", filePath); - const mod = await import(`file://${filePath}`); - console.log("loaded", mod); -} - -console.log("all loaded"); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/loop.out b/tests/specs/run/top_level_for_await_ts/top_level_await/loop.out deleted file mode 100644 index 1bdffbf660..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/loop.out +++ /dev/null @@ -1,5 +0,0 @@ -loading [WILDCARD]a.js -loaded [Module: null prototype] { default: [class Foo] } -loading [WILDCARD]b.js -loaded [Module: null prototype] { default: [class Bar] } -all loaded diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/nested.out b/tests/specs/run/top_level_for_await_ts/top_level_await/nested.out deleted file mode 100644 index 8a1218a102..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/nested.out +++ /dev/null @@ -1,5 +0,0 @@ -1 -2 -3 -4 -5 diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/nested/a.js b/tests/specs/run/top_level_for_await_ts/top_level_await/nested/a.js deleted file mode 100644 index 74837d4ba1..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/nested/a.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log(2); -await import("./b.js"); -console.log(4); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/nested/b.js b/tests/specs/run/top_level_for_await_ts/top_level_await/nested/b.js deleted file mode 100644 index 3bd241b50e..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/nested/b.js +++ /dev/null @@ -1 +0,0 @@ -console.log(3); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/nested/main.js b/tests/specs/run/top_level_for_await_ts/top_level_await/nested/main.js deleted file mode 100644 index ed46a47175..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/nested/main.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log(1); -await import("./a.js"); -console.log(5); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/order.js b/tests/specs/run/top_level_for_await_ts/top_level_await/order.js deleted file mode 100644 index 30659cdfbf..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/order.js +++ /dev/null @@ -1,21 +0,0 @@ -// Ported from Node -// https://github.com/nodejs/node/blob/54746bb763ebea0dc7e99d88ff4b379bcd680964/test/es-module/test-esm-tla.mjs - -const { default: order } = await import("./tla/parent.js"); - -console.log("order", JSON.stringify(order)); - -if ( - !( - order[0] === "order" && - order[1] === "b" && - order[2] === "c" && - order[3] === "d" && - order[4] === "a" && - order[5] === "parent" - ) -) { - throw new Error("TLA wrong order"); -} - -console.log("TLA order correct"); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/order.out b/tests/specs/run/top_level_for_await_ts/top_level_await/order.out deleted file mode 100644 index 4cc27858cf..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/order.out +++ /dev/null @@ -1,2 +0,0 @@ -order ["order","b","c","d","a","parent"] -TLA order correct diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/a.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/a.js deleted file mode 100644 index c3ef3f7dbc..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/a.js +++ /dev/null @@ -1,3 +0,0 @@ -import order from "./order.js"; - -order.push("b"); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/b.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/b.js deleted file mode 100644 index 3271c92d8f..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/b.js +++ /dev/null @@ -1,7 +0,0 @@ -import order from "./order.js"; - -await new Promise((resolve) => { - setTimeout(resolve, 200); -}); - -order.push("a"); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/c.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/c.js deleted file mode 100644 index 806eb0a8be..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/c.js +++ /dev/null @@ -1,3 +0,0 @@ -import order from "./order.js"; - -order.push("c"); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/d.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/d.js deleted file mode 100644 index 283ebf817f..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/d.js +++ /dev/null @@ -1,8 +0,0 @@ -import order from "./order.js"; - -const end = Date.now() + 500; -while (end < Date.now()) { - // pass -} - -order.push("d"); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/order.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/order.js deleted file mode 100644 index f213a562ce..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/order.js +++ /dev/null @@ -1 +0,0 @@ -export default ["order"]; diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/parent.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla/parent.js deleted file mode 100644 index 1ecc154634..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/tla/parent.js +++ /dev/null @@ -1,9 +0,0 @@ -import order from "./order.js"; -import "./a.js"; -import "./b.js"; -import "./c.js"; -import "./d.js"; - -order.push("parent"); - -export default order; diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla2/a.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla2/a.js deleted file mode 100644 index d07bcb94db..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/tla2/a.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Foo { - constructor(message) { - this.message = message; - } -} diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla2/b.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla2/b.js deleted file mode 100644 index 68e357c1e9..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/tla2/b.js +++ /dev/null @@ -1,5 +0,0 @@ -export default class Bar { - constructor(message) { - this.message = message; - } -} diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla3/b.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla3/b.js deleted file mode 100644 index d0349545e9..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/tla3/b.js +++ /dev/null @@ -1,7 +0,0 @@ -import { foo } from "./timeout_loop.js"; -import { collection } from "../circular.js"; - -console.log("collection in b", collection); -console.log("foo in b", foo); - -export const a = "a"; diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/tla3/timeout_loop.js b/tests/specs/run/top_level_for_await_ts/top_level_await/tla3/timeout_loop.js deleted file mode 100644 index 860e6cd2ae..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/tla3/timeout_loop.js +++ /dev/null @@ -1,23 +0,0 @@ -export const foo = "foo"; - -export function delay(ms) { - return new Promise((res) => - setTimeout(() => { - res(); - }, ms) - ); -} - -let i = 0; - -async function timeoutLoop() { - await delay(1000); - console.log("timeout loop", i); - i++; - if (i > 5) { - return; - } - timeoutLoop(); -} - -timeoutLoop(); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.js b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.js deleted file mode 100644 index ea319ea124..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.js +++ /dev/null @@ -1,3 +0,0 @@ -const buf = await Deno.readFile("./assets/hello.txt"); -const n = await Deno.stdout.write(buf); -console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.out b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.out deleted file mode 100644 index 4b65d15fe3..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.out +++ /dev/null @@ -1,3 +0,0 @@ -Hello world! - -write 12 diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.ts b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.ts deleted file mode 100644 index 8d47ceb21e..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_await.ts +++ /dev/null @@ -1,3 +0,0 @@ -const buf: Uint8Array = await Deno.readFile("./assets/hello.txt"); -const n: number = await Deno.stdout.write(buf); -console.log(`\n\nwrite ${n}`); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.js deleted file mode 100644 index a330f6c711..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.js +++ /dev/null @@ -1,10 +0,0 @@ -function* asyncGenerator() { - let i = 0; - while (i < 3) { - yield i++; - } -} - -for await (const num of asyncGenerator()) { - console.log(num); -} diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.out deleted file mode 100644 index 4539bbf2d2..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.out +++ /dev/null @@ -1,3 +0,0 @@ -0 -1 -2 diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.ts b/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.ts deleted file mode 100644 index 9179322d78..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/top_level_for_await.ts +++ /dev/null @@ -1,10 +0,0 @@ -async function* asyncGenerator(): AsyncIterableIterator { - let i = 0; - while (i < 3) { - yield i++; - } -} - -for await (const num of asyncGenerator()) { - console.log(num); -} diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/unresolved.js b/tests/specs/run/top_level_for_await_ts/top_level_await/unresolved.js deleted file mode 100644 index 231a8cd634..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/unresolved.js +++ /dev/null @@ -1 +0,0 @@ -await new Promise(() => {}); diff --git a/tests/specs/run/top_level_for_await_ts/top_level_await/unresolved.out b/tests/specs/run/top_level_for_await_ts/top_level_await/unresolved.out deleted file mode 100644 index 1f4ea5d382..0000000000 --- a/tests/specs/run/top_level_for_await_ts/top_level_await/unresolved.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Top-level await promise never resolved -await new Promise(() => {}); -^ - at ([WILDCARD]top_level_await/unresolved.js:1:1) diff --git a/tests/specs/run/ts_decorators/__test__.jsonc b/tests/specs/run/ts_decorators/__test__.jsonc deleted file mode 100644 index 96e7cdf308..0000000000 --- a/tests/specs/run/ts_decorators/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --reload --check decorators/experimental/ts/main.ts", - "output": "decorators/experimental/ts/main.out" -} diff --git a/tests/specs/run/ts_decorators/decorators/experimental/deno.json b/tests/specs/run/ts_decorators/decorators/experimental/deno.json deleted file mode 100644 index 504cd646e1..0000000000 --- a/tests/specs/run/ts_decorators/decorators/experimental/deno.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "experimentalDecorators": true - } -} diff --git a/tests/specs/run/ts_decorators/decorators/experimental/no_check/main.out b/tests/specs/run/ts_decorators/decorators/experimental/no_check/main.out deleted file mode 100644 index 015f7076e8..0000000000 --- a/tests/specs/run/ts_decorators/decorators/experimental/no_check/main.out +++ /dev/null @@ -1,3 +0,0 @@ -a(): evaluated -a(): called -method diff --git a/tests/specs/run/ts_decorators/decorators/experimental/no_check/main.ts b/tests/specs/run/ts_decorators/decorators/experimental/no_check/main.ts deleted file mode 100644 index 9f7ec550d5..0000000000 --- a/tests/specs/run/ts_decorators/decorators/experimental/no_check/main.ts +++ /dev/null @@ -1,21 +0,0 @@ -// deno-lint-ignore-file -function a() { - console.log("a(): evaluated"); - return ( - _target: any, - _propertyKey: string, - _descriptor: PropertyDescriptor, - ) => { - console.log("a(): called"); - }; -} - -class B { - @a() - method() { - console.log("method"); - } -} - -const b = new B(); -b.method(); diff --git a/tests/specs/run/ts_decorators/decorators/experimental/runtime/main.out b/tests/specs/run/ts_decorators/decorators/experimental/runtime/main.out deleted file mode 100644 index 0fc1d4590e..0000000000 --- a/tests/specs/run/ts_decorators/decorators/experimental/runtime/main.out +++ /dev/null @@ -1,7 +0,0 @@ -@A evaluated -@B evaluated -@B called -@A called -fn() called from @A -fn() called from @B -C.test() called diff --git a/tests/specs/run/ts_decorators/decorators/experimental/runtime/main.ts b/tests/specs/run/ts_decorators/decorators/experimental/runtime/main.ts deleted file mode 100644 index 40a26bbd4d..0000000000 --- a/tests/specs/run/ts_decorators/decorators/experimental/runtime/main.ts +++ /dev/null @@ -1,42 +0,0 @@ -// deno-lint-ignore-file -function a() { - console.log("@A evaluated"); - return function ( - target: any, - propertyKey: string, - descriptor: PropertyDescriptor, - ) { - console.log("@A called"); - const fn = descriptor.value; - descriptor.value = function () { - console.log("fn() called from @A"); - fn(); - }; - }; -} - -function b() { - console.log("@B evaluated"); - return function ( - target: any, - propertyKey: string, - descriptor: PropertyDescriptor, - ) { - console.log("@B called"); - const fn = descriptor.value; - descriptor.value = function () { - console.log("fn() called from @B"); - fn(); - }; - }; -} - -class C { - @a() - @b() - static test() { - console.log("C.test() called"); - } -} - -C.test(); diff --git a/tests/specs/run/ts_decorators/decorators/experimental/ts/main.out b/tests/specs/run/ts_decorators/decorators/experimental/ts/main.out deleted file mode 100644 index ea64fbaa63..0000000000 --- a/tests/specs/run/ts_decorators/decorators/experimental/ts/main.out +++ /dev/null @@ -1,3 +0,0 @@ -Warning experimentalDecorators compiler option is deprecated and may be removed at any time -Check [WILDCARD] -SomeClass { someField: "asdf" } diff --git a/tests/specs/run/ts_decorators/decorators/experimental/ts/main.ts b/tests/specs/run/ts_decorators/decorators/experimental/ts/main.ts deleted file mode 100644 index 95fba6cd48..0000000000 --- a/tests/specs/run/ts_decorators/decorators/experimental/ts/main.ts +++ /dev/null @@ -1,14 +0,0 @@ -// deno-lint-ignore-file - -function Decorate() { - return function (constructor: any): any { - return class extends constructor { - protected someField: string = "asdf"; - }; - }; -} - -@Decorate() -class SomeClass {} - -console.log(new SomeClass()); diff --git a/tests/specs/run/ts_decorators/decorators/tc39_proposal/main.out b/tests/specs/run/ts_decorators/decorators/tc39_proposal/main.out deleted file mode 100644 index 39394952e8..0000000000 --- a/tests/specs/run/ts_decorators/decorators/tc39_proposal/main.out +++ /dev/null @@ -1,3 +0,0 @@ -starting m with arguments 1 -C.m 1 -ending m diff --git a/tests/specs/run/ts_decorators/decorators/tc39_proposal/main.ts b/tests/specs/run/ts_decorators/decorators/tc39_proposal/main.ts deleted file mode 100644 index 00c8a85025..0000000000 --- a/tests/specs/run/ts_decorators/decorators/tc39_proposal/main.ts +++ /dev/null @@ -1,21 +0,0 @@ -// deno-lint-ignore no-explicit-any -function logged(value: any, { kind, name }: { kind: string; name: string }) { - if (kind === "method") { - return function (...args: unknown[]) { - console.log(`starting ${name} with arguments ${args.join(", ")}`); - // @ts-ignore this has implicit any type - const ret = value.call(this, ...args); - console.log(`ending ${name}`); - return ret; - }; - } -} - -class C { - @logged - m(arg: number) { - console.log("C.m", arg); - } -} - -new C().m(1); diff --git a/tests/specs/run/unsafe_proto/__test__.jsonc b/tests/specs/run/unsafe_proto/__test__.jsonc index d1c608b515..88d13e7693 100644 --- a/tests/specs/run/unsafe_proto/__test__.jsonc +++ b/tests/specs/run/unsafe_proto/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run -A unsafe_proto/main.js", - "output": "unsafe_proto/main.out", + "args": "run -A main.js", + "output": "main.out", "exitCode": 0 } diff --git a/tests/specs/run/unsafe_proto/unsafe_proto/main.js b/tests/specs/run/unsafe_proto/main.js similarity index 100% rename from tests/specs/run/unsafe_proto/unsafe_proto/main.js rename to tests/specs/run/unsafe_proto/main.js diff --git a/tests/specs/run/unsafe_proto/unsafe_proto/main.out b/tests/specs/run/unsafe_proto/main.out similarity index 100% rename from tests/specs/run/unsafe_proto/unsafe_proto/main.out rename to tests/specs/run/unsafe_proto/main.out diff --git a/tests/specs/run/unsafe_proto/unsafe_proto/worker.js b/tests/specs/run/unsafe_proto/worker.js similarity index 100% rename from tests/specs/run/unsafe_proto/unsafe_proto/worker.js rename to tests/specs/run/unsafe_proto/worker.js diff --git a/tests/specs/run/unsafe_proto_flag/__test__.jsonc b/tests/specs/run/unsafe_proto_flag/__test__.jsonc index 8bd2b56ffc..db2918f1d8 100644 --- a/tests/specs/run/unsafe_proto_flag/__test__.jsonc +++ b/tests/specs/run/unsafe_proto_flag/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run -A --unstable-unsafe-proto unsafe_proto/main.js", - "output": "unsafe_proto/main_with_unsafe_proto_flag.out", + "args": "run -A --unstable-unsafe-proto main.js", + "output": "main_with_unsafe_proto_flag.out", "exitCode": 0 } diff --git a/tests/specs/run/unsafe_proto_flag/unsafe_proto/main.js b/tests/specs/run/unsafe_proto_flag/main.js similarity index 100% rename from tests/specs/run/unsafe_proto_flag/unsafe_proto/main.js rename to tests/specs/run/unsafe_proto_flag/main.js diff --git a/tests/specs/run/unsafe_proto/unsafe_proto/main_with_unsafe_proto_flag.out b/tests/specs/run/unsafe_proto_flag/main_with_unsafe_proto_flag.out similarity index 100% rename from tests/specs/run/unsafe_proto/unsafe_proto/main_with_unsafe_proto_flag.out rename to tests/specs/run/unsafe_proto_flag/main_with_unsafe_proto_flag.out diff --git a/tests/specs/run/unsafe_proto_flag/unsafe_proto/main.out b/tests/specs/run/unsafe_proto_flag/unsafe_proto/main.out deleted file mode 100644 index 4b095fd0ff..0000000000 --- a/tests/specs/run/unsafe_proto_flag/unsafe_proto/main.out +++ /dev/null @@ -1,2 +0,0 @@ -false -false diff --git a/tests/specs/run/unsafe_proto_flag/unsafe_proto/main_with_unsafe_proto_flag.out b/tests/specs/run/unsafe_proto_flag/unsafe_proto/main_with_unsafe_proto_flag.out deleted file mode 100644 index bb101b641b..0000000000 --- a/tests/specs/run/unsafe_proto_flag/unsafe_proto/main_with_unsafe_proto_flag.out +++ /dev/null @@ -1,2 +0,0 @@ -true -true diff --git a/tests/specs/run/unsafe_proto_flag/unsafe_proto/worker.js b/tests/specs/run/unsafe_proto_flag/worker.js similarity index 100% rename from tests/specs/run/unsafe_proto_flag/unsafe_proto/worker.js rename to tests/specs/run/unsafe_proto_flag/worker.js diff --git a/tests/specs/task/bin_pkg_with_scope_auto/bin_none.out b/tests/specs/task/bin_pkg_with_scope_auto/bin_none.out deleted file mode 100644 index f44b234bf3..0000000000 --- a/tests/specs/task/bin_pkg_with_scope_auto/bin_none.out +++ /dev/null @@ -1,12 +0,0 @@ -Download http://localhost:4260/@denotest%2fbin -[UNORDERED_START] -Download http://localhost:4260/@denotest/bin/0.5.0.tgz -Download http://localhost:4260/@denotest/bin/1.0.0.tgz -[UNORDERED_END] -Task bin bin hi && cli-esm testing this out && npx cli-cjs test "extra" -hi -testing -this -out -test -extra diff --git a/tests/specs/task/filter/deno_multi.out b/tests/specs/task/filter/deno_multi.out deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/testdata/cache/037_fetch_multiple.out b/tests/testdata/cache/037_fetch_multiple.out deleted file mode 100644 index f4c0c314bc..0000000000 --- a/tests/testdata/cache/037_fetch_multiple.out +++ /dev/null @@ -1,5 +0,0 @@ -Download http://localhost:4545/subdir/mod2.ts -Download http://localhost:4545/subdir/mt_text_typescript.t1.ts -Download http://localhost:4545/subdir/print_hello.ts -Check [WILDCARD]/fetch/test.ts -Check [WILDCARD]/fetch/other.ts diff --git a/tests/testdata/file_extensions/ts_with_extension.out b/tests/testdata/file_extensions/ts_with_extension.out deleted file mode 100644 index 181959ee23..0000000000 --- a/tests/testdata/file_extensions/ts_with_extension.out +++ /dev/null @@ -1 +0,0 @@ -executing typescript with extension diff --git a/tests/testdata/fmt/expected_fmt_check_verbose_formatted_files.out b/tests/testdata/fmt/expected_fmt_check_verbose_formatted_files.out deleted file mode 100644 index 158c556c29..0000000000 --- a/tests/testdata/fmt/expected_fmt_check_verbose_formatted_files.out +++ /dev/null @@ -1 +0,0 @@ -Checked 2 files diff --git a/tests/testdata/fmt/fmt_with_config_default.out b/tests/testdata/fmt/fmt_with_config_default.out deleted file mode 100644 index faad9352bb..0000000000 --- a/tests/testdata/fmt/fmt_with_config_default.out +++ /dev/null @@ -1,2 +0,0 @@ -Config file found at '[WILDCARD]deno.jsonc' -Checked 2 files diff --git a/tools/lint.js b/tools/lint.js index 8e0057fa30..2312cde272 100755 --- a/tools/lint.js +++ b/tools/lint.js @@ -3,7 +3,16 @@ // deno-lint-ignore-file no-console -import { buildMode, getPrebuilt, getSources, join, ROOT_PATH } from "./util.js"; +import { + buildMode, + dirname, + getPrebuilt, + getSources, + join, + parseJSONC, + ROOT_PATH, + walk, +} from "./util.js"; import { checkCopyright } from "./copyright_checker.js"; import * as ciFile from "../.github/workflows/ci.generate.ts"; @@ -25,6 +34,7 @@ if (js) { promises.push(dlintPreferPrimordials()); promises.push(ensureCiYmlUpToDate()); promises.push(ensureNoNewITests()); + promises.push(ensureNoUnusedOutFiles()); if (rs) { promises.push(checkCopyright()); @@ -251,3 +261,49 @@ async function ensureNoNewITests() { } } } + +async function ensureNoUnusedOutFiles() { + const specsDir = join(ROOT_PATH, "tests", "specs"); + const outFilePaths = new Set( + (await Array.fromAsync( + walk(specsDir, { exts: [".out"] }), + )).map((entry) => entry.path), + ); + const testFiles = (await Array.fromAsync( + walk(specsDir, { exts: [".jsonc"] }), + )).filter((entry) => { + return entry.path.endsWith("__test__.jsonc"); + }); + + function checkObject(baseDirPath, obj) { + for (const [key, value] of Object.entries(obj)) { + if (typeof value === "object") { + checkObject(baseDirPath, value); + } else if (key === "output" && typeof value === "string") { + const outFilePath = join(baseDirPath, value); + outFilePaths.delete(outFilePath); + } + } + } + + for (const testFile of testFiles) { + try { + const text = await Deno.readTextFile(testFile.path); + const data = parseJSONC(text); + checkObject(dirname(testFile.path), data); + } catch (err) { + throw new Error("Failed reading: " + testFile.path, { + cause: err, + }); + } + } + + const notFoundPaths = Array.from(outFilePaths); + if (notFoundPaths.length > 0) { + notFoundPaths.sort(); // be deterministic + for (const file of notFoundPaths) { + console.error(`Unreferenced .out file: ${file}`); + } + throw new Error(`${notFoundPaths.length} unreferenced .out files`); + } +} diff --git a/tools/util.js b/tools/util.js index 8c7cea15d8..8669337bff 100644 --- a/tools/util.js +++ b/tools/util.js @@ -2,12 +2,20 @@ // deno-lint-ignore-file no-console -import { dirname, fromFileUrl, join, resolve, toFileUrl } from "@std/path"; +import { + dirname, + extname, + fromFileUrl, + join, + resolve, + toFileUrl, +} from "@std/path"; import { wait } from "https://deno.land/x/wait@0.1.13/mod.ts"; -export { dirname, fromFileUrl, join, resolve, toFileUrl }; -export { existsSync, walk } from "@std/fs"; +export { dirname, extname, fromFileUrl, join, resolve, toFileUrl }; +export { existsSync, expandGlobSync, walk } from "@std/fs"; export { TextLineStream } from "@std/streams/text-line-stream"; export { delay } from "@std/async/delay"; +export { parse as parseJSONC } from "@std/jsonc/parse"; // [toolName] --version output const versions = { From 927352bd4e7f58458daa56921cf148862af05383 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Wed, 27 Nov 2024 08:35:39 +0100 Subject: [PATCH 177/227] fix(node/fs): add missing stat path argument validation (#27086) We didn't validate the `path` argument that's passed to `fs.stat()` and `fs.statSync()` which lead to wrong errors being thrown. The `@rollup/plugin-node-resolve` code calls it with `undefined` quite a lot which lead to `nitro` and `nuxt` failing. Fixes https://github.com/denoland/deno/issues/26700 --------- Co-authored-by: Yoshiya Hinosawa --- ext/node/polyfills/_fs/_fs_stat.ts | 4 +++ tests/unit_node/_fs/_fs_stat_test.ts | 37 +++++++++++++++++++++++++++- tests/unit_node/fs_test.ts | 5 +++- 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/ext/node/polyfills/_fs/_fs_stat.ts b/ext/node/polyfills/_fs/_fs_stat.ts index 507cb05eaf..f264746686 100644 --- a/ext/node/polyfills/_fs/_fs_stat.ts +++ b/ext/node/polyfills/_fs/_fs_stat.ts @@ -6,6 +6,7 @@ import { denoErrorToNodeError } from "ext:deno_node/internal/errors.ts"; import { promisify } from "ext:deno_node/internal/util.mjs"; import { primordials } from "ext:core/mod.js"; +import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs"; const { ObjectCreate, ObjectAssign } = primordials; @@ -379,6 +380,7 @@ export function stat( ? optionsOrCallback : { bigint: false }; + path = getValidatedPath(path).toString(); if (!callback) throw new Error("No callback function supplied"); Deno.stat(path).then( @@ -409,6 +411,8 @@ export function statSync( path: string | URL, options: statOptions = { bigint: false, throwIfNoEntry: true }, ): Stats | BigIntStats | undefined { + path = getValidatedPath(path).toString(); + try { const origin = Deno.statSync(path); return CFISBIS(origin, options.bigint); diff --git a/tests/unit_node/_fs/_fs_stat_test.ts b/tests/unit_node/_fs/_fs_stat_test.ts index e42aa34a9a..3cbbe940b0 100644 --- a/tests/unit_node/_fs/_fs_stat_test.ts +++ b/tests/unit_node/_fs/_fs_stat_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { BigIntStats, stat, Stats, statSync } from "node:fs"; -import { assertEquals, fail } from "@std/assert"; +import { assert, assertEquals, fail } from "@std/assert"; export function assertStats(actual: Stats, expected: Deno.FileInfo) { assertEquals(actual.dev, expected.dev); @@ -152,3 +152,38 @@ Deno.test({ assertEquals(stats.isSocket(), false); }, }); + +Deno.test({ + name: "[node/fs] stat invalid path error", + async fn() { + try { + await new Promise((resolve, reject) => { + stat( + // deno-lint-ignore no-explicit-any + undefined as any, + (err, stats) => err ? reject(err) : resolve(stats), + ); + }); + fail(); + } catch (err) { + assert(err instanceof TypeError); + // deno-lint-ignore no-explicit-any + assertEquals((err as any).code, "ERR_INVALID_ARG_TYPE"); + } + }, +}); + +Deno.test({ + name: "[node/fs] statSync invalid path error", + fn() { + try { + // deno-lint-ignore no-explicit-any + statSync(undefined as any); + fail(); + } catch (err) { + assert(err instanceof TypeError); + // deno-lint-ignore no-explicit-any + assertEquals((err as any).code, "ERR_INVALID_ARG_TYPE"); + } + }, +}); diff --git a/tests/unit_node/fs_test.ts b/tests/unit_node/fs_test.ts index 631608d7cc..32bea40e75 100644 --- a/tests/unit_node/fs_test.ts +++ b/tests/unit_node/fs_test.ts @@ -3,6 +3,7 @@ /// import { assert, assertEquals, assertRejects, assertThrows } from "@std/assert"; import { join } from "node:path"; +import { fileURLToPath } from "node:url"; import { tmpdir } from "node:os"; import { closeSync, @@ -160,7 +161,9 @@ Deno.test( } catch (error: unknown) { assertEquals( `${error}`, - `Error: ENOENT: no such file or directory, stat '${fileUrl.pathname}'`, + `Error: ENOENT: no such file or directory, stat '${ + fileURLToPath(fileUrl) + }'`, ); } }, From 7400181ecb7c6d235f0b8c47f663f84e68ba162d Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Wed, 27 Nov 2024 02:15:15 -0800 Subject: [PATCH 178/227] fix(tools/doc): HTML resolve main entrypoint from config file (#27103) Fixes #26901 --- cli/tools/doc.rs | 8 +++++- tests/specs/doc/html/__test__.jsonc | 27 ++++++++++++------- ...referenced_private_types_fixed.ts => a.ts} | 0 tests/specs/doc/html/b.ts | 11 ++++++++ tests/specs/doc/html/check_file.ts | 5 ++++ tests/specs/doc/html/deno.json | 5 ++++ 6 files changed, 46 insertions(+), 10 deletions(-) rename tests/specs/doc/html/{referenced_private_types_fixed.ts => a.ts} (100%) create mode 100644 tests/specs/doc/html/b.ts create mode 100644 tests/specs/doc/html/check_file.ts create mode 100644 tests/specs/doc/html/deno.json diff --git a/cli/tools/doc.rs b/cli/tools/doc.rs index 197596167f..9a24e458ac 100644 --- a/cli/tools/doc.rs +++ b/cli/tools/doc.rs @@ -209,10 +209,14 @@ pub async fn doc( Default::default() }; + let mut main_entrypoint = None; + let rewrite_map = if let Some(config_file) = cli_options.start_dir.maybe_deno_json() { let config = config_file.to_exports_config()?; + main_entrypoint = config.get_resolved(".").ok().flatten(); + let rewrite_map = config .clone() .into_map() @@ -240,6 +244,7 @@ pub async fn doc( html_options, deno_ns, rewrite_map, + main_entrypoint, ) } else { let modules_len = doc_nodes_by_url.len(); @@ -383,6 +388,7 @@ fn generate_docs_directory( html_options: &DocHtmlFlag, deno_ns: std::collections::HashMap, Option>>, rewrite_map: Option>, + main_entrypoint: Option, ) -> Result<(), AnyError> { let cwd = std::env::current_dir().context("Failed to get CWD")?; let output_dir_resolved = cwd.join(&html_options.output); @@ -415,7 +421,7 @@ fn generate_docs_directory( let options = deno_doc::html::GenerateOptions { package_name: html_options.name.clone(), - main_entrypoint: None, + main_entrypoint, rewrite_map, href_resolver: Rc::new(DocResolver { deno_ns, diff --git a/tests/specs/doc/html/__test__.jsonc b/tests/specs/doc/html/__test__.jsonc index 5114127cd6..78ced63744 100644 --- a/tests/specs/doc/html/__test__.jsonc +++ b/tests/specs/doc/html/__test__.jsonc @@ -1,12 +1,21 @@ { "tempDir": true, - "args": [ - "doc", - "--html", - "--name=MyLib", - "--output=temp_dir_path_here", - "referenced_private_types_fixed.ts" - ], - "output": "[WILDCARD]", - "exitCode": 0 + "steps": [ + { + "args": [ + "doc", + "--html", + "--name=MyLib", + "a.ts", + "b.ts" + ], + "output": "Written 23 files to \"./docs/\"\n", + "exitCode": 0 + }, + { + "args": "run --allow-read check_file.ts", + "output": "", + "exitCode": 0 + } + ] } diff --git a/tests/specs/doc/html/referenced_private_types_fixed.ts b/tests/specs/doc/html/a.ts similarity index 100% rename from tests/specs/doc/html/referenced_private_types_fixed.ts rename to tests/specs/doc/html/a.ts diff --git a/tests/specs/doc/html/b.ts b/tests/specs/doc/html/b.ts new file mode 100644 index 0000000000..bb38536992 --- /dev/null +++ b/tests/specs/doc/html/b.ts @@ -0,0 +1,11 @@ +/** Doc comment */ +export interface MyInterface2 { + /** Doc comment */ + prop?: string; +} + +/** Doc comment */ +export class MyClass2 { + /** Doc comment */ + prop: MyInterface2 = {}; +} diff --git a/tests/specs/doc/html/check_file.ts b/tests/specs/doc/html/check_file.ts new file mode 100644 index 0000000000..7d2fdeff5f --- /dev/null +++ b/tests/specs/doc/html/check_file.ts @@ -0,0 +1,5 @@ +const content = Deno.readTextFileSync("./docs/index.html"); + +if (content.includes("..")) { + throw new Error(); +} diff --git a/tests/specs/doc/html/deno.json b/tests/specs/doc/html/deno.json new file mode 100644 index 0000000000..b466b28003 --- /dev/null +++ b/tests/specs/doc/html/deno.json @@ -0,0 +1,5 @@ +{ + "exports": { + ".": "./a.ts" + } +} From 1e51b650bea825ec5b12041bb5db67a39df3b63e Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Wed, 27 Nov 2024 02:41:57 -0800 Subject: [PATCH 179/227] perf(ext/webstorage): use object wrap for `Storage` (#26931) ![image](https://github.com/user-attachments/assets/3f86e2fd-9026-4965-8f3b-512423362f1e) Depends on: - https://github.com/denoland/deno_core/pull/970 - https://github.com/denoland/deno_core/pull/976 - https://github.com/denoland/deno_core/pull/980 - https://github.com/denoland/deno_core/pull/981 --------- Signed-off-by: Divy Srivastava --- Cargo.lock | 19 ++- Cargo.toml | 2 +- ext/webstorage/01_webstorage.js | 89 ++----------- ext/webstorage/lib.rs | 202 ++++++++++++++++-------------- tests/wpt/runner/expectation.json | 2 +- 5 files changed, 132 insertions(+), 182 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5f59c936e8..fc567b4a38 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -394,6 +394,12 @@ dependencies = [ "tower-service", ] +[[package]] +name = "az" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" + [[package]] name = "backtrace" version = "0.3.73" @@ -1454,11 +1460,12 @@ dependencies = [ [[package]] name = "deno_core" -version = "0.322.0" +version = "0.323.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f593ef2b8acab8cd3ace9d50052edc65a3654fdbde808070cfa5da5cf7aaae6" +checksum = "a781bcfe1b5211b8497f45bf5b3dba73036b8d5d1533c1f05d26ccf0afb25a78" dependencies = [ "anyhow", + "az", "bincode", "bit-set", "bit-vec", @@ -1969,9 +1976,9 @@ dependencies = [ [[package]] name = "deno_ops" -version = "0.198.0" +version = "0.199.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870826735cd9aa0376d2aadca14365b753e830e3cc16891efb9232845a6982a4" +checksum = "a24a1f3e22029a57d3094b32070b8328eac793920b5a022027d360f085e6b245" dependencies = [ "proc-macro-rules", "proc-macro2", @@ -6570,9 +6577,9 @@ dependencies = [ [[package]] name = "serde_v8" -version = "0.231.0" +version = "0.232.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a0c48b8842ebae21c52da1d978fba5c2be5991680bddfdc1a36ee0ccbc60114" +checksum = "5c9feae92f7293fcc1a32a86be1a399859c0637e55dad8991d5258c43f7ff4d2" dependencies = [ "num-bigint", "serde", diff --git a/Cargo.toml b/Cargo.toml index 3fa7a2164a..652d55e071 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ repository = "https://github.com/denoland/deno" [workspace.dependencies] deno_ast = { version = "=0.43.3", features = ["transpiling"] } -deno_core = { version = "0.322.0" } +deno_core = { version = "0.323.0" } deno_bench_util = { version = "0.173.0", path = "./bench_util" } deno_config = { version = "=0.39.2", features = ["workspace", "sync"] } diff --git a/ext/webstorage/01_webstorage.js b/ext/webstorage/01_webstorage.js index 9e86366563..12abea8387 100644 --- a/ext/webstorage/01_webstorage.js +++ b/ext/webstorage/01_webstorage.js @@ -3,91 +3,20 @@ /// import { primordials } from "ext:core/mod.js"; -import { - op_webstorage_clear, - op_webstorage_get, - op_webstorage_iterate_keys, - op_webstorage_key, - op_webstorage_length, - op_webstorage_remove, - op_webstorage_set, -} from "ext:core/ops"; +import { op_webstorage_iterate_keys, Storage } from "ext:core/ops"; const { - Symbol, SymbolFor, ObjectFromEntries, ObjectEntries, ReflectDefineProperty, ReflectDeleteProperty, - ReflectGet, + FunctionPrototypeBind, ReflectHas, Proxy, } = primordials; -import * as webidl from "ext:deno_webidl/00_webidl.js"; - -const _persistent = Symbol("[[persistent]]"); - -class Storage { - [_persistent]; - - constructor() { - webidl.illegalConstructor(); - } - - get length() { - webidl.assertBranded(this, StoragePrototype); - return op_webstorage_length(this[_persistent]); - } - - key(index) { - webidl.assertBranded(this, StoragePrototype); - const prefix = "Failed to execute 'key' on 'Storage'"; - webidl.requiredArguments(arguments.length, 1, prefix); - index = webidl.converters["unsigned long"](index, prefix, "Argument 1"); - - return op_webstorage_key(index, this[_persistent]); - } - - setItem(key, value) { - webidl.assertBranded(this, StoragePrototype); - const prefix = "Failed to execute 'setItem' on 'Storage'"; - webidl.requiredArguments(arguments.length, 2, prefix); - key = webidl.converters.DOMString(key, prefix, "Argument 1"); - value = webidl.converters.DOMString(value, prefix, "Argument 2"); - - op_webstorage_set(key, value, this[_persistent]); - } - - getItem(key) { - webidl.assertBranded(this, StoragePrototype); - const prefix = "Failed to execute 'getItem' on 'Storage'"; - webidl.requiredArguments(arguments.length, 1, prefix); - key = webidl.converters.DOMString(key, prefix, "Argument 1"); - - return op_webstorage_get(key, this[_persistent]); - } - - removeItem(key) { - webidl.assertBranded(this, StoragePrototype); - const prefix = "Failed to execute 'removeItem' on 'Storage'"; - webidl.requiredArguments(arguments.length, 1, prefix); - key = webidl.converters.DOMString(key, prefix, "Argument 1"); - - op_webstorage_remove(key, this[_persistent]); - } - - clear() { - webidl.assertBranded(this, StoragePrototype); - op_webstorage_clear(this[_persistent]); - } -} - -const StoragePrototype = Storage.prototype; - function createStorage(persistent) { - const storage = webidl.createBranded(Storage); - storage[_persistent] = persistent; + const storage = new Storage(persistent); const proxy = new Proxy(storage, { deleteProperty(target, key) { @@ -106,12 +35,16 @@ function createStorage(persistent) { return true; }, - get(target, key, receiver) { + get(target, key) { if (typeof key === "symbol") { return target[key]; } if (ReflectHas(target, key)) { - return ReflectGet(target, key, receiver); + const value = target[key]; + if (typeof value === "function") { + return FunctionPrototypeBind(value, target); + } + return value; } return target.getItem(key) ?? undefined; }, @@ -136,7 +69,7 @@ function createStorage(persistent) { }, ownKeys() { - return op_webstorage_iterate_keys(persistent); + return op_webstorage_iterate_keys(storage); }, getOwnPropertyDescriptor(target, key) { @@ -163,7 +96,7 @@ function createStorage(persistent) { inspect, inspectOptions, ) { - return `${this.constructor.name} ${ + return `Storage ${ inspect({ ...ObjectFromEntries(ObjectEntries(proxy)), length: this.length, diff --git a/ext/webstorage/lib.rs b/ext/webstorage/lib.rs index 40946f05a7..c3e4c46596 100644 --- a/ext/webstorage/lib.rs +++ b/ext/webstorage/lib.rs @@ -5,6 +5,7 @@ use std::path::PathBuf; use deno_core::op2; +use deno_core::GarbageCollected; use deno_core::OpState; use rusqlite::params; use rusqlite::Connection; @@ -32,17 +33,14 @@ const MAX_STORAGE_BYTES: usize = 10 * 1024 * 1024; deno_core::extension!(deno_webstorage, deps = [ deno_webidl ], ops = [ - op_webstorage_length, - op_webstorage_key, - op_webstorage_set, - op_webstorage_get, - op_webstorage_remove, - op_webstorage_clear, op_webstorage_iterate_keys, ], + objects = [ + Storage + ], esm = [ "01_webstorage.js" ], options = { - origin_storage_dir: Option + origin_storage_dir: Option }, state = |state, options| { if let Some(origin_storage_dir) = options.origin_storage_dir { @@ -110,38 +108,6 @@ fn get_webstorage( Ok(conn) } -#[op2(fast)] -pub fn op_webstorage_length( - state: &mut OpState, - persistent: bool, -) -> Result { - let conn = get_webstorage(state, persistent)?; - - let mut stmt = conn.prepare_cached("SELECT COUNT(*) FROM data")?; - let length: u32 = stmt.query_row(params![], |row| row.get(0))?; - - Ok(length) -} - -#[op2] -#[string] -pub fn op_webstorage_key( - state: &mut OpState, - #[smi] index: u32, - persistent: bool, -) -> Result, WebStorageError> { - let conn = get_webstorage(state, persistent)?; - - let mut stmt = - conn.prepare_cached("SELECT key FROM data LIMIT 1 OFFSET ?")?; - - let key: Option = stmt - .query_row(params![index], |row| row.get(0)) - .optional()?; - - Ok(key) -} - #[inline] fn size_check(input: usize) -> Result<(), WebStorageError> { if input >= MAX_STORAGE_BYTES { @@ -151,81 +117,125 @@ fn size_check(input: usize) -> Result<(), WebStorageError> { Ok(()) } -#[op2(fast)] -pub fn op_webstorage_set( - state: &mut OpState, - #[string] key: &str, - #[string] value: &str, +struct Storage { persistent: bool, -) -> Result<(), WebStorageError> { - let conn = get_webstorage(state, persistent)?; - - size_check(key.len() + value.len())?; - - let mut stmt = conn - .prepare_cached("SELECT SUM(pgsize) FROM dbstat WHERE name = 'data'")?; - let size: u32 = stmt.query_row(params![], |row| row.get(0))?; - - size_check(size as usize)?; - - let mut stmt = conn - .prepare_cached("INSERT OR REPLACE INTO data (key, value) VALUES (?, ?)")?; - stmt.execute(params![key, value])?; - - Ok(()) } +impl GarbageCollected for Storage {} + #[op2] -#[string] -pub fn op_webstorage_get( - state: &mut OpState, - #[string] key_name: String, - persistent: bool, -) -> Result, WebStorageError> { - let conn = get_webstorage(state, persistent)?; +impl Storage { + #[constructor] + #[cppgc] + fn new(persistent: bool) -> Storage { + Storage { persistent } + } - let mut stmt = conn.prepare_cached("SELECT value FROM data WHERE key = ?")?; - let val = stmt - .query_row(params![key_name], |row| row.get(0)) - .optional()?; + #[getter] + #[smi] + fn length(&self, state: &mut OpState) -> Result { + let conn = get_webstorage(state, self.persistent)?; - Ok(val) -} + let mut stmt = conn.prepare_cached("SELECT COUNT(*) FROM data")?; + let length: u32 = stmt.query_row(params![], |row| row.get(0))?; -#[op2(fast)] -pub fn op_webstorage_remove( - state: &mut OpState, - #[string] key_name: &str, - persistent: bool, -) -> Result<(), WebStorageError> { - let conn = get_webstorage(state, persistent)?; + Ok(length) + } - let mut stmt = conn.prepare_cached("DELETE FROM data WHERE key = ?")?; - stmt.execute(params![key_name])?; + #[required(1)] + #[string] + fn key( + &self, + state: &mut OpState, + #[smi] index: u32, + ) -> Result, WebStorageError> { + let conn = get_webstorage(state, self.persistent)?; - Ok(()) -} + let mut stmt = + conn.prepare_cached("SELECT key FROM data LIMIT 1 OFFSET ?")?; -#[op2(fast)] -pub fn op_webstorage_clear( - state: &mut OpState, - persistent: bool, -) -> Result<(), WebStorageError> { - let conn = get_webstorage(state, persistent)?; + let key: Option = stmt + .query_row(params![index], |row| row.get(0)) + .optional()?; - let mut stmt = conn.prepare_cached("DELETE FROM data")?; - stmt.execute(params![])?; + Ok(key) + } - Ok(()) + #[fast] + #[required(2)] + fn set_item( + &self, + state: &mut OpState, + #[string] key: &str, + #[string] value: &str, + ) -> Result<(), WebStorageError> { + let conn = get_webstorage(state, self.persistent)?; + + size_check(key.len() + value.len())?; + + let mut stmt = conn + .prepare_cached("SELECT SUM(pgsize) FROM dbstat WHERE name = 'data'")?; + let size: u32 = stmt.query_row(params![], |row| row.get(0))?; + + size_check(size as usize)?; + + let mut stmt = conn.prepare_cached( + "INSERT OR REPLACE INTO data (key, value) VALUES (?, ?)", + )?; + stmt.execute(params![key, value])?; + + Ok(()) + } + + #[required(1)] + #[string] + fn get_item( + &self, + state: &mut OpState, + #[string] key: &str, + ) -> Result, WebStorageError> { + let conn = get_webstorage(state, self.persistent)?; + + let mut stmt = + conn.prepare_cached("SELECT value FROM data WHERE key = ?")?; + let val = stmt.query_row(params![key], |row| row.get(0)).optional()?; + + Ok(val) + } + + #[fast] + #[required(1)] + fn remove_item( + &self, + state: &mut OpState, + #[string] key: &str, + ) -> Result<(), WebStorageError> { + let conn = get_webstorage(state, self.persistent)?; + + let mut stmt = conn.prepare_cached("DELETE FROM data WHERE key = ?")?; + stmt.execute(params![key])?; + + Ok(()) + } + + #[fast] + fn clear(&self, state: &mut OpState) -> Result<(), WebStorageError> { + let conn = get_webstorage(state, self.persistent)?; + + let mut stmt = conn.prepare_cached("DELETE FROM data")?; + stmt.execute(params![])?; + + Ok(()) + } } #[op2] #[serde] -pub fn op_webstorage_iterate_keys( +fn op_webstorage_iterate_keys( + #[cppgc] storage: &Storage, state: &mut OpState, - persistent: bool, ) -> Result, WebStorageError> { - let conn = get_webstorage(state, persistent)?; + let conn = get_webstorage(state, storage.persistent)?; let mut stmt = conn.prepare_cached("SELECT key FROM data")?; let keys = stmt diff --git a/tests/wpt/runner/expectation.json b/tests/wpt/runner/expectation.json index 6140f4379d..5776fdb486 100644 --- a/tests/wpt/runner/expectation.json +++ b/tests/wpt/runner/expectation.json @@ -9789,7 +9789,7 @@ "event_constructor.window.html": false, "event_initstorageevent.window.html": false, "missing_arguments.window.html": true, - "storage_builtins.window.html": true, + "storage_builtins.window.html": false, "storage_clear.window.html": true, "storage_functions_not_overwritten.window.html": true, "storage_getitem.window.html": true, From 2bbfef137c01d9e06e8f91d78dbdfcd401262f26 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 27 Nov 2024 09:50:38 -0500 Subject: [PATCH 180/227] feat(unstable): repurpose `--unstable-detect-cjs` to attempt loading more modules as cjs (#27094) This resurrects the `--unstable-detect-cjs` flag (which became stable), and repurposes it to attempt loading .js/.jsx/.ts/.tsx files as CJS in the following additional scenarios: 1. There is no package.json 1. There is a package.json without a "type" field Also cleans up the implementation of this in the LSP a lot by hanging `resolution_mode()` off `Document` (didn't think about doing that until now). --- cli/args/flags.rs | 4 +- cli/args/mod.rs | 6 + cli/factory.rs | 11 +- cli/lsp/analysis.rs | 8 +- cli/lsp/completions.rs | 4 +- cli/lsp/diagnostics.rs | 1 - cli/lsp/documents.rs | 161 +++++++++--------- cli/lsp/language_server.rs | 14 +- cli/lsp/resolver.rs | 112 ++++-------- cli/lsp/tsc.rs | 13 +- cli/resolver.rs | 1 - cli/schemas/config-file.v1.json | 1 + cli/standalone/binary.rs | 1 + cli/standalone/mod.rs | 11 +- resolvers/deno/cjs.rs | 29 ++-- runtime/fmt_errors.rs | 3 +- .../no_pkg_json/__test__.jsonc | 4 + .../unstable_detect_cjs/no_pkg_json/add.ts | 3 + .../unstable_detect_cjs/no_pkg_json/deno.json | 3 + .../unstable_detect_cjs/no_pkg_json/main.out | 1 + .../unstable_detect_cjs/no_pkg_json/main.ts | 3 + .../no_type_field/__test__.jsonc | 4 + .../unstable_detect_cjs/no_type_field/add.ts | 3 + .../no_type_field/main.out | 1 + .../unstable_detect_cjs/no_type_field/main.ts | 3 + .../no_type_field/package.json | 2 + .../type_module/__test__.jsonc | 5 + .../unstable_detect_cjs/type_module/add.ts | 3 + .../unstable_detect_cjs/type_module/main.out | 4 + .../unstable_detect_cjs/type_module/main.ts | 3 + .../type_module/package.json | 3 + .../run/import_common_js/exports_error.out | 3 +- .../run/import_common_js/module_error.out | 3 +- .../run/import_common_js/require_error.out | 3 +- .../run/npm_pkg_requires_esm_js/output.out | 3 +- .../commonjs/basic/main_mix.out | 3 +- .../run/package_json_type/none/main_cjs.out | 3 +- 37 files changed, 217 insertions(+), 226 deletions(-) create mode 100644 tests/specs/node/unstable_detect_cjs/no_pkg_json/__test__.jsonc create mode 100644 tests/specs/node/unstable_detect_cjs/no_pkg_json/add.ts create mode 100644 tests/specs/node/unstable_detect_cjs/no_pkg_json/deno.json create mode 100644 tests/specs/node/unstable_detect_cjs/no_pkg_json/main.out create mode 100644 tests/specs/node/unstable_detect_cjs/no_pkg_json/main.ts create mode 100644 tests/specs/node/unstable_detect_cjs/no_type_field/__test__.jsonc create mode 100644 tests/specs/node/unstable_detect_cjs/no_type_field/add.ts create mode 100644 tests/specs/node/unstable_detect_cjs/no_type_field/main.out create mode 100644 tests/specs/node/unstable_detect_cjs/no_type_field/main.ts create mode 100644 tests/specs/node/unstable_detect_cjs/no_type_field/package.json create mode 100644 tests/specs/node/unstable_detect_cjs/type_module/__test__.jsonc create mode 100644 tests/specs/node/unstable_detect_cjs/type_module/add.ts create mode 100644 tests/specs/node/unstable_detect_cjs/type_module/main.out create mode 100644 tests/specs/node/unstable_detect_cjs/type_module/main.ts create mode 100644 tests/specs/node/unstable_detect_cjs/type_module/package.json diff --git a/cli/args/flags.rs b/cli/args/flags.rs index dde4a8ab77..5ea28bfec1 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -598,6 +598,7 @@ pub struct UnstableConfig { // TODO(bartlomieju): remove in Deno 2.5 pub legacy_flag_enabled: bool, // --unstable pub bare_node_builtins: bool, + pub detect_cjs: bool, pub sloppy_imports: bool, pub features: Vec, // --unstabe-kv --unstable-cron } @@ -4373,7 +4374,7 @@ impl CommandExt for Command { ).arg( Arg::new("unstable-detect-cjs") .long("unstable-detect-cjs") - .help("Reads the package.json type field in a project to treat .js files as .cjs") + .help("Treats ambiguous .js, .jsx, .ts, .tsx files as CommonJS modules in more cases") .value_parser(FalseyValueParser::new()) .action(ArgAction::SetTrue) .hide(true) @@ -5986,6 +5987,7 @@ fn unstable_args_parse( flags.unstable_config.bare_node_builtins = matches.get_flag("unstable-bare-node-builtins"); + flags.unstable_config.detect_cjs = matches.get_flag("unstable-detect-cjs"); flags.unstable_config.sloppy_imports = matches.get_flag("unstable-sloppy-imports"); diff --git a/cli/args/mod.rs b/cli/args/mod.rs index 0914999411..fb576a8c3e 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1606,6 +1606,11 @@ impl CliOptions { || self.workspace().has_unstable("bare-node-builtins") } + pub fn unstable_detect_cjs(&self) -> bool { + self.flags.unstable_config.detect_cjs + || self.workspace().has_unstable("detect-cjs") + } + pub fn detect_cjs(&self) -> bool { // only enabled when there's a package.json in order to not have a // perf penalty for non-npm Deno projects of searching for the closest @@ -1675,6 +1680,7 @@ impl CliOptions { "sloppy-imports", "byonm", "bare-node-builtins", + "detect-cjs", "fmt-component", "fmt-sql", ]) diff --git a/cli/factory.rs b/cli/factory.rs index 98149982f0..5d9a2c0824 100644 --- a/cli/factory.rs +++ b/cli/factory.rs @@ -48,7 +48,6 @@ use crate::resolver::CliNpmReqResolver; use crate::resolver::CliResolver; use crate::resolver::CliResolverOptions; use crate::resolver::CliSloppyImportsResolver; -use crate::resolver::IsCjsResolverOptions; use crate::resolver::NpmModuleLoader; use crate::resolver::SloppyImportsCachedFs; use crate::standalone::DenoCompileBinaryWriter; @@ -72,6 +71,7 @@ use deno_core::error::AnyError; use deno_core::futures::FutureExt; use deno_core::FeatureChecker; +use deno_resolver::cjs::IsCjsResolutionMode; use deno_resolver::npm::NpmReqResolverOptions; use deno_resolver::DenoResolverOptions; use deno_resolver::NodeAndNpmReqResolver; @@ -845,9 +845,12 @@ impl CliFactory { Ok(Arc::new(CjsTracker::new( self.in_npm_pkg_checker()?.clone(), self.pkg_json_resolver().clone(), - IsCjsResolverOptions { - detect_cjs: options.detect_cjs(), - is_node_main: options.is_node_main(), + if options.is_node_main() || options.unstable_detect_cjs() { + IsCjsResolutionMode::ImplicitTypeCommonJs + } else if options.detect_cjs() { + IsCjsResolutionMode::ExplicitTypeCommonJs + } else { + IsCjsResolutionMode::Disabled }, ))) }) diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs index eca1f15ed0..65ce330dfc 100644 --- a/cli/lsp/analysis.rs +++ b/cli/lsp/analysis.rs @@ -1281,9 +1281,7 @@ impl CodeActionCollection { import_start_from_specifier(document, i) })?; let referrer = document.specifier(); - let referrer_kind = language_server - .is_cjs_resolver - .get_doc_resolution_mode(document); + let resolution_mode = document.resolution_mode(); let file_referrer = document.file_referrer(); let config_data = language_server .config @@ -1309,7 +1307,7 @@ impl CodeActionCollection { if !language_server.resolver.is_bare_package_json_dep( &dep_key, referrer, - referrer_kind, + resolution_mode, ) { return None; } @@ -1329,7 +1327,7 @@ impl CodeActionCollection { } if language_server .resolver - .npm_to_file_url(&npm_ref, referrer, referrer_kind, file_referrer) + .npm_to_file_url(&npm_ref, referrer, resolution_mode, file_referrer) .is_some() { // The package import has types. diff --git a/cli/lsp/completions.rs b/cli/lsp/completions.rs index a77f3506fd..95e5113620 100644 --- a/cli/lsp/completions.rs +++ b/cli/lsp/completions.rs @@ -9,7 +9,6 @@ use super::jsr::CliJsrSearchApi; use super::lsp_custom; use super::npm::CliNpmSearchApi; use super::registries::ModuleRegistry; -use super::resolver::LspIsCjsResolver; use super::resolver::LspResolver; use super::search::PackageSearchApi; use super::tsc; @@ -161,7 +160,6 @@ pub async fn get_import_completions( jsr_search_api: &CliJsrSearchApi, npm_search_api: &CliNpmSearchApi, documents: &Documents, - is_cjs_resolver: &LspIsCjsResolver, resolver: &LspResolver, maybe_import_map: Option<&ImportMap>, ) -> Option { @@ -171,7 +169,7 @@ pub async fn get_import_completions( let resolution_mode = graph_range .resolution_mode .map(to_node_resolution_mode) - .unwrap_or_else(|| is_cjs_resolver.get_doc_resolution_mode(&document)); + .unwrap_or_else(|| document.resolution_mode()); let range = to_narrow_lsp_range(document.text_info(), graph_range.range); let resolved = resolver .as_cli_resolver(file_referrer) diff --git a/cli/lsp/diagnostics.rs b/cli/lsp/diagnostics.rs index 1967cdd7c9..1b72953c1b 100644 --- a/cli/lsp/diagnostics.rs +++ b/cli/lsp/diagnostics.rs @@ -1707,7 +1707,6 @@ mod tests { documents: Arc::new(documents), assets: Default::default(), config: Arc::new(config), - is_cjs_resolver: Default::default(), resolver, }, ) diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs index 96332b4388..df51c07a39 100644 --- a/cli/lsp/documents.rs +++ b/cli/lsp/documents.rs @@ -3,7 +3,6 @@ use super::cache::calculate_fs_version; use super::cache::LspCache; use super::config::Config; -use super::resolver::LspIsCjsResolver; use super::resolver::LspResolver; use super::resolver::ScopeDepInfo; use super::resolver::SingleReferrerGraphResolver; @@ -313,6 +312,7 @@ pub struct Document { media_type: MediaType, /// Present if and only if this is an open document. open_data: Option, + resolution_mode: ResolutionMode, resolver: Arc, specifier: ModuleSpecifier, text: Arc, @@ -328,7 +328,6 @@ impl Document { maybe_lsp_version: Option, maybe_language_id: Option, maybe_headers: Option>, - is_cjs_resolver: &LspIsCjsResolver, resolver: Arc, config: Arc, cache: &Arc, @@ -340,7 +339,7 @@ impl Document { .or(file_referrer); let media_type = resolve_media_type(&specifier, maybe_headers.as_ref(), maybe_language_id); - let (maybe_parsed_source, maybe_module) = + let (maybe_parsed_source, maybe_module, resolution_mode) = if media_type_is_diagnosable(media_type) { parse_and_analyze_module( specifier.clone(), @@ -348,11 +347,10 @@ impl Document { maybe_headers.as_ref(), media_type, file_referrer.as_ref(), - is_cjs_resolver, &resolver, ) } else { - (None, None) + (None, None, ResolutionMode::Import) }; let maybe_module = maybe_module.and_then(Result::ok); let dependencies = maybe_module @@ -387,6 +385,7 @@ impl Document { maybe_parsed_source, maybe_semantic_tokens: Default::default(), }), + resolution_mode, resolver, specifier, text, @@ -396,7 +395,6 @@ impl Document { fn with_new_config( &self, - is_cjs_resolver: &LspIsCjsResolver, resolver: Arc, config: Arc, ) -> Arc { @@ -408,20 +406,20 @@ impl Document { let dependencies; let maybe_types_dependency; let maybe_parsed_source; + let found_resolution_mode; let is_script; let maybe_test_module_fut; if media_type != self.media_type { let parsed_source_result = parse_source(self.specifier.clone(), self.text.clone(), media_type); - let maybe_module = analyze_module( + let (maybe_module_result, resolution_mode) = analyze_module( self.specifier.clone(), &parsed_source_result, self.maybe_headers.as_ref(), self.file_referrer.as_ref(), - is_cjs_resolver, &resolver, - ) - .ok(); + ); + let maybe_module = maybe_module_result.ok(); dependencies = maybe_module .as_ref() .map(|m| Arc::new(m.dependencies.clone())) @@ -433,17 +431,21 @@ impl Document { maybe_parsed_source = Some(parsed_source_result); maybe_test_module_fut = get_maybe_test_module_fut(maybe_parsed_source.as_ref(), &config); + found_resolution_mode = resolution_mode; } else { let cli_resolver = resolver.as_cli_resolver(self.file_referrer.as_ref()); + let is_cjs_resolver = + resolver.as_is_cjs_resolver(self.file_referrer.as_ref()); let npm_resolver = resolver.create_graph_npm_resolver(self.file_referrer.as_ref()); let config_data = resolver.as_config_data(self.file_referrer.as_ref()); let jsx_import_source_config = config_data.and_then(|d| d.maybe_jsx_import_source_config()); + found_resolution_mode = is_cjs_resolver + .get_lsp_resolution_mode(&self.specifier, self.is_script); let resolver = SingleReferrerGraphResolver { valid_referrer: &self.specifier, - module_resolution_mode: is_cjs_resolver - .get_lsp_resolution_mode(&self.specifier, self.is_script), + module_resolution_mode: found_resolution_mode, cli_resolver, jsx_import_source_config: jsx_import_source_config.as_ref(), }; @@ -493,6 +495,7 @@ impl Document { maybe_language_id: self.maybe_language_id, maybe_test_module_fut, media_type, + resolution_mode: found_resolution_mode, open_data: self.open_data.as_ref().map(|d| DocumentOpenData { lsp_version: d.lsp_version, maybe_parsed_source, @@ -508,7 +511,6 @@ impl Document { fn with_change( &self, - is_cjs_resolver: &LspIsCjsResolver, version: i32, changes: Vec, ) -> Result, AnyError> { @@ -530,7 +532,7 @@ impl Document { } let text: Arc = content.into(); let media_type = self.media_type; - let (maybe_parsed_source, maybe_module) = if self + let (maybe_parsed_source, maybe_module, resolution_mode) = if self .maybe_language_id .as_ref() .map(|li| li.is_diagnosable()) @@ -542,11 +544,10 @@ impl Document { self.maybe_headers.as_ref(), media_type, self.file_referrer.as_ref(), - is_cjs_resolver, self.resolver.as_ref(), ) } else { - (None, None) + (None, None, ResolutionMode::Import) }; let maybe_module = maybe_module.and_then(Result::ok); let dependencies = maybe_module @@ -580,6 +581,7 @@ impl Document { maybe_navigation_tree: Mutex::new(None), maybe_test_module_fut, media_type, + resolution_mode, open_data: self.open_data.is_some().then_some(DocumentOpenData { lsp_version: version, maybe_parsed_source, @@ -613,6 +615,7 @@ impl Document { maybe_test_module_fut: self.maybe_test_module_fut.clone(), media_type: self.media_type, open_data: None, + resolution_mode: self.resolution_mode, resolver: self.resolver.clone(), }) } @@ -641,6 +644,7 @@ impl Document { maybe_test_module_fut: self.maybe_test_module_fut.clone(), media_type: self.media_type, open_data: self.open_data.clone(), + resolution_mode: self.resolution_mode, resolver: self.resolver.clone(), }) } @@ -664,6 +668,10 @@ impl Document { &self.text } + pub fn resolution_mode(&self) -> ResolutionMode { + self.resolution_mode + } + pub fn text_info(&self) -> &SourceTextInfo { // try to get the text info from the parsed source and if // not then create one in the cell @@ -677,14 +685,6 @@ impl Document { .get_or_init(|| SourceTextInfo::new(self.text.clone())) }) } - - /// If this is maybe a CJS script and maybe not an ES module. - /// - /// Use `LspIsCjsResolver` to determine for sure. - pub fn is_script(&self) -> Option { - self.is_script - } - pub fn line_index(&self) -> Arc { self.line_index.clone() } @@ -832,7 +832,6 @@ impl FileSystemDocuments { pub fn get( &self, specifier: &ModuleSpecifier, - is_cjs_resolver: &LspIsCjsResolver, resolver: &Arc, config: &Arc, cache: &Arc, @@ -856,14 +855,7 @@ impl FileSystemDocuments { }; if dirty { // attempt to update the file on the file system - self.refresh_document( - specifier, - is_cjs_resolver, - resolver, - config, - cache, - file_referrer, - ) + self.refresh_document(specifier, resolver, config, cache, file_referrer) } else { old_doc } @@ -874,7 +866,6 @@ impl FileSystemDocuments { fn refresh_document( &self, specifier: &ModuleSpecifier, - is_cjs_resolver: &LspIsCjsResolver, resolver: &Arc, config: &Arc, cache: &Arc, @@ -896,7 +887,6 @@ impl FileSystemDocuments { None, None, None, - is_cjs_resolver, resolver.clone(), config.clone(), cache, @@ -913,7 +903,6 @@ impl FileSystemDocuments { None, None, None, - is_cjs_resolver, resolver.clone(), config.clone(), cache, @@ -946,7 +935,6 @@ impl FileSystemDocuments { None, None, Some(cached_file.metadata.headers), - is_cjs_resolver, resolver.clone(), config.clone(), cache, @@ -987,8 +975,6 @@ pub struct Documents { /// The DENO_DIR that the documents looks for non-file based modules. cache: Arc, config: Arc, - /// Resolver for detecting if a document is CJS or ESM. - is_cjs_resolver: Arc, /// A resolver that takes into account currently loaded import map and JSX /// settings. resolver: Arc, @@ -1024,7 +1010,6 @@ impl Documents { // the cache for remote modules here in order to get the // x-typescript-types? None, - &self.is_cjs_resolver, self.resolver.clone(), self.config.clone(), &self.cache, @@ -1059,7 +1044,7 @@ impl Documents { )) })?; self.dirty = true; - let doc = doc.with_change(&self.is_cjs_resolver, version, changes)?; + let doc = doc.with_change(version, changes)?; self.open_docs.insert(doc.specifier().clone(), doc.clone()); Ok(doc) } @@ -1191,7 +1176,6 @@ impl Documents { if let Some(old_doc) = old_doc { self.file_system_docs.get( specifier, - &self.is_cjs_resolver, &self.resolver, &self.config, &self.cache, @@ -1216,7 +1200,6 @@ impl Documents { } else { self.file_system_docs.get( &specifier, - &self.is_cjs_resolver, &self.resolver, &self.config, &self.cache, @@ -1346,7 +1329,6 @@ impl Documents { ) { self.config = Arc::new(config.clone()); self.cache = Arc::new(cache.clone()); - self.is_cjs_resolver = Arc::new(LspIsCjsResolver::new(cache)); self.resolver = resolver.clone(); node_resolver::PackageJsonThreadLocalCache::clear(); @@ -1370,21 +1352,14 @@ impl Documents { if !config.specifier_enabled(doc.specifier()) { continue; } - *doc = doc.with_new_config( - &self.is_cjs_resolver, - self.resolver.clone(), - self.config.clone(), - ); + *doc = doc.with_new_config(self.resolver.clone(), self.config.clone()); } for mut doc in self.file_system_docs.docs.iter_mut() { if !config.specifier_enabled(doc.specifier()) { continue; } - *doc.value_mut() = doc.with_new_config( - &self.is_cjs_resolver, - self.resolver.clone(), - self.config.clone(), - ); + *doc.value_mut() = + doc.with_new_config(self.resolver.clone(), self.config.clone()); } self.open_docs = open_docs; let mut preload_count = 0; @@ -1401,7 +1376,6 @@ impl Documents { { fs_docs.refresh_document( specifier, - &self.is_cjs_resolver, &self.resolver, &self.config, &self.cache, @@ -1567,8 +1541,12 @@ impl Documents { return Some((specifier, media_type)); }; if let Some(types) = doc.maybe_types_dependency().maybe_specifier() { - let specifier_kind = self.is_cjs_resolver.get_doc_resolution_mode(&doc); - self.resolve_dependency(types, &specifier, specifier_kind, file_referrer) + self.resolve_dependency( + types, + &specifier, + doc.resolution_mode(), + file_referrer, + ) } else { Some((doc.specifier().clone(), doc.media_type())) } @@ -1636,19 +1614,25 @@ fn parse_and_analyze_module( maybe_headers: Option<&HashMap>, media_type: MediaType, file_referrer: Option<&ModuleSpecifier>, - is_cjs_resolver: &LspIsCjsResolver, resolver: &LspResolver, -) -> (Option, Option) { +) -> ( + Option, + Option, + ResolutionMode, +) { let parsed_source_result = parse_source(specifier.clone(), text, media_type); - let module_result = analyze_module( + let (module_result, resolution_mode) = analyze_module( specifier, &parsed_source_result, maybe_headers, file_referrer, - is_cjs_resolver, resolver, ); - (Some(parsed_source_result), Some(module_result)) + ( + Some(parsed_source_result), + Some(module_result), + resolution_mode, + ) } fn parse_source( @@ -1671,44 +1655,51 @@ fn analyze_module( parsed_source_result: &ParsedSourceResult, maybe_headers: Option<&HashMap>, file_referrer: Option<&ModuleSpecifier>, - is_cjs_resolver: &LspIsCjsResolver, resolver: &LspResolver, -) -> ModuleResult { +) -> (ModuleResult, ResolutionMode) { match parsed_source_result { Ok(parsed_source) => { let npm_resolver = resolver.create_graph_npm_resolver(file_referrer); let cli_resolver = resolver.as_cli_resolver(file_referrer); + let is_cjs_resolver = resolver.as_is_cjs_resolver(file_referrer); let config_data = resolver.as_config_data(file_referrer); let valid_referrer = specifier.clone(); let jsx_import_source_config = config_data.and_then(|d| d.maybe_jsx_import_source_config()); + let module_resolution_mode = is_cjs_resolver.get_lsp_resolution_mode( + &specifier, + Some(parsed_source.compute_is_script()), + ); let resolver = SingleReferrerGraphResolver { valid_referrer: &valid_referrer, - module_resolution_mode: is_cjs_resolver.get_lsp_resolution_mode( - &specifier, - Some(parsed_source.compute_is_script()), - ), + module_resolution_mode, cli_resolver, jsx_import_source_config: jsx_import_source_config.as_ref(), }; - Ok(deno_graph::parse_module_from_ast( - deno_graph::ParseModuleFromAstOptions { - graph_kind: deno_graph::GraphKind::TypesOnly, - specifier, - maybe_headers, - parsed_source, - // use a null file system because there's no need to bother resolving - // dynamic imports like import(`./dir/${something}`) in the LSP - file_system: &deno_graph::source::NullFileSystem, - jsr_url_provider: &CliJsrUrlProvider, - maybe_resolver: Some(&resolver), - maybe_npm_resolver: Some(&npm_resolver), - }, - )) + ( + Ok(deno_graph::parse_module_from_ast( + deno_graph::ParseModuleFromAstOptions { + graph_kind: deno_graph::GraphKind::TypesOnly, + specifier, + maybe_headers, + parsed_source, + // use a null file system because there's no need to bother resolving + // dynamic imports like import(`./dir/${something}`) in the LSP + file_system: &deno_graph::source::NullFileSystem, + jsr_url_provider: &CliJsrUrlProvider, + maybe_resolver: Some(&resolver), + maybe_npm_resolver: Some(&npm_resolver), + }, + )), + module_resolution_mode, + ) } - Err(err) => Err(deno_graph::ModuleGraphError::ModuleError( - deno_graph::ModuleError::ParseErr(specifier, err.clone()), - )), + Err(err) => ( + Err(deno_graph::ModuleGraphError::ModuleError( + deno_graph::ModuleError::ParseErr(specifier, err.clone()), + )), + ResolutionMode::Import, + ), } } diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 8fccfd0411..0caaa94107 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -79,7 +79,6 @@ use super::parent_process_checker; use super::performance::Performance; use super::refactor; use super::registries::ModuleRegistry; -use super::resolver::LspIsCjsResolver; use super::resolver::LspResolver; use super::testing; use super::text; @@ -147,7 +146,6 @@ pub struct StateSnapshot { pub project_version: usize, pub assets: AssetsSnapshot, pub config: Arc, - pub is_cjs_resolver: Arc, pub documents: Arc, pub resolver: Arc, } @@ -207,7 +205,6 @@ pub struct Inner { pub documents: Documents, http_client_provider: Arc, initial_cwd: PathBuf, - pub is_cjs_resolver: Arc, jsr_search_api: CliJsrSearchApi, /// Handles module registries, which allow discovery of modules module_registry: ModuleRegistry, @@ -485,7 +482,6 @@ impl Inner { let initial_cwd = std::env::current_dir().unwrap_or_else(|_| { panic!("Could not resolve current working directory") }); - let is_cjs_resolver = Arc::new(LspIsCjsResolver::new(&cache)); Self { assets, @@ -497,7 +493,6 @@ impl Inner { documents, http_client_provider, initial_cwd: initial_cwd.clone(), - is_cjs_resolver, jsr_search_api, project_version: 0, task_queue: Default::default(), @@ -608,7 +603,6 @@ impl Inner { project_version: self.project_version, assets: self.assets.snapshot(), config: Arc::new(self.config.clone()), - is_cjs_resolver: self.is_cjs_resolver.clone(), documents: Arc::new(self.documents.clone()), resolver: self.resolver.snapshot(), }) @@ -630,7 +624,6 @@ impl Inner { } }); self.cache = LspCache::new(global_cache_url); - self.is_cjs_resolver = Arc::new(LspIsCjsResolver::new(&self.cache)); let deno_dir = self.cache.deno_dir(); let workspace_settings = self.config.workspace_settings(); let maybe_root_path = self @@ -1638,7 +1631,7 @@ impl Inner { .get_ts_diagnostics(&specifier, asset_or_doc.document_lsp_version()); let specifier_kind = asset_or_doc .document() - .map(|d| self.is_cjs_resolver.get_doc_resolution_mode(d)) + .map(|d| d.resolution_mode()) .unwrap_or(ResolutionMode::Import); let mut includes_no_cache = false; for diagnostic in &fixable_diagnostics { @@ -1862,7 +1855,7 @@ impl Inner { maybe_asset_or_doc .as_ref() .and_then(|d| d.document()) - .map(|d| self.is_cjs_resolver.get_doc_resolution_mode(d)) + .map(|d| d.resolution_mode()) .unwrap_or(ResolutionMode::Import), &combined_code_actions.changes, self, @@ -1919,7 +1912,7 @@ impl Inner { &action_data.specifier, asset_or_doc .document() - .map(|d| self.is_cjs_resolver.get_doc_resolution_mode(d)) + .map(|d| d.resolution_mode()) .unwrap_or(ResolutionMode::Import), &refactor_edit_info.edits, self, @@ -2270,7 +2263,6 @@ impl Inner { &self.jsr_search_api, &self.npm_search_api, &self.documents, - &self.is_cjs_resolver, self.resolver.as_ref(), self .config diff --git a/cli/lsp/resolver.rs b/cli/lsp/resolver.rs index 49203c5bfd..c705511f30 100644 --- a/cli/lsp/resolver.rs +++ b/cli/lsp/resolver.rs @@ -13,8 +13,8 @@ use deno_graph::GraphImport; use deno_graph::ModuleSpecifier; use deno_graph::Range; use deno_npm::NpmSystemInfo; -use deno_path_util::url_from_directory_path; use deno_path_util::url_to_file_path; +use deno_resolver::cjs::IsCjsResolutionMode; use deno_resolver::npm::NpmReqResolverOptions; use deno_resolver::DenoResolverOptions; use deno_resolver::NodeAndNpmReqResolver; @@ -39,7 +39,6 @@ use std::collections::HashSet; use std::sync::Arc; use super::cache::LspCache; -use super::documents::Document; use super::jsr::JsrCacheResolver; use crate::args::create_default_npmrc; use crate::args::CacheSetting; @@ -71,7 +70,6 @@ use crate::resolver::CliResolverOptions; use crate::resolver::IsCjsResolver; use crate::resolver::WorkerCliNpmGraphResolver; use crate::tsc::into_specifier_and_media_type; -use crate::util::fs::canonicalize_path_maybe_not_exists; use crate::util::progress_bar::ProgressBar; use crate::util::progress_bar::ProgressBarStyle; @@ -79,6 +77,7 @@ use crate::util::progress_bar::ProgressBarStyle; struct LspScopeResolver { resolver: Arc, in_npm_pkg_checker: Arc, + is_cjs_resolver: Arc, jsr_resolver: Option>, npm_resolver: Option>, node_resolver: Option>, @@ -97,6 +96,7 @@ impl Default for LspScopeResolver { Self { resolver: factory.cli_resolver().clone(), in_npm_pkg_checker: factory.in_npm_pkg_checker().clone(), + is_cjs_resolver: factory.is_cjs_resolver().clone(), jsr_resolver: None, npm_resolver: None, node_resolver: None, @@ -206,6 +206,7 @@ impl LspScopeResolver { Self { resolver: cli_resolver, in_npm_pkg_checker, + is_cjs_resolver: factory.is_cjs_resolver().clone(), jsr_resolver, npm_pkg_req_resolver, npm_resolver, @@ -229,6 +230,7 @@ impl LspScopeResolver { Arc::new(Self { resolver: factory.cli_resolver().clone(), in_npm_pkg_checker: factory.in_npm_pkg_checker().clone(), + is_cjs_resolver: factory.is_cjs_resolver().clone(), jsr_resolver: self.jsr_resolver.clone(), npm_pkg_req_resolver: factory.npm_pkg_req_resolver().cloned(), npm_resolver: factory.npm_resolver().cloned(), @@ -346,6 +348,14 @@ impl LspResolver { resolver.resolver.create_graph_npm_resolver() } + pub fn as_is_cjs_resolver( + &self, + file_referrer: Option<&ModuleSpecifier>, + ) -> &IsCjsResolver { + let resolver = self.get_scope_resolver(file_referrer); + resolver.is_cjs_resolver.as_ref() + } + pub fn as_config_data( &self, file_referrer: Option<&ModuleSpecifier>, @@ -582,6 +592,7 @@ pub struct ScopeDepInfo { struct ResolverFactoryServices { cli_resolver: Deferred>, in_npm_pkg_checker: Deferred>, + is_cjs_resolver: Deferred>, node_resolver: Deferred>>, npm_pkg_req_resolver: Deferred>>, npm_resolver: Option>, @@ -745,6 +756,23 @@ impl<'a> ResolverFactory<'a> { }) } + pub fn is_cjs_resolver(&self) -> &Arc { + self.services.is_cjs_resolver.get_or_init(|| { + Arc::new(IsCjsResolver::new( + self.in_npm_pkg_checker().clone(), + self.pkg_json_resolver().clone(), + if self + .config_data + .is_some_and(|d| d.unstable.contains("detect-cjs")) + { + IsCjsResolutionMode::ImplicitTypeCommonJs + } else { + IsCjsResolutionMode::ExplicitTypeCommonJs + }, + )) + }) + } + pub fn node_resolver(&self) -> Option<&Arc> { self .services @@ -804,84 +832,6 @@ impl std::fmt::Debug for RedirectResolver { } } -#[derive(Debug)] -pub struct LspIsCjsResolver { - inner: IsCjsResolver, -} - -impl Default for LspIsCjsResolver { - fn default() -> Self { - LspIsCjsResolver::new(&Default::default()) - } -} - -impl LspIsCjsResolver { - pub fn new(cache: &LspCache) -> Self { - #[derive(Debug)] - struct LspInNpmPackageChecker { - global_cache_dir: ModuleSpecifier, - } - - impl LspInNpmPackageChecker { - pub fn new(cache: &LspCache) -> Self { - let npm_folder_path = cache.deno_dir().npm_folder_path(); - Self { - global_cache_dir: url_from_directory_path( - &canonicalize_path_maybe_not_exists(&npm_folder_path) - .unwrap_or(npm_folder_path), - ) - .unwrap_or_else(|_| { - ModuleSpecifier::parse("file:///invalid/").unwrap() - }), - } - } - } - - impl InNpmPackageChecker for LspInNpmPackageChecker { - fn in_npm_package(&self, specifier: &ModuleSpecifier) -> bool { - if specifier.scheme() != "file" { - return false; - } - if specifier - .as_str() - .starts_with(self.global_cache_dir.as_str()) - { - return true; - } - specifier.as_str().contains("/node_modules/") - } - } - - let fs = Arc::new(deno_fs::RealFs); - let pkg_json_resolver = Arc::new(PackageJsonResolver::new( - deno_runtime::deno_node::DenoFsNodeResolverEnv::new(fs.clone()), - )); - - LspIsCjsResolver { - inner: IsCjsResolver::new( - Arc::new(LspInNpmPackageChecker::new(cache)), - pkg_json_resolver, - crate::resolver::IsCjsResolverOptions { - detect_cjs: true, - is_node_main: false, - }, - ), - } - } - - pub fn get_doc_resolution_mode(&self, document: &Document) -> ResolutionMode { - self.get_lsp_resolution_mode(document.specifier(), document.is_script()) - } - - pub fn get_lsp_resolution_mode( - &self, - specifier: &ModuleSpecifier, - is_script: Option, - ) -> ResolutionMode { - self.inner.get_lsp_resolution_mode(specifier, is_script) - } -} - #[derive(Debug)] pub struct SingleReferrerGraphResolver<'a> { pub valid_referrer: &'a ModuleSpecifier, diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index cf0107acfd..a8e2b91e77 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -4449,12 +4449,7 @@ fn op_load<'s>( version: state.script_version(&specifier), is_cjs: doc .document() - .map(|d| { - state - .state_snapshot - .is_cjs_resolver - .get_doc_resolution_mode(d) - }) + .map(|d| d.resolution_mode()) .unwrap_or(ResolutionMode::Import) == ResolutionMode::Require, }) @@ -4689,10 +4684,7 @@ fn op_script_names(state: &mut OpState) -> ScriptNames { let (types, _) = documents.resolve_dependency( types, specifier, - state - .state_snapshot - .is_cjs_resolver - .get_doc_resolution_mode(doc), + doc.resolution_mode(), doc.file_referrer(), )?; let types_doc = documents.get_or_load(&types, doc.file_referrer())?; @@ -5576,7 +5568,6 @@ mod tests { documents: Arc::new(documents), assets: Default::default(), config: Arc::new(config), - is_cjs_resolver: Default::default(), resolver, }); let performance = Arc::new(Performance::default()); diff --git a/cli/resolver.rs b/cli/resolver.rs index 7f6dc0b1ac..6f3351391f 100644 --- a/cli/resolver.rs +++ b/cli/resolver.rs @@ -42,7 +42,6 @@ use crate::util::text_encoding::from_utf8_lossy_owned; pub type CjsTracker = deno_resolver::cjs::CjsTracker; pub type IsCjsResolver = deno_resolver::cjs::IsCjsResolver; -pub type IsCjsResolverOptions = deno_resolver::cjs::IsCjsResolverOptions; pub type CliSloppyImportsResolver = SloppyImportsResolver; pub type CliDenoResolver = deno_resolver::DenoResolver< diff --git a/cli/schemas/config-file.v1.json b/cli/schemas/config-file.v1.json index ccd773efbf..a64cb2ff65 100644 --- a/cli/schemas/config-file.v1.json +++ b/cli/schemas/config-file.v1.json @@ -554,6 +554,7 @@ "bare-node-builtins", "byonm", "cron", + "detect-cjs", "ffi", "fs", "fmt-component", diff --git a/cli/standalone/binary.rs b/cli/standalone/binary.rs index 6f85266b05..b0623807ae 100644 --- a/cli/standalone/binary.rs +++ b/cli/standalone/binary.rs @@ -777,6 +777,7 @@ impl<'a> DenoCompileBinaryWriter<'a> { unstable_config: UnstableConfig { legacy_flag_enabled: false, bare_node_builtins: self.cli_options.unstable_bare_node_builtins(), + detect_cjs: self.cli_options.unstable_detect_cjs(), sloppy_imports: self.cli_options.unstable_sloppy_imports(), features: self.cli_options.unstable_features(), }, diff --git a/cli/standalone/mod.rs b/cli/standalone/mod.rs index 16aa4cde2b..ed0ed762c9 100644 --- a/cli/standalone/mod.rs +++ b/cli/standalone/mod.rs @@ -32,6 +32,7 @@ use deno_core::ResolutionKind; use deno_core::SourceCodeCacheInfo; use deno_npm::npm_rc::ResolvedNpmRc; use deno_package_json::PackageJsonDepValue; +use deno_resolver::cjs::IsCjsResolutionMode; use deno_resolver::npm::NpmReqResolverOptions; use deno_runtime::deno_fs; use deno_runtime::deno_node::create_host_defined_options; @@ -87,7 +88,6 @@ use crate::npm::CreateInNpmPkgCheckerOptions; use crate::resolver::CjsTracker; use crate::resolver::CliDenoResolverFs; use crate::resolver::CliNpmReqResolver; -use crate::resolver::IsCjsResolverOptions; use crate::resolver::NpmModuleLoader; use crate::util::progress_bar::ProgressBar; use crate::util::progress_bar::ProgressBarStyle; @@ -731,9 +731,12 @@ pub async fn run(data: StandaloneData) -> Result { let cjs_tracker = Arc::new(CjsTracker::new( in_npm_pkg_checker.clone(), pkg_json_resolver.clone(), - IsCjsResolverOptions { - detect_cjs: !metadata.workspace_resolver.package_jsons.is_empty(), - is_node_main: false, + if metadata.unstable_config.detect_cjs { + IsCjsResolutionMode::ImplicitTypeCommonJs + } else if metadata.workspace_resolver.package_jsons.is_empty() { + IsCjsResolutionMode::Disabled + } else { + IsCjsResolutionMode::ExplicitTypeCommonJs }, )); let cache_db = Caches::new(deno_dir_provider.clone()); diff --git a/resolvers/deno/cjs.rs b/resolvers/deno/cjs.rs index e322036dfe..9ae60b6a15 100644 --- a/resolvers/deno/cjs.rs +++ b/resolvers/deno/cjs.rs @@ -26,13 +26,13 @@ impl CjsTracker { pub fn new( in_npm_pkg_checker: Arc, pkg_json_resolver: Arc>, - options: IsCjsResolverOptions, + mode: IsCjsResolutionMode, ) -> Self { Self { is_cjs_resolver: IsCjsResolver::new( in_npm_pkg_checker, pkg_json_resolver, - options, + mode, ), known: Default::default(), } @@ -114,10 +114,14 @@ impl CjsTracker { } } -#[derive(Debug)] -pub struct IsCjsResolverOptions { - pub detect_cjs: bool, - pub is_node_main: bool, +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum IsCjsResolutionMode { + /// Requires an explicit `"type": "commonjs"` in the package.json. + ExplicitTypeCommonJs, + /// Implicitly uses `"type": "commonjs"` if no `"type"` is specified. + ImplicitTypeCommonJs, + /// Does not respect `"type": "commonjs"` and always treats ambiguous files as ESM. + Disabled, } /// Resolves whether a module is CJS or ESM. @@ -125,19 +129,19 @@ pub struct IsCjsResolverOptions { pub struct IsCjsResolver { in_npm_pkg_checker: Arc, pkg_json_resolver: Arc>, - options: IsCjsResolverOptions, + mode: IsCjsResolutionMode, } impl IsCjsResolver { pub fn new( in_npm_pkg_checker: Arc, pkg_json_resolver: Arc>, - options: IsCjsResolverOptions, + mode: IsCjsResolutionMode, ) -> Self { Self { in_npm_pkg_checker, pkg_json_resolver, - options, + mode, } } @@ -249,18 +253,19 @@ impl IsCjsResolver { } else { Ok(ResolutionMode::Require) } - } else if self.options.detect_cjs || self.options.is_node_main { + } else if self.mode != IsCjsResolutionMode::Disabled { if let Some(pkg_json) = self.pkg_json_resolver.get_closest_package_json(specifier)? { let is_cjs_type = pkg_json.typ == "commonjs" - || self.options.is_node_main && pkg_json.typ == "none"; + || self.mode == IsCjsResolutionMode::ImplicitTypeCommonJs + && pkg_json.typ == "none"; Ok(if is_cjs_type { ResolutionMode::Require } else { ResolutionMode::Import }) - } else if self.options.is_node_main { + } else if self.mode == IsCjsResolutionMode::ImplicitTypeCommonJs { Ok(ResolutionMode::Require) } else { Ok(ResolutionMode::Import) diff --git a/runtime/fmt_errors.rs b/runtime/fmt_errors.rs index 6c05fbc633..6f120b5d46 100644 --- a/runtime/fmt_errors.rs +++ b/runtime/fmt_errors.rs @@ -316,7 +316,8 @@ fn get_suggestions_for_terminal_errors(e: &JsError) -> Vec { FixSuggestion::hint_multiline(&[ "Rewrite this module to ESM,", cstr!("or change the file extension to .cjs,"), - cstr!("or add package.json next to the file with \"type\": \"commonjs\" option."), + cstr!("or add package.json next to the file with \"type\": \"commonjs\" option,"), + cstr!("or pass --unstable-detect-cjs flag to detect CommonJS when loading."), ]), FixSuggestion::docs("https://docs.deno.com/go/commonjs"), ]; diff --git a/tests/specs/node/unstable_detect_cjs/no_pkg_json/__test__.jsonc b/tests/specs/node/unstable_detect_cjs/no_pkg_json/__test__.jsonc new file mode 100644 index 0000000000..dde4f9a2c6 --- /dev/null +++ b/tests/specs/node/unstable_detect_cjs/no_pkg_json/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --check --quiet --allow-read=. main.ts", + "output": "main.out" +} diff --git a/tests/specs/node/unstable_detect_cjs/no_pkg_json/add.ts b/tests/specs/node/unstable_detect_cjs/no_pkg_json/add.ts new file mode 100644 index 0000000000..3b399665dc --- /dev/null +++ b/tests/specs/node/unstable_detect_cjs/no_pkg_json/add.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number) { + return a + b; +} diff --git a/tests/specs/node/unstable_detect_cjs/no_pkg_json/deno.json b/tests/specs/node/unstable_detect_cjs/no_pkg_json/deno.json new file mode 100644 index 0000000000..b786cd6aeb --- /dev/null +++ b/tests/specs/node/unstable_detect_cjs/no_pkg_json/deno.json @@ -0,0 +1,3 @@ +{ + "unstable": ["detect-cjs"] +} diff --git a/tests/specs/node/unstable_detect_cjs/no_pkg_json/main.out b/tests/specs/node/unstable_detect_cjs/no_pkg_json/main.out new file mode 100644 index 0000000000..00750edc07 --- /dev/null +++ b/tests/specs/node/unstable_detect_cjs/no_pkg_json/main.out @@ -0,0 +1 @@ +3 diff --git a/tests/specs/node/unstable_detect_cjs/no_pkg_json/main.ts b/tests/specs/node/unstable_detect_cjs/no_pkg_json/main.ts new file mode 100644 index 0000000000..23ab21441b --- /dev/null +++ b/tests/specs/node/unstable_detect_cjs/no_pkg_json/main.ts @@ -0,0 +1,3 @@ +import mod = require("./add.ts"); + +console.log(mod.add(1, 2)); diff --git a/tests/specs/node/unstable_detect_cjs/no_type_field/__test__.jsonc b/tests/specs/node/unstable_detect_cjs/no_type_field/__test__.jsonc new file mode 100644 index 0000000000..9162484e8a --- /dev/null +++ b/tests/specs/node/unstable_detect_cjs/no_type_field/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --unstable-detect-cjs --check --quiet --allow-read=. main.ts", + "output": "main.out" +} diff --git a/tests/specs/node/unstable_detect_cjs/no_type_field/add.ts b/tests/specs/node/unstable_detect_cjs/no_type_field/add.ts new file mode 100644 index 0000000000..3b399665dc --- /dev/null +++ b/tests/specs/node/unstable_detect_cjs/no_type_field/add.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number) { + return a + b; +} diff --git a/tests/specs/node/unstable_detect_cjs/no_type_field/main.out b/tests/specs/node/unstable_detect_cjs/no_type_field/main.out new file mode 100644 index 0000000000..00750edc07 --- /dev/null +++ b/tests/specs/node/unstable_detect_cjs/no_type_field/main.out @@ -0,0 +1 @@ +3 diff --git a/tests/specs/node/unstable_detect_cjs/no_type_field/main.ts b/tests/specs/node/unstable_detect_cjs/no_type_field/main.ts new file mode 100644 index 0000000000..23ab21441b --- /dev/null +++ b/tests/specs/node/unstable_detect_cjs/no_type_field/main.ts @@ -0,0 +1,3 @@ +import mod = require("./add.ts"); + +console.log(mod.add(1, 2)); diff --git a/tests/specs/node/unstable_detect_cjs/no_type_field/package.json b/tests/specs/node/unstable_detect_cjs/no_type_field/package.json new file mode 100644 index 0000000000..2c63c08510 --- /dev/null +++ b/tests/specs/node/unstable_detect_cjs/no_type_field/package.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/specs/node/unstable_detect_cjs/type_module/__test__.jsonc b/tests/specs/node/unstable_detect_cjs/type_module/__test__.jsonc new file mode 100644 index 0000000000..f95a6fc8ec --- /dev/null +++ b/tests/specs/node/unstable_detect_cjs/type_module/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --unstable-detect-cjs --quiet --allow-read=. main.ts", + "output": "main.out", + "exitCode": 1 +} diff --git a/tests/specs/node/unstable_detect_cjs/type_module/add.ts b/tests/specs/node/unstable_detect_cjs/type_module/add.ts new file mode 100644 index 0000000000..3b399665dc --- /dev/null +++ b/tests/specs/node/unstable_detect_cjs/type_module/add.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number) { + return a + b; +} diff --git a/tests/specs/node/unstable_detect_cjs/type_module/main.out b/tests/specs/node/unstable_detect_cjs/type_module/main.out new file mode 100644 index 0000000000..6b9bcaa46b --- /dev/null +++ b/tests/specs/node/unstable_detect_cjs/type_module/main.out @@ -0,0 +1,4 @@ +error: Uncaught SyntaxError: Unexpected token '=' +import mod = require("./add.ts"); + ^ + at (file:///[WILDLINE]/main.ts:1:8) diff --git a/tests/specs/node/unstable_detect_cjs/type_module/main.ts b/tests/specs/node/unstable_detect_cjs/type_module/main.ts new file mode 100644 index 0000000000..23ab21441b --- /dev/null +++ b/tests/specs/node/unstable_detect_cjs/type_module/main.ts @@ -0,0 +1,3 @@ +import mod = require("./add.ts"); + +console.log(mod.add(1, 2)); diff --git a/tests/specs/node/unstable_detect_cjs/type_module/package.json b/tests/specs/node/unstable_detect_cjs/type_module/package.json new file mode 100644 index 0000000000..3dbc1ca591 --- /dev/null +++ b/tests/specs/node/unstable_detect_cjs/type_module/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/tests/specs/run/import_common_js/exports_error.out b/tests/specs/run/import_common_js/exports_error.out index baa44682be..b0bb7acebc 100644 --- a/tests/specs/run/import_common_js/exports_error.out +++ b/tests/specs/run/import_common_js/exports_error.out @@ -7,5 +7,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); package.json has a "type": "commonjs" option. hint: Rewrite this module to ESM, or change the file extension to .cjs, - or add package.json next to the file with "type": "commonjs" option. + or add package.json next to the file with "type": "commonjs" option, + or pass --unstable-detect-cjs flag to detect CommonJS when loading. docs: https://docs.deno.com/go/commonjs diff --git a/tests/specs/run/import_common_js/module_error.out b/tests/specs/run/import_common_js/module_error.out index 957b19cb1e..c1e9802520 100644 --- a/tests/specs/run/import_common_js/module_error.out +++ b/tests/specs/run/import_common_js/module_error.out @@ -7,5 +7,6 @@ module.exports = { package.json has a "type": "commonjs" option. hint: Rewrite this module to ESM, or change the file extension to .cjs, - or add package.json next to the file with "type": "commonjs" option. + or add package.json next to the file with "type": "commonjs" option, + or pass --unstable-detect-cjs flag to detect CommonJS when loading. docs: https://docs.deno.com/go/commonjs diff --git a/tests/specs/run/import_common_js/require_error.out b/tests/specs/run/import_common_js/require_error.out index e13db85e8e..f89adf082d 100644 --- a/tests/specs/run/import_common_js/require_error.out +++ b/tests/specs/run/import_common_js/require_error.out @@ -7,5 +7,6 @@ const process = require("process"); package.json has a "type": "commonjs" option. hint: Rewrite this module to ESM, or change the file extension to .cjs, - or add package.json next to the file with "type": "commonjs" option. + or add package.json next to the file with "type": "commonjs" option, + or pass --unstable-detect-cjs flag to detect CommonJS when loading. docs: https://docs.deno.com/go/commonjs diff --git a/tests/specs/run/npm_pkg_requires_esm_js/output.out b/tests/specs/run/npm_pkg_requires_esm_js/output.out index 2cae7108b0..59b34e5c9e 100644 --- a/tests/specs/run/npm_pkg_requires_esm_js/output.out +++ b/tests/specs/run/npm_pkg_requires_esm_js/output.out @@ -8,5 +8,6 @@ console.log(require); package.json has a "type": "commonjs" option. hint: Rewrite this module to ESM, or change the file extension to .cjs, - or add package.json next to the file with "type": "commonjs" option. + or add package.json next to the file with "type": "commonjs" option, + or pass --unstable-detect-cjs flag to detect CommonJS when loading. docs: https://docs.deno.com/go/commonjs diff --git a/tests/specs/run/package_json_type/commonjs/basic/main_mix.out b/tests/specs/run/package_json_type/commonjs/basic/main_mix.out index 65671fd618..a3c0cfc4d4 100644 --- a/tests/specs/run/package_json_type/commonjs/basic/main_mix.out +++ b/tests/specs/run/package_json_type/commonjs/basic/main_mix.out @@ -8,5 +8,6 @@ console.log(require("./add").add(1, 2)); package.json has a "type": "commonjs" option. hint: Rewrite this module to ESM, or change the file extension to .cjs, - or add package.json next to the file with "type": "commonjs" option. + or add package.json next to the file with "type": "commonjs" option, + or pass --unstable-detect-cjs flag to detect CommonJS when loading. docs: https://docs.deno.com/go/commonjs diff --git a/tests/specs/run/package_json_type/none/main_cjs.out b/tests/specs/run/package_json_type/none/main_cjs.out index afa5028f4f..06511fed73 100644 --- a/tests/specs/run/package_json_type/none/main_cjs.out +++ b/tests/specs/run/package_json_type/none/main_cjs.out @@ -7,5 +7,6 @@ const { add } = require("./add"); package.json has a "type": "commonjs" option. hint: Rewrite this module to ESM, or change the file extension to .cjs, - or add package.json next to the file with "type": "commonjs" option. + or add package.json next to the file with "type": "commonjs" option, + or pass --unstable-detect-cjs flag to detect CommonJS when loading. docs: https://docs.deno.com/go/commonjs From e943c6a25d59dd3346a51add790db79a7b2230e4 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Wed, 27 Nov 2024 23:51:23 +0900 Subject: [PATCH 181/227] test(ext/node): enable parallel/test-fs-promises-file-handle-stat.js (#27074) --- tests/node_compat/config.jsonc | 1 + tests/node_compat/runner/TODO.md | 1 - .../test-fs-promises-file-handle-stat.js | 30 +++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 tests/node_compat/test/parallel/test-fs-promises-file-handle-stat.js diff --git a/tests/node_compat/config.jsonc b/tests/node_compat/config.jsonc index d163765daa..5acbd25dc3 100644 --- a/tests/node_compat/config.jsonc +++ b/tests/node_compat/config.jsonc @@ -338,6 +338,7 @@ "test-fs-open-numeric-flags.js", "test-fs-open.js", "test-fs-opendir.js", + "test-fs-promises-file-handle-stat.js", "test-fs-promises-writefile-with-fd.js", "test-fs-read-stream-autoClose.js", "test-fs-read-stream-concurrent-reads.js", diff --git a/tests/node_compat/runner/TODO.md b/tests/node_compat/runner/TODO.md index ef1f36840a..acd5ec45c4 100644 --- a/tests/node_compat/runner/TODO.md +++ b/tests/node_compat/runner/TODO.md @@ -822,7 +822,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-fs-promises-file-handle-read-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-read-worker.js) - [parallel/test-fs-promises-file-handle-read.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-read.js) - [parallel/test-fs-promises-file-handle-readFile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-readFile.js) -- [parallel/test-fs-promises-file-handle-stat.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-stat.js) - [parallel/test-fs-promises-file-handle-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-stream.js) - [parallel/test-fs-promises-file-handle-sync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-sync.js) - [parallel/test-fs-promises-file-handle-truncate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-truncate.js) diff --git a/tests/node_compat/test/parallel/test-fs-promises-file-handle-stat.js b/tests/node_compat/test/parallel/test-fs-promises-file-handle-stat.js new file mode 100644 index 0000000000..45315c10b2 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-promises-file-handle-stat.js @@ -0,0 +1,30 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +// The following tests validate base functionality for the fs.promises +// FileHandle.stat method. + +const { open } = require('fs').promises; +const tmpdir = require('../common/tmpdir'); +const assert = require('assert'); + +tmpdir.refresh(); + +async function validateStat() { + const filePath = tmpdir.resolve('tmp-read-file.txt'); + const fileHandle = await open(filePath, 'w+'); + const stats = await fileHandle.stat(); + assert.ok(stats.mtime instanceof Date); + await fileHandle.close(); +} + +validateStat() + .then(common.mustCall()); From 93adf37bdfe43452f9b6dc9b7e5ecc359649cef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 27 Nov 2024 15:54:15 +0000 Subject: [PATCH 182/227] fix(task): strip ansi codes and control chars when printing tasks (#27100) --- cli/tools/task.rs | 35 +++++++++++++++++-- tests/integration/task_tests.rs | 59 +++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 3 deletions(-) diff --git a/cli/tools/task.rs b/cli/tools/task.rs index 1b83422ba9..4752738c52 100644 --- a/cli/tools/task.rs +++ b/cli/tools/task.rs @@ -8,6 +8,7 @@ use std::path::PathBuf; use std::rc::Rc; use std::sync::Arc; +use console_static_text::ansi::strip_ansi_codes; use deno_config::workspace::FolderConfigs; use deno_config::workspace::TaskDefinition; use deno_config::workspace::TaskOrScript; @@ -722,19 +723,47 @@ fn print_available_tasks( if let Some(description) = &desc.task.description { let slash_slash = colors::italic_gray("//"); for line in description.lines() { - writeln!(writer, " {slash_slash} {}", colors::italic_gray(line))?; + writeln!( + writer, + " {slash_slash} {}", + colors::italic_gray(strip_ansi_codes_and_escape_control_chars(line)) + )?; } } - writeln!(writer, " {}", desc.task.command)?; + writeln!( + writer, + " {}", + strip_ansi_codes_and_escape_control_chars(&desc.task.command) + )?; if !desc.task.dependencies.is_empty() { + let dependencies = desc + .task + .dependencies + .into_iter() + .map(|d| strip_ansi_codes_and_escape_control_chars(&d)) + .collect::>() + .join(", "); writeln!( writer, " {} {}", colors::gray("depends on:"), - colors::cyan(desc.task.dependencies.join(", ")) + colors::cyan(dependencies) )?; } } Ok(()) } + +fn strip_ansi_codes_and_escape_control_chars(s: &str) -> String { + strip_ansi_codes(s) + .chars() + .map(|c| match c { + '\n' => "\\n".to_string(), + '\r' => "\\r".to_string(), + '\t' => "\\t".to_string(), + c if c.is_control() => format!("\\x{:02x}", c as u8), + c => c.to_string(), + }) + .collect() +} diff --git a/tests/integration/task_tests.rs b/tests/integration/task_tests.rs index 56bab2970d..f2e901228a 100644 --- a/tests/integration/task_tests.rs +++ b/tests/integration/task_tests.rs @@ -3,6 +3,9 @@ // Most of the tests for this are in deno_task_shell. // These tests are intended to only test integration. +use test_util as util; +use util::TestContextBuilder; + // use test_util::env_vars_for_npm_tests; // use test_util::itest; // use test_util::TestContext; @@ -28,3 +31,59 @@ // exit_code: 1, // http_server: true, // }); + +#[test] +fn deno_task_ansi_escape_codes() { + let context = TestContextBuilder::default().use_temp_cwd().build(); + let temp_dir = context.temp_dir(); + temp_dir.write("deno.json", r#"{ + "tasks": { + "dev": "echo 'BOOO!!!'", + "next": "\u001b[3F\u001b[0G- dev\u001b[1E\u001b[2K echo 'I am your friend.'" + } +} +"#); + + context + .new_command() + .args_vec(["task"]) + .with_pty(|mut console| { + console.expect("Available tasks:"); + console.expect("- dev"); + console.expect(" echo 'BOOO!!!'"); + console.expect("- next"); + console.expect(" - dev echo 'I am your friend.'"); + }); +} + +#[test] +fn deno_task_control_chars() { + let context = TestContextBuilder::default().use_temp_cwd().build(); + let temp_dir = context.temp_dir(); + temp_dir.write( + "deno.json", + r#"{ + "tasks": { + "dev": "echo 'BOOO!!!' && \r echo hi there is my command", + "serve": { + "description": "this is a\tm\rangled description", + "command": "echo hello" + } + } +} +"#, + ); + + context + .new_command() + .args_vec(["task"]) + .with_pty(|mut console| { + console.expect("Available tasks:"); + console.expect("- dev"); + console + .expect(" echo 'BOOO!!!' && \\r echo hi there is my command"); + console.expect("- serve"); + console.expect(" // this is a\\tm\\rangled description"); + console.expect(" echo hello"); + }); +} From 9bc36aa79b849ceb2a735a870fa1b977690c821a Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Wed, 27 Nov 2024 17:56:13 +0100 Subject: [PATCH 183/227] fix(node/http): casing ignored in ServerResponse.hasHeader() (#27105) We didn't respect casing when checking if a HTTP header is present in Node's `ServerResponse.hasHeader()`. This lead to us returning incorrect results when the header was present. Koa assumed that the `Content-Type` header wasn't present when it actually was and defaulted to a different `Content-Type` value. Fixes https://github.com/denoland/deno/issues/27101 --- ext/node/polyfills/http.ts | 2 +- tests/unit_node/http_test.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts index 9a920adeee..948a3527bd 100644 --- a/ext/node/polyfills/http.ts +++ b/ext/node/polyfills/http.ts @@ -1409,7 +1409,7 @@ ServerResponse.prototype.hasHeader = function ( this: ServerResponse, name: string, ) { - return Object.hasOwn(this._headers, name); + return Object.hasOwn(this._headers, StringPrototypeToLowerCase(name)); }; ServerResponse.prototype.writeHead = function ( diff --git a/tests/unit_node/http_test.ts b/tests/unit_node/http_test.ts index 2b3b8f509f..31ac6bee25 100644 --- a/tests/unit_node/http_test.ts +++ b/tests/unit_node/http_test.ts @@ -1151,6 +1151,7 @@ Deno.test("[node/http] ServerResponse header names case insensitive", async () = const { promise, resolve } = Promise.withResolvers(); const server = http.createServer((_req, res) => { res.setHeader("Content-Length", "12345"); + assert(res.hasHeader("Content-Length")); res.removeHeader("content-length"); assertEquals(res.getHeader("Content-Length"), undefined); assert(!res.hasHeader("Content-Length")); From 6fb0e10252746b4eee3b3328a5990d59b81850ac Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 27 Nov 2024 12:20:20 -0500 Subject: [PATCH 184/227] chore: fix lint step due to node compat test changes (#27111) Seems due to merging this: https://github.com/denoland/deno/actions/runs/12052779514/job/33606893423 --- tests/node_compat/runner/TODO.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/node_compat/runner/TODO.md b/tests/node_compat/runner/TODO.md index acd5ec45c4..116226d8a0 100644 --- a/tests/node_compat/runner/TODO.md +++ b/tests/node_compat/runner/TODO.md @@ -1,7 +1,7 @@ # Remaining Node Tests -594 tests out of 3681 have been ported from Node 20.11.1 (16.14% ported, 83.97% remaining). +595 tests out of 3681 have been ported from Node 20.11.1 (16.16% ported, 83.94% remaining). NOTE: This file should not be manually edited. Please edit `tests/node_compat/config.json` and run `deno task setup` in `tests/node_compat/runner` dir instead. From 16e16690af5323a0c125e98aa25e92f5bb47c2f2 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Wed, 27 Nov 2024 10:31:15 -0800 Subject: [PATCH 185/227] fix(ext/webgpu): use correct variable name (#27108) --- ext/webgpu/01_webgpu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/webgpu/01_webgpu.js b/ext/webgpu/01_webgpu.js index e9dd6c203e..d371f49ea1 100644 --- a/ext/webgpu/01_webgpu.js +++ b/ext/webgpu/01_webgpu.js @@ -620,7 +620,7 @@ function createGPUSupportedLimits(limits) { } function normalizeLimit(limit) { - if (typeof num === "bigint") { + if (typeof limit === "bigint") { limit = Number(limit); if (limit === NumberPOSITIVE_INFINITY) { limit = NumberMAX_SAFE_INTEGER; From 76daa03aa904eac3e61b13d813bda60a1a9da422 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Wed, 27 Nov 2024 13:54:26 -0800 Subject: [PATCH 186/227] fix(info): resolve bare specifier pointing to workspace member (#27020) Fixes https://github.com/denoland/deno/issues/26721 Previously, we were applying only the import map, which would result in `@scope/foo` expanding to (e.g.) `jsr:@scope/foo@1.0.0`. Since that didn't exist it would error and fail to resolve. --- cli/tools/info.rs | 62 ++++++++++++++++--- .../__test__.jsonc | 22 +++++-- .../info_bare.out | 4 ++ .../info/workspace_member/__test__.jsonc | 12 ++++ tests/specs/info/workspace_member/deno.json | 2 +- .../workspace_member/info_bare_specifier.out | 6 ++ .../info_bare_specifier_package_json.out | 6 ++ ...fo_bare_specifier_package_json_subpath.out | 6 ++ .../info/workspace_member/member/deno.json | 2 + .../specs/info/workspace_member/member/mod.ts | 3 + .../info/workspace_member/member2/deno.json | 1 + .../info/workspace_member/member3/bar.ts | 0 .../info/workspace_member/member3/mod.ts | 0 .../workspace_member/member3/package.json | 7 +++ 14 files changed, 120 insertions(+), 13 deletions(-) create mode 100644 tests/specs/info/package_json_basic_auto_install/info_bare.out create mode 100644 tests/specs/info/workspace_member/info_bare_specifier.out create mode 100644 tests/specs/info/workspace_member/info_bare_specifier_package_json.out create mode 100644 tests/specs/info/workspace_member/info_bare_specifier_package_json_subpath.out create mode 100644 tests/specs/info/workspace_member/member/mod.ts create mode 100644 tests/specs/info/workspace_member/member2/deno.json create mode 100644 tests/specs/info/workspace_member/member3/bar.ts create mode 100644 tests/specs/info/workspace_member/member3/mod.ts create mode 100644 tests/specs/info/workspace_member/member3/package.json diff --git a/cli/tools/info.rs b/cli/tools/info.rs index fcc9fdcfa1..f0cd37772d 100644 --- a/cli/tools/info.rs +++ b/cli/tools/info.rs @@ -49,19 +49,67 @@ pub async fn info( let module_graph_creator = factory.module_graph_creator().await?; let npm_resolver = factory.npm_resolver().await?; let maybe_lockfile = cli_options.maybe_lockfile(); + let resolver = factory.workspace_resolver().await?.clone(); let npmrc = cli_options.npmrc(); - let resolver = factory.workspace_resolver().await?; + let node_resolver = factory.node_resolver().await?; let cwd_url = url::Url::from_directory_path(cli_options.initial_cwd()).unwrap(); - let maybe_import_specifier = if let Some(import_map) = - resolver.maybe_import_map() + let maybe_import_specifier = if let Ok(resolved) = + resolver.resolve(&specifier, &cwd_url) { - if let Ok(imports_specifier) = import_map.resolve(&specifier, &cwd_url) { - Some(imports_specifier) - } else { - None + match resolved { + deno_config::workspace::MappedResolution::Normal { + specifier, .. + } + | deno_config::workspace::MappedResolution::ImportMap { + specifier, + .. + } + | deno_config::workspace::MappedResolution::WorkspaceJsrPackage { + specifier, + .. + } => Some(specifier), + deno_config::workspace::MappedResolution::WorkspaceNpmPackage { + target_pkg_json, + sub_path, + .. + } => Some(node_resolver.resolve_package_subpath_from_deno_module( + target_pkg_json.clone().dir_path(), + sub_path.as_deref(), + Some(&cwd_url), + node_resolver::ResolutionMode::Import, + node_resolver::NodeResolutionKind::Execution, + )?), + deno_config::workspace::MappedResolution::PackageJson { + alias, + sub_path, + dep_result, + .. + } => match dep_result.as_ref().map_err(|e| e.clone())? { + deno_package_json::PackageJsonDepValue::Workspace(version_req) => { + let pkg_folder = resolver + .resolve_workspace_pkg_json_folder_for_pkg_json_dep( + alias, + version_req, + )?; + Some(node_resolver.resolve_package_subpath_from_deno_module( + pkg_folder, + sub_path.as_deref(), + Some(&cwd_url), + node_resolver::ResolutionMode::Import, + node_resolver::NodeResolutionKind::Execution, + )?) + } + deno_package_json::PackageJsonDepValue::Req(req) => { + Some(ModuleSpecifier::parse(&format!( + "npm:{}{}", + req, + sub_path.map(|s| format!("/{}", s)).unwrap_or_default() + ))?) + } + }, } } else { None diff --git a/tests/specs/info/package_json_basic_auto_install/__test__.jsonc b/tests/specs/info/package_json_basic_auto_install/__test__.jsonc index a98f89e913..4b5b9fb1a8 100644 --- a/tests/specs/info/package_json_basic_auto_install/__test__.jsonc +++ b/tests/specs/info/package_json_basic_auto_install/__test__.jsonc @@ -1,9 +1,21 @@ { "tempDir": true, - "steps": [ - { - "args": "info --quiet main.ts", - "output": "info.out" + "tests": { + "resolves_npm_deps": { + "steps": [ + { + "args": "info --quiet main.ts", + "output": "info.out" + } + ] + }, + "bare_specifier": { + "steps": [ + { + "args": "info --quiet @denotest/esm-basic", + "output": "info_bare.out" + } + ] } - ] + } } diff --git a/tests/specs/info/package_json_basic_auto_install/info_bare.out b/tests/specs/info/package_json_basic_auto_install/info_bare.out new file mode 100644 index 0000000000..4269e05413 --- /dev/null +++ b/tests/specs/info/package_json_basic_auto_install/info_bare.out @@ -0,0 +1,4 @@ +dependencies: 0 unique +size: 471B + +npm:/@denotest/esm-basic@1.0.0 (471B) diff --git a/tests/specs/info/workspace_member/__test__.jsonc b/tests/specs/info/workspace_member/__test__.jsonc index d13d3b03e8..b62b3a3a59 100644 --- a/tests/specs/info/workspace_member/__test__.jsonc +++ b/tests/specs/info/workspace_member/__test__.jsonc @@ -11,6 +11,18 @@ "cwd": "member/sub", "output": "info_workspace_member_sub.out", "exitCode": 0 + }, + "member_bare_specifier": { + "args": "info @denotest/workspace-member", + "output": "info_bare_specifier.out" + }, + "member_package_json_specifier": { + "args": "info @denotest/workspace-member-package-json", + "output": "info_bare_specifier_package_json.out" + }, + "member_package_json_specifier_subpath": { + "args": "info @denotest/workspace-member-package-json/foo", + "output": "info_bare_specifier_package_json_subpath.out" } } } diff --git a/tests/specs/info/workspace_member/deno.json b/tests/specs/info/workspace_member/deno.json index f88028aeab..dc8a3f4ba5 100644 --- a/tests/specs/info/workspace_member/deno.json +++ b/tests/specs/info/workspace_member/deno.json @@ -1,3 +1,3 @@ { - "workspace": ["./member"] + "workspace": ["./member", "./member2", "./member3"] } diff --git a/tests/specs/info/workspace_member/info_bare_specifier.out b/tests/specs/info/workspace_member/info_bare_specifier.out new file mode 100644 index 0000000000..e446407d50 --- /dev/null +++ b/tests/specs/info/workspace_member/info_bare_specifier.out @@ -0,0 +1,6 @@ +local: [WILDCARD]mod.ts +type: TypeScript +dependencies: 0 unique +size: [WILDCARD] + +file://[WILDCARD]member/mod.ts ([WILDCARD]) diff --git a/tests/specs/info/workspace_member/info_bare_specifier_package_json.out b/tests/specs/info/workspace_member/info_bare_specifier_package_json.out new file mode 100644 index 0000000000..846305e4bb --- /dev/null +++ b/tests/specs/info/workspace_member/info_bare_specifier_package_json.out @@ -0,0 +1,6 @@ +local: [WILDCARD]mod.ts +type: TypeScript +dependencies: 0 unique +size: [WILDCARD] + +file://[WILDCARD]member3/mod.ts ([WILDCARD]) diff --git a/tests/specs/info/workspace_member/info_bare_specifier_package_json_subpath.out b/tests/specs/info/workspace_member/info_bare_specifier_package_json_subpath.out new file mode 100644 index 0000000000..89c1a13b53 --- /dev/null +++ b/tests/specs/info/workspace_member/info_bare_specifier_package_json_subpath.out @@ -0,0 +1,6 @@ +local: [WILDCARD]bar.ts +type: TypeScript +dependencies: 0 unique +size: [WILDCARD] + +file://[WILDCARD]member3/bar.ts ([WILDCARD]) diff --git a/tests/specs/info/workspace_member/member/deno.json b/tests/specs/info/workspace_member/member/deno.json index 66aac29046..5b8d7202a5 100644 --- a/tests/specs/info/workspace_member/member/deno.json +++ b/tests/specs/info/workspace_member/member/deno.json @@ -1,4 +1,6 @@ { + "name": "@denotest/workspace-member", + "exports": "./mod.ts", "imports": { "foo": "./sub/file.ts" } diff --git a/tests/specs/info/workspace_member/member/mod.ts b/tests/specs/info/workspace_member/member/mod.ts new file mode 100644 index 0000000000..e415f2ed64 --- /dev/null +++ b/tests/specs/info/workspace_member/member/mod.ts @@ -0,0 +1,3 @@ +export function hi() { + console.log("hi"); +} diff --git a/tests/specs/info/workspace_member/member2/deno.json b/tests/specs/info/workspace_member/member2/deno.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/tests/specs/info/workspace_member/member2/deno.json @@ -0,0 +1 @@ +{} diff --git a/tests/specs/info/workspace_member/member3/bar.ts b/tests/specs/info/workspace_member/member3/bar.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/specs/info/workspace_member/member3/mod.ts b/tests/specs/info/workspace_member/member3/mod.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/specs/info/workspace_member/member3/package.json b/tests/specs/info/workspace_member/member3/package.json new file mode 100644 index 0000000000..7a4ddf9dd3 --- /dev/null +++ b/tests/specs/info/workspace_member/member3/package.json @@ -0,0 +1,7 @@ +{ + "name": "@denotest/workspace-member-package-json", + "exports": { + ".": "./mod.ts", + "./foo": "./bar.ts" + } +} From f161adf19e3ba0436ed18fcdbba81fbb360a6fb1 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 27 Nov 2024 21:28:41 -0500 Subject: [PATCH 187/227] perf(compile): read embedded files as static references when UTF-8 and reading as strings (#27033) --- cli/args/deno_json.rs | 2 ++ cli/cache/mod.rs | 2 ++ cli/module_loader.rs | 26 ++++++++------ cli/node.rs | 2 +- cli/resolver.rs | 16 ++++++--- cli/standalone/binary.rs | 7 ++-- cli/standalone/mod.rs | 5 +-- cli/standalone/virtual_fs.rs | 11 +++--- cli/util/text_encoding.rs | 9 +++++ ext/fs/in_memory_fs.rs | 7 ++-- ext/fs/interface.rs | 21 +++++++---- ext/fs/lib.rs | 1 + ext/fs/ops.rs | 68 +++++++++++++++++++++++++++++++----- ext/fs/std_fs.rs | 9 ++--- ext/io/fs.rs | 4 +-- ext/io/lib.rs | 8 ++--- ext/node/lib.rs | 9 ++++- ext/node/ops/require.rs | 6 ++-- resolvers/deno/fs.rs | 6 +++- 19 files changed, 158 insertions(+), 61 deletions(-) diff --git a/cli/args/deno_json.rs b/cli/args/deno_json.rs index a82289e67d..3e6eb617a6 100644 --- a/cli/args/deno_json.rs +++ b/cli/args/deno_json.rs @@ -22,6 +22,8 @@ impl<'a> deno_config::fs::DenoConfigFs for DenoConfigFsAdapter<'a> { self .0 .read_text_file_lossy_sync(path, None) + // todo(https://github.com/denoland/deno_config/pull/140): avoid clone + .map(|s| s.into_owned()) .map_err(|err| err.into_io_error()) } diff --git a/cli/cache/mod.rs b/cli/cache/mod.rs index 50fc135ddf..73a3895a10 100644 --- a/cli/cache/mod.rs +++ b/cli/cache/mod.rs @@ -116,6 +116,8 @@ impl<'a> deno_cache_dir::DenoCacheEnv for DenoCacheEnvFsAdapter<'a> { self .0 .read_file_sync(path, None) + // todo(https://github.com/denoland/deno_cache_dir/pull/66): avoid clone + .map(|bytes| bytes.into_owned()) .map_err(|err| err.into_io_error()) } diff --git a/cli/module_loader.rs b/cli/module_loader.rs index 3d2dfb2a66..447c85a9ac 100644 --- a/cli/module_loader.rs +++ b/cli/module_loader.rs @@ -1060,7 +1060,10 @@ impl NodeRequireLoader self.npm_resolver.ensure_read_permission(permissions, path) } - fn load_text_file_lossy(&self, path: &Path) -> Result { + fn load_text_file_lossy( + &self, + path: &Path, + ) -> Result, AnyError> { // todo(dsherret): use the preloaded module from the graph if available? let media_type = MediaType::from_path(path); let text = self.fs.read_text_file_lossy_sync(path, None)?; @@ -1075,15 +1078,18 @@ impl NodeRequireLoader .into(), ); } - self.emitter.emit_parsed_source_sync( - &specifier, - media_type, - // this is probably not super accurate due to require esm, but probably ok. - // If we find this causes a lot of churn in the emit cache then we should - // investigate how we can make this better - ModuleKind::Cjs, - &text.into(), - ) + self + .emitter + .emit_parsed_source_sync( + &specifier, + media_type, + // this is probably not super accurate due to require esm, but probably ok. + // If we find this causes a lot of churn in the emit cache then we should + // investigate how we can make this better + ModuleKind::Cjs, + &text.into(), + ) + .map(Cow::Owned) } else { Ok(text) } diff --git a/cli/node.rs b/cli/node.rs index bc39cdbde9..11959df6b9 100644 --- a/cli/node.rs +++ b/cli/node.rs @@ -160,7 +160,7 @@ impl CjsCodeAnalyzer for CliCjsCodeAnalyzer { if let Ok(source_from_file) = self.fs.read_text_file_lossy_async(path, None).await { - Cow::Owned(source_from_file) + source_from_file } else { return Ok(ExtNodeCjsAnalysis::Cjs(CjsAnalysisExports { exports: vec![], diff --git a/cli/resolver.rs b/cli/resolver.rs index 6f3351391f..15ca4aa2b6 100644 --- a/cli/resolver.rs +++ b/cli/resolver.rs @@ -37,7 +37,7 @@ use crate::node::CliNodeCodeTranslator; use crate::npm::CliNpmResolver; use crate::npm::InnerCliNpmResolverRef; use crate::util::sync::AtomicFlag; -use crate::util::text_encoding::from_utf8_lossy_owned; +use crate::util::text_encoding::from_utf8_lossy_cow; pub type CjsTracker = deno_resolver::cjs::CjsTracker; pub type IsCjsResolver = @@ -62,7 +62,10 @@ pub struct ModuleCodeStringSource { pub struct CliDenoResolverFs(pub Arc); impl deno_resolver::fs::DenoResolverFs for CliDenoResolverFs { - fn read_to_string_lossy(&self, path: &Path) -> std::io::Result { + fn read_to_string_lossy( + &self, + path: &Path, + ) -> std::io::Result> { self .0 .read_text_file_lossy_sync(path, None) @@ -182,18 +185,21 @@ impl NpmModuleLoader { let code = if self.cjs_tracker.is_maybe_cjs(specifier, media_type)? { // translate cjs to esm if it's cjs and inject node globals - let code = from_utf8_lossy_owned(code); + let code = from_utf8_lossy_cow(code); ModuleSourceCode::String( self .node_code_translator - .translate_cjs_to_esm(specifier, Some(Cow::Owned(code))) + .translate_cjs_to_esm(specifier, Some(code)) .await? .into_owned() .into(), ) } else { // esm and json code is untouched - ModuleSourceCode::Bytes(code.into_boxed_slice().into()) + ModuleSourceCode::Bytes(match code { + Cow::Owned(bytes) => bytes.into_boxed_slice().into(), + Cow::Borrowed(bytes) => bytes.into(), + }) }; Ok(ModuleCodeStringSource { diff --git a/cli/standalone/binary.rs b/cli/standalone/binary.rs index b0623807ae..632f27da6f 100644 --- a/cli/standalone/binary.rs +++ b/cli/standalone/binary.rs @@ -282,14 +282,13 @@ impl StandaloneModules { .vfs .read_file_all(entry, VfsFileSubDataKind::ModuleGraph)?, Err(err) if err.kind() == ErrorKind::NotFound => { - let bytes = match RealFs.read_file_sync(&path, None) { + match RealFs.read_file_sync(&path, None) { Ok(bytes) => bytes, Err(FsError::Io(err)) if err.kind() == ErrorKind::NotFound => { return Ok(None) } Err(err) => return Err(err.into()), - }; - Cow::Owned(bytes) + } } Err(err) => return Err(err.into()), }; @@ -694,7 +693,7 @@ impl<'a> DenoCompileBinaryWriter<'a> { &file_path, match maybe_source { Some(source) => source, - None => RealFs.read_file_sync(&file_path, None)?, + None => RealFs.read_file_sync(&file_path, None)?.into_owned(), }, VfsFileSubDataKind::ModuleGraph, ) diff --git a/cli/standalone/mod.rs b/cli/standalone/mod.rs index ed0ed762c9..53efab2964 100644 --- a/cli/standalone/mod.rs +++ b/cli/standalone/mod.rs @@ -91,6 +91,7 @@ use crate::resolver::CliNpmReqResolver; use crate::resolver::NpmModuleLoader; use crate::util::progress_bar::ProgressBar; use crate::util::progress_bar::ProgressBarStyle; +use crate::util::text_encoding::from_utf8_lossy_cow; use crate::util::v8::construct_v8_flags; use crate::worker::CliCodeCache; use crate::worker::CliMainWorkerFactory; @@ -516,13 +517,13 @@ impl NodeRequireLoader for EmbeddedModuleLoader { fn load_text_file_lossy( &self, path: &std::path::Path, - ) -> Result { + ) -> Result, AnyError> { let file_entry = self.shared.vfs.file_entry(path)?; let file_bytes = self .shared .vfs .read_file_all(file_entry, VfsFileSubDataKind::ModuleGraph)?; - Ok(String::from_utf8(file_bytes.into_owned())?) + Ok(from_utf8_lossy_cow(file_bytes)) } fn is_maybe_cjs( diff --git a/cli/standalone/virtual_fs.rs b/cli/standalone/virtual_fs.rs index b630f629c5..66fc835534 100644 --- a/cli/standalone/virtual_fs.rs +++ b/cli/standalone/virtual_fs.rs @@ -743,15 +743,12 @@ impl deno_io::fs::File for FileBackedVfsFile { Err(FsError::NotSupported) } - fn read_all_sync(self: Rc) -> FsResult> { - self.read_to_end().map(|bytes| bytes.into_owned()) + fn read_all_sync(self: Rc) -> FsResult> { + self.read_to_end() } - async fn read_all_async(self: Rc) -> FsResult> { + async fn read_all_async(self: Rc) -> FsResult> { let inner = (*self).clone(); - tokio::task::spawn_blocking(move || { - inner.read_to_end().map(|bytes| bytes.into_owned()) - }) - .await? + tokio::task::spawn_blocking(move || inner.read_to_end()).await? } fn chmod_sync(self: Rc, _pathmode: u32) -> FsResult<()> { diff --git a/cli/util/text_encoding.rs b/cli/util/text_encoding.rs index 8524e63ebb..06b311e150 100644 --- a/cli/util/text_encoding.rs +++ b/cli/util/text_encoding.rs @@ -11,6 +11,15 @@ use deno_core::ModuleSourceCode; static SOURCE_MAP_PREFIX: &[u8] = b"//# sourceMappingURL=data:application/json;base64,"; +#[inline(always)] +pub fn from_utf8_lossy_cow(bytes: Cow<[u8]>) -> Cow { + match bytes { + Cow::Borrowed(bytes) => String::from_utf8_lossy(bytes), + Cow::Owned(bytes) => Cow::Owned(from_utf8_lossy_owned(bytes)), + } +} + +#[inline(always)] pub fn from_utf8_lossy_owned(bytes: Vec) -> String { match String::from_utf8_lossy(&bytes) { Cow::Owned(code) => code, diff --git a/ext/fs/in_memory_fs.rs b/ext/fs/in_memory_fs.rs index 34b77836d9..b79b0ae984 100644 --- a/ext/fs/in_memory_fs.rs +++ b/ext/fs/in_memory_fs.rs @@ -3,6 +3,7 @@ // Allow using Arc for this module. #![allow(clippy::disallowed_types)] +use std::borrow::Cow; use std::collections::hash_map::Entry; use std::collections::HashMap; use std::io::Error; @@ -457,11 +458,11 @@ impl FileSystem for InMemoryFs { &self, path: &Path, _access_check: Option, - ) -> FsResult> { + ) -> FsResult> { let entry = self.get_entry(path); match entry { Some(entry) => match &*entry { - PathEntry::File(data) => Ok(data.clone()), + PathEntry::File(data) => Ok(Cow::Owned(data.clone())), PathEntry::Dir => Err(FsError::Io(Error::new( ErrorKind::InvalidInput, "Is a directory", @@ -474,7 +475,7 @@ impl FileSystem for InMemoryFs { &'a self, path: PathBuf, access_check: Option>, - ) -> FsResult> { + ) -> FsResult> { self.read_file_sync(&path, access_check) } } diff --git a/ext/fs/interface.rs b/ext/fs/interface.rs index 73333b0fd1..28a49c5d9b 100644 --- a/ext/fs/interface.rs +++ b/ext/fs/interface.rs @@ -1,5 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use core::str; use std::borrow::Cow; use std::path::Path; use std::path::PathBuf; @@ -288,7 +289,7 @@ pub trait FileSystem: std::fmt::Debug + MaybeSend + MaybeSync { &self, path: &Path, access_check: Option, - ) -> FsResult> { + ) -> FsResult> { let options = OpenOptions::read(); let file = self.open_sync(path, options, access_check)?; let buf = file.read_all_sync()?; @@ -298,7 +299,7 @@ pub trait FileSystem: std::fmt::Debug + MaybeSend + MaybeSync { &'a self, path: PathBuf, access_check: Option>, - ) -> FsResult> { + ) -> FsResult> { let options = OpenOptions::read(); let file = self.open_async(path, options, access_check).await?; let buf = file.read_all_async().await?; @@ -327,17 +328,25 @@ pub trait FileSystem: std::fmt::Debug + MaybeSend + MaybeSync { &self, path: &Path, access_check: Option, - ) -> FsResult { + ) -> FsResult> { let buf = self.read_file_sync(path, access_check)?; - Ok(string_from_utf8_lossy(buf)) + Ok(string_from_cow_utf8_lossy(buf)) } async fn read_text_file_lossy_async<'a>( &'a self, path: PathBuf, access_check: Option>, - ) -> FsResult { + ) -> FsResult> { let buf = self.read_file_async(path, access_check).await?; - Ok(string_from_utf8_lossy(buf)) + Ok(string_from_cow_utf8_lossy(buf)) + } +} + +#[inline(always)] +fn string_from_cow_utf8_lossy(buf: Cow<'static, [u8]>) -> Cow<'static, str> { + match buf { + Cow::Owned(buf) => Cow::Owned(string_from_utf8_lossy(buf)), + Cow::Borrowed(buf) => String::from_utf8_lossy(buf), } } diff --git a/ext/fs/lib.rs b/ext/fs/lib.rs index aed9a7085f..26fac1e79f 100644 --- a/ext/fs/lib.rs +++ b/ext/fs/lib.rs @@ -17,6 +17,7 @@ pub use crate::interface::OpenOptions; pub use crate::ops::FsOpsError; pub use crate::ops::FsOpsErrorKind; pub use crate::ops::OperationError; +pub use crate::ops::V8MaybeStaticStr; pub use crate::std_fs::RealFs; pub use crate::sync::MaybeSend; pub use crate::sync::MaybeSync; diff --git a/ext/fs/ops.rs b/ext/fs/ops.rs index 7a9778c485..5e64585e0c 100644 --- a/ext/fs/ops.rs +++ b/ext/fs/ops.rs @@ -1,5 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use std::borrow::Cow; use std::cell::RefCell; use std::error::Error; use std::fmt::Formatter; @@ -18,12 +19,15 @@ use crate::FsPermissions; use crate::OpenOptions; use boxed_error::Boxed; use deno_core::op2; +use deno_core::v8; use deno_core::CancelFuture; use deno_core::CancelHandle; +use deno_core::FastString; use deno_core::JsBuffer; use deno_core::OpState; use deno_core::ResourceId; use deno_core::ToJsBuffer; +use deno_core::ToV8; use deno_io::fs::FileResource; use deno_io::fs::FsError; use deno_io::fs::FsStat; @@ -1333,7 +1337,8 @@ where .read_file_sync(&path, Some(&mut access_check)) .map_err(|error| map_permission_error("readfile", error, &path))?; - Ok(buf.into()) + // todo(https://github.com/denoland/deno/issues/27107): do not clone here + Ok(buf.into_owned().into_boxed_slice().into()) } #[op2(async, stack_trace)] @@ -1375,15 +1380,61 @@ where .map_err(|error| map_permission_error("readfile", error, &path))? }; - Ok(buf.into()) + // todo(https://github.com/denoland/deno/issues/27107): do not clone here + Ok(buf.into_owned().into_boxed_slice().into()) +} + +// todo(https://github.com/denoland/deno_core/pull/986): remove +// when upgrading deno_core +#[derive(Debug)] +pub struct FastStringV8AllocationError; + +impl std::error::Error for FastStringV8AllocationError {} + +impl std::fmt::Display for FastStringV8AllocationError { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!( + f, + "failed to allocate string; buffer exceeds maximum length" + ) + } +} + +/// Maintains a static reference to the string if possible. +pub struct V8MaybeStaticStr(pub Cow<'static, str>); + +impl<'s> ToV8<'s> for V8MaybeStaticStr { + type Error = FastStringV8AllocationError; + + #[inline] + fn to_v8( + self, + scope: &mut v8::HandleScope<'s>, + ) -> Result, Self::Error> { + // todo(https://github.com/denoland/deno_core/pull/986): remove this check + // when upgrading deno_core + const MAX_V8_STRING_LENGTH: usize = 536870888; + if self.0.len() > MAX_V8_STRING_LENGTH { + return Err(FastStringV8AllocationError); + } + + Ok( + match self.0 { + Cow::Borrowed(text) => FastString::from_static(text), + Cow::Owned(value) => value.into(), + } + .v8_string(scope) + .into(), + ) + } } #[op2(stack_trace)] -#[string] +#[to_v8] pub fn op_fs_read_file_text_sync

( state: &mut OpState, #[string] path: String, -) -> Result +) -> Result where P: FsPermissions + 'static, { @@ -1395,17 +1446,16 @@ where let str = fs .read_text_file_lossy_sync(&path, Some(&mut access_check)) .map_err(|error| map_permission_error("readfile", error, &path))?; - - Ok(str) + Ok(V8MaybeStaticStr(str)) } #[op2(async, stack_trace)] -#[string] +#[to_v8] pub async fn op_fs_read_file_text_async

( state: Rc>, #[string] path: String, #[smi] cancel_rid: Option, -) -> Result +) -> Result where P: FsPermissions + 'static, { @@ -1439,7 +1489,7 @@ where .map_err(|error| map_permission_error("readfile", error, &path))? }; - Ok(str) + Ok(V8MaybeStaticStr(str)) } fn to_seek_from(offset: i64, whence: i32) -> Result { diff --git a/ext/fs/std_fs.rs b/ext/fs/std_fs.rs index 73439d9bab..86ad213160 100644 --- a/ext/fs/std_fs.rs +++ b/ext/fs/std_fs.rs @@ -2,6 +2,7 @@ #![allow(clippy::disallowed_methods)] +use std::borrow::Cow; use std::env::current_dir; use std::fs; use std::io; @@ -371,7 +372,7 @@ impl FileSystem for RealFs { &self, path: &Path, access_check: Option, - ) -> FsResult> { + ) -> FsResult> { let mut file = open_with_access_check( OpenOptions { read: true, @@ -382,13 +383,13 @@ impl FileSystem for RealFs { )?; let mut buf = Vec::new(); file.read_to_end(&mut buf)?; - Ok(buf) + Ok(Cow::Owned(buf)) } async fn read_file_async<'a>( &'a self, path: PathBuf, access_check: Option>, - ) -> FsResult> { + ) -> FsResult> { let mut file = open_with_access_check( OpenOptions { read: true, @@ -400,7 +401,7 @@ impl FileSystem for RealFs { spawn_blocking(move || { let mut buf = Vec::new(); file.read_to_end(&mut buf)?; - Ok::<_, FsError>(buf) + Ok::<_, FsError>(Cow::Owned(buf)) }) .await? .map_err(Into::into) diff --git a/ext/io/fs.rs b/ext/io/fs.rs index 7ef02315ba..bd5dfd0bb9 100644 --- a/ext/io/fs.rs +++ b/ext/io/fs.rs @@ -215,8 +215,8 @@ pub trait File { fn write_all_sync(self: Rc, buf: &[u8]) -> FsResult<()>; async fn write_all(self: Rc, buf: BufView) -> FsResult<()>; - fn read_all_sync(self: Rc) -> FsResult>; - async fn read_all_async(self: Rc) -> FsResult>; + fn read_all_sync(self: Rc) -> FsResult>; + async fn read_all_async(self: Rc) -> FsResult>; fn chmod_sync(self: Rc, pathmode: u32) -> FsResult<()>; async fn chmod_async(self: Rc, mode: u32) -> FsResult<()>; diff --git a/ext/io/lib.rs b/ext/io/lib.rs index 5d183aa464..873fccd7b8 100644 --- a/ext/io/lib.rs +++ b/ext/io/lib.rs @@ -789,26 +789,26 @@ impl crate::fs::File for StdFileResourceInner { } } - fn read_all_sync(self: Rc) -> FsResult> { + fn read_all_sync(self: Rc) -> FsResult> { match self.kind { StdFileResourceKind::File | StdFileResourceKind::Stdin(_) => { let mut buf = Vec::new(); self.with_sync(|file| Ok(file.read_to_end(&mut buf)?))?; - Ok(buf) + Ok(Cow::Owned(buf)) } StdFileResourceKind::Stdout | StdFileResourceKind::Stderr => { Err(FsError::NotSupported) } } } - async fn read_all_async(self: Rc) -> FsResult> { + async fn read_all_async(self: Rc) -> FsResult> { match self.kind { StdFileResourceKind::File | StdFileResourceKind::Stdin(_) => { self .with_inner_blocking_task(|file| { let mut buf = Vec::new(); file.read_to_end(&mut buf)?; - Ok(buf) + Ok(Cow::Owned(buf)) }) .await } diff --git a/ext/node/lib.rs b/ext/node/lib.rs index 63f5794b7d..9986b0f607 100644 --- a/ext/node/lib.rs +++ b/ext/node/lib.rs @@ -157,7 +157,10 @@ pub trait NodeRequireLoader { path: &'a Path, ) -> Result, AnyError>; - fn load_text_file_lossy(&self, path: &Path) -> Result; + fn load_text_file_lossy( + &self, + path: &Path, + ) -> Result, AnyError>; /// Get if the module kind is maybe CJS and loading should determine /// if its CJS or ESM. @@ -873,6 +876,8 @@ impl deno_package_json::fs::DenoPkgJsonFs for DenoFsNodeResolverEnv { self .fs .read_text_file_lossy_sync(path, None) + // todo(https://github.com/denoland/deno_package_json/pull/9): don't clone + .map(|text| text.into_owned()) .map_err(|err| err.into_io_error()) } } @@ -887,6 +892,8 @@ impl<'a> deno_package_json::fs::DenoPkgJsonFs for DenoPkgJsonFsAdapter<'a> { self .0 .read_text_file_lossy_sync(path, None) + // todo(https://github.com/denoland/deno_package_json/pull/9): don't clone + .map(|text| text.into_owned()) .map_err(|err| err.into_io_error()) } } diff --git a/ext/node/ops/require.rs b/ext/node/ops/require.rs index 64dc4423ae..1c204f54e8 100644 --- a/ext/node/ops/require.rs +++ b/ext/node/ops/require.rs @@ -8,6 +8,7 @@ use deno_core::v8; use deno_core::JsRuntimeInspector; use deno_core::OpState; use deno_fs::FileSystemRc; +use deno_fs::V8MaybeStaticStr; use deno_package_json::PackageJsonRc; use deno_path_util::normalize_path; use deno_path_util::url_from_file_path; @@ -477,11 +478,11 @@ where } #[op2(stack_trace)] -#[string] +#[to_v8] pub fn op_require_read_file

( state: &mut OpState, #[string] file_path: String, -) -> Result +) -> Result where P: NodePermissions + 'static, { @@ -492,6 +493,7 @@ where let loader = state.borrow::(); loader .load_text_file_lossy(&file_path) + .map(V8MaybeStaticStr) .map_err(|e| RequireErrorKind::ReadModule(e).into_box()) } diff --git a/resolvers/deno/fs.rs b/resolvers/deno/fs.rs index 4929f4508e..f2021a73a9 100644 --- a/resolvers/deno/fs.rs +++ b/resolvers/deno/fs.rs @@ -1,5 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use std::borrow::Cow; use std::path::Path; use std::path::PathBuf; @@ -10,7 +11,10 @@ pub struct DirEntry { } pub trait DenoResolverFs { - fn read_to_string_lossy(&self, path: &Path) -> std::io::Result; + fn read_to_string_lossy( + &self, + path: &Path, + ) -> std::io::Result>; fn realpath_sync(&self, path: &Path) -> std::io::Result; fn exists_sync(&self, path: &Path) -> bool; fn is_dir_sync(&self, path: &Path) -> bool; From 1af2d2474e212038d8fee06c897be08145541fa3 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Thu, 28 Nov 2024 04:29:20 -0800 Subject: [PATCH 188/227] fix(ext/node): `tls.connect` socket upgrades (#27125) Fixes https://github.com/denoland/deno/issues/27087 Fixes https://github.com/denoland/deno/issues/26685 Fixes https://github.com/denoland/deno/issues/26660 --- ext/node/polyfills/_tls_wrap.ts | 16 +++++++++++++++- ext/node/polyfills/http2.ts | 6 +++--- .../polyfills/internal_binding/stream_wrap.ts | 14 +++++++++++++- tests/unit_node/tls_test.ts | 14 ++++++++++++++ 4 files changed, 45 insertions(+), 5 deletions(-) diff --git a/ext/node/polyfills/_tls_wrap.ts b/ext/node/polyfills/_tls_wrap.ts index e36fc637e7..4c7424a328 100644 --- a/ext/node/polyfills/_tls_wrap.ts +++ b/ext/node/polyfills/_tls_wrap.ts @@ -148,9 +148,13 @@ export class TLSSocket extends net.Socket { : new TCP(TCPConstants.SOCKET); } + const { promise, resolve } = Promise.withResolvers(); + // Patches `afterConnect` hook to replace TCP conn with TLS conn const afterConnect = handle.afterConnect; handle.afterConnect = async (req: any, status: number) => { + options.hostname ??= undefined; // coerce to undefined if null, startTls expects hostname to be undefined + try { const conn = await Deno.startTls(handle[kStreamBaseField], options); try { @@ -164,15 +168,25 @@ export class TLSSocket extends net.Socket { // Don't interrupt "secure" event to let the first read/write // operation emit the error. } + + // Assign the TLS connection to the handle and resume reading. handle[kStreamBaseField] = conn; + handle.upgrading = false; + if (!handle.pauseOnCreate) { + handle.readStart(); + } + + resolve(); + tlssock.emit("secure"); tlssock.removeListener("end", onConnectEnd); - } catch (_) { + } catch { // TODO(kt3k): Handle this } return afterConnect.call(handle, req, status); }; + handle.upgrading = promise; (handle as any).verifyError = function () { return null; // Never fails, rejectUnauthorized is always true in Deno. }; diff --git a/ext/node/polyfills/http2.ts b/ext/node/polyfills/http2.ts index dc2379aebb..1b3f74f6f6 100644 --- a/ext/node/polyfills/http2.ts +++ b/ext/node/polyfills/http2.ts @@ -479,13 +479,13 @@ export class ClientHttp2Session extends Http2Session { socket.on("error", socketOnError); socket.on("close", socketOnClose); + + socket[kHandle].pauseOnCreate = true; const connPromise = new Promise((resolve) => { const eventName = url.startsWith("https") ? "secureConnect" : "connect"; socket.once(eventName, () => { const rid = socket[kHandle][kStreamBaseField][internalRidSymbol]; - nextTick(() => { - resolve(rid); - }); + nextTick(() => resolve(rid)); }); }); socket[kSession] = this; diff --git a/ext/node/polyfills/internal_binding/stream_wrap.ts b/ext/node/polyfills/internal_binding/stream_wrap.ts index 7aea83d6f5..19c9357ce8 100644 --- a/ext/node/polyfills/internal_binding/stream_wrap.ts +++ b/ext/node/polyfills/internal_binding/stream_wrap.ts @@ -320,8 +320,16 @@ export class LibuvStreamWrap extends HandleWrap { /** Internal method for reading from the attached stream. */ async #read() { let buf = this.#buf; + let nread: number | null; const ridBefore = this[kStreamBaseField]![internalRidSymbol]; + + if (this.upgrading) { + // Starting an upgrade, stop reading. Upgrading will resume reading. + this.readStop(); + return; + } + try { nread = await this[kStreamBaseField]!.read(buf); } catch (e) { @@ -382,6 +390,11 @@ export class LibuvStreamWrap extends HandleWrap { const ridBefore = this[kStreamBaseField]![internalRidSymbol]; + if (this.upgrading) { + // There is an upgrade in progress, queue the write request. + await this.upgrading; + } + let nwritten = 0; try { // TODO(crowlKats): duplicate from runtime/js/13_buffer.js @@ -400,7 +413,6 @@ export class LibuvStreamWrap extends HandleWrap { } let status: number; - // TODO(cmorten): map err to status codes if ( e instanceof Deno.errors.BadResource || diff --git a/tests/unit_node/tls_test.ts b/tests/unit_node/tls_test.ts index 43d6205b0b..627b948cd1 100644 --- a/tests/unit_node/tls_test.ts +++ b/tests/unit_node/tls_test.ts @@ -257,3 +257,17 @@ Deno.test("TLSSocket.alpnProtocol is set for client", async () => { listener.close(); await new Promise((resolve) => outgoing.on("close", resolve)); }); + +Deno.test("tls connect upgrade tcp", async () => { + const { promise, resolve } = Promise.withResolvers(); + + const socket = new net.Socket(); + socket.connect(443, "google.com"); + socket.on("connect", () => { + const secure = tls.connect({ socket }); + secure.on("secureConnect", () => resolve()); + }); + + await promise; + socket.destroy(); +}); From 32e260d55a364f7b3151b74ff4ba9585a11d11e1 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Thu, 28 Nov 2024 14:51:24 +0100 Subject: [PATCH 189/227] fix: support bun specifiers in JSR publish (#24588) Fixes https://github.com/denoland/deno/issues/26989 --------- Co-authored-by: Nathan Whitaker --- cli/graph_util.rs | 23 +++++++++++++++- cli/tools/registry/diagnostics.rs | 2 +- cli/tools/registry/graph.rs | 2 +- cli/tsc/mod.rs | 26 +++++++++++-------- .../publish/bun_specifier/__test__.jsonc | 4 +++ .../publish/bun_specifier/bun_specifier.out | 6 +++++ tests/specs/publish/bun_specifier/deno.json | 8 ++++++ tests/specs/publish/bun_specifier/mod.ts | 1 + .../publish/invalid_import/invalid_import.out | 4 +-- .../invalid_import_esm_sh_suggestion.out | 2 +- .../publish/prefer_fast_check_graph/main.out | 2 +- 11 files changed, 62 insertions(+), 18 deletions(-) create mode 100644 tests/specs/publish/bun_specifier/__test__.jsonc create mode 100644 tests/specs/publish/bun_specifier/bun_specifier.out create mode 100644 tests/specs/publish/bun_specifier/deno.json create mode 100644 tests/specs/publish/bun_specifier/mod.ts diff --git a/cli/graph_util.rs b/cli/graph_util.rs index 360021d22d..63997dc9ce 100644 --- a/cli/graph_util.rs +++ b/cli/graph_util.rs @@ -6,6 +6,7 @@ use crate::args::CliLockfile; use crate::args::CliOptions; use crate::args::DENO_DISABLE_PEDANTIC_NODE_WARNINGS; use crate::cache; +use crate::cache::FetchCacher; use crate::cache::GlobalHttpCache; use crate::cache::ModuleInfoCache; use crate::cache::ParsedSourceCache; @@ -254,6 +255,23 @@ impl ModuleGraphCreator { package_configs: &[JsrPackageConfig], build_fast_check_graph: bool, ) -> Result { + struct PublishLoader(FetchCacher); + impl Loader for PublishLoader { + fn load( + &self, + specifier: &deno_ast::ModuleSpecifier, + options: deno_graph::source::LoadOptions, + ) -> deno_graph::source::LoadFuture { + if specifier.scheme() == "bun" { + return Box::pin(std::future::ready(Ok(Some( + deno_graph::source::LoadResponse::External { + specifier: specifier.clone(), + }, + )))); + } + self.0.load(specifier, options) + } + } fn graph_has_external_remote(graph: &ModuleGraph) -> bool { // Earlier on, we marked external non-JSR modules as external. // If the graph contains any of those, it would cause type checking @@ -271,12 +289,15 @@ impl ModuleGraphCreator { for package_config in package_configs { roots.extend(package_config.config_file.resolve_export_value_urls()?); } + + let loader = self.module_graph_builder.create_graph_loader(); + let mut publish_loader = PublishLoader(loader); let mut graph = self .create_graph_with_options(CreateGraphOptions { is_dynamic: false, graph_kind: deno_graph::GraphKind::All, roots, - loader: None, + loader: Some(&mut publish_loader), }) .await?; self.graph_valid(&graph)?; diff --git a/cli/tools/registry/diagnostics.rs b/cli/tools/registry/diagnostics.rs index f2b630d782..ef38affc30 100644 --- a/cli/tools/registry/diagnostics.rs +++ b/cli/tools/registry/diagnostics.rs @@ -476,7 +476,7 @@ impl Diagnostic for PublishDiagnostic { InvalidExternalImport { imported, .. } => Cow::Owned(vec![ Cow::Owned(format!("the import was resolved to '{}'", imported)), Cow::Borrowed("this specifier is not allowed to be imported on jsr"), - Cow::Borrowed("jsr only supports importing `jsr:`, `npm:`, and `data:` specifiers"), + Cow::Borrowed("jsr only supports importing `jsr:`, `npm:`, `data:`, `bun:`, and `node:` specifiers"), ]), UnsupportedJsxTsx { .. } => Cow::Owned(vec![ Cow::Borrowed("follow https://github.com/jsr-io/jsr/issues/24 for updates"), diff --git a/cli/tools/registry/graph.rs b/cli/tools/registry/graph.rs index 184557e5df..21962d009e 100644 --- a/cli/tools/registry/graph.rs +++ b/cli/tools/registry/graph.rs @@ -47,7 +47,7 @@ impl GraphDiagnosticsCollector { resolution: &ResolutionResolved| { if visited.insert(resolution.specifier.clone()) { match resolution.specifier.scheme() { - "file" | "data" | "node" => {} + "file" | "data" | "node" | "bun" => {} "jsr" => { skip_specifiers.insert(resolution.specifier.clone()); diff --git a/cli/tsc/mod.rs b/cli/tsc/mod.rs index 50127b093d..a8e8d73b68 100644 --- a/cli/tsc/mod.rs +++ b/cli/tsc/mod.rs @@ -656,17 +656,21 @@ fn op_load_inner( } Module::Npm(_) | Module::Node(_) => None, Module::External(module) => { - // means it's Deno code importing an npm module - let specifier = node::resolve_specifier_into_node_modules( - &module.specifier, - &deno_fs::RealFs, - ); - Some(Cow::Owned(load_from_node_modules( - &specifier, - state.maybe_npm.as_ref(), - &mut media_type, - &mut is_cjs, - )?)) + if module.specifier.scheme() != "file" { + None + } else { + // means it's Deno code importing an npm module + let specifier = node::resolve_specifier_into_node_modules( + &module.specifier, + &deno_fs::RealFs, + ); + Some(Cow::Owned(load_from_node_modules( + &specifier, + state.maybe_npm.as_ref(), + &mut media_type, + &mut is_cjs, + )?)) + } } } } else if let Some(npm) = state diff --git a/tests/specs/publish/bun_specifier/__test__.jsonc b/tests/specs/publish/bun_specifier/__test__.jsonc new file mode 100644 index 0000000000..4124845ba9 --- /dev/null +++ b/tests/specs/publish/bun_specifier/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "publish --token 'sadfasdf'", + "output": "bun_specifier.out" +} diff --git a/tests/specs/publish/bun_specifier/bun_specifier.out b/tests/specs/publish/bun_specifier/bun_specifier.out new file mode 100644 index 0000000000..af45ed598b --- /dev/null +++ b/tests/specs/publish/bun_specifier/bun_specifier.out @@ -0,0 +1,6 @@ +Check file:///[WILDCARD]/mod.ts +Checking for slow types in the public API... +Check file:///[WILDCARD]/mod.ts +Publishing @foo/bar@1.0.0 ... +Successfully published @foo/bar@1.0.0 +Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/specs/publish/bun_specifier/deno.json b/tests/specs/publish/bun_specifier/deno.json new file mode 100644 index 0000000000..0657aefdbb --- /dev/null +++ b/tests/specs/publish/bun_specifier/deno.json @@ -0,0 +1,8 @@ +{ + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + }, + "license": "MIT" +} diff --git a/tests/specs/publish/bun_specifier/mod.ts b/tests/specs/publish/bun_specifier/mod.ts new file mode 100644 index 0000000000..ad7ca6152c --- /dev/null +++ b/tests/specs/publish/bun_specifier/mod.ts @@ -0,0 +1 @@ +import "bun:sqlite"; diff --git a/tests/specs/publish/invalid_import/invalid_import.out b/tests/specs/publish/invalid_import/invalid_import.out index 6914dc51e0..3b795ba2e9 100644 --- a/tests/specs/publish/invalid_import/invalid_import.out +++ b/tests/specs/publish/invalid_import/invalid_import.out @@ -12,7 +12,7 @@ error[invalid-external-import]: invalid import to a non-JSR 'http' specifier info: the import was resolved to 'http://localhost:4545/welcome.ts' info: this specifier is not allowed to be imported on jsr - info: jsr only supports importing `jsr:`, `npm:`, and `data:` specifiers + info: jsr only supports importing `jsr:`, `npm:`, `data:`, `bun:`, and `node:` specifiers docs: https://jsr.io/go/invalid-external-import error[invalid-external-import]: invalid import to a non-JSR 'http' specifier @@ -25,7 +25,7 @@ error[invalid-external-import]: invalid import to a non-JSR 'http' specifier info: the import was resolved to 'http://localhost:4545/echo.ts' info: this specifier is not allowed to be imported on jsr - info: jsr only supports importing `jsr:`, `npm:`, and `data:` specifiers + info: jsr only supports importing `jsr:`, `npm:`, `data:`, `bun:`, and `node:` specifiers docs: https://jsr.io/go/invalid-external-import error: Found 2 problems diff --git a/tests/specs/publish/invalid_import_esm_sh_suggestion/invalid_import_esm_sh_suggestion.out b/tests/specs/publish/invalid_import_esm_sh_suggestion/invalid_import_esm_sh_suggestion.out index b0a544df89..1de23c0bae 100644 --- a/tests/specs/publish/invalid_import_esm_sh_suggestion/invalid_import_esm_sh_suggestion.out +++ b/tests/specs/publish/invalid_import_esm_sh_suggestion/invalid_import_esm_sh_suggestion.out @@ -13,7 +13,7 @@ error[invalid-external-import]: invalid import to a non-JSR 'http' specifier info: the import was resolved to 'http://esm.sh/react-dom@18.2.0/server' info: this specifier is not allowed to be imported on jsr - info: jsr only supports importing `jsr:`, `npm:`, and `data:` specifiers + info: jsr only supports importing `jsr:`, `npm:`, `data:`, `bun:`, and `node:` specifiers docs: https://jsr.io/go/invalid-external-import error: Found 1 problem diff --git a/tests/specs/publish/prefer_fast_check_graph/main.out b/tests/specs/publish/prefer_fast_check_graph/main.out index dd7d052c92..3ff4d33a30 100644 --- a/tests/specs/publish/prefer_fast_check_graph/main.out +++ b/tests/specs/publish/prefer_fast_check_graph/main.out @@ -13,7 +13,7 @@ error[invalid-external-import]: invalid import to a non-JSR 'https' specifier info: the import was resolved to 'https://deno.land/std/assert/assert.ts' info: this specifier is not allowed to be imported on jsr - info: jsr only supports importing `jsr:`, `npm:`, and `data:` specifiers + info: jsr only supports importing `jsr:`, `npm:`, `data:`, `bun:`, and `node:` specifiers docs: https://jsr.io/go/invalid-external-import error: Found 1 problem From 026bbc4a9edf1372779c4ce4d2052710b5ff24fc Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Thu, 28 Nov 2024 15:07:32 +0100 Subject: [PATCH 190/227] fix(init): support scoped npm packages (#27128) The naming scheme for create npm packages varies depending on whether they are scoped or not. We only supported unscoped packages prior to this PR. This PR adds support for all the following cases which npm supports: - `foo` -> `create-foo` - `@foo/bar` -> `@foo/create-bar` - `@foo` -> `@foo/create` - `@foo@2.0.0` -> `@foo/create@2.0.0` - `@foo/bar@2.0.0` -> `@foo/create-bar@2.0.0` See https://docs.npmjs.com/cli/v8/commands/npm-init#description Fixes https://github.com/denoland/deno/issues/27127 --- cli/tools/init/mod.rs | 74 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/cli/tools/init/mod.rs b/cli/tools/init/mod.rs index 25b86cb957..36bdbac2bc 100644 --- a/cli/tools/init/mod.rs +++ b/cli/tools/init/mod.rs @@ -252,8 +252,46 @@ Deno.test(function addTest() { Ok(0) } +fn npm_name_to_create_package(name: &str) -> String { + let mut s = "npm:".to_string(); + + let mut scoped = false; + let mut create = false; + + for (i, ch) in name.char_indices() { + if i == 0 { + if ch == '@' { + scoped = true; + } else { + create = true; + s.push_str("create-"); + } + } else if scoped { + if ch == '/' { + scoped = false; + create = true; + s.push_str("/create-"); + continue; + } else if ch == '@' && !create { + scoped = false; + create = true; + s.push_str("/create@"); + continue; + } + } + + s.push(ch); + } + + if !create { + s.push_str("/create"); + } + + s +} + async fn init_npm(name: &str, args: Vec) -> Result { - let script_name = format!("npm:create-{}", name); + let script_name = npm_name_to_create_package(name); fn print_manual_usage(script_name: &str, args: &[String]) -> i32 { log::info!("{}", cformat!("You can initialize project manually by running deno run {} {} and applying desired permissions.", script_name, args.join(" "))); @@ -336,3 +374,37 @@ fn create_file( Ok(()) } } + +#[cfg(test)] +mod test { + use crate::tools::init::npm_name_to_create_package; + + #[test] + fn npm_name_to_create_package_test() { + // See https://docs.npmjs.com/cli/v8/commands/npm-init#description + assert_eq!( + npm_name_to_create_package("foo"), + "npm:create-foo".to_string() + ); + assert_eq!( + npm_name_to_create_package("foo@1.0.0"), + "npm:create-foo@1.0.0".to_string() + ); + assert_eq!( + npm_name_to_create_package("@foo"), + "npm:@foo/create".to_string() + ); + assert_eq!( + npm_name_to_create_package("@foo@1.0.0"), + "npm:@foo/create@1.0.0".to_string() + ); + assert_eq!( + npm_name_to_create_package("@foo/bar"), + "npm:@foo/create-bar".to_string() + ); + assert_eq!( + npm_name_to_create_package("@foo/bar@1.0.0"), + "npm:@foo/create-bar@1.0.0".to_string() + ); + } +} From 39722f190a2a3d52ce3592c2283cd33a614325cc Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Thu, 28 Nov 2024 15:11:51 +0100 Subject: [PATCH 191/227] fix(node/timers): error when passing id to clearTimeout/clearInterval (#27130) As pointed out in https://github.com/denoland/deno/issues/27126 we used a variable which could potentially be of type `number` instead of the `Timeout` class instance. Ensure that we're always setting `_destroyed` on the class instead instead. Fixes https://github.com/denoland/deno/issues/27126 --- ext/node/polyfills/timers.ts | 4 ++-- tests/unit_node/timers_test.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ext/node/polyfills/timers.ts b/ext/node/polyfills/timers.ts index e826416ed8..fa5f7a2042 100644 --- a/ext/node/polyfills/timers.ts +++ b/ext/node/polyfills/timers.ts @@ -54,7 +54,7 @@ export function clearTimeout(timeout?: Timeout | number) { const id = +timeout; const timer = MapPrototypeGet(activeTimers, id); if (timer) { - timeout._destroyed = true; + timer._destroyed = true; MapPrototypeDelete(activeTimers, id); } clearTimeout_(id); @@ -74,7 +74,7 @@ export function clearInterval(timeout?: Timeout | number | string) { const id = +timeout; const timer = MapPrototypeGet(activeTimers, id); if (timer) { - timeout._destroyed = true; + timer._destroyed = true; MapPrototypeDelete(activeTimers, id); } clearInterval_(id); diff --git a/tests/unit_node/timers_test.ts b/tests/unit_node/timers_test.ts index 10c42e892c..ecff32e763 100644 --- a/tests/unit_node/timers_test.ts +++ b/tests/unit_node/timers_test.ts @@ -100,6 +100,16 @@ Deno.test("[node/timers refresh cancelled timer]", () => { p.refresh(); }); +Deno.test("[node/timers] clearTimeout with number", () => { + const timer = +timers.setTimeout(() => fail(), 10); + timers.clearTimeout(timer); +}); + +Deno.test("[node/timers] clearInterval with number", () => { + const timer = +timers.setInterval(() => fail(), 10); + timers.clearInterval(timer); +}); + Deno.test("[node/timers setImmediate returns Immediate object]", () => { const { clearImmediate, setImmediate } = timers; From 12aea2014aafa379b324cda759a95f0bbc579b43 Mon Sep 17 00:00:00 2001 From: denobot <33910674+denobot@users.noreply.github.com> Date: Thu, 28 Nov 2024 18:00:24 +0100 Subject: [PATCH 192/227] chore: forward v2.1.2 release commit to main (#27136) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the release commit being forwarded back to main for 2.1.2 Co-authored-by: bartlomieju Co-authored-by: Bartek Iwańczuk --- .github/workflows/ci.generate.ts | 2 +- .github/workflows/ci.yml | 8 ++--- Cargo.lock | 60 ++++++++++++++++---------------- Cargo.toml | 58 +++++++++++++++--------------- Releases.md | 44 +++++++++++++++++++++++ bench_util/Cargo.toml | 2 +- cli/Cargo.toml | 2 +- ext/broadcast_channel/Cargo.toml | 2 +- ext/cache/Cargo.toml | 2 +- ext/canvas/Cargo.toml | 2 +- ext/console/Cargo.toml | 2 +- ext/cron/Cargo.toml | 2 +- ext/crypto/Cargo.toml | 2 +- ext/fetch/Cargo.toml | 2 +- ext/ffi/Cargo.toml | 2 +- ext/fs/Cargo.toml | 2 +- ext/http/Cargo.toml | 2 +- ext/io/Cargo.toml | 2 +- ext/kv/Cargo.toml | 2 +- ext/napi/Cargo.toml | 2 +- ext/napi/sym/Cargo.toml | 2 +- ext/net/Cargo.toml | 2 +- ext/node/Cargo.toml | 2 +- ext/telemetry/Cargo.toml | 2 +- ext/tls/Cargo.toml | 2 +- ext/url/Cargo.toml | 2 +- ext/web/Cargo.toml | 2 +- ext/webgpu/Cargo.toml | 2 +- ext/webidl/Cargo.toml | 2 +- ext/websocket/Cargo.toml | 2 +- ext/webstorage/Cargo.toml | 2 +- resolvers/deno/Cargo.toml | 2 +- resolvers/node/Cargo.toml | 2 +- runtime/Cargo.toml | 2 +- runtime/permissions/Cargo.toml | 2 +- 35 files changed, 138 insertions(+), 94 deletions(-) diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts index 53a0f46e50..9a166e6cf0 100755 --- a/.github/workflows/ci.generate.ts +++ b/.github/workflows/ci.generate.ts @@ -5,7 +5,7 @@ import { stringify } from "jsr:@std/yaml@^0.221/stringify"; // Bump this number when you want to purge the cache. // Note: the tools/release/01_bump_crate_versions.ts script will update this version // automatically via regex, so ensure that this line maintains this format. -const cacheVersion = 27; +const cacheVersion = 28; const ubuntuX86Runner = "ubuntu-24.04"; const ubuntuX86XlRunner = "ubuntu-24.04-xl"; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee8527bcef..dd48f1fb0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -361,8 +361,8 @@ jobs: path: |- ~/.cargo/registry/index ~/.cargo/registry/cache - key: '27-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}' - restore-keys: '27-cargo-home-${{ matrix.os }}-${{ matrix.arch }}' + key: '28-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}' + restore-keys: '28-cargo-home-${{ matrix.os }}-${{ matrix.arch }}' if: '!(matrix.skip)' - name: Restore cache build output (PR) uses: actions/cache/restore@v4 @@ -375,7 +375,7 @@ jobs: !./target/*/*.zip !./target/*/*.tar.gz key: never_saved - restore-keys: '27-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-' + restore-keys: '28-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-' - name: Apply and update mtime cache if: '!(matrix.skip) && (!startsWith(github.ref, ''refs/tags/''))' uses: ./.github/mtime_cache @@ -685,7 +685,7 @@ jobs: !./target/*/*.zip !./target/*/*.sha256sum !./target/*/*.tar.gz - key: '27-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}' + key: '28-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}' publish-canary: name: publish canary runs-on: ubuntu-24.04 diff --git a/Cargo.lock b/Cargo.lock index fc567b4a38..5e27d1a801 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1194,7 +1194,7 @@ dependencies = [ [[package]] name = "deno" -version = "2.1.1" +version = "2.1.2" dependencies = [ "anstream", "async-trait", @@ -1365,7 +1365,7 @@ dependencies = [ [[package]] name = "deno_bench_util" -version = "0.173.0" +version = "0.174.0" dependencies = [ "bencher", "deno_core", @@ -1374,7 +1374,7 @@ dependencies = [ [[package]] name = "deno_broadcast_channel" -version = "0.173.0" +version = "0.174.0" dependencies = [ "async-trait", "deno_core", @@ -1385,7 +1385,7 @@ dependencies = [ [[package]] name = "deno_cache" -version = "0.111.0" +version = "0.112.0" dependencies = [ "async-trait", "deno_core", @@ -1418,7 +1418,7 @@ dependencies = [ [[package]] name = "deno_canvas" -version = "0.48.0" +version = "0.49.0" dependencies = [ "deno_core", "deno_webgpu", @@ -1453,7 +1453,7 @@ dependencies = [ [[package]] name = "deno_console" -version = "0.179.0" +version = "0.180.0" dependencies = [ "deno_core", ] @@ -1501,7 +1501,7 @@ checksum = "fe4dccb6147bb3f3ba0c7a48e993bfeb999d2c2e47a81badee80e2b370c8d695" [[package]] name = "deno_cron" -version = "0.59.0" +version = "0.60.0" dependencies = [ "anyhow", "async-trait", @@ -1514,7 +1514,7 @@ dependencies = [ [[package]] name = "deno_crypto" -version = "0.193.0" +version = "0.194.0" dependencies = [ "aes", "aes-gcm", @@ -1580,7 +1580,7 @@ dependencies = [ [[package]] name = "deno_fetch" -version = "0.203.0" +version = "0.204.0" dependencies = [ "base64 0.21.7", "bytes", @@ -1614,7 +1614,7 @@ dependencies = [ [[package]] name = "deno_ffi" -version = "0.166.0" +version = "0.167.0" dependencies = [ "deno_core", "deno_permissions", @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "deno_fs" -version = "0.89.0" +version = "0.90.0" dependencies = [ "async-trait", "base32", @@ -1687,7 +1687,7 @@ dependencies = [ [[package]] name = "deno_http" -version = "0.177.0" +version = "0.178.0" dependencies = [ "async-compression", "async-trait", @@ -1726,7 +1726,7 @@ dependencies = [ [[package]] name = "deno_io" -version = "0.89.0" +version = "0.90.0" dependencies = [ "async-trait", "deno_core", @@ -1747,7 +1747,7 @@ dependencies = [ [[package]] name = "deno_kv" -version = "0.87.0" +version = "0.88.0" dependencies = [ "anyhow", "async-trait", @@ -1820,7 +1820,7 @@ dependencies = [ [[package]] name = "deno_napi" -version = "0.110.0" +version = "0.111.0" dependencies = [ "deno_core", "deno_permissions", @@ -1848,7 +1848,7 @@ dependencies = [ [[package]] name = "deno_net" -version = "0.171.0" +version = "0.172.0" dependencies = [ "deno_core", "deno_permissions", @@ -1865,7 +1865,7 @@ dependencies = [ [[package]] name = "deno_node" -version = "0.116.0" +version = "0.117.0" dependencies = [ "aead-gcm-stream", "aes", @@ -2017,7 +2017,7 @@ dependencies = [ [[package]] name = "deno_permissions" -version = "0.39.0" +version = "0.40.0" dependencies = [ "deno_core", "deno_path_util", @@ -2035,7 +2035,7 @@ dependencies = [ [[package]] name = "deno_resolver" -version = "0.11.0" +version = "0.12.0" dependencies = [ "anyhow", "base32", @@ -2054,7 +2054,7 @@ dependencies = [ [[package]] name = "deno_runtime" -version = "0.188.0" +version = "0.189.0" dependencies = [ "color-print", "deno_ast", @@ -2153,7 +2153,7 @@ dependencies = [ [[package]] name = "deno_telemetry" -version = "0.1.0" +version = "0.2.0" dependencies = [ "async-trait", "deno_core", @@ -2194,7 +2194,7 @@ dependencies = [ [[package]] name = "deno_tls" -version = "0.166.0" +version = "0.167.0" dependencies = [ "deno_core", "deno_native_certs", @@ -2243,7 +2243,7 @@ dependencies = [ [[package]] name = "deno_url" -version = "0.179.0" +version = "0.180.0" dependencies = [ "deno_bench_util", "deno_console", @@ -2255,7 +2255,7 @@ dependencies = [ [[package]] name = "deno_web" -version = "0.210.0" +version = "0.211.0" dependencies = [ "async-trait", "base64-simd 0.8.0", @@ -2277,7 +2277,7 @@ dependencies = [ [[package]] name = "deno_webgpu" -version = "0.146.0" +version = "0.147.0" dependencies = [ "deno_core", "raw-window-handle", @@ -2290,7 +2290,7 @@ dependencies = [ [[package]] name = "deno_webidl" -version = "0.179.0" +version = "0.180.0" dependencies = [ "deno_bench_util", "deno_core", @@ -2298,7 +2298,7 @@ dependencies = [ [[package]] name = "deno_websocket" -version = "0.184.0" +version = "0.185.0" dependencies = [ "bytes", "deno_core", @@ -2320,7 +2320,7 @@ dependencies = [ [[package]] name = "deno_webstorage" -version = "0.174.0" +version = "0.175.0" dependencies = [ "deno_core", "deno_web", @@ -4833,7 +4833,7 @@ dependencies = [ [[package]] name = "napi_sym" -version = "0.109.0" +version = "0.110.0" dependencies = [ "quote", "serde", @@ -4888,7 +4888,7 @@ dependencies = [ [[package]] name = "node_resolver" -version = "0.18.0" +version = "0.19.0" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 652d55e071..1ca9fcb66b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,17 +49,17 @@ repository = "https://github.com/denoland/deno" deno_ast = { version = "=0.43.3", features = ["transpiling"] } deno_core = { version = "0.323.0" } -deno_bench_util = { version = "0.173.0", path = "./bench_util" } +deno_bench_util = { version = "0.174.0", path = "./bench_util" } deno_config = { version = "=0.39.2", features = ["workspace", "sync"] } deno_lockfile = "=0.23.1" deno_media_type = { version = "0.2.0", features = ["module_specifier"] } deno_npm = "=0.25.4" deno_path_util = "=0.2.1" -deno_permissions = { version = "0.39.0", path = "./runtime/permissions" } -deno_runtime = { version = "0.188.0", path = "./runtime" } +deno_permissions = { version = "0.40.0", path = "./runtime/permissions" } +deno_runtime = { version = "0.189.0", path = "./runtime" } deno_semver = "=0.5.16" deno_terminal = "0.2.0" -napi_sym = { version = "0.109.0", path = "./ext/napi/sym" } +napi_sym = { version = "0.110.0", path = "./ext/napi/sym" } test_util = { package = "test_server", path = "./tests/util/server" } denokv_proto = "0.8.4" @@ -68,33 +68,33 @@ denokv_remote = "0.8.4" denokv_sqlite = { default-features = false, version = "0.8.4" } # exts -deno_broadcast_channel = { version = "0.173.0", path = "./ext/broadcast_channel" } -deno_cache = { version = "0.111.0", path = "./ext/cache" } -deno_canvas = { version = "0.48.0", path = "./ext/canvas" } -deno_console = { version = "0.179.0", path = "./ext/console" } -deno_cron = { version = "0.59.0", path = "./ext/cron" } -deno_crypto = { version = "0.193.0", path = "./ext/crypto" } -deno_fetch = { version = "0.203.0", path = "./ext/fetch" } -deno_ffi = { version = "0.166.0", path = "./ext/ffi" } -deno_fs = { version = "0.89.0", path = "./ext/fs" } -deno_http = { version = "0.177.0", path = "./ext/http" } -deno_io = { version = "0.89.0", path = "./ext/io" } -deno_kv = { version = "0.87.0", path = "./ext/kv" } -deno_napi = { version = "0.110.0", path = "./ext/napi" } -deno_net = { version = "0.171.0", path = "./ext/net" } -deno_node = { version = "0.116.0", path = "./ext/node" } -deno_telemetry = { version = "0.1.0", path = "./ext/telemetry" } -deno_tls = { version = "0.166.0", path = "./ext/tls" } -deno_url = { version = "0.179.0", path = "./ext/url" } -deno_web = { version = "0.210.0", path = "./ext/web" } -deno_webgpu = { version = "0.146.0", path = "./ext/webgpu" } -deno_webidl = { version = "0.179.0", path = "./ext/webidl" } -deno_websocket = { version = "0.184.0", path = "./ext/websocket" } -deno_webstorage = { version = "0.174.0", path = "./ext/webstorage" } +deno_broadcast_channel = { version = "0.174.0", path = "./ext/broadcast_channel" } +deno_cache = { version = "0.112.0", path = "./ext/cache" } +deno_canvas = { version = "0.49.0", path = "./ext/canvas" } +deno_console = { version = "0.180.0", path = "./ext/console" } +deno_cron = { version = "0.60.0", path = "./ext/cron" } +deno_crypto = { version = "0.194.0", path = "./ext/crypto" } +deno_fetch = { version = "0.204.0", path = "./ext/fetch" } +deno_ffi = { version = "0.167.0", path = "./ext/ffi" } +deno_fs = { version = "0.90.0", path = "./ext/fs" } +deno_http = { version = "0.178.0", path = "./ext/http" } +deno_io = { version = "0.90.0", path = "./ext/io" } +deno_kv = { version = "0.88.0", path = "./ext/kv" } +deno_napi = { version = "0.111.0", path = "./ext/napi" } +deno_net = { version = "0.172.0", path = "./ext/net" } +deno_node = { version = "0.117.0", path = "./ext/node" } +deno_telemetry = { version = "0.2.0", path = "./ext/telemetry" } +deno_tls = { version = "0.167.0", path = "./ext/tls" } +deno_url = { version = "0.180.0", path = "./ext/url" } +deno_web = { version = "0.211.0", path = "./ext/web" } +deno_webgpu = { version = "0.147.0", path = "./ext/webgpu" } +deno_webidl = { version = "0.180.0", path = "./ext/webidl" } +deno_websocket = { version = "0.185.0", path = "./ext/websocket" } +deno_webstorage = { version = "0.175.0", path = "./ext/webstorage" } # resolvers -deno_resolver = { version = "0.11.0", path = "./resolvers/deno" } -node_resolver = { version = "0.18.0", path = "./resolvers/node" } +deno_resolver = { version = "0.12.0", path = "./resolvers/deno" } +node_resolver = { version = "0.19.0", path = "./resolvers/node" } aes = "=0.8.3" anyhow = "1.0.57" diff --git a/Releases.md b/Releases.md index 0e977d0311..6f9083ffde 100644 --- a/Releases.md +++ b/Releases.md @@ -6,6 +6,50 @@ https://github.com/denoland/deno/releases We also have one-line install commands at: https://github.com/denoland/deno_install +### 2.1.2 / 2024.11.28 + +- feat(unstable): Instrument Deno.serve (#26964) +- feat(unstable): Instrument fetch (#27057) +- feat(unstable): repurpose `--unstable-detect-cjs` to attempt loading more + modules as cjs (#27094) +- fix(check): support jsdoc `@import` tag (#26991) +- fix(compile): correct buffered reading of assets and files (#27008) +- fix(compile): do not error embedding same symlink via multiple methods + (#27015) +- fix(compile): handle TypeScript file included as asset (#27032) +- fix(ext/fetch): don't throw when `bodyUsed` inspect after upgrade (#27088) +- fix(ext/node): `tls.connect` socket upgrades (#27125) +- fix(ext/node): add `fs.promises.fstat` and `FileHandle#stat` (#26719) +- fix(ext/webgpu): normalize limits to number (#27072) +- fix(ext/webgpu): use correct variable name (#27108) +- fix(ext/websocket): don't throw exception when sending to closed socket + (#26932) +- fix(fmt): return `None` if sql fmt result is the same (#27014) +- fix(info): resolve bare specifier pointing to workspace member (#27020) +- fix(init): always force managed node modules (#27047) +- fix(init): support scoped npm packages (#27128) +- fix(install): don't re-set up node_modules if running lifecycle script + (#26984) +- fix(lsp): remove stray debug output (#27010) +- fix(lsp): support task object notation for tasks request (#27076) +- fix(lsp): wasm file import completions (#27018) +- fix(node): correct resolution of dynamic import of esm from cjs (#27071) +- fix(node/fs): add missing stat path argument validation (#27086) +- fix(node/fs): missing uv error context for readFile (#27011) +- fix(node/http): casing ignored in ServerResponse.hasHeader() (#27105) +- fix(node/timers): error when passing id to clearTimeout/clearInterval (#27130) +- fix(runtime/ops): Fix watchfs remove event (#27041) +- fix(streams): reject `string` in `ReadableStream.from` type (#25116) +- fix(task): handle carriage return in task description (#27099) +- fix(task): handle multiline descriptions properly (#27069) +- fix(task): strip ansi codes and control chars when printing tasks (#27100) +- fix(tools/doc): HTML resolve main entrypoint from config file (#27103) +- fix: support bun specifiers in JSR publish (#24588) +- fix: support non-function exports in Wasm modules (#26992) +- perf(compile): read embedded files as static references when UTF-8 and reading + as strings (#27033) +- perf(ext/webstorage): use object wrap for `Storage` (#26931) + ### 2.1.1 / 2024.11.21 - docs(add): clarification to add command (#26968) diff --git a/bench_util/Cargo.toml b/bench_util/Cargo.toml index 4d39ae30e4..4d2284b6d9 100644 --- a/bench_util/Cargo.toml +++ b/bench_util/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_bench_util" -version = "0.173.0" +version = "0.174.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/cli/Cargo.toml b/cli/Cargo.toml index fd28b315d4..dd75f903e4 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno" -version = "2.1.1" +version = "2.1.2" authors.workspace = true default-run = "deno" edition.workspace = true diff --git a/ext/broadcast_channel/Cargo.toml b/ext/broadcast_channel/Cargo.toml index e7c3f584b6..a038359287 100644 --- a/ext/broadcast_channel/Cargo.toml +++ b/ext/broadcast_channel/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_broadcast_channel" -version = "0.173.0" +version = "0.174.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/cache/Cargo.toml b/ext/cache/Cargo.toml index 9005bf5b24..edaf443c05 100644 --- a/ext/cache/Cargo.toml +++ b/ext/cache/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_cache" -version = "0.111.0" +version = "0.112.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/canvas/Cargo.toml b/ext/canvas/Cargo.toml index 5dca442437..db624670f3 100644 --- a/ext/canvas/Cargo.toml +++ b/ext/canvas/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_canvas" -version = "0.48.0" +version = "0.49.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/console/Cargo.toml b/ext/console/Cargo.toml index 1d76390b6e..49ad243456 100644 --- a/ext/console/Cargo.toml +++ b/ext/console/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_console" -version = "0.179.0" +version = "0.180.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/cron/Cargo.toml b/ext/cron/Cargo.toml index d1809da135..d8f7f20d0c 100644 --- a/ext/cron/Cargo.toml +++ b/ext/cron/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_cron" -version = "0.59.0" +version = "0.60.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/crypto/Cargo.toml b/ext/crypto/Cargo.toml index dfb81c62a3..d8b740e087 100644 --- a/ext/crypto/Cargo.toml +++ b/ext/crypto/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_crypto" -version = "0.193.0" +version = "0.194.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/fetch/Cargo.toml b/ext/fetch/Cargo.toml index 90b1b152d9..96d6a45a1f 100644 --- a/ext/fetch/Cargo.toml +++ b/ext/fetch/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_fetch" -version = "0.203.0" +version = "0.204.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/ffi/Cargo.toml b/ext/ffi/Cargo.toml index 2f0813a58b..23deb30810 100644 --- a/ext/ffi/Cargo.toml +++ b/ext/ffi/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_ffi" -version = "0.166.0" +version = "0.167.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/fs/Cargo.toml b/ext/fs/Cargo.toml index 1d7d5d3d9a..3fbcef4475 100644 --- a/ext/fs/Cargo.toml +++ b/ext/fs/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_fs" -version = "0.89.0" +version = "0.90.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/http/Cargo.toml b/ext/http/Cargo.toml index 5dc3cd9a7b..5d7eec7353 100644 --- a/ext/http/Cargo.toml +++ b/ext/http/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_http" -version = "0.177.0" +version = "0.178.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/io/Cargo.toml b/ext/io/Cargo.toml index caaf67ab0b..b8a14acd6f 100644 --- a/ext/io/Cargo.toml +++ b/ext/io/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_io" -version = "0.89.0" +version = "0.90.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/kv/Cargo.toml b/ext/kv/Cargo.toml index 972aabfbb7..3d050d9bbb 100644 --- a/ext/kv/Cargo.toml +++ b/ext/kv/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_kv" -version = "0.87.0" +version = "0.88.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/napi/Cargo.toml b/ext/napi/Cargo.toml index f9a1f73007..0910aacc7f 100644 --- a/ext/napi/Cargo.toml +++ b/ext/napi/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_napi" -version = "0.110.0" +version = "0.111.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/napi/sym/Cargo.toml b/ext/napi/sym/Cargo.toml index 74d7b450ba..ed69781fc3 100644 --- a/ext/napi/sym/Cargo.toml +++ b/ext/napi/sym/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "napi_sym" -version = "0.109.0" +version = "0.110.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/net/Cargo.toml b/ext/net/Cargo.toml index 8669f650e3..401ce08ff4 100644 --- a/ext/net/Cargo.toml +++ b/ext/net/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_net" -version = "0.171.0" +version = "0.172.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/node/Cargo.toml b/ext/node/Cargo.toml index 5e47a74e1d..89def9b0bc 100644 --- a/ext/node/Cargo.toml +++ b/ext/node/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_node" -version = "0.116.0" +version = "0.117.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/telemetry/Cargo.toml b/ext/telemetry/Cargo.toml index 6e0c40e873..12d7777491 100644 --- a/ext/telemetry/Cargo.toml +++ b/ext/telemetry/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_telemetry" -version = "0.1.0" +version = "0.2.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/tls/Cargo.toml b/ext/tls/Cargo.toml index 6b4bc98909..2819dc4344 100644 --- a/ext/tls/Cargo.toml +++ b/ext/tls/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_tls" -version = "0.166.0" +version = "0.167.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/url/Cargo.toml b/ext/url/Cargo.toml index e2ea7dae58..42cec915b5 100644 --- a/ext/url/Cargo.toml +++ b/ext/url/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_url" -version = "0.179.0" +version = "0.180.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/web/Cargo.toml b/ext/web/Cargo.toml index f56f21b72f..43c6d61053 100644 --- a/ext/web/Cargo.toml +++ b/ext/web/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_web" -version = "0.210.0" +version = "0.211.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/webgpu/Cargo.toml b/ext/webgpu/Cargo.toml index 93be59b734..f84550553e 100644 --- a/ext/webgpu/Cargo.toml +++ b/ext/webgpu/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webgpu" -version = "0.146.0" +version = "0.147.0" authors = ["the Deno authors"] edition.workspace = true license = "MIT" diff --git a/ext/webidl/Cargo.toml b/ext/webidl/Cargo.toml index 9bf65335c0..a60374bb8d 100644 --- a/ext/webidl/Cargo.toml +++ b/ext/webidl/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webidl" -version = "0.179.0" +version = "0.180.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/websocket/Cargo.toml b/ext/websocket/Cargo.toml index d6177dada0..3807cb8cd5 100644 --- a/ext/websocket/Cargo.toml +++ b/ext/websocket/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_websocket" -version = "0.184.0" +version = "0.185.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/webstorage/Cargo.toml b/ext/webstorage/Cargo.toml index 580eb95e2f..ca68d17629 100644 --- a/ext/webstorage/Cargo.toml +++ b/ext/webstorage/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webstorage" -version = "0.174.0" +version = "0.175.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/resolvers/deno/Cargo.toml b/resolvers/deno/Cargo.toml index b2c4bd2384..f5119478b8 100644 --- a/resolvers/deno/Cargo.toml +++ b/resolvers/deno/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_resolver" -version = "0.11.0" +version = "0.12.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/resolvers/node/Cargo.toml b/resolvers/node/Cargo.toml index fb30270573..40fd5b87aa 100644 --- a/resolvers/node/Cargo.toml +++ b/resolvers/node/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "node_resolver" -version = "0.18.0" +version = "0.19.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 1b960c2bdb..e4c0e188de 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_runtime" -version = "0.188.0" +version = "0.189.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/runtime/permissions/Cargo.toml b/runtime/permissions/Cargo.toml index efbc657055..5ecccdf7ec 100644 --- a/runtime/permissions/Cargo.toml +++ b/runtime/permissions/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_permissions" -version = "0.39.0" +version = "0.40.0" authors.workspace = true edition.workspace = true license.workspace = true From 3553aa913249a5940cd2a0828119ae3c89ad2f3d Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Thu, 28 Nov 2024 18:11:36 +0100 Subject: [PATCH 193/227] fix(publish): error on missing name field (#27131) This PR improves the error output on publish when the `name` filed is missing: ```json { "exports": "./mod.ts", "version": "0.0.1" } ``` Before: ```sh deno publish --dry-run error: You did not specify an entrypoint in file:///Users/marvinh/dev/test/deno-pkg-timers/deno.json. Add `exports` mapping in the configuration file, eg: { "name": "@scope/name", "version": "0.0.0", "exports": "" } ``` After: ```sh deno publish --dry-run error: Missing 'name' field in 'file:///Users/marvinh/dev/test/deno-pkg-timers/deno.json'. ``` Fixes https://github.com/denoland/deno/issues/27116 --- cli/tools/registry/mod.rs | 7 +++---- tests/specs/publish/missing_name/__test__.jsonc | 5 +++++ tests/specs/publish/missing_name/deno.json | 4 ++++ tests/specs/publish/missing_name/mod.ts | 3 +++ tests/specs/publish/missing_name/publish.out | 1 + 5 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 tests/specs/publish/missing_name/__test__.jsonc create mode 100644 tests/specs/publish/missing_name/deno.json create mode 100644 tests/specs/publish/missing_name/mod.ts create mode 100644 tests/specs/publish/missing_name/publish.out diff --git a/cli/tools/registry/mod.rs b/cli/tools/registry/mod.rs index ba61d352d3..a866660f36 100644 --- a/cli/tools/registry/mod.rs +++ b/cli/tools/registry/mod.rs @@ -97,11 +97,10 @@ pub async fn publish( match cli_options.start_dir.maybe_deno_json() { Some(deno_json) => { debug_assert!(!deno_json.is_package()); + if deno_json.json.name.is_none() { + bail!("Missing 'name' field in '{}'.", deno_json.specifier); + } error_missing_exports_field(deno_json)?; - bail!( - "Missing 'name' or 'exports' field in '{}'.", - deno_json.specifier - ); } None => { bail!( diff --git a/tests/specs/publish/missing_name/__test__.jsonc b/tests/specs/publish/missing_name/__test__.jsonc new file mode 100644 index 0000000000..241bb87e04 --- /dev/null +++ b/tests/specs/publish/missing_name/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "publish --token 'sadfasdf'", + "output": "publish.out", + "exitCode": 1 +} diff --git a/tests/specs/publish/missing_name/deno.json b/tests/specs/publish/missing_name/deno.json new file mode 100644 index 0000000000..4b0018cf62 --- /dev/null +++ b/tests/specs/publish/missing_name/deno.json @@ -0,0 +1,4 @@ +{ + "version": "1.0.0", + "exports": "./mod.ts" +} diff --git a/tests/specs/publish/missing_name/mod.ts b/tests/specs/publish/missing_name/mod.ts new file mode 100644 index 0000000000..8d9b8a22a1 --- /dev/null +++ b/tests/specs/publish/missing_name/mod.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number): number { + return a + b; +} diff --git a/tests/specs/publish/missing_name/publish.out b/tests/specs/publish/missing_name/publish.out new file mode 100644 index 0000000000..10e0688ef2 --- /dev/null +++ b/tests/specs/publish/missing_name/publish.out @@ -0,0 +1 @@ +error: Missing 'name' field in 'file:///[WILDCARD]deno.json'. From 8626ec7c25e25c628eed9fdd517c0ec20b01d0a6 Mon Sep 17 00:00:00 2001 From: Ian Bull Date: Thu, 28 Nov 2024 10:47:07 -0800 Subject: [PATCH 194/227] refactor(ext/fs): align error messages (#25414) Aligns the error messages in the ext/fs folder to be in-line with the Deno style guide. --- ext/fs/30_fs.js | 12 ++++++++---- tests/unit/files_test.ts | 8 ++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ext/fs/30_fs.js b/ext/fs/30_fs.js index 40513e7e02..fc2b18be13 100644 --- a/ext/fs/30_fs.js +++ b/ext/fs/30_fs.js @@ -578,7 +578,7 @@ class FsFile { this.#rid = rid; if (!symbol || symbol !== SymbolFor("Deno.internal.FsFile")) { throw new TypeError( - "`Deno.FsFile` cannot be constructed, use `Deno.open()` or `Deno.openSync()` instead.", + "'Deno.FsFile' cannot be constructed, use 'Deno.open()' or 'Deno.openSync()' instead", ); } } @@ -713,11 +713,15 @@ function checkOpenOptions(options) { (val) => val === true, ).length === 0 ) { - throw new Error("OpenOptions requires at least one option to be true"); + throw new Error( + "'options' requires at least one option to be true", + ); } if (options.truncate && !options.write) { - throw new Error("'truncate' option requires 'write' option"); + throw new Error( + "'truncate' option requires 'write' to be true", + ); } const createOrCreateNewWithoutWriteOrAppend = @@ -726,7 +730,7 @@ function checkOpenOptions(options) { if (createOrCreateNewWithoutWriteOrAppend) { throw new Error( - "'create' or 'createNew' options require 'write' or 'append' option", + "'create' or 'createNew' options require 'write' or 'append' to be true", ); } } diff --git a/tests/unit/files_test.ts b/tests/unit/files_test.ts index a847104c28..c22d3deb77 100644 --- a/tests/unit/files_test.ts +++ b/tests/unit/files_test.ts @@ -137,7 +137,7 @@ Deno.test(async function openOptions() { await Deno.open(filename, { write: false }); }, Error, - "OpenOptions requires at least one option to be true", + "'options' requires at least one option to be true", ); await assertRejects( @@ -145,7 +145,7 @@ Deno.test(async function openOptions() { await Deno.open(filename, { truncate: true, write: false }); }, Error, - "'truncate' option requires 'write' option", + "'truncate' option requires 'write' to be true", ); await assertRejects( @@ -153,7 +153,7 @@ Deno.test(async function openOptions() { await Deno.open(filename, { create: true, write: false }); }, Error, - "'create' or 'createNew' options require 'write' or 'append' option", + "'create' or 'createNew' options require 'write' or 'append' to be true", ); await assertRejects( @@ -161,7 +161,7 @@ Deno.test(async function openOptions() { await Deno.open(filename, { createNew: true, append: false }); }, Error, - "'create' or 'createNew' options require 'write' or 'append' option", + "'create' or 'createNew' options require 'write' or 'append' to be true", ); }); From f6248601f48fa0f4d2d64247f8100fd1d1a02d5a Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 29 Nov 2024 17:36:43 -0500 Subject: [PATCH 195/227] fix(task): forward signals to spawned sub-processes on unix (#27141) Closes https://github.com/denoland/deno/issues/18445 --- Cargo.lock | 6 +- cli/Cargo.toml | 2 +- cli/lsp/tsc.rs | 14 +- .../resolvers/common/lifecycle_scripts.rs | 25 ++ cli/task_runner.rs | 89 +++++- cli/tools/task.rs | 73 +++-- runtime/lib.rs | 1 + runtime/ops/process.rs | 14 +- runtime/ops/signal.rs | 248 +---------------- runtime/signal.rs | 257 ++++++++++++++++++ tests/specs/task/signals/__test__.jsonc | 8 + tests/specs/task/signals/deno.jsonc | 5 + tests/specs/task/signals/listener.ts | 16 ++ tests/specs/task/signals/sender.ts | 55 ++++ tests/specs/task/signals/signals.ts | 65 +++++ 15 files changed, 590 insertions(+), 288 deletions(-) create mode 100644 runtime/signal.rs create mode 100644 tests/specs/task/signals/__test__.jsonc create mode 100644 tests/specs/task/signals/deno.jsonc create mode 100644 tests/specs/task/signals/listener.ts create mode 100644 tests/specs/task/signals/sender.ts create mode 100644 tests/specs/task/signals/signals.ts diff --git a/Cargo.lock b/Cargo.lock index 5e27d1a801..9e72dac0df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2136,19 +2136,19 @@ dependencies = [ [[package]] name = "deno_task_shell" -version = "0.18.1" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f444918f7102c1a5a143e9d57809e499fb4d365070519bf2e8bdb16d586af2a" +checksum = "01e09966ce29f8d26b652a43355397e1df43b85759e7824196bf0ceaeaa9a2f4" dependencies = [ "anyhow", "futures", "glob", "monch", + "nix", "os_pipe", "path-dedot", "thiserror", "tokio", - "tokio-util", ] [[package]] diff --git a/cli/Cargo.toml b/cli/Cargo.toml index dd75f903e4..a21e5d5c68 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -82,7 +82,7 @@ deno_path_util.workspace = true deno_resolver.workspace = true deno_runtime = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_semver.workspace = true -deno_task_shell = "=0.18.1" +deno_task_shell = "=0.20.1" deno_telemetry.workspace = true deno_terminal.workspace = true libsui = "0.5.0" diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index a8e2b91e77..d3d821ebb3 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -1297,16 +1297,10 @@ impl TsServer { { // When an LSP request is cancelled by the client, the future this is being // executed under and any local variables here will be dropped at the next - // await point. To pass on that cancellation to the TS thread, we make this - // wrapper which cancels the request's token on drop. - struct DroppableToken(CancellationToken); - impl Drop for DroppableToken { - fn drop(&mut self) { - self.0.cancel(); - } - } + // await point. To pass on that cancellation to the TS thread, we use drop_guard + // which cancels the request's token on drop. let token = token.child_token(); - let droppable_token = DroppableToken(token.clone()); + let droppable_token = token.clone().drop_guard(); let (tx, mut rx) = oneshot::channel::>(); let change = self.pending_change.lock().take(); @@ -1320,7 +1314,7 @@ impl TsServer { tokio::select! { value = &mut rx => { let value = value??; - drop(droppable_token); + droppable_token.disarm(); Ok(serde_json::from_str(&value)?) } _ = token.cancelled() => { diff --git a/cli/npm/managed/resolvers/common/lifecycle_scripts.rs b/cli/npm/managed/resolvers/common/lifecycle_scripts.rs index f8b9e8a7e8..958c4bcd19 100644 --- a/cli/npm/managed/resolvers/common/lifecycle_scripts.rs +++ b/cli/npm/managed/resolvers/common/lifecycle_scripts.rs @@ -9,6 +9,7 @@ use deno_npm::resolution::NpmResolutionSnapshot; use deno_runtime::deno_io::FromRawIoHandle; use deno_semver::package::PackageNv; use deno_semver::Version; +use deno_task_shell::KillSignal; use std::borrow::Cow; use std::collections::HashSet; use std::rc::Rc; @@ -155,6 +156,29 @@ impl<'a> LifecycleScripts<'a> { packages: &[NpmResolutionPackage], root_node_modules_dir_path: &Path, progress_bar: &ProgressBar, + ) -> Result<(), AnyError> { + let kill_signal = KillSignal::default(); + let _drop_signal = kill_signal.clone().drop_guard(); + // we don't run with signals forwarded because once signals + // are setup then they're process wide. + self + .finish_with_cancellation( + snapshot, + packages, + root_node_modules_dir_path, + progress_bar, + kill_signal, + ) + .await + } + + async fn finish_with_cancellation( + self, + snapshot: &NpmResolutionSnapshot, + packages: &[NpmResolutionPackage], + root_node_modules_dir_path: &Path, + progress_bar: &ProgressBar, + kill_signal: KillSignal, ) -> Result<(), AnyError> { self.warn_not_run_scripts()?; let get_package_path = @@ -246,6 +270,7 @@ impl<'a> LifecycleScripts<'a> { stderr: TaskStdio::piped(), stdout: TaskStdio::piped(), }), + kill_signal: kill_signal.clone(), }, ) .await?; diff --git a/cli/task_runner.rs b/cli/task_runner.rs index ec043f280e..aabdaf5777 100644 --- a/cli/task_runner.rs +++ b/cli/task_runner.rs @@ -14,6 +14,7 @@ use deno_runtime::deno_node::NodeResolver; use deno_semver::package::PackageNv; use deno_task_shell::ExecutableCommand; use deno_task_shell::ExecuteResult; +use deno_task_shell::KillSignal; use deno_task_shell::ShellCommand; use deno_task_shell::ShellCommandContext; use deno_task_shell::ShellPipeReader; @@ -22,6 +23,7 @@ use lazy_regex::Lazy; use regex::Regex; use tokio::task::JoinHandle; use tokio::task::LocalSet; +use tokio_util::sync::CancellationToken; use crate::npm::CliNpmResolver; use crate::npm::InnerCliNpmResolverRef; @@ -45,9 +47,11 @@ impl TaskStdio { pub fn stdout() -> Self { Self(None, ShellPipeWriter::stdout()) } + pub fn stderr() -> Self { Self(None, ShellPipeWriter::stderr()) } + pub fn piped() -> Self { let (r, w) = deno_task_shell::pipe(); Self(Some(r), w) @@ -62,8 +66,8 @@ pub struct TaskIo { impl Default for TaskIo { fn default() -> Self { Self { - stderr: TaskStdio::stderr(), stdout: TaskStdio::stdout(), + stderr: TaskStdio::stderr(), } } } @@ -78,6 +82,7 @@ pub struct RunTaskOptions<'a> { pub custom_commands: HashMap>, pub root_node_modules_dir: Option<&'a Path>, pub stdio: Option, + pub kill_signal: KillSignal, } pub type TaskCustomCommands = HashMap>; @@ -96,8 +101,12 @@ pub async fn run_task( .with_context(|| format!("Error parsing script '{}'.", opts.task_name))?; let env_vars = prepare_env_vars(opts.env_vars, opts.init_cwd, opts.root_node_modules_dir); - let state = - deno_task_shell::ShellState::new(env_vars, opts.cwd, opts.custom_commands); + let state = deno_task_shell::ShellState::new( + env_vars, + opts.cwd, + opts.custom_commands, + opts.kill_signal, + ); let stdio = opts.stdio.unwrap_or_default(); let ( TaskStdio(stdout_read, stdout_write), @@ -537,6 +546,80 @@ fn resolve_managed_npm_commands( Ok(result) } +/// Runs a deno task future forwarding any signals received +/// to the process. +/// +/// Signal listeners and ctrl+c listening will be setup. +pub async fn run_future_forwarding_signals( + kill_signal: KillSignal, + future: impl std::future::Future, +) -> TOutput { + fn spawn_future_with_cancellation( + future: impl std::future::Future + 'static, + token: CancellationToken, + ) { + deno_core::unsync::spawn(async move { + tokio::select! { + _ = future => {} + _ = token.cancelled() => {} + } + }); + } + + let token = CancellationToken::new(); + let _token_drop_guard = token.clone().drop_guard(); + let _drop_guard = kill_signal.clone().drop_guard(); + + spawn_future_with_cancellation( + listen_ctrl_c(kill_signal.clone()), + token.clone(), + ); + #[cfg(unix)] + spawn_future_with_cancellation( + listen_and_forward_all_signals(kill_signal), + token, + ); + + future.await +} + +async fn listen_ctrl_c(kill_signal: KillSignal) { + while let Ok(()) = tokio::signal::ctrl_c().await { + kill_signal.send(deno_task_shell::SignalKind::SIGINT) + } +} + +#[cfg(unix)] +async fn listen_and_forward_all_signals(kill_signal: KillSignal) { + use deno_core::futures::FutureExt; + use deno_runtime::signal::SIGNAL_NUMS; + + // listen and forward every signal we support + let mut futures = Vec::with_capacity(SIGNAL_NUMS.len()); + for signo in SIGNAL_NUMS.iter().copied() { + if signo == libc::SIGKILL || signo == libc::SIGSTOP { + continue; // skip, can't listen to these + } + + let kill_signal = kill_signal.clone(); + futures.push( + async move { + let Ok(mut stream) = tokio::signal::unix::signal( + tokio::signal::unix::SignalKind::from_raw(signo), + ) else { + return; + }; + let signal_kind: deno_task_shell::SignalKind = signo.into(); + while let Some(()) = stream.recv().await { + kill_signal.send(signal_kind); + } + } + .boxed_local(), + ) + } + futures::future::join_all(futures).await; +} + #[cfg(test)] mod test { diff --git a/cli/tools/task.rs b/cli/tools/task.rs index 4752738c52..a2f76aaf1f 100644 --- a/cli/tools/task.rs +++ b/cli/tools/task.rs @@ -26,6 +26,7 @@ use deno_core::futures::StreamExt; use deno_core::url::Url; use deno_path_util::normalize_path; use deno_runtime::deno_node::NodeResolver; +use deno_task_shell::KillSignal; use deno_task_shell::ShellCommand; use indexmap::IndexMap; use regex::Regex; @@ -37,6 +38,7 @@ use crate::colors; use crate::factory::CliFactory; use crate::npm::CliNpmResolver; use crate::task_runner; +use crate::task_runner::run_future_forwarding_signals; use crate::util::fs::canonicalize_path; #[derive(Debug)] @@ -226,28 +228,33 @@ pub async fn execute_script( concurrency: no_of_concurrent_tasks.into(), }; - if task_flags.eval { - return task_runner - .run_deno_task( - &Url::from_directory_path(cli_options.initial_cwd()).unwrap(), - "", - &TaskDefinition { - command: task_flags.task.as_ref().unwrap().to_string(), - dependencies: vec![], - description: None, - }, - ) - .await; - } - - for task_config in &packages_task_configs { - let exit_code = task_runner.run_tasks(task_config).await?; - if exit_code > 0 { - return Ok(exit_code); + let kill_signal = KillSignal::default(); + run_future_forwarding_signals(kill_signal.clone(), async { + if task_flags.eval { + return task_runner + .run_deno_task( + &Url::from_directory_path(cli_options.initial_cwd()).unwrap(), + "", + &TaskDefinition { + command: task_flags.task.as_ref().unwrap().to_string(), + dependencies: vec![], + description: None, + }, + kill_signal, + ) + .await; } - } - Ok(0) + for task_config in &packages_task_configs { + let exit_code = task_runner.run_tasks(task_config, &kill_signal).await?; + if exit_code > 0 { + return Ok(exit_code); + } + } + + Ok(0) + }) + .await } struct RunSingleOptions<'a> { @@ -255,6 +262,7 @@ struct RunSingleOptions<'a> { script: &'a str, cwd: &'a Path, custom_commands: HashMap>, + kill_signal: KillSignal, } struct TaskRunner<'a> { @@ -270,9 +278,10 @@ impl<'a> TaskRunner<'a> { pub async fn run_tasks( &self, pkg_tasks_config: &PackageTaskInfo, + kill_signal: &KillSignal, ) -> Result { match sort_tasks_topo(pkg_tasks_config) { - Ok(sorted) => self.run_tasks_in_parallel(sorted).await, + Ok(sorted) => self.run_tasks_in_parallel(sorted, kill_signal).await, Err(err) => match err { TaskError::NotFound(name) => { if self.task_flags.is_run { @@ -307,6 +316,7 @@ impl<'a> TaskRunner<'a> { async fn run_tasks_in_parallel( &self, tasks: Vec>, + kill_signal: &KillSignal, ) -> Result { struct PendingTasksContext<'a> { completed: HashSet, @@ -327,6 +337,7 @@ impl<'a> TaskRunner<'a> { fn get_next_task<'b>( &mut self, runner: &'b TaskRunner<'b>, + kill_signal: &KillSignal, ) -> Option< LocalBoxFuture<'b, Result<(i32, &'a ResolvedTask<'a>), AnyError>>, > @@ -349,15 +360,23 @@ impl<'a> TaskRunner<'a> { } self.running.insert(task.id); + let kill_signal = kill_signal.clone(); return Some( async move { match task.task_or_script { TaskOrScript::Task(_, def) => { - runner.run_deno_task(task.folder_url, task.name, def).await + runner + .run_deno_task(task.folder_url, task.name, def, kill_signal) + .await } TaskOrScript::Script(scripts, _) => { runner - .run_npm_script(task.folder_url, task.name, scripts) + .run_npm_script( + task.folder_url, + task.name, + scripts, + kill_signal, + ) .await } } @@ -380,7 +399,7 @@ impl<'a> TaskRunner<'a> { while context.has_remaining_tasks() { while queue.len() < self.concurrency { - if let Some(task) = context.get_next_task(self) { + if let Some(task) = context.get_next_task(self, kill_signal) { queue.push(task); } else { break; @@ -409,6 +428,7 @@ impl<'a> TaskRunner<'a> { dir_url: &Url, task_name: &str, definition: &TaskDefinition, + kill_signal: KillSignal, ) -> Result { let cwd = match &self.task_flags.cwd { Some(path) => canonicalize_path(&PathBuf::from(path)) @@ -426,6 +446,7 @@ impl<'a> TaskRunner<'a> { script: &definition.command, cwd: &cwd, custom_commands, + kill_signal, }) .await } @@ -435,6 +456,7 @@ impl<'a> TaskRunner<'a> { dir_url: &Url, task_name: &str, scripts: &IndexMap, + kill_signal: KillSignal, ) -> Result { // ensure the npm packages are installed if using a managed resolver if let Some(npm_resolver) = self.npm_resolver.as_managed() { @@ -466,6 +488,7 @@ impl<'a> TaskRunner<'a> { script, cwd: &cwd, custom_commands: custom_commands.clone(), + kill_signal: kill_signal.clone(), }) .await?; if exit_code > 0 { @@ -486,6 +509,7 @@ impl<'a> TaskRunner<'a> { script, cwd, custom_commands, + kill_signal, } = opts; output_task( @@ -504,6 +528,7 @@ impl<'a> TaskRunner<'a> { argv: self.cli_options.argv(), root_node_modules_dir: self.npm_resolver.root_node_modules_path(), stdio: None, + kill_signal, }) .await? .exit_code, diff --git a/runtime/lib.rs b/runtime/lib.rs index 53d4f265e0..1ce325964f 100644 --- a/runtime/lib.rs +++ b/runtime/lib.rs @@ -34,6 +34,7 @@ pub mod inspector_server; pub mod js; pub mod ops; pub mod permissions; +pub mod signal; pub mod snapshot; pub mod sys_info; pub mod tokio_util; diff --git a/runtime/ops/process.rs b/runtime/ops/process.rs index 83d9317d32..422f229632 100644 --- a/runtime/ops/process.rs +++ b/runtime/ops/process.rs @@ -256,9 +256,7 @@ impl TryFrom for ChildStatus { success: false, code: 128 + signal, #[cfg(unix)] - signal: Some( - crate::ops::signal::signal_int_to_str(signal)?.to_string(), - ), + signal: Some(crate::signal::signal_int_to_str(signal)?.to_string()), #[cfg(not(unix))] signal: None, } @@ -1076,7 +1074,8 @@ mod deprecated { #[cfg(unix)] pub fn kill(pid: i32, signal: &str) -> Result<(), ProcessError> { - let signo = super::super::signal::signal_str_to_int(signal)?; + let signo = crate::signal::signal_str_to_int(signal) + .map_err(SignalError::InvalidSignalStr)?; use nix::sys::signal::kill as unix_kill; use nix::sys::signal::Signal; use nix::unistd::Pid; @@ -1099,7 +1098,12 @@ mod deprecated { use winapi::um::winnt::PROCESS_TERMINATE; if !matches!(signal, "SIGKILL" | "SIGTERM") { - Err(SignalError::InvalidSignalStr(signal.to_string()).into()) + Err( + SignalError::InvalidSignalStr(crate::signal::InvalidSignalStrError( + signal.to_string(), + )) + .into(), + ) } else if pid <= 0 { Err(ProcessError::InvalidPid) } else { diff --git a/runtime/ops/signal.rs b/runtime/ops/signal.rs index e1e4ab68bc..ef87c37297 100644 --- a/runtime/ops/signal.rs +++ b/runtime/ops/signal.rs @@ -46,34 +46,10 @@ deno_core::extension!( #[derive(Debug, thiserror::Error)] pub enum SignalError { - #[cfg(any( - target_os = "android", - target_os = "linux", - target_os = "openbsd", - target_os = "openbsd", - target_os = "macos", - target_os = "solaris", - target_os = "illumos" - ))] - #[error("Invalid signal: {0}")] - InvalidSignalStr(String), - #[cfg(any( - target_os = "android", - target_os = "linux", - target_os = "openbsd", - target_os = "openbsd", - target_os = "macos", - target_os = "solaris", - target_os = "illumos" - ))] - #[error("Invalid signal: {0}")] - InvalidSignalInt(libc::c_int), - #[cfg(target_os = "windows")] - #[error("Windows only supports ctrl-c (SIGINT) and ctrl-break (SIGBREAK), but got {0}")] - InvalidSignalStr(String), - #[cfg(target_os = "windows")] - #[error("Windows only supports ctrl-c (SIGINT) and ctrl-break (SIGBREAK), but got {0}")] - InvalidSignalInt(libc::c_int), + #[error(transparent)] + InvalidSignalStr(#[from] crate::signal::InvalidSignalStrError), + #[error(transparent)] + InvalidSignalInt(#[from] crate::signal::InvalidSignalIntError), #[error("Binding to signal '{0}' is not allowed")] SignalNotAllowed(String), #[error("{0}")] @@ -181,218 +157,6 @@ impl Resource for SignalStreamResource { } } -macro_rules! first_literal { - ($head:literal $(, $tail:literal)*) => { - $head - }; -} -macro_rules! signal_dict { - ($(($number:literal, $($name:literal)|+)),*) => { - pub fn signal_str_to_int(s: &str) -> Result { - match s { - $($($name)|* => Ok($number),)* - _ => Err(SignalError::InvalidSignalStr(s.to_string())), - } - } - - pub fn signal_int_to_str(s: libc::c_int) -> Result<&'static str, SignalError> { - match s { - $($number => Ok(first_literal!($($name),+)),)* - _ => Err(SignalError::InvalidSignalInt(s)), - } - } - } -} - -#[cfg(target_os = "freebsd")] -signal_dict!( - (1, "SIGHUP"), - (2, "SIGINT"), - (3, "SIGQUIT"), - (4, "SIGILL"), - (5, "SIGTRAP"), - (6, "SIGABRT" | "SIGIOT"), - (7, "SIGEMT"), - (8, "SIGFPE"), - (9, "SIGKILL"), - (10, "SIGBUS"), - (11, "SIGSEGV"), - (12, "SIGSYS"), - (13, "SIGPIPE"), - (14, "SIGALRM"), - (15, "SIGTERM"), - (16, "SIGURG"), - (17, "SIGSTOP"), - (18, "SIGTSTP"), - (19, "SIGCONT"), - (20, "SIGCHLD"), - (21, "SIGTTIN"), - (22, "SIGTTOU"), - (23, "SIGIO"), - (24, "SIGXCPU"), - (25, "SIGXFSZ"), - (26, "SIGVTALRM"), - (27, "SIGPROF"), - (28, "SIGWINCH"), - (29, "SIGINFO"), - (30, "SIGUSR1"), - (31, "SIGUSR2"), - (32, "SIGTHR"), - (33, "SIGLIBRT") -); - -#[cfg(target_os = "openbsd")] -signal_dict!( - (1, "SIGHUP"), - (2, "SIGINT"), - (3, "SIGQUIT"), - (4, "SIGILL"), - (5, "SIGTRAP"), - (6, "SIGABRT" | "SIGIOT"), - (7, "SIGEMT"), - (8, "SIGKILL"), - (10, "SIGBUS"), - (11, "SIGSEGV"), - (12, "SIGSYS"), - (13, "SIGPIPE"), - (14, "SIGALRM"), - (15, "SIGTERM"), - (16, "SIGURG"), - (17, "SIGSTOP"), - (18, "SIGTSTP"), - (19, "SIGCONT"), - (20, "SIGCHLD"), - (21, "SIGTTIN"), - (22, "SIGTTOU"), - (23, "SIGIO"), - (24, "SIGXCPU"), - (25, "SIGXFSZ"), - (26, "SIGVTALRM"), - (27, "SIGPROF"), - (28, "SIGWINCH"), - (29, "SIGINFO"), - (30, "SIGUSR1"), - (31, "SIGUSR2"), - (32, "SIGTHR") -); - -#[cfg(any(target_os = "android", target_os = "linux"))] -signal_dict!( - (1, "SIGHUP"), - (2, "SIGINT"), - (3, "SIGQUIT"), - (4, "SIGILL"), - (5, "SIGTRAP"), - (6, "SIGABRT" | "SIGIOT"), - (7, "SIGBUS"), - (8, "SIGFPE"), - (9, "SIGKILL"), - (10, "SIGUSR1"), - (11, "SIGSEGV"), - (12, "SIGUSR2"), - (13, "SIGPIPE"), - (14, "SIGALRM"), - (15, "SIGTERM"), - (16, "SIGSTKFLT"), - (17, "SIGCHLD"), - (18, "SIGCONT"), - (19, "SIGSTOP"), - (20, "SIGTSTP"), - (21, "SIGTTIN"), - (22, "SIGTTOU"), - (23, "SIGURG"), - (24, "SIGXCPU"), - (25, "SIGXFSZ"), - (26, "SIGVTALRM"), - (27, "SIGPROF"), - (28, "SIGWINCH"), - (29, "SIGIO" | "SIGPOLL"), - (30, "SIGPWR"), - (31, "SIGSYS" | "SIGUNUSED") -); - -#[cfg(target_os = "macos")] -signal_dict!( - (1, "SIGHUP"), - (2, "SIGINT"), - (3, "SIGQUIT"), - (4, "SIGILL"), - (5, "SIGTRAP"), - (6, "SIGABRT" | "SIGIOT"), - (7, "SIGEMT"), - (8, "SIGFPE"), - (9, "SIGKILL"), - (10, "SIGBUS"), - (11, "SIGSEGV"), - (12, "SIGSYS"), - (13, "SIGPIPE"), - (14, "SIGALRM"), - (15, "SIGTERM"), - (16, "SIGURG"), - (17, "SIGSTOP"), - (18, "SIGTSTP"), - (19, "SIGCONT"), - (20, "SIGCHLD"), - (21, "SIGTTIN"), - (22, "SIGTTOU"), - (23, "SIGIO"), - (24, "SIGXCPU"), - (25, "SIGXFSZ"), - (26, "SIGVTALRM"), - (27, "SIGPROF"), - (28, "SIGWINCH"), - (29, "SIGINFO"), - (30, "SIGUSR1"), - (31, "SIGUSR2") -); - -#[cfg(any(target_os = "solaris", target_os = "illumos"))] -signal_dict!( - (1, "SIGHUP"), - (2, "SIGINT"), - (3, "SIGQUIT"), - (4, "SIGILL"), - (5, "SIGTRAP"), - (6, "SIGABRT" | "SIGIOT"), - (7, "SIGEMT"), - (8, "SIGFPE"), - (9, "SIGKILL"), - (10, "SIGBUS"), - (11, "SIGSEGV"), - (12, "SIGSYS"), - (13, "SIGPIPE"), - (14, "SIGALRM"), - (15, "SIGTERM"), - (16, "SIGUSR1"), - (17, "SIGUSR2"), - (18, "SIGCHLD"), - (19, "SIGPWR"), - (20, "SIGWINCH"), - (21, "SIGURG"), - (22, "SIGPOLL"), - (23, "SIGSTOP"), - (24, "SIGTSTP"), - (25, "SIGCONT"), - (26, "SIGTTIN"), - (27, "SIGTTOU"), - (28, "SIGVTALRM"), - (29, "SIGPROF"), - (30, "SIGXCPU"), - (31, "SIGXFSZ"), - (32, "SIGWAITING"), - (33, "SIGLWP"), - (34, "SIGFREEZE"), - (35, "SIGTHAW"), - (36, "SIGCANCEL"), - (37, "SIGLOST"), - (38, "SIGXRES"), - (39, "SIGJVM1"), - (40, "SIGJVM2") -); - -#[cfg(target_os = "windows")] -signal_dict!((2, "SIGINT"), (21, "SIGBREAK")); - #[cfg(unix)] #[op2(fast)] #[smi] @@ -400,7 +164,7 @@ fn op_signal_bind( state: &mut OpState, #[string] sig: &str, ) -> Result { - let signo = signal_str_to_int(sig)?; + let signo = crate::signal::signal_str_to_int(sig)?; if signal_hook_registry::FORBIDDEN.contains(&signo) { return Err(SignalError::SignalNotAllowed(sig.to_string())); } @@ -437,7 +201,7 @@ fn op_signal_bind( state: &mut OpState, #[string] sig: &str, ) -> Result { - let signo = signal_str_to_int(sig)?; + let signo = crate::signal::signal_str_to_int(sig)?; let resource = SignalStreamResource { signal: AsyncRefCell::new(match signo { // SIGINT diff --git a/runtime/signal.rs b/runtime/signal.rs new file mode 100644 index 0000000000..0ef83d7de8 --- /dev/null +++ b/runtime/signal.rs @@ -0,0 +1,257 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +#[cfg(target_os = "windows")] +#[derive(Debug, thiserror::Error)] +#[error("Windows only supports ctrl-c (SIGINT) and ctrl-break (SIGBREAK), but got {0}")] +pub struct InvalidSignalStrError(pub String); + +#[cfg(any( + target_os = "android", + target_os = "linux", + target_os = "openbsd", + target_os = "openbsd", + target_os = "macos", + target_os = "solaris", + target_os = "illumos" +))] +#[derive(Debug, thiserror::Error)] +#[error("Invalid signal: {0}")] +pub struct InvalidSignalStrError(pub String); + +#[cfg(target_os = "windows")] +#[derive(Debug, thiserror::Error)] +#[error("Windows only supports ctrl-c (SIGINT) and ctrl-break (SIGBREAK), but got {0}")] +pub struct InvalidSignalIntError(pub libc::c_int); + +#[cfg(any( + target_os = "android", + target_os = "linux", + target_os = "openbsd", + target_os = "openbsd", + target_os = "macos", + target_os = "solaris", + target_os = "illumos" +))] +#[derive(Debug, thiserror::Error)] +#[error("Invalid signal: {0}")] +pub struct InvalidSignalIntError(pub libc::c_int); + +macro_rules! first_literal { + ($head:literal $(, $tail:literal)*) => { + $head + }; +} + +macro_rules! signal_dict { + ($(($number:literal, $($name:literal)|+)),*) => { + + pub const SIGNAL_NUMS: &'static [libc::c_int] = &[ + $( + $number + ),* + ]; + + pub fn signal_str_to_int(s: &str) -> Result { + match s { + $($($name)|* => Ok($number),)* + _ => Err(InvalidSignalStrError(s.to_string())), + } + } + + pub fn signal_int_to_str(s: libc::c_int) -> Result<&'static str, InvalidSignalIntError> { + match s { + $($number => Ok(first_literal!($($name),+)),)* + _ => Err(InvalidSignalIntError(s)), + } + } + } +} + +#[cfg(target_os = "freebsd")] +signal_dict!( + (1, "SIGHUP"), + (2, "SIGINT"), + (3, "SIGQUIT"), + (4, "SIGILL"), + (5, "SIGTRAP"), + (6, "SIGABRT" | "SIGIOT"), + (7, "SIGEMT"), + (8, "SIGFPE"), + (9, "SIGKILL"), + (10, "SIGBUS"), + (11, "SIGSEGV"), + (12, "SIGSYS"), + (13, "SIGPIPE"), + (14, "SIGALRM"), + (15, "SIGTERM"), + (16, "SIGURG"), + (17, "SIGSTOP"), + (18, "SIGTSTP"), + (19, "SIGCONT"), + (20, "SIGCHLD"), + (21, "SIGTTIN"), + (22, "SIGTTOU"), + (23, "SIGIO"), + (24, "SIGXCPU"), + (25, "SIGXFSZ"), + (26, "SIGVTALRM"), + (27, "SIGPROF"), + (28, "SIGWINCH"), + (29, "SIGINFO"), + (30, "SIGUSR1"), + (31, "SIGUSR2"), + (32, "SIGTHR"), + (33, "SIGLIBRT") +); + +#[cfg(target_os = "openbsd")] +signal_dict!( + (1, "SIGHUP"), + (2, "SIGINT"), + (3, "SIGQUIT"), + (4, "SIGILL"), + (5, "SIGTRAP"), + (6, "SIGABRT" | "SIGIOT"), + (7, "SIGEMT"), + (8, "SIGKILL"), + (10, "SIGBUS"), + (11, "SIGSEGV"), + (12, "SIGSYS"), + (13, "SIGPIPE"), + (14, "SIGALRM"), + (15, "SIGTERM"), + (16, "SIGURG"), + (17, "SIGSTOP"), + (18, "SIGTSTP"), + (19, "SIGCONT"), + (20, "SIGCHLD"), + (21, "SIGTTIN"), + (22, "SIGTTOU"), + (23, "SIGIO"), + (24, "SIGXCPU"), + (25, "SIGXFSZ"), + (26, "SIGVTALRM"), + (27, "SIGPROF"), + (28, "SIGWINCH"), + (29, "SIGINFO"), + (30, "SIGUSR1"), + (31, "SIGUSR2"), + (32, "SIGTHR") +); + +#[cfg(any(target_os = "android", target_os = "linux"))] +signal_dict!( + (1, "SIGHUP"), + (2, "SIGINT"), + (3, "SIGQUIT"), + (4, "SIGILL"), + (5, "SIGTRAP"), + (6, "SIGABRT" | "SIGIOT"), + (7, "SIGBUS"), + (8, "SIGFPE"), + (9, "SIGKILL"), + (10, "SIGUSR1"), + (11, "SIGSEGV"), + (12, "SIGUSR2"), + (13, "SIGPIPE"), + (14, "SIGALRM"), + (15, "SIGTERM"), + (16, "SIGSTKFLT"), + (17, "SIGCHLD"), + (18, "SIGCONT"), + (19, "SIGSTOP"), + (20, "SIGTSTP"), + (21, "SIGTTIN"), + (22, "SIGTTOU"), + (23, "SIGURG"), + (24, "SIGXCPU"), + (25, "SIGXFSZ"), + (26, "SIGVTALRM"), + (27, "SIGPROF"), + (28, "SIGWINCH"), + (29, "SIGIO" | "SIGPOLL"), + (30, "SIGPWR"), + (31, "SIGSYS" | "SIGUNUSED") +); + +#[cfg(target_os = "macos")] +signal_dict!( + (1, "SIGHUP"), + (2, "SIGINT"), + (3, "SIGQUIT"), + (4, "SIGILL"), + (5, "SIGTRAP"), + (6, "SIGABRT" | "SIGIOT"), + (7, "SIGEMT"), + (8, "SIGFPE"), + (9, "SIGKILL"), + (10, "SIGBUS"), + (11, "SIGSEGV"), + (12, "SIGSYS"), + (13, "SIGPIPE"), + (14, "SIGALRM"), + (15, "SIGTERM"), + (16, "SIGURG"), + (17, "SIGSTOP"), + (18, "SIGTSTP"), + (19, "SIGCONT"), + (20, "SIGCHLD"), + (21, "SIGTTIN"), + (22, "SIGTTOU"), + (23, "SIGIO"), + (24, "SIGXCPU"), + (25, "SIGXFSZ"), + (26, "SIGVTALRM"), + (27, "SIGPROF"), + (28, "SIGWINCH"), + (29, "SIGINFO"), + (30, "SIGUSR1"), + (31, "SIGUSR2") +); + +#[cfg(any(target_os = "solaris", target_os = "illumos"))] +signal_dict!( + (1, "SIGHUP"), + (2, "SIGINT"), + (3, "SIGQUIT"), + (4, "SIGILL"), + (5, "SIGTRAP"), + (6, "SIGABRT" | "SIGIOT"), + (7, "SIGEMT"), + (8, "SIGFPE"), + (9, "SIGKILL"), + (10, "SIGBUS"), + (11, "SIGSEGV"), + (12, "SIGSYS"), + (13, "SIGPIPE"), + (14, "SIGALRM"), + (15, "SIGTERM"), + (16, "SIGUSR1"), + (17, "SIGUSR2"), + (18, "SIGCHLD"), + (19, "SIGPWR"), + (20, "SIGWINCH"), + (21, "SIGURG"), + (22, "SIGPOLL"), + (23, "SIGSTOP"), + (24, "SIGTSTP"), + (25, "SIGCONT"), + (26, "SIGTTIN"), + (27, "SIGTTOU"), + (28, "SIGVTALRM"), + (29, "SIGPROF"), + (30, "SIGXCPU"), + (31, "SIGXFSZ"), + (32, "SIGWAITING"), + (33, "SIGLWP"), + (34, "SIGFREEZE"), + (35, "SIGTHAW"), + (36, "SIGCANCEL"), + (37, "SIGLOST"), + (38, "SIGXRES"), + (39, "SIGJVM1"), + (40, "SIGJVM2") +); + +#[cfg(target_os = "windows")] +signal_dict!((2, "SIGINT"), (21, "SIGBREAK")); diff --git a/tests/specs/task/signals/__test__.jsonc b/tests/specs/task/signals/__test__.jsonc new file mode 100644 index 0000000000..69801c46bf --- /dev/null +++ b/tests/specs/task/signals/__test__.jsonc @@ -0,0 +1,8 @@ +{ + // signals don't really exist on windows + "if": "unix", + // this runs a deno task + "args": "run -A --check sender.ts", + // just ensure this doesn't hang and completes successfully + "output": "[WILDCARD]" +} diff --git a/tests/specs/task/signals/deno.jsonc b/tests/specs/task/signals/deno.jsonc new file mode 100644 index 0000000000..18057558ee --- /dev/null +++ b/tests/specs/task/signals/deno.jsonc @@ -0,0 +1,5 @@ +{ + "tasks": { + "listener": "deno run listener.ts" + } +} diff --git a/tests/specs/task/signals/listener.ts b/tests/specs/task/signals/listener.ts new file mode 100644 index 0000000000..e4f54c2117 --- /dev/null +++ b/tests/specs/task/signals/listener.ts @@ -0,0 +1,16 @@ +import { signals } from "./signals.ts"; + +for (const signal of signals) { + Deno.addSignalListener(signal, () => { + console.log("Received", signal); + if (signal === "SIGTERM") { + Deno.exit(0); + } + }); +} + +setInterval(() => { + // keep alive +}, 1000); + +console.log("Ready"); diff --git a/tests/specs/task/signals/sender.ts b/tests/specs/task/signals/sender.ts new file mode 100644 index 0000000000..70f4dd788d --- /dev/null +++ b/tests/specs/task/signals/sender.ts @@ -0,0 +1,55 @@ +import { signals } from "./signals.ts"; + +class StdoutReader { + readonly #reader: ReadableStreamDefaultReader; + #text = ""; + + constructor(stream: ReadableStream) { + const textStream = stream.pipeThrough(new TextDecoderStream()); + this.#reader = textStream.getReader(); + } + + [Symbol.dispose]() { + this.#reader.releaseLock(); + } + + async waitForText(waitingText: string) { + if (this.#text.includes(waitingText)) { + return; + } + + while (true) { + const { value, done } = await this.#reader.read(); + if (value) { + this.#text += value; + if (this.#text.includes(waitingText)) { + break; + } + } + if (done) { + throw new Error("Did not find text: " + waitingText); + } + } + } +} + +const command = new Deno.Command(Deno.execPath(), { + args: ["task", "listener"], + stdout: "piped", +}); + +const child = command.spawn(); +const reader = new StdoutReader(child.stdout!); +await reader.waitForText("Ready"); + +for (const signal of signals) { + if (signal === "SIGTERM") { + continue; + } + console.error("Sending", signal); + child.kill(signal); + await reader.waitForText("Received " + signal); +} + +console.error("Sending SIGTERM"); +child.kill("SIGTERM"); diff --git a/tests/specs/task/signals/signals.ts b/tests/specs/task/signals/signals.ts new file mode 100644 index 0000000000..dd05ee1d17 --- /dev/null +++ b/tests/specs/task/signals/signals.ts @@ -0,0 +1,65 @@ +const signals = [ + "SIGABRT", + "SIGALRM", + "SIGBUS", + "SIGCHLD", + "SIGCONT", + "SIGEMT", + "SIGFPE", + "SIGHUP", + "SIGILL", + "SIGINFO", + "SIGINT", + "SIGIO", + "SIGPOLL", + "SIGPIPE", + "SIGPROF", + "SIGPWR", + "SIGQUIT", + "SIGSEGV", + "SIGSTKFLT", + "SIGSYS", + "SIGTERM", + "SIGTRAP", + "SIGTSTP", + "SIGTTIN", + "SIGTTOU", + "SIGURG", + "SIGUSR1", + "SIGUSR2", + "SIGVTALRM", + "SIGWINCH", + "SIGXCPU", + "SIGXFSZ", +] as const; + +// SIGKILL and SIGSTOP are not stoppable, SIGBREAK is for windows, and SIGUNUSED is not defined +type SignalsToTest = Exclude< + Deno.Signal, + "SIGKILL" | "SIGSTOP" | "SIGBREAK" | "SIGUNUSED" +>; +type EnsureAllSignalsIncluded = SignalsToTest extends typeof signals[number] + ? typeof signals[number] extends SignalsToTest ? true + : never + : never; +const _checkSignals: EnsureAllSignalsIncluded = true; + +const osSpecificSignals = signals.filter((s) => { + switch (s) { + case "SIGEMT": + return Deno.build.os === "darwin"; + case "SIGINFO": + case "SIGFPE": + case "SIGILL": + case "SIGSEGV": + return Deno.build.os === "freebsd"; + case "SIGPOLL": + case "SIGPWR": + case "SIGSTKFLT": + return Deno.build.os === "linux"; + default: + return true; + } +}); + +export { osSpecificSignals as signals }; From 1d49b3cb0f54eb8184acc00ec4bb3bd519653441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 29 Nov 2024 23:54:26 +0000 Subject: [PATCH 196/227] fix: support `workspace:^` and `workspace:~` version constraints (#27096) This commit adds support for understanding "workpace:^" and "workspace:~" version constraints in npm/pnpm workspaces. This is done by upgrading various crates to their latest versions. Closes https://github.com/denoland/deno/issues/26726 --------- Co-authored-by: David Sherret --- Cargo.lock | 229 +++++---- Cargo.toml | 14 +- cli/Cargo.toml | 8 +- cli/args/deno_json.rs | 4 +- cli/args/lockfile.rs | 7 +- cli/args/package_json.rs | 23 +- cli/cache/mod.rs | 15 +- cli/factory.rs | 7 +- cli/file_fetcher.rs | 2 +- cli/lsp/config.rs | 5 +- cli/lsp/documents.rs | 2 +- cli/lsp/jsr.rs | 2 +- cli/tools/registry/diagnostics.rs | 62 +-- cli/tools/registry/mod.rs | 18 +- cli/tools/registry/pm/deps.rs | 170 +++---- cli/tools/registry/unfurl.rs | 438 ++++++++++++++++-- ext/node/lib.rs | 8 +- resolvers/deno/npm/byonm.rs | 6 +- .../__test__.jsonc | 10 + .../npm/workspace_version_wildcards/a/mod.ts | 3 + .../a/package.json | 7 + .../npm/workspace_version_wildcards/b/mod.ts | 3 + .../b/package.json | 7 + .../npm/workspace_version_wildcards/c/mod.ts | 3 + .../c/package.json | 7 + .../npm/workspace_version_wildcards/d/mod.ts | 3 + .../d/package.json | 7 + .../npm/workspace_version_wildcards/e/main.ts | 9 + .../e/package.json | 10 + .../npm/workspace_version_wildcards/main.out | 4 + .../npm/workspace_version_wildcards/main.ts | 6 + .../workspace_version_wildcards/package.json | 9 + 32 files changed, 766 insertions(+), 342 deletions(-) create mode 100644 tests/specs/npm/workspace_version_wildcards/__test__.jsonc create mode 100644 tests/specs/npm/workspace_version_wildcards/a/mod.ts create mode 100644 tests/specs/npm/workspace_version_wildcards/a/package.json create mode 100644 tests/specs/npm/workspace_version_wildcards/b/mod.ts create mode 100644 tests/specs/npm/workspace_version_wildcards/b/package.json create mode 100644 tests/specs/npm/workspace_version_wildcards/c/mod.ts create mode 100644 tests/specs/npm/workspace_version_wildcards/c/package.json create mode 100644 tests/specs/npm/workspace_version_wildcards/d/mod.ts create mode 100644 tests/specs/npm/workspace_version_wildcards/d/package.json create mode 100644 tests/specs/npm/workspace_version_wildcards/e/main.ts create mode 100644 tests/specs/npm/workspace_version_wildcards/e/package.json create mode 100644 tests/specs/npm/workspace_version_wildcards/main.out create mode 100644 tests/specs/npm/workspace_version_wildcards/main.ts create mode 100644 tests/specs/npm/workspace_version_wildcards/package.json diff --git a/Cargo.lock b/Cargo.lock index 9e72dac0df..77dc2cb4c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -231,7 +231,7 @@ dependencies = [ "nom 7.1.3", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.64", "time", ] @@ -1292,7 +1292,7 @@ dependencies = [ "test_server", "text-size", "text_lines", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-util", "tracing", @@ -1321,13 +1321,14 @@ dependencies = [ [[package]] name = "deno_ast" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d00b724e06d2081a141ec1155756a0b465d413d8e2a7515221f61d482eb2ee" +checksum = "eebc7aaabfdb3ddcad32aee1b62d250149dc8b35dfbdccbb125df2bdc62da952" dependencies = [ "base64 0.21.7", + "deno_error", "deno_media_type", - "deno_terminal 0.1.1", + "deno_terminal 0.2.0", "dprint-swc-ext", "once_cell", "percent-encoding", @@ -1358,7 +1359,7 @@ dependencies = [ "swc_visit", "swc_visit_macros", "text_lines", - "thiserror", + "thiserror 2.0.3", "unicode-width", "url", ] @@ -1378,7 +1379,7 @@ version = "0.174.0" dependencies = [ "async-trait", "deno_core", - "thiserror", + "thiserror 1.0.64", "tokio", "uuid", ] @@ -1392,15 +1393,15 @@ dependencies = [ "rusqlite", "serde", "sha2", - "thiserror", + "thiserror 1.0.64", "tokio", ] [[package]] name = "deno_cache_dir" -version = "0.13.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c1f52170cd7715f8006da54cde1444863a0d6fbd9c11d037a737db2dec8e22" +checksum = "cca43605c8cbce6c6787e0daf227864487c07c2b31d438c0bf43d1b38da94b7f" dependencies = [ "base32", "deno_media_type", @@ -1412,7 +1413,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "thiserror", + "thiserror 1.0.64", "url", ] @@ -1424,14 +1425,14 @@ dependencies = [ "deno_webgpu", "image", "serde", - "thiserror", + "thiserror 1.0.64", ] [[package]] name = "deno_config" -version = "0.39.2" +version = "0.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38fb809500238be2b10eee42944a47b3ac38974e1edbb47f73afcfca7df143bf" +checksum = "ce717af3fe6788dae63965d58d5637fd62be8fe4f345f189137ffc06c51837d2" dependencies = [ "anyhow", "deno_package_json", @@ -1447,7 +1448,7 @@ dependencies = [ "phf", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "url", ] @@ -1508,7 +1509,7 @@ dependencies = [ "chrono", "deno_core", "saffron", - "thiserror", + "thiserror 1.0.64", "tokio", ] @@ -1543,7 +1544,7 @@ dependencies = [ "sha2", "signature", "spki", - "thiserror", + "thiserror 1.0.64", "tokio", "uuid", "x25519-dalek", @@ -1551,9 +1552,9 @@ dependencies = [ [[package]] name = "deno_doc" -version = "0.161.1" +version = "0.161.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d994915f85e873865fc341e592080a487b0a987d06177016b2d93fd62162f8" +checksum = "3af787319136f3e7f73ef551c618aeec70794522e36cd75ae35132a3bad983ef" dependencies = [ "anyhow", "cfg-if", @@ -1578,6 +1579,29 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "deno_error" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "199c66ffd17ee1a948904d33f3d3f364573951c1f9fb3f859bfe7770bf33862a" +dependencies = [ + "deno_error_macro", + "libc", + "serde", + "serde_json", +] + +[[package]] +name = "deno_error_macro" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cd99df6ae75443907e1f959fc42ec6dcea67a7bd083e76cf23a117102c9a2ce" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "deno_fetch" version = "0.204.0" @@ -1602,7 +1626,7 @@ dependencies = [ "rustls-webpki", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-rustls", "tokio-socks", @@ -1627,7 +1651,7 @@ dependencies = [ "serde", "serde-value", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "winapi", ] @@ -1650,16 +1674,16 @@ dependencies = [ "rand", "rayon", "serde", - "thiserror", + "thiserror 1.0.64", "winapi", "windows-sys 0.52.0", ] [[package]] name = "deno_graph" -version = "0.86.2" +version = "0.86.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c3f4be49dad28e794ff4eeb2daaf7956c97f8557097ef6f9c3ff1292e0a5c28" +checksum = "fc78ed0b4bbcb4197300f0d6e7d1edc2d2c5019cdb9dedba7ff229158441885b" dependencies = [ "anyhow", "async-trait", @@ -1679,7 +1703,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "thiserror", + "thiserror 2.0.3", "twox-hash", "url", "wasm_dep_analyzer", @@ -1719,7 +1743,7 @@ dependencies = [ "scopeguard", "serde", "smallvec", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-util", ] @@ -1773,15 +1797,15 @@ dependencies = [ "rand", "rusqlite", "serde", - "thiserror", + "thiserror 1.0.64", "url", ] [[package]] name = "deno_lint" -version = "0.68.0" +version = "0.68.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb994e6d1b18223df0a756c7948143b35682941d615edffef60d5b38822f38ac" +checksum = "ce2a040657166e39c7d59ad34230f0cc829f8ea8b7b2377038cc012ec1a1ef16" dependencies = [ "anyhow", "deno_ast", @@ -1797,14 +1821,14 @@ dependencies = [ [[package]] name = "deno_lockfile" -version = "0.23.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579117d5815aa9bae0212637d6f4d5f45f9649bb2c8988dca434077545535039" +checksum = "559c19feb00af0c34f0bd4a20e56e12463fafd5c5069d6005f3ce33008027eea" dependencies = [ "deno_semver", "serde", "serde_json", - "thiserror", + "thiserror 2.0.3", ] [[package]] @@ -1829,7 +1853,7 @@ dependencies = [ "libuv-sys-lite", "log", "napi_sym", - "thiserror", + "thiserror 1.0.64", "windows-sys 0.52.0", ] @@ -1859,7 +1883,7 @@ dependencies = [ "rustls-tokio-stream", "serde", "socket2", - "thiserror", + "thiserror 1.0.64", "tokio", ] @@ -1943,7 +1967,7 @@ dependencies = [ "sm3", "spki", "stable_deref_trait", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-eld", "url", @@ -1957,9 +1981,9 @@ dependencies = [ [[package]] name = "deno_npm" -version = "0.25.4" +version = "0.25.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b4dc4a9f1cff63d5638e7d93042f24f46300d1cc77b86f3caaa699a7ddccf7" +checksum = "89ded7af9db5d9f2986a739d1b5fbe1c57f498e4f996ae4114728e7c6dad213f" dependencies = [ "anyhow", "async-trait", @@ -1970,7 +1994,7 @@ dependencies = [ "monch", "serde", "serde_json", - "thiserror", + "thiserror 2.0.3", "url", ] @@ -1987,20 +2011,22 @@ dependencies = [ "strum", "strum_macros", "syn 2.0.87", - "thiserror", + "thiserror 1.0.64", ] [[package]] name = "deno_package_json" -version = "0.1.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cbc4c4d3eb0960b58e8f43f9fc2d3f620fcac9a03cd85203e08db5b04e83c1f" +checksum = "80b0a3d81c592624a1ae15332a04b4dc2b7c163ef1dfc7c60171f736d1babdf5" dependencies = [ + "deno_error", + "deno_path_util", "deno_semver", "indexmap 2.3.0", "serde", "serde_json", - "thiserror", + "thiserror 2.0.3", "url", ] @@ -2011,7 +2037,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff25f6e08e7a0214bbacdd6f7195c7f1ebcd850c87a624e4ff06326b68b42d99" dependencies = [ "percent-encoding", - "thiserror", + "thiserror 1.0.64", "url", ] @@ -2028,7 +2054,7 @@ dependencies = [ "once_cell", "percent-encoding", "serde", - "thiserror", + "thiserror 1.0.64", "which 4.4.2", "winapi", ] @@ -2048,7 +2074,7 @@ dependencies = [ "deno_semver", "node_resolver", "test_server", - "thiserror", + "thiserror 1.0.64", "url", ] @@ -2111,7 +2137,7 @@ dependencies = [ "signal-hook-registry", "tempfile", "test_server", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-metrics", "twox-hash", @@ -2123,14 +2149,15 @@ dependencies = [ [[package]] name = "deno_semver" -version = "0.5.16" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c957c6a57c38b7dde2315df0da0ec228911e56a74f185b108a488d0401841a67" +checksum = "4756be7351289726087408984db18b9eb5e0186907673f39f858d119d0162071" dependencies = [ + "deno_error", "monch", "once_cell", "serde", - "thiserror", + "thiserror 2.0.3", "url", ] @@ -2147,7 +2174,7 @@ dependencies = [ "nix", "os_pipe", "path-dedot", - "thiserror", + "thiserror 1.0.64", "tokio", ] @@ -2203,7 +2230,7 @@ dependencies = [ "rustls-tokio-stream", "rustls-webpki", "serde", - "thiserror", + "thiserror 1.0.64", "tokio", "webpki-roots", ] @@ -2249,7 +2276,7 @@ dependencies = [ "deno_console", "deno_core", "deno_webidl", - "thiserror", + "thiserror 1.0.64", "urlpattern", ] @@ -2270,7 +2297,7 @@ dependencies = [ "flate2", "futures", "serde", - "thiserror", + "thiserror 1.0.64", "tokio", "uuid", ] @@ -2282,7 +2309,7 @@ dependencies = [ "deno_core", "raw-window-handle", "serde", - "thiserror", + "thiserror 1.0.64", "tokio", "wgpu-core", "wgpu-types", @@ -2314,7 +2341,7 @@ dependencies = [ "once_cell", "rustls-tokio-stream", "serde", - "thiserror", + "thiserror 1.0.64", "tokio", ] @@ -2325,7 +2352,7 @@ dependencies = [ "deno_core", "deno_web", "rusqlite", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -2397,7 +2424,7 @@ dependencies = [ "rand", "rusqlite", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", "uuid", @@ -2690,9 +2717,9 @@ dependencies = [ [[package]] name = "dprint-plugin-typescript" -version = "0.93.2" +version = "0.93.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff29fd136541e59d51946f0d2d353fefc886776f61a799ebfb5838b06cef13b" +checksum = "5804d1809f6191a9261f423c41cd51a50e49567d61caa5a8f6224eea94ae0d12" dependencies = [ "anyhow", "deno_ast", @@ -2838,7 +2865,7 @@ dependencies = [ "debug-ignore", "indexmap 2.3.0", "log", - "thiserror", + "thiserror 1.0.64", "zerocopy", ] @@ -2998,7 +3025,7 @@ dependencies = [ "anyhow", "async-trait", "log", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", ] @@ -3033,7 +3060,7 @@ dependencies = [ "rand", "sha1", "simdutf8", - "thiserror", + "thiserror 1.0.64", "tokio", "utf-8", ] @@ -3091,7 +3118,7 @@ dependencies = [ "deno_terminal 0.1.1", "parking_lot", "regex", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -3565,7 +3592,7 @@ dependencies = [ "pest_derive", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -3651,7 +3678,7 @@ dependencies = [ "once_cell", "radix_trie", "rand", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", ] @@ -3674,7 +3701,7 @@ dependencies = [ "once_cell", "rand", "serde", - "thiserror", + "thiserror 1.0.64", "tinyvec", "tokio", "tracing", @@ -3698,7 +3725,7 @@ dependencies = [ "resolv-conf", "serde", "smallvec", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", ] @@ -3716,7 +3743,7 @@ dependencies = [ "futures-util", "hickory-proto", "serde", - "thiserror", + "thiserror 1.0.64", "time", "tokio", "tokio-util", @@ -4156,7 +4183,7 @@ dependencies = [ "percent-encoding", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "url", ] @@ -4362,7 +4389,7 @@ dependencies = [ "anyhow", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "uuid", ] @@ -4812,7 +4839,7 @@ dependencies = [ "serde", "spirv", "termcolor", - "thiserror", + "thiserror 1.0.64", "unicode-xid", ] @@ -4902,7 +4929,7 @@ dependencies = [ "path-clean", "regex", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "url", ] @@ -5099,7 +5126,7 @@ dependencies = [ "js-sys", "once_cell", "pin-project-lite", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -5129,7 +5156,7 @@ dependencies = [ "opentelemetry_sdk", "prost", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tonic", "tracing", @@ -5171,7 +5198,7 @@ dependencies = [ "percent-encoding", "rand", "serde_json", - "thiserror", + "thiserror 1.0.64", "tracing", ] @@ -5355,7 +5382,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.64", "ucd-trie", ] @@ -5769,7 +5796,7 @@ dependencies = [ "indexmap 2.3.0", "quick-xml", "strip-ansi-escapes", - "thiserror", + "thiserror 1.0.64", "uuid", ] @@ -5794,7 +5821,7 @@ dependencies = [ "quinn-udp", "rustc-hash 1.1.0", "rustls", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", ] @@ -5811,7 +5838,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls", "slab", - "thiserror", + "thiserror 1.0.64", "tinyvec", "tracing", ] @@ -5960,7 +5987,7 @@ checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -6584,7 +6611,7 @@ dependencies = [ "num-bigint", "serde", "smallvec", - "thiserror", + "thiserror 1.0.64", "v8", ] @@ -7587,7 +7614,16 @@ version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.64", +] + +[[package]] +name = "thiserror" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +dependencies = [ + "thiserror-impl 2.0.3", ] [[package]] @@ -7601,6 +7637,17 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "thiserror-impl" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "thousands" version = "0.2.0" @@ -7753,7 +7800,7 @@ checksum = "51165dfa029d2a65969413a6cc96f354b86b464498702f174a4efa13608fd8c0" dependencies = [ "either", "futures-util", - "thiserror", + "thiserror 1.0.64", "tokio", ] @@ -8170,7 +8217,7 @@ dependencies = [ "indexmap 2.3.0", "num-bigint", "serde", - "thiserror", + "thiserror 1.0.64", "wtf8", ] @@ -8342,7 +8389,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f270206a91783fd90625c8bb0d8fbd459d0b1d1bf209b656f713f01ae7c04b8" dependencies = [ - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -8396,7 +8443,7 @@ dependencies = [ "rustc-hash 1.1.0", "serde", "smallvec", - "thiserror", + "thiserror 1.0.64", "web-sys", "wgpu-hal", "wgpu-types", @@ -8437,7 +8484,7 @@ dependencies = [ "raw-window-handle", "rustc-hash 1.1.0", "smallvec", - "thiserror", + "thiserror 1.0.64", "wasm-bindgen", "web-sys", "wgpu-types", @@ -8503,7 +8550,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b2b1bf557d947847a30eb73f79aa6cdb3eaf3ce02f5e9599438f77896a62b3c" dependencies = [ - "thiserror", + "thiserror 1.0.64", "windows", ] @@ -8785,7 +8832,7 @@ dependencies = [ "nom 7.1.3", "oid-registry", "rusticata-macros", - "thiserror", + "thiserror 1.0.64", "time", ] @@ -8929,7 +8976,7 @@ dependencies = [ "parking_lot", "rand", "regex", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-util", "uuid", @@ -8970,7 +9017,7 @@ dependencies = [ "flate2", "indexmap 2.3.0", "memchr", - "thiserror", + "thiserror 1.0.64", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 1ca9fcb66b..f6606b54c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,18 +46,18 @@ license = "MIT" repository = "https://github.com/denoland/deno" [workspace.dependencies] -deno_ast = { version = "=0.43.3", features = ["transpiling"] } +deno_ast = { version = "=0.44.0", features = ["transpiling"] } deno_core = { version = "0.323.0" } deno_bench_util = { version = "0.174.0", path = "./bench_util" } -deno_config = { version = "=0.39.2", features = ["workspace", "sync"] } -deno_lockfile = "=0.23.1" +deno_config = { version = "=0.39.3", features = ["workspace", "sync"] } +deno_lockfile = "=0.23.2" deno_media_type = { version = "0.2.0", features = ["module_specifier"] } -deno_npm = "=0.25.4" +deno_npm = "=0.25.5" deno_path_util = "=0.2.1" deno_permissions = { version = "0.40.0", path = "./runtime/permissions" } deno_runtime = { version = "0.189.0", path = "./runtime" } -deno_semver = "=0.5.16" +deno_semver = "=0.6.0" deno_terminal = "0.2.0" napi_sym = { version = "0.110.0", path = "./ext/napi/sym" } test_util = { package = "test_server", path = "./tests/util/server" } @@ -115,8 +115,8 @@ console_static_text = "=0.8.1" dashmap = "5.5.3" data-encoding = "2.3.3" data-url = "=0.3.0" -deno_cache_dir = "=0.13.2" -deno_package_json = { version = "0.1.2", default-features = false } +deno_cache_dir = "=0.14.0" +deno_package_json = { version = "0.2.1", default-features = false } dlopen2 = "0.6.1" ecb = "=0.1.2" elliptic-curve = { version = "0.13.4", features = ["alloc", "arithmetic", "ecdh", "std", "pem", "jwk"] } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index a21e5d5c68..ac093a7238 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -72,9 +72,9 @@ deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposa deno_cache_dir.workspace = true deno_config.workspace = true deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] } -deno_doc = { version = "=0.161.1", features = ["rust", "comrak"] } -deno_graph = { version = "=0.86.2" } -deno_lint = { version = "=0.68.0", features = ["docs"] } +deno_doc = { version = "=0.161.2", features = ["rust", "comrak"] } +deno_graph = { version = "=0.86.3" } +deno_lint = { version = "=0.68.1", features = ["docs"] } deno_lockfile.workspace = true deno_npm.workspace = true deno_package_json.workspace = true @@ -108,7 +108,7 @@ dotenvy = "0.15.7" dprint-plugin-json = "=0.19.4" dprint-plugin-jupyter = "=0.1.5" dprint-plugin-markdown = "=0.17.8" -dprint-plugin-typescript = "=0.93.2" +dprint-plugin-typescript = "=0.93.3" env_logger = "=0.10.0" fancy-regex = "=0.10.0" faster-hex.workspace = true diff --git a/cli/args/deno_json.rs b/cli/args/deno_json.rs index 3e6eb617a6..c2ba31fd36 100644 --- a/cli/args/deno_json.rs +++ b/cli/args/deno_json.rs @@ -18,12 +18,10 @@ impl<'a> deno_config::fs::DenoConfigFs for DenoConfigFsAdapter<'a> { fn read_to_string_lossy( &self, path: &std::path::Path, - ) -> Result { + ) -> Result, std::io::Error> { self .0 .read_text_file_lossy_sync(path, None) - // todo(https://github.com/denoland/deno_config/pull/140): avoid clone - .map(|s| s.into_owned()) .map_err(|err| err.into_io_error()) } diff --git a/cli/args/lockfile.rs b/cli/args/lockfile.rs index a9eb8a0d7c..6c1a2ca0ef 100644 --- a/cli/args/lockfile.rs +++ b/cli/args/lockfile.rs @@ -109,9 +109,12 @@ impl CliLockfile { let Some(pkg_json) = maybe_pkg_json else { return Default::default(); }; - pkg_json - .resolve_local_package_json_deps() + let deps = pkg_json.resolve_local_package_json_deps(); + + deps + .dependencies .values() + .chain(deps.dev_dependencies.values()) .filter_map(|dep| dep.as_ref().ok()) .filter_map(|dep| match dep { PackageJsonDepValue::Req(req) => { diff --git a/cli/args/package_json.rs b/cli/args/package_json.rs index 7dc75550c3..b0f0a2f9ba 100644 --- a/cli/args/package_json.rs +++ b/cli/args/package_json.rs @@ -8,8 +8,10 @@ use deno_core::serde_json; use deno_core::url::Url; use deno_package_json::PackageJsonDepValue; use deno_package_json::PackageJsonDepValueParseError; +use deno_package_json::PackageJsonDepWorkspaceReq; use deno_semver::npm::NpmPackageReqReference; use deno_semver::package::PackageReq; +use deno_semver::VersionReq; use thiserror::Error; #[derive(Debug)] @@ -95,8 +97,14 @@ impl NpmInstallDepsProvider { if let Some(pkg_json) = &folder.pkg_json { let deps = pkg_json.resolve_local_package_json_deps(); - let mut pkg_pkgs = Vec::with_capacity(deps.len()); - for (alias, dep) in deps { + let mut pkg_pkgs = Vec::with_capacity( + deps.dependencies.len() + deps.dev_dependencies.len(), + ); + for (alias, dep) in deps + .dependencies + .into_iter() + .chain(deps.dev_dependencies.into_iter()) + { let dep = match dep { Ok(dep) => dep, Err(err) => { @@ -131,7 +139,16 @@ impl NpmInstallDepsProvider { }); } } - PackageJsonDepValue::Workspace(version_req) => { + PackageJsonDepValue::Workspace(workspace_version_req) => { + let version_req = match workspace_version_req { + PackageJsonDepWorkspaceReq::VersionReq(version_req) => { + version_req + } + PackageJsonDepWorkspaceReq::Tilde + | PackageJsonDepWorkspaceReq::Caret => { + VersionReq::parse_from_npm("*").unwrap() + } + }; if let Some(pkg) = workspace_npm_pkgs.iter().find(|pkg| { pkg.matches_name_and_version_req(&alias, &version_req) }) { diff --git a/cli/cache/mod.rs b/cli/cache/mod.rs index 73a3895a10..e3e242e975 100644 --- a/cli/cache/mod.rs +++ b/cli/cache/mod.rs @@ -23,6 +23,7 @@ use deno_graph::source::Loader; use deno_runtime::deno_fs; use deno_runtime::deno_permissions::PermissionsContainer; use node_resolver::InNpmPackageChecker; +use std::borrow::Cow; use std::collections::HashMap; use std::path::Path; use std::path::PathBuf; @@ -67,8 +68,11 @@ pub const CACHE_PERM: u32 = 0o644; pub struct RealDenoCacheEnv; impl deno_cache_dir::DenoCacheEnv for RealDenoCacheEnv { - fn read_file_bytes(&self, path: &Path) -> std::io::Result> { - std::fs::read(path) + fn read_file_bytes( + &self, + path: &Path, + ) -> std::io::Result> { + std::fs::read(path).map(Cow::Owned) } fn atomic_write_file( @@ -112,12 +116,13 @@ pub struct DenoCacheEnvFsAdapter<'a>( ); impl<'a> deno_cache_dir::DenoCacheEnv for DenoCacheEnvFsAdapter<'a> { - fn read_file_bytes(&self, path: &Path) -> std::io::Result> { + fn read_file_bytes( + &self, + path: &Path, + ) -> std::io::Result> { self .0 .read_file_sync(path, None) - // todo(https://github.com/denoland/deno_cache_dir/pull/66): avoid clone - .map(|bytes| bytes.into_owned()) .map_err(|err| err.into_io_error()) } diff --git a/cli/factory.rs b/cli/factory.rs index 5d9a2c0824..6937b750f9 100644 --- a/cli/factory.rs +++ b/cli/factory.rs @@ -504,7 +504,12 @@ impl CliFactory { let resolver = cli_options .create_workspace_resolver( self.file_fetcher()?, - if cli_options.use_byonm() { + if cli_options.use_byonm() + && !matches!( + cli_options.sub_command(), + DenoSubcommand::Publish(_) + ) + { PackageJsonDepResolution::Disabled } else { // todo(dsherret): this should be false for nodeModulesDir: true diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs index 640f83c35c..f0adc60e3b 100644 --- a/cli/file_fetcher.rs +++ b/cli/file_fetcher.rs @@ -1540,7 +1540,7 @@ mod tests { .unwrap() .unwrap() .content; - String::from_utf8(bytes).unwrap() + String::from_utf8(bytes.into_owned()).unwrap() } #[track_caller] diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs index ea77e36bcf..a629757788 100644 --- a/cli/lsp/config.rs +++ b/cli/lsp/config.rs @@ -41,6 +41,7 @@ use deno_path_util::url_to_file_path; use deno_runtime::deno_node::PackageJson; use indexmap::IndexSet; use lsp_types::ClientCapabilities; +use std::borrow::Cow; use std::collections::BTreeMap; use std::collections::BTreeSet; use std::collections::HashMap; @@ -2092,7 +2093,7 @@ impl CachedFsItems { #[derive(Default)] struct InnerData { stat_calls: CachedFsItems, - read_to_string_calls: CachedFsItems, + read_to_string_calls: CachedFsItems>, } #[derive(Default)] @@ -2113,7 +2114,7 @@ impl DenoConfigFs for CachedDenoConfigFs { fn read_to_string_lossy( &self, path: &Path, - ) -> Result { + ) -> Result, std::io::Error> { self .0 .lock() diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs index df51c07a39..b9ec8ffc46 100644 --- a/cli/lsp/documents.rs +++ b/cli/lsp/documents.rs @@ -925,7 +925,7 @@ impl FileSystemDocuments { let content = bytes_to_content( specifier, media_type, - cached_file.content, + cached_file.content.into_owned(), maybe_charset, ) .ok()?; diff --git a/cli/lsp/jsr.rs b/cli/lsp/jsr.rs index 9a738ec287..ab570f6348 100644 --- a/cli/lsp/jsr.rs +++ b/cli/lsp/jsr.rs @@ -262,7 +262,7 @@ fn read_cached_url( cache .get(&cache.cache_item_key(url).ok()?, None) .ok()? - .map(|f| f.content) + .map(|f| f.content.into_owned()) } #[derive(Debug)] diff --git a/cli/tools/registry/diagnostics.rs b/cli/tools/registry/diagnostics.rs index ef38affc30..9c32b8e36d 100644 --- a/cli/tools/registry/diagnostics.rs +++ b/cli/tools/registry/diagnostics.rs @@ -169,7 +169,7 @@ impl Diagnostic for PublishDiagnostic { .. }) => DiagnosticLevel::Warning, FastCheck(_) => DiagnosticLevel::Error, - SpecifierUnfurl(_) => DiagnosticLevel::Warning, + SpecifierUnfurl(d) => d.level(), InvalidPath { .. } => DiagnosticLevel::Error, DuplicatePath { .. } => DiagnosticLevel::Error, UnsupportedFileType { .. } => DiagnosticLevel::Warning, @@ -187,7 +187,7 @@ impl Diagnostic for PublishDiagnostic { use PublishDiagnostic::*; match &self { FastCheck(diagnostic) => diagnostic.code(), - SpecifierUnfurl(diagnostic) => Cow::Borrowed(diagnostic.code()), + SpecifierUnfurl(diagnostic) => diagnostic.code(), InvalidPath { .. } => Cow::Borrowed("invalid-path"), DuplicatePath { .. } => Cow::Borrowed("case-insensitive-duplicate-path"), UnsupportedFileType { .. } => Cow::Borrowed("unsupported-file-type"), @@ -207,7 +207,7 @@ impl Diagnostic for PublishDiagnostic { use PublishDiagnostic::*; match &self { FastCheck(diagnostic) => diagnostic.message(), - SpecifierUnfurl(diagnostic) => Cow::Borrowed(diagnostic.message()), + SpecifierUnfurl(diagnostic) => diagnostic.message(), InvalidPath { message, .. } => Cow::Borrowed(message.as_str()), DuplicatePath { .. } => { Cow::Borrowed("package path is a case insensitive duplicate of another path in the package") @@ -243,17 +243,7 @@ impl Diagnostic for PublishDiagnostic { use PublishDiagnostic::*; match &self { FastCheck(diagnostic) => diagnostic.location(), - SpecifierUnfurl(diagnostic) => match diagnostic { - SpecifierUnfurlerDiagnostic::UnanalyzableDynamicImport { - specifier, - text_info, - range, - } => DiagnosticLocation::ModulePosition { - specifier: Cow::Borrowed(specifier), - text_info: Cow::Borrowed(text_info), - source_pos: DiagnosticSourcePos::SourcePos(range.start), - }, - }, + SpecifierUnfurl(diagnostic) => diagnostic.location(), InvalidPath { path, .. } => { DiagnosticLocation::Path { path: path.clone() } } @@ -325,24 +315,8 @@ impl Diagnostic for PublishDiagnostic { use PublishDiagnostic::*; match &self { - FastCheck(diagnostic) => diagnostic.snippet(), - SpecifierUnfurl(diagnostic) => match diagnostic { - SpecifierUnfurlerDiagnostic::UnanalyzableDynamicImport { - text_info, - range, - .. - } => Some(DiagnosticSnippet { - source: Cow::Borrowed(text_info), - highlights: vec![DiagnosticSnippetHighlight { - style: DiagnosticSnippetHighlightStyle::Warning, - range: DiagnosticSourceRange { - start: DiagnosticSourcePos::SourcePos(range.start), - end: DiagnosticSourcePos::SourcePos(range.end), - }, - description: Some("the unanalyzable dynamic import".into()), - }], - }), - }, + FastCheck(d) => d.snippet(), + SpecifierUnfurl(d) => d.snippet(), InvalidPath { .. } => None, DuplicatePath { .. } => None, UnsupportedFileType { .. } => None, @@ -380,7 +354,7 @@ impl Diagnostic for PublishDiagnostic { use PublishDiagnostic::*; match &self { FastCheck(diagnostic) => diagnostic.hint(), - SpecifierUnfurl(_) => None, + SpecifierUnfurl(d) => d.hint(), InvalidPath { .. } => Some( Cow::Borrowed("rename or remove the file, or add it to 'publish.exclude' in the config file"), ), @@ -436,9 +410,9 @@ impl Diagnostic for PublishDiagnostic { None => None, } } - SyntaxError(diagnostic) => diagnostic.snippet_fixed(), + SyntaxError(d) => d.snippet_fixed(), + SpecifierUnfurl(d) => d.snippet_fixed(), FastCheck(_) - | SpecifierUnfurl(_) | InvalidPath { .. } | DuplicatePath { .. } | UnsupportedFileType { .. } @@ -453,16 +427,8 @@ impl Diagnostic for PublishDiagnostic { fn info(&self) -> Cow<'_, [Cow<'_, str>]> { use PublishDiagnostic::*; match &self { - FastCheck(diagnostic) => { - diagnostic.info() - } - SpecifierUnfurl(diagnostic) => match diagnostic { - SpecifierUnfurlerDiagnostic::UnanalyzableDynamicImport { .. } => Cow::Borrowed(&[ - Cow::Borrowed("after publishing this package, imports from the local import map / package.json do not work"), - Cow::Borrowed("dynamic imports that can not be analyzed at publish time will not be rewritten automatically"), - Cow::Borrowed("make sure the dynamic import is resolvable at runtime without an import map / package.json") - ]), - }, + FastCheck(d) => d.info(), + SpecifierUnfurl(d) => d.info(), InvalidPath { .. } => Cow::Borrowed(&[ Cow::Borrowed("to portably support all platforms, including windows, the allowed characters in package paths are limited"), ]), @@ -503,10 +469,8 @@ impl Diagnostic for PublishDiagnostic { fn docs_url(&self) -> Option> { use PublishDiagnostic::*; match &self { - FastCheck(diagnostic) => diagnostic.docs_url(), - SpecifierUnfurl(diagnostic) => match diagnostic { - SpecifierUnfurlerDiagnostic::UnanalyzableDynamicImport { .. } => None, - }, + FastCheck(d) => d.docs_url(), + SpecifierUnfurl(d) => d.docs_url(), InvalidPath { .. } => { Some(Cow::Borrowed("https://jsr.io/go/invalid-path")) } diff --git a/cli/tools/registry/mod.rs b/cli/tools/registry/mod.rs index a866660f36..001e401459 100644 --- a/cli/tools/registry/mod.rs +++ b/cli/tools/registry/mod.rs @@ -14,7 +14,6 @@ use base64::Engine; use deno_ast::ModuleSpecifier; use deno_config::deno_json::ConfigFile; use deno_config::workspace::JsrPackageConfig; -use deno_config::workspace::PackageJsonDepResolution; use deno_config::workspace::Workspace; use deno_core::anyhow::bail; use deno_core::anyhow::Context; @@ -44,8 +43,6 @@ use crate::cache::ParsedSourceCache; use crate::factory::CliFactory; use crate::graph_util::ModuleGraphCreator; use crate::http_util::HttpClient; -use crate::resolver::CliSloppyImportsResolver; -use crate::resolver::SloppyImportsCachedFs; use crate::tools::check::CheckOptions; use crate::tools::lint::collect_no_slow_type_diagnostics; use crate::tools::registry::diagnostics::PublishDiagnostic; @@ -123,19 +120,8 @@ pub async fn publish( } let specifier_unfurler = Arc::new(SpecifierUnfurler::new( - if cli_options.unstable_sloppy_imports() { - Some(CliSloppyImportsResolver::new(SloppyImportsCachedFs::new( - cli_factory.fs().clone(), - ))) - } else { - None - }, - cli_options - .create_workspace_resolver( - cli_factory.file_fetcher()?, - PackageJsonDepResolution::Enabled, - ) - .await?, + cli_factory.sloppy_imports_resolver()?.cloned(), + cli_factory.workspace_resolver().await?.clone(), cli_options.unstable_bare_node_builtins(), )); diff --git a/cli/tools/registry/pm/deps.rs b/cli/tools/registry/pm/deps.rs index 4778d6f327..b7e1c0f0d4 100644 --- a/cli/tools/registry/pm/deps.rs +++ b/cli/tools/registry/pm/deps.rs @@ -19,8 +19,7 @@ use deno_core::futures::FutureExt; use deno_core::futures::StreamExt; use deno_core::serde_json; use deno_graph::FillFromLockfileOptions; -use deno_package_json::PackageJsonDepValue; -use deno_package_json::PackageJsonDepValueParseError; +use deno_package_json::PackageJsonDepsMap; use deno_package_json::PackageJsonRc; use deno_runtime::deno_permissions::PermissionsContainer; use deno_semver::jsr::JsrPackageReqReference; @@ -32,7 +31,6 @@ use deno_semver::VersionReq; use import_map::ImportMap; use import_map::ImportMapWithDiagnostics; use import_map::SpecifierMapEntry; -use indexmap::IndexMap; use tokio::sync::Semaphore; use crate::args::CliLockfile; @@ -269,94 +267,6 @@ enum PackageJsonDepKind { Dev, } -type PackageJsonDeps = IndexMap< - String, - Result< - (PackageJsonDepKind, PackageJsonDepValue), - PackageJsonDepValueParseError, - >, ->; - -/// Resolve the package.json's dependencies. -// TODO(nathanwhit): Remove once we update deno_package_json with dev deps split out -fn resolve_local_package_json_deps( - package_json: &PackageJsonRc, -) -> PackageJsonDeps { - /// Gets the name and raw version constraint for a registry info or - /// package.json dependency entry taking into account npm package aliases. - fn parse_dep_entry_name_and_raw_version<'a>( - key: &'a str, - value: &'a str, - ) -> (&'a str, &'a str) { - if let Some(package_and_version) = value.strip_prefix("npm:") { - if let Some((name, version)) = package_and_version.rsplit_once('@') { - // if empty, then the name was scoped and there's no version - if name.is_empty() { - (package_and_version, "*") - } else { - (name, version) - } - } else { - (package_and_version, "*") - } - } else { - (key, value) - } - } - - fn parse_entry( - key: &str, - value: &str, - ) -> Result { - if let Some(workspace_key) = value.strip_prefix("workspace:") { - let version_req = VersionReq::parse_from_npm(workspace_key)?; - return Ok(PackageJsonDepValue::Workspace(version_req)); - } - if value.starts_with("file:") - || value.starts_with("git:") - || value.starts_with("http:") - || value.starts_with("https:") - { - return Err(PackageJsonDepValueParseError::Unsupported { - scheme: value.split(':').next().unwrap().to_string(), - }); - } - let (name, version_req) = parse_dep_entry_name_and_raw_version(key, value); - let result = VersionReq::parse_from_npm(version_req); - match result { - Ok(version_req) => Ok(PackageJsonDepValue::Req(PackageReq { - name: name.to_string(), - version_req, - })), - Err(err) => Err(PackageJsonDepValueParseError::VersionReq(err)), - } - } - - fn insert_deps( - deps: Option<&IndexMap>, - result: &mut PackageJsonDeps, - kind: PackageJsonDepKind, - ) { - if let Some(deps) = deps { - for (key, value) in deps { - result.entry(key.to_string()).or_insert_with(|| { - parse_entry(key, value).map(|entry| (kind, entry)) - }); - } - } - } - - let deps = package_json.dependencies.as_ref(); - let dev_deps = package_json.dev_dependencies.as_ref(); - let mut result = IndexMap::new(); - - // favors the deps over dev_deps - insert_deps(deps, &mut result, PackageJsonDepKind::Normal); - insert_deps(dev_deps, &mut result, PackageJsonDepKind::Dev); - - result -} - fn add_deps_from_deno_json( deno_json: &Arc, mut filter: impl DepFilter, @@ -406,40 +316,64 @@ fn add_deps_from_deno_json( fn add_deps_from_package_json( package_json: &PackageJsonRc, - mut filter: impl DepFilter, + filter: impl DepFilter, deps: &mut Vec, ) { - let package_json_deps = resolve_local_package_json_deps(package_json); - for (k, v) in package_json_deps { - let (package_dep_kind, v) = match v { - Ok((k, v)) => (k, v), - Err(e) => { - log::warn!("bad package json dep value: {e}"); - continue; - } - }; - match v { - deno_package_json::PackageJsonDepValue::Req(req) => { - let alias = k.as_str(); - let alias = (alias != req.name).then(|| alias.to_string()); - if !filter.should_include(alias.as_deref(), &req, DepKind::Npm) { + let package_json_deps = package_json.resolve_local_package_json_deps(); + + fn iterate( + package_json: &PackageJsonRc, + mut filter: impl DepFilter, + package_dep_kind: PackageJsonDepKind, + package_json_deps: PackageJsonDepsMap, + deps: &mut Vec, + ) { + for (k, v) in package_json_deps { + let v = match v { + Ok(v) => v, + Err(e) => { + log::warn!("bad package json dep value: {e}"); continue; } - let id = DepId(deps.len()); - deps.push(Dep { - id, - kind: DepKind::Npm, - location: DepLocation::PackageJson( - package_json.clone(), - KeyPath::from_parts([package_dep_kind.into(), k.into()]), - ), - req, - alias, - }) + }; + match v { + deno_package_json::PackageJsonDepValue::Req(req) => { + let alias = k.as_str(); + let alias = (alias != req.name).then(|| alias.to_string()); + if !filter.should_include(alias.as_deref(), &req, DepKind::Npm) { + continue; + } + let id = DepId(deps.len()); + deps.push(Dep { + id, + kind: DepKind::Npm, + location: DepLocation::PackageJson( + package_json.clone(), + KeyPath::from_parts([package_dep_kind.into(), k.into()]), + ), + req, + alias, + }) + } + deno_package_json::PackageJsonDepValue::Workspace(_) => continue, } - deno_package_json::PackageJsonDepValue::Workspace(_) => continue, } } + + iterate( + package_json, + filter, + PackageJsonDepKind::Normal, + package_json_deps.dependencies, + deps, + ); + iterate( + package_json, + filter, + PackageJsonDepKind::Dev, + package_json_deps.dev_dependencies, + deps, + ); } fn deps_from_workspace( diff --git a/cli/tools/registry/unfurl.rs b/cli/tools/registry/unfurl.rs index 90343ac656..bf6aaaf50d 100644 --- a/cli/tools/registry/unfurl.rs +++ b/cli/tools/registry/unfurl.rs @@ -1,19 +1,35 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use std::borrow::Cow; +use std::sync::Arc; + +use deno_ast::diagnostics::Diagnostic; +use deno_ast::diagnostics::DiagnosticLevel; +use deno_ast::diagnostics::DiagnosticLocation; +use deno_ast::diagnostics::DiagnosticSnippet; +use deno_ast::diagnostics::DiagnosticSnippetHighlight; +use deno_ast::diagnostics::DiagnosticSnippetHighlightStyle; +use deno_ast::diagnostics::DiagnosticSourcePos; +use deno_ast::diagnostics::DiagnosticSourceRange; use deno_ast::ParsedSource; use deno_ast::SourceRange; use deno_ast::SourceTextInfo; +use deno_ast::SourceTextProvider; use deno_config::workspace::MappedResolution; use deno_config::workspace::PackageJsonDepResolution; use deno_config::workspace::WorkspaceResolver; +use deno_core::anyhow; use deno_core::ModuleSpecifier; use deno_graph::DependencyDescriptor; use deno_graph::DynamicTemplatePart; use deno_graph::ParserModuleAnalyzer; use deno_graph::TypeScriptReference; use deno_package_json::PackageJsonDepValue; +use deno_package_json::PackageJsonDepWorkspaceReq; use deno_resolver::sloppy_imports::SloppyImportsResolutionKind; use deno_runtime::deno_node::is_builtin_node_module; +use deno_semver::Version; +use deno_semver::VersionReq; use crate::resolver::CliSloppyImportsResolver; @@ -24,34 +40,163 @@ pub enum SpecifierUnfurlerDiagnostic { text_info: SourceTextInfo, range: SourceRange, }, + ResolvingNpmWorkspacePackage { + specifier: ModuleSpecifier, + package_name: String, + text_info: SourceTextInfo, + range: SourceRange, + reason: String, + }, } -impl SpecifierUnfurlerDiagnostic { - pub fn code(&self) -> &'static str { +impl Diagnostic for SpecifierUnfurlerDiagnostic { + fn level(&self) -> DiagnosticLevel { match self { - Self::UnanalyzableDynamicImport { .. } => "unanalyzable-dynamic-import", - } - } - - pub fn message(&self) -> &'static str { - match self { - Self::UnanalyzableDynamicImport { .. } => { - "unable to analyze dynamic import" + SpecifierUnfurlerDiagnostic::UnanalyzableDynamicImport { .. } => { + DiagnosticLevel::Warning + } + SpecifierUnfurlerDiagnostic::ResolvingNpmWorkspacePackage { .. } => { + DiagnosticLevel::Error } } } + + fn code(&self) -> Cow<'_, str> { + match self { + Self::UnanalyzableDynamicImport { .. } => "unanalyzable-dynamic-import", + Self::ResolvingNpmWorkspacePackage { .. } => "npm-workspace-package", + } + .into() + } + + fn message(&self) -> Cow<'_, str> { + match self { + Self::UnanalyzableDynamicImport { .. } => { + "unable to analyze dynamic import".into() + } + Self::ResolvingNpmWorkspacePackage { + package_name, + reason, + .. + } => format!( + "failed resolving npm workspace package '{}': {}", + package_name, reason + ) + .into(), + } + } + + fn location(&self) -> deno_ast::diagnostics::DiagnosticLocation { + match self { + SpecifierUnfurlerDiagnostic::UnanalyzableDynamicImport { + specifier, + text_info, + range, + } => DiagnosticLocation::ModulePosition { + specifier: Cow::Borrowed(specifier), + text_info: Cow::Borrowed(text_info), + source_pos: DiagnosticSourcePos::SourcePos(range.start), + }, + SpecifierUnfurlerDiagnostic::ResolvingNpmWorkspacePackage { + specifier, + text_info, + range, + .. + } => DiagnosticLocation::ModulePosition { + specifier: Cow::Borrowed(specifier), + text_info: Cow::Borrowed(text_info), + source_pos: DiagnosticSourcePos::SourcePos(range.start), + }, + } + } + + fn snippet(&self) -> Option> { + match self { + SpecifierUnfurlerDiagnostic::UnanalyzableDynamicImport { + text_info, + range, + .. + } => Some(DiagnosticSnippet { + source: Cow::Borrowed(text_info), + highlights: vec![DiagnosticSnippetHighlight { + style: DiagnosticSnippetHighlightStyle::Warning, + range: DiagnosticSourceRange { + start: DiagnosticSourcePos::SourcePos(range.start), + end: DiagnosticSourcePos::SourcePos(range.end), + }, + description: Some("the unanalyzable dynamic import".into()), + }], + }), + SpecifierUnfurlerDiagnostic::ResolvingNpmWorkspacePackage { + text_info, + range, + .. + } => Some(DiagnosticSnippet { + source: Cow::Borrowed(text_info), + highlights: vec![DiagnosticSnippetHighlight { + style: DiagnosticSnippetHighlightStyle::Warning, + range: DiagnosticSourceRange { + start: DiagnosticSourcePos::SourcePos(range.start), + end: DiagnosticSourcePos::SourcePos(range.end), + }, + description: Some("the unresolved import".into()), + }], + }), + } + } + + fn hint(&self) -> Option> { + match self { + SpecifierUnfurlerDiagnostic::UnanalyzableDynamicImport { .. } => { + None + } + SpecifierUnfurlerDiagnostic::ResolvingNpmWorkspacePackage { .. } => Some( + "make sure the npm workspace package is resolvable and has a version field in its package.json".into() + ), + } + } + + fn snippet_fixed( + &self, + ) -> Option> { + None + } + + fn info(&self) -> Cow<'_, [Cow<'_, str>]> { + match self { + SpecifierUnfurlerDiagnostic::UnanalyzableDynamicImport { .. } => Cow::Borrowed(&[ + Cow::Borrowed("after publishing this package, imports from the local import map / package.json do not work"), + Cow::Borrowed("dynamic imports that can not be analyzed at publish time will not be rewritten automatically"), + Cow::Borrowed("make sure the dynamic import is resolvable at runtime without an import map / package.json") + ]), + SpecifierUnfurlerDiagnostic::ResolvingNpmWorkspacePackage { .. } => { + Cow::Borrowed(&[]) + }, + } + } + + fn docs_url(&self) -> Option> { + None + } +} + +enum UnfurlSpecifierError { + Workspace { + package_name: String, + reason: String, + }, } pub struct SpecifierUnfurler { - sloppy_imports_resolver: Option, - workspace_resolver: WorkspaceResolver, + sloppy_imports_resolver: Option>, + workspace_resolver: Arc, bare_node_builtins: bool, } impl SpecifierUnfurler { pub fn new( - sloppy_imports_resolver: Option, - workspace_resolver: WorkspaceResolver, + sloppy_imports_resolver: Option>, + workspace_resolver: Arc, bare_node_builtins: bool, ) -> Self { debug_assert_eq!( @@ -65,11 +210,45 @@ impl SpecifierUnfurler { } } + fn unfurl_specifier_reporting_diagnostic( + &self, + referrer: &ModuleSpecifier, + specifier: &str, + text_info: &SourceTextInfo, + range: &deno_graph::PositionRange, + diagnostic_reporter: &mut dyn FnMut(SpecifierUnfurlerDiagnostic), + ) -> Option { + match self.unfurl_specifier(referrer, specifier) { + Ok(maybe_unfurled) => maybe_unfurled, + Err(diagnostic) => match diagnostic { + UnfurlSpecifierError::Workspace { + package_name, + reason, + } => { + let range = to_range(text_info, range); + diagnostic_reporter( + SpecifierUnfurlerDiagnostic::ResolvingNpmWorkspacePackage { + specifier: referrer.clone(), + package_name, + text_info: text_info.clone(), + range: SourceRange::new( + text_info.start_pos() + range.start, + text_info.start_pos() + range.end, + ), + reason, + }, + ); + None + } + }, + } + } + fn unfurl_specifier( &self, referrer: &ModuleSpecifier, specifier: &str, - ) -> Option { + ) -> Result, UnfurlSpecifierError> { let resolved = if let Ok(resolved) = self.workspace_resolver.resolve(specifier, referrer) { @@ -120,8 +299,40 @@ impl SpecifierUnfurler { )) .ok() } - PackageJsonDepValue::Workspace(version_req) => { - // todo(#24612): consider warning or error when this is also a jsr package? + PackageJsonDepValue::Workspace(workspace_version_req) => { + let version_req = match workspace_version_req { + PackageJsonDepWorkspaceReq::VersionReq(version_req) => { + Cow::Borrowed(version_req) + } + PackageJsonDepWorkspaceReq::Caret => { + let version = self + .find_workspace_npm_dep_version(alias) + .map_err(|err| UnfurlSpecifierError::Workspace { + package_name: alias.to_string(), + reason: err.to_string(), + })?; + // version was validated, so ok to unwrap + Cow::Owned( + VersionReq::parse_from_npm(&format!("^{}", version)) + .unwrap(), + ) + } + PackageJsonDepWorkspaceReq::Tilde => { + let version = self + .find_workspace_npm_dep_version(alias) + .map_err(|err| UnfurlSpecifierError::Workspace { + package_name: alias.to_string(), + reason: err.to_string(), + })?; + // version was validated, so ok to unwrap + Cow::Owned( + VersionReq::parse_from_npm(&format!("~{}", version)) + .unwrap(), + ) + } + }; + // todo(#24612): warn when this is also a jsr package telling + // people to map the specifiers in the import map ModuleSpecifier::parse(&format!( "npm:{}@{}{}", alias, @@ -151,10 +362,14 @@ impl SpecifierUnfurler { None if self.bare_node_builtins && is_builtin_node_module(specifier) => { format!("node:{specifier}").parse().unwrap() } - None => ModuleSpecifier::options() + None => match ModuleSpecifier::options() .base_url(Some(referrer)) .parse(specifier) - .ok()?, + .ok() + { + Some(value) => value, + None => return Ok(None), + }, }; // TODO(lucacasonato): this requires integration in deno_graph first // let resolved = if let Ok(specifier) = @@ -188,7 +403,7 @@ impl SpecifierUnfurler { }; let relative_resolved = relative_url(&resolved, referrer); if relative_resolved == specifier { - None // nothing to unfurl + Ok(None) // nothing to unfurl } else { log::debug!( "Unfurled specifier: {} from {} -> {}", @@ -196,7 +411,29 @@ impl SpecifierUnfurler { referrer, relative_resolved ); - Some(relative_resolved) + Ok(Some(relative_resolved)) + } + } + + fn find_workspace_npm_dep_version( + &self, + pkg_name: &str, + ) -> Result { + // todo(#24612): warn when this is also a jsr package telling + // people to map the specifiers in the import map + let pkg_json = self + .workspace_resolver + .package_jsons() + .find(|pkg| pkg.name.as_deref() == Some(pkg_name)) + .ok_or_else(|| { + anyhow::anyhow!("unable to find npm package in workspace") + })?; + if let Some(version) = &pkg_json.version { + Ok(Version::parse_from_npm(version)?) + } else { + Err(anyhow::anyhow!( + "missing version in package.json of npm package", + )) } } @@ -208,6 +445,7 @@ impl SpecifierUnfurler { text_info: &SourceTextInfo, dep: &deno_graph::DynamicDependencyDescriptor, text_changes: &mut Vec, + diagnostic_reporter: &mut dyn FnMut(SpecifierUnfurlerDiagnostic), ) -> bool { match &dep.argument { deno_graph::DynamicArgument::String(specifier) => { @@ -217,8 +455,14 @@ impl SpecifierUnfurler { let Some(relative_index) = maybe_relative_index else { return true; // always say it's analyzable for a string }; - let unfurled = self.unfurl_specifier(module_url, specifier); - if let Some(unfurled) = unfurled { + let maybe_unfurled = self.unfurl_specifier_reporting_diagnostic( + module_url, + specifier, + text_info, + &dep.argument_range, + diagnostic_reporter, + ); + if let Some(unfurled) = maybe_unfurled { let start = range.start + relative_index; text_changes.push(deno_ast::TextChange { range: start..start + specifier.len(), @@ -238,7 +482,13 @@ impl SpecifierUnfurler { if !specifier.ends_with('/') { return false; } - let unfurled = self.unfurl_specifier(module_url, specifier); + let unfurled = self.unfurl_specifier_reporting_diagnostic( + module_url, + specifier, + text_info, + &dep.argument_range, + diagnostic_reporter, + ); let Some(unfurled) = unfurled else { return true; // nothing to unfurl }; @@ -280,8 +530,15 @@ impl SpecifierUnfurler { let analyze_specifier = |specifier: &str, range: &deno_graph::PositionRange, - text_changes: &mut Vec| { - if let Some(unfurled) = self.unfurl_specifier(url, specifier) { + text_changes: &mut Vec, + diagnostic_reporter: &mut dyn FnMut(SpecifierUnfurlerDiagnostic)| { + if let Some(unfurled) = self.unfurl_specifier_reporting_diagnostic( + url, + specifier, + text_info, + range, + diagnostic_reporter, + ) { text_changes.push(deno_ast::TextChange { range: to_range(text_info, range), new_text: unfurled, @@ -295,11 +552,17 @@ impl SpecifierUnfurler { &dep.specifier, &dep.specifier_range, &mut text_changes, + diagnostic_reporter, ); } DependencyDescriptor::Dynamic(dep) => { - let success = - self.try_unfurl_dynamic_dep(url, text_info, dep, &mut text_changes); + let success = self.try_unfurl_dynamic_dep( + url, + text_info, + dep, + &mut text_changes, + diagnostic_reporter, + ); if !success { let start_pos = text_info.line_start(dep.argument_range.start.line) @@ -326,6 +589,7 @@ impl SpecifierUnfurler { &specifier_with_range.text, &specifier_with_range.range, &mut text_changes, + diagnostic_reporter, ); } for jsdoc in &module_info.jsdoc_imports { @@ -333,6 +597,7 @@ impl SpecifierUnfurler { &jsdoc.specifier.text, &jsdoc.specifier.range, &mut text_changes, + diagnostic_reporter, ); } if let Some(specifier_with_range) = &module_info.jsx_import_source { @@ -340,6 +605,7 @@ impl SpecifierUnfurler { &specifier_with_range.text, &specifier_with_range.range, &mut text_changes, + diagnostic_reporter, ); } @@ -458,10 +724,10 @@ mod tests { ); let fs = Arc::new(RealFs); let unfurler = SpecifierUnfurler::new( - Some(CliSloppyImportsResolver::new(SloppyImportsCachedFs::new( - fs, + Some(Arc::new(CliSloppyImportsResolver::new( + SloppyImportsCachedFs::new(fs), ))), - workspace_resolver, + Arc::new(workspace_resolver), true, ); @@ -547,4 +813,114 @@ const warn2 = await import(`${expr}`); assert_eq!(unfurled_source, expected_source); } } + + #[test] + fn test_unfurling_npm_dep_workspace_specifier() { + let cwd = testdata_path().join("unfurl").to_path_buf(); + + let pkg_json_add = PackageJson::load_from_value( + cwd.join("add/package.json"), + json!({ "name": "add", "version": "0.1.0", }), + ); + let pkg_json_subtract = PackageJson::load_from_value( + cwd.join("subtract/package.json"), + json!({ "name": "subtract", "version": "0.2.0", }), + ); + let pkg_json_publishing = PackageJson::load_from_value( + cwd.join("publish/package.json"), + json!({ + "name": "@denotest/main", + "version": "1.0.0", + "dependencies": { + "add": "workspace:~", + "subtract": "workspace:^", + "non-existent": "workspace:~", + } + }), + ); + let root_pkg_json = PackageJson::load_from_value( + cwd.join("package.json"), + json!({ "workspaces": ["./publish", "./subtract", "./add"] }), + ); + let workspace_resolver = WorkspaceResolver::new_raw( + Arc::new(ModuleSpecifier::from_directory_path(&cwd).unwrap()), + None, + vec![ResolverWorkspaceJsrPackage { + is_patch: false, + base: ModuleSpecifier::from_directory_path( + cwd.join("publish/jsr.json"), + ) + .unwrap(), + name: "@denotest/main".to_string(), + version: Some(Version::parse_standard("1.0.0").unwrap()), + exports: IndexMap::from([(".".to_string(), "mod.ts".to_string())]), + }], + vec![ + Arc::new(root_pkg_json), + Arc::new(pkg_json_add), + Arc::new(pkg_json_subtract), + Arc::new(pkg_json_publishing), + ], + deno_config::workspace::PackageJsonDepResolution::Enabled, + ); + let fs = Arc::new(RealFs); + let unfurler = SpecifierUnfurler::new( + Some(Arc::new(CliSloppyImportsResolver::new( + SloppyImportsCachedFs::new(fs), + ))), + Arc::new(workspace_resolver), + true, + ); + + { + let source_code = r#"import add from "add"; +import subtract from "subtract"; + +console.log(add, subtract); +"#; + let specifier = + ModuleSpecifier::from_file_path(cwd.join("publish").join("mod.ts")) + .unwrap(); + let source = parse_ast(&specifier, source_code); + let mut d = Vec::new(); + let mut reporter = |diagnostic| d.push(diagnostic); + let unfurled_source = unfurler.unfurl(&specifier, &source, &mut reporter); + assert_eq!(d.len(), 0); + // it will inline the version + let expected_source = r#"import add from "npm:add@~0.1.0"; +import subtract from "npm:subtract@^0.2.0"; + +console.log(add, subtract); +"#; + assert_eq!(unfurled_source, expected_source); + } + + { + let source_code = r#"import nonExistent from "non-existent"; +console.log(nonExistent); +"#; + let specifier = + ModuleSpecifier::from_file_path(cwd.join("publish").join("other.ts")) + .unwrap(); + let source = parse_ast(&specifier, source_code); + let mut d = Vec::new(); + let mut reporter = |diagnostic| d.push(diagnostic); + let unfurled_source = unfurler.unfurl(&specifier, &source, &mut reporter); + assert_eq!(d.len(), 1); + match &d[0] { + SpecifierUnfurlerDiagnostic::ResolvingNpmWorkspacePackage { + package_name, + reason, + .. + } => { + assert_eq!(package_name, "non-existent"); + assert_eq!(reason, "unable to find npm package in workspace"); + } + _ => unreachable!(), + } + // won't make any changes, but the above will be a fatal error + assert!(matches!(d[0].level(), DiagnosticLevel::Error)); + assert_eq!(unfurled_source, source_code); + } + } } diff --git a/ext/node/lib.rs b/ext/node/lib.rs index 9986b0f607..bf593ad432 100644 --- a/ext/node/lib.rs +++ b/ext/node/lib.rs @@ -872,12 +872,10 @@ impl deno_package_json::fs::DenoPkgJsonFs for DenoFsNodeResolverEnv { fn read_to_string_lossy( &self, path: &std::path::Path, - ) -> Result { + ) -> Result, std::io::Error> { self .fs .read_text_file_lossy_sync(path, None) - // todo(https://github.com/denoland/deno_package_json/pull/9): don't clone - .map(|text| text.into_owned()) .map_err(|err| err.into_io_error()) } } @@ -888,12 +886,10 @@ impl<'a> deno_package_json::fs::DenoPkgJsonFs for DenoPkgJsonFsAdapter<'a> { fn read_to_string_lossy( &self, path: &Path, - ) -> Result { + ) -> Result, std::io::Error> { self .0 .read_text_file_lossy_sync(path, None) - // todo(https://github.com/denoland/deno_package_json/pull/9): don't clone - .map(|text| text.into_owned()) .map_err(|err| err.into_io_error()) } } diff --git a/resolvers/deno/npm/byonm.rs b/resolvers/deno/npm/byonm.rs index e9182d47a1..771f23ce23 100644 --- a/resolvers/deno/npm/byonm.rs +++ b/resolvers/deno/npm/byonm.rs @@ -179,7 +179,11 @@ impl ByonmNpmResolver { pkg_json: &PackageJson, ) -> Option { let deps = pkg_json.resolve_local_package_json_deps(); - for (key, value) in deps { + for (key, value) in deps + .dependencies + .into_iter() + .chain(deps.dev_dependencies.into_iter()) + { if let Ok(value) = value { match value { PackageJsonDepValue::Req(dep_req) => { diff --git a/tests/specs/npm/workspace_version_wildcards/__test__.jsonc b/tests/specs/npm/workspace_version_wildcards/__test__.jsonc new file mode 100644 index 0000000000..1dfb3dc6a5 --- /dev/null +++ b/tests/specs/npm/workspace_version_wildcards/__test__.jsonc @@ -0,0 +1,10 @@ +{ + "tempDir": true, + "steps": [{ + "args": "install", + "output": "[WILDCARD]" + }, { + "args": "run e/main.ts", + "output": "main.out" + }] +} diff --git a/tests/specs/npm/workspace_version_wildcards/a/mod.ts b/tests/specs/npm/workspace_version_wildcards/a/mod.ts new file mode 100644 index 0000000000..784e2aed80 --- /dev/null +++ b/tests/specs/npm/workspace_version_wildcards/a/mod.ts @@ -0,0 +1,3 @@ +export function sayHello() { + console.log("Hello from a!"); +} diff --git a/tests/specs/npm/workspace_version_wildcards/a/package.json b/tests/specs/npm/workspace_version_wildcards/a/package.json new file mode 100644 index 0000000000..0b4b7cedc6 --- /dev/null +++ b/tests/specs/npm/workspace_version_wildcards/a/package.json @@ -0,0 +1,7 @@ +{ + "name": "@denotest/a", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/npm/workspace_version_wildcards/b/mod.ts b/tests/specs/npm/workspace_version_wildcards/b/mod.ts new file mode 100644 index 0000000000..74b0441515 --- /dev/null +++ b/tests/specs/npm/workspace_version_wildcards/b/mod.ts @@ -0,0 +1,3 @@ +export function sayHello() { + console.log("Hello from b!"); +} diff --git a/tests/specs/npm/workspace_version_wildcards/b/package.json b/tests/specs/npm/workspace_version_wildcards/b/package.json new file mode 100644 index 0000000000..d01d890f72 --- /dev/null +++ b/tests/specs/npm/workspace_version_wildcards/b/package.json @@ -0,0 +1,7 @@ +{ + "name": "@denotest/b", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/npm/workspace_version_wildcards/c/mod.ts b/tests/specs/npm/workspace_version_wildcards/c/mod.ts new file mode 100644 index 0000000000..462fbd398c --- /dev/null +++ b/tests/specs/npm/workspace_version_wildcards/c/mod.ts @@ -0,0 +1,3 @@ +export function sayHello() { + console.log("Hello from c!"); +} diff --git a/tests/specs/npm/workspace_version_wildcards/c/package.json b/tests/specs/npm/workspace_version_wildcards/c/package.json new file mode 100644 index 0000000000..caf23c77cd --- /dev/null +++ b/tests/specs/npm/workspace_version_wildcards/c/package.json @@ -0,0 +1,7 @@ +{ + "name": "@denotest/c", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/npm/workspace_version_wildcards/d/mod.ts b/tests/specs/npm/workspace_version_wildcards/d/mod.ts new file mode 100644 index 0000000000..a21866ee89 --- /dev/null +++ b/tests/specs/npm/workspace_version_wildcards/d/mod.ts @@ -0,0 +1,3 @@ +export function sayHello() { + console.log("Hello from d!"); +} diff --git a/tests/specs/npm/workspace_version_wildcards/d/package.json b/tests/specs/npm/workspace_version_wildcards/d/package.json new file mode 100644 index 0000000000..b908366c25 --- /dev/null +++ b/tests/specs/npm/workspace_version_wildcards/d/package.json @@ -0,0 +1,7 @@ +{ + "name": "@denotest/d", + "version": "1.2.3", + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/specs/npm/workspace_version_wildcards/e/main.ts b/tests/specs/npm/workspace_version_wildcards/e/main.ts new file mode 100644 index 0000000000..c626db09e8 --- /dev/null +++ b/tests/specs/npm/workspace_version_wildcards/e/main.ts @@ -0,0 +1,9 @@ +import * as a from "@denotest/a"; +import * as b from "@denotest/b"; +import * as c from "@denotest/c"; +import * as d from "@denotest/d"; + +a.sayHello(); +b.sayHello(); +c.sayHello(); +d.sayHello(); diff --git a/tests/specs/npm/workspace_version_wildcards/e/package.json b/tests/specs/npm/workspace_version_wildcards/e/package.json new file mode 100644 index 0000000000..9dca2bb729 --- /dev/null +++ b/tests/specs/npm/workspace_version_wildcards/e/package.json @@ -0,0 +1,10 @@ +{ + "name": "@denotest/e", + "version": "1.0.0", + "dependencies": { + "@denotest/a": "workspace:*", + "@denotest/b": "workspace:~", + "@denotest/c": "workspace:^", + "@denotest/d": "workspace:1.2.3" + } +} diff --git a/tests/specs/npm/workspace_version_wildcards/main.out b/tests/specs/npm/workspace_version_wildcards/main.out new file mode 100644 index 0000000000..ac501447e5 --- /dev/null +++ b/tests/specs/npm/workspace_version_wildcards/main.out @@ -0,0 +1,4 @@ +Hello from a! +Hello from b! +Hello from c! +Hello from d! diff --git a/tests/specs/npm/workspace_version_wildcards/main.ts b/tests/specs/npm/workspace_version_wildcards/main.ts new file mode 100644 index 0000000000..316503b9ca --- /dev/null +++ b/tests/specs/npm/workspace_version_wildcards/main.ts @@ -0,0 +1,6 @@ +// should resolve these as bare specifiers within the workspace +import * as a from "@denotest/a"; +import * as c from "@denotest/c"; + +a.sayHello(); +c.sayHello(); diff --git a/tests/specs/npm/workspace_version_wildcards/package.json b/tests/specs/npm/workspace_version_wildcards/package.json new file mode 100644 index 0000000000..0516fa6921 --- /dev/null +++ b/tests/specs/npm/workspace_version_wildcards/package.json @@ -0,0 +1,9 @@ +{ + "workspaces": [ + "./a", + "./b", + "./c", + "./d", + "./e" + ] +} From f9a6cc3f03ceecba7b00236a91e5eacbe0a6b9d2 Mon Sep 17 00:00:00 2001 From: Mathias Lykkegaard Lorenzen Date: Mon, 2 Dec 2024 16:05:59 +0100 Subject: [PATCH 197/227] chore: export variables from node compat tools script (#27189) --- tests/node_compat/runner/setup.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/node_compat/runner/setup.ts b/tests/node_compat/runner/setup.ts index 32c0e2a63a..eeae3ae92d 100755 --- a/tests/node_compat/runner/setup.ts +++ b/tests/node_compat/runner/setup.ts @@ -19,7 +19,7 @@ const encoder = new TextEncoder(); const NODE_VERSION = version; -const NODE_IGNORED_TEST_DIRS = [ +export const NODE_IGNORED_TEST_DIRS = [ "addons", "async-hooks", "cctest", @@ -40,13 +40,13 @@ const NODE_IGNORED_TEST_DIRS = [ "wpt", ]; -const VENDORED_NODE_TEST = new URL("./suite/test/", import.meta.url); -const NODE_COMPAT_TEST_DEST_URL = new URL( +export const VENDORED_NODE_TEST = new URL("./suite/test/", import.meta.url); +export const NODE_COMPAT_TEST_DEST_URL = new URL( "../test/", import.meta.url, ); -async function getNodeTests(): Promise { +export async function getNodeTests(): Promise { const paths: string[] = []; const rootPath = VENDORED_NODE_TEST.href.slice(7); for await ( @@ -61,7 +61,7 @@ async function getNodeTests(): Promise { return paths.sort(); } -function getDenoTests() { +export function getDenoTests() { return Object.entries(config.tests) .filter(([testDir]) => !NODE_IGNORED_TEST_DIRS.includes(testDir)) .flatMap(([testDir, tests]) => tests.map((test) => testDir + "/" + test)); From 6dd2d5e49e00b5d1b7c30fd44c1975b3b2101148 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 2 Dec 2024 11:00:31 -0500 Subject: [PATCH 198/227] refactor: upgrade to deno_npm 0.26 (#27194) --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- cli/npm/managed/resolution.rs | 34 ++++++++++++++++------------------ 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 77dc2cb4c4..9e000ddafc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1981,9 +1981,9 @@ dependencies = [ [[package]] name = "deno_npm" -version = "0.25.5" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ded7af9db5d9f2986a739d1b5fbe1c57f498e4f996ae4114728e7c6dad213f" +checksum = "f2f125a5dba7839c46394a0a9c835da9fe60f5f412587ab4956a76492a1cc6a8" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index f6606b54c3..068046607f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,7 +53,7 @@ deno_bench_util = { version = "0.174.0", path = "./bench_util" } deno_config = { version = "=0.39.3", features = ["workspace", "sync"] } deno_lockfile = "=0.23.2" deno_media_type = { version = "0.2.0", features = ["module_specifier"] } -deno_npm = "=0.25.5" +deno_npm = "=0.26.0" deno_path_util = "=0.2.1" deno_permissions = { version = "0.40.0", path = "./runtime/permissions" } deno_runtime = { version = "0.189.0", path = "./runtime" } diff --git a/cli/npm/managed/resolution.rs b/cli/npm/managed/resolution.rs index ecfe5cb25c..033c853233 100644 --- a/cli/npm/managed/resolution.rs +++ b/cli/npm/managed/resolution.rs @@ -8,11 +8,10 @@ use deno_core::error::AnyError; use deno_lockfile::NpmPackageDependencyLockfileInfo; use deno_lockfile::NpmPackageLockfileInfo; use deno_npm::registry::NpmRegistryApi; +use deno_npm::resolution::AddPkgReqsOptions; use deno_npm::resolution::NpmPackagesPartitioned; use deno_npm::resolution::NpmResolutionError; use deno_npm::resolution::NpmResolutionSnapshot; -use deno_npm::resolution::NpmResolutionSnapshotPendingResolver; -use deno_npm::resolution::NpmResolutionSnapshotPendingResolverOptions; use deno_npm::resolution::PackageCacheFolderIdNotFoundError; use deno_npm::resolution::PackageNotFoundFromReferrerError; use deno_npm::resolution::PackageNvNotFoundError; @@ -283,8 +282,9 @@ async fn add_package_reqs_to_snapshot( /* this string is used in tests */ "Running npm resolution." ); - let pending_resolver = get_npm_pending_resolver(api); - let result = pending_resolver.add_pkg_reqs(snapshot, package_reqs).await; + let result = snapshot + .add_pkg_reqs(api, get_add_pkg_reqs_options(package_reqs)) + .await; api.clear_memory_cache(); let result = match &result.dep_graph_result { Err(NpmResolutionError::Resolution(err)) if api.mark_force_reload() => { @@ -293,7 +293,9 @@ async fn add_package_reqs_to_snapshot( // try again let snapshot = get_new_snapshot(); - let result = pending_resolver.add_pkg_reqs(snapshot, package_reqs).await; + let result = snapshot + .add_pkg_reqs(api, get_add_pkg_reqs_options(package_reqs)) + .await; api.clear_memory_cache(); result } @@ -309,19 +311,15 @@ async fn add_package_reqs_to_snapshot( result } -fn get_npm_pending_resolver( - api: &CliNpmRegistryApi, -) -> NpmResolutionSnapshotPendingResolver { - NpmResolutionSnapshotPendingResolver::new( - NpmResolutionSnapshotPendingResolverOptions { - api, - // WARNING: When bumping this version, check if anything needs to be - // updated in the `setNodeOnlyGlobalNames` call in 99_main_compiler.js - types_node_version_req: Some( - VersionReq::parse_from_npm("22.0.0 - 22.5.4").unwrap(), - ), - }, - ) +fn get_add_pkg_reqs_options(package_reqs: &[PackageReq]) -> AddPkgReqsOptions { + AddPkgReqsOptions { + package_reqs, + // WARNING: When bumping this version, check if anything needs to be + // updated in the `setNodeOnlyGlobalNames` call in 99_main_compiler.js + types_node_version_req: Some( + VersionReq::parse_from_npm("22.0.0 - 22.5.4").unwrap(), + ), + } } fn populate_lockfile_from_snapshot( From 7c036772df1554561b908655006f92f71e47fcec Mon Sep 17 00:00:00 2001 From: snek Date: Mon, 2 Dec 2024 20:45:41 +0100 Subject: [PATCH 199/227] feat(unstable): add metrics to otel (#27143) Refs: https://github.com/denoland/deno/issues/26852 Initial support for exporting metrics. Co-authored-by: Luca Casonato --- ext/telemetry/lib.rs | 748 +++++++++++++++++- ext/telemetry/telemetry.ts | 280 ++++++- .../@opentelemetry/sdk-metrics/registry.json | 1 + tests/specs/cli/otel_basic/__test__.jsonc | 4 + tests/specs/cli/otel_basic/basic.out | 3 +- tests/specs/cli/otel_basic/deno_dot_exit.out | 3 +- tests/specs/cli/otel_basic/main.ts | 6 + tests/specs/cli/otel_basic/metric.out | 124 +++ tests/specs/cli/otel_basic/metric.ts | 34 + tests/specs/cli/otel_basic/natural_exit.out | 3 +- tests/specs/cli/otel_basic/uncaught.out | 3 +- 11 files changed, 1174 insertions(+), 35 deletions(-) create mode 100644 tests/registry/npm/@opentelemetry/sdk-metrics/registry.json create mode 100644 tests/specs/cli/otel_basic/metric.out create mode 100644 tests/specs/cli/otel_basic/metric.ts diff --git a/ext/telemetry/lib.rs b/ext/telemetry/lib.rs index 1ce8ac1dcc..9612401014 100644 --- a/ext/telemetry/lib.rs +++ b/ext/telemetry/lib.rs @@ -16,6 +16,7 @@ use once_cell::sync::OnceCell; use opentelemetry::logs::AnyValue; use opentelemetry::logs::LogRecord as LogRecordTrait; use opentelemetry::logs::Severity; +use opentelemetry::otel_error; use opentelemetry::trace::SpanContext; use opentelemetry::trace::SpanId; use opentelemetry::trace::SpanKind; @@ -27,15 +28,21 @@ use opentelemetry::KeyValue; use opentelemetry::StringValue; use opentelemetry::Value; use opentelemetry_otlp::HttpExporterBuilder; +use opentelemetry_otlp::MetricExporter; use opentelemetry_otlp::Protocol; use opentelemetry_otlp::WithExportConfig; use opentelemetry_otlp::WithHttpConfig; use opentelemetry_sdk::export::trace::SpanData; use opentelemetry_sdk::logs::BatchLogProcessor; -use opentelemetry_sdk::logs::LogProcessor as LogProcessorTrait; +use opentelemetry_sdk::logs::LogProcessor; use opentelemetry_sdk::logs::LogRecord; +use opentelemetry_sdk::metrics::data::Metric; +use opentelemetry_sdk::metrics::data::ResourceMetrics; +use opentelemetry_sdk::metrics::data::ScopeMetrics; +use opentelemetry_sdk::metrics::exporter::PushMetricExporter; +use opentelemetry_sdk::metrics::Temporality; use opentelemetry_sdk::trace::BatchSpanProcessor; -use opentelemetry_sdk::trace::SpanProcessor as SpanProcessorTrait; +use opentelemetry_sdk::trace::SpanProcessor; use opentelemetry_sdk::Resource; use opentelemetry_semantic_conventions::resource::PROCESS_RUNTIME_NAME; use opentelemetry_semantic_conventions::resource::PROCESS_RUNTIME_VERSION; @@ -54,9 +61,6 @@ use std::thread; use std::time::Duration; use std::time::SystemTime; -type SpanProcessor = BatchSpanProcessor; -type LogProcessor = BatchLogProcessor; - deno_core::extension!( deno_telemetry, ops = [ @@ -71,6 +75,23 @@ deno_core::extension!( op_otel_span_attribute3, op_otel_span_set_dropped, op_otel_span_flush, + op_otel_metrics_resource_attribute, + op_otel_metrics_resource_attribute2, + op_otel_metrics_resource_attribute3, + op_otel_metrics_scope, + op_otel_metrics_sum, + op_otel_metrics_gauge, + op_otel_metrics_sum_or_gauge_data_point, + op_otel_metrics_histogram, + op_otel_metrics_histogram_data_point, + op_otel_metrics_histogram_data_point_entry_final, + op_otel_metrics_histogram_data_point_entry1, + op_otel_metrics_histogram_data_point_entry2, + op_otel_metrics_histogram_data_point_entry3, + op_otel_metrics_data_point_attribute, + op_otel_metrics_data_point_attribute2, + op_otel_metrics_data_point_attribute3, + op_otel_metrics_submit, ], esm = ["telemetry.ts", "util.ts"], ); @@ -322,8 +343,69 @@ mod hyper_client { } } -static OTEL_PROCESSORS: OnceCell<(SpanProcessor, LogProcessor)> = - OnceCell::new(); +enum MetricProcessorMessage { + ResourceMetrics(ResourceMetrics), + Flush(tokio::sync::oneshot::Sender<()>), +} + +struct MetricProcessor { + tx: tokio::sync::mpsc::Sender, +} + +impl MetricProcessor { + fn new(exporter: MetricExporter) -> Self { + let (tx, mut rx) = tokio::sync::mpsc::channel(2048); + let future = async move { + while let Some(message) = rx.recv().await { + match message { + MetricProcessorMessage::ResourceMetrics(mut rm) => { + if let Err(err) = exporter.export(&mut rm).await { + otel_error!( + name: "MetricProcessor.Export.Error", + error = format!("{}", err) + ); + } + } + MetricProcessorMessage::Flush(tx) => { + if let Err(()) = tx.send(()) { + otel_error!( + name: "MetricProcessor.Flush.SendResultError", + error = "()", + ); + } + } + } + } + }; + + (*OTEL_SHARED_RUNTIME_SPAWN_TASK_TX) + .unbounded_send(Box::pin(future)) + .expect("failed to send task to shared OpenTelemetry runtime"); + + Self { tx } + } + + fn submit(&self, rm: ResourceMetrics) { + let _ = self + .tx + .try_send(MetricProcessorMessage::ResourceMetrics(rm)); + } + + fn force_flush(&self) -> Result<(), anyhow::Error> { + let (tx, rx) = tokio::sync::oneshot::channel(); + self.tx.try_send(MetricProcessorMessage::Flush(tx))?; + deno_core::futures::executor::block_on(rx)?; + Ok(()) + } +} + +struct Processors { + spans: BatchSpanProcessor, + logs: BatchLogProcessor, + metrics: MetricProcessor, +} + +static OTEL_PROCESSORS: OnceCell = OnceCell::new(); static BUILT_IN_INSTRUMENTATION_SCOPE: OnceCell< opentelemetry::InstrumentationScope, @@ -404,6 +486,12 @@ pub fn init(config: OtelConfig) -> anyhow::Result<()> { BatchSpanProcessor::builder(span_exporter, OtelSharedRuntime).build(); span_processor.set_resource(&resource); + let metric_exporter = HttpExporterBuilder::default() + .with_http_client(client.clone()) + .with_protocol(protocol) + .build_metrics_exporter(Temporality::Cumulative)?; + let metric_processor = MetricProcessor::new(metric_exporter); + let log_exporter = HttpExporterBuilder::default() .with_http_client(client) .with_protocol(protocol) @@ -413,7 +501,11 @@ pub fn init(config: OtelConfig) -> anyhow::Result<()> { log_processor.set_resource(&resource); OTEL_PROCESSORS - .set((span_processor, log_processor)) + .set(Processors { + spans: span_processor, + logs: log_processor, + metrics: metric_processor, + }) .map_err(|_| anyhow!("failed to init otel"))?; let builtin_instrumentation_scope = @@ -431,16 +523,22 @@ pub fn init(config: OtelConfig) -> anyhow::Result<()> { /// `process::exit()`, to ensure that all OpenTelemetry logs are properly /// flushed before the process terminates. pub fn flush() { - if let Some((span_processor, log_processor)) = OTEL_PROCESSORS.get() { - let _ = span_processor.force_flush(); - let _ = log_processor.force_flush(); + if let Some(Processors { + spans, + logs, + metrics, + }) = OTEL_PROCESSORS.get() + { + let _ = spans.force_flush(); + let _ = logs.force_flush(); + let _ = metrics.force_flush(); } } pub fn handle_log(record: &log::Record) { use log::Level; - let Some((_, log_processor)) = OTEL_PROCESSORS.get() else { + let Some(Processors { logs, .. }) = OTEL_PROCESSORS.get() else { return; }; @@ -490,7 +588,7 @@ pub fn handle_log(record: &log::Record) { let _ = record.key_values().visit(&mut Visitor(&mut log_record)); - log_processor.emit( + logs.emit( &mut log_record, BUILT_IN_INSTRUMENTATION_SCOPE.get().unwrap(), ); @@ -648,7 +746,7 @@ fn op_otel_log( span_id: v8::Local<'_, v8::Value>, #[smi] trace_flags: u8, ) { - let Some((_, log_processor)) = OTEL_PROCESSORS.get() else { + let Some(Processors { logs, .. }) = OTEL_PROCESSORS.get() else { return; }; @@ -678,12 +776,25 @@ fn op_otel_log( ); } - log_processor.emit( + logs.emit( &mut log_record, BUILT_IN_INSTRUMENTATION_SCOPE.get().unwrap(), ); } +fn owned_string<'s>( + scope: &mut v8::HandleScope<'s>, + string: v8::Local<'s, v8::String>, +) -> String { + let x = v8::ValueView::new(scope, string); + match x.data() { + v8::ValueViewData::OneByte(bytes) => { + String::from_utf8_lossy(bytes).into_owned() + } + v8::ValueViewData::TwoByte(bytes) => String::from_utf16_lossy(bytes), + } +} + struct TemporarySpan(SpanData); #[allow(clippy::too_many_arguments)] @@ -700,10 +811,10 @@ fn op_otel_span_start<'s>( end_time: f64, ) -> Result<(), anyhow::Error> { if let Some(temporary_span) = state.try_take::() { - let Some((span_processor, _)) = OTEL_PROCESSORS.get() else { + let Some(Processors { spans, .. }) = OTEL_PROCESSORS.get() else { return Ok(()); }; - span_processor.on_end(temporary_span.0); + spans.on_end(temporary_span.0); }; let Some(InstrumentationScope(instrumentation_scope)) = @@ -724,15 +835,7 @@ fn op_otel_span_start<'s>( let parent_span_id = parse_span_id(scope, parent_span_id); - let name = { - let x = v8::ValueView::new(scope, name.try_cast()?); - match x.data() { - v8::ValueViewData::OneByte(bytes) => { - String::from_utf8_lossy(bytes).into_owned() - } - v8::ValueViewData::TwoByte(bytes) => String::from_utf16_lossy(bytes), - } - }; + let name = owned_string(scope, name.try_cast()?); let temporary_span = TemporarySpan(SpanData { span_context: SpanContext::new( @@ -866,9 +969,598 @@ fn op_otel_span_flush(state: &mut OpState) { return; }; - let Some((span_processor, _)) = OTEL_PROCESSORS.get() else { + let Some(Processors { spans, .. }) = OTEL_PROCESSORS.get() else { return; }; - span_processor.on_end(temporary_span.0); + spans.on_end(temporary_span.0); +} + +// Holds data being built from JS before +// it is submitted to the rust processor. +struct TemporaryMetricsExport { + resource_attributes: Vec, + scope_metrics: Vec, + metric: Option, +} + +struct TemporaryMetric { + name: String, + description: String, + unit: String, + data: TemporaryMetricData, +} + +enum TemporaryMetricData { + Sum(opentelemetry_sdk::metrics::data::Sum), + Gauge(opentelemetry_sdk::metrics::data::Gauge), + Histogram(opentelemetry_sdk::metrics::data::Histogram), +} + +impl From for Metric { + fn from(value: TemporaryMetric) -> Self { + Metric { + name: Cow::Owned(value.name), + description: Cow::Owned(value.description), + unit: Cow::Owned(value.unit), + data: match value.data { + TemporaryMetricData::Sum(sum) => Box::new(sum), + TemporaryMetricData::Gauge(gauge) => Box::new(gauge), + TemporaryMetricData::Histogram(histogram) => Box::new(histogram), + }, + } + } +} + +#[op2(fast)] +fn op_otel_metrics_resource_attribute<'s>( + scope: &mut v8::HandleScope<'s>, + state: &mut OpState, + #[smi] capacity: u32, + key: v8::Local<'s, v8::Value>, + value: v8::Local<'s, v8::Value>, +) { + let metrics_export = if let Some(metrics_export) = + state.try_borrow_mut::() + { + metrics_export.resource_attributes.reserve_exact( + (capacity as usize) - metrics_export.resource_attributes.capacity(), + ); + metrics_export + } else { + state.put(TemporaryMetricsExport { + resource_attributes: Vec::with_capacity(capacity as usize), + scope_metrics: vec![], + metric: None, + }); + state.borrow_mut() + }; + attr!(scope, metrics_export.resource_attributes, key, value); +} + +#[op2(fast)] +fn op_otel_metrics_resource_attribute2<'s>( + scope: &mut v8::HandleScope<'s>, + state: &mut OpState, + #[smi] capacity: u32, + key1: v8::Local<'s, v8::Value>, + value1: v8::Local<'s, v8::Value>, + key2: v8::Local<'s, v8::Value>, + value2: v8::Local<'s, v8::Value>, +) { + let metrics_export = if let Some(metrics_export) = + state.try_borrow_mut::() + { + metrics_export.resource_attributes.reserve_exact( + (capacity as usize) - metrics_export.resource_attributes.capacity(), + ); + metrics_export + } else { + state.put(TemporaryMetricsExport { + resource_attributes: Vec::with_capacity(capacity as usize), + scope_metrics: vec![], + metric: None, + }); + state.borrow_mut() + }; + attr!(scope, metrics_export.resource_attributes, key1, value1); + attr!(scope, metrics_export.resource_attributes, key2, value2); +} + +#[allow(clippy::too_many_arguments)] +#[op2(fast)] +fn op_otel_metrics_resource_attribute3<'s>( + scope: &mut v8::HandleScope<'s>, + state: &mut OpState, + #[smi] capacity: u32, + key1: v8::Local<'s, v8::Value>, + value1: v8::Local<'s, v8::Value>, + key2: v8::Local<'s, v8::Value>, + value2: v8::Local<'s, v8::Value>, + key3: v8::Local<'s, v8::Value>, + value3: v8::Local<'s, v8::Value>, +) { + let metrics_export = if let Some(metrics_export) = + state.try_borrow_mut::() + { + metrics_export.resource_attributes.reserve_exact( + (capacity as usize) - metrics_export.resource_attributes.capacity(), + ); + metrics_export + } else { + state.put(TemporaryMetricsExport { + resource_attributes: Vec::with_capacity(capacity as usize), + scope_metrics: vec![], + metric: None, + }); + state.borrow_mut() + }; + attr!(scope, metrics_export.resource_attributes, key1, value1); + attr!(scope, metrics_export.resource_attributes, key2, value2); + attr!(scope, metrics_export.resource_attributes, key3, value3); +} + +#[op2(fast)] +fn op_otel_metrics_scope<'s>( + scope: &mut v8::HandleScope<'s>, + state: &mut OpState, + name: v8::Local<'s, v8::Value>, + schema_url: v8::Local<'s, v8::Value>, + version: v8::Local<'s, v8::Value>, +) { + let name = owned_string(scope, name.cast()); + + let scope_builder = opentelemetry::InstrumentationScope::builder(name); + let scope_builder = if schema_url.is_null_or_undefined() { + scope_builder + } else { + scope_builder.with_schema_url(owned_string(scope, schema_url.cast())) + }; + let scope_builder = if version.is_null_or_undefined() { + scope_builder + } else { + scope_builder.with_version(owned_string(scope, version.cast())) + }; + let scope = scope_builder.build(); + let scope_metric = ScopeMetrics { + scope, + metrics: vec![], + }; + + match state.try_borrow_mut::() { + Some(temp) => { + if let Some(current_metric) = temp.metric.take() { + let metric = Metric::from(current_metric); + temp.scope_metrics.last_mut().unwrap().metrics.push(metric); + } + temp.scope_metrics.push(scope_metric); + } + None => { + state.put(TemporaryMetricsExport { + resource_attributes: vec![], + scope_metrics: vec![scope_metric], + metric: None, + }); + } + } +} + +#[op2(fast)] +fn op_otel_metrics_sum<'s>( + scope: &mut v8::HandleScope<'s>, + state: &mut OpState, + name: v8::Local<'s, v8::Value>, + description: v8::Local<'s, v8::Value>, + unit: v8::Local<'s, v8::Value>, + #[smi] temporality: u8, + is_monotonic: bool, +) { + let Some(temp) = state.try_borrow_mut::() else { + return; + }; + + if let Some(current_metric) = temp.metric.take() { + let metric = Metric::from(current_metric); + temp.scope_metrics.last_mut().unwrap().metrics.push(metric); + } + + let name = owned_string(scope, name.cast()); + let description = owned_string(scope, description.cast()); + let unit = owned_string(scope, unit.cast()); + let temporality = match temporality { + 0 => Temporality::Delta, + 1 => Temporality::Cumulative, + _ => return, + }; + let sum = opentelemetry_sdk::metrics::data::Sum { + data_points: vec![], + temporality, + is_monotonic, + }; + + temp.metric = Some(TemporaryMetric { + name, + description, + unit, + data: TemporaryMetricData::Sum(sum), + }); +} + +#[op2(fast)] +fn op_otel_metrics_gauge<'s>( + scope: &mut v8::HandleScope<'s>, + state: &mut OpState, + name: v8::Local<'s, v8::Value>, + description: v8::Local<'s, v8::Value>, + unit: v8::Local<'s, v8::Value>, +) { + let Some(temp) = state.try_borrow_mut::() else { + return; + }; + + if let Some(current_metric) = temp.metric.take() { + let metric = Metric::from(current_metric); + temp.scope_metrics.last_mut().unwrap().metrics.push(metric); + } + + let name = owned_string(scope, name.cast()); + let description = owned_string(scope, description.cast()); + let unit = owned_string(scope, unit.cast()); + + let gauge = opentelemetry_sdk::metrics::data::Gauge { + data_points: vec![], + }; + + temp.metric = Some(TemporaryMetric { + name, + description, + unit, + data: TemporaryMetricData::Gauge(gauge), + }); +} + +#[op2(fast)] +fn op_otel_metrics_sum_or_gauge_data_point( + state: &mut OpState, + value: f64, + start_time: f64, + time: f64, +) { + let Some(temp) = state.try_borrow_mut::() else { + return; + }; + + let start_time = SystemTime::UNIX_EPOCH + .checked_add(std::time::Duration::from_secs_f64(start_time)) + .unwrap(); + let time = SystemTime::UNIX_EPOCH + .checked_add(std::time::Duration::from_secs_f64(time)) + .unwrap(); + + let data_point = opentelemetry_sdk::metrics::data::DataPoint { + value, + start_time: Some(start_time), + time: Some(time), + attributes: vec![], + exemplars: vec![], + }; + + match &mut temp.metric { + Some(TemporaryMetric { + data: TemporaryMetricData::Sum(sum), + .. + }) => sum.data_points.push(data_point), + Some(TemporaryMetric { + data: TemporaryMetricData::Gauge(gauge), + .. + }) => gauge.data_points.push(data_point), + _ => {} + } +} + +#[op2(fast)] +fn op_otel_metrics_histogram<'s>( + scope: &mut v8::HandleScope<'s>, + state: &mut OpState, + name: v8::Local<'s, v8::Value>, + description: v8::Local<'s, v8::Value>, + unit: v8::Local<'s, v8::Value>, + #[smi] temporality: u8, +) { + let Some(temp) = state.try_borrow_mut::() else { + return; + }; + + if let Some(current_metric) = temp.metric.take() { + let metric = Metric::from(current_metric); + temp.scope_metrics.last_mut().unwrap().metrics.push(metric); + } + + let name = owned_string(scope, name.cast()); + let description = owned_string(scope, description.cast()); + let unit = owned_string(scope, unit.cast()); + + let temporality = match temporality { + 0 => Temporality::Delta, + 1 => Temporality::Cumulative, + _ => return, + }; + let histogram = opentelemetry_sdk::metrics::data::Histogram { + data_points: vec![], + temporality, + }; + + temp.metric = Some(TemporaryMetric { + name, + description, + unit, + data: TemporaryMetricData::Histogram(histogram), + }); +} + +#[allow(clippy::too_many_arguments)] +#[op2(fast)] +fn op_otel_metrics_histogram_data_point( + state: &mut OpState, + #[number] count: u64, + min: f64, + max: f64, + sum: f64, + start_time: f64, + time: f64, + #[smi] buckets: u32, +) { + let Some(temp) = state.try_borrow_mut::() else { + return; + }; + + let min = if min.is_nan() { None } else { Some(min) }; + let max = if max.is_nan() { None } else { Some(max) }; + + let start_time = SystemTime::UNIX_EPOCH + .checked_add(std::time::Duration::from_secs_f64(start_time)) + .unwrap(); + let time = SystemTime::UNIX_EPOCH + .checked_add(std::time::Duration::from_secs_f64(time)) + .unwrap(); + + let data_point = opentelemetry_sdk::metrics::data::HistogramDataPoint { + bounds: Vec::with_capacity(buckets as usize), + bucket_counts: Vec::with_capacity((buckets as usize) + 1), + count, + sum, + min, + max, + start_time, + time, + attributes: vec![], + exemplars: vec![], + }; + + if let Some(TemporaryMetric { + data: TemporaryMetricData::Histogram(histogram), + .. + }) = &mut temp.metric + { + histogram.data_points.push(data_point); + } +} + +#[op2(fast)] +fn op_otel_metrics_histogram_data_point_entry_final( + state: &mut OpState, + #[number] count1: u64, +) { + let Some(temp) = state.try_borrow_mut::() else { + return; + }; + + if let Some(TemporaryMetric { + data: TemporaryMetricData::Histogram(histogram), + .. + }) = &mut temp.metric + { + histogram + .data_points + .last_mut() + .unwrap() + .bucket_counts + .push(count1) + } +} + +#[op2(fast)] +fn op_otel_metrics_histogram_data_point_entry1( + state: &mut OpState, + #[number] count1: u64, + bound1: f64, +) { + let Some(temp) = state.try_borrow_mut::() else { + return; + }; + + if let Some(TemporaryMetric { + data: TemporaryMetricData::Histogram(histogram), + .. + }) = &mut temp.metric + { + let data_point = histogram.data_points.last_mut().unwrap(); + data_point.bucket_counts.push(count1); + data_point.bounds.push(bound1); + } +} + +#[op2(fast)] +fn op_otel_metrics_histogram_data_point_entry2( + state: &mut OpState, + #[number] count1: u64, + bound1: f64, + #[number] count2: u64, + bound2: f64, +) { + let Some(temp) = state.try_borrow_mut::() else { + return; + }; + + if let Some(TemporaryMetric { + data: TemporaryMetricData::Histogram(histogram), + .. + }) = &mut temp.metric + { + let data_point = histogram.data_points.last_mut().unwrap(); + data_point.bucket_counts.push(count1); + data_point.bounds.push(bound1); + data_point.bucket_counts.push(count2); + data_point.bounds.push(bound2); + } +} + +#[op2(fast)] +fn op_otel_metrics_histogram_data_point_entry3( + state: &mut OpState, + #[number] count1: u64, + bound1: f64, + #[number] count2: u64, + bound2: f64, + #[number] count3: u64, + bound3: f64, +) { + let Some(temp) = state.try_borrow_mut::() else { + return; + }; + + if let Some(TemporaryMetric { + data: TemporaryMetricData::Histogram(histogram), + .. + }) = &mut temp.metric + { + let data_point = histogram.data_points.last_mut().unwrap(); + data_point.bucket_counts.push(count1); + data_point.bounds.push(bound1); + data_point.bucket_counts.push(count2); + data_point.bounds.push(bound2); + data_point.bucket_counts.push(count3); + data_point.bounds.push(bound3); + } +} + +#[op2(fast)] +fn op_otel_metrics_data_point_attribute<'s>( + scope: &mut v8::HandleScope<'s>, + state: &mut OpState, + #[smi] capacity: u32, + key: v8::Local<'s, v8::Value>, + value: v8::Local<'s, v8::Value>, +) { + if let Some(TemporaryMetricsExport { + metric: Some(metric), + .. + }) = state.try_borrow_mut::() + { + let attributes = match &mut metric.data { + TemporaryMetricData::Sum(sum) => { + &mut sum.data_points.last_mut().unwrap().attributes + } + TemporaryMetricData::Gauge(gauge) => { + &mut gauge.data_points.last_mut().unwrap().attributes + } + TemporaryMetricData::Histogram(histogram) => { + &mut histogram.data_points.last_mut().unwrap().attributes + } + }; + attributes.reserve_exact((capacity as usize) - attributes.capacity()); + attr!(scope, attributes, key, value); + } +} + +#[op2(fast)] +fn op_otel_metrics_data_point_attribute2<'s>( + scope: &mut v8::HandleScope<'s>, + state: &mut OpState, + #[smi] capacity: u32, + key1: v8::Local<'s, v8::Value>, + value1: v8::Local<'s, v8::Value>, + key2: v8::Local<'s, v8::Value>, + value2: v8::Local<'s, v8::Value>, +) { + if let Some(TemporaryMetricsExport { + metric: Some(metric), + .. + }) = state.try_borrow_mut::() + { + let attributes = match &mut metric.data { + TemporaryMetricData::Sum(sum) => { + &mut sum.data_points.last_mut().unwrap().attributes + } + TemporaryMetricData::Gauge(gauge) => { + &mut gauge.data_points.last_mut().unwrap().attributes + } + TemporaryMetricData::Histogram(histogram) => { + &mut histogram.data_points.last_mut().unwrap().attributes + } + }; + attributes.reserve_exact((capacity as usize) - attributes.capacity()); + attr!(scope, attributes, key1, value1); + attr!(scope, attributes, key2, value2); + } +} + +#[allow(clippy::too_many_arguments)] +#[op2(fast)] +fn op_otel_metrics_data_point_attribute3<'s>( + scope: &mut v8::HandleScope<'s>, + state: &mut OpState, + #[smi] capacity: u32, + key1: v8::Local<'s, v8::Value>, + value1: v8::Local<'s, v8::Value>, + key2: v8::Local<'s, v8::Value>, + value2: v8::Local<'s, v8::Value>, + key3: v8::Local<'s, v8::Value>, + value3: v8::Local<'s, v8::Value>, +) { + if let Some(TemporaryMetricsExport { + metric: Some(metric), + .. + }) = state.try_borrow_mut::() + { + let attributes = match &mut metric.data { + TemporaryMetricData::Sum(sum) => { + &mut sum.data_points.last_mut().unwrap().attributes + } + TemporaryMetricData::Gauge(gauge) => { + &mut gauge.data_points.last_mut().unwrap().attributes + } + TemporaryMetricData::Histogram(histogram) => { + &mut histogram.data_points.last_mut().unwrap().attributes + } + }; + attributes.reserve_exact((capacity as usize) - attributes.capacity()); + attr!(scope, attributes, key1, value1); + attr!(scope, attributes, key2, value2); + attr!(scope, attributes, key3, value3); + } +} + +#[op2(fast)] +fn op_otel_metrics_submit(state: &mut OpState) { + let Some(mut temp) = state.try_take::() else { + return; + }; + + let Some(Processors { metrics, .. }) = OTEL_PROCESSORS.get() else { + return; + }; + + if let Some(current_metric) = temp.metric { + let metric = Metric::from(current_metric); + temp.scope_metrics.last_mut().unwrap().metrics.push(metric); + } + + let resource = Resource::new(temp.resource_attributes); + let scope_metrics = temp.scope_metrics; + + metrics.submit(ResourceMetrics { + resource, + scope_metrics, + }); } diff --git a/ext/telemetry/telemetry.ts b/ext/telemetry/telemetry.ts index 03fbd83e2f..e8065e8a3b 100644 --- a/ext/telemetry/telemetry.ts +++ b/ext/telemetry/telemetry.ts @@ -7,6 +7,23 @@ import { op_otel_instrumentation_scope_enter, op_otel_instrumentation_scope_enter_builtin, op_otel_log, + op_otel_metrics_data_point_attribute, + op_otel_metrics_data_point_attribute2, + op_otel_metrics_data_point_attribute3, + op_otel_metrics_gauge, + op_otel_metrics_histogram, + op_otel_metrics_histogram_data_point, + op_otel_metrics_histogram_data_point_entry1, + op_otel_metrics_histogram_data_point_entry2, + op_otel_metrics_histogram_data_point_entry3, + op_otel_metrics_histogram_data_point_entry_final, + op_otel_metrics_resource_attribute, + op_otel_metrics_resource_attribute2, + op_otel_metrics_resource_attribute3, + op_otel_metrics_scope, + op_otel_metrics_submit, + op_otel_metrics_sum, + op_otel_metrics_sum_or_gauge_data_point, op_otel_span_attribute, op_otel_span_attribute2, op_otel_span_attribute3, @@ -186,7 +203,7 @@ const instrumentationScopes = new SafeWeakMap< >(); let activeInstrumentationLibrary: WeakRef | null = null; -function submit( +function submitSpan( spanId: string | Uint8Array, traceId: string | Uint8Array, traceFlags: number, @@ -411,7 +428,7 @@ export class Span { endSpan = (span: Span) => { const endTime = now(); - submit( + submitSpan( span.#spanId, span.#traceId, span.#traceFlags, @@ -571,7 +588,7 @@ class SpanExporter { for (let i = 0; i < spans.length; i += 1) { const span = spans[i]; const context = span.spanContext(); - submit( + submitSpan( context.spanId, context.traceId, context.traceFlags, @@ -671,6 +688,262 @@ class ContextManager { } } +function attributeValue(value: IAnyValue) { + return value.boolValue ?? value.stringValue ?? value.doubleValue ?? + value.intValue; +} + +function submitMetrics(resource, scopeMetrics) { + let i = 0; + while (i < resource.attributes.length) { + if (i + 2 < resource.attributes.length) { + op_otel_metrics_resource_attribute3( + resource.attributes.length, + resource.attributes[i].key, + attributeValue(resource.attributes[i].value), + resource.attributes[i + 1].key, + attributeValue(resource.attributes[i + 1].value), + resource.attributes[i + 2].key, + attributeValue(resource.attributes[i + 2].value), + ); + i += 3; + } else if (i + 1 < resource.attributes.length) { + op_otel_metrics_resource_attribute2( + resource.attributes.length, + resource.attributes[i].key, + attributeValue(resource.attributes[i].value), + resource.attributes[i + 1].key, + attributeValue(resource.attributes[i + 1].value), + ); + i += 2; + } else { + op_otel_metrics_resource_attribute( + resource.attributes.length, + resource.attributes[i].key, + attributeValue(resource.attributes[i].value), + ); + i += 1; + } + } + + for (let smi = 0; smi < scopeMetrics.length; smi += 1) { + const { scope, metrics } = scopeMetrics[smi]; + + op_otel_metrics_scope(scope.name, scope.schemaUrl, scope.version); + + for (let mi = 0; mi < metrics.length; mi += 1) { + const metric = metrics[mi]; + switch (metric.dataPointType) { + case 3: + op_otel_metrics_sum( + metric.descriptor.name, + // deno-lint-ignore prefer-primordials + metric.descriptor.description, + metric.descriptor.unit, + metric.aggregationTemporality, + metric.isMonotonic, + ); + for (let di = 0; di < metric.dataPoints.length; di += 1) { + const dataPoint = metric.dataPoints[di]; + op_otel_metrics_sum_or_gauge_data_point( + dataPoint.value, + hrToSecs(dataPoint.startTime), + hrToSecs(dataPoint.endTime), + ); + const attributes = ObjectEntries(dataPoint.attributes); + let i = 0; + while (i < attributes.length) { + if (i + 2 < attributes.length) { + op_otel_metrics_data_point_attribute3( + attributes.length, + attributes[i][0], + attributes[i][1], + attributes[i + 1][0], + attributes[i + 1][1], + attributes[i + 2][0], + attributes[i + 2][1], + ); + i += 3; + } else if (i + 1 < attributes.length) { + op_otel_metrics_data_point_attribute2( + attributes.length, + attributes[i][0], + attributes[i][1], + attributes[i + 1][0], + attributes[i + 1][1], + ); + i += 2; + } else { + op_otel_metrics_data_point_attribute( + attributes.length, + attributes[i][0], + attributes[i][1], + ); + i += 1; + } + } + } + break; + case 2: + op_otel_metrics_gauge( + metric.descriptor.name, + // deno-lint-ignore prefer-primordials + metric.descriptor.description, + metric.descriptor.unit, + ); + for (let di = 0; di < metric.dataPoints.length; di += 1) { + const dataPoint = metric.dataPoints[di]; + op_otel_metrics_sum_or_gauge_data_point( + dataPoint.value, + hrToSecs(dataPoint.startTime), + hrToSecs(dataPoint.endTime), + ); + const attributes = ObjectEntries(dataPoint.attributes); + let i = 0; + while (i < attributes.length) { + if (i + 2 < attributes.length) { + op_otel_metrics_data_point_attribute3( + attributes.length, + attributes[i][0], + attributes[i][1], + attributes[i + 1][0], + attributes[i + 1][1], + attributes[i + 2][0], + attributes[i + 2][1], + ); + i += 3; + } else if (i + 1 < attributes.length) { + op_otel_metrics_data_point_attribute2( + attributes.length, + attributes[i][0], + attributes[i][1], + attributes[i + 1][0], + attributes[i + 1][1], + ); + i += 2; + } else { + op_otel_metrics_data_point_attribute( + attributes.length, + attributes[i][0], + attributes[i][1], + ); + i += 1; + } + } + } + break; + case 0: + op_otel_metrics_histogram( + metric.descriptor.name, + // deno-lint-ignore prefer-primordials + metric.descriptor.description, + metric.descriptor.unit, + metric.aggregationTemporality, + ); + for (let di = 0; di < metric.dataPoints.length; di += 1) { + const dataPoint = metric.dataPoints[di]; + const { boundaries, counts } = dataPoint.value.buckets; + op_otel_metrics_histogram_data_point( + dataPoint.value.count, + dataPoint.value.min ?? NaN, + dataPoint.value.max ?? NaN, + dataPoint.value.sum, + hrToSecs(dataPoint.startTime), + hrToSecs(dataPoint.endTime), + boundaries.length, + ); + let j = 0; + while (j < boundaries.length) { + if (j + 3 < boundaries.length) { + op_otel_metrics_histogram_data_point_entry3( + counts[j], + boundaries[j], + counts[j + 1], + boundaries[j + 1], + counts[j + 2], + boundaries[j + 2], + ); + j += 3; + } else if (j + 2 < boundaries.length) { + op_otel_metrics_histogram_data_point_entry2( + counts[j], + boundaries[j], + counts[j + 1], + boundaries[j + 1], + ); + j += 2; + } else { + op_otel_metrics_histogram_data_point_entry1( + counts[j], + boundaries[j], + ); + j += 1; + } + } + op_otel_metrics_histogram_data_point_entry_final(counts[j]); + const attributes = ObjectEntries(dataPoint.attributes); + let i = 0; + while (i < attributes.length) { + if (i + 2 < attributes.length) { + op_otel_metrics_data_point_attribute3( + attributes.length, + attributes[i][0], + attributes[i][1], + attributes[i + 1][0], + attributes[i + 1][1], + attributes[i + 2][0], + attributes[i + 2][1], + ); + i += 3; + } else if (i + 1 < attributes.length) { + op_otel_metrics_data_point_attribute2( + attributes.length, + attributes[i][0], + attributes[i][1], + attributes[i + 1][0], + attributes[i + 1][1], + ); + i += 2; + } else { + op_otel_metrics_data_point_attribute( + attributes.length, + attributes[i][0], + attributes[i][1], + ); + i += 1; + } + } + } + break; + default: + continue; + } + } + } + + op_otel_metrics_submit(); +} + +class MetricExporter { + export(metrics, resultCallback: (result: ExportResult) => void) { + try { + submitMetrics(metrics.resource, metrics.scopeMetrics); + resultCallback({ code: 0 }); + } catch (error) { + resultCallback({ + code: 1, + error: ObjectPrototypeIsPrototypeOf(error, Error) + ? error as Error + : new Error(String(error)), + }); + } + } + + async forceFlush() {} + + async shutdown() {} +} + const otelConsoleConfig = { ignore: 0, capture: 1, @@ -708,4 +981,5 @@ export function bootstrap( export const telemetry = { SpanExporter, ContextManager, + MetricExporter, }; diff --git a/tests/registry/npm/@opentelemetry/sdk-metrics/registry.json b/tests/registry/npm/@opentelemetry/sdk-metrics/registry.json new file mode 100644 index 0000000000..1e55892f95 --- /dev/null +++ b/tests/registry/npm/@opentelemetry/sdk-metrics/registry.json @@ -0,0 +1 @@ +{"_id":"@opentelemetry/sdk-metrics","_rev":"32-fd2f541de5aecbe413589147b6cc22fc","name":"@opentelemetry/sdk-metrics","dist-tags":{"next":"1.8.0","latest":"1.28.0"},"versions":{"0.32.0":{"name":"@opentelemetry/sdk-metrics","version":"0.32.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@0.32.0","maintainers":[{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"463cd3a2b267f044db9aaab85887a171710345a0","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-0.32.0.tgz","fileCount":480,"integrity":"sha512-zC9RCOIsXRqOHWmWfcxArtDHbip2/jaIH1yu/OKau/shDZYFluAxY6zAEYIb4YEAzKKEF+fpaoRgpodDWNGVGA==","signatures":[{"sig":"MEUCIHBrzbDjk66vVi3mOQOqt4aIRr90QWqLXe7z6pqSOS6GAiEAxRW5Nt/5Uo5aJhfbXMPZUZSd1f5UYsLkrC5WVFl9u0o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1364783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBmODACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqU5Q//X8u5PAiNpAJrFIXflu/338sR9oMsluNoiuoPba0zw6ikiPUv\r\nXCYlQMw1XBSE63X2CVpSDakAhG4WtkWXbsi2zRCfOLUze5CuQPf+TqikvwM/\r\nFOGeHl67KjYw20u1K0H0kxB1qAsBQNBV0lWIM8aF6Yty2J05kP7dACmT6o4v\r\nUn6n2+fjQFMlhRA0WeCrEk+6usmFQDBaZSieZofKGm9C3KCeasPZRfnAJZq3\r\nQvbINhGXDOfFdXrwQPNRqZEIDI5/9frr9dJuRsL+h59AEBizdkezofZGvJPr\r\n860MZqidZhyrzC8NBpodJK0sGxQutbssmSKDT2dptVEd9jjj7mj7iKhNPEFy\r\ntUQDgD/4ltCoLyqraDQi+twaE9gFDhol6EwwdRTIMV8pvazMXFuQ1ik6lsC8\r\nPMt4UDYjtOwDkOGqOjtK/AebAOkJWhoEOuz3znl4VAowL5+qPblVRUEOm7HY\r\nKM/I5DEJltVpWJymDlvRNyvN/ysah+p3b6QtAz5ZcXlipFBh/qFozY7GpemB\r\nIHNryYjSZiAvRCsbnWgHsNg2dIDHJQvN440q6cWfX49Hs03r1rYuKlJjkBpy\r\nFFxrzMAoUejzJ/4j9lVc0rfacQrIoUtQ+j4uLJVPCqy4BPk1LMTnyWY16zb4\r\nIvRTJJH4pe1bz0ucrcj7GawkrVRaoxvNO2U=\r\n=wJDK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"a5abee69119cc41d9d34f6beb5c1826eef1ac0dd","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.all.json","watch":"tsc --build --watch tsconfig.all.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../../","compile":"tsc --build tsconfig.all.json","version":"node ../../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../../scripts/version-update.js","precompile":"lerna run version --scope $(npm pkg get name) --include-dependencies","tdd:browser":"karma start","test:browser":"nyc karma start --single-run","peer-api-check":"node ../../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/5.4.3/node@v14.18.1+x64 (darwin)","description":"Work in progress OpenTelemetry metrics SDK","directories":{},"_nodeVersion":"14.18.1","dependencies":{"lodash.merge":"4.6.2","@opentelemetry/core":"1.6.0","@opentelemetry/resources":"1.6.0","@opentelemetry/api-metrics":"0.32.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.3.16","mocha":"10.0.0","sinon":"14.0.0","rimraf":"3.0.2","codecov":"3.8.3","ts-mocha":"10.0.0","typescript":"4.4.4","@types/node":"18.6.5","karma-mocha":"2.0.1","@types/mocha":"9.1.1","@types/sinon":"10.0.13","karma-webpack":"4.0.2","@opentelemetry/api":"^1.0.0","@types/lodash.merge":"4.6.6","karma-spec-reporter":"0.0.32","karma-chrome-launcher":"3.1.0","karma-coverage-istanbul-reporter":"3.0.3"},"peerDependencies":{"@opentelemetry/api":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_0.32.0_1661363075429_0.18961817621798693","host":"s3://npm-registry-packages"}},"0.33.0":{"name":"@opentelemetry/sdk-metrics","version":"0.33.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@0.33.0","maintainers":[{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"c4e51decc6e3bb0e1e97c7b081955d357e46c2fe","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-0.33.0.tgz","fileCount":489,"integrity":"sha512-ZXPixOlTd/FHLwpkmm5nTpJE7bZOPfmbSz8hBVFCEHkXE1aKEKaM38UFnZ+2xzOY1tDsDwyxEiiBiDX8y3039A==","signatures":[{"sig":"MEUCIBeHiozEczRdIpEbB1UwgCro3jj+tB2iGk+FQ+CZuc3LAiEA97t2teODixmkZuRZk4z+IPqaULq8SBNRrV8c3JVlTys=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1425603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJGjCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNERAAjSfh3/c433lR4GMa9u1DjMIVy7MYOZe0YftxnQ9VPGs2jgfa\r\nWC4r/3Qbantsq49xoVj8GjmiZnIrhzm833P8L7lNLes8LDtI8TEbv+6SPfsq\r\nRLBvUdPHww4UlbfShEo5hnGXVIC3qudVRlvGv2DKxFD9AF2QZszGKsrNQ+P8\r\nB5A/lWp4dqY+IhB0xMk3y7asdEggiF/isxMsCGhNFpDiyL8iHQWuW3ylt5pq\r\nZmPLY23ax1kWkTSvj7Us9X7tgIjGuGgzU+cBSf29WI0L2gyVu5TBBRk5NY5x\r\nryXCnzi1MoNdY669ToCEVcCxJoWb4DY9Mg2ihhJq2argdUPzwEBThC1EecAP\r\nJ/786fw+PKmQAzKGVGEXRmDZljF4+3Zk/KIujlHZK7RP6h1kaMCRAKYwnBLT\r\nR9v3W4ljHnbPgV0OmX+W0suV8oEoYtIJxe/7yyznWsLxcndndZq6WFqzcJQN\r\nVdPk6kxtXdSx7hzcnn1CXxckq+fiG0EdZX32ZRGEi1X4EXmTeNL8s2CMiVUl\r\ndGQm+vbP517Nj2oQvOcnO+YSf55XGNtv49cbusZ8JHVGQhHE26HXCK6A2ci1\r\nhEgPOMtjRH43f3kncjdQXW/vTsS/vMiacwyM94686CkEOaJJNnTv8R2DlV2s\r\nkvO54QGc0KDggcsxEqzpfo9OuQEFKWUe0lU=\r\n=fhUv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"ad88c3d9aa0100fe259b93f4b660e84417b757ac","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.all.json","watch":"tsc --build --watch tsconfig.all.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../../","compile":"tsc --build tsconfig.all.json","version":"node ../../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../../scripts/version-update.js","precompile":"lerna run version --scope $(npm pkg get name) --include-dependencies","tdd:browser":"karma start","test:browser":"nyc karma start --single-run","peer-api-check":"node ../../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/5.4.3/node@v14.18.1+x64 (darwin)","description":"Work in progress OpenTelemetry metrics SDK","directories":{},"_nodeVersion":"14.18.1","dependencies":{"lodash.merge":"4.6.2","@opentelemetry/core":"1.7.0","@opentelemetry/resources":"1.7.0","@opentelemetry/api-metrics":"0.33.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.3.16","mocha":"10.0.0","sinon":"14.0.0","rimraf":"3.0.2","codecov":"3.8.3","ts-mocha":"10.0.0","typescript":"4.4.4","@types/node":"18.6.5","karma-mocha":"2.0.1","@types/mocha":"9.1.1","@types/sinon":"10.0.13","karma-webpack":"4.0.2","@opentelemetry/api":"^1.0.0","@types/lodash.merge":"4.6.6","karma-spec-reporter":"0.0.32","karma-chrome-launcher":"3.1.0","karma-coverage-istanbul-reporter":"3.0.3"},"peerDependencies":{"@opentelemetry/api":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_0.33.0_1663330498049_0.15542963522751552","host":"s3://npm-registry-packages"}},"1.8.0":{"name":"@opentelemetry/sdk-metrics","version":"1.8.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.8.0","maintainers":[{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"d061060f03861ab3f345d0f924922bc1a6396157","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.8.0.tgz","fileCount":489,"integrity":"sha512-+KYb+uj0vHhl8xzJO+oChS4oP1e+/2Wl3SXoHoIdcEjd1TQfDV+lxOm4oqxWq6wykXvI35/JHyejxSoT+qxGmg==","signatures":[{"sig":"MEYCIQDsOqqaWHTqJVYLyeRb+ZNiGkJbd34UCyCqyHX6UgwbCAIhAMvGlF7I5klQng1omsJ/Nk8Nzz0TlqjJqpvJj76kcBV2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1416962,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbANeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqikQ/9EWJ03wBF//CwkzW46y4mBkSgukPe+k9sfS4+cd4/+nErVF2O\r\nMTKRhSpoDQcVLBdmTfeaObKRmgYg2p3PeOrGPphcfkEmZjrRv6342ubUWjRW\r\nm39DSPq8NmZp7J5hRf2hLYSg6tXKZnflCmj+T8upYC/KmW7kOKtx/B3tTy7c\r\nq6q1Kc6vBToqid7yNdFLsIYTjVHM8xSvtg0QVx84S6mtzR2iO8uAzL3ucu34\r\nfLXyN2MzbqJIO516Jt1vE0ix9q/xmt7TrbqCi5k5yZ8cIOianx1Yl7MFGOAX\r\nKwaGILDNoBnb7c8mQITWnP286rsO4NMNnBoXt7ZJCmIavKe8XlbxFZAwuM/q\r\nl0bC9nG8l4r+182xF5XKV2/wnRPQ3j8+uQyBx/8+7YGoIVbowgd4GvJEZGRm\r\n83hxM4/xGxmHiWbkngJlyspY7s86o1MTuwPgwns73cgAhNZsuti2SVgtdoFc\r\n4prfRtGRXUtHJkBQMItiPDEG+Mnfq9hBxHh2F1zuvDLzyN93nCs22gBY79jT\r\n33kticfFECGRLhuCIhZIuV+yzBu4ciYXk0fg9hMY6wagCqQ+tPRs4HPqO92f\r\nuVGhapMpKJPclhvOvlbY4d4Ixm4mo5rrnJx0BPkn445hV6JwJbUC3PAU9yPp\r\nJhIpEHNdZQc8ntThHRpYRCSBmecy8YkzSdo=\r\n=haC6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"7972edf6659fb6e0d5928a5cf7a35f26683e168f","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.all.json","watch":"tsc --build --watch tsconfig.all.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.all.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"lerna run version --scope $(npm pkg get name) --include-dependencies","tdd:browser":"karma start","test:browser":"nyc karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/5.4.3/node@v14.18.1+x64 (darwin)","description":"Work in progress OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"lodash.merge":"4.6.2","@opentelemetry/core":"1.8.0","@opentelemetry/resources":"1.8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"15.1.0","karma":"6.3.16","mocha":"10.0.0","sinon":"14.0.0","rimraf":"3.0.2","codecov":"3.8.3","ts-mocha":"10.0.0","typescript":"4.4.4","@types/node":"18.6.5","karma-mocha":"2.0.1","@types/mocha":"10.0.0","@types/sinon":"10.0.13","karma-webpack":"4.0.2","@opentelemetry/api":">=1.3.0 <1.4.0","@types/lodash.merge":"4.6.6","karma-spec-reporter":"0.0.32","karma-chrome-launcher":"3.1.0","karma-coverage-istanbul-reporter":"3.0.3"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.4.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.8.0_1668023134085_0.198580524230221","host":"s3://npm-registry-packages"}},"1.9.0":{"name":"@opentelemetry/sdk-metrics","version":"1.9.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.9.0","maintainers":[{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"1c3a51abeb7f45ea25b91daf7e05e43d25ddd20a","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.9.0.tgz","fileCount":489,"integrity":"sha512-fSlJWhp86kCan1zuxdH6LTyUBYlohQwDKnxep5qHMnRTNErkYmdjgsmjZvSMdAfUFtQqfZmTXe2Lap7a5AIf9Q==","signatures":[{"sig":"MEUCIGoaNR3oyipKjYbn2fxyiZ4BKdIFiSOmx699LRzKo0vWAiEAyTvGUxH0WbB1bXUpv9AlkibTlQ51uAHPzOa9yFD7L7A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1432686,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvy41ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrSjg//czBDsjkHKhMQ+UP70UHKKTG+xRRSxL0WB8vcvSu2U1VFJldP\r\nBiEOUKKfXMNMTlwB6fuo8mdBnwT/Pn6rmbYyW30mkRtc0n9rpakFtdvASSUg\r\nSsLAROHI+NpaNG3lygIpwXu6wLNGzh1ejL8/1/sfRFKBZIGlb/4l9eHtLj8z\r\nNEZ2r0IAOVOQ2JWnMon0gSM1yjplES4pF30tt5j+UeJbNqgbu9CxD8mUOt/E\r\nV4KT3XawHrjMB5VmPlUhZ66OwbF4P7dZF3ukETA/ezK2XBQeUBBNCiJbW6C0\r\np6WdlJZ/1chyseR9hKiBm8bOrx9XQlNcKyM8brOL9G0joCa/YDX12z0lK5xg\r\nlv/As+8IcQUBkcMsBnzl/BVZUnVQ/qacyWXsYpuMmSCfCOCcCAfLXP/kkVDG\r\nNtNpb3RWySMTuqhYBNxQ2wSBmu0TnXxc3y7ubWfqVNh8SJu9kLZQo8fRFyrM\r\nrVATAIjhFPpZAGBeDca3YHuElfFhXdxtklvHX4ATh3yN0DlVqaaWxQXp6W/I\r\n671fbqRQWCy29YlLoS7k4WR8CGkvNFPYedOgIPinE/g3Qv4oTF0z8vcFYI9G\r\nP2PyfHSre1bHm/5rTIiB9xWEK+XUb+9uV/33gGfTkZqz+6oGd4E0pg9q16cy\r\nEZrSABE83nfpxgpbmLMjACClgyQWshGNr4I=\r\n=qh/2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"08f597f3a3d71a4852b0afbba120af15ca038121","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"lerna run version --scope $(npm pkg get name) --include-dependencies","tdd:browser":"karma start","test:browser":"nyc karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.0.3/node@v14.18.1+x64 (darwin)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"lodash.merge":"4.6.2","@opentelemetry/core":"1.9.0","@opentelemetry/resources":"1.9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.3.16","mocha":"10.0.0","sinon":"15.0.0","rimraf":"3.0.2","codecov":"3.8.3","ts-mocha":"10.0.0","typescript":"4.4.4","@types/node":"18.6.5","karma-mocha":"2.0.1","@types/mocha":"10.0.0","@types/sinon":"10.0.13","karma-webpack":"4.0.2","@opentelemetry/api":">=1.3.0 <1.5.0","@types/lodash.merge":"4.6.6","karma-spec-reporter":"0.0.32","karma-chrome-launcher":"3.1.0","karma-coverage-istanbul-reporter":"3.0.3"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.9.0_1673473589677_0.62979083795101","host":"s3://npm-registry-packages"}},"1.9.1":{"name":"@opentelemetry/sdk-metrics","version":"1.9.1","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.9.1","maintainers":[{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"babc162a81df9884c16b1e67c2dd26ab478f3080","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.9.1.tgz","fileCount":543,"integrity":"sha512-AyhKDcA8NuV7o1+9KvzRMxNbATJ8AcrutKilJ6hWSo9R5utnzxgffV4y+Hp4mJn84iXxkv+CBb99GOJ2A5OMzA==","signatures":[{"sig":"MEYCIQCYUyFLpMVK/wDHg6lU87nZ3MQB9nQh8JvM/VryTCdksgIhAKZDK2iXOPbTaQ6GOK3qt6u560bXhXh+VmFjYH9uiaHo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1556782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1+KFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpp3w//cVciehkq5CKoOUjcEovwgleHJd+eCwOEc40/05fiVn6NmDuW\r\nHAs1UekoxG9cc+MHhvp/38o5o1WFK2sFGXO7ymvMluXheGXx7nI6U+qnqkb9\r\nWWvI53gNcfN5GUgJGarHX6kt+DoyV5+0ig0R/2U37hk6DWm89kZArd+X8xEI\r\nD+2GADx/m1uTUO/PJnaJ8LB1LLK2SJ2vQmViYTP8icykDzIJT5flZyBeb+hk\r\nRqgaFcx7Qa+XecZIjTUXfY5ZQCOc5IYf3JAVea/0kAosP63vSaK9TU+p4GG6\r\n4mYBEANc4Inn4ocav0UoYb5kDNntNo/wAusSI4gH/sByMaQhW/EGy9qmKTA+\r\nKpsIPqZO/FPXZEUJZsEUBOD7GxGp8rUB38JEvW3d3ACDFPfVl/AAuIJ4wipt\r\nM4cKsHtewTdDbDGrkO7o9EDG+OACTTBbvAQ/vxWoC8lDZ+vVWbc0pT+taLcs\r\nlimhIk0XDHJGZ+vxL/T7ib0nOCE1qgt6TL5F0Mmx/Juen4Go2NhOa9dbZG1Y\r\nSI6b/SXe5izJQR6vGhyx2mo3OOXrBQmQc/jjcJbwaRRzLshUY/GmZeqrsPLO\r\n91kJNQIUfFRZLhY0tLPlUaYoFjUY+HL4d0RHWKxLoenZ1POPTBwbrfTpwTRD\r\nOTqOB4P/zL3AutUyuX+FOPevSBguIKxq7wA=\r\n=AXfq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"279458e7ddf16f7ddca5fe60c78672e05fafce66","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"lerna run version --scope $(npm pkg get name) --include-dependencies","tdd:browser":"karma start","test:browser":"nyc karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.0.3/node@v14.18.1+x64 (darwin)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"lodash.merge":"4.6.2","@opentelemetry/core":"1.9.1","@opentelemetry/resources":"1.9.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.3.16","mocha":"10.0.0","sinon":"15.0.0","rimraf":"4.1.2","codecov":"3.8.3","ts-mocha":"10.0.0","typescript":"4.4.4","@types/node":"18.6.5","karma-mocha":"2.0.1","@types/mocha":"10.0.0","@types/sinon":"10.0.13","karma-webpack":"4.0.2","@opentelemetry/api":">=1.3.0 <1.5.0","@types/lodash.merge":"4.6.6","karma-spec-reporter":"0.0.32","karma-chrome-launcher":"3.1.0","karma-coverage-istanbul-reporter":"3.0.3"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.9.1_1675092613192_0.7361446399809115","host":"s3://npm-registry-packages"}},"1.10.0":{"name":"@opentelemetry/sdk-metrics","version":"1.10.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.10.0","maintainers":[{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"627f164036ad053551b3e75447adf9a902b066aa","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.10.0.tgz","fileCount":543,"integrity":"sha512-vOB3khvj894ppOwafNqKNavpChZYR2S2IZyy8PmL0DwNgFPGYwkWxZkv7YJduBNzcCd+Ao+ug93jdSFFhnpIhQ==","signatures":[{"sig":"MEUCIQDL/qHYi9VPBH3poMg/gvlnmTAxuK7zGkYo7FXRK1XAMgIgPAiYWDmawt1pshH1UtUsHcw9izgXdV8pWQMROlpkKEQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1571910,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkD0cTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZ/w/9G8OISP56mEsFRcrjWT+zXdW4zgKR3RBzQcZ+RjfqhV2Gq51K\r\nkwhYJ/bIk/xXtSJkpZ+gHjQIy1lwNXU9ux62RcZXzO/EcDLEg1aDDBD+d7G4\r\naYN81H49JVfrstGQzxduGK1vamLm2EBg0PbQGK7r8oNiNkK/Rt+qRY0ZYi6f\r\neYFhc8Nvbh9MKquBU21z/En/IhrxlbUQyetJ0TKfoonVsoj9VK1F7BBf/7cD\r\nYirI9GZzNKfk+y3IPmQ3aalntJmoN+aWWGYFn3hbE2IIo48N1EOkv3ZPXLwm\r\nHIaEN4MbK1vIjbjaS0LHC6lWYDooa5GCvVEXSl1ZJimyIpdx3FV5z0mVgusJ\r\nyb2PuPPm2okM7FM4xg0sDOqajIBbTy253Q8F+dqEBiZah1ELX/HTXV+3TG8l\r\nUJjlP6oE1CQwW43F+o46Pmf9eF0qi3pPEPwFpuX6JQfnWgWrAgR4LAhAh1UA\r\nhbVTVTBixGvNCZFvMh8Irbj3DNz/6pj2h5akehMBbaENpKj8g8Ij/tFIH7ho\r\nVXKGbDTUrnJPAcm4q1lghjiuBOgvJ3mZxacCayI+5daZBpL1rzXp9TrMSZqq\r\nsk5NuYgpfwBunGAjyeH3J4BirEKMUQElOKUr0oPvGYz11Rz6cs2Xa3U679q6\r\nZ7ZlwIHa3hghQeF62mlagpDWNJ1MweZb3zU=\r\n=fjdK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"56e6b1bb890f844b8963a146780d0b9cfa8abd0d","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"lerna run version --scope $(npm pkg get name) --include-dependencies","tdd:browser":"karma start","test:browser":"nyc karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.0.3/node@v14.18.1+x64 (darwin)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"lodash.merge":"4.6.2","@opentelemetry/core":"1.10.0","@opentelemetry/resources":"1.10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.3.16","mocha":"10.0.0","sinon":"15.0.0","rimraf":"4.1.2","codecov":"3.8.3","ts-mocha":"10.0.0","typescript":"4.4.4","@types/node":"18.6.5","karma-mocha":"2.0.1","@types/mocha":"10.0.0","@types/sinon":"10.0.13","karma-webpack":"4.0.2","@opentelemetry/api":">=1.3.0 <1.5.0","@types/lodash.merge":"4.6.6","karma-spec-reporter":"0.0.32","karma-chrome-launcher":"3.1.0","karma-coverage-istanbul-reporter":"3.0.3"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.10.0_1678722835367_0.34217119288271447","host":"s3://npm-registry-packages"}},"1.10.1":{"name":"@opentelemetry/sdk-metrics","version":"1.10.1","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.10.1","maintainers":[{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"1389a8524ba59dc2e1d9cf627d504119c111fca1","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.10.1.tgz","fileCount":543,"integrity":"sha512-ARAD4e6lZhLwstwW+1HG2Q3XuYFA/t8vn10KK/mA4em1pZYKFn64c45RJZJcntxWp4wOZRbp9iL1RXsg7zIjow==","signatures":[{"sig":"MEQCIF7l8lYSyGXYbwwaiNKB4rSrfukNeC9FI7PrmRetWSCaAiAEvWmV3Mebg7p+TvQxAN44ZzolcH3+uz+10I6dLs+2BA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1571910,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGIV6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrjQg//V5N9A3eIarDzrRPXxYMuJ3TO2qYzZxGLjCSbFBab/UFBKK2g\r\n4KS7ImLvfoP7k9S5xKMEQlCgG+0dGWt3SFELbhpLmwjVPM7OUcfF+es8dfAE\r\nQC6aLfq5juKIz/hcNBUGPZfauUQqReb+KptJUlCfvIW1RUi12dCoXSLm89/r\r\nXOUbhsIo3v+Lj5HBvn4lIl/3iJ07SaB3ehaVtypnSmpcgl2sWyMv77USvagd\r\nENNV4IbUFYM9YRnMFCWgSxtZtFDKmkLypkvUyu9jepecvgbXT+J4Z8hl6zgo\r\nv2Sqbi5PjkY035ZgSHqQ09yHGg5azUwn8AN0Yecqq88Mrqt35As1kdJLvrXg\r\nDK5lDQaxPqtaMSzLAg34Ck/Cng8HANjiKGaRA5ITCuJhoVMRt9va+mHscMwv\r\ngdfkJHKyq3wlGPZAvroDkljKROic2cYZv35zSwHXAoQ1PxYgEvbtxYDxsxPk\r\nSv5azrVgUBpKBM33EE+MMQ3AeizxdjCHnl8mPgv5u4C26MfdEd5f8cOKt9BS\r\nlhvukjFyU9DjoyMypt+LZWjWz1WVxircRPkXwSQa7t2FIGSV5XHL5nHSrBt4\r\nam5WwdCTJntt5jdeiL5RHN0myvOBDPB10G9ZoaogPjGUIXJK/XERuVD4/e9w\r\nJMVSLW8zW0CgZaAGWoaA4KhhW2OYXC/OdUk=\r\n=O4i4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"486df99906958de9b8b666839785b00160a6a229","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"lerna run version --scope $(npm pkg get name) --include-dependencies","tdd:browser":"karma start","test:browser":"nyc karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.0.3/node@v14.18.1+x64 (darwin)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"lodash.merge":"4.6.2","@opentelemetry/core":"1.10.1","@opentelemetry/resources":"1.10.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.3.16","mocha":"10.0.0","sinon":"15.0.0","rimraf":"4.1.2","codecov":"3.8.3","ts-mocha":"10.0.0","typescript":"4.4.4","@types/node":"18.6.5","karma-mocha":"2.0.1","@types/mocha":"10.0.0","@types/sinon":"10.0.13","karma-webpack":"4.0.2","@opentelemetry/api":">=1.3.0 <1.5.0","@types/lodash.merge":"4.6.6","karma-spec-reporter":"0.0.32","karma-chrome-launcher":"3.1.0","karma-coverage-istanbul-reporter":"3.0.3"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.10.1_1679328634706_0.9289571491726534","host":"s3://npm-registry-packages"}},"1.11.0":{"name":"@opentelemetry/sdk-metrics","version":"1.11.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.11.0","maintainers":[{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"0fe347fb39a802ec270315cba0eba2e3ce64c4a2","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.11.0.tgz","fileCount":561,"integrity":"sha512-knuq3pwU0+46FEMdw9Ses+alXL9cbcLUUTdYBBBsaKkqKwoVMHfhBufW7u6YCu4i+47Wg6ZZTN/eGc4LbTbK5Q==","signatures":[{"sig":"MEUCICcPE7ow3GH80M4VwObQJPDkCO3SK4VTYmZkd1STJ+uZAiEA35ZtKgFt5GMZa3WnCxdCI7yWWkwAk9QYu88ktlLJYVk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1839857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJaswACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrzcg/9FdLBYGIFXRPNUEc+CsQRabaC90KOwOp+7HV39/LXozs0FSB1\r\niKe3uUkfFBCLhcRSCQns1EVifv+Xda02Wa/Y0r28uhKc1y/N7uGQWLFpR7Iu\r\ngVVKTxpLt2QPsTYyQuuj4a6XGpGk7frKzv+uss7ByMKXUsC7YmzMS1DUJt+4\r\nekB8LXK7MEMrsN1ze0pp9+r9KTPGMDQXT9I64a/AuWR7IhM4RuPqjpriq/7R\r\nV38kOjgp4I6uj1H4hAB3FQ1NwdVOSajrDQ2HHLUvT4lv22LKIABQr0TDtQsN\r\naJq9rK7IfWSAE5zj5q9t8VfpNkhph3pFPPgg/l1Mnryr+VYhvErInyIuuPcM\r\n6X3csId2wFKauJR4oSXTLDxE6IMfvPk1ln2aXe3u/bSDrjEkd8bJvAS45yhW\r\n8JxegGRcA3SMuTtJcy85S6mVc/rksLjDSGDGpBaL4eYnR1qQ1hGYLljdpbuy\r\nbDRNcL2ZERMu3CmmXsFEmDqfTdFaMIzGTXXN20+ti6HtcBL9WFsKgVudxD5O\r\nTU40gKMtkAc+kfQ7cheqj+WjbH6ED0dPA7BHCE8Mo7kQTuGCVR1pMZZHh50h\r\nb/CaOKc7PCzVltN0PRnNPouwHzSM00LFqU4O2dvfnDkM6yyNJ86Je01ls6Fu\r\nQooqG9QlA64TxWqtWwXfGRY/w5p7wZSrXrE=\r\n=KFj4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"1328ee04ae78f9f6cf143af7050c00aaa6d2eb3b","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"lerna run version --scope $(npm pkg get name) --include-dependencies","tdd:browser":"karma start","test:browser":"nyc karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.0.3/node@v14.18.1+x64 (darwin)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"lodash.merge":"4.6.2","@opentelemetry/core":"1.11.0","@opentelemetry/resources":"1.11.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.3.16","mocha":"10.0.0","sinon":"15.0.0","rimraf":"4.1.2","codecov":"3.8.3","ts-mocha":"10.0.0","typescript":"4.4.4","@types/node":"18.6.5","karma-mocha":"2.0.1","@types/mocha":"10.0.0","@types/sinon":"10.0.13","karma-webpack":"4.0.2","@opentelemetry/api":">=1.3.0 <1.5.0","@types/lodash.merge":"4.6.6","karma-spec-reporter":"0.0.32","karma-chrome-launcher":"3.1.0","karma-coverage-istanbul-reporter":"3.0.3"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.11.0_1680190255856_0.4488883258029981","host":"s3://npm-registry-packages"}},"1.12.0":{"name":"@opentelemetry/sdk-metrics","version":"1.12.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.12.0","maintainers":[{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"52c135b8ca6af677a3e93b6721bc866a74c98b4b","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.12.0.tgz","fileCount":561,"integrity":"sha512-zOy88Jfk88eTxqu+9ypHLs184dGydJocSWtvWMY10QKVVaxhC3SLKa0uxI/zBtD9S+x0LP65wxrTSfSoUNtCOA==","signatures":[{"sig":"MEQCIEAfZBHAMQVNInXN1E0ihfClv5NylKPFc0jrD34SRJMvAiBzpMnq2Iu5C00sNF1GPtmv10V2RrlKn7msJG8pBtnd5g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1839857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOEYtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobXQ/6AsboU2mCpdhs/tPwnXUqcjmoBV3/aVWoXwM22/jxCszCX8vk\r\nRFoTQHvvMZOMjqOLOPW2S3U2sPumqm7tj7V2aT/tVoZ7En09afYCbKO1fClj\r\ndtm9zB4H/GeL9uT4j8E7mFzPGMkgl/Wo8xZzrifKGknDwoO5sITFwXYCb1XI\r\nVprJn7eNMQEeMuGNd8WG2SFiI+VwVDfRz9eCmaI6ozABBw+Xd/Ae2SzPRfqo\r\nlbV46b6MN47oJHPNNjvPDPpQ8PUu+usZ2CZZR0/DYvHryjJnsTEaBOEqefXl\r\nvL7ommVdZW6DNSzMEQ5k4DQIMIHrvYYL/j8Cwkl7UcpmzrXgWoHNfQLlP3zk\r\nOqHvW+AEAYeiAs1ZrLRwNId+SpdNdERohMR70BxyU1ZXXx6NcpzJv6V+a+4q\r\nrtfX4oazI7rldM1BHO3sJM3g0cCyUtllFGTb5Mg8EI1qXBZppQF33jLvj20n\r\n4Ulb6wpsteaDDlBOK1TmN0s8VftM4ekrz2b5+UvE5yYq7RX+FVRFWb8U5xiZ\r\nHRc/5H4txVGZXLFvmSCJm6WmzUy83njG0qSF3wS6dOetNRXlrJrhS0tnHBqM\r\nnC4RbTqtdrp4EDi4F521hcdm6uo2cAmCxHbVhwgL+3lM2me9VmAtxB/BJacp\r\nvupg+95/zDYgsEWSTaFE/0t7TGuFe0UJ9j4=\r\n=5rhT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"a04090010ee18e17487b449984807cc2b7b6e3e6","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"lerna run version --scope $(npm pkg get name) --include-dependencies","tdd:browser":"karma start","test:browser":"nyc karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.0.3/node@v14.18.1+x64 (darwin)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"14.18.1","dependencies":{"lodash.merge":"4.6.2","@opentelemetry/core":"1.12.0","@opentelemetry/resources":"1.12.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.3.16","mocha":"10.0.0","sinon":"15.0.0","rimraf":"4.1.2","codecov":"3.8.3","ts-mocha":"10.0.0","typescript":"4.4.4","@types/node":"18.6.5","karma-mocha":"2.0.1","@types/mocha":"10.0.0","@types/sinon":"10.0.13","karma-webpack":"4.0.2","@opentelemetry/api":">=1.3.0 <1.5.0","@types/lodash.merge":"4.6.6","karma-spec-reporter":"0.0.32","karma-chrome-launcher":"3.1.0","karma-coverage-istanbul-reporter":"3.0.3"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.12.0_1681409581531_0.31698151736882196","host":"s3://npm-registry-packages"}},"1.13.0":{"name":"@opentelemetry/sdk-metrics","version":"1.13.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.13.0","maintainers":[{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"4e859107a7a4389bcda7b37d3952bc7dd34211d7","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.13.0.tgz","fileCount":561,"integrity":"sha512-MOjZX6AnSOqLliCcZUrb+DQKjAWXBiGeICGbHAGe5w0BB18PJIeIo995lO5JSaFfHpmUMgJButTPfJJD27W3Vg==","signatures":[{"sig":"MEYCIQCUeO+qPBpw+CVNlqlTfDO++08VfOb0W3UdO9pIYolUCAIhAJH6JOYZuj9SxAwhyK86XMhqrxGloVuk7E7pzmTPdjJr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1839834},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"8fc76896595aac912bf9e15d4f19c167317844c8","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"lerna run version --scope $(npm pkg get name) --include-dependencies","tdd:browser":"karma start","test:browser":"nyc karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.0.3/node@v18.12.1+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.12.1","dependencies":{"lodash.merge":"4.6.2","@opentelemetry/core":"1.13.0","@opentelemetry/resources":"1.13.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.3.16","mocha":"10.0.0","sinon":"15.0.0","codecov":"3.8.3","ts-mocha":"10.0.0","typescript":"4.4.4","@types/node":"18.6.5","karma-mocha":"2.0.1","@types/mocha":"10.0.0","@types/sinon":"10.0.13","karma-webpack":"4.0.2","@opentelemetry/api":">=1.3.0 <1.5.0","@types/lodash.merge":"4.6.6","karma-spec-reporter":"0.0.32","karma-chrome-launcher":"3.1.0","karma-coverage-istanbul-reporter":"3.0.3"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.13.0_1683811806809_0.022001801192962578","host":"s3://npm-registry-packages"}},"1.14.0":{"name":"@opentelemetry/sdk-metrics","version":"1.14.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.14.0","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"ee51d72eb32a74108e6632681ce2df46cddc0714","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.14.0.tgz","fileCount":561,"integrity":"sha512-F0JXmLqT4LmsaiaE28fl0qMtc5w0YuMWTHt1hnANTNX8hxW4IKSv9+wrYG7BZd61HEbPm032Re7fXyzzNA6nIw==","signatures":[{"sig":"MEUCIQDZy6AZC4gsrIqvrLyc0L21UL/+PakTzlDTNsuwjRpDhwIgMSf9ZJoCKDB8uD708TqJtggoPZ9cpVP/LIthheTWDWM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1839834},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"edebbcc757535bc88f01340409dbbecc0bb6ccf8","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"lerna run version --scope $(npm pkg get name) --include-dependencies","tdd:browser":"karma start","test:browser":"nyc karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.0.3/node@v18.12.1+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.12.1","dependencies":{"lodash.merge":"4.6.2","@opentelemetry/core":"1.14.0","@opentelemetry/resources":"1.14.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.3.16","mocha":"10.0.0","sinon":"15.0.0","codecov":"3.8.3","ts-mocha":"10.0.0","typescript":"4.4.4","@types/node":"18.6.5","karma-mocha":"2.0.1","@types/mocha":"10.0.0","@types/sinon":"10.0.13","karma-webpack":"4.0.2","@opentelemetry/api":">=1.3.0 <1.5.0","@types/lodash.merge":"4.6.6","karma-spec-reporter":"0.0.32","karma-chrome-launcher":"3.1.0","karma-coverage-istanbul-reporter":"3.0.3"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.14.0_1686031255514_0.6205545095237606","host":"s3://npm-registry-packages"}},"1.15.0":{"name":"@opentelemetry/sdk-metrics","version":"1.15.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.15.0","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"e47ad688882fc2daedcbbe3db16a5c110feb23e8","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.15.0.tgz","fileCount":561,"integrity":"sha512-fFUnAcPvlXO39nlIduGuaeCuiZyFtSLCn9gW/0djFRO5DFst4m4gcT6+llXvNWuUvtGB49s56NP10B9IZRN0Rw==","signatures":[{"sig":"MEQCIA6mPFnkdT47rCrHsCh4ePv+jy+q7abH27EHpIw2DKE0AiB9rZUo59MjzXY9Uih4EbPVSQZ5I/uFRmYTdzVsP7a68g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1803014},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"06e919d6c909e8cc8e28b6624d9843f401d9b059","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"nyc karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/7.1.1/node@v18.12.1+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.12.1","dependencies":{"tslib":"^2.3.1","lodash.merge":"^4.6.2","@opentelemetry/core":"1.15.0","@opentelemetry/resources":"1.15.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.2","lerna":"7.1.1","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","ts-mocha":"10.0.0","cross-var":"1.1.0","typescript":"4.4.4","@types/node":"18.6.5","karma-mocha":"2.0.1","@types/mocha":"10.0.1","@types/sinon":"10.0.15","karma-webpack":"4.0.2","@opentelemetry/api":">=1.3.0 <1.5.0","@types/lodash.merge":"4.6.7","karma-spec-reporter":"0.0.36","karma-chrome-launcher":"3.1.0","karma-coverage-istanbul-reporter":"3.0.3"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.15.0_1688642828881_0.612950022765163","host":"s3://npm-registry-packages"}},"1.15.1":{"name":"@opentelemetry/sdk-metrics","version":"1.15.1","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.15.1","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"e0d2844191ecd7fce3fccf18ae50ed35389f0885","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.15.1.tgz","fileCount":561,"integrity":"sha512-ojcrzexOQfto83NvKfIvsJap4SHH3ZvLjsDGhQ04AfvWWGR7mPcqLSlLedoSkEdIe0k1H6uBEsHBtIprkMpTHA==","signatures":[{"sig":"MEYCIQCBwveTbaE79v4tJk8CdBffRh5H6Loc8hSu+ysnZzK1YAIhAMHsh5T/As5lzxnmYm6j7V704gjjvyvEm2CaH1bpx5cO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1841179},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"9f71800fdc2a5ee5055684037a12498af71955f2","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/7.1.3/node@v18.4.0+x64 (darwin)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.4.0","dependencies":{"lodash.merge":"^4.6.2","@opentelemetry/core":"1.15.1","@opentelemetry/resources":"1.15.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.2","lerna":"7.1.3","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","webpack":"4.46.0","ts-mocha":"10.0.0","cross-var":"1.1.0","ts-loader":"8.4.0","typescript":"4.4.4","@babel/core":"7.22.9","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"4.10.0","@types/mocha":"10.0.1","@types/sinon":"10.0.15","karma-webpack":"4.0.2","webpack-merge":"5.9.0","karma-coverage":"2.2.1","@opentelemetry/api":">=1.3.0 <1.5.0","@types/lodash.merge":"4.6.7","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"6.1.1","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.15.1_1690209168814_0.4696021233708716","host":"s3://npm-registry-packages"}},"1.15.2":{"name":"@opentelemetry/sdk-metrics","version":"1.15.2","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.15.2","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"eadd0a049de9cd860e1e0d49eea01156469c4b60","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.15.2.tgz","fileCount":561,"integrity":"sha512-9aIlcX8GnhcsAHW/Wl8bzk4ZnWTpNlLtud+fxUfBtFATu6OZ6TrGrF4JkT9EVrnoxwtPIDtjHdEsSjOqisY/iA==","signatures":[{"sig":"MEUCIQCFKX9DaFzjXDXPu/N+lf5A+VZoJEIuX5BlwqR2YxqIPQIgTriFUfsIieNy4ajXosd23GlEnVapJ9nRDMUvRFJYIGk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1848194},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"48fb15862e801b742059a3e39dbcc8ef4c10b2e2","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/7.1.4/node@v18.12.1+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.12.1","dependencies":{"lodash.merge":"^4.6.2","@opentelemetry/core":"1.15.2","@opentelemetry/resources":"1.15.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.2","lerna":"7.1.4","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","webpack":"4.46.0","ts-mocha":"10.0.0","cross-var":"1.1.0","ts-loader":"8.4.0","typescript":"4.4.4","@babel/core":"7.22.10","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"4.10.0","@types/mocha":"10.0.1","@types/sinon":"10.0.16","karma-webpack":"4.0.2","webpack-merge":"5.9.0","karma-coverage":"2.2.1","@opentelemetry/api":">=1.3.0 <1.5.0","@types/lodash.merge":"4.6.7","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"6.1.1","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.15.2_1691500878806_0.21964542929012487","host":"s3://npm-registry-packages"}},"1.16.0":{"name":"@opentelemetry/sdk-metrics","version":"1.16.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.16.0","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"6c413c6abb1d68dbfe59984384d4031feeccbe1e","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.16.0.tgz","fileCount":561,"integrity":"sha512-58obaKzBY0CB6ZQS/sxcGvihqZk2zL2KDCQe734NofVfE7JpKMn/TtyzA8O4nw9sXIO2N9Wx2zzKRyGFXVGrcw==","signatures":[{"sig":"MEUCIGu4l4M/yMtx2D8TpJeVo1nvcoCzRr6o5+wZtJj2W23YAiEAzPdInj1ng6V1HXJhfyT/sRzxXuC3taYmiuKCASO4G2g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1872545},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"5fcd8cf136e2235903dde3df9ba03ced594f0e95","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/7.1.5/node@v18.12.1+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.12.1","dependencies":{"lodash.merge":"^4.6.2","@opentelemetry/core":"1.16.0","@opentelemetry/resources":"1.16.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.2","lerna":"7.1.5","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","webpack":"4.46.0","ts-mocha":"10.0.0","cross-var":"1.1.0","ts-loader":"8.4.0","typescript":"4.4.4","@babel/core":"7.22.17","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"4.10.0","@types/mocha":"10.0.1","@types/sinon":"10.0.16","karma-webpack":"4.0.2","webpack-merge":"5.9.0","karma-coverage":"2.2.1","@opentelemetry/api":">=1.3.0 <1.6.0","@types/lodash.merge":"4.6.7","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"6.1.1","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.6.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.16.0_1694434471320_0.42251452448444704","host":"s3://npm-registry-packages"}},"1.17.0":{"name":"@opentelemetry/sdk-metrics","version":"1.17.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.17.0","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"e51d39e0bb749780d17f9b1df12f0490438dec1a","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.17.0.tgz","fileCount":561,"integrity":"sha512-HlWM27yGmYuwCoVRe3yg2PqKnIsq0kEF0HQgvkeDWz2NYkq9fFaSspR6kvjxUTbghAlZrabiqbgyKoYpYaXS3w==","signatures":[{"sig":"MEQCIEGFsgaNt88vPUiItoys14mI96KUmsfCU3V9/M9zEFrHAiAgibedup1xc0Uh7HFSGEe8a8IEZbYsRxYQhUM7mMJJmQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1872545},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"faf939c77591f709afbc23fadbe629c9d3607ef6","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/7.1.5/node@v18.12.1+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.12.1","dependencies":{"lodash.merge":"^4.6.2","@opentelemetry/core":"1.17.0","@opentelemetry/resources":"1.17.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.2","lerna":"7.1.5","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","webpack":"4.46.0","ts-mocha":"10.0.0","cross-var":"1.1.0","ts-loader":"8.4.0","typescript":"4.4.4","@babel/core":"7.22.17","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"4.10.0","@types/mocha":"10.0.1","@types/sinon":"10.0.16","karma-webpack":"4.0.2","webpack-merge":"5.9.0","karma-coverage":"2.2.1","@opentelemetry/api":">=1.3.0 <1.7.0","@types/lodash.merge":"4.6.7","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"6.1.1","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.7.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.17.0_1694524354547_0.27289065421627656","host":"s3://npm-registry-packages"}},"1.17.1":{"name":"@opentelemetry/sdk-metrics","version":"1.17.1","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.17.1","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"9c4d13d845bcc82be8684050d9db7cce10f61580","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.17.1.tgz","fileCount":561,"integrity":"sha512-eHdpsMCKhKhwznxvEfls8Wv3y4ZBWkkXlD3m7vtHIiWBqsMHspWSfie1s07mM45i/bBCf6YBMgz17FUxIXwmZA==","signatures":[{"sig":"MEUCIQC6T+my/2xzI2vaedMangtbqdpdAHiTTnwC85I9zGxvdwIgJwgxV8Jz14/su/N16gkO8rU//itJPXSzxcx7YCPtM6U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1883659},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"f8e187b473274cc2011e7385992f07d319d667dc","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/7.1.5/node@v18.12.1+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.12.1","dependencies":{"lodash.merge":"^4.6.2","@opentelemetry/core":"1.17.1","@opentelemetry/resources":"1.17.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.2","lerna":"7.1.5","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","webpack":"4.46.0","ts-mocha":"10.0.0","cross-var":"1.1.0","ts-loader":"8.4.0","typescript":"4.4.4","@babel/core":"7.22.20","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"4.10.0","@types/mocha":"10.0.2","@types/sinon":"10.0.18","karma-webpack":"4.0.2","webpack-merge":"5.9.0","karma-coverage":"2.2.1","@opentelemetry/api":">=1.3.0 <1.7.0","@types/lodash.merge":"4.6.7","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"6.1.1","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.7.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.17.1_1696947498625_0.4798664177082872","host":"s3://npm-registry-packages"}},"1.18.0":{"name":"@opentelemetry/sdk-metrics","version":"1.18.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.18.0","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"f84fffcabdb0e9504e3b219635c1099aabc9e207","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.18.0.tgz","fileCount":561,"integrity":"sha512-wK5zdNCo5cJvZog/lsqXCg9/Dt9UeNXQsskgqX8Yz+40t13Kb5CKFFkAMU8tNUxkvidHnD6G6sT6xeVCHQYe4A==","signatures":[{"sig":"MEUCIQCMiT/6j2k3CLJNS9PVe/gMQM/shgZfXDwNLg9l7E3QdgIgFnmCSIgxrXYgrtIppJgyKJkGNUzsbBET1HwAZBRXfG8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1890396},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"73b446688f10fd8dc4cf403a085f0a39070df7b4","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.6.2/node@v18.18.2+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.18.2","dependencies":{"lodash.merge":"^4.6.2","@opentelemetry/core":"1.18.0","@opentelemetry/resources":"1.18.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.2","lerna":"6.6.2","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","webpack":"4.46.0","ts-mocha":"10.0.0","cross-var":"1.1.0","ts-loader":"8.4.0","typescript":"4.4.4","@babel/core":"7.22.20","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"4.10.0","@types/mocha":"10.0.3","@types/sinon":"10.0.20","karma-webpack":"4.0.2","webpack-merge":"5.9.0","karma-coverage":"2.2.1","@opentelemetry/api":">=1.3.0 <1.8.0","@types/lodash.merge":"4.6.8","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"6.1.1","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.8.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.18.0_1699353886784_0.2402177673494048","host":"s3://npm-registry-packages"}},"1.18.1":{"name":"@opentelemetry/sdk-metrics","version":"1.18.1","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.18.1","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"1dd334744a1e5d2eec27e9e9765c73cd2f43aef3","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.18.1.tgz","fileCount":561,"integrity":"sha512-TEFgeNFhdULBYiCoHbz31Y4PDsfjjxRp8Wmdp6ybLQZPqMNEb+dRq+XN8Xw3ivIgTaf9gYsomgV5ensX99RuEQ==","signatures":[{"sig":"MEUCIQDZiuGHcrjzMGF/TJ452D+P3TvNuhbyNQDLJOkdYsDPFQIgKtcP2GNoTjs9raH1wfRgj93Kw4tqRy7FLSmt98YetyQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1892649},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"f665499096189390e691cf1a772e677fa67812d7","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.6.2/node@v18.18.2+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.18.2","dependencies":{"lodash.merge":"^4.6.2","@opentelemetry/core":"1.18.1","@opentelemetry/resources":"1.18.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.2","lerna":"6.6.2","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","webpack":"4.46.0","ts-mocha":"10.0.0","cross-var":"1.1.0","ts-loader":"8.4.0","typescript":"4.4.4","@babel/core":"7.22.20","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"4.10.0","@types/mocha":"10.0.3","@types/sinon":"10.0.20","karma-webpack":"4.0.2","webpack-merge":"5.9.0","karma-coverage":"2.2.1","@opentelemetry/api":">=1.3.0 <1.8.0","@types/lodash.merge":"4.6.8","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"6.1.1","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.8.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.18.1_1699466949698_0.2731195093463463","host":"s3://npm-registry-packages"}},"1.19.0":{"name":"@opentelemetry/sdk-metrics","version":"1.19.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.19.0","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"fe8029af29402563eb8dba75a85fc02006ea92c4","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.19.0.tgz","fileCount":561,"integrity":"sha512-FiMii40zr0Fmys4F1i8gmuCvbinBnBsDeGBr4FQemOf0iPCLytYQm5AZJ/nn4xSc71IgKBQwTFQRAGJI7JvZ4Q==","signatures":[{"sig":"MEUCIQCQbl3KfCIEDQc8lHtdKlCRprXMXq1iqFxWHzS7fhRAMQIgOOpi/ti3SCJMstM0WHGr81bNA0QPpltVs/+OuHKDlyw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1892648},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"d3c311aec24137084dc820805a2597e120335672","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.6.2/node@v18.18.2+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.18.2","dependencies":{"lodash.merge":"^4.6.2","@opentelemetry/core":"1.19.0","@opentelemetry/resources":"1.19.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.2","lerna":"6.6.2","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","webpack":"5.89.0","ts-mocha":"10.0.0","cross-var":"1.1.0","ts-loader":"8.4.0","typescript":"4.4.4","@babel/core":"7.23.6","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"5.1.4","@types/mocha":"10.0.6","@types/sinon":"10.0.20","karma-webpack":"4.0.2","webpack-merge":"5.10.0","karma-coverage":"2.2.1","@opentelemetry/api":">=1.3.0 <1.8.0","@types/lodash.merge":"4.6.9","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"6.1.1","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.8.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.19.0_1702557329935_0.360745159718469","host":"s3://npm-registry-packages"}},"1.20.0":{"name":"@opentelemetry/sdk-metrics","version":"1.20.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.20.0","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"472d723d986a0a0cc1ee1170ed086dc18269d7e0","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.20.0.tgz","fileCount":561,"integrity":"sha512-07bFOQUrpN/Q5biJ/cuBePztKwkc1VGkFblZxAcVkuvCLDAPJfsyr0NNWegWeYe0bpGt1jmXScpUWnVD+t8Q0w==","signatures":[{"sig":"MEUCIC3XY/+kezXMIGl3icXMEXdu0pKWhpKhJ7kpzNi6cW5lAiEAtKlujqgWTX99ep+IDoNQKi5a4BEjbPjw6yGUGzBa6hU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1892648},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"57008533aba7ccd51ea80f38ff4f29404d47eb9c","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.6.2/node@v18.19.0+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","dependencies":{"lodash.merge":"^4.6.2","@opentelemetry/core":"1.20.0","@opentelemetry/resources":"1.20.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.2","lerna":"6.6.2","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","webpack":"5.89.0","ts-mocha":"10.0.0","cross-var":"1.1.0","ts-loader":"8.4.0","typescript":"4.4.4","@babel/core":"7.23.6","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"5.1.4","@types/mocha":"10.0.6","@types/sinon":"10.0.20","karma-webpack":"4.0.2","webpack-merge":"5.10.0","karma-coverage":"2.2.1","@opentelemetry/api":">=1.3.0 <1.8.0","@types/lodash.merge":"4.6.9","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"6.1.1","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.8.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.20.0_1705313747415_0.3264673460411951","host":"s3://npm-registry-packages"}},"1.21.0":{"name":"@opentelemetry/sdk-metrics","version":"1.21.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.21.0","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"40d71aaec5b696e58743889ce6d5bf2593f9a23d","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.21.0.tgz","fileCount":561,"integrity":"sha512-on1jTzIHc5DyWhRP+xpf+zrgrREXcHBH4EDAfaB5mIG7TWpKxNXooQ1JCylaPsswZUv4wGnVTinr4HrBdGARAQ==","signatures":[{"sig":"MEQCIGpBDMhU8lTH5TE6aUTa3/f+ZAAJNZyvJR4W+y34uKgyAiA9nbAm4W2G9iFlp1OSXMtF3+Qs3M8RTAz9dMzR/gPTXA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1898573},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"828f2ed730e4d26d71f92e220f96b60a552a673a","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.6.2/node@v18.19.0+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","dependencies":{"lodash.merge":"^4.6.2","@opentelemetry/core":"1.21.0","@opentelemetry/resources":"1.21.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.2","lerna":"6.6.2","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","webpack":"5.89.0","ts-mocha":"10.0.0","cross-var":"1.1.0","ts-loader":"8.4.0","typescript":"4.4.4","@babel/core":"7.23.6","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"5.1.4","@types/mocha":"10.0.6","@types/sinon":"10.0.20","karma-webpack":"4.0.2","webpack-merge":"5.10.0","karma-coverage":"2.2.1","@babel/preset-env":"7.22.20","@opentelemetry/api":">=1.3.0 <1.8.0","@types/lodash.merge":"4.6.9","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"6.1.1","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.8.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.21.0_1706249469816_0.2681154592027921","host":"s3://npm-registry-packages"}},"1.22.0":{"name":"@opentelemetry/sdk-metrics","version":"1.22.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.22.0","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"b94c62403013e4c72b96dc747d71d786073efafc","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.22.0.tgz","fileCount":561,"integrity":"sha512-k6iIx6H3TZ+BVMr2z8M16ri2OxWaljg5h8ihGJxi/KQWcjign6FEaEzuigXt5bK9wVEhqAcWLCfarSftaNWkkg==","signatures":[{"sig":"MEUCIQDNXgVv9Uxbxg3/33/6F66wijwbwDd7GOiqKURWpli14gIgE4NQsN1CjuPkQcHMyQ25CAKybwbYPJODQxdspPHt3+E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1903538},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"7be35c7845e206b27b682e8ce1cee850b09cec04","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.6.2/node@v18.19.0+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","dependencies":{"lodash.merge":"^4.6.2","@opentelemetry/core":"1.22.0","@opentelemetry/resources":"1.22.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.2","lerna":"6.6.2","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","webpack":"5.89.0","ts-mocha":"10.0.0","cross-var":"1.1.0","ts-loader":"8.4.0","typescript":"4.4.4","@babel/core":"7.23.6","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"5.1.4","@types/mocha":"10.0.6","@types/sinon":"10.0.20","karma-webpack":"4.0.2","webpack-merge":"5.10.0","karma-coverage":"2.2.1","@babel/preset-env":"7.22.20","@opentelemetry/api":">=1.3.0 <1.9.0","@types/lodash.merge":"4.6.9","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"6.1.1","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.9.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.22.0_1709198294535_0.21078722486314505","host":"s3://npm-registry-packages"}},"1.23.0":{"name":"@opentelemetry/sdk-metrics","version":"1.23.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.23.0","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"b4cf3cc86b6dedf5c438c67c829df7399bf64be1","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.23.0.tgz","fileCount":561,"integrity":"sha512-4OkvW6+wST4h6LFG23rXSTf6nmTf201h9dzq7bE0z5R9ESEVLERZz6WXwE7PSgg1gdjlaznm1jLJf8GttypFDg==","signatures":[{"sig":"MEUCIQCRviOtBHY4cxAbFmlSe5/d1UlZwJANaHyzFmHvAstAfgIgcfcrCMSSgbzKnYncXB5RxmguAOFxcmRGxTgWETblVvM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1914895},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"5231aa255047fbc6ee3d6a299f4423ab2f8a5fbc","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.6.2/node@v18.19.0+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","dependencies":{"lodash.merge":"^4.6.2","@opentelemetry/core":"1.23.0","@opentelemetry/resources":"1.23.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.2","lerna":"6.6.2","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","webpack":"5.89.0","ts-mocha":"10.0.0","cross-var":"1.1.0","ts-loader":"8.4.0","typescript":"4.4.4","@babel/core":"7.23.6","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"5.1.4","@types/mocha":"10.0.6","@types/sinon":"10.0.20","karma-webpack":"4.0.2","webpack-merge":"5.10.0","karma-coverage":"2.2.1","@babel/preset-env":"7.22.20","@opentelemetry/api":">=1.3.0 <1.9.0","@types/lodash.merge":"4.6.9","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"6.1.1","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.9.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.23.0_1712131805787_0.6556898049242013","host":"s3://npm-registry-packages"}},"1.24.0":{"name":"@opentelemetry/sdk-metrics","version":"1.24.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.24.0","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"205c19b6d18e385039d0a261c784a203c644fc28","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.24.0.tgz","fileCount":561,"integrity":"sha512-4tJ+E6N019OZVB/nUW/LoK9xHxfeh88TCoaTqHeLBE9wLYfi6irWW6J9cphMav7J8Qk0D5b7/RM4VEY4dArWOA==","signatures":[{"sig":"MEUCIFw7C6N1PHTi2sUnPwYd6pb4MEYB0sdDPAfLyVHSEEL0AiEAhRBkWnU/RMsb1e2pd8JuT67Zi9eH87TbDc40JN74Plg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1914895},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"3ab4f765d8d696327b7d139ae6a45e7bd7edd924","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.6.2/node@v18.19.0+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","dependencies":{"lodash.merge":"^4.6.2","@opentelemetry/core":"1.24.0","@opentelemetry/resources":"1.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.2","lerna":"6.6.2","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","webpack":"5.89.0","ts-mocha":"10.0.0","cross-var":"1.1.0","ts-loader":"8.4.0","typescript":"4.4.4","@babel/core":"7.23.6","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"5.1.4","@types/mocha":"10.0.6","@types/sinon":"10.0.20","karma-webpack":"4.0.2","webpack-merge":"5.10.0","karma-coverage":"2.2.1","@babel/preset-env":"7.22.20","@opentelemetry/api":">=1.3.0 <1.9.0","@types/lodash.merge":"4.6.9","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"6.1.1","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.9.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.24.0_1713969585182_0.37633556794494494","host":"s3://npm-registry-packages"}},"1.24.1":{"name":"@opentelemetry/sdk-metrics","version":"1.24.1","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.24.1","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"82ee3069b2ca9bb7c1e91272ff81536dc2e9bc8d","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.24.1.tgz","fileCount":561,"integrity":"sha512-FrAqCbbGao9iKI+Mgh+OsC9+U2YMoXnlDHe06yH7dvavCKzE3S892dGtX54+WhSFVxHR/TMRVJiK/CV93GR0TQ==","signatures":[{"sig":"MEUCIQCTMSUw6bs+C6f+azmvQBAAOS2F2zkdYmTaUA0WsSSESgIgVgEsIIBcrrCeUZGl8a4ziCe01KmMiEcyeTk5/btVJww=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1914895},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"41c2626fe0ed03e2e83bd79ee43c9bdf0ffd80d8","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.6.2/node@v18.19.0+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","dependencies":{"lodash.merge":"^4.6.2","@opentelemetry/core":"1.24.1","@opentelemetry/resources":"1.24.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.2","lerna":"6.6.2","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","webpack":"5.89.0","ts-mocha":"10.0.0","cross-var":"1.1.0","ts-loader":"8.4.0","typescript":"4.4.4","@babel/core":"7.23.6","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"5.1.4","@types/mocha":"10.0.6","@types/sinon":"10.0.20","karma-webpack":"4.0.2","webpack-merge":"5.10.0","karma-coverage":"2.2.1","@babel/preset-env":"7.22.20","@opentelemetry/api":">=1.3.0 <1.9.0","@types/lodash.merge":"4.6.9","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"6.1.1","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.9.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.24.1_1715093558847_0.03178144750682588","host":"s3://npm-registry-packages"}},"1.25.0":{"name":"@opentelemetry/sdk-metrics","version":"1.25.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.25.0","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"0c954d580c17821ae4385d29447718df09e80b79","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.25.0.tgz","fileCount":561,"integrity":"sha512-IF+Sv4VHgBr/BPMKabl+GouJIhEqAOexCHgXVTISdz3q9P9H/uA8ScCF+22gitQ69aFtESbdYOV+Fen5+avQng==","signatures":[{"sig":"MEUCIQCTGV0/dFktbxE5zP6XFH0Eu0/cZ7CGkU7c5BAAq4CVjAIgG3QIuMsMnEWURsoo1SS0GKQqtBcHiCbSGaaBzrbsXaE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1914152},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"c4d3351b6b3f5593c8d7cbfec97b45cea9fe1511","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","align-api-deps":"node ../../scripts/align-api-deps.js","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.6.2/node@v18.19.0+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","dependencies":{"lodash.merge":"^4.6.2","@opentelemetry/core":"1.25.0","@opentelemetry/resources":"1.25.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.3","lerna":"6.6.2","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","webpack":"5.89.0","ts-mocha":"10.0.0","cross-var":"1.1.0","ts-loader":"9.5.1","typescript":"4.4.4","@babel/core":"7.24.6","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"5.1.4","@types/mocha":"10.0.6","@types/sinon":"17.0.3","karma-webpack":"5.0.1","webpack-merge":"5.10.0","karma-coverage":"2.2.1","@babel/preset-env":"7.24.6","@opentelemetry/api":">=1.3.0 <1.10.0","@types/lodash.merge":"4.6.9","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"6.1.1","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.10.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.25.0_1717607758345_0.42159719696026543","host":"s3://npm-registry-packages"}},"1.25.1":{"name":"@opentelemetry/sdk-metrics","version":"1.25.1","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.25.1","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"50c985ec15557a9654334e7fa1018dc47a8a56b7","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.25.1.tgz","fileCount":561,"integrity":"sha512-9Mb7q5ioFL4E4dDrc4wC/A3NTHDat44v4I3p2pLPSxRvqUbDIQyMVr9uK+EU69+HWhlET1VaSrRzwdckWqY15Q==","signatures":[{"sig":"MEUCIQCNZXU0MM/EDXNSq8ZV/6psCW97vGmYrurc/e/iYg7LOAIgS3/fl7W9LtXeIauAqM5ZL24hsmc39zaKuX+90I3Edn8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1914152},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"0608f405573901e54db01e44c533009cf28be262","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","align-api-deps":"node ../../scripts/align-api-deps.js","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.6.2/node@v18.19.0+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.19.0","dependencies":{"lodash.merge":"^4.6.2","@opentelemetry/core":"1.25.1","@opentelemetry/resources":"1.25.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.3","lerna":"6.6.2","mocha":"10.2.0","sinon":"15.1.2","codecov":"3.8.3","webpack":"5.89.0","ts-mocha":"10.0.0","cross-var":"1.1.0","ts-loader":"9.5.1","typescript":"4.4.4","@babel/core":"7.24.7","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"5.1.4","@types/mocha":"10.0.6","@types/sinon":"17.0.3","karma-webpack":"5.0.1","webpack-merge":"5.10.0","karma-coverage":"2.2.1","@babel/preset-env":"7.24.7","@opentelemetry/api":">=1.3.0 <1.10.0","@types/lodash.merge":"4.6.9","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"6.1.1","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.10.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.25.1_1718875163722_0.02638450999168529","host":"s3://npm-registry-packages"}},"1.26.0":{"name":"@opentelemetry/sdk-metrics","version":"1.26.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.26.0","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"37bb0afb1d4447f50aab9cdd05db6f2d8b86103e","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.26.0.tgz","fileCount":561,"integrity":"sha512-0SvDXmou/JjzSDOjUmetAAvcKQW6ZrvosU0rkbDGpXvvZN+pQF6JbK/Kd4hNdK4q/22yeruqvukXEJyySTzyTQ==","signatures":[{"sig":"MEQCICUUc6/yySv2TiNLcq7AT6pbNR/Hi6zEZwTkoKabjKDXAiBJffQVgekh2F9ABx6OLgxEpstV/+ZyN55vBGwjKtK3bg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1922196},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"720bc8c70d47029cb6b41a34ffdc3d25cbaa2f80","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc mocha 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","align-api-deps":"node ../../scripts/align-api-deps.js","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.6.2/node@v18.20.4+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.20.4","dependencies":{"@opentelemetry/core":"1.26.0","@opentelemetry/resources":"1.26.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.4","lerna":"6.6.2","mocha":"10.7.3","sinon":"15.1.2","codecov":"3.8.3","webpack":"5.89.0","cross-var":"1.1.0","ts-loader":"9.5.1","typescript":"4.4.4","@babel/core":"7.25.2","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"5.1.4","@types/mocha":"10.0.7","@types/sinon":"17.0.3","karma-webpack":"5.0.1","webpack-merge":"5.10.0","karma-coverage":"2.2.1","@babel/preset-env":"7.25.3","@opentelemetry/api":">=1.3.0 <1.10.0","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"7.0.0","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.10.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.26.0_1724836642462_0.8363214110577704","host":"s3://npm-registry-packages"}},"1.27.0":{"name":"@opentelemetry/sdk-metrics","version":"1.27.0","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/sdk-metrics@1.27.0","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"fb4f55017dc95a95ee00260262952b18e3e7c25c","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.27.0.tgz","fileCount":561,"integrity":"sha512-JzWgzlutoXCydhHWIbLg+r76m+m3ncqvkCcsswXAQ4gqKS+LOHKhq+t6fx1zNytvLuaOUBur7EvWxECc4jPQKg==","signatures":[{"sig":"MEQCICee8j7NTKwwuMDYrj9aQl8y/q4kq6aAAzlgQtPxV3QOAiBvOudBQcJ+lEOSc3vaMLEPFzNp4YjETGVxdyID8KO5GQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@opentelemetry%2fsdk-metrics@1.27.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":1920417},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","engines":{"node":">=14"},"gitHead":"eb3ca4fb07ee31c62093f5fcec56575573c902ce","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc mocha 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"node ../../scripts/version-update.js","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","tdd:browser":"karma start","test:browser":"karma start --single-run","align-api-deps":"node ../../scripts/align-api-deps.js","peer-api-check":"node ../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.6.2/node@v18.20.4+x64 (linux)","description":"OpenTelemetry metrics SDK","directories":{},"sideEffects":false,"_nodeVersion":"18.20.4","dependencies":{"@opentelemetry/core":"1.27.0","@opentelemetry/resources":"1.27.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","karma":"6.4.4","lerna":"6.6.2","mocha":"10.7.3","sinon":"15.1.2","webpack":"5.94.0","cross-var":"1.1.0","ts-loader":"9.5.1","typescript":"4.4.4","@babel/core":"7.25.2","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"5.1.4","@types/mocha":"10.0.8","@types/sinon":"17.0.3","karma-webpack":"5.0.1","webpack-merge":"5.10.0","karma-coverage":"2.2.1","@babel/preset-env":"7.25.4","@opentelemetry/api":">=1.3.0 <1.10.0","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"7.0.0","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.10.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-metrics_1.27.0_1729695104075_0.2954021766849051","host":"s3://npm-registry-packages"}},"1.28.0":{"name":"@opentelemetry/sdk-metrics","version":"1.28.0","description":"OpenTelemetry metrics SDK","main":"build/src/index.js","module":"build/esm/index.js","esnext":"build/esnext/index.js","types":"build/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/open-telemetry/opentelemetry-js.git"},"scripts":{"prepublishOnly":"npm run compile","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","test":"nyc mocha 'test/**/*.test.ts'","test:browser":"karma start --single-run","tdd":"npm run test -- --watch-extensions ts --watch","tdd:browser":"karma start","lint":"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix","version":"node ../../scripts/version-update.js","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","prewatch":"node ../../scripts/version-update.js","peer-api-check":"node ../../scripts/peer-api-check.js","align-api-deps":"node ../../scripts/align-api-deps.js"},"keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","engines":{"node":">=14"},"publishConfig":{"access":"public"},"devDependencies":{"@babel/core":"7.26.0","@babel/preset-env":"7.26.0","@opentelemetry/api":">=1.3.0 <1.10.0","@types/mocha":"10.0.9","@types/node":"18.6.5","@types/sinon":"17.0.3","babel-plugin-istanbul":"7.0.0","cross-var":"1.1.0","karma":"6.4.4","karma-chrome-launcher":"3.1.0","karma-coverage":"2.2.1","karma-mocha":"2.0.1","karma-spec-reporter":"0.0.36","karma-webpack":"5.0.1","lerna":"6.6.2","mocha":"10.8.2","nyc":"15.1.0","sinon":"15.1.2","ts-loader":"9.5.1","typescript":"4.4.4","webpack":"5.96.1","webpack-cli":"5.1.4","webpack-merge":"5.10.0"},"peerDependencies":{"@opentelemetry/api":">=1.3.0 <1.10.0"},"dependencies":{"@opentelemetry/core":"1.28.0","@opentelemetry/resources":"1.28.0"},"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","sideEffects":false,"gitHead":"4b1ad3fda0cde58907e30fab25c3c767546708e5","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"_id":"@opentelemetry/sdk-metrics@1.28.0","_nodeVersion":"18.20.4","_npmVersion":"lerna/6.6.2/node@v18.20.4+x64 (linux)","dist":{"integrity":"sha512-43tqMK/0BcKTyOvm15/WQ3HLr0Vu/ucAl/D84NO7iSlv6O4eOprxSHa3sUtmYkaZWHqdDJV0AHVz/R6u4JALVQ==","shasum":"257b5295bbe9de1ad31c5e8cb43a660c25911d20","tarball":"https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.28.0.tgz","fileCount":561,"unpackedSize":1922324,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@opentelemetry%2fsdk-metrics@1.28.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH/Z6d+HyDNtyNUtpuzVdAyqhlTCfvqGItbZ06UPzbGwAiEA1ZqqIIyQTA5ZM/DN/dHtZc0GZcZv5TtaAtdiIAF0eZI="}]},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"directories":{},"maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk-metrics_1.28.0_1731926513320_0.5425586601271688"},"_hasShrinkwrap":false}},"time":{"created":"2022-08-24T17:44:35.369Z","modified":"2024-11-18T10:41:53.964Z","0.32.0":"2022-08-24T17:44:35.717Z","0.33.0":"2022-09-16T12:14:58.301Z","1.8.0":"2022-11-09T19:45:34.297Z","1.9.0":"2023-01-11T21:46:29.914Z","1.9.1":"2023-01-30T15:30:13.362Z","1.10.0":"2023-03-13T15:53:55.612Z","1.10.1":"2023-03-20T16:10:34.822Z","1.11.0":"2023-03-30T15:30:56.074Z","1.12.0":"2023-04-13T18:13:01.808Z","1.13.0":"2023-05-11T13:30:07.116Z","1.14.0":"2023-06-06T06:00:55.809Z","1.15.0":"2023-07-06T11:27:09.167Z","1.15.1":"2023-07-24T14:32:49.159Z","1.15.2":"2023-08-08T13:21:18.974Z","1.16.0":"2023-09-11T12:14:31.689Z","1.17.0":"2023-09-12T13:12:34.838Z","1.17.1":"2023-10-10T14:18:19.024Z","1.18.0":"2023-11-07T10:44:47.115Z","1.18.1":"2023-11-08T18:09:09.980Z","1.19.0":"2023-12-14T12:35:30.166Z","1.20.0":"2024-01-15T10:15:47.729Z","1.21.0":"2024-01-26T06:11:10.039Z","1.22.0":"2024-02-29T09:18:14.841Z","1.23.0":"2024-04-03T08:10:06.050Z","1.24.0":"2024-04-24T14:39:45.460Z","1.24.1":"2024-05-07T14:52:39.090Z","1.25.0":"2024-06-05T17:15:58.569Z","1.25.1":"2024-06-20T09:19:23.925Z","1.26.0":"2024-08-28T09:17:22.703Z","1.27.0":"2024-10-23T14:51:44.571Z","1.28.0":"2024-11-18T10:41:53.564Z"},"bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics","keywords":["opentelemetry","nodejs","metrics","stats","profiling"],"repository":{"type":"git","url":"git+https://github.com/open-telemetry/opentelemetry-js.git"},"description":"OpenTelemetry metrics SDK","maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"readme":"# OpenTelemetry Metrics SDK\n\n[![NPM Published Version][npm-img]][npm-url]\n[![Apache License][license-image]][license-image]\n\nThis module contains the Metrics SDK of [opentelemetry-js](https://github.com/open-telemetry/opentelemetry-js).\n\nUsed standalone, this module provides methods for manual instrumentation of code, offering full control over recording metrics for client-side JavaScript (browser) and Node.js.\n\nIt does **not** provide automated instrumentation of known libraries or host environment metrics out-of-the-box.\n\n## Installation\n\n```bash\nnpm install --save @opentelemetry/api\nnpm install --save @opentelemetry/sdk-metrics\n```\n\n## Usage\n\nThe basic setup of the SDK can be seen as followings:\n\n```js\nconst opentelemetry = require('@opentelemetry/api');\nconst { MeterProvider } = require('@opentelemetry/sdk-metrics');\n\n// To create an instrument, you first need to initialize the Meter provider.\n// NOTE: The default OpenTelemetry meter provider does not record any metric instruments.\n// Registering a working meter provider allows the API methods to record instruments.\nopentelemetry.metrics.setGlobalMeterProvider(new MeterProvider());\n\n// To record a metric event, we used the global singleton meter to create an instrument.\nconst counter = opentelemetry.metrics.getMeter('default').createCounter('foo');\n\n// record a metric event.\ncounter.add(1, { attributeKey: 'attribute-value' });\n```\n\nIn conditions, we may need to setup an async instrument to observe costly events:\n\n```js\n// Creating an async instrument, similar to synchronous instruments\nconst observableCounter = opentelemetry.metrics.getMeter('default')\n .createObservableCounter('observable-counter');\n\n// Register a single-instrument callback to the async instrument.\nobservableCounter.addCallback(async (observableResult) => {\n // ... do async stuff\n observableResult.observe(1, { attributeKey: 'attribute-value' });\n});\n\n// Register a multi-instrument callback and associate it with a set of async instruments.\nopentelemetry.metrics.getMeter('default')\n .addBatchObservableCallback(batchObservableCallback, [ observableCounter ]);\nasync function batchObservableCallback(batchObservableResult) {\n // ... do async stuff\n batchObservableResult.observe(observableCounter, 1, { attributeKey: 'attribute-value' });\n}\n```\n\nViews can be registered when instantiating a `MeterProvider`:\n\n```js\nconst meterProvider = new MeterProvider({\n views: [\n // override the bucket boundaries on `my.histogram` to [0, 50, 100]\n new View({ aggregation: new ExplicitBucketHistogramAggregation([0, 50, 100]), instrumentName: 'my.histogram'}),\n // rename 'my.counter' to 'my.renamed.counter'\n new View({ name: 'my.renamed.counter', instrumentName: 'my.counter'})\n ]\n})\n```\n\n## Example\n\nSee [examples/prometheus](https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/examples/prometheus) for an end-to-end example, including exporting metrics.\n\n## Useful links\n\n- For more information on OpenTelemetry, visit: \n- For more about OpenTelemetry JavaScript: \n- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]\n\n## License\n\nApache 2.0 - See [LICENSE][license-url] for more information.\n\n[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions\n[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE\n[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat\n[npm-url]: https://www.npmjs.com/package/@opentelemetry/sdk-metrics\n[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fsdk%2Dmetrics.svg\n","readmeFilename":"README.md"} \ No newline at end of file diff --git a/tests/specs/cli/otel_basic/__test__.jsonc b/tests/specs/cli/otel_basic/__test__.jsonc index 991413c3d5..05e23d32e9 100644 --- a/tests/specs/cli/otel_basic/__test__.jsonc +++ b/tests/specs/cli/otel_basic/__test__.jsonc @@ -15,6 +15,10 @@ { "args": "run -A main.ts uncaught.ts", "output": "uncaught.out" + }, + { + "args": "run -A main.ts metric.ts", + "output": "metric.out" } ] } diff --git a/tests/specs/cli/otel_basic/basic.out b/tests/specs/cli/otel_basic/basic.out index 88296a7c04..1e82ba59b3 100644 --- a/tests/specs/cli/otel_basic/basic.out +++ b/tests/specs/cli/otel_basic/basic.out @@ -188,5 +188,6 @@ "traceId": "00000000000000000000000000000003", "spanId": "1000000000000002" } - ] + ], + "metrics": [] } diff --git a/tests/specs/cli/otel_basic/deno_dot_exit.out b/tests/specs/cli/otel_basic/deno_dot_exit.out index 98a41cf606..025fdfc874 100644 --- a/tests/specs/cli/otel_basic/deno_dot_exit.out +++ b/tests/specs/cli/otel_basic/deno_dot_exit.out @@ -15,5 +15,6 @@ "traceId": "", "spanId": "" } - ] + ], + "metrics": [] } diff --git a/tests/specs/cli/otel_basic/main.ts b/tests/specs/cli/otel_basic/main.ts index bdbae0cc0e..ccba126cc1 100644 --- a/tests/specs/cli/otel_basic/main.ts +++ b/tests/specs/cli/otel_basic/main.ts @@ -3,6 +3,7 @@ const data = { spans: [], logs: [], + metrics: [], }; const server = Deno.serve( @@ -45,6 +46,11 @@ const server = Deno.serve( data.spans.push(...sSpans.spans); }); }); + body.resourceMetrics?.forEach((rMetrics) => { + rMetrics.scopeMetrics.forEach((sMetrics) => { + data.metrics.push(...sMetrics.metrics); + }); + }); return Response.json({ partialSuccess: {} }, { status: 200 }); }, }, diff --git a/tests/specs/cli/otel_basic/metric.out b/tests/specs/cli/otel_basic/metric.out new file mode 100644 index 0000000000..26ed4a23c6 --- /dev/null +++ b/tests/specs/cli/otel_basic/metric.out @@ -0,0 +1,124 @@ +{ + "spans": [], + "logs": [], + "metrics": [ + { + "name": "counter", + "description": "Example of a Counter", + "unit": "", + "metadata": [], + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "attribute", + "value": { + "doubleValue": 1 + } + } + ], + "startTimeUnixNano": "[WILDCARD]", + "timeUnixNano": "[WILDCARD]", + "exemplars": [], + "flags": 0, + "asDouble": 1 + } + ], + "aggregationTemporality": 2, + "isMonotonic": true + } + }, + { + "name": "up_down_counter", + "description": "Example of a UpDownCounter", + "unit": "", + "metadata": [], + "sum": { + "dataPoints": [ + { + "attributes": [ + { + "key": "attribute", + "value": { + "doubleValue": 1 + } + } + ], + "startTimeUnixNano": "[WILDCARD]", + "timeUnixNano": "[WILDCARD]", + "exemplars": [], + "flags": 0, + "asDouble": -1 + } + ], + "aggregationTemporality": 2, + "isMonotonic": false + } + }, + { + "name": "histogram", + "description": "Example of a Histogram", + "unit": "", + "metadata": [], + "histogram": { + "dataPoints": [ + { + "attributes": [ + { + "key": "attribute", + "value": { + "doubleValue": 1 + } + } + ], + "startTimeUnixNano": "[WILDCARD]", + "timeUnixNano": "[WILDCARD]", + "count": 1, + "sum": 1, + "bucketCounts": [ + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "explicitBounds": [ + 0, + 5, + 10, + 25, + 50, + 75, + 100, + 250, + 500, + 750, + 1000, + 2500, + 5000, + 7500, + 10000 + ], + "exemplars": [], + "flags": 0, + "min": 1, + "max": 1 + } + ], + "aggregationTemporality": 2 + } + } + ] +} diff --git a/tests/specs/cli/otel_basic/metric.ts b/tests/specs/cli/otel_basic/metric.ts new file mode 100644 index 0000000000..7d332f0432 --- /dev/null +++ b/tests/specs/cli/otel_basic/metric.ts @@ -0,0 +1,34 @@ +import { + MeterProvider, + PeriodicExportingMetricReader, +} from "npm:@opentelemetry/sdk-metrics@1.28.0"; + +const meterProvider = new MeterProvider(); + +meterProvider.addMetricReader( + new PeriodicExportingMetricReader({ + exporter: new Deno.telemetry.MetricExporter(), + exportIntervalMillis: 100, + }), +); + +const meter = meterProvider.getMeter("m"); + +const counter = meter.createCounter("counter", { + description: "Example of a Counter", +}); + +const upDownCounter = meter.createUpDownCounter("up_down_counter", { + description: "Example of a UpDownCounter", +}); + +const histogram = meter.createHistogram("histogram", { + description: "Example of a Histogram", +}); + +const attributes = { attribute: 1 }; +counter.add(1, attributes); +upDownCounter.add(-1, attributes); +histogram.record(1, attributes); + +await meterProvider.forceFlush(); diff --git a/tests/specs/cli/otel_basic/natural_exit.out b/tests/specs/cli/otel_basic/natural_exit.out index 98a41cf606..025fdfc874 100644 --- a/tests/specs/cli/otel_basic/natural_exit.out +++ b/tests/specs/cli/otel_basic/natural_exit.out @@ -15,5 +15,6 @@ "traceId": "", "spanId": "" } - ] + ], + "metrics": [] } diff --git a/tests/specs/cli/otel_basic/uncaught.out b/tests/specs/cli/otel_basic/uncaught.out index a5a886bfeb..4ff08e6dba 100644 --- a/tests/specs/cli/otel_basic/uncaught.out +++ b/tests/specs/cli/otel_basic/uncaught.out @@ -33,5 +33,6 @@ throw new Error("uncaught"); "traceId": "", "spanId": "" } - ] + ], + "metrics": [] } From 76571fd5a5ae0ebd31e10ed5bcea5e44c51621d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 2 Dec 2024 21:53:00 +0000 Subject: [PATCH 200/227] chore: upgrade deno_lint to 0.68.2 (#27197) --- Cargo.lock | 4 ++-- cli/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9e000ddafc..09e63cbb3d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1803,9 +1803,9 @@ dependencies = [ [[package]] name = "deno_lint" -version = "0.68.1" +version = "0.68.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce2a040657166e39c7d59ad34230f0cc829f8ea8b7b2377038cc012ec1a1ef16" +checksum = "ce713d564f76efd90535061113210bdc6b942ed6327b33eb1d5f76a5daf8e7a5" dependencies = [ "anyhow", "deno_ast", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index ac093a7238..728f6726b5 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -74,7 +74,7 @@ deno_config.workspace = true deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_doc = { version = "=0.161.2", features = ["rust", "comrak"] } deno_graph = { version = "=0.86.3" } -deno_lint = { version = "=0.68.1", features = ["docs"] } +deno_lint = { version = "=0.68.2", features = ["docs"] } deno_lockfile.workspace = true deno_npm.workspace = true deno_package_json.workspace = true From 53936eda11ba0b2e9845d940772be774750e1184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 3 Dec 2024 01:04:55 +0000 Subject: [PATCH 201/227] fix(fmt): stable formatting of HTML files with JS (#27164) Closes https://github.com/denoland/deno/issues/26407 Closes https://github.com/denoland/deno/issues/26763 Closes https://github.com/denoland/deno/issues/26560 Closes https://github.com/denoland/deno/issues/26744 Closes https://github.com/denoland/deno/issues/27030 --- Cargo.lock | 4 ++-- cli/Cargo.toml | 2 +- cli/tools/fmt.rs | 19 ++++++++++++++----- tests/specs/fmt/html/__test__.jsonc | 4 ++++ tests/specs/fmt/html/with_js.html | 9 +++++++++ 5 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 tests/specs/fmt/html/with_js.html diff --git a/Cargo.lock b/Cargo.lock index 09e63cbb3d..f9288c9eb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4682,9 +4682,9 @@ dependencies = [ [[package]] name = "markup_fmt" -version = "0.16.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f303c36143671ac6c54112eb5aa95649b169dae783fdb6ead2c0e88b408c425c" +checksum = "fa7605bb4ad755a9ab5c96f2ce3bfd4eb8acd559b842c041fc8a5f84d63aed3a" dependencies = [ "aho-corasick", "css_dataset", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 728f6726b5..2012c90dfb 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -130,7 +130,7 @@ libz-sys.workspace = true log = { workspace = true, features = ["serde"] } lsp-types.workspace = true malva = "=0.11.0" -markup_fmt = "=0.16.0" +markup_fmt = "=0.18.0" memmem.workspace = true monch.workspace = true notify.workspace = true diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index c2c2a6bb6b..e29627345c 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -440,8 +440,10 @@ pub fn format_html( ) } _ => { - let mut typescript_config = - get_resolved_typescript_config(fmt_options); + let mut typescript_config_builder = + get_typescript_config_builder(fmt_options); + typescript_config_builder.file_indent_level(hints.indent_level); + let mut typescript_config = typescript_config_builder.build(); typescript_config.line_width = hints.print_width as u32; dprint_plugin_typescript::format_text( &path, @@ -919,9 +921,9 @@ fn files_str(len: usize) -> &'static str { } } -fn get_resolved_typescript_config( +fn get_typescript_config_builder( options: &FmtOptionsConfig, -) -> dprint_plugin_typescript::configuration::Configuration { +) -> dprint_plugin_typescript::configuration::ConfigurationBuilder { let mut builder = dprint_plugin_typescript::configuration::ConfigurationBuilder::new(); builder.deno(); @@ -953,7 +955,13 @@ fn get_resolved_typescript_config( }); } - builder.build() + builder +} + +fn get_resolved_typescript_config( + options: &FmtOptionsConfig, +) -> dprint_plugin_typescript::configuration::Configuration { + get_typescript_config_builder(options).build() } fn get_resolved_markdown_config( @@ -1075,6 +1083,7 @@ fn get_resolved_markup_fmt_config( }; let language_options = LanguageOptions { + script_formatter: Some(markup_fmt::config::ScriptFormatter::Dprint), quotes: Quotes::Double, format_comments: false, script_indent: true, diff --git a/tests/specs/fmt/html/__test__.jsonc b/tests/specs/fmt/html/__test__.jsonc index 2e6d08d4cc..96b7f4ed92 100644 --- a/tests/specs/fmt/html/__test__.jsonc +++ b/tests/specs/fmt/html/__test__.jsonc @@ -12,6 +12,10 @@ "broken": { "args": "fmt broken.html", "output": "broken.out" + }, + "with_js": { + "args": "fmt --check with_js.html", + "output": "Checked 1 file\n" } } } diff --git a/tests/specs/fmt/html/with_js.html b/tests/specs/fmt/html/with_js.html new file mode 100644 index 0000000000..d956c6728b --- /dev/null +++ b/tests/specs/fmt/html/with_js.html @@ -0,0 +1,9 @@ + + + + + From 70d69a88288a0ec05947a0fa385eb661011e9947 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 2 Dec 2024 20:37:40 -0500 Subject: [PATCH 202/227] chore: fix cjs_with_deps test to use a temp dir (#27199) It was creating a node_modules directory. --- tests/specs/npm/cjs_with_deps/__test__.jsonc | 1 + tests/specs/npm/cjs_with_deps/main_info.out | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/specs/npm/cjs_with_deps/__test__.jsonc b/tests/specs/npm/cjs_with_deps/__test__.jsonc index a09f172053..7441b5509f 100644 --- a/tests/specs/npm/cjs_with_deps/__test__.jsonc +++ b/tests/specs/npm/cjs_with_deps/__test__.jsonc @@ -1,4 +1,5 @@ { + "tempDir": true, "tests": { "cjs_with_deps": { "args": "run --allow-read --allow-env main.js", diff --git a/tests/specs/npm/cjs_with_deps/main_info.out b/tests/specs/npm/cjs_with_deps/main_info.out index 8e37c88eb0..f1271ec1f1 100644 --- a/tests/specs/npm/cjs_with_deps/main_info.out +++ b/tests/specs/npm/cjs_with_deps/main_info.out @@ -3,7 +3,7 @@ type: JavaScript dependencies: 14 unique size: [WILDCARD] -file:///[WILDCARD]/cjs_with_deps/main.js ([WILDCARD]) +file:///[WILDCARD]/main.js ([WILDCARD]) ├─┬ npm:/chalk@4.1.2 ([WILDCARD]) │ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) │ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) From c1dcf1b618e87f1a50869fffe38b473a77377fe8 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 2 Dec 2024 21:10:16 -0500 Subject: [PATCH 203/227] refactor: add deno_npm_cache crate (#27200) Extracting out more code from the CLI for reuse elsewhere (still more work to do, but this is a start). This is the code for extracting npm tarballs and saving information in the npm cache in the global deno_dir. --- Cargo.lock | 35 ++- Cargo.toml | 3 + cli/Cargo.toml | 1 + cli/args/mod.rs | 28 ++- cli/npm/managed/mod.rs | 73 +++--- cli/npm/managed/registry.rs | 23 +- cli/npm/managed/resolvers/common.rs | 4 +- cli/npm/managed/resolvers/global.rs | 12 +- cli/npm/managed/resolvers/local.rs | 16 +- cli/npm/managed/resolvers/mod.rs | 8 +- cli/npm/mod.rs | 111 ++++++++- cli/util/path.rs | 13 -- cli/util/sync/mod.rs | 2 - cli/util/sync/value_creator.rs | 213 ------------------ resolvers/npm_cache/Cargo.toml | 42 ++++ resolvers/npm_cache/README.md | 6 + .../mod.rs => resolvers/npm_cache/lib.rs | 130 ++++++++--- .../npm_cache}/registry_info.rs | 71 +++--- .../npm_cache/remote.rs | 6 +- .../cache => resolvers/npm_cache}/tarball.rs | 76 +++---- .../npm_cache}/tarball_extract.rs | 45 ++-- resolvers/npm_cache/todo.md | 9 + 22 files changed, 492 insertions(+), 435 deletions(-) delete mode 100644 cli/util/sync/value_creator.rs create mode 100644 resolvers/npm_cache/Cargo.toml create mode 100644 resolvers/npm_cache/README.md rename cli/npm/managed/cache/mod.rs => resolvers/npm_cache/lib.rs (71%) rename {cli/npm/managed/cache => resolvers/npm_cache}/registry_info.rs (84%) rename cli/npm/common.rs => resolvers/npm_cache/remote.rs (95%) rename {cli/npm/managed/cache => resolvers/npm_cache}/tarball.rs (77%) rename {cli/npm/managed/cache => resolvers/npm_cache}/tarball_extract.rs (90%) create mode 100644 resolvers/npm_cache/todo.md diff --git a/Cargo.lock b/Cargo.lock index f9288c9eb5..28548ab84c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1220,6 +1220,7 @@ dependencies = [ "deno_lint", "deno_lockfile", "deno_npm", + "deno_npm_cache", "deno_package_json", "deno_path_util", "deno_resolver", @@ -1998,6 +1999,35 @@ dependencies = [ "url", ] +[[package]] +name = "deno_npm_cache" +version = "0.0.1" +dependencies = [ + "anyhow", + "async-trait", + "base64 0.21.7", + "boxed_error", + "deno_cache_dir", + "deno_core", + "deno_npm", + "deno_semver", + "deno_unsync", + "faster-hex", + "flate2", + "futures", + "http 1.1.0", + "log", + "parking_lot", + "percent-encoding", + "rand", + "ring", + "serde_json", + "tar", + "tempfile", + "thiserror 1.0.64", + "url", +] + [[package]] name = "deno_ops" version = "0.199.0" @@ -2260,10 +2290,11 @@ dependencies = [ [[package]] name = "deno_unsync" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f36b4ef61a04ce201b925a5dffa90f88437d37fee4836c758470dd15ba7f05e" +checksum = "d774fd83f26b24f0805a6ab8b26834a0d06ceac0db517b769b1e4633c96a2057" dependencies = [ + "futures", "parking_lot", "tokio", ] diff --git a/Cargo.toml b/Cargo.toml index 068046607f..23670beec3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,6 +30,7 @@ members = [ "ext/webstorage", "resolvers/deno", "resolvers/node", + "resolvers/npm_cache", "runtime", "runtime/permissions", "tests", @@ -93,6 +94,7 @@ deno_websocket = { version = "0.185.0", path = "./ext/websocket" } deno_webstorage = { version = "0.175.0", path = "./ext/webstorage" } # resolvers +deno_npm_cache = { version = "0.0.1", path = "./resolvers/npm_cache" } deno_resolver = { version = "0.12.0", path = "./resolvers/deno" } node_resolver = { version = "0.19.0", path = "./resolvers/node" } @@ -117,6 +119,7 @@ data-encoding = "2.3.3" data-url = "=0.3.0" deno_cache_dir = "=0.14.0" deno_package_json = { version = "0.2.1", default-features = false } +deno_unsync = "0.4.2" dlopen2 = "0.6.1" ecb = "=0.1.2" elliptic-curve = { version = "0.13.4", features = ["alloc", "arithmetic", "ecdh", "std", "pem", "jwk"] } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 2012c90dfb..4a343ce747 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -77,6 +77,7 @@ deno_graph = { version = "=0.86.3" } deno_lint = { version = "=0.68.2", features = ["docs"] } deno_lockfile.workspace = true deno_npm.workspace = true +deno_npm_cache.workspace = true deno_package_json.workspace = true deno_path_util.workspace = true deno_resolver.workspace = true diff --git a/cli/args/mod.rs b/cli/args/mod.rs index fb576a8c3e..0b049cf409 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -27,6 +27,7 @@ use deno_npm::npm_rc::NpmRc; use deno_npm::npm_rc::ResolvedNpmRc; use deno_npm::resolution::ValidSerializedNpmResolutionSnapshot; use deno_npm::NpmSystemInfo; +use deno_npm_cache::NpmCacheSetting; use deno_path_util::normalize_path; use deno_semver::npm::NpmPackageReqReference; use deno_telemetry::OtelConfig; @@ -238,20 +239,25 @@ pub enum CacheSetting { } impl CacheSetting { - pub fn should_use_for_npm_package(&self, package_name: &str) -> bool { + pub fn as_npm_cache_setting(&self) -> NpmCacheSetting { match self { - CacheSetting::ReloadAll => false, - CacheSetting::ReloadSome(list) => { - if list.iter().any(|i| i == "npm:") { - return false; + CacheSetting::Only => NpmCacheSetting::Only, + CacheSetting::ReloadAll => NpmCacheSetting::ReloadAll, + CacheSetting::ReloadSome(values) => { + if values.iter().any(|v| v == "npm:") { + NpmCacheSetting::ReloadAll + } else { + NpmCacheSetting::ReloadSome { + npm_package_names: values + .iter() + .filter_map(|v| v.strip_prefix("npm:")) + .map(|n| n.to_string()) + .collect(), + } } - let specifier = format!("npm:{package_name}"); - if list.contains(&specifier) { - return false; - } - true } - _ => true, + CacheSetting::RespectHeaders => unreachable!(), // not supported + CacheSetting::Use => NpmCacheSetting::Use, } } } diff --git a/cli/npm/managed/mod.rs b/cli/npm/managed/mod.rs index 88094d5141..da39f55e85 100644 --- a/cli/npm/managed/mod.rs +++ b/cli/npm/managed/mod.rs @@ -5,8 +5,6 @@ use std::path::Path; use std::path::PathBuf; use std::sync::Arc; -use cache::RegistryInfoDownloader; -use cache::TarballCache; use deno_ast::ModuleSpecifier; use deno_cache_dir::npm::NpmCacheDir; use deno_core::anyhow::Context; @@ -42,22 +40,23 @@ use crate::args::NpmProcessState; use crate::args::NpmProcessStateKind; use crate::args::PackageJsonDepValueParseWithLocationError; use crate::cache::FastInsecureHasher; -use crate::http_util::HttpClientProvider; use crate::util::fs::canonicalize_path_maybe_not_exists_with_fs; use crate::util::progress_bar::ProgressBar; use crate::util::sync::AtomicFlag; -use self::cache::NpmCache; use self::registry::CliNpmRegistryApi; use self::resolution::NpmResolution; use self::resolvers::create_npm_fs_resolver; use self::resolvers::NpmPackageFsResolver; +use super::CliNpmCache; +use super::CliNpmCacheEnv; +use super::CliNpmRegistryInfoProvider; use super::CliNpmResolver; +use super::CliNpmTarballCache; use super::InnerCliNpmResolverRef; use super::ResolvePkgFolderFromDenoReqError; -pub mod cache; mod registry; mod resolution; mod resolvers; @@ -85,8 +84,9 @@ pub struct CliManagedNpmResolverCreateOptions { pub async fn create_managed_npm_resolver_for_lsp( options: CliManagedNpmResolverCreateOptions, ) -> Arc { - let npm_cache = create_cache(&options); - let npm_api = create_api(&options, npm_cache.clone()); + let cache_env = create_cache_env(&options); + let npm_cache = create_cache(cache_env.clone(), &options); + let npm_api = create_api(npm_cache.clone(), cache_env.clone(), &options); // spawn due to the lsp's `Send` requirement deno_core::unsync::spawn(async move { let snapshot = match resolve_snapshot(&npm_api, options.snapshot).await { @@ -97,8 +97,8 @@ pub async fn create_managed_npm_resolver_for_lsp( } }; create_inner( + cache_env, options.fs, - options.http_client_provider, options.maybe_lockfile, npm_api, npm_cache, @@ -118,12 +118,13 @@ pub async fn create_managed_npm_resolver_for_lsp( pub async fn create_managed_npm_resolver( options: CliManagedNpmResolverCreateOptions, ) -> Result, AnyError> { - let npm_cache = create_cache(&options); - let npm_api = create_api(&options, npm_cache.clone()); + let npm_cache_env = create_cache_env(&options); + let npm_cache = create_cache(npm_cache_env.clone(), &options); + let npm_api = create_api(npm_cache.clone(), npm_cache_env.clone(), &options); let snapshot = resolve_snapshot(&npm_api, options.snapshot).await?; Ok(create_inner( + npm_cache_env, options.fs, - options.http_client_provider, options.maybe_lockfile, npm_api, npm_cache, @@ -139,11 +140,11 @@ pub async fn create_managed_npm_resolver( #[allow(clippy::too_many_arguments)] fn create_inner( + env: Arc, fs: Arc, - http_client_provider: Arc, maybe_lockfile: Option>, npm_api: Arc, - npm_cache: Arc, + npm_cache: Arc, npm_rc: Arc, npm_install_deps_provider: Arc, text_only_progress_bar: crate::util::progress_bar::ProgressBar, @@ -157,12 +158,10 @@ fn create_inner( snapshot, maybe_lockfile.clone(), )); - let tarball_cache = Arc::new(TarballCache::new( + let tarball_cache = Arc::new(CliNpmTarballCache::new( npm_cache.clone(), - fs.clone(), - http_client_provider.clone(), + env, npm_rc.clone(), - text_only_progress_bar.clone(), )); let fs_resolver = create_npm_fs_resolver( fs.clone(), @@ -190,25 +189,39 @@ fn create_inner( )) } -fn create_cache(options: &CliManagedNpmResolverCreateOptions) -> Arc { - Arc::new(NpmCache::new( +fn create_cache_env( + options: &CliManagedNpmResolverCreateOptions, +) -> Arc { + Arc::new(CliNpmCacheEnv::new( + options.fs.clone(), + options.http_client_provider.clone(), + options.text_only_progress_bar.clone(), + )) +} + +fn create_cache( + env: Arc, + options: &CliManagedNpmResolverCreateOptions, +) -> Arc { + Arc::new(CliNpmCache::new( options.npm_cache_dir.clone(), - options.cache_setting.clone(), + options.cache_setting.as_npm_cache_setting(), + env, options.npmrc.clone(), )) } fn create_api( + cache: Arc, + env: Arc, options: &CliManagedNpmResolverCreateOptions, - npm_cache: Arc, ) -> Arc { Arc::new(CliNpmRegistryApi::new( - npm_cache.clone(), - Arc::new(RegistryInfoDownloader::new( - npm_cache, - options.http_client_provider.clone(), + cache.clone(), + Arc::new(CliNpmRegistryInfoProvider::new( + cache, + env, options.npmrc.clone(), - options.text_only_progress_bar.clone(), )), )) } @@ -292,10 +305,10 @@ pub struct ManagedCliNpmResolver { fs_resolver: Arc, maybe_lockfile: Option>, npm_api: Arc, - npm_cache: Arc, + npm_cache: Arc, npm_install_deps_provider: Arc, resolution: Arc, - tarball_cache: Arc, + tarball_cache: Arc, text_only_progress_bar: ProgressBar, npm_system_info: NpmSystemInfo, top_level_install_flag: AtomicFlag, @@ -317,10 +330,10 @@ impl ManagedCliNpmResolver { fs_resolver: Arc, maybe_lockfile: Option>, npm_api: Arc, - npm_cache: Arc, + npm_cache: Arc, npm_install_deps_provider: Arc, resolution: Arc, - tarball_cache: Arc, + tarball_cache: Arc, text_only_progress_bar: ProgressBar, npm_system_info: NpmSystemInfo, lifecycle_scripts: LifecycleScriptsConfig, diff --git a/cli/npm/managed/registry.rs b/cli/npm/managed/registry.rs index 8f15d619b9..b431c77c5d 100644 --- a/cli/npm/managed/registry.rs +++ b/cli/npm/managed/registry.rs @@ -14,27 +14,28 @@ use deno_core::parking_lot::Mutex; use deno_npm::registry::NpmPackageInfo; use deno_npm::registry::NpmRegistryApi; use deno_npm::registry::NpmRegistryPackageInfoLoadError; +use deno_npm_cache::NpmCacheSetting; -use crate::args::CacheSetting; +use crate::npm::CliNpmCache; +use crate::npm::CliNpmRegistryInfoProvider; use crate::util::sync::AtomicFlag; -use super::cache::NpmCache; -use super::cache::RegistryInfoDownloader; - +// todo(#27198): Remove this and move functionality down into +// RegistryInfoProvider, which already does most of this. #[derive(Debug)] pub struct CliNpmRegistryApi(Option>); impl CliNpmRegistryApi { pub fn new( - cache: Arc, - registry_info_downloader: Arc, + cache: Arc, + registry_info_provider: Arc, ) -> Self { Self(Some(Arc::new(CliNpmRegistryApiInner { cache, force_reload_flag: Default::default(), mem_cache: Default::default(), previously_reloaded_packages: Default::default(), - registry_info_downloader, + registry_info_provider, }))) } @@ -83,11 +84,11 @@ enum CacheItem { #[derive(Debug)] struct CliNpmRegistryApiInner { - cache: Arc, + cache: Arc, force_reload_flag: AtomicFlag, mem_cache: Mutex>, previously_reloaded_packages: Mutex>, - registry_info_downloader: Arc, + registry_info_provider: Arc, } impl CliNpmRegistryApiInner { @@ -118,7 +119,7 @@ impl CliNpmRegistryApiInner { return Ok(result); } } - api.registry_info_downloader + api.registry_info_provider .load_package_info(&name) .await .map_err(Arc::new) @@ -159,7 +160,7 @@ impl CliNpmRegistryApiInner { // is disabled or if we're already reloading if matches!( self.cache.cache_setting(), - CacheSetting::Only | CacheSetting::ReloadAll + NpmCacheSetting::Only | NpmCacheSetting::ReloadAll ) { return false; } diff --git a/cli/npm/managed/resolvers/common.rs b/cli/npm/managed/resolvers/common.rs index eee11c7604..332756daa4 100644 --- a/cli/npm/managed/resolvers/common.rs +++ b/cli/npm/managed/resolvers/common.rs @@ -24,7 +24,7 @@ use deno_runtime::deno_fs::FileSystem; use deno_runtime::deno_node::NodePermissions; use node_resolver::errors::PackageFolderResolveError; -use crate::npm::managed::cache::TarballCache; +use crate::npm::CliNpmTarballCache; /// Part of the resolution that interacts with the file system. #[async_trait(?Send)] @@ -140,7 +140,7 @@ impl RegistryReadPermissionChecker { /// Caches all the packages in parallel. pub async fn cache_packages( packages: &[NpmResolutionPackage], - tarball_cache: &Arc, + tarball_cache: &Arc, ) -> Result<(), AnyError> { let mut futures_unordered = futures::stream::FuturesUnordered::new(); for package in packages { diff --git a/cli/npm/managed/resolvers/global.rs b/cli/npm/managed/resolvers/global.rs index f0193e78e9..2b48c3d2fc 100644 --- a/cli/npm/managed/resolvers/global.rs +++ b/cli/npm/managed/resolvers/global.rs @@ -8,6 +8,8 @@ use std::path::PathBuf; use std::sync::Arc; use crate::colors; +use crate::npm::CliNpmCache; +use crate::npm::CliNpmTarballCache; use async_trait::async_trait; use deno_ast::ModuleSpecifier; use deno_core::error::AnyError; @@ -24,8 +26,6 @@ use node_resolver::errors::ReferrerNotFoundError; use crate::args::LifecycleScriptsConfig; use crate::cache::FastInsecureHasher; -use super::super::cache::NpmCache; -use super::super::cache::TarballCache; use super::super::resolution::NpmResolution; use super::common::cache_packages; use super::common::lifecycle_scripts::LifecycleScriptsStrategy; @@ -35,8 +35,8 @@ use super::common::RegistryReadPermissionChecker; /// Resolves packages from the global npm cache. #[derive(Debug)] pub struct GlobalNpmPackageResolver { - cache: Arc, - tarball_cache: Arc, + cache: Arc, + tarball_cache: Arc, resolution: Arc, system_info: NpmSystemInfo, registry_read_permission_checker: RegistryReadPermissionChecker, @@ -45,9 +45,9 @@ pub struct GlobalNpmPackageResolver { impl GlobalNpmPackageResolver { pub fn new( - cache: Arc, + cache: Arc, fs: Arc, - tarball_cache: Arc, + tarball_cache: Arc, resolution: Arc, system_info: NpmSystemInfo, lifecycle_scripts: LifecycleScriptsConfig, diff --git a/cli/npm/managed/resolvers/local.rs b/cli/npm/managed/resolvers/local.rs index ca7867425d..0c279d9e12 100644 --- a/cli/npm/managed/resolvers/local.rs +++ b/cli/npm/managed/resolvers/local.rs @@ -17,6 +17,8 @@ use std::sync::Arc; use crate::args::LifecycleScriptsConfig; use crate::colors; +use crate::npm::CliNpmCache; +use crate::npm::CliNpmTarballCache; use async_trait::async_trait; use deno_ast::ModuleSpecifier; use deno_cache_dir::npm::mixed_case_package_name_decode; @@ -52,8 +54,6 @@ use crate::util::fs::LaxSingleProcessFsFlag; use crate::util::progress_bar::ProgressBar; use crate::util::progress_bar::ProgressMessagePrompt; -use super::super::cache::NpmCache; -use super::super::cache::TarballCache; use super::super::resolution::NpmResolution; use super::common::bin_entries; use super::common::NpmPackageFsResolver; @@ -63,12 +63,12 @@ use super::common::RegistryReadPermissionChecker; /// and resolves packages from it. #[derive(Debug)] pub struct LocalNpmPackageResolver { - cache: Arc, + cache: Arc, fs: Arc, npm_install_deps_provider: Arc, progress_bar: ProgressBar, resolution: Arc, - tarball_cache: Arc, + tarball_cache: Arc, root_node_modules_path: PathBuf, root_node_modules_url: Url, system_info: NpmSystemInfo, @@ -79,12 +79,12 @@ pub struct LocalNpmPackageResolver { impl LocalNpmPackageResolver { #[allow(clippy::too_many_arguments)] pub fn new( - cache: Arc, + cache: Arc, fs: Arc, npm_install_deps_provider: Arc, progress_bar: ProgressBar, resolution: Arc, - tarball_cache: Arc, + tarball_cache: Arc, node_modules_folder: PathBuf, system_info: NpmSystemInfo, lifecycle_scripts: LifecycleScriptsConfig, @@ -284,10 +284,10 @@ fn local_node_modules_package_contents_path( #[allow(clippy::too_many_arguments)] async fn sync_resolution_with_fs( snapshot: &NpmResolutionSnapshot, - cache: &Arc, + cache: &Arc, npm_install_deps_provider: &NpmInstallDepsProvider, progress_bar: &ProgressBar, - tarball_cache: &Arc, + tarball_cache: &Arc, root_node_modules_dir_path: &Path, system_info: &NpmSystemInfo, lifecycle_scripts: &LifecycleScriptsConfig, diff --git a/cli/npm/managed/resolvers/mod.rs b/cli/npm/managed/resolvers/mod.rs index 36d795ee7e..736270749f 100644 --- a/cli/npm/managed/resolvers/mod.rs +++ b/cli/npm/managed/resolvers/mod.rs @@ -12,6 +12,8 @@ use deno_runtime::deno_fs::FileSystem; use crate::args::LifecycleScriptsConfig; use crate::args::NpmInstallDepsProvider; +use crate::npm::CliNpmCache; +use crate::npm::CliNpmTarballCache; use crate::util::progress_bar::ProgressBar; pub use self::common::NpmPackageFsResolver; @@ -19,18 +21,16 @@ pub use self::common::NpmPackageFsResolver; use self::global::GlobalNpmPackageResolver; use self::local::LocalNpmPackageResolver; -use super::cache::NpmCache; -use super::cache::TarballCache; use super::resolution::NpmResolution; #[allow(clippy::too_many_arguments)] pub fn create_npm_fs_resolver( fs: Arc, - npm_cache: Arc, + npm_cache: Arc, npm_install_deps_provider: &Arc, progress_bar: &ProgressBar, resolution: Arc, - tarball_cache: Arc, + tarball_cache: Arc, maybe_node_modules_path: Option, system_info: NpmSystemInfo, lifecycle_scripts: LifecycleScriptsConfig, diff --git a/cli/npm/mod.rs b/cli/npm/mod.rs index 0e955ac5b4..48d90d7dd0 100644 --- a/cli/npm/mod.rs +++ b/cli/npm/mod.rs @@ -1,33 +1,39 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. mod byonm; -mod common; mod managed; use std::borrow::Cow; use std::path::Path; use std::sync::Arc; -use common::maybe_auth_header_for_npm_registry; use dashmap::DashMap; use deno_core::error::AnyError; use deno_core::serde_json; +use deno_core::url::Url; use deno_npm::npm_rc::ResolvedNpmRc; use deno_npm::registry::NpmPackageInfo; use deno_resolver::npm::ByonmInNpmPackageChecker; use deno_resolver::npm::ByonmNpmResolver; use deno_resolver::npm::CliNpmReqResolver; use deno_resolver::npm::ResolvePkgFolderFromDenoReqError; +use deno_runtime::deno_fs::FileSystem; use deno_runtime::deno_node::NodePermissions; use deno_runtime::ops::process::NpmProcessStateProvider; use deno_semver::package::PackageNv; use deno_semver::package::PackageReq; -use managed::cache::registry_info::get_package_url; +use http::HeaderName; +use http::HeaderValue; use managed::create_managed_in_npm_pkg_checker; use node_resolver::InNpmPackageChecker; use node_resolver::NpmPackageFolderResolver; use crate::file_fetcher::FileFetcher; +use crate::http_util::HttpClientProvider; +use crate::util::fs::atomic_write_file_with_retries_and_fs; +use crate::util::fs::hard_link_dir_recursive; +use crate::util::fs::AtomicWriteFileFsAdapter; +use crate::util::progress_bar::ProgressBar; pub use self::byonm::CliByonmNpmResolver; pub use self::byonm::CliByonmNpmResolverCreateOptions; @@ -36,6 +42,99 @@ pub use self::managed::CliManagedNpmResolverCreateOptions; pub use self::managed::CliNpmResolverManagedSnapshotOption; pub use self::managed::ManagedCliNpmResolver; +pub type CliNpmTarballCache = deno_npm_cache::TarballCache; +pub type CliNpmCache = deno_npm_cache::NpmCache; +pub type CliNpmRegistryInfoProvider = + deno_npm_cache::RegistryInfoProvider; + +#[derive(Debug)] +pub struct CliNpmCacheEnv { + fs: Arc, + http_client_provider: Arc, + progress_bar: ProgressBar, +} + +impl CliNpmCacheEnv { + pub fn new( + fs: Arc, + http_client_provider: Arc, + progress_bar: ProgressBar, + ) -> Self { + Self { + fs, + http_client_provider, + progress_bar, + } + } +} + +#[async_trait::async_trait(?Send)] +impl deno_npm_cache::NpmCacheEnv for CliNpmCacheEnv { + fn exists(&self, path: &Path) -> bool { + self.fs.exists_sync(path) + } + + fn hard_link_dir_recursive( + &self, + from: &Path, + to: &Path, + ) -> Result<(), AnyError> { + // todo(dsherret): use self.fs here instead + hard_link_dir_recursive(from, to) + } + + fn atomic_write_file_with_retries( + &self, + file_path: &Path, + data: &[u8], + ) -> std::io::Result<()> { + atomic_write_file_with_retries_and_fs( + &AtomicWriteFileFsAdapter { + fs: self.fs.as_ref(), + write_mode: crate::cache::CACHE_PERM, + }, + file_path, + data, + ) + } + + async fn download_with_retries_on_any_tokio_runtime( + &self, + url: Url, + maybe_auth_header: Option<(HeaderName, HeaderValue)>, + ) -> Result>, deno_npm_cache::DownloadError> { + let guard = self.progress_bar.update(url.as_str()); + let client = self.http_client_provider.get_or_create().map_err(|err| { + deno_npm_cache::DownloadError { + status_code: None, + error: err, + } + })?; + client + .download_with_progress_and_retries(url, maybe_auth_header, &guard) + .await + .map_err(|err| { + use crate::http_util::DownloadError::*; + let status_code = match &err { + Fetch { .. } + | UrlParse { .. } + | HttpParse { .. } + | Json { .. } + | ToStr { .. } + | NoRedirectHeader { .. } + | TooManyRedirects => None, + BadResponse(bad_response_error) => { + Some(bad_response_error.status_code) + } + }; + deno_npm_cache::DownloadError { + status_code, + error: err.into(), + } + }) + } +} + pub enum CliNpmResolverCreateOptions { Managed(CliManagedNpmResolverCreateOptions), Byonm(CliByonmNpmResolverCreateOptions), @@ -179,13 +278,15 @@ impl NpmFetchResolver { if let Some(info) = self.info_by_name.get(name) { return info.value().clone(); } + // todo(#27198): use RegistryInfoProvider instead let fetch_package_info = || async { - let info_url = get_package_url(&self.npmrc, name); + let info_url = deno_npm_cache::get_package_url(&self.npmrc, name); let file_fetcher = self.file_fetcher.clone(); let registry_config = self.npmrc.get_registry_config(name); // TODO(bartlomieju): this should error out, not use `.ok()`. let maybe_auth_header = - maybe_auth_header_for_npm_registry(registry_config).ok()?; + deno_npm_cache::maybe_auth_header_for_npm_registry(registry_config) + .ok()?; // spawn due to the lsp's `Send` requirement let file = deno_core::unsync::spawn(async move { file_fetcher diff --git a/cli/util/path.rs b/cli/util/path.rs index 173f357c08..df66b83766 100644 --- a/cli/util/path.rs +++ b/cli/util/path.rs @@ -51,19 +51,6 @@ pub fn get_extension(file_path: &Path) -> Option { .map(|e| e.to_lowercase()); } -pub fn get_atomic_dir_path(file_path: &Path) -> PathBuf { - let rand = gen_rand_path_component(); - let new_file_name = format!( - ".{}_{}", - file_path - .file_name() - .map(|f| f.to_string_lossy()) - .unwrap_or(Cow::Borrowed("")), - rand - ); - file_path.with_file_name(new_file_name) -} - pub fn get_atomic_file_path(file_path: &Path) -> PathBuf { let rand = gen_rand_path_component(); let extension = format!("{rand}.tmp"); diff --git a/cli/util/sync/mod.rs b/cli/util/sync/mod.rs index 3c2ffbd7dd..c3b2a315b0 100644 --- a/cli/util/sync/mod.rs +++ b/cli/util/sync/mod.rs @@ -3,11 +3,9 @@ mod async_flag; mod sync_read_async_write_lock; mod task_queue; -mod value_creator; pub use async_flag::AsyncFlag; pub use deno_core::unsync::sync::AtomicFlag; pub use sync_read_async_write_lock::SyncReadAsyncWriteLock; pub use task_queue::TaskQueue; pub use task_queue::TaskQueuePermit; -pub use value_creator::MultiRuntimeAsyncValueCreator; diff --git a/cli/util/sync/value_creator.rs b/cli/util/sync/value_creator.rs deleted file mode 100644 index 57aabe801a..0000000000 --- a/cli/util/sync/value_creator.rs +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -use std::sync::Arc; - -use deno_core::futures::future::BoxFuture; -use deno_core::futures::future::LocalBoxFuture; -use deno_core::futures::future::Shared; -use deno_core::futures::FutureExt; -use deno_core::parking_lot::Mutex; -use tokio::task::JoinError; - -type JoinResult = Result>; -type CreateFutureFn = - Box LocalBoxFuture<'static, TResult> + Send + Sync>; - -#[derive(Debug)] -struct State { - retry_index: usize, - future: Option>>>, -} - -/// Attempts to create a shared value asynchronously on one tokio runtime while -/// many runtimes are requesting the value. -/// -/// This is only useful when the value needs to get created once across -/// many runtimes. -/// -/// This handles the case where the tokio runtime creating the value goes down -/// while another one is waiting on the value. -pub struct MultiRuntimeAsyncValueCreator { - create_future: CreateFutureFn, - state: Mutex>, -} - -impl std::fmt::Debug - for MultiRuntimeAsyncValueCreator -{ - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("MultiRuntimeAsyncValueCreator").finish() - } -} - -impl MultiRuntimeAsyncValueCreator { - pub fn new(create_future: CreateFutureFn) -> Self { - Self { - state: Mutex::new(State { - retry_index: 0, - future: None, - }), - create_future, - } - } - - pub async fn get(&self) -> TResult { - let (mut future, mut retry_index) = { - let mut state = self.state.lock(); - let future = match &state.future { - Some(future) => future.clone(), - None => { - let future = self.create_shared_future(); - state.future = Some(future.clone()); - future - } - }; - (future, state.retry_index) - }; - - loop { - let result = future.await; - - match result { - Ok(result) => return result, - Err(join_error) => { - if join_error.is_cancelled() { - let mut state = self.state.lock(); - - if state.retry_index == retry_index { - // we were the first one to retry, so create a new future - // that we'll run from the current runtime - state.retry_index += 1; - state.future = Some(self.create_shared_future()); - } - - retry_index = state.retry_index; - future = state.future.as_ref().unwrap().clone(); - - // just in case we're stuck in a loop - if retry_index > 1000 { - panic!("Something went wrong.") // should never happen - } - } else { - panic!("{}", join_error); - } - } - } - } - } - - fn create_shared_future( - &self, - ) -> Shared>> { - let future = (self.create_future)(); - deno_core::unsync::spawn(future) - .map(|result| result.map_err(Arc::new)) - .boxed() - .shared() - } -} - -#[cfg(test)] -mod test { - use deno_core::unsync::spawn; - - use super::*; - - #[tokio::test] - async fn single_runtime() { - let value_creator = MultiRuntimeAsyncValueCreator::new(Box::new(|| { - async { 1 }.boxed_local() - })); - let value = value_creator.get().await; - assert_eq!(value, 1); - } - - #[test] - fn multi_runtimes() { - let value_creator = - Arc::new(MultiRuntimeAsyncValueCreator::new(Box::new(|| { - async { - tokio::task::yield_now().await; - 1 - } - .boxed_local() - }))); - let handles = (0..3) - .map(|_| { - let value_creator = value_creator.clone(); - std::thread::spawn(|| { - create_runtime().block_on(async move { value_creator.get().await }) - }) - }) - .collect::>(); - for handle in handles { - assert_eq!(handle.join().unwrap(), 1); - } - } - - #[test] - fn multi_runtimes_first_never_finishes() { - let is_first_run = Arc::new(Mutex::new(true)); - let (tx, rx) = std::sync::mpsc::channel::<()>(); - let value_creator = Arc::new(MultiRuntimeAsyncValueCreator::new({ - let is_first_run = is_first_run.clone(); - Box::new(move || { - let is_first_run = is_first_run.clone(); - let tx = tx.clone(); - async move { - let is_first_run = { - let mut is_first_run = is_first_run.lock(); - let initial_value = *is_first_run; - *is_first_run = false; - tx.send(()).unwrap(); - initial_value - }; - if is_first_run { - tokio::time::sleep(std::time::Duration::from_millis(30_000)).await; - panic!("TIMED OUT"); // should not happen - } else { - tokio::task::yield_now().await; - } - 1 - } - .boxed_local() - }) - })); - std::thread::spawn({ - let value_creator = value_creator.clone(); - let is_first_run = is_first_run.clone(); - move || { - create_runtime().block_on(async { - let value_creator = value_creator.clone(); - // spawn a task that will never complete - spawn(async move { value_creator.get().await }); - // wait for the task to set is_first_run to false - while *is_first_run.lock() { - tokio::time::sleep(std::time::Duration::from_millis(20)).await; - } - // now exit the runtime while the value_creator is still pending - }) - } - }); - let handle = { - let value_creator = value_creator.clone(); - std::thread::spawn(|| { - create_runtime().block_on(async move { - let value_creator = value_creator.clone(); - rx.recv().unwrap(); - // even though the other runtime shutdown, this get() should - // recover and still get the value - value_creator.get().await - }) - }) - }; - assert_eq!(handle.join().unwrap(), 1); - } - - fn create_runtime() -> tokio::runtime::Runtime { - tokio::runtime::Builder::new_current_thread() - .enable_all() - .build() - .unwrap() - } -} diff --git a/resolvers/npm_cache/Cargo.toml b/resolvers/npm_cache/Cargo.toml new file mode 100644 index 0000000000..df01f62131 --- /dev/null +++ b/resolvers/npm_cache/Cargo.toml @@ -0,0 +1,42 @@ +# Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +[package] +name = "deno_npm_cache" +version = "0.0.1" +authors.workspace = true +edition.workspace = true +license.workspace = true +readme = "README.md" +repository.workspace = true +description = "Helpers for downloading and caching npm dependencies for Deno" + +[lib] +path = "lib.rs" + +[dependencies] +# todo(dsherret): remove this dependency +anyhow.workspace = true +# todo(dsherret): remove this dependency +deno_core.workspace = true + +async-trait.workspace = true +base64.workspace = true +boxed_error.workspace = true +deno_cache_dir.workspace = true +deno_npm.workspace = true +deno_semver.workspace = true +deno_unsync = { workspace = true, features = ["tokio"] } +faster-hex.workspace = true +flate2 = { workspace = true, features = ["zlib-ng-compat"] } +futures.workspace = true +http.workspace = true +log.workspace = true +parking_lot.workspace = true +percent-encoding.workspace = true +rand.workspace = true +ring.workspace = true +serde_json.workspace = true +tar.workspace = true +tempfile = "3.4.0" +thiserror.workspace = true +url.workspace = true diff --git a/resolvers/npm_cache/README.md b/resolvers/npm_cache/README.md new file mode 100644 index 0000000000..a7edbb4159 --- /dev/null +++ b/resolvers/npm_cache/README.md @@ -0,0 +1,6 @@ +# deno_npm_cache + +[![crates](https://img.shields.io/crates/v/deno_npm_cache.svg)](https://crates.io/crates/deno_npm_cache) +[![docs](https://docs.rs/deno_npm_cache/badge.svg)](https://docs.rs/deno_npm_cache) + +Helpers for downloading and caching npm dependencies for Deno. diff --git a/cli/npm/managed/cache/mod.rs b/resolvers/npm_cache/lib.rs similarity index 71% rename from cli/npm/managed/cache/mod.rs rename to resolvers/npm_cache/lib.rs index 8ae99f41e0..4e8966a4e1 100644 --- a/cli/npm/managed/cache/mod.rs +++ b/resolvers/npm_cache/lib.rs @@ -1,63 +1,133 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. use std::collections::HashSet; -use std::fs; use std::io::ErrorKind; use std::path::Path; use std::path::PathBuf; use std::sync::Arc; -use deno_ast::ModuleSpecifier; +use anyhow::bail; +use anyhow::Context; +use anyhow::Error as AnyError; use deno_cache_dir::npm::NpmCacheDir; -use deno_core::anyhow::bail; -use deno_core::anyhow::Context; -use deno_core::error::AnyError; -use deno_core::parking_lot::Mutex; -use deno_core::serde_json; -use deno_core::url::Url; use deno_npm::npm_rc::ResolvedNpmRc; use deno_npm::registry::NpmPackageInfo; use deno_npm::NpmPackageCacheFolderId; use deno_semver::package::PackageNv; use deno_semver::Version; +use http::HeaderName; +use http::HeaderValue; +use http::StatusCode; +use parking_lot::Mutex; +use url::Url; -use crate::args::CacheSetting; -use crate::cache::CACHE_PERM; -use crate::util::fs::atomic_write_file_with_retries; -use crate::util::fs::hard_link_dir_recursive; - -pub mod registry_info; +mod registry_info; +mod remote; mod tarball; mod tarball_extract; -pub use registry_info::RegistryInfoDownloader; +pub use registry_info::RegistryInfoProvider; pub use tarball::TarballCache; +// todo(#27198): make both of these private and get the rest of the code +// using RegistryInfoProvider. +pub use registry_info::get_package_url; +pub use remote::maybe_auth_header_for_npm_registry; + +#[derive(Debug)] +pub struct DownloadError { + pub status_code: Option, + pub error: AnyError, +} + +impl std::error::Error for DownloadError { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + Some(self.error.as_ref()) + } +} + +impl std::fmt::Display for DownloadError { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.error.fmt(f) + } +} + +#[async_trait::async_trait(?Send)] +pub trait NpmCacheEnv: Send + Sync + 'static { + fn exists(&self, path: &Path) -> bool; + fn hard_link_dir_recursive( + &self, + from: &Path, + to: &Path, + ) -> Result<(), AnyError>; + fn atomic_write_file_with_retries( + &self, + file_path: &Path, + data: &[u8], + ) -> std::io::Result<()>; + async fn download_with_retries_on_any_tokio_runtime( + &self, + url: Url, + maybe_auth_header: Option<(HeaderName, HeaderValue)>, + ) -> Result>, DownloadError>; +} + +/// Indicates how cached source files should be handled. +#[derive(Debug, Clone, Eq, PartialEq)] +pub enum NpmCacheSetting { + /// Only the cached files should be used. Any files not in the cache will + /// error. This is the equivalent of `--cached-only` in the CLI. + Only, + /// No cached source files should be used, and all files should be reloaded. + /// This is the equivalent of `--reload` in the CLI. + ReloadAll, + /// Only some cached resources should be used. This is the equivalent of + /// `--reload=npm:chalk` + ReloadSome { npm_package_names: Vec }, + /// The cached source files should be used for local modules. This is the + /// default behavior of the CLI. + Use, +} + +impl NpmCacheSetting { + pub fn should_use_for_npm_package(&self, package_name: &str) -> bool { + match self { + NpmCacheSetting::ReloadAll => false, + NpmCacheSetting::ReloadSome { npm_package_names } => { + !npm_package_names.iter().any(|n| n == package_name) + } + _ => true, + } + } +} + /// Stores a single copy of npm packages in a cache. #[derive(Debug)] -pub struct NpmCache { +pub struct NpmCache { + env: Arc, cache_dir: Arc, - cache_setting: CacheSetting, + cache_setting: NpmCacheSetting, npmrc: Arc, - /// ensures a package is only downloaded once per run previously_reloaded_packages: Mutex>, } -impl NpmCache { +impl NpmCache { pub fn new( cache_dir: Arc, - cache_setting: CacheSetting, + cache_setting: NpmCacheSetting, + env: Arc, npmrc: Arc, ) -> Self { Self { cache_dir, cache_setting, + env, previously_reloaded_packages: Default::default(), npmrc, } } - pub fn cache_setting(&self) -> &CacheSetting { + pub fn cache_setting(&self) -> &NpmCacheSetting { &self.cache_setting } @@ -118,7 +188,9 @@ impl NpmCache { // it seems Windows does an "AccessDenied" error when moving a // directory with hard links, so that's why this solution is done with_folder_sync_lock(&folder_id.nv, &package_folder, || { - hard_link_dir_recursive(&original_package_folder, &package_folder) + self + .env + .hard_link_dir_recursive(&original_package_folder, &package_folder) })?; Ok(()) } @@ -158,7 +230,7 @@ impl NpmCache { pub fn resolve_package_folder_id_from_specifier( &self, - specifier: &ModuleSpecifier, + specifier: &Url, ) -> Option { self .cache_dir @@ -180,7 +252,7 @@ impl NpmCache { ) -> Result, AnyError> { let file_cache_path = self.get_registry_package_info_file_cache_path(name); - let file_text = match fs::read_to_string(file_cache_path) { + let file_text = match std::fs::read_to_string(file_cache_path) { Ok(file_text) => file_text, Err(err) if err.kind() == ErrorKind::NotFound => return Ok(None), Err(err) => return Err(err.into()), @@ -195,7 +267,9 @@ impl NpmCache { ) -> Result<(), AnyError> { let file_cache_path = self.get_registry_package_info_file_cache_path(name); let file_text = serde_json::to_string(&package_info)?; - atomic_write_file_with_retries(&file_cache_path, file_text, CACHE_PERM)?; + self + .env + .atomic_write_file_with_retries(&file_cache_path, file_text.as_bytes())?; Ok(()) } @@ -216,7 +290,7 @@ fn with_folder_sync_lock( output_folder: &Path, action: impl FnOnce() -> Result<(), AnyError>, ) -> Result<(), AnyError> { - fs::create_dir_all(output_folder).with_context(|| { + std::fs::create_dir_all(output_folder).with_context(|| { format!("Error creating '{}'.", output_folder.display()) })?; @@ -229,7 +303,7 @@ fn with_folder_sync_lock( // then wait until the other process finishes with a timeout), but // for now this is good enough. let sync_lock_path = output_folder.join(NPM_PACKAGE_SYNC_LOCK_FILENAME); - match fs::OpenOptions::new() + match std::fs::OpenOptions::new() .write(true) .create(true) .truncate(false) @@ -257,7 +331,7 @@ fn with_folder_sync_lock( match inner(output_folder, action) { Ok(()) => Ok(()), Err(err) => { - if let Err(remove_err) = fs::remove_dir_all(output_folder) { + if let Err(remove_err) = std::fs::remove_dir_all(output_folder) { if remove_err.kind() != std::io::ErrorKind::NotFound { bail!( concat!( diff --git a/cli/npm/managed/cache/registry_info.rs b/resolvers/npm_cache/registry_info.rs similarity index 84% rename from cli/npm/managed/cache/registry_info.rs rename to resolvers/npm_cache/registry_info.rs index 6d39d3c13f..7ab50f0495 100644 --- a/cli/npm/managed/cache/registry_info.rs +++ b/resolvers/npm_cache/registry_info.rs @@ -3,28 +3,22 @@ use std::collections::HashMap; use std::sync::Arc; -use deno_core::anyhow::anyhow; -use deno_core::anyhow::bail; -use deno_core::anyhow::Context; -use deno_core::error::custom_error; -use deno_core::error::AnyError; -use deno_core::futures::future::LocalBoxFuture; -use deno_core::futures::FutureExt; -use deno_core::parking_lot::Mutex; -use deno_core::serde_json; -use deno_core::url::Url; +use anyhow::anyhow; +use anyhow::bail; +use anyhow::Context; +use anyhow::Error as AnyError; use deno_npm::npm_rc::ResolvedNpmRc; use deno_npm::registry::NpmPackageInfo; +use deno_unsync::sync::MultiRuntimeAsyncValueCreator; +use futures::future::LocalBoxFuture; +use futures::FutureExt; +use parking_lot::Mutex; +use url::Url; -use crate::args::CacheSetting; -use crate::http_util::HttpClientProvider; -use crate::npm::common::maybe_auth_header_for_npm_registry; -use crate::util::progress_bar::ProgressBar; -use crate::util::sync::MultiRuntimeAsyncValueCreator; - -use super::NpmCache; - -// todo(dsherret): create seams and unit test this +use crate::remote::maybe_auth_header_for_npm_registry; +use crate::NpmCache; +use crate::NpmCacheEnv; +use crate::NpmCacheSetting; type LoadResult = Result>; type LoadFuture = LocalBoxFuture<'static, LoadResult>; @@ -49,30 +43,31 @@ enum MemoryCacheItem { MemoryCached(Result>, Arc>), } +// todo(#27198): refactor to store this only in the http cache and also +// consolidate with CliNpmRegistryApi. + /// Downloads packuments from the npm registry. /// /// This is shared amongst all the workers. #[derive(Debug)] -pub struct RegistryInfoDownloader { - cache: Arc, - http_client_provider: Arc, +pub struct RegistryInfoProvider { + // todo(#27198): remove this + cache: Arc>, + env: Arc, npmrc: Arc, - progress_bar: ProgressBar, memory_cache: Mutex>, } -impl RegistryInfoDownloader { +impl RegistryInfoProvider { pub fn new( - cache: Arc, - http_client_provider: Arc, + cache: Arc>, + env: Arc, npmrc: Arc, - progress_bar: ProgressBar, ) -> Self { Self { cache, - http_client_provider, + env, npmrc, - progress_bar, memory_cache: Default::default(), } } @@ -94,8 +89,8 @@ impl RegistryInfoDownloader { self: &Arc, name: &str, ) -> Result>, AnyError> { - if *self.cache.cache_setting() == CacheSetting::Only { - return Err(custom_error( + if *self.cache.cache_setting() == NpmCacheSetting::Only { + return Err(deno_core::error::custom_error( "NotCached", format!( "An npm specifier not found in cache: \"{name}\", --cached-only is specified." @@ -167,7 +162,7 @@ impl RegistryInfoDownloader { ) -> Result { // this scenario failing should be exceptionally rare so let's // deal with improving it only when anyone runs into an issue - let maybe_package_info = deno_core::unsync::spawn_blocking({ + let maybe_package_info = deno_unsync::spawn_blocking({ let cache = self.cache.clone(); let name = name.to_string(); move || cache.load_package_info(&name) @@ -199,20 +194,18 @@ impl RegistryInfoDownloader { return std::future::ready(Err(Arc::new(err))).boxed_local() } }; - let guard = self.progress_bar.update(package_url.as_str()); let name = name.to_string(); async move { - let client = downloader.http_client_provider.get_or_create()?; - let maybe_bytes = client - .download_with_progress_and_retries( + let maybe_bytes = downloader + .env + .download_with_retries_on_any_tokio_runtime( package_url, maybe_auth_header, - &guard, ) .await?; match maybe_bytes { Some(bytes) => { - let future_result = deno_core::unsync::spawn_blocking( + let future_result = deno_unsync::spawn_blocking( move || -> Result { let package_info = serde_json::from_slice(&bytes)?; match downloader.cache.save_package_info(&name, &package_info) { @@ -241,6 +234,8 @@ impl RegistryInfoDownloader { } } +// todo(#27198): make this private and only use RegistryInfoProvider in the rest of +// the code pub fn get_package_url(npmrc: &ResolvedNpmRc, name: &str) -> Url { let registry_url = npmrc.get_registry_url(name); // The '/' character in scoped package names "@scope/name" must be diff --git a/cli/npm/common.rs b/resolvers/npm_cache/remote.rs similarity index 95% rename from cli/npm/common.rs rename to resolvers/npm_cache/remote.rs index 55f1bc086d..538554612f 100644 --- a/cli/npm/common.rs +++ b/resolvers/npm_cache/remote.rs @@ -1,10 +1,10 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use anyhow::bail; +use anyhow::Context; +use anyhow::Error as AnyError; use base64::prelude::BASE64_STANDARD; use base64::Engine; -use deno_core::anyhow::bail; -use deno_core::anyhow::Context; -use deno_core::error::AnyError; use deno_npm::npm_rc::RegistryConfig; use http::header; diff --git a/cli/npm/managed/cache/tarball.rs b/resolvers/npm_cache/tarball.rs similarity index 77% rename from cli/npm/managed/cache/tarball.rs rename to resolvers/npm_cache/tarball.rs index 7cf88d6d64..3102d811d1 100644 --- a/cli/npm/managed/cache/tarball.rs +++ b/resolvers/npm_cache/tarball.rs @@ -3,33 +3,26 @@ use std::collections::HashMap; use std::sync::Arc; -use deno_core::anyhow::anyhow; -use deno_core::anyhow::bail; -use deno_core::anyhow::Context; -use deno_core::error::custom_error; -use deno_core::error::AnyError; -use deno_core::futures::future::LocalBoxFuture; -use deno_core::futures::FutureExt; -use deno_core::parking_lot::Mutex; -use deno_core::url::Url; +use anyhow::anyhow; +use anyhow::bail; +use anyhow::Context; +use anyhow::Error as AnyError; use deno_npm::npm_rc::ResolvedNpmRc; use deno_npm::registry::NpmPackageVersionDistInfo; -use deno_runtime::deno_fs::FileSystem; use deno_semver::package::PackageNv; +use deno_unsync::sync::MultiRuntimeAsyncValueCreator; +use futures::future::LocalBoxFuture; +use futures::FutureExt; use http::StatusCode; +use parking_lot::Mutex; +use url::Url; -use crate::args::CacheSetting; -use crate::http_util::DownloadError; -use crate::http_util::HttpClientProvider; -use crate::npm::common::maybe_auth_header_for_npm_registry; -use crate::util::progress_bar::ProgressBar; -use crate::util::sync::MultiRuntimeAsyncValueCreator; - -use super::tarball_extract::verify_and_extract_tarball; -use super::tarball_extract::TarballExtractionMode; -use super::NpmCache; - -// todo(dsherret): create seams and unit test this +use crate::remote::maybe_auth_header_for_npm_registry; +use crate::tarball_extract::verify_and_extract_tarball; +use crate::tarball_extract::TarballExtractionMode; +use crate::NpmCache; +use crate::NpmCacheEnv; +use crate::NpmCacheSetting; type LoadResult = Result<(), Arc>; type LoadFuture = LocalBoxFuture<'static, LoadResult>; @@ -49,29 +42,23 @@ enum MemoryCacheItem { /// /// This is shared amongst all the workers. #[derive(Debug)] -pub struct TarballCache { - cache: Arc, - fs: Arc, - http_client_provider: Arc, +pub struct TarballCache { + cache: Arc>, + env: Arc, npmrc: Arc, - progress_bar: ProgressBar, memory_cache: Mutex>, } -impl TarballCache { +impl TarballCache { pub fn new( - cache: Arc, - fs: Arc, - http_client_provider: Arc, + cache: Arc>, + env: Arc, npmrc: Arc, - progress_bar: ProgressBar, ) -> Self { Self { cache, - fs, - http_client_provider, + env, npmrc, - progress_bar, memory_cache: Default::default(), } } @@ -144,11 +131,11 @@ impl TarballCache { let package_folder = tarball_cache.cache.package_folder_for_nv_and_url(&package_nv, registry_url); let should_use_cache = tarball_cache.cache.should_use_cache_for_package(&package_nv); - let package_folder_exists = tarball_cache.fs.exists_sync(&package_folder); + let package_folder_exists = tarball_cache.env.exists(&package_folder); if should_use_cache && package_folder_exists { return Ok(()); - } else if tarball_cache.cache.cache_setting() == &CacheSetting::Only { - return Err(custom_error( + } else if tarball_cache.cache.cache_setting() == &NpmCacheSetting::Only { + return Err(deno_core::error::custom_error( "NotCached", format!( "An npm specifier not found in cache: \"{}\", --cached-only is specified.", @@ -169,15 +156,13 @@ impl TarballCache { tarball_cache.npmrc.tarball_config(&tarball_uri); let maybe_auth_header = maybe_registry_config.and_then(|c| maybe_auth_header_for_npm_registry(c).ok()?); - let guard = tarball_cache.progress_bar.update(&dist.tarball); - let result = tarball_cache.http_client_provider - .get_or_create()? - .download_with_progress_and_retries(tarball_uri, maybe_auth_header, &guard) + let result = tarball_cache.env + .download_with_retries_on_any_tokio_runtime(tarball_uri, maybe_auth_header) .await; let maybe_bytes = match result { Ok(maybe_bytes) => maybe_bytes, - Err(DownloadError::BadResponse(err)) => { - if err.status_code == StatusCode::UNAUTHORIZED + Err(err) => { + if err.status_code == Some(StatusCode::UNAUTHORIZED) && maybe_registry_config.is_none() && tarball_cache.npmrc.get_registry_config(&package_nv.name).auth_token.is_some() { @@ -194,7 +179,6 @@ impl TarballCache { } return Err(err.into()) }, - Err(err) => return Err(err.into()), }; match maybe_bytes { Some(bytes) => { @@ -213,7 +197,7 @@ impl TarballCache { }; let dist = dist.clone(); let package_nv = package_nv.clone(); - deno_core::unsync::spawn_blocking(move || { + deno_unsync::spawn_blocking(move || { verify_and_extract_tarball( &package_nv, &bytes, diff --git a/cli/npm/managed/cache/tarball_extract.rs b/resolvers/npm_cache/tarball_extract.rs similarity index 90% rename from cli/npm/managed/cache/tarball_extract.rs rename to resolvers/npm_cache/tarball_extract.rs index e2d242e662..262618d905 100644 --- a/cli/npm/managed/cache/tarball_extract.rs +++ b/resolvers/npm_cache/tarball_extract.rs @@ -1,16 +1,17 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use std::borrow::Cow; use std::collections::HashSet; use std::fs; use std::io::ErrorKind; use std::path::Path; use std::path::PathBuf; +use anyhow::bail; +use anyhow::Context; +use anyhow::Error as AnyError; use base64::prelude::BASE64_STANDARD; use base64::Engine; -use deno_core::anyhow::bail; -use deno_core::anyhow::Context; -use deno_core::error::AnyError; use deno_npm::registry::NpmPackageVersionDistInfo; use deno_npm::registry::NpmPackageVersionDistInfoIntegrity; use deno_semver::package::PackageNv; @@ -18,8 +19,6 @@ use flate2::read::GzDecoder; use tar::Archive; use tar::EntryType; -use crate::util::path::get_atomic_dir_path; - #[derive(Debug, Copy, Clone)] pub enum TarballExtractionMode { /// Overwrites the destination directory without deleting any files. @@ -206,10 +205,30 @@ fn extract_tarball(data: &[u8], output_folder: &Path) -> Result<(), AnyError> { Ok(()) } +fn get_atomic_dir_path(file_path: &Path) -> PathBuf { + let rand = gen_rand_path_component(); + let new_file_name = format!( + ".{}_{}", + file_path + .file_name() + .map(|f| f.to_string_lossy()) + .unwrap_or(Cow::Borrowed("")), + rand + ); + file_path.with_file_name(new_file_name) +} + +fn gen_rand_path_component() -> String { + (0..4).fold(String::new(), |mut output, _| { + output.push_str(&format!("{:02x}", rand::random::())); + output + }) +} + #[cfg(test)] mod test { use deno_semver::Version; - use test_util::TempDir; + use tempfile::TempDir; use super::*; @@ -303,21 +322,21 @@ mod test { #[test] fn rename_with_retries_succeeds_exists() { - let temp_dir = TempDir::new(); + let temp_dir = TempDir::new().unwrap(); let folder_1 = temp_dir.path().join("folder_1"); let folder_2 = temp_dir.path().join("folder_2"); - folder_1.create_dir_all(); - folder_1.join("a.txt").write("test"); - folder_2.create_dir_all(); + std::fs::create_dir_all(&folder_1).unwrap(); + std::fs::write(folder_1.join("a.txt"), "test").unwrap(); + std::fs::create_dir_all(&folder_2).unwrap(); // this will not end up in the output as rename_with_retries assumes // the folders ending up at the destination are the same - folder_2.join("b.txt").write("test2"); + std::fs::write(folder_2.join("b.txt"), "test2").unwrap(); let dest_folder = temp_dir.path().join("dest_folder"); - rename_with_retries(folder_1.as_path(), dest_folder.as_path()).unwrap(); - rename_with_retries(folder_2.as_path(), dest_folder.as_path()).unwrap(); + rename_with_retries(folder_1.as_path(), &dest_folder).unwrap(); + rename_with_retries(folder_2.as_path(), &dest_folder).unwrap(); assert!(dest_folder.join("a.txt").exists()); assert!(!dest_folder.join("b.txt").exists()); } diff --git a/resolvers/npm_cache/todo.md b/resolvers/npm_cache/todo.md new file mode 100644 index 0000000000..e10b1cfd89 --- /dev/null +++ b/resolvers/npm_cache/todo.md @@ -0,0 +1,9 @@ +This crate is a work in progress: + +1. Remove `deno_core` dependency. +1. Remove `anyhow` dependency. +1. Add a clippy.toml file that bans accessing the file system directory and + instead does it through a trait. +1. Make this crate work in Wasm. +1. Refactor to store npm packument in a single place: + https://github.com/denoland/deno/issues/27198 From b78c851a9419b0ce5df87885257d512cc96cec30 Mon Sep 17 00:00:00 2001 From: Ian Bull Date: Mon, 2 Dec 2024 19:30:39 -0800 Subject: [PATCH 204/227] refactor(ext/web): align error messages (#25871) Aligns the error messages in the ext/web folder to be in-line with the Deno style guide. --- ext/web/00_infra.js | 8 +-- ext/web/02_event.js | 4 +- ext/web/03_abort_signal.js | 2 +- ext/web/04_global_interfaces.js | 6 +- ext/web/05_base64.js | 2 +- ext/web/06_streams.js | 58 ++++++++++--------- ext/web/10_filereader.js | 2 +- ext/web/12_location.js | 50 ++++++++-------- ext/web/15_performance.js | 14 +++-- ext/web/16_image_data.js | 16 ++--- .../run/_070_location/070_location.ts.out | 4 +- 11 files changed, 86 insertions(+), 80 deletions(-) diff --git a/ext/web/00_infra.js b/ext/web/00_infra.js index 4b241ab5d7..9a75f8fa58 100644 --- a/ext/web/00_infra.js +++ b/ext/web/00_infra.js @@ -271,7 +271,7 @@ function addPaddingToBase64url(base64url) { if (base64url.length % 4 === 2) return base64url + "=="; if (base64url.length % 4 === 3) return base64url + "="; if (base64url.length % 4 === 1) { - throw new TypeError("Illegal base64url string!"); + throw new TypeError("Illegal base64url string"); } return base64url; } @@ -382,7 +382,7 @@ function assert(cond, msg = "Assertion failed.") { function serializeJSValueToJSONString(value) { const result = JSONStringify(value); if (result === undefined) { - throw new TypeError("Value is not JSON serializable."); + throw new TypeError("Value is not JSON serializable"); } return result; } @@ -429,7 +429,7 @@ function pathFromURLWin32(url) { */ function pathFromURLPosix(url) { if (url.hostname !== "") { - throw new TypeError(`Host must be empty.`); + throw new TypeError("Host must be empty"); } return decodeURIComponent( @@ -444,7 +444,7 @@ function pathFromURLPosix(url) { function pathFromURL(pathOrUrl) { if (ObjectPrototypeIsPrototypeOf(URLPrototype, pathOrUrl)) { if (pathOrUrl.protocol != "file:") { - throw new TypeError("Must be a file URL."); + throw new TypeError("Must be a file URL"); } return core.build.os == "windows" diff --git a/ext/web/02_event.js b/ext/web/02_event.js index a3e40ab996..f6351c4b9e 100644 --- a/ext/web/02_event.js +++ b/ext/web/02_event.js @@ -1031,11 +1031,11 @@ class EventTarget { } if (getDispatched(event)) { - throw new DOMException("Invalid event state.", "InvalidStateError"); + throw new DOMException("Invalid event state", "InvalidStateError"); } if (event.eventPhase !== Event.NONE) { - throw new DOMException("Invalid event state.", "InvalidStateError"); + throw new DOMException("Invalid event state", "InvalidStateError"); } return dispatch(self, event); diff --git a/ext/web/03_abort_signal.js b/ext/web/03_abort_signal.js index ae0701451b..93b3cf0522 100644 --- a/ext/web/03_abort_signal.js +++ b/ext/web/03_abort_signal.js @@ -196,7 +196,7 @@ class AbortSignal extends EventTarget { constructor(key = null) { if (key !== illegalConstructorKey) { - throw new TypeError("Illegal constructor."); + throw new TypeError("Illegal constructor"); } super(); } diff --git a/ext/web/04_global_interfaces.js b/ext/web/04_global_interfaces.js index 8483a7b238..7c7f83b431 100644 --- a/ext/web/04_global_interfaces.js +++ b/ext/web/04_global_interfaces.js @@ -16,7 +16,7 @@ const illegalConstructorKey = Symbol("illegalConstructorKey"); class Window extends EventTarget { constructor(key = null) { if (key !== illegalConstructorKey) { - throw new TypeError("Illegal constructor."); + throw new TypeError("Illegal constructor"); } super(); } @@ -29,7 +29,7 @@ class Window extends EventTarget { class WorkerGlobalScope extends EventTarget { constructor(key = null) { if (key != illegalConstructorKey) { - throw new TypeError("Illegal constructor."); + throw new TypeError("Illegal constructor"); } super(); } @@ -42,7 +42,7 @@ class WorkerGlobalScope extends EventTarget { class DedicatedWorkerGlobalScope extends WorkerGlobalScope { constructor(key = null) { if (key != illegalConstructorKey) { - throw new TypeError("Illegal constructor."); + throw new TypeError("Illegal constructor"); } super(); } diff --git a/ext/web/05_base64.js b/ext/web/05_base64.js index b97846b904..e6796e1dc3 100644 --- a/ext/web/05_base64.js +++ b/ext/web/05_base64.js @@ -50,7 +50,7 @@ function btoa(data) { } catch (e) { if (ObjectPrototypeIsPrototypeOf(TypeErrorPrototype, e)) { throw new DOMException( - "The string to be encoded contains characters outside of the Latin1 range.", + "Cannot encode string: string contains characters outside of the Latin1 range", "InvalidCharacterError", ); } diff --git a/ext/web/06_streams.js b/ext/web/06_streams.js index 57a437e4f5..e673ee2bb4 100644 --- a/ext/web/06_streams.js +++ b/ext/web/06_streams.js @@ -523,10 +523,14 @@ function dequeueValue(container) { function enqueueValueWithSize(container, value, size) { assert(container[_queue] && typeof container[_queueTotalSize] === "number"); if (isNonNegativeNumber(size) === false) { - throw new RangeError("chunk size isn't a positive number"); + throw new RangeError( + "Cannot enqueue value with size: chunk size must be a positive number", + ); } if (size === Infinity) { - throw new RangeError("chunk size is invalid"); + throw new RangeError( + "Cannot enqueue value with size: chunk size is invalid", + ); } container[_queue].enqueue({ value, size }); container[_queueTotalSize] += size; @@ -1097,7 +1101,7 @@ async function readableStreamCollectIntoUint8Array(stream) { if (TypedArrayPrototypeGetSymbolToStringTag(chunk) !== "Uint8Array") { throw new TypeError( - "Can't convert value to Uint8Array while consuming the stream", + "Cannot convert value to Uint8Array while consuming the stream", ); } @@ -1347,7 +1351,7 @@ function readableByteStreamControllerEnqueue(controller, chunk) { if (isDetachedBuffer(buffer)) { throw new TypeError( - "chunk's buffer is detached and so cannot be enqueued", + "Chunk's buffer is detached and so cannot be enqueued", ); } const transferredBuffer = ArrayBufferPrototypeTransferToFixedLength(buffer); @@ -2095,14 +2099,14 @@ function readableByteStreamControllerRespond(controller, bytesWritten) { if (state === "closed") { if (bytesWritten !== 0) { throw new TypeError( - "bytesWritten must be 0 when calling respond() on a closed stream", + `"bytesWritten" must be 0 when calling respond() on a closed stream: received ${bytesWritten}`, ); } } else { assert(state === "readable"); if (bytesWritten === 0) { throw new TypeError( - "bytesWritten must be greater than 0 when calling respond() on a readable stream", + '"bytesWritten" must be greater than 0 when calling respond() on a readable stream', ); } if ( @@ -2110,7 +2114,7 @@ function readableByteStreamControllerRespond(controller, bytesWritten) { // deno-lint-ignore prefer-primordials firstDescriptor.byteLength ) { - throw new RangeError("bytesWritten out of range"); + throw new RangeError('"bytesWritten" out of range'); } } firstDescriptor.buffer = ArrayBufferPrototypeTransferToFixedLength( @@ -2305,7 +2309,7 @@ function readableByteStreamControllerRespondWithNewView(controller, view) { if (state === "closed") { if (byteLength !== 0) { throw new TypeError( - "The view's length must be 0 when calling respondWithNewView() on a closed stream", + `The view's length must be 0 when calling respondWithNewView() on a closed stream: received ${byteLength}`, ); } } else { @@ -3577,7 +3581,7 @@ function setUpReadableByteStreamControllerFromUnderlyingSource( } const autoAllocateChunkSize = underlyingSourceDict["autoAllocateChunkSize"]; if (autoAllocateChunkSize === 0) { - throw new TypeError("autoAllocateChunkSize must be greater than 0"); + throw new TypeError('"autoAllocateChunkSize" must be greater than 0'); } setUpReadableByteStreamController( stream, @@ -3706,7 +3710,7 @@ function setUpReadableStreamDefaultControllerFromUnderlyingSource( */ function setUpReadableStreamBYOBReader(reader, stream) { if (isReadableStreamLocked(stream)) { - throw new TypeError("ReadableStream is locked."); + throw new TypeError("ReadableStream is locked"); } if ( !(ObjectPrototypeIsPrototypeOf( @@ -3727,7 +3731,7 @@ function setUpReadableStreamBYOBReader(reader, stream) { */ function setUpReadableStreamDefaultReader(reader, stream) { if (isReadableStreamLocked(stream)) { - throw new TypeError("ReadableStream is locked."); + throw new TypeError("ReadableStream is locked"); } readableStreamReaderGenericInitialize(reader, stream); reader[_readRequests] = new Queue(); @@ -3961,7 +3965,7 @@ function setUpWritableStreamDefaultControllerFromUnderlyingSink( */ function setUpWritableStreamDefaultWriter(writer, stream) { if (isWritableStreamLocked(stream) === true) { - throw new TypeError("The stream is already locked."); + throw new TypeError("The stream is already locked"); } writer[_stream] = stream; stream[_writer] = writer; @@ -4019,7 +4023,7 @@ function transformStreamDefaultControllerEnqueue(controller, chunk) { /** @type {ReadableStreamDefaultController} */ readableController, ) === false ) { - throw new TypeError("Readable stream is unavailable."); + throw new TypeError("Readable stream is unavailable"); } try { readableStreamDefaultControllerEnqueue( @@ -5143,7 +5147,7 @@ class ReadableStream { if (underlyingSourceDict.type === "bytes") { if (strategy.size !== undefined) { throw new RangeError( - `${prefix}: When underlying source is "bytes", strategy.size must be undefined.`, + `${prefix}: When underlying source is "bytes", strategy.size must be 'undefined'`, ); } const highWaterMark = extractHighWaterMark(strategy, 0); @@ -5273,10 +5277,10 @@ class ReadableStream { const { readable, writable } = transform; const { preventClose, preventAbort, preventCancel, signal } = options; if (isReadableStreamLocked(this)) { - throw new TypeError("ReadableStream is already locked."); + throw new TypeError("ReadableStream is already locked"); } if (isWritableStreamLocked(writable)) { - throw new TypeError("Target WritableStream is already locked."); + throw new TypeError("Target WritableStream is already locked"); } const promise = readableStreamPipeTo( this, @@ -5814,7 +5818,7 @@ class ReadableByteStreamController { } if (this[_stream][_state] !== "readable") { throw new TypeError( - "ReadableByteStreamController's stream is not in a readable state.", + "ReadableByteStreamController's stream is not in a readable state", ); } readableByteStreamControllerClose(this); @@ -5846,7 +5850,7 @@ class ReadableByteStreamController { if (byteLength === 0) { throw webidl.makeException( TypeError, - "length must be non-zero", + "Length must be non-zero", prefix, arg1, ); @@ -5854,19 +5858,19 @@ class ReadableByteStreamController { if (getArrayBufferByteLength(buffer) === 0) { throw webidl.makeException( TypeError, - "buffer length must be non-zero", + "Buffer length must be non-zero", prefix, arg1, ); } if (this[_closeRequested] === true) { throw new TypeError( - "Cannot enqueue chunk after a close has been requested.", + "Cannot enqueue chunk after a close has been requested", ); } if (this[_stream][_state] !== "readable") { throw new TypeError( - "Cannot enqueue chunk when underlying stream is not readable.", + "Cannot enqueue chunk when underlying stream is not readable", ); } return readableByteStreamControllerEnqueue(this, chunk); @@ -6006,7 +6010,7 @@ class ReadableStreamDefaultController { close() { webidl.assertBranded(this, ReadableStreamDefaultControllerPrototype); if (readableStreamDefaultControllerCanCloseOrEnqueue(this) === false) { - throw new TypeError("The stream controller cannot close or enqueue."); + throw new TypeError("The stream controller cannot close or enqueue"); } readableStreamDefaultControllerClose(this); } @@ -6021,7 +6025,7 @@ class ReadableStreamDefaultController { chunk = webidl.converters.any(chunk); } if (readableStreamDefaultControllerCanCloseOrEnqueue(this) === false) { - throw new TypeError("The stream controller cannot close or enqueue."); + throw new TypeError("The stream controller cannot close or enqueue"); } readableStreamDefaultControllerEnqueue(this, chunk); } @@ -6146,12 +6150,12 @@ class TransformStream { ); if (transformerDict.readableType !== undefined) { throw new RangeError( - `${prefix}: readableType transformers not supported.`, + `${prefix}: readableType transformers not supported`, ); } if (transformerDict.writableType !== undefined) { throw new RangeError( - `${prefix}: writableType transformers not supported.`, + `${prefix}: writableType transformers not supported`, ); } const readableHighWaterMark = extractHighWaterMark(readableStrategy, 0); @@ -6356,7 +6360,7 @@ class WritableStream { ); if (underlyingSinkDict.type != null) { throw new RangeError( - `${prefix}: WritableStream does not support 'type' in the underlying sink.`, + `${prefix}: WritableStream does not support 'type' in the underlying sink`, ); } initializeWritableStream(this); @@ -6483,7 +6487,7 @@ class WritableStreamDefaultWriter { webidl.assertBranded(this, WritableStreamDefaultWriterPrototype); if (this[_stream] === undefined) { throw new TypeError( - "A writable stream is not associated with the writer.", + "A writable stream is not associated with the writer", ); } return writableStreamDefaultWriterGetDesiredSize(this); diff --git a/ext/web/10_filereader.js b/ext/web/10_filereader.js index 05b45202d6..2718606380 100644 --- a/ext/web/10_filereader.js +++ b/ext/web/10_filereader.js @@ -65,7 +65,7 @@ class FileReader extends EventTarget { // 1. If fr's state is "loading", throw an InvalidStateError DOMException. if (this[state] === "loading") { throw new DOMException( - "Invalid FileReader state.", + "Invalid FileReader state", "InvalidStateError", ); } diff --git a/ext/web/12_location.js b/ext/web/12_location.js index 2cda9f719c..ba0c47e2d1 100644 --- a/ext/web/12_location.js +++ b/ext/web/12_location.js @@ -28,7 +28,7 @@ const locationConstructorKey = Symbol("locationConstructorKey"); class Location { constructor(href = null, key = null) { if (key != locationConstructorKey) { - throw new TypeError("Illegal constructor."); + throw new TypeError("Illegal constructor"); } const url = new URL(href); url.username = ""; @@ -41,7 +41,7 @@ class Location { }, set() { throw new DOMException( - `Cannot set "location.hash".`, + `Cannot set "location.hash"`, "NotSupportedError", ); }, @@ -54,7 +54,7 @@ class Location { }, set() { throw new DOMException( - `Cannot set "location.host".`, + `Cannot set "location.host"`, "NotSupportedError", ); }, @@ -67,7 +67,7 @@ class Location { }, set() { throw new DOMException( - `Cannot set "location.hostname".`, + `Cannot set "location.hostname"`, "NotSupportedError", ); }, @@ -80,7 +80,7 @@ class Location { }, set() { throw new DOMException( - `Cannot set "location.href".`, + `Cannot set "location.href"`, "NotSupportedError", ); }, @@ -100,7 +100,7 @@ class Location { }, set() { throw new DOMException( - `Cannot set "location.pathname".`, + `Cannot set "location.pathname"`, "NotSupportedError", ); }, @@ -113,7 +113,7 @@ class Location { }, set() { throw new DOMException( - `Cannot set "location.port".`, + `Cannot set "location.port"`, "NotSupportedError", ); }, @@ -126,7 +126,7 @@ class Location { }, set() { throw new DOMException( - `Cannot set "location.protocol".`, + `Cannot set "location.protocol"`, "NotSupportedError", ); }, @@ -139,7 +139,7 @@ class Location { }, set() { throw new DOMException( - `Cannot set "location.search".`, + `Cannot set "location.search"`, "NotSupportedError", ); }, @@ -161,7 +161,7 @@ class Location { __proto__: null, value: function assign() { throw new DOMException( - `Cannot call "location.assign()".`, + `Cannot call "location.assign()"`, "NotSupportedError", ); }, @@ -171,7 +171,7 @@ class Location { __proto__: null, value: function reload() { throw new DOMException( - `Cannot call "location.reload()".`, + `Cannot call "location.reload()"`, "NotSupportedError", ); }, @@ -181,7 +181,7 @@ class Location { __proto__: null, value: function replace() { throw new DOMException( - `Cannot call "location.replace()".`, + `Cannot call "location.replace()"`, "NotSupportedError", ); }, @@ -229,7 +229,7 @@ const workerLocationUrls = new SafeWeakMap(); class WorkerLocation { constructor(href = null, key = null) { if (key != locationConstructorKey) { - throw new TypeError("Illegal constructor."); + throw new TypeError("Illegal constructor"); } const url = new URL(href); url.username = ""; @@ -244,7 +244,7 @@ ObjectDefineProperties(WorkerLocation.prototype, { get() { const url = WeakMapPrototypeGet(workerLocationUrls, this); if (url == null) { - throw new TypeError("Illegal invocation."); + throw new TypeError("Illegal invocation"); } return url.hash; }, @@ -256,7 +256,7 @@ ObjectDefineProperties(WorkerLocation.prototype, { get() { const url = WeakMapPrototypeGet(workerLocationUrls, this); if (url == null) { - throw new TypeError("Illegal invocation."); + throw new TypeError("Illegal invocation"); } return url.host; }, @@ -268,7 +268,7 @@ ObjectDefineProperties(WorkerLocation.prototype, { get() { const url = WeakMapPrototypeGet(workerLocationUrls, this); if (url == null) { - throw new TypeError("Illegal invocation."); + throw new TypeError("Illegal invocation"); } return url.hostname; }, @@ -280,7 +280,7 @@ ObjectDefineProperties(WorkerLocation.prototype, { get() { const url = WeakMapPrototypeGet(workerLocationUrls, this); if (url == null) { - throw new TypeError("Illegal invocation."); + throw new TypeError("Illegal invocation"); } return url.href; }, @@ -292,7 +292,7 @@ ObjectDefineProperties(WorkerLocation.prototype, { get() { const url = WeakMapPrototypeGet(workerLocationUrls, this); if (url == null) { - throw new TypeError("Illegal invocation."); + throw new TypeError("Illegal invocation"); } return url.origin; }, @@ -304,7 +304,7 @@ ObjectDefineProperties(WorkerLocation.prototype, { get() { const url = WeakMapPrototypeGet(workerLocationUrls, this); if (url == null) { - throw new TypeError("Illegal invocation."); + throw new TypeError("Illegal invocation"); } return url.pathname; }, @@ -316,7 +316,7 @@ ObjectDefineProperties(WorkerLocation.prototype, { get() { const url = WeakMapPrototypeGet(workerLocationUrls, this); if (url == null) { - throw new TypeError("Illegal invocation."); + throw new TypeError("Illegal invocation"); } return url.port; }, @@ -328,7 +328,7 @@ ObjectDefineProperties(WorkerLocation.prototype, { get() { const url = WeakMapPrototypeGet(workerLocationUrls, this); if (url == null) { - throw new TypeError("Illegal invocation."); + throw new TypeError("Illegal invocation"); } return url.protocol; }, @@ -340,7 +340,7 @@ ObjectDefineProperties(WorkerLocation.prototype, { get() { const url = WeakMapPrototypeGet(workerLocationUrls, this); if (url == null) { - throw new TypeError("Illegal invocation."); + throw new TypeError("Illegal invocation"); } return url.search; }, @@ -352,7 +352,7 @@ ObjectDefineProperties(WorkerLocation.prototype, { value: function toString() { const url = WeakMapPrototypeGet(workerLocationUrls, this); if (url == null) { - throw new TypeError("Illegal invocation."); + throw new TypeError("Illegal invocation"); } return url.href; }, @@ -414,7 +414,7 @@ const locationDescriptor = { return location; }, set() { - throw new DOMException(`Cannot set "location".`, "NotSupportedError"); + throw new DOMException(`Cannot set "location"`, "NotSupportedError"); }, enumerable: true, }; @@ -422,7 +422,7 @@ const workerLocationDescriptor = { get() { if (workerLocation == null) { throw new Error( - `Assertion: "globalThis.location" must be defined in a worker.`, + `Assertion: "globalThis.location" must be defined in a worker`, ); } return workerLocation; diff --git a/ext/web/15_performance.js b/ext/web/15_performance.js index 9e0e310a57..f23e851246 100644 --- a/ext/web/15_performance.js +++ b/ext/web/15_performance.js @@ -123,14 +123,14 @@ function convertMarkToTimestamp(mark) { const entry = findMostRecent(mark, "mark"); if (!entry) { throw new DOMException( - `Cannot find mark: "${mark}".`, + `Cannot find mark: "${mark}"`, "SyntaxError", ); } return entry.startTime; } if (mark < 0) { - throw new TypeError("Mark cannot be negative."); + throw new TypeError(`Mark cannot be negative: received ${mark}`); } return mark; } @@ -261,7 +261,9 @@ class PerformanceMark extends PerformanceEntry { super(name, "mark", startTime, 0, illegalConstructorKey); this[webidl.brand] = webidl.brand; if (startTime < 0) { - throw new TypeError("startTime cannot be negative"); + throw new TypeError( + `Cannot construct PerformanceMark: startTime cannot be negative, received ${startTime}`, + ); } this[_detail] = structuredClone(detail); } @@ -504,14 +506,14 @@ class Performance extends EventTarget { ObjectKeys(startOrMeasureOptions).length > 0 ) { if (endMark) { - throw new TypeError("Options cannot be passed with endMark."); + throw new TypeError('Options cannot be passed with "endMark"'); } if ( !ReflectHas(startOrMeasureOptions, "start") && !ReflectHas(startOrMeasureOptions, "end") ) { throw new TypeError( - "A start or end mark must be supplied in options.", + 'A "start" or "end" mark must be supplied in options', ); } if ( @@ -520,7 +522,7 @@ class Performance extends EventTarget { ReflectHas(startOrMeasureOptions, "end") ) { throw new TypeError( - "Cannot specify start, end, and duration together in options.", + 'Cannot specify "start", "end", and "duration" together in options', ); } } diff --git a/ext/web/16_image_data.js b/ext/web/16_image_data.js index 2048f002d5..13df0d07be 100644 --- a/ext/web/16_image_data.js +++ b/ext/web/16_image_data.js @@ -84,35 +84,35 @@ class ImageData { if (dataLength === 0) { throw new DOMException( - "Failed to construct 'ImageData': The input data has zero elements.", + "Failed to construct 'ImageData': the input data has zero elements", "InvalidStateError", ); } if (dataLength % 4 !== 0) { throw new DOMException( - "Failed to construct 'ImageData': The input data length is not a multiple of 4.", + `Failed to construct 'ImageData': the input data length is not a multiple of 4, received ${dataLength}`, "InvalidStateError", ); } if (sourceWidth < 1) { throw new DOMException( - "Failed to construct 'ImageData': The source width is zero or not a number.", + "Failed to construct 'ImageData': the source width is zero or not a number", "IndexSizeError", ); } if (webidl.type(sourceHeight) !== "Undefined" && sourceHeight < 1) { throw new DOMException( - "Failed to construct 'ImageData': The source height is zero or not a number.", + "Failed to construct 'ImageData': the source height is zero or not a number", "IndexSizeError", ); } if (dataLength / 4 % sourceWidth !== 0) { throw new DOMException( - "Failed to construct 'ImageData': The input data length is not a multiple of (4 * width).", + "Failed to construct 'ImageData': the input data length is not a multiple of (4 * width)", "IndexSizeError", ); } @@ -122,7 +122,7 @@ class ImageData { (sourceWidth * sourceHeight * 4 !== dataLength) ) { throw new DOMException( - "Failed to construct 'ImageData': The input data length is not equal to (4 * width * height).", + "Failed to construct 'ImageData': the input data length is not equal to (4 * width * height)", "IndexSizeError", ); } @@ -159,14 +159,14 @@ class ImageData { if (sourceWidth < 1) { throw new DOMException( - "Failed to construct 'ImageData': The source width is zero or not a number.", + "Failed to construct 'ImageData': the source width is zero or not a number", "IndexSizeError", ); } if (sourceHeight < 1) { throw new DOMException( - "Failed to construct 'ImageData': The source height is zero or not a number.", + "Failed to construct 'ImageData': the source height is zero or not a number", "IndexSizeError", ); } diff --git a/tests/specs/run/_070_location/070_location.ts.out b/tests/specs/run/_070_location/070_location.ts.out index a03cf6477c..c5750973fb 100644 --- a/tests/specs/run/_070_location/070_location.ts.out +++ b/tests/specs/run/_070_location/070_location.ts.out @@ -11,5 +11,5 @@ Location { protocol: "https:", search: "?baz" } -NotSupportedError: Cannot set "location". -NotSupportedError: Cannot set "location.hostname". +NotSupportedError: Cannot set "location" +NotSupportedError: Cannot set "location.hostname" From 2fbc5fea83dca1d044d9011c9f125a7b44e561e2 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Tue, 3 Dec 2024 10:28:20 +0100 Subject: [PATCH 205/227] fix(node/fs): support `recursive` option in readdir (#27179) We didn't support the `recursive` option of `fs.readdir()/fs.readdirSync()`. Fixes https://github.com/denoland/deno/issues/27175 --- ext/node/polyfills/_fs/_fs_readdir.ts | 105 ++++++++++++++++-------- tests/unit_node/_fs/_fs_readdir_test.ts | 43 ++++++++++ 2 files changed, 116 insertions(+), 32 deletions(-) diff --git a/ext/node/polyfills/_fs/_fs_readdir.ts b/ext/node/polyfills/_fs/_fs_readdir.ts index 3b314227dc..59c802e424 100644 --- a/ext/node/polyfills/_fs/_fs_readdir.ts +++ b/ext/node/polyfills/_fs/_fs_readdir.ts @@ -4,12 +4,13 @@ // deno-lint-ignore-file prefer-primordials import { TextDecoder, TextEncoder } from "ext:deno_web/08_text_encoding.js"; -import { asyncIterableToCallback } from "ext:deno_node/_fs/_fs_watch.ts"; import Dirent from "ext:deno_node/_fs/_fs_dirent.ts"; import { denoErrorToNodeError } from "ext:deno_node/internal/errors.ts"; import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs"; import { Buffer } from "node:buffer"; import { promisify } from "ext:deno_node/internal/util.mjs"; +import { op_fs_read_dir_async, op_fs_read_dir_sync } from "ext:core/ops"; +import { join, relative } from "node:path"; function toDirent(val: Deno.DirEntry & { parentPath: string }): Dirent { return new Dirent(val); @@ -18,6 +19,7 @@ function toDirent(val: Deno.DirEntry & { parentPath: string }): Dirent { type readDirOptions = { encoding?: string; withFileTypes?: boolean; + recursive?: boolean; }; type readDirCallback = (err: Error | null, files: string[]) => void; @@ -30,12 +32,12 @@ type readDirBoth = ( export function readdir( path: string | Buffer | URL, - options: { withFileTypes?: false; encoding?: string }, + options: readDirOptions, callback: readDirCallback, ): void; export function readdir( path: string | Buffer | URL, - options: { withFileTypes: true; encoding?: string }, + options: readDirOptions, callback: readDirCallbackDirent, ): void; export function readdir(path: string | URL, callback: readDirCallback): void; @@ -51,8 +53,7 @@ export function readdir( const options = typeof optionsOrCallback === "object" ? optionsOrCallback : null; - const result: Array = []; - path = getValidatedPath(path); + path = getValidatedPath(path).toString(); if (!callback) throw new Error("No callback function supplied"); @@ -66,24 +67,44 @@ export function readdir( } } - try { - path = path.toString(); - asyncIterableToCallback(Deno.readDir(path), (val, done) => { - if (typeof path !== "string") return; - if (done) { - callback(null, result); + const result: Array = []; + const dirs = [path]; + let current: string | undefined; + (async () => { + while ((current = dirs.shift()) !== undefined) { + try { + const entries = await op_fs_read_dir_async(current); + + for (let i = 0; i < entries.length; i++) { + const entry = entries[i]; + if (options?.recursive && entry.isDirectory) { + dirs.push(join(current, entry.name)); + } + + if (options?.withFileTypes) { + entry.parentPath = current; + result.push(toDirent(entry)); + } else { + let name = decode(entry.name, options?.encoding); + if (options?.recursive) { + name = relative(path, join(current, name)); + } + result.push(name); + } + } + } catch (err) { + callback( + denoErrorToNodeError(err as Error, { + syscall: "readdir", + path: current, + }), + ); return; } - if (options?.withFileTypes) { - val.parentPath = path; - result.push(toDirent(val)); - } else result.push(decode(val.name)); - }, (e) => { - callback(denoErrorToNodeError(e as Error, { syscall: "readdir" })); - }); - } catch (e) { - callback(denoErrorToNodeError(e as Error, { syscall: "readdir" })); - } + } + + callback(null, result); + })(); } function decode(str: string, encoding?: string): string { @@ -118,8 +139,7 @@ export function readdirSync( path: string | Buffer | URL, options?: readDirOptions, ): Array { - const result = []; - path = getValidatedPath(path); + path = getValidatedPath(path).toString(); if (options?.encoding) { try { @@ -131,16 +151,37 @@ export function readdirSync( } } - try { - path = path.toString(); - for (const file of Deno.readDirSync(path)) { - if (options?.withFileTypes) { - file.parentPath = path; - result.push(toDirent(file)); - } else result.push(decode(file.name)); + const result: Array = []; + const dirs = [path]; + let current: string | undefined; + while ((current = dirs.shift()) !== undefined) { + try { + const entries = op_fs_read_dir_sync(current); + + for (let i = 0; i < entries.length; i++) { + const entry = entries[i]; + if (options?.recursive && entry.isDirectory) { + dirs.push(join(current, entry.name)); + } + + if (options?.withFileTypes) { + entry.parentPath = current; + result.push(toDirent(entry)); + } else { + let name = decode(entry.name, options?.encoding); + if (options?.recursive) { + name = relative(path, join(current, name)); + } + result.push(name); + } + } + } catch (e) { + throw denoErrorToNodeError(e as Error, { + syscall: "readdir", + path: current, + }); } - } catch (e) { - throw denoErrorToNodeError(e as Error, { syscall: "readdir" }); } + return result; } diff --git a/tests/unit_node/_fs/_fs_readdir_test.ts b/tests/unit_node/_fs/_fs_readdir_test.ts index 8e5b46fc8a..3e36b1dc2d 100644 --- a/tests/unit_node/_fs/_fs_readdir_test.ts +++ b/tests/unit_node/_fs/_fs_readdir_test.ts @@ -53,6 +53,29 @@ Deno.test({ }, }); +Deno.test("ASYNC: read dirs recursively", async () => { + const dir = Deno.makeTempDirSync(); + Deno.writeTextFileSync(join(dir, "file1.txt"), "hi"); + Deno.mkdirSync(join(dir, "sub")); + Deno.writeTextFileSync(join(dir, "sub", "file2.txt"), "hi"); + + try { + const files = await new Promise((resolve, reject) => { + readdir(dir, { recursive: true }, (err, files) => { + if (err) reject(err); + resolve(files.map((f) => f.toString())); + }); + }); + + assertEqualsArrayAnyOrder( + files, + ["file1.txt", "sub", join("sub", "file2.txt")], + ); + } finally { + Deno.removeSync(dir, { recursive: true }); + } +}); + Deno.test({ name: "SYNC: reading empty the directory", fn() { @@ -75,6 +98,26 @@ Deno.test({ }, }); +Deno.test("SYNC: read dirs recursively", () => { + const dir = Deno.makeTempDirSync(); + Deno.writeTextFileSync(join(dir, "file1.txt"), "hi"); + Deno.mkdirSync(join(dir, "sub")); + Deno.writeTextFileSync(join(dir, "sub", "file2.txt"), "hi"); + + try { + const files = readdirSync(dir, { recursive: true }).map((f) => + f.toString() + ); + + assertEqualsArrayAnyOrder( + files, + ["file1.txt", "sub", join("sub", "file2.txt")], + ); + } finally { + Deno.removeSync(dir, { recursive: true }); + } +}); + Deno.test("[std/node/fs] readdir callback isn't called twice if error is thrown", async () => { // The correct behaviour is not to catch any errors thrown, // but that means there'll be an uncaught error and the test will fail. From d5b63bb642ac6dd1578858836490a686275596ef Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Tue, 3 Dec 2024 16:35:46 +0100 Subject: [PATCH 206/227] fix(task): only pass args to root task (#27213) When we run `deno task` with args like `deno task foo arg` the argument should only be passed to the root task, not to its dependencies. Fixes https://github.com/denoland/deno/issues/27206 --- cli/tools/task.rs | 40 +++++++++++++++---- tests/specs/task/dependencies/__test__.jsonc | 5 +++ .../task/dependencies/arg_task_with_deps.out | 4 ++ .../dependencies/arg_task_with_deps/deno.json | 9 +++++ 4 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 tests/specs/task/dependencies/arg_task_with_deps.out create mode 100644 tests/specs/task/dependencies/arg_task_with_deps/deno.json diff --git a/cli/tools/task.rs b/cli/tools/task.rs index a2f76aaf1f..21919be3c3 100644 --- a/cli/tools/task.rs +++ b/cli/tools/task.rs @@ -241,12 +241,15 @@ pub async fn execute_script( description: None, }, kill_signal, + cli_options.argv(), ) .await; } for task_config in &packages_task_configs { - let exit_code = task_runner.run_tasks(task_config, &kill_signal).await?; + let exit_code = task_runner + .run_tasks(task_config, &kill_signal, cli_options.argv()) + .await?; if exit_code > 0 { return Ok(exit_code); } @@ -263,6 +266,7 @@ struct RunSingleOptions<'a> { cwd: &'a Path, custom_commands: HashMap>, kill_signal: KillSignal, + argv: &'a [String], } struct TaskRunner<'a> { @@ -279,9 +283,10 @@ impl<'a> TaskRunner<'a> { &self, pkg_tasks_config: &PackageTaskInfo, kill_signal: &KillSignal, + argv: &[String], ) -> Result { match sort_tasks_topo(pkg_tasks_config) { - Ok(sorted) => self.run_tasks_in_parallel(sorted, kill_signal).await, + Ok(sorted) => self.run_tasks_in_parallel(sorted, kill_signal, argv).await, Err(err) => match err { TaskError::NotFound(name) => { if self.task_flags.is_run { @@ -317,6 +322,7 @@ impl<'a> TaskRunner<'a> { &self, tasks: Vec>, kill_signal: &KillSignal, + args: &[String], ) -> Result { struct PendingTasksContext<'a> { completed: HashSet, @@ -338,13 +344,21 @@ impl<'a> TaskRunner<'a> { &mut self, runner: &'b TaskRunner<'b>, kill_signal: &KillSignal, + argv: &'a [String], ) -> Option< LocalBoxFuture<'b, Result<(i32, &'a ResolvedTask<'a>), AnyError>>, > where 'a: 'b, { - for task in self.tasks.iter() { + let mut tasks_iter = self.tasks.iter().peekable(); + while let Some(task) = tasks_iter.next() { + let args = if tasks_iter.peek().is_none() { + argv + } else { + &[] + }; + if self.completed.contains(&task.id) || self.running.contains(&task.id) { @@ -366,7 +380,13 @@ impl<'a> TaskRunner<'a> { match task.task_or_script { TaskOrScript::Task(_, def) => { runner - .run_deno_task(task.folder_url, task.name, def, kill_signal) + .run_deno_task( + task.folder_url, + task.name, + def, + kill_signal, + args, + ) .await } TaskOrScript::Script(scripts, _) => { @@ -376,6 +396,7 @@ impl<'a> TaskRunner<'a> { task.name, scripts, kill_signal, + args, ) .await } @@ -399,7 +420,7 @@ impl<'a> TaskRunner<'a> { while context.has_remaining_tasks() { while queue.len() < self.concurrency { - if let Some(task) = context.get_next_task(self, kill_signal) { + if let Some(task) = context.get_next_task(self, kill_signal, args) { queue.push(task); } else { break; @@ -429,6 +450,7 @@ impl<'a> TaskRunner<'a> { task_name: &str, definition: &TaskDefinition, kill_signal: KillSignal, + argv: &'a [String], ) -> Result { let cwd = match &self.task_flags.cwd { Some(path) => canonicalize_path(&PathBuf::from(path)) @@ -447,6 +469,7 @@ impl<'a> TaskRunner<'a> { cwd: &cwd, custom_commands, kill_signal, + argv, }) .await } @@ -457,6 +480,7 @@ impl<'a> TaskRunner<'a> { task_name: &str, scripts: &IndexMap, kill_signal: KillSignal, + argv: &[String], ) -> Result { // ensure the npm packages are installed if using a managed resolver if let Some(npm_resolver) = self.npm_resolver.as_managed() { @@ -489,6 +513,7 @@ impl<'a> TaskRunner<'a> { cwd: &cwd, custom_commands: custom_commands.clone(), kill_signal: kill_signal.clone(), + argv, }) .await?; if exit_code > 0 { @@ -510,11 +535,12 @@ impl<'a> TaskRunner<'a> { cwd, custom_commands, kill_signal, + argv, } = opts; output_task( opts.task_name, - &task_runner::get_script_with_args(script, self.cli_options.argv()), + &task_runner::get_script_with_args(script, argv), ); Ok( @@ -525,7 +551,7 @@ impl<'a> TaskRunner<'a> { env_vars: self.env_vars.clone(), custom_commands, init_cwd: self.cli_options.initial_cwd(), - argv: self.cli_options.argv(), + argv, root_node_modules_dir: self.npm_resolver.root_node_modules_path(), stdio: None, kill_signal, diff --git a/tests/specs/task/dependencies/__test__.jsonc b/tests/specs/task/dependencies/__test__.jsonc index 38d085d796..84c98f11a4 100644 --- a/tests/specs/task/dependencies/__test__.jsonc +++ b/tests/specs/task/dependencies/__test__.jsonc @@ -56,6 +56,11 @@ "args": "task a", "output": "./cycle_2.out", "exitCode": 1 + }, + "arg_task_with_deps": { + "cwd": "arg_task_with_deps", + "args": "task a a", + "output": "./arg_task_with_deps.out" } } } diff --git a/tests/specs/task/dependencies/arg_task_with_deps.out b/tests/specs/task/dependencies/arg_task_with_deps.out new file mode 100644 index 0000000000..ce4a26f447 --- /dev/null +++ b/tests/specs/task/dependencies/arg_task_with_deps.out @@ -0,0 +1,4 @@ +Task b echo 'b' +b +Task a echo "a" +a diff --git a/tests/specs/task/dependencies/arg_task_with_deps/deno.json b/tests/specs/task/dependencies/arg_task_with_deps/deno.json new file mode 100644 index 0000000000..3b6dcf7c80 --- /dev/null +++ b/tests/specs/task/dependencies/arg_task_with_deps/deno.json @@ -0,0 +1,9 @@ +{ + "tasks": { + "a": { + "command": "echo", + "dependencies": ["b"] + }, + "b": "echo 'b'" + } +} From 8cd257de3dbdb94f0ddabcc262ff335c98ca314c Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 3 Dec 2024 19:44:56 -0500 Subject: [PATCH 207/227] refactor: remove `CliNpmRegistryApi` (#27222) Extracts more code out of the CLI. --- cli/lsp/diagnostics.rs | 2 +- cli/npm/managed/mod.rs | 54 +++-- cli/npm/managed/registry.rs | 201 ------------------ cli/npm/managed/resolution.rs | 39 ++-- resolvers/npm_cache/lib.rs | 2 +- resolvers/npm_cache/registry_info.rs | 188 +++++++++++++--- resolvers/npm_cache/tarball.rs | 12 +- tests/integration/lsp_tests.rs | 12 +- tests/integration/npm_tests.rs | 2 +- .../npm/cached_only/cached_only/main.out | 3 +- .../npm/npmrc_bad_registry_config/main.out | 6 +- tests/specs/npm/npmrc_bad_token/main.out | 6 +- .../npmrc_password_no_username/install.out | 7 +- .../npmrc_username_no_password/install.out | 7 +- tests/testdata/npm/cached_only/main.out | 2 +- 15 files changed, 242 insertions(+), 301 deletions(-) delete mode 100644 cli/npm/managed/registry.rs diff --git a/cli/lsp/diagnostics.rs b/cli/lsp/diagnostics.rs index 1b72953c1b..ac4d8c01e4 100644 --- a/cli/lsp/diagnostics.rs +++ b/cli/lsp/diagnostics.rs @@ -1262,7 +1262,7 @@ impl DenoDiagnostic { Self::NoAttributeType => (lsp::DiagnosticSeverity::ERROR, "The module is a JSON module and not being imported with an import attribute. Consider adding `with { type: \"json\" }` to the import statement.".to_string(), None), Self::NoCache(specifier) => (lsp::DiagnosticSeverity::ERROR, format!("Uncached or missing remote URL: {specifier}"), Some(json!({ "specifier": specifier }))), Self::NotInstalledJsr(pkg_req, specifier) => (lsp::DiagnosticSeverity::ERROR, format!("JSR package \"{pkg_req}\" is not installed or doesn't exist."), Some(json!({ "specifier": specifier }))), - Self::NotInstalledNpm(pkg_req, specifier) => (lsp::DiagnosticSeverity::ERROR, format!("NPM package \"{pkg_req}\" is not installed or doesn't exist."), Some(json!({ "specifier": specifier }))), + Self::NotInstalledNpm(pkg_req, specifier) => (lsp::DiagnosticSeverity::ERROR, format!("npm package \"{pkg_req}\" is not installed or doesn't exist."), Some(json!({ "specifier": specifier }))), Self::NoLocal(specifier) => { let maybe_sloppy_resolution = CliSloppyImportsResolver::new( SloppyImportsCachedFs::new(Arc::new(deno_fs::RealFs)) diff --git a/cli/npm/managed/mod.rs b/cli/npm/managed/mod.rs index da39f55e85..5ed25f8272 100644 --- a/cli/npm/managed/mod.rs +++ b/cli/npm/managed/mod.rs @@ -44,7 +44,6 @@ use crate::util::fs::canonicalize_path_maybe_not_exists_with_fs; use crate::util::progress_bar::ProgressBar; use crate::util::sync::AtomicFlag; -use self::registry::CliNpmRegistryApi; use self::resolution::NpmResolution; use self::resolvers::create_npm_fs_resolver; use self::resolvers::NpmPackageFsResolver; @@ -57,7 +56,6 @@ use super::CliNpmTarballCache; use super::InnerCliNpmResolverRef; use super::ResolvePkgFolderFromDenoReqError; -mod registry; mod resolution; mod resolvers; @@ -120,13 +118,13 @@ pub async fn create_managed_npm_resolver( ) -> Result, AnyError> { let npm_cache_env = create_cache_env(&options); let npm_cache = create_cache(npm_cache_env.clone(), &options); - let npm_api = create_api(npm_cache.clone(), npm_cache_env.clone(), &options); - let snapshot = resolve_snapshot(&npm_api, options.snapshot).await?; + let api = create_api(npm_cache.clone(), npm_cache_env.clone(), &options); + let snapshot = resolve_snapshot(&api, options.snapshot).await?; Ok(create_inner( npm_cache_env, options.fs, options.maybe_lockfile, - npm_api, + api, npm_cache, options.npmrc, options.npm_install_deps_provider, @@ -143,7 +141,7 @@ fn create_inner( env: Arc, fs: Arc, maybe_lockfile: Option>, - npm_api: Arc, + registry_info_provider: Arc, npm_cache: Arc, npm_rc: Arc, npm_install_deps_provider: Arc, @@ -154,7 +152,7 @@ fn create_inner( lifecycle_scripts: LifecycleScriptsConfig, ) -> Arc { let resolution = Arc::new(NpmResolution::from_serialized( - npm_api.clone(), + registry_info_provider.clone(), snapshot, maybe_lockfile.clone(), )); @@ -178,7 +176,7 @@ fn create_inner( fs, fs_resolver, maybe_lockfile, - npm_api, + registry_info_provider, npm_cache, npm_install_deps_provider, resolution, @@ -215,29 +213,29 @@ fn create_api( cache: Arc, env: Arc, options: &CliManagedNpmResolverCreateOptions, -) -> Arc { - Arc::new(CliNpmRegistryApi::new( - cache.clone(), - Arc::new(CliNpmRegistryInfoProvider::new( - cache, - env, - options.npmrc.clone(), - )), +) -> Arc { + Arc::new(CliNpmRegistryInfoProvider::new( + cache, + env, + options.npmrc.clone(), )) } async fn resolve_snapshot( - api: &CliNpmRegistryApi, + registry_info_provider: &Arc, snapshot: CliNpmResolverManagedSnapshotOption, ) -> Result, AnyError> { match snapshot { CliNpmResolverManagedSnapshotOption::ResolveFromLockfile(lockfile) => { if !lockfile.overwrite() { - let snapshot = snapshot_from_lockfile(lockfile.clone(), api) - .await - .with_context(|| { - format!("failed reading lockfile '{}'", lockfile.filename.display()) - })?; + let snapshot = snapshot_from_lockfile( + lockfile.clone(), + ®istry_info_provider.as_npm_registry_api(), + ) + .await + .with_context(|| { + format!("failed reading lockfile '{}'", lockfile.filename.display()) + })?; Ok(Some(snapshot)) } else { Ok(None) @@ -304,7 +302,7 @@ pub struct ManagedCliNpmResolver { fs: Arc, fs_resolver: Arc, maybe_lockfile: Option>, - npm_api: Arc, + registry_info_provider: Arc, npm_cache: Arc, npm_install_deps_provider: Arc, resolution: Arc, @@ -329,7 +327,7 @@ impl ManagedCliNpmResolver { fs: Arc, fs_resolver: Arc, maybe_lockfile: Option>, - npm_api: Arc, + registry_info_provider: Arc, npm_cache: Arc, npm_install_deps_provider: Arc, resolution: Arc, @@ -342,7 +340,7 @@ impl ManagedCliNpmResolver { fs, fs_resolver, maybe_lockfile, - npm_api, + registry_info_provider, npm_cache, npm_install_deps_provider, text_only_progress_bar, @@ -588,7 +586,7 @@ impl ManagedCliNpmResolver { ) -> Result, AnyError> { // this will internally cache the package information self - .npm_api + .registry_info_provider .package_info(package_name) .await .map_err(|err| err.into()) @@ -684,7 +682,7 @@ impl CliNpmResolver for ManagedCliNpmResolver { fn clone_snapshotted(&self) -> Arc { // create a new snapshotted npm resolution and resolver let npm_resolution = Arc::new(NpmResolution::new( - self.npm_api.clone(), + self.registry_info_provider.clone(), self.resolution.snapshot(), self.maybe_lockfile.clone(), )); @@ -703,7 +701,7 @@ impl CliNpmResolver for ManagedCliNpmResolver { self.lifecycle_scripts.clone(), ), self.maybe_lockfile.clone(), - self.npm_api.clone(), + self.registry_info_provider.clone(), self.npm_cache.clone(), self.npm_install_deps_provider.clone(), npm_resolution, diff --git a/cli/npm/managed/registry.rs b/cli/npm/managed/registry.rs deleted file mode 100644 index b431c77c5d..0000000000 --- a/cli/npm/managed/registry.rs +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -use std::collections::HashMap; -use std::collections::HashSet; -use std::sync::Arc; - -use async_trait::async_trait; -use deno_core::anyhow::anyhow; -use deno_core::error::AnyError; -use deno_core::futures::future::BoxFuture; -use deno_core::futures::future::Shared; -use deno_core::futures::FutureExt; -use deno_core::parking_lot::Mutex; -use deno_npm::registry::NpmPackageInfo; -use deno_npm::registry::NpmRegistryApi; -use deno_npm::registry::NpmRegistryPackageInfoLoadError; -use deno_npm_cache::NpmCacheSetting; - -use crate::npm::CliNpmCache; -use crate::npm::CliNpmRegistryInfoProvider; -use crate::util::sync::AtomicFlag; - -// todo(#27198): Remove this and move functionality down into -// RegistryInfoProvider, which already does most of this. -#[derive(Debug)] -pub struct CliNpmRegistryApi(Option>); - -impl CliNpmRegistryApi { - pub fn new( - cache: Arc, - registry_info_provider: Arc, - ) -> Self { - Self(Some(Arc::new(CliNpmRegistryApiInner { - cache, - force_reload_flag: Default::default(), - mem_cache: Default::default(), - previously_reloaded_packages: Default::default(), - registry_info_provider, - }))) - } - - /// Clears the internal memory cache. - pub fn clear_memory_cache(&self) { - self.inner().clear_memory_cache(); - } - - fn inner(&self) -> &Arc { - // this panicking indicates a bug in the code where this - // wasn't initialized - self.0.as_ref().unwrap() - } -} - -#[async_trait(?Send)] -impl NpmRegistryApi for CliNpmRegistryApi { - async fn package_info( - &self, - name: &str, - ) -> Result, NpmRegistryPackageInfoLoadError> { - match self.inner().maybe_package_info(name).await { - Ok(Some(info)) => Ok(info), - Ok(None) => Err(NpmRegistryPackageInfoLoadError::PackageNotExists { - package_name: name.to_string(), - }), - Err(err) => { - Err(NpmRegistryPackageInfoLoadError::LoadError(Arc::new(err))) - } - } - } - - fn mark_force_reload(&self) -> bool { - self.inner().mark_force_reload() - } -} - -type CacheItemPendingResult = - Result>, Arc>; - -#[derive(Debug)] -enum CacheItem { - Pending(Shared>), - Resolved(Option>), -} - -#[derive(Debug)] -struct CliNpmRegistryApiInner { - cache: Arc, - force_reload_flag: AtomicFlag, - mem_cache: Mutex>, - previously_reloaded_packages: Mutex>, - registry_info_provider: Arc, -} - -impl CliNpmRegistryApiInner { - pub async fn maybe_package_info( - self: &Arc, - name: &str, - ) -> Result>, AnyError> { - let (created, future) = { - let mut mem_cache = self.mem_cache.lock(); - match mem_cache.get(name) { - Some(CacheItem::Resolved(maybe_info)) => { - return Ok(maybe_info.clone()); - } - Some(CacheItem::Pending(future)) => (false, future.clone()), - None => { - let future = { - let api = self.clone(); - let name = name.to_string(); - async move { - if (api.cache.cache_setting().should_use_for_npm_package(&name) && !api.force_reload_flag.is_raised()) - // if this has been previously reloaded, then try loading from the - // file system cache - || !api.previously_reloaded_packages.lock().insert(name.to_string()) - { - // attempt to load from the file cache - if let Some(info) = api.load_file_cached_package_info(&name).await { - let result = Some(Arc::new(info)); - return Ok(result); - } - } - api.registry_info_provider - .load_package_info(&name) - .await - .map_err(Arc::new) - } - .boxed() - .shared() - }; - mem_cache - .insert(name.to_string(), CacheItem::Pending(future.clone())); - (true, future) - } - } - }; - - if created { - match future.await { - Ok(maybe_info) => { - // replace the cache item to say it's resolved now - self - .mem_cache - .lock() - .insert(name.to_string(), CacheItem::Resolved(maybe_info.clone())); - Ok(maybe_info) - } - Err(err) => { - // purge the item from the cache so it loads next time - self.mem_cache.lock().remove(name); - Err(anyhow!("{:#}", err)) - } - } - } else { - Ok(future.await.map_err(|err| anyhow!("{:#}", err))?) - } - } - - fn mark_force_reload(&self) -> bool { - // never force reload the registry information if reloading - // is disabled or if we're already reloading - if matches!( - self.cache.cache_setting(), - NpmCacheSetting::Only | NpmCacheSetting::ReloadAll - ) { - return false; - } - if self.force_reload_flag.raise() { - self.clear_memory_cache(); - true - } else { - false - } - } - - async fn load_file_cached_package_info( - &self, - name: &str, - ) -> Option { - let result = deno_core::unsync::spawn_blocking({ - let cache = self.cache.clone(); - let name = name.to_string(); - move || cache.load_package_info(&name) - }) - .await - .unwrap(); - match result { - Ok(value) => value, - Err(err) => { - if cfg!(debug_assertions) { - panic!("error loading cached npm package info for {name}: {err:#}"); - } else { - None - } - } - } - } - - fn clear_memory_cache(&self) { - self.mem_cache.lock().clear(); - } -} diff --git a/cli/npm/managed/resolution.rs b/cli/npm/managed/resolution.rs index 033c853233..66cc6a7428 100644 --- a/cli/npm/managed/resolution.rs +++ b/cli/npm/managed/resolution.rs @@ -27,10 +27,9 @@ use deno_semver::package::PackageReq; use deno_semver::VersionReq; use crate::args::CliLockfile; +use crate::npm::CliNpmRegistryInfoProvider; use crate::util::sync::SyncReadAsyncWriteLock; -use super::CliNpmRegistryApi; - pub struct AddPkgReqsResult { /// Results from adding the individual packages. /// @@ -47,7 +46,7 @@ pub struct AddPkgReqsResult { /// /// This does not interact with the file system. pub struct NpmResolution { - api: Arc, + registry_info_provider: Arc, snapshot: SyncReadAsyncWriteLock, maybe_lockfile: Option>, } @@ -63,22 +62,22 @@ impl std::fmt::Debug for NpmResolution { impl NpmResolution { pub fn from_serialized( - api: Arc, + registry_info_provider: Arc, initial_snapshot: Option, maybe_lockfile: Option>, ) -> Self { let snapshot = NpmResolutionSnapshot::new(initial_snapshot.unwrap_or_default()); - Self::new(api, snapshot, maybe_lockfile) + Self::new(registry_info_provider, snapshot, maybe_lockfile) } pub fn new( - api: Arc, + registry_info_provider: Arc, initial_snapshot: NpmResolutionSnapshot, maybe_lockfile: Option>, ) -> Self { Self { - api, + registry_info_provider, snapshot: SyncReadAsyncWriteLock::new(initial_snapshot), maybe_lockfile, } @@ -91,7 +90,7 @@ impl NpmResolution { // only allow one thread in here at a time let snapshot_lock = self.snapshot.acquire().await; let result = add_package_reqs_to_snapshot( - &self.api, + &self.registry_info_provider, package_reqs, self.maybe_lockfile.clone(), || snapshot_lock.read().clone(), @@ -119,7 +118,7 @@ impl NpmResolution { let reqs_set = package_reqs.iter().collect::>(); let snapshot = add_package_reqs_to_snapshot( - &self.api, + &self.registry_info_provider, package_reqs, self.maybe_lockfile.clone(), || { @@ -259,7 +258,7 @@ impl NpmResolution { } async fn add_package_reqs_to_snapshot( - api: &CliNpmRegistryApi, + registry_info_provider: &Arc, package_reqs: &[PackageReq], maybe_lockfile: Option>, get_new_snapshot: impl Fn() -> NpmResolutionSnapshot, @@ -282,26 +281,28 @@ async fn add_package_reqs_to_snapshot( /* this string is used in tests */ "Running npm resolution." ); + let npm_registry_api = registry_info_provider.as_npm_registry_api(); let result = snapshot - .add_pkg_reqs(api, get_add_pkg_reqs_options(package_reqs)) + .add_pkg_reqs(&npm_registry_api, get_add_pkg_reqs_options(package_reqs)) .await; - api.clear_memory_cache(); let result = match &result.dep_graph_result { - Err(NpmResolutionError::Resolution(err)) if api.mark_force_reload() => { + Err(NpmResolutionError::Resolution(err)) + if npm_registry_api.mark_force_reload() => + { log::debug!("{err:#}"); log::debug!("npm resolution failed. Trying again..."); - // try again + // try again with forced reloading let snapshot = get_new_snapshot(); - let result = snapshot - .add_pkg_reqs(api, get_add_pkg_reqs_options(package_reqs)) - .await; - api.clear_memory_cache(); - result + snapshot + .add_pkg_reqs(&npm_registry_api, get_add_pkg_reqs_options(package_reqs)) + .await } _ => result, }; + registry_info_provider.clear_memory_cache(); + if let Ok(snapshot) = &result.dep_graph_result { if let Some(lockfile) = maybe_lockfile { populate_lockfile_from_snapshot(&lockfile, snapshot); diff --git a/resolvers/npm_cache/lib.rs b/resolvers/npm_cache/lib.rs index 4e8966a4e1..9f5424dc46 100644 --- a/resolvers/npm_cache/lib.rs +++ b/resolvers/npm_cache/lib.rs @@ -42,7 +42,7 @@ pub struct DownloadError { impl std::error::Error for DownloadError { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - Some(self.error.as_ref()) + self.error.source() } } diff --git a/resolvers/npm_cache/registry_info.rs b/resolvers/npm_cache/registry_info.rs index 7ab50f0495..543ddadc5a 100644 --- a/resolvers/npm_cache/registry_info.rs +++ b/resolvers/npm_cache/registry_info.rs @@ -1,14 +1,19 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. use std::collections::HashMap; +use std::collections::HashSet; use std::sync::Arc; use anyhow::anyhow; use anyhow::bail; use anyhow::Context; use anyhow::Error as AnyError; +use async_trait::async_trait; use deno_npm::npm_rc::ResolvedNpmRc; use deno_npm::registry::NpmPackageInfo; +use deno_npm::registry::NpmRegistryApi; +use deno_npm::registry::NpmRegistryPackageInfoLoadError; +use deno_unsync::sync::AtomicFlag; use deno_unsync::sync::MultiRuntimeAsyncValueCreator; use futures::future::LocalBoxFuture; use futures::FutureExt; @@ -43,8 +48,49 @@ enum MemoryCacheItem { MemoryCached(Result>, Arc>), } -// todo(#27198): refactor to store this only in the http cache and also -// consolidate with CliNpmRegistryApi. +#[derive(Debug, Default)] +struct MemoryCache { + clear_id: usize, + items: HashMap, +} + +impl MemoryCache { + #[inline(always)] + pub fn clear(&mut self) { + self.clear_id += 1; + self.items.clear(); + } + + #[inline(always)] + pub fn get(&self, key: &str) -> Option<&MemoryCacheItem> { + self.items.get(key) + } + + #[inline(always)] + pub fn insert(&mut self, key: String, value: MemoryCacheItem) { + self.items.insert(key, value); + } + + #[inline(always)] + pub fn try_insert( + &mut self, + clear_id: usize, + key: &str, + value: MemoryCacheItem, + ) -> bool { + if clear_id != self.clear_id { + return false; + } + // if the clear_id is the same then the item should exist + debug_assert!(self.items.contains_key(key)); + if let Some(item) = self.items.get_mut(key) { + *item = value; + } + true + } +} + +// todo(#27198): refactor to store this only in the http cache /// Downloads packuments from the npm registry. /// @@ -55,7 +101,9 @@ pub struct RegistryInfoProvider { cache: Arc>, env: Arc, npmrc: Arc, - memory_cache: Mutex>, + force_reload_flag: AtomicFlag, + memory_cache: Mutex, + previously_loaded_packages: Mutex>, } impl RegistryInfoProvider { @@ -68,17 +116,60 @@ impl RegistryInfoProvider { cache, env, npmrc, + force_reload_flag: AtomicFlag::lowered(), memory_cache: Default::default(), + previously_loaded_packages: Default::default(), } } - pub async fn load_package_info( + /// Clears the internal memory cache. + pub fn clear_memory_cache(&self) { + self.memory_cache.lock().clear(); + } + + fn mark_force_reload(&self) -> bool { + // never force reload the registry information if reloading + // is disabled or if we're already reloading + if matches!( + self.cache.cache_setting(), + NpmCacheSetting::Only | NpmCacheSetting::ReloadAll + ) { + return false; + } + if self.force_reload_flag.raise() { + self.clear_memory_cache(); + true + } else { + false + } + } + + pub fn as_npm_registry_api(self: &Arc) -> NpmRegistryApiAdapter { + NpmRegistryApiAdapter(self.clone()) + } + + pub async fn package_info( + self: &Arc, + name: &str, + ) -> Result, NpmRegistryPackageInfoLoadError> { + match self.maybe_package_info(name).await { + Ok(Some(info)) => Ok(info), + Ok(None) => Err(NpmRegistryPackageInfoLoadError::PackageNotExists { + package_name: name.to_string(), + }), + Err(err) => { + Err(NpmRegistryPackageInfoLoadError::LoadError(Arc::new(err))) + } + } + } + + pub async fn maybe_package_info( self: &Arc, name: &str, ) -> Result>, AnyError> { self.load_package_info_inner(name).await.with_context(|| { format!( - "Error getting response at {} for package \"{}\"", + "Failed loading {} for package \"{}\"", get_package_url(&self.npmrc, name), name ) @@ -89,18 +180,9 @@ impl RegistryInfoProvider { self: &Arc, name: &str, ) -> Result>, AnyError> { - if *self.cache.cache_setting() == NpmCacheSetting::Only { - return Err(deno_core::error::custom_error( - "NotCached", - format!( - "An npm specifier not found in cache: \"{name}\", --cached-only is specified." - ) - )); - } - - let cache_item = { + let (cache_item, clear_id) = { let mut mem_cache = self.memory_cache.lock(); - if let Some(cache_item) = mem_cache.get(name) { + let cache_item = if let Some(cache_item) = mem_cache.get(name) { cache_item.clone() } else { let value_creator = MultiRuntimeAsyncValueCreator::new({ @@ -111,7 +193,8 @@ impl RegistryInfoProvider { let cache_item = MemoryCacheItem::Pending(Arc::new(value_creator)); mem_cache.insert(name.to_string(), cache_item.clone()); cache_item - } + }; + (cache_item, mem_cache.clear_id) }; match cache_item { @@ -130,25 +213,37 @@ impl RegistryInfoProvider { Ok(FutureResult::SavedFsCache(info)) => { // return back the future and mark this package as having // been saved in the cache for next time it's requested - *self.memory_cache.lock().get_mut(name).unwrap() = - MemoryCacheItem::FsCached; + self.memory_cache.lock().try_insert( + clear_id, + name, + MemoryCacheItem::FsCached, + ); Ok(Some(info)) } Ok(FutureResult::ErroredFsCache(info)) => { // since saving to the fs cache failed, keep the package information in memory - *self.memory_cache.lock().get_mut(name).unwrap() = - MemoryCacheItem::MemoryCached(Ok(Some(info.clone()))); + self.memory_cache.lock().try_insert( + clear_id, + name, + MemoryCacheItem::MemoryCached(Ok(Some(info.clone()))), + ); Ok(Some(info)) } Ok(FutureResult::PackageNotExists) => { - *self.memory_cache.lock().get_mut(name).unwrap() = - MemoryCacheItem::MemoryCached(Ok(None)); + self.memory_cache.lock().try_insert( + clear_id, + name, + MemoryCacheItem::MemoryCached(Ok(None)), + ); Ok(None) } Err(err) => { - let return_err = anyhow!("{}", err); - *self.memory_cache.lock().get_mut(name).unwrap() = - MemoryCacheItem::MemoryCached(Err(err)); + let return_err = anyhow!("{:#}", err); + self.memory_cache.lock().try_insert( + clear_id, + name, + MemoryCacheItem::MemoryCached(Err(err)), + ); Err(return_err) } } @@ -196,6 +291,29 @@ impl RegistryInfoProvider { }; let name = name.to_string(); async move { + if (downloader.cache.cache_setting().should_use_for_npm_package(&name) && !downloader.force_reload_flag.is_raised()) + // if this has been previously reloaded, then try loading from the + // file system cache + || downloader.previously_loaded_packages.lock().contains(&name) + { + // attempt to load from the file cache + if let Some(info) = downloader.cache.load_package_info(&name)? { + let result = Arc::new(info); + return Ok(FutureResult::SavedFsCache(result)); + } + } + + if *downloader.cache.cache_setting() == NpmCacheSetting::Only { + return Err(deno_core::error::custom_error( + "NotCached", + format!( + "npm package not found in cache: \"{name}\", --cached-only is specified." + ) + )); + } + + downloader.previously_loaded_packages.lock().insert(name.to_string()); + let maybe_bytes = downloader .env .download_with_retries_on_any_tokio_runtime( @@ -234,6 +352,24 @@ impl RegistryInfoProvider { } } +pub struct NpmRegistryApiAdapter( + Arc>, +); + +#[async_trait(?Send)] +impl NpmRegistryApi for NpmRegistryApiAdapter { + async fn package_info( + &self, + name: &str, + ) -> Result, NpmRegistryPackageInfoLoadError> { + self.0.package_info(name).await + } + + fn mark_force_reload(&self) -> bool { + self.0.mark_force_reload() + } +} + // todo(#27198): make this private and only use RegistryInfoProvider in the rest of // the code pub fn get_package_url(npmrc: &ResolvedNpmRc, name: &str) -> Url { diff --git a/resolvers/npm_cache/tarball.rs b/resolvers/npm_cache/tarball.rs index 3102d811d1..5c8e460fd6 100644 --- a/resolvers/npm_cache/tarball.rs +++ b/resolvers/npm_cache/tarball.rs @@ -65,13 +65,13 @@ impl TarballCache { pub async fn ensure_package( self: &Arc, - package: &PackageNv, + package_nv: &PackageNv, dist: &NpmPackageVersionDistInfo, ) -> Result<(), AnyError> { self - .ensure_package_inner(package, dist) + .ensure_package_inner(package_nv, dist) .await - .with_context(|| format!("Failed caching npm package '{}'.", package)) + .with_context(|| format!("Failed caching npm package '{}'.", package_nv)) } async fn ensure_package_inner( @@ -100,7 +100,7 @@ impl TarballCache { match cache_item { MemoryCacheItem::Cached => Ok(()), - MemoryCacheItem::Errored(err) => Err(anyhow!("{}", err)), + MemoryCacheItem::Errored(err) => Err(anyhow!("{:#}", err)), MemoryCacheItem::Pending(creator) => { let result = creator.get().await; match result { @@ -110,7 +110,7 @@ impl TarballCache { Ok(()) } Err(err) => { - let result_err = anyhow!("{}", err); + let result_err = anyhow!("{:#}", err); *self.memory_cache.lock().get_mut(package_nv).unwrap() = MemoryCacheItem::Errored(err); Err(result_err) @@ -138,7 +138,7 @@ impl TarballCache { return Err(deno_core::error::custom_error( "NotCached", format!( - "An npm specifier not found in cache: \"{}\", --cached-only is specified.", + "npm package not found in cache: \"{}\", --cached-only is specified.", &package_nv.name ) ) diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 9ccd33c995..296da75315 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -6009,7 +6009,7 @@ fn lsp_code_actions_deno_cache_npm() { "severity": 1, "code": "not-installed-npm", "source": "deno", - "message": "NPM package \"chalk\" is not installed or doesn't exist.", + "message": "npm package \"chalk\" is not installed or doesn't exist.", "data": { "specifier": "npm:chalk" } }], "version": 1 @@ -6036,7 +6036,7 @@ fn lsp_code_actions_deno_cache_npm() { "severity": 1, "code": "not-installed-npm", "source": "deno", - "message": "NPM package \"chalk\" is not installed or doesn't exist.", + "message": "npm package \"chalk\" is not installed or doesn't exist.", "data": { "specifier": "npm:chalk" } }], "only": ["quickfix"] @@ -6056,7 +6056,7 @@ fn lsp_code_actions_deno_cache_npm() { "severity": 1, "code": "not-installed-npm", "source": "deno", - "message": "NPM package \"chalk\" is not installed or doesn't exist.", + "message": "npm package \"chalk\" is not installed or doesn't exist.", "data": { "specifier": "npm:chalk" } }], "command": { @@ -6111,7 +6111,7 @@ fn lsp_code_actions_deno_cache_all() { "severity": 1, "code": "not-installed-npm", "source": "deno", - "message": "NPM package \"chalk\" is not installed or doesn't exist.", + "message": "npm package \"chalk\" is not installed or doesn't exist.", "data": { "specifier": "npm:chalk" }, }, ], @@ -6199,7 +6199,7 @@ fn lsp_code_actions_deno_cache_all() { "severity": 1, "code": "not-installed-npm", "source": "deno", - "message": "NPM package \"chalk\" is not installed or doesn't exist.", + "message": "npm package \"chalk\" is not installed or doesn't exist.", "data": { "specifier": "npm:chalk" }, }, ], @@ -9860,7 +9860,7 @@ fn lsp_completions_node_builtin() { "severity": 1, "code": "not-installed-npm", "source": "deno", - "message": "NPM package \"@types/node\" is not installed or doesn't exist." + "message": "npm package \"@types/node\" is not installed or doesn't exist." } ]) ); diff --git a/tests/integration/npm_tests.rs b/tests/integration/npm_tests.rs index f8c6eebf39..ffd3b817d4 100644 --- a/tests/integration/npm_tests.rs +++ b/tests/integration/npm_tests.rs @@ -102,7 +102,7 @@ fn cached_only_after_first_run() { let stdout = String::from_utf8_lossy(&output.stdout); assert_contains!( stderr, - "An npm specifier not found in cache: \"ansi-styles\", --cached-only is specified." + "npm package not found in cache: \"ansi-styles\", --cached-only is specified." ); assert!(stdout.is_empty()); assert!(!output.status.success()); diff --git a/tests/specs/npm/cached_only/cached_only/main.out b/tests/specs/npm/cached_only/cached_only/main.out index 0d0cdad094..ea17167b14 100644 --- a/tests/specs/npm/cached_only/cached_only/main.out +++ b/tests/specs/npm/cached_only/cached_only/main.out @@ -1,2 +1,3 @@ -error: Error getting response at http://localhost:4260/chalk for package "chalk": An npm specifier not found in cache: "chalk", --cached-only is specified. +error: Failed loading http://localhost:4260/chalk for package "chalk" + 0: npm package not found in cache: "chalk", --cached-only is specified. at file:///[WILDCARD]/main.ts:1:19 diff --git a/tests/specs/npm/npmrc_bad_registry_config/main.out b/tests/specs/npm/npmrc_bad_registry_config/main.out index 5d778d32e9..d616829604 100644 --- a/tests/specs/npm/npmrc_bad_registry_config/main.out +++ b/tests/specs/npm/npmrc_bad_registry_config/main.out @@ -1,3 +1,5 @@ Download http://localhost:4261/@denotest%2fbasic -error: Error getting response at http://localhost:4261/@denotest%2fbasic for package "@denotest/basic": Bad response: 401 -[WILDCARD] \ No newline at end of file +error: Failed loading http://localhost:4261/@denotest%2fbasic for package "@denotest/basic" + +Caused by: + Bad response: 401 diff --git a/tests/specs/npm/npmrc_bad_token/main.out b/tests/specs/npm/npmrc_bad_token/main.out index 5d778d32e9..d616829604 100644 --- a/tests/specs/npm/npmrc_bad_token/main.out +++ b/tests/specs/npm/npmrc_bad_token/main.out @@ -1,3 +1,5 @@ Download http://localhost:4261/@denotest%2fbasic -error: Error getting response at http://localhost:4261/@denotest%2fbasic for package "@denotest/basic": Bad response: 401 -[WILDCARD] \ No newline at end of file +error: Failed loading http://localhost:4261/@denotest%2fbasic for package "@denotest/basic" + +Caused by: + Bad response: 401 diff --git a/tests/specs/npm/npmrc_password_no_username/install.out b/tests/specs/npm/npmrc_password_no_username/install.out index b198bcd27e..ceff6d5c97 100644 --- a/tests/specs/npm/npmrc_password_no_username/install.out +++ b/tests/specs/npm/npmrc_password_no_username/install.out @@ -1,3 +1,4 @@ -[UNORDERED_START] -error: Error getting response at http://localhost:4261/@denotest%2fbasic for package "@denotest/basic": Both the username and password must be provided for basic auth -[UNORDERED_END] +error: Failed loading http://localhost:4261/@denotest%2fbasic for package "@denotest/basic" + +Caused by: + Both the username and password must be provided for basic auth diff --git a/tests/specs/npm/npmrc_username_no_password/install.out b/tests/specs/npm/npmrc_username_no_password/install.out index b198bcd27e..ceff6d5c97 100644 --- a/tests/specs/npm/npmrc_username_no_password/install.out +++ b/tests/specs/npm/npmrc_username_no_password/install.out @@ -1,3 +1,4 @@ -[UNORDERED_START] -error: Error getting response at http://localhost:4261/@denotest%2fbasic for package "@denotest/basic": Both the username and password must be provided for basic auth -[UNORDERED_END] +error: Failed loading http://localhost:4261/@denotest%2fbasic for package "@denotest/basic" + +Caused by: + Both the username and password must be provided for basic auth diff --git a/tests/testdata/npm/cached_only/main.out b/tests/testdata/npm/cached_only/main.out index c4bfc1fc43..99ded2ec76 100644 --- a/tests/testdata/npm/cached_only/main.out +++ b/tests/testdata/npm/cached_only/main.out @@ -1,2 +1,2 @@ -error: Error getting response at http://localhost:4260/chalk for package "chalk": An npm specifier not found in cache: "chalk", --cached-only is specified. +error: Failed loading http://localhost:4260/chalk for package "chalk": npm package not found in cache: "chalk", --cached-only is specified. at file:///[WILDCARD]/testdata/npm/cached_only/main.ts:1:19 From 32b4c37c05afb4b0458631809d1c1cdf17155251 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Wed, 4 Dec 2024 11:29:31 +0900 Subject: [PATCH 208/227] test(ext/node): reduce race condition in test case (#27207) --- tests/unit_node/http_test.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/unit_node/http_test.ts b/tests/unit_node/http_test.ts index 31ac6bee25..048ddf30f5 100644 --- a/tests/unit_node/http_test.ts +++ b/tests/unit_node/http_test.ts @@ -1370,6 +1370,7 @@ Deno.test("[node/http] client closing a streaming request doesn't terminate serv let interval: number; let uploadedData = ""; let requestError: Error | null = null; + const deferred1 = Promise.withResolvers(); const server = http.createServer((req, res) => { res.writeHead(200, { "Content-Type": "text/plain" }); interval = setInterval(() => { @@ -1382,13 +1383,13 @@ Deno.test("[node/http] client closing a streaming request doesn't terminate serv clearInterval(interval); }); req.on("error", (err) => { + deferred1.resolve(); requestError = err; clearInterval(interval); res.end(); }); }); - const deferred1 = Promise.withResolvers(); server.listen(0, () => { // deno-lint-ignore no-explicit-any const port = (server.address() as any).port; @@ -1418,9 +1419,6 @@ Deno.test("[node/http] client closing a streaming request doesn't terminate serv if (sentChunks >= 3) { client.destroy(); - setTimeout(() => { - deferred1.resolve(); - }, 40); } else { setTimeout(writeChunk, 10); } From fb24fd37c9a44bd3e9d1936072a0c5d6a8f18b31 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Wed, 4 Dec 2024 11:37:20 +0900 Subject: [PATCH 209/227] test: add node compat test cases (#27134) This PR enables node compat test cases found passing by using the tool added in #27122 The percentage of passing test case increases from 16.16% to 30.43% by this change. --- tests/node_compat/config.jsonc | 540 +++++++++++++++++- tests/node_compat/runner/TODO.md | 527 +---------------- .../test/abort/test-addon-uv-handle-leak.js | 143 +++++ .../benchmark/test-benchmark-async-hooks.js | 20 + .../test/benchmark/test-benchmark-http.js | 21 + .../test/benchmark/test-benchmark-http2.js | 23 + .../test/benchmark/test-benchmark-tls.js | 24 + .../test/benchmark/test-benchmark-worker.js | 21 + .../es-module/test-cjs-prototype-pollution.js | 19 + .../test-esm-dynamic-import-mutating-fs.js | 29 + .../test-esm-loader-cache-clearing.js | 17 + .../test/es-module/test-esm-windows.js | 54 ++ .../test-vm-compile-function-lineoffset.js | 41 ++ .../node_compat/test/message/eval_messages.js | 60 ++ .../test/message/max_tick_depth.js | 38 ++ .../test/message/stdin_messages.js | 61 ++ .../test/message/util_inspect_error.js | 19 + .../test-arm-math-illegal-instruction.js | 22 + ...oks-run-in-async-scope-caught-exception.js | 18 + ...async-hooks-run-in-async-scope-this-arg.js | 24 + .../parallel/test-async-local-storage-bind.js | 24 + .../test-async-local-storage-contexts.js | 42 ++ .../test-async-local-storage-deep-stack.js | 22 + ...t-async-local-storage-http-multiclients.js | 72 +++ .../test-async-local-storage-snapshot.js | 23 + .../test/parallel/test-atomics-wake.js | 14 + .../parallel/test-beforeexit-event-exit.js | 34 ++ .../parallel/test-blob-buffer-too-large.js | 31 + .../parallel/test-buffer-sharedarraybuffer.js | 34 ++ .../test/parallel/test-buffer-write.js | 115 ++++ .../test/parallel/test-child-process-fork3.js | 34 ++ .../test-child-process-send-type-error.js | 36 ++ .../parallel/test-child-process-stdin-ipc.js | 47 ++ .../test-child-process-stdio-overlapped.js | 86 +++ .../parallel/test-client-request-destroy.js | 20 + .../test-cluster-uncaught-exception.js | 56 ++ .../parallel/test-console-assign-undefined.js | 35 ++ .../test/parallel/test-console-formatTime.js | 21 + .../test-console-not-call-toString.js | 41 ++ .../test/parallel/test-console-self-assign.js | 13 + .../test/parallel/test-crypto-dh-errors.js | 118 ++++ .../test/parallel/test-crypto-dh-odd-key.js | 50 ++ .../test/parallel/test-crypto-domain.js | 56 ++ .../test/parallel/test-crypto-from-binary.js | 72 +++ .../parallel/test-crypto-keygen-dh-classic.js | 30 + ...ypto-keygen-duplicate-deprecated-option.js | 50 ++ ...crypto-keygen-empty-passphrase-no-error.js | 36 ++ .../test-crypto-keygen-key-objects.js | 40 ++ .../test-crypto-keygen-missing-oid.js | 50 ++ ...pto-keygen-non-standard-public-exponent.js | 42 ++ .../test-crypto-keygen-rfc8017-9-1.js | 39 ++ .../test-crypto-keygen-rfc8017-a-2-3.js | 53 ++ .../test-crypto-lazy-transform-writable.js | 43 ++ .../test/parallel/test-crypto-no-algorithm.js | 45 ++ .../test-crypto-op-during-process-exit.js | 35 ++ .../parallel/test-crypto-padding-aes256.js | 67 +++ .../test-crypto-psychic-signatures.js | 107 ++++ ...t-crypto-publicDecrypt-fails-first-time.js | 48 ++ .../test-crypto-randomfillsync-regression.js | 25 + .../test/parallel/test-crypto-scrypt.js | 266 +++++++++ .../test-crypto-subtle-zero-length.js | 46 ++ .../test/parallel/test-dgram-address.js | 88 +++ .../test-dgram-bind-default-address.js | 60 ++ .../parallel/test-dgram-bind-error-repeat.js | 34 ++ .../test/parallel/test-dgram-bind.js | 50 ++ .../test/parallel/test-dgram-bytes-length.js | 46 ++ .../parallel/test-dgram-close-in-listening.js | 33 ++ .../test-dgram-close-is-not-callback.js | 28 + .../test/parallel/test-dgram-close.js | 63 ++ ...ram-connect-send-callback-buffer-length.js | 30 + ...test-dgram-connect-send-callback-buffer.js | 27 + ...gram-connect-send-callback-multi-buffer.js | 36 ++ .../test-dgram-connect-send-default-host.js | 55 ++ .../test-dgram-connect-send-empty-array.js | 29 + .../test-dgram-connect-send-empty-buffer.js | 27 + .../test-dgram-connect-send-empty-packet.js | 35 ++ ...st-dgram-connect-send-multi-buffer-copy.js | 36 ++ ...t-dgram-connect-send-multi-string-array.js | 24 + .../test/parallel/test-dgram-connect.js | 73 +++ .../parallel/test-dgram-createSocket-type.js | 68 +++ .../test-dgram-error-message-address.js | 64 +++ .../test/parallel/test-dgram-implicit-bind.js | 53 ++ .../parallel/test-dgram-listen-after-bind.js | 52 ++ .../test/parallel/test-dgram-msgsize.js | 46 ++ .../test/parallel/test-dgram-oob-buffer.js | 52 ++ .../test/parallel/test-dgram-recv-error.js | 26 + .../test/parallel/test-dgram-ref.js | 42 ++ .../parallel/test-dgram-send-bad-arguments.js | 162 ++++++ ...gram-send-callback-buffer-empty-address.js | 23 + ...nd-callback-buffer-length-empty-address.js | 28 + .../test-dgram-send-callback-buffer-length.js | 50 ++ .../test-dgram-send-callback-buffer.js | 26 + ...end-callback-multi-buffer-empty-address.js | 34 ++ .../test-dgram-send-callback-multi-buffer.js | 34 ++ .../test-dgram-send-callback-recursive.js | 50 ++ .../parallel/test-dgram-send-default-host.js | 79 +++ .../parallel/test-dgram-send-empty-array.js | 32 ++ .../parallel/test-dgram-send-empty-buffer.js | 50 ++ .../parallel/test-dgram-send-empty-packet.js | 36 ++ .../test/parallel/test-dgram-send-error.js | 77 +++ .../test-dgram-send-invalid-msg-type.js | 43 ++ .../test-dgram-send-multi-buffer-copy.js | 35 ++ .../test-dgram-send-multi-string-array.js | 20 + .../test/parallel/test-dgram-udp4.js | 59 ++ .../test-dgram-udp6-send-default-host.js | 83 +++ .../test/parallel/test-dgram-unref.js | 47 ++ .../test-diagnostics-channel-bind-store.js | 115 ++++ ...gnostics-channel-safe-subscriber-errors.js | 36 ++ ...ics-channel-tracing-channel-async-error.js | 53 ++ ...agnostics-channel-tracing-channel-async.js | 67 +++ ...tics-channel-tracing-channel-run-stores.js | 28 + .../test/parallel/test-dns-multi-channel.js | 59 ++ .../test/parallel/test-domain-crypto.js | 50 ++ .../parallel/test-domain-ee-error-listener.js | 27 + .../test/parallel/test-domain-nested-throw.js | 108 ++++ .../test/parallel/test-domain-nested.js | 50 ++ .../test/parallel/test-domain-stack.js | 55 ++ ...in-top-level-error-handler-clears-stack.js | 38 ++ .../parallel/test-dsa-fips-invalid-key.js | 26 + ...otomethod-remove-unnecessary-prototypes.js | 26 + .../parallel/test-error-aggregateTwoErrors.js | 66 +++ .../test-error-prepare-stack-trace.js | 26 + .../test/parallel/test-errors-aborterror.js | 38 ++ .../parallel/test-event-capture-rejections.js | 327 +++++++++++ ...test-event-emitter-check-listener-leaks.js | 110 ++++ ...-emitter-max-listeners-warning-for-null.js | 30 + ...mitter-max-listeners-warning-for-symbol.js | 32 ++ ...est-event-emitter-max-listeners-warning.js | 38 ++ .../parallel/test-eventtarget-once-twice.js | 21 + .../parallel/test-fs-buffertype-writesync.js | 23 + .../test/parallel/test-fs-close.js | 19 + .../test/parallel/test-fs-constants.js | 15 + .../node_compat/test/parallel/test-fs-fmap.js | 35 ++ .../test/parallel/test-fs-long-path.js | 56 ++ .../test-fs-non-number-arguments-throw.js | 54 ++ .../test/parallel/test-fs-promises-exists.js | 16 + .../test-fs-promises-file-handle-write.js | 84 +++ .../test-fs-promises-readfile-empty.js | 24 + .../test-fs-promises-readfile-with-fd.js | 41 ++ .../test-fs-read-file-sync-hostname.js | 40 ++ .../test/parallel/test-fs-read-file-sync.js | 41 ++ .../parallel/test-fs-read-stream-fd-leak.js | 69 +++ .../test/parallel/test-fs-read-stream-pos.js | 89 +++ .../test/parallel/test-fs-readfile-unlink.js | 53 ++ .../test-fs-readfile-zero-byte-liar.js | 62 ++ .../parallel/test-fs-readfilesync-enoent.js | 39 ++ .../parallel/test-fs-ready-event-stream.js | 27 + .../test/parallel/test-fs-sir-writes-alot.js | 77 +++ ...t-fs-stream-construct-compat-error-read.js | 39 ++ ...-fs-stream-construct-compat-graceful-fs.js | 77 +++ ...est-fs-stream-construct-compat-old-node.js | 104 ++++ .../test-fs-stream-destroy-emit-error.js | 50 ++ .../parallel/test-fs-stream-double-close.js | 61 ++ .../parallel/test-fs-stream-fs-options.js | 79 +++ .../test/parallel/test-fs-stream-options.js | 56 ++ .../test-fs-symlink-dir-junction-relative.js | 65 +++ .../test-fs-timestamp-parsing-error.js | 36 ++ .../test-fs-truncate-clear-file-zero.js | 63 ++ .../test-fs-util-validateoffsetlength.js | 94 +++ .../test/parallel/test-fs-utimes-y2K38.js | 73 +++ ...est-fs-watch-file-enoent-after-deletion.js | 54 ++ ...st-fs-watch-recursive-add-file-with-url.js | 59 ++ .../test-fs-watch-recursive-add-file.js | 57 ++ .../test-fs-watch-recursive-add-folder.js | 57 ++ .../test-fs-watch-recursive-update-file.js | 59 ++ .../parallel/test-fs-write-negativeoffset.js | 58 ++ .../parallel/test-fs-write-stream-encoding.js | 42 ++ .../test-fs-write-stream-patch-open.js | 43 ++ .../test/parallel/test-fs-writev.js | 113 ++++ .../test/parallel/test-global-domexception.js | 18 + .../test/parallel/test-global-encoder.js | 15 + .../test/parallel/test-global-webcrypto.js | 20 + .../test/parallel/test-global-webstreams.js | 31 + .../parallel/test-http-abort-before-end.js | 50 ++ .../test-http-addrequest-localaddress.js | 44 ++ .../test/parallel/test-http-agent-false.js | 53 ++ .../test-http-agent-keepalive-delay.js | 43 ++ .../test-http-agent-maxtotalsockets.js | 118 ++++ .../parallel/test-http-agent-no-protocol.js | 48 ++ .../test/parallel/test-http-agent-null.js | 44 ++ .../test-http-allow-req-after-204-res.js | 68 +++ .../test/parallel/test-http-bind-twice.js | 43 ++ .../test/parallel/test-http-buffer-sanity.js | 78 +++ .../parallel/test-http-chunked-smuggling.js | 50 ++ .../test/parallel/test-http-chunked.js | 63 ++ .../test/parallel/test-http-client-abort2.js | 45 ++ .../test-http-client-check-http-token.js | 41 ++ ...st-http-client-close-with-default-agent.js | 30 + .../test-http-client-default-headers-exist.js | 77 +++ .../parallel/test-http-client-defaults.js | 30 + .../parallel/test-http-client-encoding.js | 46 ++ .../test-http-client-headers-array.js | 77 +++ .../parallel/test-http-client-invalid-path.js | 20 + .../test-http-client-keep-alive-hint.js | 34 ++ .../test/parallel/test-http-client-race-2.js | 119 ++++ .../test/parallel/test-http-client-race.js | 76 +++ ...est-http-client-reject-unexpected-agent.js | 76 +++ ...st-http-client-timeout-connect-listener.js | 49 ++ .../test-http-client-timeout-with-data.js | 70 +++ .../test-http-client-unescaped-path.js | 44 ++ .../parallel/test-http-client-upload-buf.js | 71 +++ .../test/parallel/test-http-client-upload.js | 74 +++ .../test/parallel/test-http-common.js | 40 ++ .../test/parallel/test-http-contentLength0.js | 51 ++ .../parallel/test-http-correct-hostname.js | 35 ++ .../test/parallel/test-http-date-header.js | 62 ++ .../test/parallel/test-http-decoded-auth.js | 55 ++ .../parallel/test-http-default-encoding.js | 65 +++ .../test-http-dump-req-when-res-ends.js | 73 +++ .../test-http-end-throw-socket-handling.js | 60 ++ .../test/parallel/test-http-eof-on-connect.js | 48 ++ .../test/parallel/test-http-extra-response.js | 87 +++ .../test/parallel/test-http-flush-headers.js | 27 + .../test/parallel/test-http-full-response.js | 88 +++ .../test/parallel/test-http-head-request.js | 64 +++ ...sponse-has-no-body-end-implicit-headers.js | 34 ++ ...test-http-head-response-has-no-body-end.js | 55 ++ .../test-http-head-response-has-no-body.js | 55 ++ ...-http-head-throw-on-response-body-write.js | 109 ++++ .../test/parallel/test-http-header-obstext.js | 28 + .../test/parallel/test-http-header-owstext.js | 56 ++ .../test/parallel/test-http-header-read.js | 59 ++ .../test/parallel/test-http-hex-write.js | 56 ++ .../test/parallel/test-http-highwatermark.js | 59 ++ .../test/parallel/test-http-host-headers.js | 103 ++++ .../test-http-hostname-typechecking.js | 49 ++ .../test-http-incoming-message-destroy.js | 17 + .../parallel/test-http-invalid-path-chars.js | 27 + .../parallel/test-http-invalidheaderfield.js | 59 ++ .../parallel/test-http-invalidheaderfield2.js | 95 +++ .../test-http-keep-alive-timeout-custom.js | 38 ++ .../test/parallel/test-http-listening.js | 23 + .../test-http-localaddress-bind-error.js | 59 ++ .../test/parallel/test-http-methods.js | 74 +++ .../parallel/test-http-outgoing-end-types.js | 25 + .../parallel/test-http-outgoing-finished.js | 39 ++ .../test-http-outgoing-write-types.js | 31 + .../test/parallel/test-http-parser-free.js | 59 ++ .../test/parallel/test-http-pause-no-dump.js | 40 ++ .../test-http-pause-resume-one-end.js | 62 ++ .../test/parallel/test-http-pause.js | 85 +++ .../test/parallel/test-http-pipe-fs.js | 72 +++ ...-http-pipeline-requests-connection-leak.js | 41 ++ .../test/parallel/test-http-proxy.js | 114 ++++ .../parallel/test-http-readable-data-event.js | 65 +++ .../parallel/test-http-request-arguments.js | 35 ++ ...test-http-request-dont-override-options.js | 47 ++ .../parallel/test-http-request-end-twice.js | 46 ++ .../test/parallel/test-http-request-end.js | 69 +++ .../test-http-request-invalid-method-error.js | 20 + .../test-http-request-large-payload.js | 33 ++ .../parallel/test-http-request-methods.js | 72 +++ ...test-http-res-write-end-dont-take-array.js | 80 +++ .../test-http-response-multiheaders.js | 78 +++ .../parallel/test-http-response-readable.js | 48 ++ ...st-http-response-writehead-returns-this.js | 29 + .../test-http-server-delete-parser.js | 31 + .../test-http-server-write-after-end.js | 36 ++ .../test-http-server-write-end-after-end.js | 38 ++ .../test/parallel/test-http-set-cookies.js | 84 +++ .../parallel/test-http-set-header-chain.js | 36 ++ .../test/parallel/test-http-status-code.js | 65 +++ .../test-http-status-reason-invalid-chars.js | 54 ++ ...est-http-uncaught-from-request-callback.js | 36 ++ .../test/parallel/test-http-url.parse-auth.js | 55 ++ .../parallel/test-http-url.parse-basic.js | 65 +++ .../test/parallel/test-http-url.parse-path.js | 53 ++ .../test/parallel/test-http-url.parse-post.js | 61 ++ .../parallel/test-http-url.parse-search.js | 54 ++ .../test/parallel/test-http-wget.js | 85 +++ .../parallel/test-http-write-empty-string.js | 61 ++ .../parallel/test-http-zerolengthbuffer.js | 30 + ...-http2-client-request-listeners-warning.js | 48 ++ .../test-http2-compat-expect-handling.js | 52 ++ .../parallel/test-http2-compat-socket-set.js | 104 ++++ .../parallel/test-http2-connect-options.js | 48 ++ .../test/parallel/test-http2-date-header.js | 36 ++ .../test/parallel/test-http2-dont-override.js | 56 ++ .../parallel/test-http2-endafterheaders.js | 57 ++ .../test/parallel/test-http2-methods.js | 56 ++ .../test-http2-request-response-proto.js | 25 + .../parallel/test-http2-respond-file-204.js | 49 ++ .../test-http2-respond-file-compat.js | 31 + .../parallel/test-http2-session-timeout.js | 71 +++ .../test/parallel/test-http2-socket-proxy.js | 133 +++++ .../test-http2-status-code-invalid.js | 48 ++ .../test/parallel/test-http2-status-code.js | 48 ++ ...ttp2-stream-removelisteners-after-close.js | 38 ++ .../parallel/test-http2-write-empty-string.js | 48 ++ .../test-https-client-renegotiation-limit.js | 118 ++++ .../parallel/test-https-connecting-to-http.js | 47 ++ .../test/parallel/test-https-foafssl.js | 96 ++++ .../test-https-localaddress-bind-error.js | 69 +++ .../test/parallel/test-https-localaddress.js | 76 +++ .../test/parallel/test-icu-data-dir.js | 40 ++ .../node_compat/test/parallel/test-icu-env.js | 295 ++++++++++ .../test/parallel/test-icu-stringwidth.js | 102 ++++ .../parallel/test-inspector-stops-no-file.js | 23 + .../test/parallel/test-instanceof.js | 18 + .../test/parallel/test-internal-fs.js | 60 ++ .../test-internal-util-normalizeencoding.js | 62 ++ .../parallel/test-kill-segfault-freebsd.js | 26 + .../test-listen-fd-detached-inherit.js | 125 ++++ .../test/parallel/test-listen-fd-detached.js | 122 ++++ .../test/parallel/test-memory-usage-emfile.js | 25 + .../test/parallel/test-memory-usage.js | 56 ++ .../test/parallel/test-messagechannel.js | 19 + .../test-microtask-queue-integration.js | 70 +++ .../test-microtask-queue-run-immediate.js | 66 +++ .../test/parallel/test-microtask-queue-run.js | 66 +++ .../test/parallel/test-module-cache.js | 25 + .../parallel/test-module-circular-symlinks.js | 75 +++ .../test/parallel/test-module-isBuiltin.js | 23 + .../parallel/test-module-multi-extensions.js | 100 ++++ .../parallel/test-module-nodemodulepaths.js | 134 +++++ .../test/parallel/test-module-readonly.js | 55 ++ .../parallel/test-module-relative-lookup.js | 31 + .../test/parallel/test-net-after-close.js | 58 ++ .../test-net-better-error-messages-listen.js | 19 + .../test/parallel/test-net-bind-twice.js | 43 ++ .../test/parallel/test-net-buffersize.js | 59 ++ .../parallel/test-net-bytes-written-large.js | 74 +++ .../parallel/test-net-can-reset-timeout.js | 64 +++ .../test-net-connect-call-socket-connect.js | 46 ++ .../parallel/test-net-connect-options-fd.js | 110 ++++ .../parallel/test-net-connect-options-ipv6.js | 74 +++ .../parallel/test-net-connect-options-port.js | 237 ++++++++ .../test-net-connect-paused-connection.js | 40 ++ .../parallel/test-net-dns-custom-lookup.js | 74 +++ .../test/parallel/test-net-dns-lookup-skip.js | 26 + .../test/parallel/test-net-dns-lookup.js | 47 ++ .../test/parallel/test-net-eaddrinuse.js | 44 ++ .../test/parallel/test-net-error-twice.js | 70 +++ .../test/parallel/test-net-keepalive.js | 59 ++ .../test-net-listen-after-destroying-stdin.js | 29 + .../test/parallel/test-net-listen-error.js | 36 ++ .../parallel/test-net-local-address-port.js | 50 ++ .../test-net-pause-resume-connecting.js | 102 ++++ .../parallel/test-net-persistent-keepalive.js | 41 ++ .../parallel/test-net-persistent-nodelay.js | 43 ++ .../parallel/test-net-persistent-ref-unref.js | 48 ++ .../test/parallel/test-net-reconnect.js | 95 +++ .../parallel/test-net-remote-address-port.js | 91 +++ .../test/parallel/test-net-remote-address.js | 30 + .../test-net-server-capture-rejection.js | 34 ++ .../test/parallel/test-net-server-close.js | 52 ++ .../test-net-server-pause-on-connect.js | 79 +++ .../test/parallel/test-net-settimeout.js | 57 ++ .../test-net-socket-close-after-end.js | 38 ++ ...socket-connect-invalid-autoselectfamily.js | 16 + .../test-net-socket-connect-without-cb.js | 33 ++ .../parallel/test-net-socket-connecting.js | 28 + .../parallel/test-net-socket-destroy-send.js | 31 + .../test-net-socket-end-before-connect.js | 20 + .../parallel/test-net-socket-end-callback.js | 29 + .../test-net-socket-ready-without-cb.js | 27 + .../parallel/test-net-socket-timeout-unref.js | 63 ++ .../test-net-socket-write-after-close.js | 49 ++ .../parallel/test-net-socket-write-error.js | 29 + .../test/parallel/test-net-sync-cork.js | 40 ++ .../test/parallel/test-net-writable.js | 22 + .../parallel/test-net-write-connect-write.js | 53 ++ .../test-net-write-fully-async-buffer.js | 41 ++ .../test-net-write-fully-async-hex-string.js | 39 ++ .../test/parallel/test-net-write-slow.js | 70 +++ .../test/parallel/test-next-tick-domain.js | 38 ++ .../test/parallel/test-next-tick-errors.js | 81 +++ .../test/parallel/test-no-node-snapshot.js | 12 + .../parallel/test-os-homedir-no-envvar.js | 37 ++ .../test/parallel/test-perf-gc-crash.js | 32 ++ .../parallel/test-performanceobserver-gc.js | 24 + .../test/parallel/test-pipe-return-val.js | 40 ++ .../test/parallel/test-pipe-writev.js | 52 ++ .../test/parallel/test-process-abort.js | 19 + .../test/parallel/test-process-argv-0.js | 49 ++ .../test/parallel/test-process-binding.js | 21 + .../test-process-dlopen-undefined-exports.js | 17 + .../parallel/test-process-domain-segfault.js | 39 ++ .../test/parallel/test-process-emitwarning.js | 88 +++ .../test/parallel/test-process-env-delete.js | 20 + .../test-process-env-windows-error-reset.js | 29 + .../test/parallel/test-process-getgroups.js | 59 ++ .../parallel/test-process-hrtime-bigint.js | 21 + .../test/parallel/test-process-next-tick.js | 56 ++ .../parallel/test-process-no-deprecation.js | 39 ++ .../test/parallel/test-process-ppid.js | 23 + .../test/parallel/test-process-really-exit.js | 24 + .../test/parallel/test-process-warning.js | 75 +++ ...st-promise-handled-rejection-no-warning.js | 14 + .../test-readable-from-iterator-closing.js | 204 +++++++ .../test/parallel/test-readable-from.js | 230 ++++++++ .../test/parallel/test-readable-large-hwm.js | 34 ++ .../test/parallel/test-readable-single-end.js | 23 + .../test-readline-async-iterators-destroy.js | 96 ++++ .../parallel/test-readline-async-iterators.js | 127 ++++ ...readline-carriage-return-between-chunks.js | 30 + .../test/parallel/test-readline-csi.js | 183 ++++++ .../test/parallel/test-ref-unref-return.js | 19 + .../test-regression-object-prototype.js | 35 ++ .../parallel/test-require-invalid-package.js | 16 + .../test/parallel/test-require-long-path.js | 35 ++ .../test/parallel/test-require-nul.js | 18 + .../test/parallel/test-require-process.js | 14 + .../test-signal-handler-remove-on-exit.js | 16 + .../test/parallel/test-signal-handler.js | 63 ++ .../test/parallel/test-socket-address.js | 24 + .../test-socket-write-after-fin-error.js | 69 +++ .../test/parallel/test-source-map-enable.js | 388 +++++++++++++ .../parallel/test-spawn-cmd-named-pipe.js | 57 ++ .../test/parallel/test-stdin-hang.js | 39 ++ .../test/parallel/test-stdin-pipe-large.js | 30 + .../test/parallel/test-stdin-pipe-resume.js | 34 ++ .../test-stdin-script-child-option.js | 24 + .../test/parallel/test-stdio-pipe-access.js | 45 ++ .../test/parallel/test-stdio-pipe-redirect.js | 49 ++ .../test/parallel/test-stdio-pipe-stderr.js | 43 ++ .../test/parallel/test-stdio-undestroy.js | 43 ++ ...out-cannot-be-closed-child-process-pipe.js | 39 ++ .../parallel/test-stdout-pipeline-destroy.js | 38 ++ .../parallel/test-stdout-stderr-reading.js | 74 +++ .../test/parallel/test-stdout-stderr-write.js | 15 + .../parallel/test-stream-catch-rejections.js | 58 ++ .../test-stream-decoder-objectmode.js | 27 + .../test-stream-duplex-readable-writable.js | 53 ++ .../parallel/test-stream-end-of-streams.js | 27 + .../test/parallel/test-stream-filter.js | 183 ++++++ .../test/parallel/test-stream-flatMap.js | 138 +++++ .../test/parallel/test-stream-forEach.js | 146 +++++ .../parallel/test-stream-passthrough-drain.js | 17 + .../test-stream-pipe-error-unhandled.js | 28 + .../parallel/test-stream-pipeline-duplex.js | 28 + .../test-stream-pipeline-listeners.js | 83 +++ .../parallel/test-stream-pipeline-uncaught.js | 29 + .../test/parallel/test-stream-push-order.js | 59 ++ .../test-stream-readable-strategy-option.js | 82 +++ .../test-stream-readable-unpipe-resume.js | 27 + .../test/parallel/test-stream-reduce.js | 139 +++++ .../test/parallel/test-stream-toArray.js | 100 ++++ ...est-stream-toWeb-allows-server-response.js | 36 ++ .../parallel/test-stream-transform-hwm0.js | 35 ++ .../test-stream-writable-end-cb-uncaught.js | 31 + .../test-stream2-finish-pipe-error.js | 27 + .../test-stream3-pipeline-async-iterator.js | 34 ++ .../parallel/test-stringbytes-external.js | 150 +++++ .../test/parallel/test-sync-fileread.js | 14 + tests/node_compat/test/parallel/test-sys.js | 35 ++ .../parallel/test-tick-processor-arguments.js | 39 ++ .../test-timers-clearImmediate-als.js | 35 ++ .../parallel/test-timers-immediate-queue.js | 64 +++ .../test/parallel/test-timers-immediate.js | 50 ++ .../test-timers-refresh-in-callback.js | 21 + .../test-timers-setimmediate-infinite-loop.js | 26 + ...imeout-removes-other-socket-unref-timer.js | 50 ++ .../test/parallel/test-timers-unref.js | 88 +++ ...test-timers-unrefd-interval-still-fires.js | 29 + .../test-timers-unrefed-in-beforeexit.js | 14 + .../test-timers-unrefed-in-callback.js | 63 ++ .../node_compat/test/parallel/test-timers.js | 88 +++ .../test/parallel/test-tls-alert-handling.js | 103 ++++ .../test/parallel/test-tls-alert.js | 60 ++ .../test-tls-client-renegotiation-limit.js | 108 ++++ .../node_compat/test/parallel/test-tls-dhe.js | 119 ++++ .../test/parallel/test-tls-ecdh-auto.js | 50 ++ .../test/parallel/test-tls-ecdh-multiple.js | 68 +++ .../test/parallel/test-tls-ecdh.js | 66 +++ .../parallel/test-tls-enable-trace-cli.js | 75 +++ .../test/parallel/test-tls-enable-trace.js | 65 +++ .../test-tls-env-extra-ca-no-crypto.js | 29 + .../test/parallel/test-tls-ocsp-callback.js | 120 ++++ .../test/parallel/test-tls-psk-server.js | 84 +++ .../parallel/test-tls-securepair-server.js | 152 +++++ .../test/parallel/test-tls-server-verify.js | 355 ++++++++++++ .../test/parallel/test-tls-session-cache.js | 171 ++++++ .../test/parallel/test-tls-set-ciphers.js | 138 +++++ ...test-tls-transport-destroy-after-own-gc.js | 36 ++ .../test-trace-events-async-hooks-dynamic.js | 69 +++ .../test-trace-events-async-hooks-worker.js | 78 +++ .../test/parallel/test-tz-version.js | 35 ++ .../test/parallel/test-utf8-scripts.js | 37 ++ ...est-util-inspect-getters-accessing-this.js | 74 +++ .../test-util-primordial-monkeypatching.js | 18 + .../test/parallel/test-uv-binding-constant.js | 26 + .../parallel/test-uv-unmapped-exception.js | 33 ++ .../test/parallel/test-v8-coverage.js | 212 +++++++ .../parallel/test-v8-deserialize-buffer.js | 14 + .../test/parallel/test-v8-flag-pool-size-0.js | 17 + .../test/parallel/test-v8-global-setter.js | 36 ++ .../test/parallel/test-v8-stop-coverage.js | 41 ++ .../parallel/test-v8-take-coverage-noop.js | 39 ++ .../test/parallel/test-v8-take-coverage.js | 91 +++ .../node_compat/test/parallel/test-weakref.js | 20 + .../test-webcrypto-encrypt-decrypt.js | 131 +++++ .../test/parallel/test-websocket.js | 14 + .../parallel/test-webstream-string-tag.js | 25 + .../test-whatwg-readablebytestreambyob.js | 69 +++ .../parallel/test-worker-cleanexit-with-js.js | 28 + .../parallel/test-worker-on-process-exit.js | 29 + .../test/parallel/test-worker-ref-onexit.js | 19 + .../parallel/test-worker-terminate-unrefed.js | 23 + .../test/parallel/test-zlib-create-raw.js | 22 + .../test-zlib-flush-write-sync-interleaved.js | 64 +++ .../test-set-raw-mode-reset-process-exit.js | 25 + .../pseudo-tty/test-set-raw-mode-reset.js | 26 + .../pseudo-tty/test-tty-stdin-call-end.js | 15 + .../test/pummel/test-crypto-dh-hash.js | 66 +++ ...est-crypto-timing-safe-equal-benchmarks.js | 129 +++++ tests/node_compat/test/pummel/test-dh-regr.js | 66 +++ .../test/pummel/test-fs-largefile.js | 63 ++ .../pummel/test-fs-readfile-tostring-fail.js | 84 +++ .../test/pummel/test-fs-watch-system-limit.js | 77 +++ .../test-heapsnapshot-near-heap-limit-big.js | 49 ++ .../test/pummel/test-net-many-clients.js | 107 ++++ .../test/pummel/test-net-pingpong-delay.js | 114 ++++ .../test/pummel/test-process-cpuUsage.js | 37 ++ .../test/pummel/test-stream-pipe-multi.js | 129 +++++ .../test-buffer-creation-regression.js | 43 ++ ...p-server-keep-alive-timeout-slow-server.js | 57 ++ .../test-net-better-error-messages-port.js | 24 + .../test-net-connect-handle-econnrefused.js | 39 ++ .../test-net-connect-local-error.js | 53 ++ .../sequential/test-net-reconnect-error.js | 50 ++ .../test/sequential/test-net-response-size.js | 82 +++ .../test/sequential/test-net-server-bind.js | 71 +++ .../test/sequential/test-tls-lookup.js | 41 ++ .../test/sequential/test-tls-psk-client.js | 117 ++++ .../sequential/test-tls-securepair-client.js | 193 +++++++ .../sequential/test-tls-session-timeout.js | 140 +++++ 527 files changed, 30399 insertions(+), 530 deletions(-) create mode 100644 tests/node_compat/test/abort/test-addon-uv-handle-leak.js create mode 100644 tests/node_compat/test/benchmark/test-benchmark-async-hooks.js create mode 100644 tests/node_compat/test/benchmark/test-benchmark-http.js create mode 100644 tests/node_compat/test/benchmark/test-benchmark-http2.js create mode 100644 tests/node_compat/test/benchmark/test-benchmark-tls.js create mode 100644 tests/node_compat/test/benchmark/test-benchmark-worker.js create mode 100644 tests/node_compat/test/es-module/test-cjs-prototype-pollution.js create mode 100644 tests/node_compat/test/es-module/test-esm-dynamic-import-mutating-fs.js create mode 100644 tests/node_compat/test/es-module/test-esm-loader-cache-clearing.js create mode 100644 tests/node_compat/test/es-module/test-esm-windows.js create mode 100644 tests/node_compat/test/es-module/test-vm-compile-function-lineoffset.js create mode 100644 tests/node_compat/test/message/eval_messages.js create mode 100644 tests/node_compat/test/message/max_tick_depth.js create mode 100644 tests/node_compat/test/message/stdin_messages.js create mode 100644 tests/node_compat/test/message/util_inspect_error.js create mode 100644 tests/node_compat/test/parallel/test-arm-math-illegal-instruction.js create mode 100644 tests/node_compat/test/parallel/test-async-hooks-run-in-async-scope-caught-exception.js create mode 100644 tests/node_compat/test/parallel/test-async-hooks-run-in-async-scope-this-arg.js create mode 100644 tests/node_compat/test/parallel/test-async-local-storage-bind.js create mode 100644 tests/node_compat/test/parallel/test-async-local-storage-contexts.js create mode 100644 tests/node_compat/test/parallel/test-async-local-storage-deep-stack.js create mode 100644 tests/node_compat/test/parallel/test-async-local-storage-http-multiclients.js create mode 100644 tests/node_compat/test/parallel/test-async-local-storage-snapshot.js create mode 100644 tests/node_compat/test/parallel/test-atomics-wake.js create mode 100644 tests/node_compat/test/parallel/test-beforeexit-event-exit.js create mode 100644 tests/node_compat/test/parallel/test-blob-buffer-too-large.js create mode 100644 tests/node_compat/test/parallel/test-buffer-sharedarraybuffer.js create mode 100644 tests/node_compat/test/parallel/test-buffer-write.js create mode 100644 tests/node_compat/test/parallel/test-child-process-fork3.js create mode 100644 tests/node_compat/test/parallel/test-child-process-send-type-error.js create mode 100644 tests/node_compat/test/parallel/test-child-process-stdin-ipc.js create mode 100644 tests/node_compat/test/parallel/test-child-process-stdio-overlapped.js create mode 100644 tests/node_compat/test/parallel/test-client-request-destroy.js create mode 100644 tests/node_compat/test/parallel/test-cluster-uncaught-exception.js create mode 100644 tests/node_compat/test/parallel/test-console-assign-undefined.js create mode 100644 tests/node_compat/test/parallel/test-console-formatTime.js create mode 100644 tests/node_compat/test/parallel/test-console-not-call-toString.js create mode 100644 tests/node_compat/test/parallel/test-console-self-assign.js create mode 100644 tests/node_compat/test/parallel/test-crypto-dh-errors.js create mode 100644 tests/node_compat/test/parallel/test-crypto-dh-odd-key.js create mode 100644 tests/node_compat/test/parallel/test-crypto-domain.js create mode 100644 tests/node_compat/test/parallel/test-crypto-from-binary.js create mode 100644 tests/node_compat/test/parallel/test-crypto-keygen-dh-classic.js create mode 100644 tests/node_compat/test/parallel/test-crypto-keygen-duplicate-deprecated-option.js create mode 100644 tests/node_compat/test/parallel/test-crypto-keygen-empty-passphrase-no-error.js create mode 100644 tests/node_compat/test/parallel/test-crypto-keygen-key-objects.js create mode 100644 tests/node_compat/test/parallel/test-crypto-keygen-missing-oid.js create mode 100644 tests/node_compat/test/parallel/test-crypto-keygen-non-standard-public-exponent.js create mode 100644 tests/node_compat/test/parallel/test-crypto-keygen-rfc8017-9-1.js create mode 100644 tests/node_compat/test/parallel/test-crypto-keygen-rfc8017-a-2-3.js create mode 100644 tests/node_compat/test/parallel/test-crypto-lazy-transform-writable.js create mode 100644 tests/node_compat/test/parallel/test-crypto-no-algorithm.js create mode 100644 tests/node_compat/test/parallel/test-crypto-op-during-process-exit.js create mode 100644 tests/node_compat/test/parallel/test-crypto-padding-aes256.js create mode 100644 tests/node_compat/test/parallel/test-crypto-psychic-signatures.js create mode 100644 tests/node_compat/test/parallel/test-crypto-publicDecrypt-fails-first-time.js create mode 100644 tests/node_compat/test/parallel/test-crypto-randomfillsync-regression.js create mode 100644 tests/node_compat/test/parallel/test-crypto-scrypt.js create mode 100644 tests/node_compat/test/parallel/test-crypto-subtle-zero-length.js create mode 100644 tests/node_compat/test/parallel/test-dgram-address.js create mode 100644 tests/node_compat/test/parallel/test-dgram-bind-default-address.js create mode 100644 tests/node_compat/test/parallel/test-dgram-bind-error-repeat.js create mode 100644 tests/node_compat/test/parallel/test-dgram-bind.js create mode 100644 tests/node_compat/test/parallel/test-dgram-bytes-length.js create mode 100644 tests/node_compat/test/parallel/test-dgram-close-in-listening.js create mode 100644 tests/node_compat/test/parallel/test-dgram-close-is-not-callback.js create mode 100644 tests/node_compat/test/parallel/test-dgram-close.js create mode 100644 tests/node_compat/test/parallel/test-dgram-connect-send-callback-buffer-length.js create mode 100644 tests/node_compat/test/parallel/test-dgram-connect-send-callback-buffer.js create mode 100644 tests/node_compat/test/parallel/test-dgram-connect-send-callback-multi-buffer.js create mode 100644 tests/node_compat/test/parallel/test-dgram-connect-send-default-host.js create mode 100644 tests/node_compat/test/parallel/test-dgram-connect-send-empty-array.js create mode 100644 tests/node_compat/test/parallel/test-dgram-connect-send-empty-buffer.js create mode 100644 tests/node_compat/test/parallel/test-dgram-connect-send-empty-packet.js create mode 100644 tests/node_compat/test/parallel/test-dgram-connect-send-multi-buffer-copy.js create mode 100644 tests/node_compat/test/parallel/test-dgram-connect-send-multi-string-array.js create mode 100644 tests/node_compat/test/parallel/test-dgram-connect.js create mode 100644 tests/node_compat/test/parallel/test-dgram-createSocket-type.js create mode 100644 tests/node_compat/test/parallel/test-dgram-error-message-address.js create mode 100644 tests/node_compat/test/parallel/test-dgram-implicit-bind.js create mode 100644 tests/node_compat/test/parallel/test-dgram-listen-after-bind.js create mode 100644 tests/node_compat/test/parallel/test-dgram-msgsize.js create mode 100644 tests/node_compat/test/parallel/test-dgram-oob-buffer.js create mode 100644 tests/node_compat/test/parallel/test-dgram-recv-error.js create mode 100644 tests/node_compat/test/parallel/test-dgram-ref.js create mode 100644 tests/node_compat/test/parallel/test-dgram-send-bad-arguments.js create mode 100644 tests/node_compat/test/parallel/test-dgram-send-callback-buffer-empty-address.js create mode 100644 tests/node_compat/test/parallel/test-dgram-send-callback-buffer-length-empty-address.js create mode 100644 tests/node_compat/test/parallel/test-dgram-send-callback-buffer-length.js create mode 100644 tests/node_compat/test/parallel/test-dgram-send-callback-buffer.js create mode 100644 tests/node_compat/test/parallel/test-dgram-send-callback-multi-buffer-empty-address.js create mode 100644 tests/node_compat/test/parallel/test-dgram-send-callback-multi-buffer.js create mode 100644 tests/node_compat/test/parallel/test-dgram-send-callback-recursive.js create mode 100644 tests/node_compat/test/parallel/test-dgram-send-default-host.js create mode 100644 tests/node_compat/test/parallel/test-dgram-send-empty-array.js create mode 100644 tests/node_compat/test/parallel/test-dgram-send-empty-buffer.js create mode 100644 tests/node_compat/test/parallel/test-dgram-send-empty-packet.js create mode 100644 tests/node_compat/test/parallel/test-dgram-send-error.js create mode 100644 tests/node_compat/test/parallel/test-dgram-send-invalid-msg-type.js create mode 100644 tests/node_compat/test/parallel/test-dgram-send-multi-buffer-copy.js create mode 100644 tests/node_compat/test/parallel/test-dgram-send-multi-string-array.js create mode 100644 tests/node_compat/test/parallel/test-dgram-udp4.js create mode 100644 tests/node_compat/test/parallel/test-dgram-udp6-send-default-host.js create mode 100644 tests/node_compat/test/parallel/test-dgram-unref.js create mode 100644 tests/node_compat/test/parallel/test-diagnostics-channel-bind-store.js create mode 100644 tests/node_compat/test/parallel/test-diagnostics-channel-safe-subscriber-errors.js create mode 100644 tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-async-error.js create mode 100644 tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-async.js create mode 100644 tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-run-stores.js create mode 100644 tests/node_compat/test/parallel/test-dns-multi-channel.js create mode 100644 tests/node_compat/test/parallel/test-domain-crypto.js create mode 100644 tests/node_compat/test/parallel/test-domain-ee-error-listener.js create mode 100644 tests/node_compat/test/parallel/test-domain-nested-throw.js create mode 100644 tests/node_compat/test/parallel/test-domain-nested.js create mode 100644 tests/node_compat/test/parallel/test-domain-stack.js create mode 100644 tests/node_compat/test/parallel/test-domain-top-level-error-handler-clears-stack.js create mode 100644 tests/node_compat/test/parallel/test-dsa-fips-invalid-key.js create mode 100644 tests/node_compat/test/parallel/test-env-newprotomethod-remove-unnecessary-prototypes.js create mode 100644 tests/node_compat/test/parallel/test-error-aggregateTwoErrors.js create mode 100644 tests/node_compat/test/parallel/test-error-prepare-stack-trace.js create mode 100644 tests/node_compat/test/parallel/test-errors-aborterror.js create mode 100644 tests/node_compat/test/parallel/test-event-capture-rejections.js create mode 100644 tests/node_compat/test/parallel/test-event-emitter-check-listener-leaks.js create mode 100644 tests/node_compat/test/parallel/test-event-emitter-max-listeners-warning-for-null.js create mode 100644 tests/node_compat/test/parallel/test-event-emitter-max-listeners-warning-for-symbol.js create mode 100644 tests/node_compat/test/parallel/test-event-emitter-max-listeners-warning.js create mode 100644 tests/node_compat/test/parallel/test-eventtarget-once-twice.js create mode 100644 tests/node_compat/test/parallel/test-fs-buffertype-writesync.js create mode 100644 tests/node_compat/test/parallel/test-fs-close.js create mode 100644 tests/node_compat/test/parallel/test-fs-constants.js create mode 100644 tests/node_compat/test/parallel/test-fs-fmap.js create mode 100644 tests/node_compat/test/parallel/test-fs-long-path.js create mode 100644 tests/node_compat/test/parallel/test-fs-non-number-arguments-throw.js create mode 100644 tests/node_compat/test/parallel/test-fs-promises-exists.js create mode 100644 tests/node_compat/test/parallel/test-fs-promises-file-handle-write.js create mode 100644 tests/node_compat/test/parallel/test-fs-promises-readfile-empty.js create mode 100644 tests/node_compat/test/parallel/test-fs-promises-readfile-with-fd.js create mode 100644 tests/node_compat/test/parallel/test-fs-read-file-sync-hostname.js create mode 100644 tests/node_compat/test/parallel/test-fs-read-file-sync.js create mode 100644 tests/node_compat/test/parallel/test-fs-read-stream-fd-leak.js create mode 100644 tests/node_compat/test/parallel/test-fs-read-stream-pos.js create mode 100644 tests/node_compat/test/parallel/test-fs-readfile-unlink.js create mode 100644 tests/node_compat/test/parallel/test-fs-readfile-zero-byte-liar.js create mode 100644 tests/node_compat/test/parallel/test-fs-readfilesync-enoent.js create mode 100644 tests/node_compat/test/parallel/test-fs-ready-event-stream.js create mode 100644 tests/node_compat/test/parallel/test-fs-sir-writes-alot.js create mode 100644 tests/node_compat/test/parallel/test-fs-stream-construct-compat-error-read.js create mode 100644 tests/node_compat/test/parallel/test-fs-stream-construct-compat-graceful-fs.js create mode 100644 tests/node_compat/test/parallel/test-fs-stream-construct-compat-old-node.js create mode 100644 tests/node_compat/test/parallel/test-fs-stream-destroy-emit-error.js create mode 100644 tests/node_compat/test/parallel/test-fs-stream-double-close.js create mode 100644 tests/node_compat/test/parallel/test-fs-stream-fs-options.js create mode 100644 tests/node_compat/test/parallel/test-fs-stream-options.js create mode 100644 tests/node_compat/test/parallel/test-fs-symlink-dir-junction-relative.js create mode 100644 tests/node_compat/test/parallel/test-fs-timestamp-parsing-error.js create mode 100644 tests/node_compat/test/parallel/test-fs-truncate-clear-file-zero.js create mode 100644 tests/node_compat/test/parallel/test-fs-util-validateoffsetlength.js create mode 100644 tests/node_compat/test/parallel/test-fs-utimes-y2K38.js create mode 100644 tests/node_compat/test/parallel/test-fs-watch-file-enoent-after-deletion.js create mode 100644 tests/node_compat/test/parallel/test-fs-watch-recursive-add-file-with-url.js create mode 100644 tests/node_compat/test/parallel/test-fs-watch-recursive-add-file.js create mode 100644 tests/node_compat/test/parallel/test-fs-watch-recursive-add-folder.js create mode 100644 tests/node_compat/test/parallel/test-fs-watch-recursive-update-file.js create mode 100644 tests/node_compat/test/parallel/test-fs-write-negativeoffset.js create mode 100644 tests/node_compat/test/parallel/test-fs-write-stream-encoding.js create mode 100644 tests/node_compat/test/parallel/test-fs-write-stream-patch-open.js create mode 100644 tests/node_compat/test/parallel/test-fs-writev.js create mode 100644 tests/node_compat/test/parallel/test-global-domexception.js create mode 100644 tests/node_compat/test/parallel/test-global-encoder.js create mode 100644 tests/node_compat/test/parallel/test-global-webcrypto.js create mode 100644 tests/node_compat/test/parallel/test-global-webstreams.js create mode 100644 tests/node_compat/test/parallel/test-http-abort-before-end.js create mode 100644 tests/node_compat/test/parallel/test-http-addrequest-localaddress.js create mode 100644 tests/node_compat/test/parallel/test-http-agent-false.js create mode 100644 tests/node_compat/test/parallel/test-http-agent-keepalive-delay.js create mode 100644 tests/node_compat/test/parallel/test-http-agent-maxtotalsockets.js create mode 100644 tests/node_compat/test/parallel/test-http-agent-no-protocol.js create mode 100644 tests/node_compat/test/parallel/test-http-agent-null.js create mode 100644 tests/node_compat/test/parallel/test-http-allow-req-after-204-res.js create mode 100644 tests/node_compat/test/parallel/test-http-bind-twice.js create mode 100644 tests/node_compat/test/parallel/test-http-buffer-sanity.js create mode 100644 tests/node_compat/test/parallel/test-http-chunked-smuggling.js create mode 100644 tests/node_compat/test/parallel/test-http-chunked.js create mode 100644 tests/node_compat/test/parallel/test-http-client-abort2.js create mode 100644 tests/node_compat/test/parallel/test-http-client-check-http-token.js create mode 100644 tests/node_compat/test/parallel/test-http-client-close-with-default-agent.js create mode 100644 tests/node_compat/test/parallel/test-http-client-default-headers-exist.js create mode 100644 tests/node_compat/test/parallel/test-http-client-defaults.js create mode 100644 tests/node_compat/test/parallel/test-http-client-encoding.js create mode 100644 tests/node_compat/test/parallel/test-http-client-headers-array.js create mode 100644 tests/node_compat/test/parallel/test-http-client-invalid-path.js create mode 100644 tests/node_compat/test/parallel/test-http-client-keep-alive-hint.js create mode 100644 tests/node_compat/test/parallel/test-http-client-race-2.js create mode 100644 tests/node_compat/test/parallel/test-http-client-race.js create mode 100644 tests/node_compat/test/parallel/test-http-client-reject-unexpected-agent.js create mode 100644 tests/node_compat/test/parallel/test-http-client-timeout-connect-listener.js create mode 100644 tests/node_compat/test/parallel/test-http-client-timeout-with-data.js create mode 100644 tests/node_compat/test/parallel/test-http-client-unescaped-path.js create mode 100644 tests/node_compat/test/parallel/test-http-client-upload-buf.js create mode 100644 tests/node_compat/test/parallel/test-http-client-upload.js create mode 100644 tests/node_compat/test/parallel/test-http-common.js create mode 100644 tests/node_compat/test/parallel/test-http-contentLength0.js create mode 100644 tests/node_compat/test/parallel/test-http-correct-hostname.js create mode 100644 tests/node_compat/test/parallel/test-http-date-header.js create mode 100644 tests/node_compat/test/parallel/test-http-decoded-auth.js create mode 100644 tests/node_compat/test/parallel/test-http-default-encoding.js create mode 100644 tests/node_compat/test/parallel/test-http-dump-req-when-res-ends.js create mode 100644 tests/node_compat/test/parallel/test-http-end-throw-socket-handling.js create mode 100644 tests/node_compat/test/parallel/test-http-eof-on-connect.js create mode 100644 tests/node_compat/test/parallel/test-http-extra-response.js create mode 100644 tests/node_compat/test/parallel/test-http-flush-headers.js create mode 100644 tests/node_compat/test/parallel/test-http-full-response.js create mode 100644 tests/node_compat/test/parallel/test-http-head-request.js create mode 100644 tests/node_compat/test/parallel/test-http-head-response-has-no-body-end-implicit-headers.js create mode 100644 tests/node_compat/test/parallel/test-http-head-response-has-no-body-end.js create mode 100644 tests/node_compat/test/parallel/test-http-head-response-has-no-body.js create mode 100644 tests/node_compat/test/parallel/test-http-head-throw-on-response-body-write.js create mode 100644 tests/node_compat/test/parallel/test-http-header-obstext.js create mode 100644 tests/node_compat/test/parallel/test-http-header-owstext.js create mode 100644 tests/node_compat/test/parallel/test-http-header-read.js create mode 100644 tests/node_compat/test/parallel/test-http-hex-write.js create mode 100644 tests/node_compat/test/parallel/test-http-highwatermark.js create mode 100644 tests/node_compat/test/parallel/test-http-host-headers.js create mode 100644 tests/node_compat/test/parallel/test-http-hostname-typechecking.js create mode 100644 tests/node_compat/test/parallel/test-http-incoming-message-destroy.js create mode 100644 tests/node_compat/test/parallel/test-http-invalid-path-chars.js create mode 100644 tests/node_compat/test/parallel/test-http-invalidheaderfield.js create mode 100644 tests/node_compat/test/parallel/test-http-invalidheaderfield2.js create mode 100644 tests/node_compat/test/parallel/test-http-keep-alive-timeout-custom.js create mode 100644 tests/node_compat/test/parallel/test-http-listening.js create mode 100644 tests/node_compat/test/parallel/test-http-localaddress-bind-error.js create mode 100644 tests/node_compat/test/parallel/test-http-methods.js create mode 100644 tests/node_compat/test/parallel/test-http-outgoing-end-types.js create mode 100644 tests/node_compat/test/parallel/test-http-outgoing-finished.js create mode 100644 tests/node_compat/test/parallel/test-http-outgoing-write-types.js create mode 100644 tests/node_compat/test/parallel/test-http-parser-free.js create mode 100644 tests/node_compat/test/parallel/test-http-pause-no-dump.js create mode 100644 tests/node_compat/test/parallel/test-http-pause-resume-one-end.js create mode 100644 tests/node_compat/test/parallel/test-http-pause.js create mode 100644 tests/node_compat/test/parallel/test-http-pipe-fs.js create mode 100644 tests/node_compat/test/parallel/test-http-pipeline-requests-connection-leak.js create mode 100644 tests/node_compat/test/parallel/test-http-proxy.js create mode 100644 tests/node_compat/test/parallel/test-http-readable-data-event.js create mode 100644 tests/node_compat/test/parallel/test-http-request-arguments.js create mode 100644 tests/node_compat/test/parallel/test-http-request-dont-override-options.js create mode 100644 tests/node_compat/test/parallel/test-http-request-end-twice.js create mode 100644 tests/node_compat/test/parallel/test-http-request-end.js create mode 100644 tests/node_compat/test/parallel/test-http-request-invalid-method-error.js create mode 100644 tests/node_compat/test/parallel/test-http-request-large-payload.js create mode 100644 tests/node_compat/test/parallel/test-http-request-methods.js create mode 100644 tests/node_compat/test/parallel/test-http-res-write-end-dont-take-array.js create mode 100644 tests/node_compat/test/parallel/test-http-response-multiheaders.js create mode 100644 tests/node_compat/test/parallel/test-http-response-readable.js create mode 100644 tests/node_compat/test/parallel/test-http-response-writehead-returns-this.js create mode 100644 tests/node_compat/test/parallel/test-http-server-delete-parser.js create mode 100644 tests/node_compat/test/parallel/test-http-server-write-after-end.js create mode 100644 tests/node_compat/test/parallel/test-http-server-write-end-after-end.js create mode 100644 tests/node_compat/test/parallel/test-http-set-cookies.js create mode 100644 tests/node_compat/test/parallel/test-http-set-header-chain.js create mode 100644 tests/node_compat/test/parallel/test-http-status-code.js create mode 100644 tests/node_compat/test/parallel/test-http-status-reason-invalid-chars.js create mode 100644 tests/node_compat/test/parallel/test-http-uncaught-from-request-callback.js create mode 100644 tests/node_compat/test/parallel/test-http-url.parse-auth.js create mode 100644 tests/node_compat/test/parallel/test-http-url.parse-basic.js create mode 100644 tests/node_compat/test/parallel/test-http-url.parse-path.js create mode 100644 tests/node_compat/test/parallel/test-http-url.parse-post.js create mode 100644 tests/node_compat/test/parallel/test-http-url.parse-search.js create mode 100644 tests/node_compat/test/parallel/test-http-wget.js create mode 100644 tests/node_compat/test/parallel/test-http-write-empty-string.js create mode 100644 tests/node_compat/test/parallel/test-http-zerolengthbuffer.js create mode 100644 tests/node_compat/test/parallel/test-http2-client-request-listeners-warning.js create mode 100644 tests/node_compat/test/parallel/test-http2-compat-expect-handling.js create mode 100644 tests/node_compat/test/parallel/test-http2-compat-socket-set.js create mode 100644 tests/node_compat/test/parallel/test-http2-connect-options.js create mode 100644 tests/node_compat/test/parallel/test-http2-date-header.js create mode 100644 tests/node_compat/test/parallel/test-http2-dont-override.js create mode 100644 tests/node_compat/test/parallel/test-http2-endafterheaders.js create mode 100644 tests/node_compat/test/parallel/test-http2-methods.js create mode 100644 tests/node_compat/test/parallel/test-http2-request-response-proto.js create mode 100644 tests/node_compat/test/parallel/test-http2-respond-file-204.js create mode 100644 tests/node_compat/test/parallel/test-http2-respond-file-compat.js create mode 100644 tests/node_compat/test/parallel/test-http2-session-timeout.js create mode 100644 tests/node_compat/test/parallel/test-http2-socket-proxy.js create mode 100644 tests/node_compat/test/parallel/test-http2-status-code-invalid.js create mode 100644 tests/node_compat/test/parallel/test-http2-status-code.js create mode 100644 tests/node_compat/test/parallel/test-http2-stream-removelisteners-after-close.js create mode 100644 tests/node_compat/test/parallel/test-http2-write-empty-string.js create mode 100644 tests/node_compat/test/parallel/test-https-client-renegotiation-limit.js create mode 100644 tests/node_compat/test/parallel/test-https-connecting-to-http.js create mode 100644 tests/node_compat/test/parallel/test-https-foafssl.js create mode 100644 tests/node_compat/test/parallel/test-https-localaddress-bind-error.js create mode 100644 tests/node_compat/test/parallel/test-https-localaddress.js create mode 100644 tests/node_compat/test/parallel/test-icu-data-dir.js create mode 100644 tests/node_compat/test/parallel/test-icu-env.js create mode 100644 tests/node_compat/test/parallel/test-icu-stringwidth.js create mode 100644 tests/node_compat/test/parallel/test-inspector-stops-no-file.js create mode 100644 tests/node_compat/test/parallel/test-instanceof.js create mode 100644 tests/node_compat/test/parallel/test-internal-fs.js create mode 100644 tests/node_compat/test/parallel/test-internal-util-normalizeencoding.js create mode 100644 tests/node_compat/test/parallel/test-kill-segfault-freebsd.js create mode 100644 tests/node_compat/test/parallel/test-listen-fd-detached-inherit.js create mode 100644 tests/node_compat/test/parallel/test-listen-fd-detached.js create mode 100644 tests/node_compat/test/parallel/test-memory-usage-emfile.js create mode 100644 tests/node_compat/test/parallel/test-memory-usage.js create mode 100644 tests/node_compat/test/parallel/test-messagechannel.js create mode 100644 tests/node_compat/test/parallel/test-microtask-queue-integration.js create mode 100644 tests/node_compat/test/parallel/test-microtask-queue-run-immediate.js create mode 100644 tests/node_compat/test/parallel/test-microtask-queue-run.js create mode 100644 tests/node_compat/test/parallel/test-module-cache.js create mode 100644 tests/node_compat/test/parallel/test-module-circular-symlinks.js create mode 100644 tests/node_compat/test/parallel/test-module-isBuiltin.js create mode 100644 tests/node_compat/test/parallel/test-module-multi-extensions.js create mode 100644 tests/node_compat/test/parallel/test-module-nodemodulepaths.js create mode 100644 tests/node_compat/test/parallel/test-module-readonly.js create mode 100644 tests/node_compat/test/parallel/test-module-relative-lookup.js create mode 100644 tests/node_compat/test/parallel/test-net-after-close.js create mode 100644 tests/node_compat/test/parallel/test-net-better-error-messages-listen.js create mode 100644 tests/node_compat/test/parallel/test-net-bind-twice.js create mode 100644 tests/node_compat/test/parallel/test-net-buffersize.js create mode 100644 tests/node_compat/test/parallel/test-net-bytes-written-large.js create mode 100644 tests/node_compat/test/parallel/test-net-can-reset-timeout.js create mode 100644 tests/node_compat/test/parallel/test-net-connect-call-socket-connect.js create mode 100644 tests/node_compat/test/parallel/test-net-connect-options-fd.js create mode 100644 tests/node_compat/test/parallel/test-net-connect-options-ipv6.js create mode 100644 tests/node_compat/test/parallel/test-net-connect-options-port.js create mode 100644 tests/node_compat/test/parallel/test-net-connect-paused-connection.js create mode 100644 tests/node_compat/test/parallel/test-net-dns-custom-lookup.js create mode 100644 tests/node_compat/test/parallel/test-net-dns-lookup-skip.js create mode 100644 tests/node_compat/test/parallel/test-net-dns-lookup.js create mode 100644 tests/node_compat/test/parallel/test-net-eaddrinuse.js create mode 100644 tests/node_compat/test/parallel/test-net-error-twice.js create mode 100644 tests/node_compat/test/parallel/test-net-keepalive.js create mode 100644 tests/node_compat/test/parallel/test-net-listen-after-destroying-stdin.js create mode 100644 tests/node_compat/test/parallel/test-net-listen-error.js create mode 100644 tests/node_compat/test/parallel/test-net-local-address-port.js create mode 100644 tests/node_compat/test/parallel/test-net-pause-resume-connecting.js create mode 100644 tests/node_compat/test/parallel/test-net-persistent-keepalive.js create mode 100644 tests/node_compat/test/parallel/test-net-persistent-nodelay.js create mode 100644 tests/node_compat/test/parallel/test-net-persistent-ref-unref.js create mode 100644 tests/node_compat/test/parallel/test-net-reconnect.js create mode 100644 tests/node_compat/test/parallel/test-net-remote-address-port.js create mode 100644 tests/node_compat/test/parallel/test-net-remote-address.js create mode 100644 tests/node_compat/test/parallel/test-net-server-capture-rejection.js create mode 100644 tests/node_compat/test/parallel/test-net-server-close.js create mode 100644 tests/node_compat/test/parallel/test-net-server-pause-on-connect.js create mode 100644 tests/node_compat/test/parallel/test-net-settimeout.js create mode 100644 tests/node_compat/test/parallel/test-net-socket-close-after-end.js create mode 100644 tests/node_compat/test/parallel/test-net-socket-connect-invalid-autoselectfamily.js create mode 100644 tests/node_compat/test/parallel/test-net-socket-connect-without-cb.js create mode 100644 tests/node_compat/test/parallel/test-net-socket-connecting.js create mode 100644 tests/node_compat/test/parallel/test-net-socket-destroy-send.js create mode 100644 tests/node_compat/test/parallel/test-net-socket-end-before-connect.js create mode 100644 tests/node_compat/test/parallel/test-net-socket-end-callback.js create mode 100644 tests/node_compat/test/parallel/test-net-socket-ready-without-cb.js create mode 100644 tests/node_compat/test/parallel/test-net-socket-timeout-unref.js create mode 100644 tests/node_compat/test/parallel/test-net-socket-write-after-close.js create mode 100644 tests/node_compat/test/parallel/test-net-socket-write-error.js create mode 100644 tests/node_compat/test/parallel/test-net-sync-cork.js create mode 100644 tests/node_compat/test/parallel/test-net-writable.js create mode 100644 tests/node_compat/test/parallel/test-net-write-connect-write.js create mode 100644 tests/node_compat/test/parallel/test-net-write-fully-async-buffer.js create mode 100644 tests/node_compat/test/parallel/test-net-write-fully-async-hex-string.js create mode 100644 tests/node_compat/test/parallel/test-net-write-slow.js create mode 100644 tests/node_compat/test/parallel/test-next-tick-domain.js create mode 100644 tests/node_compat/test/parallel/test-next-tick-errors.js create mode 100644 tests/node_compat/test/parallel/test-no-node-snapshot.js create mode 100644 tests/node_compat/test/parallel/test-os-homedir-no-envvar.js create mode 100644 tests/node_compat/test/parallel/test-perf-gc-crash.js create mode 100644 tests/node_compat/test/parallel/test-performanceobserver-gc.js create mode 100644 tests/node_compat/test/parallel/test-pipe-return-val.js create mode 100644 tests/node_compat/test/parallel/test-pipe-writev.js create mode 100644 tests/node_compat/test/parallel/test-process-abort.js create mode 100644 tests/node_compat/test/parallel/test-process-argv-0.js create mode 100644 tests/node_compat/test/parallel/test-process-binding.js create mode 100644 tests/node_compat/test/parallel/test-process-dlopen-undefined-exports.js create mode 100644 tests/node_compat/test/parallel/test-process-domain-segfault.js create mode 100644 tests/node_compat/test/parallel/test-process-emitwarning.js create mode 100644 tests/node_compat/test/parallel/test-process-env-delete.js create mode 100644 tests/node_compat/test/parallel/test-process-env-windows-error-reset.js create mode 100644 tests/node_compat/test/parallel/test-process-getgroups.js create mode 100644 tests/node_compat/test/parallel/test-process-hrtime-bigint.js create mode 100644 tests/node_compat/test/parallel/test-process-next-tick.js create mode 100644 tests/node_compat/test/parallel/test-process-no-deprecation.js create mode 100644 tests/node_compat/test/parallel/test-process-ppid.js create mode 100644 tests/node_compat/test/parallel/test-process-really-exit.js create mode 100644 tests/node_compat/test/parallel/test-process-warning.js create mode 100644 tests/node_compat/test/parallel/test-promise-handled-rejection-no-warning.js create mode 100644 tests/node_compat/test/parallel/test-readable-from-iterator-closing.js create mode 100644 tests/node_compat/test/parallel/test-readable-from.js create mode 100644 tests/node_compat/test/parallel/test-readable-large-hwm.js create mode 100644 tests/node_compat/test/parallel/test-readable-single-end.js create mode 100644 tests/node_compat/test/parallel/test-readline-async-iterators-destroy.js create mode 100644 tests/node_compat/test/parallel/test-readline-async-iterators.js create mode 100644 tests/node_compat/test/parallel/test-readline-carriage-return-between-chunks.js create mode 100644 tests/node_compat/test/parallel/test-readline-csi.js create mode 100644 tests/node_compat/test/parallel/test-ref-unref-return.js create mode 100644 tests/node_compat/test/parallel/test-regression-object-prototype.js create mode 100644 tests/node_compat/test/parallel/test-require-invalid-package.js create mode 100644 tests/node_compat/test/parallel/test-require-long-path.js create mode 100644 tests/node_compat/test/parallel/test-require-nul.js create mode 100644 tests/node_compat/test/parallel/test-require-process.js create mode 100644 tests/node_compat/test/parallel/test-signal-handler-remove-on-exit.js create mode 100644 tests/node_compat/test/parallel/test-signal-handler.js create mode 100644 tests/node_compat/test/parallel/test-socket-address.js create mode 100644 tests/node_compat/test/parallel/test-socket-write-after-fin-error.js create mode 100644 tests/node_compat/test/parallel/test-source-map-enable.js create mode 100644 tests/node_compat/test/parallel/test-spawn-cmd-named-pipe.js create mode 100644 tests/node_compat/test/parallel/test-stdin-hang.js create mode 100644 tests/node_compat/test/parallel/test-stdin-pipe-large.js create mode 100644 tests/node_compat/test/parallel/test-stdin-pipe-resume.js create mode 100644 tests/node_compat/test/parallel/test-stdin-script-child-option.js create mode 100644 tests/node_compat/test/parallel/test-stdio-pipe-access.js create mode 100644 tests/node_compat/test/parallel/test-stdio-pipe-redirect.js create mode 100644 tests/node_compat/test/parallel/test-stdio-pipe-stderr.js create mode 100644 tests/node_compat/test/parallel/test-stdio-undestroy.js create mode 100644 tests/node_compat/test/parallel/test-stdout-cannot-be-closed-child-process-pipe.js create mode 100644 tests/node_compat/test/parallel/test-stdout-pipeline-destroy.js create mode 100644 tests/node_compat/test/parallel/test-stdout-stderr-reading.js create mode 100644 tests/node_compat/test/parallel/test-stdout-stderr-write.js create mode 100644 tests/node_compat/test/parallel/test-stream-catch-rejections.js create mode 100644 tests/node_compat/test/parallel/test-stream-decoder-objectmode.js create mode 100644 tests/node_compat/test/parallel/test-stream-duplex-readable-writable.js create mode 100644 tests/node_compat/test/parallel/test-stream-end-of-streams.js create mode 100644 tests/node_compat/test/parallel/test-stream-filter.js create mode 100644 tests/node_compat/test/parallel/test-stream-flatMap.js create mode 100644 tests/node_compat/test/parallel/test-stream-forEach.js create mode 100644 tests/node_compat/test/parallel/test-stream-passthrough-drain.js create mode 100644 tests/node_compat/test/parallel/test-stream-pipe-error-unhandled.js create mode 100644 tests/node_compat/test/parallel/test-stream-pipeline-duplex.js create mode 100644 tests/node_compat/test/parallel/test-stream-pipeline-listeners.js create mode 100644 tests/node_compat/test/parallel/test-stream-pipeline-uncaught.js create mode 100644 tests/node_compat/test/parallel/test-stream-push-order.js create mode 100644 tests/node_compat/test/parallel/test-stream-readable-strategy-option.js create mode 100644 tests/node_compat/test/parallel/test-stream-readable-unpipe-resume.js create mode 100644 tests/node_compat/test/parallel/test-stream-reduce.js create mode 100644 tests/node_compat/test/parallel/test-stream-toArray.js create mode 100644 tests/node_compat/test/parallel/test-stream-toWeb-allows-server-response.js create mode 100644 tests/node_compat/test/parallel/test-stream-transform-hwm0.js create mode 100644 tests/node_compat/test/parallel/test-stream-writable-end-cb-uncaught.js create mode 100644 tests/node_compat/test/parallel/test-stream2-finish-pipe-error.js create mode 100644 tests/node_compat/test/parallel/test-stream3-pipeline-async-iterator.js create mode 100644 tests/node_compat/test/parallel/test-stringbytes-external.js create mode 100644 tests/node_compat/test/parallel/test-sync-fileread.js create mode 100644 tests/node_compat/test/parallel/test-sys.js create mode 100644 tests/node_compat/test/parallel/test-tick-processor-arguments.js create mode 100644 tests/node_compat/test/parallel/test-timers-clearImmediate-als.js create mode 100644 tests/node_compat/test/parallel/test-timers-immediate-queue.js create mode 100644 tests/node_compat/test/parallel/test-timers-immediate.js create mode 100644 tests/node_compat/test/parallel/test-timers-refresh-in-callback.js create mode 100644 tests/node_compat/test/parallel/test-timers-setimmediate-infinite-loop.js create mode 100644 tests/node_compat/test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js create mode 100644 tests/node_compat/test/parallel/test-timers-unref.js create mode 100644 tests/node_compat/test/parallel/test-timers-unrefd-interval-still-fires.js create mode 100644 tests/node_compat/test/parallel/test-timers-unrefed-in-beforeexit.js create mode 100644 tests/node_compat/test/parallel/test-timers-unrefed-in-callback.js create mode 100644 tests/node_compat/test/parallel/test-timers.js create mode 100644 tests/node_compat/test/parallel/test-tls-alert-handling.js create mode 100644 tests/node_compat/test/parallel/test-tls-alert.js create mode 100644 tests/node_compat/test/parallel/test-tls-client-renegotiation-limit.js create mode 100644 tests/node_compat/test/parallel/test-tls-dhe.js create mode 100644 tests/node_compat/test/parallel/test-tls-ecdh-auto.js create mode 100644 tests/node_compat/test/parallel/test-tls-ecdh-multiple.js create mode 100644 tests/node_compat/test/parallel/test-tls-ecdh.js create mode 100644 tests/node_compat/test/parallel/test-tls-enable-trace-cli.js create mode 100644 tests/node_compat/test/parallel/test-tls-enable-trace.js create mode 100644 tests/node_compat/test/parallel/test-tls-env-extra-ca-no-crypto.js create mode 100644 tests/node_compat/test/parallel/test-tls-ocsp-callback.js create mode 100644 tests/node_compat/test/parallel/test-tls-psk-server.js create mode 100644 tests/node_compat/test/parallel/test-tls-securepair-server.js create mode 100644 tests/node_compat/test/parallel/test-tls-server-verify.js create mode 100644 tests/node_compat/test/parallel/test-tls-session-cache.js create mode 100644 tests/node_compat/test/parallel/test-tls-set-ciphers.js create mode 100644 tests/node_compat/test/parallel/test-tls-transport-destroy-after-own-gc.js create mode 100644 tests/node_compat/test/parallel/test-trace-events-async-hooks-dynamic.js create mode 100644 tests/node_compat/test/parallel/test-trace-events-async-hooks-worker.js create mode 100644 tests/node_compat/test/parallel/test-tz-version.js create mode 100644 tests/node_compat/test/parallel/test-utf8-scripts.js create mode 100644 tests/node_compat/test/parallel/test-util-inspect-getters-accessing-this.js create mode 100644 tests/node_compat/test/parallel/test-util-primordial-monkeypatching.js create mode 100644 tests/node_compat/test/parallel/test-uv-binding-constant.js create mode 100644 tests/node_compat/test/parallel/test-uv-unmapped-exception.js create mode 100644 tests/node_compat/test/parallel/test-v8-coverage.js create mode 100644 tests/node_compat/test/parallel/test-v8-deserialize-buffer.js create mode 100644 tests/node_compat/test/parallel/test-v8-flag-pool-size-0.js create mode 100644 tests/node_compat/test/parallel/test-v8-global-setter.js create mode 100644 tests/node_compat/test/parallel/test-v8-stop-coverage.js create mode 100644 tests/node_compat/test/parallel/test-v8-take-coverage-noop.js create mode 100644 tests/node_compat/test/parallel/test-v8-take-coverage.js create mode 100644 tests/node_compat/test/parallel/test-weakref.js create mode 100644 tests/node_compat/test/parallel/test-webcrypto-encrypt-decrypt.js create mode 100644 tests/node_compat/test/parallel/test-websocket.js create mode 100644 tests/node_compat/test/parallel/test-webstream-string-tag.js create mode 100644 tests/node_compat/test/parallel/test-whatwg-readablebytestreambyob.js create mode 100644 tests/node_compat/test/parallel/test-worker-cleanexit-with-js.js create mode 100644 tests/node_compat/test/parallel/test-worker-on-process-exit.js create mode 100644 tests/node_compat/test/parallel/test-worker-ref-onexit.js create mode 100644 tests/node_compat/test/parallel/test-worker-terminate-unrefed.js create mode 100644 tests/node_compat/test/parallel/test-zlib-create-raw.js create mode 100644 tests/node_compat/test/parallel/test-zlib-flush-write-sync-interleaved.js create mode 100644 tests/node_compat/test/pseudo-tty/test-set-raw-mode-reset-process-exit.js create mode 100644 tests/node_compat/test/pseudo-tty/test-set-raw-mode-reset.js create mode 100644 tests/node_compat/test/pseudo-tty/test-tty-stdin-call-end.js create mode 100644 tests/node_compat/test/pummel/test-crypto-dh-hash.js create mode 100644 tests/node_compat/test/pummel/test-crypto-timing-safe-equal-benchmarks.js create mode 100644 tests/node_compat/test/pummel/test-dh-regr.js create mode 100644 tests/node_compat/test/pummel/test-fs-largefile.js create mode 100644 tests/node_compat/test/pummel/test-fs-readfile-tostring-fail.js create mode 100644 tests/node_compat/test/pummel/test-fs-watch-system-limit.js create mode 100644 tests/node_compat/test/pummel/test-heapsnapshot-near-heap-limit-big.js create mode 100644 tests/node_compat/test/pummel/test-net-many-clients.js create mode 100644 tests/node_compat/test/pummel/test-net-pingpong-delay.js create mode 100644 tests/node_compat/test/pummel/test-process-cpuUsage.js create mode 100644 tests/node_compat/test/pummel/test-stream-pipe-multi.js create mode 100644 tests/node_compat/test/sequential/test-buffer-creation-regression.js create mode 100644 tests/node_compat/test/sequential/test-http-server-keep-alive-timeout-slow-server.js create mode 100644 tests/node_compat/test/sequential/test-net-better-error-messages-port.js create mode 100644 tests/node_compat/test/sequential/test-net-connect-handle-econnrefused.js create mode 100644 tests/node_compat/test/sequential/test-net-connect-local-error.js create mode 100644 tests/node_compat/test/sequential/test-net-reconnect-error.js create mode 100644 tests/node_compat/test/sequential/test-net-response-size.js create mode 100644 tests/node_compat/test/sequential/test-net-server-bind.js create mode 100644 tests/node_compat/test/sequential/test-tls-lookup.js create mode 100644 tests/node_compat/test/sequential/test-tls-psk-client.js create mode 100644 tests/node_compat/test/sequential/test-tls-securepair-client.js create mode 100644 tests/node_compat/test/sequential/test-tls-session-timeout.js diff --git a/tests/node_compat/config.jsonc b/tests/node_compat/config.jsonc index 5acbd25dc3..04cb4e6e2d 100644 --- a/tests/node_compat/config.jsonc +++ b/tests/node_compat/config.jsonc @@ -122,6 +122,16 @@ "sequential": ["test-child-process-exit.js"] }, "tests": { + "abort": [ + "test-addon-uv-handle-leak.js" + ], + "benchmark": [ + "test-benchmark-async-hooks.js", + "test-benchmark-http.js", + "test-benchmark-http2.js", + "test-benchmark-tls.js", + "test-benchmark-worker.js" + ], "common": [ "child_process.js", "countdown.js", @@ -133,6 +143,13 @@ "internet.js", "tmpdir.js" ], + "es-module": [ + "test-cjs-prototype-pollution.js", + "test-esm-dynamic-import-mutating-fs.js", + "test-esm-loader-cache-clearing.js", + "test-esm-windows.js", + "test-vm-compile-function-lineoffset.js" + ], "fixtures": [ "a.js", "child_process_should_emit_error.js", @@ -161,12 +178,29 @@ // "test-dns.js", "test-http-https-default-ports.js" ], + "message": [ + "eval_messages.js", + "max_tick_depth.js", + "stdin_messages.js", + "util_inspect_error.js" + ], "parallel": [ + "test-arm-math-illegal-instruction.js", "test-assert-async.js", "test-assert-fail.js", "test-assert-strict-exists.js", "test-assert.js", + "test-async-hooks-run-in-async-scope-caught-exception.js", + "test-async-hooks-run-in-async-scope-this-arg.js", + "test-async-local-storage-bind.js", + "test-async-local-storage-contexts.js", + "test-async-local-storage-deep-stack.js", + "test-async-local-storage-http-multiclients.js", + "test-async-local-storage-snapshot.js", + "test-atomics-wake.js", "test-bad-unicode.js", + "test-beforeexit-event-exit.js", + "test-blob-buffer-too-large.js", "test-blocklist.js", "test-btoa-atob.js", "test-buffer-alloc.js", @@ -202,6 +236,7 @@ "test-buffer-readint.js", "test-buffer-readuint.js", "test-buffer-safe-unsafe.js", + "test-buffer-sharedarraybuffer.js", "test-buffer-slice.js", "test-buffer-slow.js", "test-buffer-swap.js", @@ -209,6 +244,7 @@ "test-buffer-tostring-range.js", "test-buffer-tostring-rangeerror.js", "test-buffer-tostring.js", + "test-buffer-write.js", "test-buffer-writedouble.js", "test-buffer-writefloat.js", "test-buffer-writeint.js", @@ -237,8 +273,10 @@ "test-child-process-execfilesync-maxbuf.js", "test-child-process-execsync-maxbuf.js", "test-child-process-flush-stdio.js", + "test-child-process-fork3.js", "test-child-process-ipc-next-tick.js", "test-child-process-kill.js", + "test-child-process-send-type-error.js", "test-child-process-set-blocking.js", "test-child-process-spawn-args.js", "test-child-process-spawn-event.js", @@ -246,49 +284,140 @@ "test-child-process-spawnsync-maxbuf.js", "test-child-process-spawnsync-validation-errors.js", "test-child-process-spawnsync.js", - // TODO(crowlKats): socket is not yet polyfilled - // "test-client-request-destroy.js", + "test-child-process-stdin-ipc.js", + "test-child-process-stdio-overlapped.js", + "test-client-request-destroy.js", + "test-cluster-uncaught-exception.js", + "test-console-assign-undefined.js", "test-console-async-write-error.js", + "test-console-formatTime.js", "test-console-group.js", "test-console-log-stdio-broken-dest.js", "test-console-log-throw-primitive.js", "test-console-no-swallow-stack-overflow.js", + "test-console-not-call-toString.js", + "test-console-self-assign.js", "test-console-sync-write-error.js", "test-console-table.js", "test-console-tty-colors.js", + "test-crypto-dh-errors.js", + "test-crypto-dh-odd-key.js", "test-crypto-dh-shared.js", "test-crypto-dh.js", + "test-crypto-domain.js", + "test-crypto-from-binary.js", "test-crypto-hash.js", "test-crypto-hkdf.js", "test-crypto-hmac.js", + "test-crypto-keygen-dh-classic.js", + "test-crypto-keygen-duplicate-deprecated-option.js", + "test-crypto-keygen-empty-passphrase-no-error.js", + "test-crypto-keygen-key-objects.js", + "test-crypto-keygen-missing-oid.js", + "test-crypto-keygen-non-standard-public-exponent.js", + "test-crypto-keygen-rfc8017-9-1.js", + "test-crypto-keygen-rfc8017-a-2-3.js", + "test-crypto-lazy-transform-writable.js", + "test-crypto-no-algorithm.js", + "test-crypto-op-during-process-exit.js", + "test-crypto-padding-aes256.js", "test-crypto-pbkdf2.js", "test-crypto-prime.js", + "test-crypto-psychic-signatures.js", + "test-crypto-publicDecrypt-fails-first-time.js", + "test-crypto-randomfillsync-regression.js", + "test-crypto-scrypt.js", "test-crypto-secret-keygen.js", "test-crypto-stream.js", + "test-crypto-subtle-zero-length.js", "test-crypto-update-encoding.js", "test-crypto-x509.js", + "test-dgram-address.js", + "test-dgram-bind-default-address.js", + "test-dgram-bind-error-repeat.js", + "test-dgram-bind.js", + "test-dgram-bytes-length.js", "test-dgram-close-during-bind.js", + "test-dgram-close-in-listening.js", + "test-dgram-close-is-not-callback.js", "test-dgram-close-signal.js", + "test-dgram-close.js", + "test-dgram-connect-send-callback-buffer-length.js", + "test-dgram-connect-send-callback-buffer.js", + "test-dgram-connect-send-callback-multi-buffer.js", + "test-dgram-connect-send-default-host.js", + "test-dgram-connect-send-empty-array.js", + "test-dgram-connect-send-empty-buffer.js", + "test-dgram-connect-send-empty-packet.js", + "test-dgram-connect-send-multi-buffer-copy.js", + "test-dgram-connect-send-multi-string-array.js", + "test-dgram-connect.js", + "test-dgram-createSocket-type.js", + "test-dgram-error-message-address.js", + "test-dgram-implicit-bind.js", + "test-dgram-listen-after-bind.js", + "test-dgram-msgsize.js", + "test-dgram-oob-buffer.js", + "test-dgram-recv-error.js", + "test-dgram-ref.js", + "test-dgram-send-bad-arguments.js", + "test-dgram-send-callback-buffer-empty-address.js", + "test-dgram-send-callback-buffer-length-empty-address.js", + "test-dgram-send-callback-buffer-length.js", + "test-dgram-send-callback-buffer.js", + "test-dgram-send-callback-multi-buffer-empty-address.js", + "test-dgram-send-callback-multi-buffer.js", + "test-dgram-send-callback-recursive.js", + "test-dgram-send-default-host.js", + "test-dgram-send-empty-array.js", + "test-dgram-send-empty-buffer.js", + "test-dgram-send-empty-packet.js", + "test-dgram-send-error.js", + "test-dgram-send-invalid-msg-type.js", + "test-dgram-send-multi-buffer-copy.js", + "test-dgram-send-multi-string-array.js", + "test-dgram-udp4.js", + "test-dgram-udp6-send-default-host.js", + "test-dgram-unref.js", + "test-diagnostics-channel-bind-store.js", "test-diagnostics-channel-has-subscribers.js", "test-diagnostics-channel-net.js", "test-diagnostics-channel-object-channel-pub-sub.js", "test-diagnostics-channel-pub-sub.js", + "test-diagnostics-channel-safe-subscriber-errors.js", "test-diagnostics-channel-symbol-named.js", "test-diagnostics-channel-sync-unsubscribe.js", "test-diagnostics-channel-tracing-channel-args-types.js", + "test-diagnostics-channel-tracing-channel-async-error.js", + "test-diagnostics-channel-tracing-channel-async.js", "test-diagnostics-channel-tracing-channel-callback-run-stores.js", "test-diagnostics-channel-tracing-channel-promise-run-stores.js", + "test-diagnostics-channel-tracing-channel-run-stores.js", "test-diagnostics-channel-tracing-channel-sync-error.js", "test-diagnostics-channel-tracing-channel-sync.js", "test-diagnostics-channel-udp.js", "test-dns-lookup.js", "test-dns-memory-error.js", + "test-dns-multi-channel.js", "test-dns-promises-exists.js", "test-dns-resolvens-typeerror.js", "test-dns-setservers-type-check.js", + "test-domain-crypto.js", + "test-domain-ee-error-listener.js", + "test-domain-nested-throw.js", + "test-domain-nested.js", + "test-domain-stack.js", + "test-domain-top-level-error-handler-clears-stack.js", + "test-dsa-fips-invalid-key.js", + "test-env-newprotomethod-remove-unnecessary-prototypes.js", + "test-error-aggregateTwoErrors.js", + "test-error-prepare-stack-trace.js", + "test-errors-aborterror.js", "test-eval-strict-referenceerror.js", "test-eval.js", + "test-event-capture-rejections.js", "test-event-emitter-add-listeners.js", + "test-event-emitter-check-listener-leaks.js", "test-event-emitter-emit-context.js", "test-event-emitter-error-monitor.js", "test-event-emitter-errors.js", @@ -297,6 +426,9 @@ "test-event-emitter-listener-count.js", "test-event-emitter-listeners-side-effects.js", "test-event-emitter-listeners.js", + "test-event-emitter-max-listeners-warning-for-null.js", + "test-event-emitter-max-listeners-warning-for-symbol.js", + "test-event-emitter-max-listeners-warning.js", "test-event-emitter-max-listeners.js", "test-event-emitter-method-names.js", "test-event-emitter-modify-in-emit.js", @@ -315,6 +447,7 @@ "test-events-once.js", "test-events-uncaught-exception-stack.js", "test-eventtarget-brandcheck.js", + "test-eventtarget-once-twice.js", "test-exception-handler.js", "test-exception-handler2.js", "test-file-read-noexist.js", @@ -325,28 +458,42 @@ "test-fs-access.js", "test-fs-append-file-sync.js", "test-fs-append-file.js", + "test-fs-buffertype-writesync.js", "test-fs-chmod-mask.js", "test-fs-chmod.js", "test-fs-chown-type-check.js", + "test-fs-close.js", + "test-fs-constants.js", "test-fs-copyfile.js", "test-fs-empty-readStream.js", + "test-fs-fmap.js", "test-fs-lchown.js", + "test-fs-long-path.js", "test-fs-mkdir.js", + "test-fs-non-number-arguments-throw.js", "test-fs-open-flags.js", "test-fs-open-mode-mask.js", "test-fs-open-no-close.js", "test-fs-open-numeric-flags.js", "test-fs-open.js", "test-fs-opendir.js", + "test-fs-promises-exists.js", "test-fs-promises-file-handle-stat.js", + "test-fs-promises-file-handle-write.js", + "test-fs-promises-readfile-empty.js", + "test-fs-promises-readfile-with-fd.js", "test-fs-promises-writefile-with-fd.js", + "test-fs-read-file-sync-hostname.js", + "test-fs-read-file-sync.js", "test-fs-read-stream-autoClose.js", "test-fs-read-stream-concurrent-reads.js", "test-fs-read-stream-double-close.js", "test-fs-read-stream-encoding.js", + "test-fs-read-stream-fd-leak.js", "test-fs-read-stream-fd.js", "test-fs-read-stream-inherit.js", "test-fs-read-stream-patch-open.js", + "test-fs-read-stream-pos.js", "test-fs-read-stream-resume.js", "test-fs-read-stream-throw-type-error.js", "test-fs-read-stream.js", @@ -356,8 +503,12 @@ "test-fs-readdir-stack-overflow.js", "test-fs-readdir.js", "test-fs-readfile-empty.js", + "test-fs-readfile-unlink.js", + "test-fs-readfile-zero-byte-liar.js", + "test-fs-readfilesync-enoent.js", "test-fs-readv-sync.js", "test-fs-readv.js", + "test-fs-ready-event-stream.js", "test-fs-realpath-native.js", "test-fs-rmdir-recursive-sync-warns-not-found.js", "test-fs-rmdir-recursive-sync-warns-on-file.js", @@ -367,33 +518,122 @@ "test-fs-rmdir-recursive-warns-on-file.js", "test-fs-rmdir-recursive.js", "test-fs-rmdir-type-check.js", + "test-fs-sir-writes-alot.js", + "test-fs-stream-construct-compat-error-read.js", + "test-fs-stream-construct-compat-graceful-fs.js", + "test-fs-stream-construct-compat-old-node.js", + "test-fs-stream-destroy-emit-error.js", + "test-fs-stream-double-close.js", + "test-fs-stream-fs-options.js", + "test-fs-stream-options.js", + "test-fs-symlink-dir-junction-relative.js", + "test-fs-timestamp-parsing-error.js", + "test-fs-truncate-clear-file-zero.js", + "test-fs-util-validateoffsetlength.js", + "test-fs-utimes-y2K38.js", "test-fs-utimes.js", + "test-fs-watch-file-enoent-after-deletion.js", + "test-fs-watch-recursive-add-file-with-url.js", + "test-fs-watch-recursive-add-file.js", + "test-fs-watch-recursive-add-folder.js", + "test-fs-watch-recursive-update-file.js", "test-fs-watchfile.js", "test-fs-write-buffer.js", "test-fs-write-file-buffer.js", "test-fs-write-file-invalid-path.js", "test-fs-write-file-sync.js", "test-fs-write-file.js", + "test-fs-write-negativeoffset.js", "test-fs-write-no-fd.js", "test-fs-write-stream-autoclose-option.js", "test-fs-write-stream-close-without-callback.js", "test-fs-write-stream-double-close.js", + "test-fs-write-stream-encoding.js", "test-fs-write-stream-end.js", "test-fs-write-stream-fs.js", + "test-fs-write-stream-patch-open.js", "test-fs-write-stream-throw-type-error.js", "test-fs-write-stream.js", "test-fs-write-sync.js", "test-fs-write.js", "test-fs-writev-sync.js", + "test-fs-writev.js", + "test-global-domexception.js", + "test-global-encoder.js", + "test-global-webcrypto.js", + "test-global-webstreams.js", "test-handle-wrap-close-abort.js", + "test-http-abort-before-end.js", + "test-http-addrequest-localaddress.js", + "test-http-agent-false.js", "test-http-agent-getname.js", + "test-http-agent-keepalive-delay.js", + "test-http-agent-maxtotalsockets.js", + "test-http-agent-no-protocol.js", + "test-http-agent-null.js", + "test-http-allow-req-after-204-res.js", + "test-http-bind-twice.js", + "test-http-buffer-sanity.js", + "test-http-chunked-smuggling.js", + "test-http-chunked.js", + "test-http-client-abort2.js", + "test-http-client-check-http-token.js", + "test-http-client-close-with-default-agent.js", + "test-http-client-default-headers-exist.js", + "test-http-client-defaults.js", + "test-http-client-encoding.js", "test-http-client-get-url.js", + "test-http-client-headers-array.js", + "test-http-client-invalid-path.js", + "test-http-client-keep-alive-hint.js", + "test-http-client-race-2.js", + "test-http-client-race.js", "test-http-client-read-in-error.js", + "test-http-client-reject-unexpected-agent.js", + "test-http-client-timeout-connect-listener.js", + "test-http-client-timeout-with-data.js", + "test-http-client-unescaped-path.js", + "test-http-client-upload-buf.js", + "test-http-client-upload.js", // TODO(lev): ClientRequest.socket is not polyfilled so this test keeps // failing //"test-http-client-set-timeout.js", + "test-http-common.js", + "test-http-contentLength0.js", + "test-http-correct-hostname.js", + "test-http-date-header.js", + "test-http-decoded-auth.js", + "test-http-default-encoding.js", + "test-http-dump-req-when-res-ends.js", + "test-http-end-throw-socket-handling.js", + "test-http-eof-on-connect.js", + "test-http-extra-response.js", + "test-http-flush-headers.js", + "test-http-full-response.js", + "test-http-head-request.js", + "test-http-head-response-has-no-body-end-implicit-headers.js", + "test-http-head-response-has-no-body-end.js", + "test-http-head-response-has-no-body.js", + "test-http-head-throw-on-response-body-write.js", + "test-http-header-obstext.js", + "test-http-header-owstext.js", + "test-http-header-read.js", "test-http-header-validators.js", + "test-http-hex-write.js", + "test-http-highwatermark.js", + "test-http-host-headers.js", + "test-http-hostname-typechecking.js", + "test-http-incoming-message-destroy.js", + "test-http-invalid-path-chars.js", + "test-http-invalidheaderfield.js", + "test-http-invalidheaderfield2.js", + "test-http-keep-alive-timeout-custom.js", + "test-http-listening.js", + "test-http-localaddress-bind-error.js", "test-http-localaddress.js", + "test-http-methods.js", + "test-http-outgoing-end-types.js", + "test-http-outgoing-finished.js", // TODO(bartlomieju): temporarily disabled while we iterate on the HTTP client // "test-http-outgoing-buffer.js", "test-http-outgoing-internal-headernames-getter.js", @@ -403,53 +643,186 @@ // "test-http-outgoing-message-inheritance.js", "test-http-outgoing-renderHeaders.js", "test-http-outgoing-settimeout.js", + "test-http-outgoing-write-types.js", + "test-http-parser-free.js", + "test-http-pause-no-dump.js", + "test-http-pause-resume-one-end.js", + "test-http-pause.js", + "test-http-pipe-fs.js", + "test-http-pipeline-requests-connection-leak.js", + "test-http-proxy.js", + "test-http-readable-data-event.js", + "test-http-request-arguments.js", + "test-http-request-dont-override-options.js", + "test-http-request-end-twice.js", + "test-http-request-end.js", + "test-http-request-invalid-method-error.js", + "test-http-request-large-payload.js", + "test-http-request-methods.js", + "test-http-res-write-end-dont-take-array.js", + "test-http-response-multiheaders.js", + "test-http-response-readable.js", + "test-http-response-writehead-returns-this.js", + "test-http-server-delete-parser.js", + "test-http-server-write-after-end.js", + "test-http-server-write-end-after-end.js", + "test-http-set-cookies.js", + "test-http-set-header-chain.js", + "test-http-status-code.js", + "test-http-status-reason-invalid-chars.js", + "test-http-uncaught-from-request-callback.js", + "test-http-url.parse-auth.js", + "test-http-url.parse-basic.js", "test-http-url.parse-https.request.js", "test-http-url.parse-only-support-http-https-protocol.js", + "test-http-url.parse-path.js", + "test-http-url.parse-post.js", + "test-http-url.parse-search.js", + "test-http-wget.js", + "test-http-write-empty-string.js", + "test-http-zerolengthbuffer.js", + "test-http2-client-request-listeners-warning.js", + "test-http2-compat-expect-handling.js", + "test-http2-compat-socket-set.js", + "test-http2-connect-options.js", + "test-http2-date-header.js", + "test-http2-dont-override.js", + "test-http2-endafterheaders.js", + "test-http2-methods.js", + "test-http2-request-response-proto.js", + "test-http2-respond-file-204.js", + "test-http2-respond-file-compat.js", + "test-http2-session-timeout.js", + "test-http2-socket-proxy.js", + "test-http2-status-code-invalid.js", + "test-http2-status-code.js", + "test-http2-stream-removelisteners-after-close.js", + "test-http2-write-empty-string.js", + "test-https-client-renegotiation-limit.js", + "test-https-connecting-to-http.js", + "test-https-foafssl.js", + "test-https-localaddress-bind-error.js", + "test-https-localaddress.js", + "test-icu-data-dir.js", + "test-icu-env.js", + "test-icu-stringwidth.js", "test-icu-transcode.js", + "test-inspector-stops-no-file.js", + "test-instanceof.js", + "test-internal-fs.js", + "test-internal-util-normalizeencoding.js", + "test-kill-segfault-freebsd.js", + "test-listen-fd-detached-inherit.js", + "test-listen-fd-detached.js", + "test-memory-usage-emfile.js", + "test-memory-usage.js", + "test-messagechannel.js", + "test-microtask-queue-integration.js", + "test-microtask-queue-run-immediate.js", + "test-microtask-queue-run.js", + "test-module-cache.js", + "test-module-circular-symlinks.js", + "test-module-isBuiltin.js", + "test-module-multi-extensions.js", + "test-module-nodemodulepaths.js", + "test-module-readonly.js", + "test-module-relative-lookup.js", "test-net-access-byteswritten.js", + "test-net-after-close.js", "test-net-autoselectfamily.js", "test-net-better-error-messages-listen-path.js", + "test-net-better-error-messages-listen.js", "test-net-better-error-messages-path.js", "test-net-better-error-messages-port-hostname.js", + "test-net-bind-twice.js", + "test-net-buffersize.js", + "test-net-bytes-written-large.js", + "test-net-can-reset-timeout.js", "test-net-connect-after-destroy.js", + "test-net-connect-call-socket-connect.js", "test-net-connect-destroy.js", "test-net-connect-immediate-destroy.js", "test-net-connect-immediate-finish.js", "test-net-connect-no-arg.js", + "test-net-connect-options-fd.js", + "test-net-connect-options-ipv6.js", + "test-net-connect-options-port.js", + "test-net-connect-paused-connection.js", + "test-net-dns-custom-lookup.js", "test-net-dns-error.js", + "test-net-dns-lookup-skip.js", + "test-net-dns-lookup.js", "test-net-during-close.js", + "test-net-eaddrinuse.js", "test-net-end-close.js", "test-net-end-without-connect.js", + "test-net-error-twice.js", "test-net-isip.js", "test-net-isipv4.js", "test-net-isipv6.js", + "test-net-keepalive.js", + "test-net-listen-after-destroying-stdin.js", "test-net-listen-close-server-callback-is-not-function.js", "test-net-listen-close-server.js", + "test-net-listen-error.js", "test-net-listen-invalid-port.js", "test-net-listening.js", + "test-net-local-address-port.js", "test-net-localerror.js", "test-net-options-lookup.js", + "test-net-pause-resume-connecting.js", + "test-net-persistent-keepalive.js", + "test-net-persistent-nodelay.js", + "test-net-persistent-ref-unref.js", "test-net-pipe-connect-errors.js", + "test-net-reconnect.js", + "test-net-remote-address-port.js", + "test-net-remote-address.js", + "test-net-server-capture-rejection.js", + "test-net-server-close.js", "test-net-server-listen-options-signal.js", "test-net-server-listen-options.js", "test-net-server-listen-path.js", "test-net-server-listen-remove-callback.js", "test-net-server-options.js", + "test-net-server-pause-on-connect.js", "test-net-server-unref-persistent.js", "test-net-server-unref.js", + "test-net-settimeout.js", + "test-net-socket-close-after-end.js", + "test-net-socket-connect-invalid-autoselectfamily.js", + "test-net-socket-connect-without-cb.js", + "test-net-socket-connecting.js", + "test-net-socket-destroy-send.js", "test-net-socket-destroy-twice.js", + "test-net-socket-end-before-connect.js", + "test-net-socket-end-callback.js", "test-net-socket-no-halfopen-enforcer.js", + "test-net-socket-ready-without-cb.js", "test-net-socket-setnodelay.js", + "test-net-socket-timeout-unref.js", + "test-net-socket-write-after-close.js", + "test-net-socket-write-error.js", + "test-net-sync-cork.js", "test-net-timeout-no-handle.js", + "test-net-writable.js", "test-net-write-arguments.js", + "test-net-write-connect-write.js", + "test-net-write-fully-async-buffer.js", + "test-net-write-fully-async-hex-string.js", + "test-net-write-slow.js", "test-next-tick-doesnt-hang.js", + "test-next-tick-domain.js", + "test-next-tick-errors.js", "test-next-tick-fixed-queue-regression.js", "test-next-tick-intentional-starvation.js", "test-next-tick-ordering.js", "test-next-tick-ordering2.js", "test-next-tick-when-exiting.js", "test-next-tick.js", + "test-no-node-snapshot.js", "test-nodeeventtarget.js", + "test-os-homedir-no-envvar.js", "test-os.js", "test-outgoing-message-destroy.js", "test-outgoing-message-pipe.js", @@ -468,15 +841,35 @@ "test-path-win32-exists.js", "test-path-zero-length-strings.js", "test-path.js", + "test-perf-gc-crash.js", + "test-performanceobserver-gc.js", + "test-pipe-return-val.js", + "test-pipe-writev.js", + "test-process-abort.js", + "test-process-argv-0.js", "test-process-beforeexit.js", "test-process-binding-internalbinding-allowlist.js", + "test-process-binding.js", + "test-process-dlopen-undefined-exports.js", + "test-process-domain-segfault.js", + "test-process-emitwarning.js", "test-process-env-allowed-flags.js", + "test-process-env-delete.js", + "test-process-env-windows-error-reset.js", "test-process-exit-from-before-exit.js", "test-process-exit-handler.js", "test-process-exit-recursive.js", "test-process-exit.js", + "test-process-getgroups.js", + "test-process-hrtime-bigint.js", "test-process-kill-pid.js", + "test-process-next-tick.js", + "test-process-no-deprecation.js", + "test-process-ppid.js", + "test-process-really-exit.js", "test-process-uptime.js", + "test-process-warning.js", + "test-promise-handled-rejection-no-warning.js", "test-promise-unhandled-silent.js", "test-promise-unhandled-throw-handler.js", "test-punycode.js", @@ -484,6 +877,14 @@ "test-querystring-maxKeys-non-finite.js", "test-querystring-multichar-separator.js", "test-querystring.js", + "test-readable-from-iterator-closing.js", + "test-readable-from.js", + "test-readable-large-hwm.js", + "test-readable-single-end.js", + "test-readline-async-iterators-destroy.js", + "test-readline-async-iterators.js", + "test-readline-carriage-return-between-chunks.js", + "test-readline-csi.js", "test-readline-emit-keypress-events.js", "test-readline-interface-escapecodetimeout.js", "test-readline-keys.js", @@ -492,7 +893,31 @@ "test-readline-set-raw-mode.js", "test-readline-undefined-columns.js", "test-readline.js", + "test-ref-unref-return.js", + "test-regression-object-prototype.js", + "test-require-invalid-package.js", + "test-require-long-path.js", + "test-require-nul.js", + "test-require-process.js", + "test-signal-handler-remove-on-exit.js", + "test-signal-handler.js", + "test-socket-address.js", + "test-socket-write-after-fin-error.js", + "test-source-map-enable.js", + "test-spawn-cmd-named-pipe.js", "test-stdin-from-file-spawn.js", + "test-stdin-hang.js", + "test-stdin-pipe-large.js", + "test-stdin-pipe-resume.js", + "test-stdin-script-child-option.js", + "test-stdio-pipe-access.js", + "test-stdio-pipe-redirect.js", + "test-stdio-pipe-stderr.js", + "test-stdio-undestroy.js", + "test-stdout-cannot-be-closed-child-process-pipe.js", + "test-stdout-pipeline-destroy.js", + "test-stdout-stderr-reading.js", + "test-stdout-stderr-write.js", "test-stream-add-abort-signal.js", "test-stream-aliases-legacy.js", "test-stream-auto-destroy.js", @@ -500,22 +925,30 @@ "test-stream-backpressure.js", "test-stream-big-packet.js", "test-stream-big-push.js", + "test-stream-catch-rejections.js", "test-stream-construct.js", + "test-stream-decoder-objectmode.js", "test-stream-destroy-event-order.js", "test-stream-duplex-destroy.js", "test-stream-duplex-end.js", "test-stream-duplex-from.js", "test-stream-duplex-props.js", "test-stream-duplex-readable-end.js", + "test-stream-duplex-readable-writable.js", "test-stream-duplex-writable-finished.js", "test-stream-duplex.js", + "test-stream-end-of-streams.js", "test-stream-end-paused.js", "test-stream-error-once.js", "test-stream-events-prepend.js", + "test-stream-filter.js", + "test-stream-flatMap.js", + "test-stream-forEach.js", "test-stream-inheritance.js", "test-stream-ispaused.js", "test-stream-objectmode-undefined.js", "test-stream-once-readable-pipe.js", + "test-stream-passthrough-drain.js", "test-stream-pipe-after-end.js", "test-stream-pipe-await-drain-manual-resume.js", "test-stream-pipe-await-drain-push-while-write.js", @@ -523,6 +956,7 @@ "test-stream-pipe-cleanup-pause.js", "test-stream-pipe-cleanup.js", "test-stream-pipe-error-handling.js", + "test-stream-pipe-error-unhandled.js", "test-stream-pipe-event.js", "test-stream-pipe-flow-after-unpipe.js", "test-stream-pipe-flow.js", @@ -533,8 +967,12 @@ "test-stream-pipe-unpipe-streams.js", "test-stream-pipe-without-listenerCount.js", "test-stream-pipeline-async-iterator.js", + "test-stream-pipeline-duplex.js", + "test-stream-pipeline-listeners.js", "test-stream-pipeline-queued-end-in-destroy.js", + "test-stream-pipeline-uncaught.js", "test-stream-pipeline-with-empty-string.js", + "test-stream-push-order.js", "test-stream-push-strings.js", "test-stream-readable-aborted.js", "test-stream-readable-add-chunk-during-data.js", @@ -566,15 +1004,21 @@ "test-stream-readable-resumeScheduled.js", "test-stream-readable-setEncoding-existing-buffers.js", "test-stream-readable-setEncoding-null.js", + "test-stream-readable-strategy-option.js", + "test-stream-readable-unpipe-resume.js", "test-stream-readable-unshift.js", "test-stream-readable-with-unimplemented-_read.js", "test-stream-readableListening-state.js", + "test-stream-reduce.js", + "test-stream-toArray.js", + "test-stream-toWeb-allows-server-response.js", "test-stream-transform-callback-twice.js", "test-stream-transform-constructor-set-methods.js", "test-stream-transform-destroy.js", "test-stream-transform-final-sync.js", "test-stream-transform-final.js", "test-stream-transform-flush-data.js", + "test-stream-transform-hwm0.js", "test-stream-transform-objectmode-falsey-value.js", "test-stream-transform-split-highwatermark.js", "test-stream-transform-split-objectmode.js", @@ -589,6 +1033,7 @@ "test-stream-writable-decoded-encoding.js", "test-stream-writable-destroy.js", "test-stream-writable-end-cb-error.js", + "test-stream-writable-end-cb-uncaught.js", "test-stream-writable-end-multiple.js", "test-stream-writable-ended-state.js", "test-stream-writable-final-async.js", @@ -616,6 +1061,7 @@ "test-stream2-basic.js", "test-stream2-compatibility.js", "test-stream2-decode-partial.js", + "test-stream2-finish-pipe-error.js", "test-stream2-finish-pipe.js", "test-stream2-large-read-stall.js", "test-stream2-objects.js", @@ -638,24 +1084,60 @@ "test-stream3-cork-end.js", "test-stream3-cork-uncork.js", "test-stream3-pause-then-read.js", + "test-stream3-pipeline-async-iterator.js", "test-streams-highwatermark.js", "test-string-decoder.js", + "test-stringbytes-external.js", + "test-sync-fileread.js", + "test-sys.js", + "test-tick-processor-arguments.js", "test-timers-api-refs.js", "test-timers-args.js", "test-timers-clear-null-does-not-throw-error.js", "test-timers-clear-object-does-not-throw-error.js", "test-timers-clear-timeout-interval-equivalent.js", + "test-timers-clearImmediate-als.js", "test-timers-clearImmediate.js", + "test-timers-immediate-queue.js", + "test-timers-immediate.js", "test-timers-interval-throw.js", "test-timers-non-integer-delay.js", + "test-timers-refresh-in-callback.js", "test-timers-refresh.js", "test-timers-same-timeout-wrong-list-deleted.js", + "test-timers-setimmediate-infinite-loop.js", + "test-timers-socket-timeout-removes-other-socket-unref-timer.js", "test-timers-timeout-with-non-integer.js", "test-timers-uncaught-exception.js", "test-timers-unref-throw-then-ref.js", + "test-timers-unref.js", + "test-timers-unrefd-interval-still-fires.js", + "test-timers-unrefed-in-beforeexit.js", + "test-timers-unrefed-in-callback.js", "test-timers-user-call.js", "test-timers-zero-timeout.js", + "test-timers.js", + "test-tls-alert-handling.js", + "test-tls-alert.js", + "test-tls-client-renegotiation-limit.js", + "test-tls-dhe.js", + "test-tls-ecdh-auto.js", + "test-tls-ecdh-multiple.js", + "test-tls-ecdh.js", + "test-tls-enable-trace-cli.js", + "test-tls-enable-trace.js", + "test-tls-env-extra-ca-no-crypto.js", + "test-tls-ocsp-callback.js", + "test-tls-psk-server.js", + "test-tls-securepair-server.js", + "test-tls-server-verify.js", + "test-tls-session-cache.js", + "test-tls-set-ciphers.js", + "test-tls-transport-destroy-after-own-gc.js", + "test-trace-events-async-hooks-dynamic.js", + "test-trace-events-async-hooks-worker.js", "test-tty-stdin-end.js", + "test-tz-version.js", "test-url-domain-ascii-unicode.js", "test-url-fileurltopath.js", "test-url-format-invalid-input.js", @@ -666,19 +1148,31 @@ "test-url-pathtofileurl.js", "test-url-relative.js", "test-url-urltooptions.js", + "test-utf8-scripts.js", "test-util-deprecate-invalid-code.js", "test-util-deprecate.js", "test-util-format.js", "test-util-inherits.js", + "test-util-inspect-getters-accessing-this.js", "test-util-inspect-long-running.js", "test-util-inspect-namespace.js", "test-util-inspect-proxy.js", "test-util-inspect.js", "test-util-isDeepStrictEqual.js", + "test-util-primordial-monkeypatching.js", "test-util-promisify.js", "test-util-types-exists.js", "test-util-types.js", "test-util.js", + "test-uv-binding-constant.js", + "test-uv-unmapped-exception.js", + "test-v8-coverage.js", + "test-v8-deserialize-buffer.js", + "test-v8-flag-pool-size-0.js", + "test-v8-global-setter.js", + "test-v8-stop-coverage.js", + "test-v8-take-coverage-noop.js", + "test-v8-take-coverage.js", "test-vm-access-process-env.js", "test-vm-attributes-property-not-on-sandbox.js", "test-vm-codegen.js", @@ -723,28 +1217,39 @@ "test-vm-timeout-escape-promise-2.js", "test-vm-timeout-escape-promise.js", "test-vm-timeout.js", + "test-weakref.js", + "test-webcrypto-encrypt-decrypt.js", "test-webcrypto-sign-verify.js", + "test-websocket.js", + "test-webstream-string-tag.js", "test-whatwg-encoding-custom-api-basics.js", "test-whatwg-encoding-custom-textdecoder-ignorebom.js", "test-whatwg-encoding-custom-textdecoder-streaming.js", "test-whatwg-events-add-event-listener-options-passive.js", "test-whatwg-events-add-event-listener-options-signal.js", "test-whatwg-events-customevent.js", + "test-whatwg-readablebytestreambyob.js", "test-whatwg-url-custom-deepequal.js", "test-whatwg-url-custom-global.js", "test-whatwg-url-custom-href-side-effect.js", "test-whatwg-url-custom-tostringtag.js", "test-whatwg-url-override-hostname.js", "test-whatwg-url-properties.js", + "test-worker-cleanexit-with-js.js", "test-worker-message-port-infinite-message-loop.js", "test-worker-message-port-multiple-sharedarraybuffers.js", "test-worker-message-port-receive-message.js", + "test-worker-on-process-exit.js", + "test-worker-ref-onexit.js", + "test-worker-terminate-unrefed.js", "test-zlib-close-after-error.js", "test-zlib-close-after-write.js", "test-zlib-convenience-methods.js", + "test-zlib-create-raw.js", "test-zlib-deflate-raw-inherits.js", "test-zlib-destroy-pipe.js", "test-zlib-empty-buffer.js", + "test-zlib-flush-write-sync-interleaved.js", "test-zlib-from-string.js", "test-zlib-invalid-input.js", "test-zlib-no-stream.js", @@ -762,14 +1267,41 @@ "console-dumb-tty.js", "no_dropped_stdio.js", "no_interleaved_stdio.js", + "test-set-raw-mode-reset-process-exit.js", + "test-set-raw-mode-reset.js", "test-tty-color-support-warning-2.js", "test-tty-color-support-warning.js", + "test-tty-stdin-call-end.js", "test-tty-stdin-end.js", "test-tty-stdout-end.js" ], - "pummel": [], + "pummel": [ + "test-crypto-dh-hash.js", + "test-crypto-timing-safe-equal-benchmarks.js", + "test-dh-regr.js", + "test-fs-largefile.js", + "test-fs-readfile-tostring-fail.js", + "test-fs-watch-system-limit.js", + "test-heapsnapshot-near-heap-limit-big.js", + "test-net-many-clients.js", + "test-net-pingpong-delay.js", + "test-process-cpuUsage.js", + "test-stream-pipe-multi.js" + ], "sequential": [ - "test-child-process-exit.js" + "test-buffer-creation-regression.js", + "test-child-process-exit.js", + "test-http-server-keep-alive-timeout-slow-server.js", + "test-net-better-error-messages-port.js", + "test-net-connect-handle-econnrefused.js", + "test-net-connect-local-error.js", + "test-net-reconnect-error.js", + "test-net-response-size.js", + "test-net-server-bind.js", + "test-tls-lookup.js", + "test-tls-psk-client.js", + "test-tls-securepair-client.js", + "test-tls-session-timeout.js" ] }, "windowsIgnore": { diff --git a/tests/node_compat/runner/TODO.md b/tests/node_compat/runner/TODO.md index 116226d8a0..f6393a5e1f 100644 --- a/tests/node_compat/runner/TODO.md +++ b/tests/node_compat/runner/TODO.md @@ -1,7 +1,7 @@ # Remaining Node Tests -595 tests out of 3681 have been ported from Node 20.11.1 (16.16% ported, 83.94% remaining). +1120 tests out of 3681 have been ported from Node 20.11.1 (30.43% ported, 69.68% remaining). NOTE: This file should not be manually edited. Please edit `tests/node_compat/config.json` and run `deno task setup` in `tests/node_compat/runner` dir instead. @@ -9,7 +9,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [abort/test-abort-fatal-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-abort-fatal-error.js) - [abort/test-abort-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-abort-uncaught-exception.js) - [abort/test-addon-register-signal-handler.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-addon-register-signal-handler.js) -- [abort/test-addon-uv-handle-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-addon-uv-handle-leak.js) - [abort/test-http-parser-consume.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-http-parser-consume.js) - [abort/test-process-abort-exitcode.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-process-abort-exitcode.js) - [abort/test-signal-handler.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-signal-handler.js) @@ -17,7 +16,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [abort/test-zlib-invalid-internals-usage.js](https://github.com/nodejs/node/tree/v20.11.1/test/abort/test-zlib-invalid-internals-usage.js) - [benchmark/test-bechmark-readline.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-bechmark-readline.js) - [benchmark/test-benchmark-assert.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-assert.js) -- [benchmark/test-benchmark-async-hooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-async-hooks.js) - [benchmark/test-benchmark-blob.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-blob.js) - [benchmark/test-benchmark-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-buffer.js) - [benchmark/test-benchmark-child-process.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-child-process.js) @@ -30,8 +28,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [benchmark/test-benchmark-esm.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-esm.js) - [benchmark/test-benchmark-events.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-events.js) - [benchmark/test-benchmark-fs.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-fs.js) -- [benchmark/test-benchmark-http.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-http.js) -- [benchmark/test-benchmark-http2.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-http2.js) - [benchmark/test-benchmark-mime.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-mime.js) - [benchmark/test-benchmark-misc.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-misc.js) - [benchmark/test-benchmark-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-module.js) @@ -45,19 +41,16 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [benchmark/test-benchmark-streams.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-streams.js) - [benchmark/test-benchmark-string_decoder.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-string_decoder.js) - [benchmark/test-benchmark-timers.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-timers.js) -- [benchmark/test-benchmark-tls.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-tls.js) - [benchmark/test-benchmark-url.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-url.js) - [benchmark/test-benchmark-util.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-util.js) - [benchmark/test-benchmark-v8.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-v8.js) - [benchmark/test-benchmark-validators.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-validators.js) - [benchmark/test-benchmark-vm.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-vm.js) - [benchmark/test-benchmark-webstreams.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-webstreams.js) -- [benchmark/test-benchmark-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-worker.js) - [benchmark/test-benchmark-zlib.js](https://github.com/nodejs/node/tree/v20.11.1/test/benchmark/test-benchmark-zlib.js) - [es-module/test-cjs-esm-warn.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-cjs-esm-warn.js) - [es-module/test-cjs-legacyMainResolve-permission.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-cjs-legacyMainResolve-permission.js) - [es-module/test-cjs-legacyMainResolve.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-cjs-legacyMainResolve.js) -- [es-module/test-cjs-prototype-pollution.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-cjs-prototype-pollution.js) - [es-module/test-dynamic-import-script-lifetime.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-dynamic-import-script-lifetime.js) - [es-module/test-esm-assertionless-json-import.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-assertionless-json-import.js) - [es-module/test-esm-cjs-builtins.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-cjs-builtins.js) @@ -66,7 +59,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [es-module/test-esm-data-urls.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-data-urls.js) - [es-module/test-esm-dynamic-import-attribute.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-dynamic-import-attribute.js) - [es-module/test-esm-dynamic-import-commonjs.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-dynamic-import-commonjs.js) -- [es-module/test-esm-dynamic-import-mutating-fs.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-dynamic-import-mutating-fs.js) - [es-module/test-esm-dynamic-import.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-dynamic-import.js) - [es-module/test-esm-encoded-path-native.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-encoded-path-native.js) - [es-module/test-esm-error-cache.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-error-cache.js) @@ -74,7 +66,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [es-module/test-esm-import-attributes-validation.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-import-attributes-validation.js) - [es-module/test-esm-invalid-data-urls.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-invalid-data-urls.js) - [es-module/test-esm-invalid-pjson.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-invalid-pjson.js) -- [es-module/test-esm-loader-cache-clearing.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-loader-cache-clearing.js) - [es-module/test-esm-loader-modulemap.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-loader-modulemap.js) - [es-module/test-esm-loader-search.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-loader-search.js) - [es-module/test-esm-named-exports.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-named-exports.js) @@ -89,10 +80,8 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [es-module/test-esm-undefined-cjs-global-like-variables.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-undefined-cjs-global-like-variables.js) - [es-module/test-esm-unknown-extension.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-unknown-extension.js) - [es-module/test-esm-url-extname.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-url-extname.js) -- [es-module/test-esm-windows.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-esm-windows.js) - [es-module/test-loaders-hidden-from-users.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-loaders-hidden-from-users.js) - [es-module/test-vm-compile-function-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-vm-compile-function-leak.js) -- [es-module/test-vm-compile-function-lineoffset.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-vm-compile-function-lineoffset.js) - [es-module/test-vm-contextified-script-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-vm-contextified-script-leak.js) - [es-module/test-vm-source-text-module-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-vm-source-text-module-leak.js) - [es-module/test-vm-synthetic-module-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/es-module/test-vm-synthetic-module-leak.js) @@ -147,19 +136,14 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [known_issues/test-vm-timeout-escape-nexttick.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-vm-timeout-escape-nexttick.js) - [known_issues/test-vm-timeout-escape-queuemicrotask.js](https://github.com/nodejs/node/tree/v20.11.1/test/known_issues/test-vm-timeout-escape-queuemicrotask.js) - [message/assert_throws_stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/assert_throws_stack.js) -- [message/eval_messages.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/eval_messages.js) - [message/internal_assert.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/internal_assert.js) - [message/internal_assert_fail.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/internal_assert_fail.js) -- [message/max_tick_depth.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/max_tick_depth.js) - [message/nexttick_throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/nexttick_throw.js) -- [message/stdin_messages.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/stdin_messages.js) - [message/util-inspect-error-cause.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/util-inspect-error-cause.js) -- [message/util_inspect_error.js](https://github.com/nodejs/node/tree/v20.11.1/test/message/util_inspect_error.js) - [parallel/test-abortcontroller.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-abortcontroller.js) - [parallel/test-aborted-util.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-aborted-util.js) - [parallel/test-abortsignal-cloneable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-abortsignal-cloneable.js) - [parallel/test-accessor-properties.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-accessor-properties.js) -- [parallel/test-arm-math-illegal-instruction.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-arm-math-illegal-instruction.js) - [parallel/test-assert-builtins-not-read-from-filesystem.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-assert-builtins-not-read-from-filesystem.js) - [parallel/test-assert-calltracker-calls.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-assert-calltracker-calls.js) - [parallel/test-assert-calltracker-getCalls.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-assert-calltracker-getCalls.js) @@ -196,20 +180,13 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-async-hooks-promise-triggerid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-promise-triggerid.js) - [parallel/test-async-hooks-promise.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-promise.js) - [parallel/test-async-hooks-recursive-stack-runInAsyncScope.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-recursive-stack-runInAsyncScope.js) -- [parallel/test-async-hooks-run-in-async-scope-caught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-run-in-async-scope-caught-exception.js) -- [parallel/test-async-hooks-run-in-async-scope-this-arg.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-run-in-async-scope-this-arg.js) - [parallel/test-async-hooks-top-level-clearimmediate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-top-level-clearimmediate.js) - [parallel/test-async-hooks-vm-gc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-vm-gc.js) - [parallel/test-async-hooks-worker-asyncfn-terminate-1.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-worker-asyncfn-terminate-1.js) - [parallel/test-async-hooks-worker-asyncfn-terminate-2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-worker-asyncfn-terminate-2.js) - [parallel/test-async-hooks-worker-asyncfn-terminate-3.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-worker-asyncfn-terminate-3.js) - [parallel/test-async-hooks-worker-asyncfn-terminate-4.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-hooks-worker-asyncfn-terminate-4.js) -- [parallel/test-async-local-storage-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-local-storage-bind.js) -- [parallel/test-async-local-storage-contexts.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-local-storage-contexts.js) -- [parallel/test-async-local-storage-deep-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-local-storage-deep-stack.js) - [parallel/test-async-local-storage-exit-does-not-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-local-storage-exit-does-not-leak.js) -- [parallel/test-async-local-storage-http-multiclients.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-local-storage-http-multiclients.js) -- [parallel/test-async-local-storage-snapshot.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-local-storage-snapshot.js) - [parallel/test-async-wrap-constructor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-wrap-constructor.js) - [parallel/test-async-wrap-destroyid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-wrap-destroyid.js) - [parallel/test-async-wrap-pop-id-during-load.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-wrap-pop-id-during-load.js) @@ -218,12 +195,9 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-async-wrap-trigger-id.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-wrap-trigger-id.js) - [parallel/test-async-wrap-uncaughtexception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-async-wrap-uncaughtexception.js) - [parallel/test-asyncresource-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-asyncresource-bind.js) -- [parallel/test-atomics-wake.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-atomics-wake.js) - [parallel/test-bash-completion.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-bash-completion.js) -- [parallel/test-beforeexit-event-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-beforeexit-event-exit.js) - [parallel/test-benchmark-cli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-benchmark-cli.js) - [parallel/test-binding-constants.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-binding-constants.js) -- [parallel/test-blob-buffer-too-large.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-blob-buffer-too-large.js) - [parallel/test-blob-createobjecturl.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-blob-createobjecturl.js) - [parallel/test-blob-file-backed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-blob-file-backed.js) - [parallel/test-blob.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-blob.js) @@ -241,8 +215,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-buffer-pool-untransferable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-pool-untransferable.js) - [parallel/test-buffer-prototype-inspect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-prototype-inspect.js) - [parallel/test-buffer-set-inspect-max-bytes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-set-inspect-max-bytes.js) -- [parallel/test-buffer-sharedarraybuffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-sharedarraybuffer.js) -- [parallel/test-buffer-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-buffer-write.js) - [parallel/test-c-ares.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-c-ares.js) - [parallel/test-child-process-advanced-serialization-largebuffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-advanced-serialization-largebuffer.js) - [parallel/test-child-process-advanced-serialization.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-advanced-serialization.js) @@ -283,7 +255,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-child-process-fork-stdio.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-stdio.js) - [parallel/test-child-process-fork-timeout-kill-signal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-timeout-kill-signal.js) - [parallel/test-child-process-fork.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork.js) -- [parallel/test-child-process-fork3.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork3.js) - [parallel/test-child-process-http-socket-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-http-socket-leak.js) - [parallel/test-child-process-internal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-internal.js) - [parallel/test-child-process-ipc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-ipc.js) @@ -296,7 +267,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-child-process-send-cb.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-send-cb.js) - [parallel/test-child-process-send-keep-open.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-send-keep-open.js) - [parallel/test-child-process-send-returns-boolean.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-send-returns-boolean.js) -- [parallel/test-child-process-send-type-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-send-type-error.js) - [parallel/test-child-process-send-utf8.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-send-utf8.js) - [parallel/test-child-process-server-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-server-close.js) - [parallel/test-child-process-silent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-silent.js) @@ -311,12 +281,10 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-child-process-spawnsync-kill-signal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawnsync-kill-signal.js) - [parallel/test-child-process-spawnsync-shell.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawnsync-shell.js) - [parallel/test-child-process-spawnsync-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawnsync-timeout.js) -- [parallel/test-child-process-stdin-ipc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdin-ipc.js) - [parallel/test-child-process-stdin.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdin.js) - [parallel/test-child-process-stdio-big-write-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio-big-write-end.js) - [parallel/test-child-process-stdio-inherit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio-inherit.js) - [parallel/test-child-process-stdio-merge-stdouts-into-cat.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio-merge-stdouts-into-cat.js) -- [parallel/test-child-process-stdio-overlapped.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio-overlapped.js) - [parallel/test-child-process-stdio-reuse-readable-stdio.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio-reuse-readable-stdio.js) - [parallel/test-child-process-stdio.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio.js) - [parallel/test-child-process-stdout-flush-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdout-flush-exit.js) @@ -338,7 +306,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-cli-syntax-eval.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cli-syntax-eval.js) - [parallel/test-cli-syntax-piped-bad.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cli-syntax-piped-bad.js) - [parallel/test-cli-syntax-piped-good.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cli-syntax-piped-good.js) -- [parallel/test-client-request-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-client-request-destroy.js) - [parallel/test-cluster-accept-fail.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-accept-fail.js) - [parallel/test-cluster-advanced-serialization.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-advanced-serialization.js) - [parallel/test-cluster-basic.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-basic.js) @@ -403,7 +370,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-cluster-shared-handle-bind-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-shared-handle-bind-error.js) - [parallel/test-cluster-shared-handle-bind-privileged-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-shared-handle-bind-privileged-port.js) - [parallel/test-cluster-shared-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-shared-leak.js) -- [parallel/test-cluster-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-uncaught-exception.js) - [parallel/test-cluster-worker-constructor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-constructor.js) - [parallel/test-cluster-worker-death.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-death.js) - [parallel/test-cluster-worker-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-cluster-worker-destroy.js) @@ -426,15 +392,11 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-common-gc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-common-gc.js) - [parallel/test-common-must-not-call.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-common-must-not-call.js) - [parallel/test-common.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-common.js) -- [parallel/test-console-assign-undefined.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-assign-undefined.js) - [parallel/test-console-clear.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-clear.js) - [parallel/test-console-count.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-count.js) -- [parallel/test-console-formatTime.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-formatTime.js) - [parallel/test-console-instance.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-instance.js) - [parallel/test-console-issue-43095.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-issue-43095.js) - [parallel/test-console-methods.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-methods.js) -- [parallel/test-console-not-call-toString.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-not-call-toString.js) -- [parallel/test-console-self-assign.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-self-assign.js) - [parallel/test-console-stdio-setters.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-stdio-setters.js) - [parallel/test-console.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console.js) - [parallel/test-constants.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-constants.js) @@ -451,22 +413,18 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-crypto-des3-wrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-des3-wrap.js) - [parallel/test-crypto-dh-constructor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-constructor.js) - [parallel/test-crypto-dh-curves.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-curves.js) -- [parallel/test-crypto-dh-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-errors.js) - [parallel/test-crypto-dh-generate-keys.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-generate-keys.js) - [parallel/test-crypto-dh-group-setters.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-group-setters.js) - [parallel/test-crypto-dh-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-leak.js) - [parallel/test-crypto-dh-modp2-views.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-modp2-views.js) - [parallel/test-crypto-dh-modp2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-modp2.js) -- [parallel/test-crypto-dh-odd-key.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-odd-key.js) - [parallel/test-crypto-dh-padding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-padding.js) - [parallel/test-crypto-dh-stateless.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-dh-stateless.js) -- [parallel/test-crypto-domain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-domain.js) - [parallel/test-crypto-domains.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-domains.js) - [parallel/test-crypto-ecb.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-ecb.js) - [parallel/test-crypto-ecdh-convert-key.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-ecdh-convert-key.js) - [parallel/test-crypto-encoding-validation-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-encoding-validation-error.js) - [parallel/test-crypto-fips.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-fips.js) -- [parallel/test-crypto-from-binary.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-from-binary.js) - [parallel/test-crypto-getcipherinfo.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-getcipherinfo.js) - [parallel/test-crypto-hash-stream-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-hash-stream-pipe.js) - [parallel/test-crypto-key-objects-messageport.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-key-objects-messageport.js) @@ -487,41 +445,24 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-crypto-keygen-async-rsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-async-rsa.js) - [parallel/test-crypto-keygen-bit-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-bit-length.js) - [parallel/test-crypto-keygen-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-deprecation.js) -- [parallel/test-crypto-keygen-dh-classic.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-dh-classic.js) -- [parallel/test-crypto-keygen-duplicate-deprecated-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-duplicate-deprecated-option.js) - [parallel/test-crypto-keygen-eddsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-eddsa.js) -- [parallel/test-crypto-keygen-empty-passphrase-no-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-empty-passphrase-no-error.js) - [parallel/test-crypto-keygen-empty-passphrase-no-prompt.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-empty-passphrase-no-prompt.js) - [parallel/test-crypto-keygen-invalid-parameter-encoding-dsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-invalid-parameter-encoding-dsa.js) - [parallel/test-crypto-keygen-invalid-parameter-encoding-ec.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-invalid-parameter-encoding-ec.js) - [parallel/test-crypto-keygen-key-object-without-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-key-object-without-encoding.js) -- [parallel/test-crypto-keygen-key-objects.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-key-objects.js) -- [parallel/test-crypto-keygen-missing-oid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-missing-oid.js) - [parallel/test-crypto-keygen-no-rsassa-pss-params.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-no-rsassa-pss-params.js) -- [parallel/test-crypto-keygen-non-standard-public-exponent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-non-standard-public-exponent.js) - [parallel/test-crypto-keygen-promisify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-promisify.js) -- [parallel/test-crypto-keygen-rfc8017-9-1.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-rfc8017-9-1.js) -- [parallel/test-crypto-keygen-rfc8017-a-2-3.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-rfc8017-a-2-3.js) - [parallel/test-crypto-keygen-rsa-pss.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-rsa-pss.js) - [parallel/test-crypto-keygen-sync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen-sync.js) - [parallel/test-crypto-keygen.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-keygen.js) -- [parallel/test-crypto-lazy-transform-writable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-lazy-transform-writable.js) -- [parallel/test-crypto-no-algorithm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-no-algorithm.js) -- [parallel/test-crypto-op-during-process-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-op-during-process-exit.js) -- [parallel/test-crypto-padding-aes256.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-padding-aes256.js) - [parallel/test-crypto-padding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-padding.js) - [parallel/test-crypto-private-decrypt-gh32240.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-private-decrypt-gh32240.js) -- [parallel/test-crypto-psychic-signatures.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-psychic-signatures.js) -- [parallel/test-crypto-publicDecrypt-fails-first-time.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-publicDecrypt-fails-first-time.js) - [parallel/test-crypto-random.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-random.js) -- [parallel/test-crypto-randomfillsync-regression.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-randomfillsync-regression.js) - [parallel/test-crypto-randomuuid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-randomuuid.js) - [parallel/test-crypto-rsa-dsa-revert.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-rsa-dsa-revert.js) - [parallel/test-crypto-rsa-dsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-rsa-dsa.js) -- [parallel/test-crypto-scrypt.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-scrypt.js) - [parallel/test-crypto-secure-heap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-secure-heap.js) - [parallel/test-crypto-sign-verify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-sign-verify.js) -- [parallel/test-crypto-subtle-zero-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-subtle-zero-length.js) - [parallel/test-crypto-verify-failure.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-verify-failure.js) - [parallel/test-crypto-webcrypto-aes-decrypt-tag-too-small.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-webcrypto-aes-decrypt-tag-too-small.js) - [parallel/test-crypto-worker-thread.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-crypto-worker-thread.js) @@ -557,84 +498,34 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-debugger-websocket-secret-mismatch.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-debugger-websocket-secret-mismatch.js) - [parallel/test-delayed-require.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-delayed-require.js) - [parallel/test-dgram-abort-closed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-abort-closed.js) -- [parallel/test-dgram-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-address.js) -- [parallel/test-dgram-bind-default-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-bind-default-address.js) -- [parallel/test-dgram-bind-error-repeat.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-bind-error-repeat.js) - [parallel/test-dgram-bind-fd-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-bind-fd-error.js) - [parallel/test-dgram-bind-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-bind-fd.js) -- [parallel/test-dgram-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-bind.js) -- [parallel/test-dgram-bytes-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-bytes-length.js) -- [parallel/test-dgram-close-in-listening.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-close-in-listening.js) -- [parallel/test-dgram-close-is-not-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-close-is-not-callback.js) -- [parallel/test-dgram-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-close.js) - [parallel/test-dgram-cluster-bind-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-cluster-bind-error.js) - [parallel/test-dgram-cluster-close-during-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-cluster-close-during-bind.js) - [parallel/test-dgram-cluster-close-in-listening.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-cluster-close-in-listening.js) -- [parallel/test-dgram-connect-send-callback-buffer-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-callback-buffer-length.js) -- [parallel/test-dgram-connect-send-callback-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-callback-buffer.js) -- [parallel/test-dgram-connect-send-callback-multi-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-callback-multi-buffer.js) -- [parallel/test-dgram-connect-send-default-host.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-default-host.js) -- [parallel/test-dgram-connect-send-empty-array.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-empty-array.js) -- [parallel/test-dgram-connect-send-empty-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-empty-buffer.js) -- [parallel/test-dgram-connect-send-empty-packet.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-empty-packet.js) -- [parallel/test-dgram-connect-send-multi-buffer-copy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-multi-buffer-copy.js) -- [parallel/test-dgram-connect-send-multi-string-array.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-multi-string-array.js) -- [parallel/test-dgram-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect.js) - [parallel/test-dgram-create-socket-handle-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-create-socket-handle-fd.js) - [parallel/test-dgram-create-socket-handle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-create-socket-handle.js) -- [parallel/test-dgram-createSocket-type.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-createSocket-type.js) - [parallel/test-dgram-custom-lookup.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-custom-lookup.js) - [parallel/test-dgram-deprecation-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-deprecation-error.js) -- [parallel/test-dgram-error-message-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-error-message-address.js) - [parallel/test-dgram-exclusive-implicit-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-exclusive-implicit-bind.js) -- [parallel/test-dgram-implicit-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-implicit-bind.js) - [parallel/test-dgram-ipv6only.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-ipv6only.js) -- [parallel/test-dgram-listen-after-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-listen-after-bind.js) - [parallel/test-dgram-membership.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-membership.js) -- [parallel/test-dgram-msgsize.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-msgsize.js) - [parallel/test-dgram-multicast-loopback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-multicast-loopback.js) - [parallel/test-dgram-multicast-set-interface.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-multicast-set-interface.js) - [parallel/test-dgram-multicast-setTTL.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-multicast-setTTL.js) -- [parallel/test-dgram-oob-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-oob-buffer.js) -- [parallel/test-dgram-recv-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-recv-error.js) -- [parallel/test-dgram-ref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-ref.js) - [parallel/test-dgram-send-address-types.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-address-types.js) -- [parallel/test-dgram-send-bad-arguments.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-bad-arguments.js) -- [parallel/test-dgram-send-callback-buffer-empty-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-callback-buffer-empty-address.js) -- [parallel/test-dgram-send-callback-buffer-length-empty-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-callback-buffer-length-empty-address.js) -- [parallel/test-dgram-send-callback-buffer-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-callback-buffer-length.js) -- [parallel/test-dgram-send-callback-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-callback-buffer.js) -- [parallel/test-dgram-send-callback-multi-buffer-empty-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-callback-multi-buffer-empty-address.js) -- [parallel/test-dgram-send-callback-multi-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-callback-multi-buffer.js) -- [parallel/test-dgram-send-callback-recursive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-callback-recursive.js) - [parallel/test-dgram-send-cb-quelches-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-cb-quelches-error.js) -- [parallel/test-dgram-send-default-host.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-default-host.js) -- [parallel/test-dgram-send-empty-array.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-empty-array.js) -- [parallel/test-dgram-send-empty-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-empty-buffer.js) -- [parallel/test-dgram-send-empty-packet.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-empty-packet.js) -- [parallel/test-dgram-send-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-error.js) -- [parallel/test-dgram-send-invalid-msg-type.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-invalid-msg-type.js) -- [parallel/test-dgram-send-multi-buffer-copy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-multi-buffer-copy.js) -- [parallel/test-dgram-send-multi-string-array.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-multi-string-array.js) - [parallel/test-dgram-send-queue-info.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-queue-info.js) - [parallel/test-dgram-sendto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-sendto.js) - [parallel/test-dgram-setBroadcast.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-setBroadcast.js) - [parallel/test-dgram-setTTL.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-setTTL.js) - [parallel/test-dgram-socket-buffer-size.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-socket-buffer-size.js) -- [parallel/test-dgram-udp4.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-udp4.js) - [parallel/test-dgram-udp6-link-local-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-udp6-link-local-address.js) -- [parallel/test-dgram-udp6-send-default-host.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-udp6-send-default-host.js) - [parallel/test-dgram-unref-in-cluster.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-unref-in-cluster.js) -- [parallel/test-dgram-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-unref.js) -- [parallel/test-diagnostics-channel-bind-store.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-bind-store.js) - [parallel/test-diagnostics-channel-http-server-start.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-http-server-start.js) - [parallel/test-diagnostics-channel-http.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-http.js) - [parallel/test-diagnostics-channel-memory-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-memory-leak.js) - [parallel/test-diagnostics-channel-process.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-process.js) -- [parallel/test-diagnostics-channel-safe-subscriber-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-safe-subscriber-errors.js) -- [parallel/test-diagnostics-channel-tracing-channel-async-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-tracing-channel-async-error.js) -- [parallel/test-diagnostics-channel-tracing-channel-async.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-tracing-channel-async.js) -- [parallel/test-diagnostics-channel-tracing-channel-run-stores.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-tracing-channel-run-stores.js) - [parallel/test-diagnostics-channel-worker-threads.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-worker-threads.js) - [parallel/test-directory-import.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-directory-import.js) - [parallel/test-disable-proto-delete.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-disable-proto-delete.js) @@ -650,7 +541,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-dns-lookup-promises.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-lookup-promises.js) - [parallel/test-dns-lookupService-promises.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-lookupService-promises.js) - [parallel/test-dns-lookupService.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-lookupService.js) -- [parallel/test-dns-multi-channel.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-multi-channel.js) - [parallel/test-dns-perf_hooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-perf_hooks.js) - [parallel/test-dns-resolve-promises.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-resolve-promises.js) - [parallel/test-dns-resolveany-bad-ancount.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-resolveany-bad-ancount.js) @@ -663,9 +553,7 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-domain-add-remove.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-add-remove.js) - [parallel/test-domain-async-id-map-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-async-id-map-leak.js) - [parallel/test-domain-bind-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-bind-timeout.js) -- [parallel/test-domain-crypto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-crypto.js) - [parallel/test-domain-dep0097.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-dep0097.js) -- [parallel/test-domain-ee-error-listener.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-ee-error-listener.js) - [parallel/test-domain-ee-implicit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-ee-implicit.js) - [parallel/test-domain-ee.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-ee.js) - [parallel/test-domain-emit-error-handler-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-emit-error-handler-stack.js) @@ -680,8 +568,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-domain-load-after-set-uncaught-exception-capture.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-load-after-set-uncaught-exception-capture.js) - [parallel/test-domain-multi.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-multi.js) - [parallel/test-domain-multiple-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-multiple-errors.js) -- [parallel/test-domain-nested-throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-nested-throw.js) -- [parallel/test-domain-nested.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-nested.js) - [parallel/test-domain-nexttick.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-nexttick.js) - [parallel/test-domain-no-error-handler-abort-on-uncaught-0.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-0.js) - [parallel/test-domain-no-error-handler-abort-on-uncaught-1.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-no-error-handler-abort-on-uncaught-1.js) @@ -698,13 +584,11 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-domain-safe-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-safe-exit.js) - [parallel/test-domain-set-uncaught-exception-capture-after-load.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-set-uncaught-exception-capture-after-load.js) - [parallel/test-domain-stack-empty-in-process-uncaughtexception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-stack-empty-in-process-uncaughtexception.js) -- [parallel/test-domain-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-stack.js) - [parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js) - [parallel/test-domain-thrown-error-handler-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-thrown-error-handler-stack.js) - [parallel/test-domain-timer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-timer.js) - [parallel/test-domain-timers-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-timers-uncaught-exception.js) - [parallel/test-domain-timers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-timers.js) -- [parallel/test-domain-top-level-error-handler-clears-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-top-level-error-handler-clears-stack.js) - [parallel/test-domain-top-level-error-handler-throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-top-level-error-handler-throw.js) - [parallel/test-domain-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-uncaught-exception.js) - [parallel/test-domain-vm-promise-isolation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-vm-promise-isolation.js) @@ -715,18 +599,13 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-dotenv.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dotenv.js) - [parallel/test-double-tls-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-double-tls-client.js) - [parallel/test-double-tls-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-double-tls-server.js) -- [parallel/test-dsa-fips-invalid-key.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dsa-fips-invalid-key.js) - [parallel/test-dummy-stdio.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dummy-stdio.js) - [parallel/test-emit-after-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-emit-after-uncaught-exception.js) -- [parallel/test-env-newprotomethod-remove-unnecessary-prototypes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-env-newprotomethod-remove-unnecessary-prototypes.js) - [parallel/test-env-var-no-warnings.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-env-var-no-warnings.js) - [parallel/test-err-name-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-err-name-deprecation.js) -- [parallel/test-error-aggregateTwoErrors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-error-aggregateTwoErrors.js) - [parallel/test-error-format-list.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-error-format-list.js) -- [parallel/test-error-prepare-stack-trace.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-error-prepare-stack-trace.js) - [parallel/test-error-reporting.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-error-reporting.js) - [parallel/test-error-serdes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-error-serdes.js) -- [parallel/test-errors-aborterror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-errors-aborterror.js) - [parallel/test-errors-systemerror-frozen-intrinsics.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-errors-systemerror-frozen-intrinsics.js) - [parallel/test-errors-systemerror-stackTraceLimit-custom-setter.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-errors-systemerror-stackTraceLimit-custom-setter.js) - [parallel/test-errors-systemerror-stackTraceLimit-deleted-and-Error-sealed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-errors-systemerror-stackTraceLimit-deleted-and-Error-sealed.js) @@ -757,11 +636,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-eslint-require-common-first.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-require-common-first.js) - [parallel/test-eslint-required-modules.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eslint-required-modules.js) - [parallel/test-eval-disallow-code-generation-from-strings.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eval-disallow-code-generation-from-strings.js) -- [parallel/test-event-capture-rejections.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-event-capture-rejections.js) -- [parallel/test-event-emitter-check-listener-leaks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-event-emitter-check-listener-leaks.js) -- [parallel/test-event-emitter-max-listeners-warning-for-null.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-event-emitter-max-listeners-warning-for-null.js) -- [parallel/test-event-emitter-max-listeners-warning-for-symbol.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-event-emitter-max-listeners-warning-for-symbol.js) -- [parallel/test-event-emitter-max-listeners-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-event-emitter-max-listeners-warning.js) - [parallel/test-event-target.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-event-target.js) - [parallel/test-eventemitter-asyncresource.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eventemitter-asyncresource.js) - [parallel/test-events-customevent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-events-customevent.js) @@ -769,7 +643,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-events-listener-count-with-listener.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-events-listener-count-with-listener.js) - [parallel/test-events-static-geteventlisteners.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-events-static-geteventlisteners.js) - [parallel/test-eventtarget-memoryleakwarning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eventtarget-memoryleakwarning.js) -- [parallel/test-eventtarget-once-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eventtarget-once-twice.js) - [parallel/test-eventtarget.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-eventtarget.js) - [parallel/test-experimental-shared-value-conveyor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-experimental-shared-value-conveyor.js) - [parallel/test-file-validate-mode-flag.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-file-validate-mode-flag.js) @@ -784,10 +657,7 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-fs-append-file-flush.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-append-file-flush.js) - [parallel/test-fs-assert-encoding-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-assert-encoding-error.js) - [parallel/test-fs-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-buffer.js) -- [parallel/test-fs-buffertype-writesync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-buffertype-writesync.js) - [parallel/test-fs-close-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-close-errors.js) -- [parallel/test-fs-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-close.js) -- [parallel/test-fs-constants.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-constants.js) - [parallel/test-fs-copyfile-respect-permissions.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-copyfile-respect-permissions.js) - [parallel/test-fs-error-messages.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-error-messages.js) - [parallel/test-fs-exists.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-exists.js) @@ -796,11 +666,9 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-fs-fchown.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-fchown.js) - [parallel/test-fs-filehandle-use-after-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-filehandle-use-after-close.js) - [parallel/test-fs-filehandle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-filehandle.js) -- [parallel/test-fs-fmap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-fmap.js) - [parallel/test-fs-fsync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-fsync.js) - [parallel/test-fs-lchmod.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-lchmod.js) - [parallel/test-fs-link.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-link.js) -- [parallel/test-fs-long-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-long-path.js) - [parallel/test-fs-make-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-make-callback.js) - [parallel/test-fs-makeStatsCallback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-makeStatsCallback.js) - [parallel/test-fs-mkdir-mode-mask.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-mkdir-mode-mask.js) @@ -808,10 +676,8 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-fs-mkdir-rmdir.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-mkdir-rmdir.js) - [parallel/test-fs-mkdtemp-prefix-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-mkdtemp-prefix-check.js) - [parallel/test-fs-mkdtemp.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-mkdtemp.js) -- [parallel/test-fs-non-number-arguments-throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-non-number-arguments-throw.js) - [parallel/test-fs-null-bytes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-null-bytes.js) - [parallel/test-fs-options-immutable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-options-immutable.js) -- [parallel/test-fs-promises-exists.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-exists.js) - [parallel/test-fs-promises-file-handle-aggregate-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-aggregate-errors.js) - [parallel/test-fs-promises-file-handle-append-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-append-file.js) - [parallel/test-fs-promises-file-handle-chmod.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-chmod.js) @@ -825,10 +691,7 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-fs-promises-file-handle-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-stream.js) - [parallel/test-fs-promises-file-handle-sync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-sync.js) - [parallel/test-fs-promises-file-handle-truncate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-truncate.js) -- [parallel/test-fs-promises-file-handle-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-write.js) - [parallel/test-fs-promises-file-handle-writeFile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-writeFile.js) -- [parallel/test-fs-promises-readfile-empty.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-readfile-empty.js) -- [parallel/test-fs-promises-readfile-with-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-readfile-with-fd.js) - [parallel/test-fs-promises-readfile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-readfile.js) - [parallel/test-fs-promises-watch.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-watch.js) - [parallel/test-fs-promises-write-optional-params.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-write-optional-params.js) @@ -838,15 +701,11 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-fs-promisified.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promisified.js) - [parallel/test-fs-read-empty-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-empty-buffer.js) - [parallel/test-fs-read-file-assert-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-file-assert-encoding.js) -- [parallel/test-fs-read-file-sync-hostname.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-file-sync-hostname.js) -- [parallel/test-fs-read-file-sync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-file-sync.js) - [parallel/test-fs-read-offset-null.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-offset-null.js) - [parallel/test-fs-read-optional-params.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-optional-params.js) - [parallel/test-fs-read-promises-optional-params.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-promises-optional-params.js) - [parallel/test-fs-read-stream-err.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-stream-err.js) -- [parallel/test-fs-read-stream-fd-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-stream-fd-leak.js) - [parallel/test-fs-read-stream-file-handle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-stream-file-handle.js) -- [parallel/test-fs-read-stream-pos.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-read-stream-pos.js) - [parallel/test-fs-readSync-optional-params.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readSync-optional-params.js) - [parallel/test-fs-readdir-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readdir-buffer.js) - [parallel/test-fs-readdir-types.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readdir-types.js) @@ -856,64 +715,42 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-fs-readfile-flags.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-flags.js) - [parallel/test-fs-readfile-pipe-large.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-pipe-large.js) - [parallel/test-fs-readfile-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-pipe.js) -- [parallel/test-fs-readfile-unlink.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-unlink.js) -- [parallel/test-fs-readfile-zero-byte-liar.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-zero-byte-liar.js) - [parallel/test-fs-readfile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile.js) -- [parallel/test-fs-readfilesync-enoent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfilesync-enoent.js) - [parallel/test-fs-readfilesync-pipe-large.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfilesync-pipe-large.js) - [parallel/test-fs-readlink-type-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readlink-type-check.js) - [parallel/test-fs-readv-promises.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readv-promises.js) - [parallel/test-fs-readv-promisify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readv-promisify.js) -- [parallel/test-fs-ready-event-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-ready-event-stream.js) - [parallel/test-fs-realpath-buffer-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-realpath-buffer-encoding.js) - [parallel/test-fs-realpath-on-substed-drive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-realpath-on-substed-drive.js) - [parallel/test-fs-realpath-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-realpath-pipe.js) - [parallel/test-fs-realpath.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-realpath.js) - [parallel/test-fs-rename-type-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-rename-type-check.js) - [parallel/test-fs-rm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-rm.js) -- [parallel/test-fs-sir-writes-alot.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-sir-writes-alot.js) - [parallel/test-fs-stat-bigint.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stat-bigint.js) - [parallel/test-fs-stat.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stat.js) - [parallel/test-fs-statfs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-statfs.js) -- [parallel/test-fs-stream-construct-compat-error-read.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stream-construct-compat-error-read.js) - [parallel/test-fs-stream-construct-compat-error-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stream-construct-compat-error-write.js) -- [parallel/test-fs-stream-construct-compat-graceful-fs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stream-construct-compat-graceful-fs.js) -- [parallel/test-fs-stream-construct-compat-old-node.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stream-construct-compat-old-node.js) -- [parallel/test-fs-stream-destroy-emit-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stream-destroy-emit-error.js) -- [parallel/test-fs-stream-double-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stream-double-close.js) -- [parallel/test-fs-stream-fs-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stream-fs-options.js) -- [parallel/test-fs-stream-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-stream-options.js) - [parallel/test-fs-symlink-buffer-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-symlink-buffer-path.js) -- [parallel/test-fs-symlink-dir-junction-relative.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-symlink-dir-junction-relative.js) - [parallel/test-fs-symlink-dir-junction.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-symlink-dir-junction.js) - [parallel/test-fs-symlink-dir.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-symlink-dir.js) - [parallel/test-fs-symlink-longpath.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-symlink-longpath.js) - [parallel/test-fs-symlink.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-symlink.js) - [parallel/test-fs-sync-fd-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-sync-fd-leak.js) - [parallel/test-fs-syncwritestream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-syncwritestream.js) -- [parallel/test-fs-timestamp-parsing-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-timestamp-parsing-error.js) -- [parallel/test-fs-truncate-clear-file-zero.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-truncate-clear-file-zero.js) - [parallel/test-fs-truncate-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-truncate-fd.js) - [parallel/test-fs-truncate-sync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-truncate-sync.js) - [parallel/test-fs-truncate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-truncate.js) - [parallel/test-fs-unlink-type-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-unlink-type-check.js) -- [parallel/test-fs-util-validateoffsetlength.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-util-validateoffsetlength.js) - [parallel/test-fs-utils-get-dirents.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-utils-get-dirents.js) -- [parallel/test-fs-utimes-y2K38.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-utimes-y2K38.js) - [parallel/test-fs-watch-abort-signal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-abort-signal.js) - [parallel/test-fs-watch-close-when-destroyed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-close-when-destroyed.js) - [parallel/test-fs-watch-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-encoding.js) - [parallel/test-fs-watch-enoent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-enoent.js) -- [parallel/test-fs-watch-file-enoent-after-deletion.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-file-enoent-after-deletion.js) - [parallel/test-fs-watch-recursive-add-file-to-existing-subfolder.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-add-file-to-existing-subfolder.js) - [parallel/test-fs-watch-recursive-add-file-to-new-folder.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-add-file-to-new-folder.js) -- [parallel/test-fs-watch-recursive-add-file-with-url.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-add-file-with-url.js) -- [parallel/test-fs-watch-recursive-add-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-add-file.js) -- [parallel/test-fs-watch-recursive-add-folder.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-add-folder.js) - [parallel/test-fs-watch-recursive-assert-leaks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-assert-leaks.js) - [parallel/test-fs-watch-recursive-promise.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-promise.js) - [parallel/test-fs-watch-recursive-symlink.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-symlink.js) -- [parallel/test-fs-watch-recursive-update-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-update-file.js) - [parallel/test-fs-watch-recursive-validate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-validate.js) - [parallel/test-fs-watch-recursive-watch-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-recursive-watch-file.js) - [parallel/test-fs-watch-ref-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-watch-ref-unref.js) @@ -926,34 +763,26 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-fs-write-buffer-large.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-buffer-large.js) - [parallel/test-fs-write-file-flush.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-file-flush.js) - [parallel/test-fs-write-file-typedarrays.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-file-typedarrays.js) -- [parallel/test-fs-write-negativeoffset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-negativeoffset.js) - [parallel/test-fs-write-optional-params.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-optional-params.js) - [parallel/test-fs-write-reuse-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-reuse-callback.js) - [parallel/test-fs-write-sigxfsz.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-sigxfsz.js) - [parallel/test-fs-write-stream-change-open.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-stream-change-open.js) -- [parallel/test-fs-write-stream-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-stream-encoding.js) - [parallel/test-fs-write-stream-err.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-stream-err.js) - [parallel/test-fs-write-stream-file-handle-2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-stream-file-handle-2.js) - [parallel/test-fs-write-stream-file-handle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-stream-file-handle.js) - [parallel/test-fs-write-stream-flush.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-stream-flush.js) -- [parallel/test-fs-write-stream-patch-open.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-stream-patch-open.js) - [parallel/test-fs-write-sync-optional-params.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-write-sync-optional-params.js) - [parallel/test-fs-writefile-with-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-writefile-with-fd.js) - [parallel/test-fs-writev-promises.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-writev-promises.js) -- [parallel/test-fs-writev.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-writev.js) - [parallel/test-gc-http-client-connaborted.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-gc-http-client-connaborted.js) - [parallel/test-gc-net-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-gc-net-timeout.js) - [parallel/test-gc-tls-external-memory.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-gc-tls-external-memory.js) - [parallel/test-global-console-exists.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-console-exists.js) - [parallel/test-global-customevent-disabled.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-customevent-disabled.js) - [parallel/test-global-customevent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-customevent.js) -- [parallel/test-global-domexception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-domexception.js) -- [parallel/test-global-encoder.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-encoder.js) - [parallel/test-global-setters.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-setters.js) - [parallel/test-global-webcrypto-classes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-webcrypto-classes.js) - [parallel/test-global-webcrypto-disbled.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-webcrypto-disbled.js) -- [parallel/test-global-webcrypto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-webcrypto.js) -- [parallel/test-global-webstreams.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global-webstreams.js) - [parallel/test-global.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-global.js) - [parallel/test-h2-large-header-cause-client-to-hangup.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-h2-large-header-cause-client-to-hangup.js) - [parallel/test-handle-wrap-hasref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-handle-wrap-hasref.js) @@ -973,26 +802,19 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-heapsnapshot-near-heap-limit-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-heapsnapshot-near-heap-limit-worker.js) - [parallel/test-http-1.0-keep-alive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-1.0-keep-alive.js) - [parallel/test-http-1.0.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-1.0.js) -- [parallel/test-http-abort-before-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-abort-before-end.js) - [parallel/test-http-abort-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-abort-client.js) - [parallel/test-http-abort-queued.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-abort-queued.js) - [parallel/test-http-abort-stream-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-abort-stream-end.js) - [parallel/test-http-aborted.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-aborted.js) -- [parallel/test-http-addrequest-localaddress.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-addrequest-localaddress.js) - [parallel/test-http-after-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-after-connect.js) - [parallel/test-http-agent-abort-controller.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-abort-controller.js) - [parallel/test-http-agent-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-close.js) - [parallel/test-http-agent-destroyed-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-destroyed-socket.js) - [parallel/test-http-agent-domain-reused-gc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-domain-reused-gc.js) - [parallel/test-http-agent-error-on-idle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-error-on-idle.js) -- [parallel/test-http-agent-false.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-false.js) -- [parallel/test-http-agent-keepalive-delay.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-keepalive-delay.js) - [parallel/test-http-agent-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-keepalive.js) - [parallel/test-http-agent-maxsockets-respected.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-maxsockets-respected.js) - [parallel/test-http-agent-maxsockets.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-maxsockets.js) -- [parallel/test-http-agent-maxtotalsockets.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-maxtotalsockets.js) -- [parallel/test-http-agent-no-protocol.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-no-protocol.js) -- [parallel/test-http-agent-null.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-null.js) - [parallel/test-http-agent-remove.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-remove.js) - [parallel/test-http-agent-reuse-drained-socket-only.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-reuse-drained-socket-only.js) - [parallel/test-http-agent-scheduling.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-scheduling.js) @@ -1002,19 +824,14 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http-agent-uninitialized.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent-uninitialized.js) - [parallel/test-http-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-agent.js) - [parallel/test-http-allow-content-length-304.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-allow-content-length-304.js) -- [parallel/test-http-allow-req-after-204-res.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-allow-req-after-204-res.js) - [parallel/test-http-automatic-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-automatic-headers.js) - [parallel/test-http-autoselectfamily.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-autoselectfamily.js) -- [parallel/test-http-bind-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-bind-twice.js) - [parallel/test-http-blank-header.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-blank-header.js) -- [parallel/test-http-buffer-sanity.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-buffer-sanity.js) - [parallel/test-http-byteswritten.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-byteswritten.js) - [parallel/test-http-catch-uncaughtexception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-catch-uncaughtexception.js) - [parallel/test-http-chunk-extensions-limit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-chunk-extensions-limit.js) - [parallel/test-http-chunk-problem.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-chunk-problem.js) - [parallel/test-http-chunked-304.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-chunked-304.js) -- [parallel/test-http-chunked-smuggling.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-chunked-smuggling.js) -- [parallel/test-http-chunked.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-chunked.js) - [parallel/test-http-client-abort-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort-destroy.js) - [parallel/test-http-client-abort-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort-event.js) - [parallel/test-http-client-abort-keep-alive-destroy-res.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort-keep-alive-destroy-res.js) @@ -1024,36 +841,24 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http-client-abort-response-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort-response-event.js) - [parallel/test-http-client-abort-unix-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort-unix-socket.js) - [parallel/test-http-client-abort.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort.js) -- [parallel/test-http-client-abort2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort2.js) - [parallel/test-http-client-abort3.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-abort3.js) - [parallel/test-http-client-aborted-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-aborted-event.js) - [parallel/test-http-client-agent-abort-close-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-agent-abort-close-event.js) - [parallel/test-http-client-agent-end-close-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-agent-end-close-event.js) - [parallel/test-http-client-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-agent.js) -- [parallel/test-http-client-check-http-token.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-check-http-token.js) - [parallel/test-http-client-close-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-close-event.js) -- [parallel/test-http-client-close-with-default-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-close-with-default-agent.js) -- [parallel/test-http-client-default-headers-exist.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-default-headers-exist.js) -- [parallel/test-http-client-defaults.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-defaults.js) -- [parallel/test-http-client-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-encoding.js) - [parallel/test-http-client-error-rawbytes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-error-rawbytes.js) - [parallel/test-http-client-finished.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-finished.js) -- [parallel/test-http-client-headers-array.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-headers-array.js) - [parallel/test-http-client-headers-host-array.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-headers-host-array.js) - [parallel/test-http-client-immediate-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-immediate-error.js) - [parallel/test-http-client-incomingmessage-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-incomingmessage-destroy.js) -- [parallel/test-http-client-invalid-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-invalid-path.js) -- [parallel/test-http-client-keep-alive-hint.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-keep-alive-hint.js) - [parallel/test-http-client-keep-alive-release-before-finish.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-keep-alive-release-before-finish.js) - [parallel/test-http-client-override-global-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-override-global-agent.js) - [parallel/test-http-client-parse-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-parse-error.js) - [parallel/test-http-client-pipe-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-pipe-end.js) -- [parallel/test-http-client-race-2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-race-2.js) -- [parallel/test-http-client-race.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-race.js) - [parallel/test-http-client-readable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-readable.js) - [parallel/test-http-client-reject-chunked-with-content-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-reject-chunked-with-content-length.js) - [parallel/test-http-client-reject-cr-no-lf.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-reject-cr-no-lf.js) -- [parallel/test-http-client-reject-unexpected-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-reject-unexpected-agent.js) - [parallel/test-http-client-req-error-dont-double-fire.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-req-error-dont-double-fire.js) - [parallel/test-http-client-request-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-request-options.js) - [parallel/test-http-client-res-destroyed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-res-destroyed.js) @@ -1063,97 +868,60 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http-client-set-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-set-timeout.js) - [parallel/test-http-client-spurious-aborted.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-spurious-aborted.js) - [parallel/test-http-client-timeout-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout-agent.js) -- [parallel/test-http-client-timeout-connect-listener.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout-connect-listener.js) - [parallel/test-http-client-timeout-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout-event.js) - [parallel/test-http-client-timeout-on-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout-on-connect.js) - [parallel/test-http-client-timeout-option-listeners.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout-option-listeners.js) - [parallel/test-http-client-timeout-option-with-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout-option-with-agent.js) - [parallel/test-http-client-timeout-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout-option.js) -- [parallel/test-http-client-timeout-with-data.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout-with-data.js) - [parallel/test-http-client-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-timeout.js) -- [parallel/test-http-client-unescaped-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-unescaped-path.js) -- [parallel/test-http-client-upload-buf.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-upload-buf.js) -- [parallel/test-http-client-upload.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-client-upload.js) -- [parallel/test-http-common.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-common.js) - [parallel/test-http-conn-reset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-conn-reset.js) - [parallel/test-http-connect-req-res.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-connect-req-res.js) - [parallel/test-http-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-connect.js) - [parallel/test-http-content-length-mismatch.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-content-length-mismatch.js) - [parallel/test-http-content-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-content-length.js) -- [parallel/test-http-contentLength0.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-contentLength0.js) -- [parallel/test-http-correct-hostname.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-correct-hostname.js) - [parallel/test-http-createConnection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-createConnection.js) -- [parallel/test-http-date-header.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-date-header.js) - [parallel/test-http-debug.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-debug.js) -- [parallel/test-http-decoded-auth.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-decoded-auth.js) -- [parallel/test-http-default-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-default-encoding.js) - [parallel/test-http-default-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-default-port.js) - [parallel/test-http-destroyed-socket-write2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-destroyed-socket-write2.js) - [parallel/test-http-dns-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-dns-error.js) - [parallel/test-http-double-content-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-double-content-length.js) -- [parallel/test-http-dump-req-when-res-ends.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-dump-req-when-res-ends.js) - [parallel/test-http-early-hints-invalid-argument.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-early-hints-invalid-argument.js) - [parallel/test-http-early-hints.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-early-hints.js) -- [parallel/test-http-end-throw-socket-handling.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-end-throw-socket-handling.js) -- [parallel/test-http-eof-on-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-eof-on-connect.js) - [parallel/test-http-exceptions.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-exceptions.js) - [parallel/test-http-expect-continue.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-expect-continue.js) - [parallel/test-http-expect-handling.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-expect-handling.js) -- [parallel/test-http-extra-response.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-extra-response.js) -- [parallel/test-http-flush-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-flush-headers.js) - [parallel/test-http-flush-response-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-flush-response-headers.js) -- [parallel/test-http-full-response.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-full-response.js) - [parallel/test-http-generic-streams.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-generic-streams.js) - [parallel/test-http-get-pipeline-problem.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-get-pipeline-problem.js) -- [parallel/test-http-head-request.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-head-request.js) -- [parallel/test-http-head-response-has-no-body-end-implicit-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-head-response-has-no-body-end-implicit-headers.js) -- [parallel/test-http-head-response-has-no-body-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-head-response-has-no-body-end.js) -- [parallel/test-http-head-response-has-no-body.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-head-response-has-no-body.js) -- [parallel/test-http-head-throw-on-response-body-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-head-throw-on-response-body-write.js) - [parallel/test-http-header-badrequest.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-header-badrequest.js) -- [parallel/test-http-header-obstext.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-header-obstext.js) - [parallel/test-http-header-overflow.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-header-overflow.js) -- [parallel/test-http-header-owstext.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-header-owstext.js) -- [parallel/test-http-header-read.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-header-read.js) -- [parallel/test-http-hex-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-hex-write.js) -- [parallel/test-http-highwatermark.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-highwatermark.js) - [parallel/test-http-host-header-ipv6-fail.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-host-header-ipv6-fail.js) -- [parallel/test-http-host-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-host-headers.js) -- [parallel/test-http-hostname-typechecking.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-hostname-typechecking.js) - [parallel/test-http-incoming-matchKnownFields.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-incoming-matchKnownFields.js) - [parallel/test-http-incoming-message-connection-setter.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-incoming-message-connection-setter.js) -- [parallel/test-http-incoming-message-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-incoming-message-destroy.js) - [parallel/test-http-incoming-message-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-incoming-message-options.js) - [parallel/test-http-incoming-pipelined-socket-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-incoming-pipelined-socket-destroy.js) - [parallel/test-http-information-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-information-headers.js) - [parallel/test-http-information-processing.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-information-processing.js) - [parallel/test-http-insecure-parser-per-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-insecure-parser-per-stream.js) - [parallel/test-http-insecure-parser.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-insecure-parser.js) -- [parallel/test-http-invalid-path-chars.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-invalid-path-chars.js) - [parallel/test-http-invalid-te.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-invalid-te.js) - [parallel/test-http-invalid-urls.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-invalid-urls.js) -- [parallel/test-http-invalidheaderfield.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-invalidheaderfield.js) -- [parallel/test-http-invalidheaderfield2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-invalidheaderfield2.js) - [parallel/test-http-keep-alive-close-on-header.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keep-alive-close-on-header.js) - [parallel/test-http-keep-alive-drop-requests.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keep-alive-drop-requests.js) - [parallel/test-http-keep-alive-max-requests.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keep-alive-max-requests.js) - [parallel/test-http-keep-alive-pipeline-max-requests.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keep-alive-pipeline-max-requests.js) -- [parallel/test-http-keep-alive-timeout-custom.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keep-alive-timeout-custom.js) - [parallel/test-http-keep-alive-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keep-alive-timeout.js) - [parallel/test-http-keep-alive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keep-alive.js) - [parallel/test-http-keepalive-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keepalive-client.js) - [parallel/test-http-keepalive-free.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keepalive-free.js) - [parallel/test-http-keepalive-override.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keepalive-override.js) - [parallel/test-http-keepalive-request.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-keepalive-request.js) -- [parallel/test-http-listening.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-listening.js) -- [parallel/test-http-localaddress-bind-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-localaddress-bind-error.js) - [parallel/test-http-malformed-request.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-malformed-request.js) - [parallel/test-http-many-ended-pipelines.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-many-ended-pipelines.js) - [parallel/test-http-max-header-size-per-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-max-header-size-per-stream.js) - [parallel/test-http-max-header-size.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-max-header-size.js) - [parallel/test-http-max-headers-count.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-max-headers-count.js) - [parallel/test-http-max-http-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-max-http-headers.js) -- [parallel/test-http-methods.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-methods.js) - [parallel/test-http-missing-header-separator-cr.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-missing-header-separator-cr.js) - [parallel/test-http-missing-header-separator-lf.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-missing-header-separator-lf.js) - [parallel/test-http-multi-line-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-multi-line-headers.js) @@ -1167,10 +935,8 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http-outgoing-destroyed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-destroyed.js) - [parallel/test-http-outgoing-end-cork.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-end-cork.js) - [parallel/test-http-outgoing-end-multiple.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-end-multiple.js) -- [parallel/test-http-outgoing-end-types.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-end-types.js) - [parallel/test-http-outgoing-finish-writable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-finish-writable.js) - [parallel/test-http-outgoing-finish.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-finish.js) -- [parallel/test-http-outgoing-finished.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-finished.js) - [parallel/test-http-outgoing-first-chunk-singlebyte-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-first-chunk-singlebyte-encoding.js) - [parallel/test-http-outgoing-message-capture-rejection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-message-capture-rejection.js) - [parallel/test-http-outgoing-message-inheritance.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-message-inheritance.js) @@ -1178,58 +944,38 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http-outgoing-properties.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-properties.js) - [parallel/test-http-outgoing-proto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-proto.js) - [parallel/test-http-outgoing-writableFinished.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-writableFinished.js) -- [parallel/test-http-outgoing-write-types.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-outgoing-write-types.js) - [parallel/test-http-parser-bad-ref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser-bad-ref.js) - [parallel/test-http-parser-finish-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser-finish-error.js) -- [parallel/test-http-parser-free.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser-free.js) - [parallel/test-http-parser-freed-before-upgrade.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser-freed-before-upgrade.js) - [parallel/test-http-parser-lazy-loaded.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser-lazy-loaded.js) - [parallel/test-http-parser-memory-retention.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser-memory-retention.js) - [parallel/test-http-parser-multiple-execute.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser-multiple-execute.js) - [parallel/test-http-parser-timeout-reset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser-timeout-reset.js) - [parallel/test-http-parser.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-parser.js) -- [parallel/test-http-pause-no-dump.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-pause-no-dump.js) -- [parallel/test-http-pause-resume-one-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-pause-resume-one-end.js) -- [parallel/test-http-pause.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-pause.js) - [parallel/test-http-perf_hooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-perf_hooks.js) -- [parallel/test-http-pipe-fs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-pipe-fs.js) - [parallel/test-http-pipeline-assertionerror-finish.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-pipeline-assertionerror-finish.js) - [parallel/test-http-pipeline-flood.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-pipeline-flood.js) -- [parallel/test-http-pipeline-requests-connection-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-pipeline-requests-connection-leak.js) - [parallel/test-http-pipeline-socket-parser-typeerror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-pipeline-socket-parser-typeerror.js) -- [parallel/test-http-proxy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-proxy.js) - [parallel/test-http-raw-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-raw-headers.js) -- [parallel/test-http-readable-data-event.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-readable-data-event.js) - [parallel/test-http-remove-connection-header-persists-connection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-remove-connection-header-persists-connection.js) - [parallel/test-http-remove-header-stays-removed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-remove-header-stays-removed.js) - [parallel/test-http-req-close-robust-from-tampering.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-req-close-robust-from-tampering.js) - [parallel/test-http-req-res-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-req-res-close.js) - [parallel/test-http-request-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-agent.js) -- [parallel/test-http-request-arguments.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-arguments.js) -- [parallel/test-http-request-dont-override-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-dont-override-options.js) -- [parallel/test-http-request-end-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-end-twice.js) -- [parallel/test-http-request-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-end.js) - [parallel/test-http-request-host-header.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-host-header.js) -- [parallel/test-http-request-invalid-method-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-invalid-method-error.js) - [parallel/test-http-request-join-authorization-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-join-authorization-headers.js) -- [parallel/test-http-request-large-payload.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-large-payload.js) -- [parallel/test-http-request-methods.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-methods.js) - [parallel/test-http-request-smuggling-content-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-request-smuggling-content-length.js) - [parallel/test-http-res-write-after-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-res-write-after-end.js) -- [parallel/test-http-res-write-end-dont-take-array.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-res-write-end-dont-take-array.js) - [parallel/test-http-response-add-header-after-sent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-add-header-after-sent.js) - [parallel/test-http-response-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-close.js) - [parallel/test-http-response-cork.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-cork.js) - [parallel/test-http-response-multi-content-length.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-multi-content-length.js) -- [parallel/test-http-response-multiheaders.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-multiheaders.js) - [parallel/test-http-response-no-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-no-headers.js) -- [parallel/test-http-response-readable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-readable.js) - [parallel/test-http-response-remove-header-after-sent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-remove-header-after-sent.js) - [parallel/test-http-response-setheaders.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-setheaders.js) - [parallel/test-http-response-splitting.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-splitting.js) - [parallel/test-http-response-status-message.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-status-message.js) - [parallel/test-http-response-statuscode.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-statuscode.js) -- [parallel/test-http-response-writehead-returns-this.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-response-writehead-returns-this.js) - [parallel/test-http-same-map.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-same-map.js) - [parallel/test-http-server-async-dispose.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-async-dispose.js) - [parallel/test-http-server-capture-rejections.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-capture-rejections.js) @@ -1242,7 +988,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http-server-connections-checking-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-connections-checking-leak.js) - [parallel/test-http-server-consumed-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-consumed-timeout.js) - [parallel/test-http-server-de-chunked-trailer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-de-chunked-trailer.js) -- [parallel/test-http-server-delete-parser.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-delete-parser.js) - [parallel/test-http-server-destroy-socket-on-client-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-destroy-socket-on-client-error.js) - [parallel/test-http-server-headers-timeout-delayed-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-headers-timeout-delayed-headers.js) - [parallel/test-http-server-headers-timeout-interrupted-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-headers-timeout-interrupted-headers.js) @@ -1275,11 +1020,7 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http-server-timeouts-validation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-timeouts-validation.js) - [parallel/test-http-server-unconsume-consume.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-unconsume-consume.js) - [parallel/test-http-server-unconsume.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-unconsume.js) -- [parallel/test-http-server-write-after-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-write-after-end.js) -- [parallel/test-http-server-write-end-after-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server-write-end-after-end.js) - [parallel/test-http-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-server.js) -- [parallel/test-http-set-cookies.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-set-cookies.js) -- [parallel/test-http-set-header-chain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-set-header-chain.js) - [parallel/test-http-set-max-idle-http-parser.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-set-max-idle-http-parser.js) - [parallel/test-http-set-timeout-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-set-timeout-server.js) - [parallel/test-http-set-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-set-timeout.js) @@ -1287,16 +1028,13 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http-should-keep-alive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-should-keep-alive.js) - [parallel/test-http-socket-encoding-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-socket-encoding-error.js) - [parallel/test-http-socket-error-listeners.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-socket-error-listeners.js) -- [parallel/test-http-status-code.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-status-code.js) - [parallel/test-http-status-message.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-status-message.js) -- [parallel/test-http-status-reason-invalid-chars.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-status-reason-invalid-chars.js) - [parallel/test-http-sync-write-error-during-continue.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-sync-write-error-during-continue.js) - [parallel/test-http-timeout-client-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-timeout-client-warning.js) - [parallel/test-http-timeout-overflow.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-timeout-overflow.js) - [parallel/test-http-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-timeout.js) - [parallel/test-http-transfer-encoding-repeated-chunked.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-transfer-encoding-repeated-chunked.js) - [parallel/test-http-transfer-encoding-smuggling.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-transfer-encoding-smuggling.js) -- [parallel/test-http-uncaught-from-request-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-uncaught-from-request-callback.js) - [parallel/test-http-unix-socket-keep-alive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-unix-socket-keep-alive.js) - [parallel/test-http-unix-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-unix-socket.js) - [parallel/test-http-upgrade-advertise.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-upgrade-advertise.js) @@ -1308,19 +1046,11 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http-upgrade-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-upgrade-server.js) - [parallel/test-http-upgrade-server2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-upgrade-server2.js) - [parallel/test-http-url.parse-auth-with-header-in-request.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-url.parse-auth-with-header-in-request.js) -- [parallel/test-http-url.parse-auth.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-url.parse-auth.js) -- [parallel/test-http-url.parse-basic.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-url.parse-basic.js) -- [parallel/test-http-url.parse-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-url.parse-path.js) -- [parallel/test-http-url.parse-post.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-url.parse-post.js) -- [parallel/test-http-url.parse-search.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-url.parse-search.js) -- [parallel/test-http-wget.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-wget.js) - [parallel/test-http-writable-true-after-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-writable-true-after-close.js) - [parallel/test-http-write-callbacks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-write-callbacks.js) -- [parallel/test-http-write-empty-string.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-write-empty-string.js) - [parallel/test-http-write-head-2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-write-head-2.js) - [parallel/test-http-write-head.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-write-head.js) - [parallel/test-http-zero-length-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-zero-length-write.js) -- [parallel/test-http-zerolengthbuffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http-zerolengthbuffer.js) - [parallel/test-http.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http.js) - [parallel/test-http2-altsvc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-altsvc.js) - [parallel/test-http2-autoselect-protocol.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-autoselect-protocol.js) @@ -1340,7 +1070,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http2-client-port-80.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-port-80.js) - [parallel/test-http2-client-priority-before-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-priority-before-connect.js) - [parallel/test-http2-client-promisify-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-promisify-connect.js) -- [parallel/test-http2-client-request-listeners-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-request-listeners-warning.js) - [parallel/test-http2-client-request-options-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-request-options-errors.js) - [parallel/test-http2-client-rststream-before-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-rststream-before-connect.js) - [parallel/test-http2-client-set-priority.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-client-set-priority.js) @@ -1361,7 +1090,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http2-compat-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-errors.js) - [parallel/test-http2-compat-expect-continue-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-expect-continue-check.js) - [parallel/test-http2-compat-expect-continue.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-expect-continue.js) -- [parallel/test-http2-compat-expect-handling.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-expect-handling.js) - [parallel/test-http2-compat-method-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-method-connect.js) - [parallel/test-http2-compat-serverrequest-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverrequest-end.js) - [parallel/test-http2-compat-serverrequest-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverrequest-headers.js) @@ -1394,7 +1122,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http2-compat-serverresponse.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-serverresponse.js) - [parallel/test-http2-compat-short-stream-client-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-short-stream-client-server.js) - [parallel/test-http2-compat-socket-destroy-delayed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-socket-destroy-delayed.js) -- [parallel/test-http2-compat-socket-set.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-socket-set.js) - [parallel/test-http2-compat-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-socket.js) - [parallel/test-http2-compat-write-early-hints-invalid-argument-type.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-write-early-hints-invalid-argument-type.js) - [parallel/test-http2-compat-write-early-hints-invalid-argument-value.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-compat-write-early-hints-invalid-argument-value.js) @@ -1403,7 +1130,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http2-connect-method-extended-cant-turn-off.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-connect-method-extended-cant-turn-off.js) - [parallel/test-http2-connect-method-extended.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-connect-method-extended.js) - [parallel/test-http2-connect-method.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-connect-method.js) -- [parallel/test-http2-connect-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-connect-options.js) - [parallel/test-http2-connect-tls-with-delay.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-connect-tls-with-delay.js) - [parallel/test-http2-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-connect.js) - [parallel/test-http2-cookies.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-cookies.js) @@ -1413,13 +1139,10 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http2-createsecureserver-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-createsecureserver-options.js) - [parallel/test-http2-createserver-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-createserver-options.js) - [parallel/test-http2-createwritereq.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-createwritereq.js) -- [parallel/test-http2-date-header.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-date-header.js) - [parallel/test-http2-debug.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-debug.js) - [parallel/test-http2-destroy-after-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-destroy-after-write.js) - [parallel/test-http2-dont-lose-data.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-dont-lose-data.js) -- [parallel/test-http2-dont-override.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-dont-override.js) - [parallel/test-http2-empty-frame-without-eof.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-empty-frame-without-eof.js) -- [parallel/test-http2-endafterheaders.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-endafterheaders.js) - [parallel/test-http2-error-order.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-error-order.js) - [parallel/test-http2-exceeds-server-trailer-size.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-exceeds-server-trailer-size.js) - [parallel/test-http2-forget-closed-streams.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-forget-closed-streams.js) @@ -1446,7 +1169,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http2-max-invalid-frames.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-max-invalid-frames.js) - [parallel/test-http2-max-session-memory-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-max-session-memory-leak.js) - [parallel/test-http2-max-settings.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-max-settings.js) -- [parallel/test-http2-methods.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-methods.js) - [parallel/test-http2-misbehaving-flow-control-paused.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-misbehaving-flow-control-paused.js) - [parallel/test-http2-misbehaving-flow-control.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-misbehaving-flow-control.js) - [parallel/test-http2-misbehaving-multiplex.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-misbehaving-multiplex.js) @@ -1479,15 +1201,12 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http2-propagate-session-destroy-code.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-propagate-session-destroy-code.js) - [parallel/test-http2-removed-header-stays-removed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-removed-header-stays-removed.js) - [parallel/test-http2-request-remove-connect-listener.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-request-remove-connect-listener.js) -- [parallel/test-http2-request-response-proto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-request-response-proto.js) - [parallel/test-http2-res-corked.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-res-corked.js) - [parallel/test-http2-res-writable-properties.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-res-writable-properties.js) - [parallel/test-http2-reset-flood.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-reset-flood.js) - [parallel/test-http2-respond-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-errors.js) -- [parallel/test-http2-respond-file-204.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-204.js) - [parallel/test-http2-respond-file-304.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-304.js) - [parallel/test-http2-respond-file-404.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-404.js) -- [parallel/test-http2-respond-file-compat.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-compat.js) - [parallel/test-http2-respond-file-error-dir.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-error-dir.js) - [parallel/test-http2-respond-file-error-pipe-offset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-error-pipe-offset.js) - [parallel/test-http2-respond-file-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-respond-file-errors.js) @@ -1535,19 +1254,14 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http2-session-gc-while-write-scheduled.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-session-gc-while-write-scheduled.js) - [parallel/test-http2-session-settings.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-session-settings.js) - [parallel/test-http2-session-stream-state.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-session-stream-state.js) -- [parallel/test-http2-session-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-session-timeout.js) - [parallel/test-http2-session-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-session-unref.js) - [parallel/test-http2-settings-unsolicited-ack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-settings-unsolicited-ack.js) - [parallel/test-http2-short-stream-client-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-short-stream-client-server.js) - [parallel/test-http2-single-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-single-headers.js) - [parallel/test-http2-socket-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-socket-close.js) - [parallel/test-http2-socket-proxy-handler-for-has.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-socket-proxy-handler-for-has.js) -- [parallel/test-http2-socket-proxy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-socket-proxy.js) -- [parallel/test-http2-status-code-invalid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-status-code-invalid.js) -- [parallel/test-http2-status-code.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-status-code.js) - [parallel/test-http2-stream-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-stream-client.js) - [parallel/test-http2-stream-destroy-event-order.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-stream-destroy-event-order.js) -- [parallel/test-http2-stream-removelisteners-after-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-stream-removelisteners-after-close.js) - [parallel/test-http2-timeouts.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-timeouts.js) - [parallel/test-http2-tls-disconnect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-tls-disconnect.js) - [parallel/test-http2-too-large-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-too-large-headers.js) @@ -1565,7 +1279,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-http2-util-update-options-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-util-update-options-buffer.js) - [parallel/test-http2-window-size.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-window-size.js) - [parallel/test-http2-write-callbacks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-write-callbacks.js) -- [parallel/test-http2-write-empty-string.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-write-empty-string.js) - [parallel/test-http2-write-finishes-after-stream-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-write-finishes-after-stream-destroy.js) - [parallel/test-http2-zero-length-header.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-zero-length-header.js) - [parallel/test-http2-zero-length-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-http2-zero-length-write.js) @@ -1592,20 +1305,15 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-https-client-get-url.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-client-get-url.js) - [parallel/test-https-client-override-global-agent.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-client-override-global-agent.js) - [parallel/test-https-client-reject.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-client-reject.js) -- [parallel/test-https-client-renegotiation-limit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-client-renegotiation-limit.js) - [parallel/test-https-client-resume.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-client-resume.js) - [parallel/test-https-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-close.js) - [parallel/test-https-connect-address-family.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-connect-address-family.js) -- [parallel/test-https-connecting-to-http.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-connecting-to-http.js) - [parallel/test-https-drain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-drain.js) - [parallel/test-https-eof-for-eom.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-eof-for-eom.js) -- [parallel/test-https-foafssl.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-foafssl.js) - [parallel/test-https-host-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-host-headers.js) - [parallel/test-https-hwm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-hwm.js) - [parallel/test-https-insecure-parse-per-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-insecure-parse-per-stream.js) - [parallel/test-https-keep-alive-drop-requests.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-keep-alive-drop-requests.js) -- [parallel/test-https-localaddress-bind-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-localaddress-bind-error.js) -- [parallel/test-https-localaddress.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-localaddress.js) - [parallel/test-https-max-header-size-per-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-max-header-size-per-stream.js) - [parallel/test-https-max-headers-count.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-max-headers-count.js) - [parallel/test-https-options-boolean-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-options-boolean-check.js) @@ -1631,11 +1339,8 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-https-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-timeout.js) - [parallel/test-https-truncate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-truncate.js) - [parallel/test-https-unix-socket-self-signed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-https-unix-socket-self-signed.js) -- [parallel/test-icu-data-dir.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-icu-data-dir.js) -- [parallel/test-icu-env.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-icu-env.js) - [parallel/test-icu-minimum-version.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-icu-minimum-version.js) - [parallel/test-icu-punycode.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-icu-punycode.js) -- [parallel/test-icu-stringwidth.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-icu-stringwidth.js) - [parallel/test-inspect-address-in-use.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspect-address-in-use.js) - [parallel/test-inspect-async-hook-setup-at-inspect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspect-async-hook-setup-at-inspect.js) - [parallel/test-inspect-publish-uid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspect-publish-uid.js) @@ -1685,7 +1390,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-inspector-runtime-evaluate-with-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-runtime-evaluate-with-timeout.js) - [parallel/test-inspector-scriptparsed-context.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-scriptparsed-context.js) - [parallel/test-inspector-stop-profile-after-done.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-stop-profile-after-done.js) -- [parallel/test-inspector-stops-no-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-stops-no-file.js) - [parallel/test-inspector-stress-http.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-stress-http.js) - [parallel/test-inspector-tracing-domain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-tracing-domain.js) - [parallel/test-inspector-vm-global-accessors-getter-sideeffect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-vm-global-accessors-getter-sideeffect.js) @@ -1694,12 +1398,10 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-inspector-waiting-for-disconnect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-waiting-for-disconnect.js) - [parallel/test-inspector-workers-flat-list.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector-workers-flat-list.js) - [parallel/test-inspector.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-inspector.js) -- [parallel/test-instanceof.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-instanceof.js) - [parallel/test-internal-assert.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-assert.js) - [parallel/test-internal-error-original-names.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-error-original-names.js) - [parallel/test-internal-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-errors.js) - [parallel/test-internal-fs-syncwritestream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-fs-syncwritestream.js) -- [parallel/test-internal-fs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-fs.js) - [parallel/test-internal-iterable-weak-map.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-iterable-weak-map.js) - [parallel/test-internal-module-require.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-module-require.js) - [parallel/test-internal-module-wrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-module-wrap.js) @@ -1711,7 +1413,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-internal-util-classwrapper.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-util-classwrapper.js) - [parallel/test-internal-util-decorate-error-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-util-decorate-error-stack.js) - [parallel/test-internal-util-helpers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-util-helpers.js) -- [parallel/test-internal-util-normalizeencoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-util-normalizeencoding.js) - [parallel/test-internal-util-objects.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-util-objects.js) - [parallel/test-internal-util-weakreference.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-util-weakreference.js) - [parallel/test-internal-validators-validateoneof.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-internal-validators-validateoneof.js) @@ -1720,171 +1421,102 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-intl-v8BreakIterator.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-intl-v8BreakIterator.js) - [parallel/test-intl.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-intl.js) - [parallel/test-js-stream-call-properties.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-js-stream-call-properties.js) -- [parallel/test-kill-segfault-freebsd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-kill-segfault-freebsd.js) - [parallel/test-listen-fd-cluster.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-listen-fd-cluster.js) -- [parallel/test-listen-fd-detached-inherit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-listen-fd-detached-inherit.js) -- [parallel/test-listen-fd-detached.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-listen-fd-detached.js) - [parallel/test-listen-fd-ebadf.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-listen-fd-ebadf.js) - [parallel/test-listen-fd-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-listen-fd-server.js) - [parallel/test-macos-app-sandbox.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-macos-app-sandbox.js) - [parallel/test-math-random.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-math-random.js) -- [parallel/test-memory-usage-emfile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-memory-usage-emfile.js) -- [parallel/test-memory-usage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-memory-usage.js) -- [parallel/test-messagechannel.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-messagechannel.js) - [parallel/test-messageevent-brandcheck.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-messageevent-brandcheck.js) - [parallel/test-messageport-hasref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-messageport-hasref.js) - [parallel/test-messaging-maketransferable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-messaging-maketransferable.js) -- [parallel/test-microtask-queue-integration.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-microtask-queue-integration.js) -- [parallel/test-microtask-queue-run-immediate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-microtask-queue-run-immediate.js) -- [parallel/test-microtask-queue-run.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-microtask-queue-run.js) - [parallel/test-mime-api.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-mime-api.js) - [parallel/test-mime-whatwg.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-mime-whatwg.js) - [parallel/test-module-binding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-binding.js) - [parallel/test-module-builtin.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-builtin.js) -- [parallel/test-module-cache.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-cache.js) - [parallel/test-module-children.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-children.js) - [parallel/test-module-circular-dependency-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-circular-dependency-warning.js) -- [parallel/test-module-circular-symlinks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-circular-symlinks.js) - [parallel/test-module-create-require.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-create-require.js) - [parallel/test-module-globalpaths-nodepath.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-globalpaths-nodepath.js) -- [parallel/test-module-isBuiltin.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-isBuiltin.js) - [parallel/test-module-loading-deprecated.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-loading-deprecated.js) - [parallel/test-module-loading-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-loading-error.js) - [parallel/test-module-loading-globalpaths.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-loading-globalpaths.js) - [parallel/test-module-main-extension-lookup.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-main-extension-lookup.js) - [parallel/test-module-main-fail.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-main-fail.js) - [parallel/test-module-main-preserve-symlinks-fail.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-main-preserve-symlinks-fail.js) -- [parallel/test-module-multi-extensions.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-multi-extensions.js) -- [parallel/test-module-nodemodulepaths.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-nodemodulepaths.js) - [parallel/test-module-parent-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-parent-deprecation.js) - [parallel/test-module-parent-setter-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-parent-setter-deprecation.js) - [parallel/test-module-prototype-mutation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-prototype-mutation.js) -- [parallel/test-module-readonly.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-readonly.js) -- [parallel/test-module-relative-lookup.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-relative-lookup.js) - [parallel/test-module-run-main-monkey-patch.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-run-main-monkey-patch.js) - [parallel/test-module-stat.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-stat.js) - [parallel/test-module-symlinked-peer-modules.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-symlinked-peer-modules.js) - [parallel/test-module-version.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-version.js) - [parallel/test-module-wrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-wrap.js) - [parallel/test-module-wrapper.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-module-wrapper.js) -- [parallel/test-net-after-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-after-close.js) - [parallel/test-net-allow-half-open.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-allow-half-open.js) - [parallel/test-net-autoselectfamily-commandline-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-autoselectfamily-commandline-option.js) - [parallel/test-net-autoselectfamily-default.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-autoselectfamily-default.js) - [parallel/test-net-autoselectfamily-ipv4first.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-autoselectfamily-ipv4first.js) -- [parallel/test-net-better-error-messages-listen.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-better-error-messages-listen.js) - [parallel/test-net-binary.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-binary.js) -- [parallel/test-net-bind-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-bind-twice.js) -- [parallel/test-net-buffersize.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-buffersize.js) - [parallel/test-net-bytes-read.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-bytes-read.js) - [parallel/test-net-bytes-stats.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-bytes-stats.js) -- [parallel/test-net-bytes-written-large.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-bytes-written-large.js) -- [parallel/test-net-can-reset-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-can-reset-timeout.js) - [parallel/test-net-child-process-connect-reset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-child-process-connect-reset.js) - [parallel/test-net-client-bind-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-client-bind-twice.js) - [parallel/test-net-connect-abort-controller.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-abort-controller.js) - [parallel/test-net-connect-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-buffer.js) - [parallel/test-net-connect-buffer2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-buffer2.js) -- [parallel/test-net-connect-call-socket-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-call-socket-connect.js) - [parallel/test-net-connect-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-keepalive.js) - [parallel/test-net-connect-memleak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-memleak.js) - [parallel/test-net-connect-nodelay.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-nodelay.js) - [parallel/test-net-connect-options-allowhalfopen.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-options-allowhalfopen.js) -- [parallel/test-net-connect-options-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-options-fd.js) - [parallel/test-net-connect-options-invalid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-options-invalid.js) -- [parallel/test-net-connect-options-ipv6.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-options-ipv6.js) - [parallel/test-net-connect-options-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-options-path.js) -- [parallel/test-net-connect-options-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-options-port.js) -- [parallel/test-net-connect-paused-connection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-paused-connection.js) - [parallel/test-net-connect-reset-after-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-reset-after-destroy.js) - [parallel/test-net-connect-reset-before-connected.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-reset-before-connected.js) - [parallel/test-net-connect-reset-until-connected.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-reset-until-connected.js) - [parallel/test-net-connect-reset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-reset.js) - [parallel/test-net-deprecated-setsimultaneousaccepts.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-deprecated-setsimultaneousaccepts.js) -- [parallel/test-net-dns-custom-lookup.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-dns-custom-lookup.js) -- [parallel/test-net-dns-lookup-skip.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-dns-lookup-skip.js) -- [parallel/test-net-dns-lookup.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-dns-lookup.js) -- [parallel/test-net-eaddrinuse.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-eaddrinuse.js) - [parallel/test-net-end-destroyed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-end-destroyed.js) -- [parallel/test-net-error-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-error-twice.js) -- [parallel/test-net-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-keepalive.js) - [parallel/test-net-large-string.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-large-string.js) -- [parallel/test-net-listen-after-destroying-stdin.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-listen-after-destroying-stdin.js) -- [parallel/test-net-listen-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-listen-error.js) - [parallel/test-net-listen-exclusive-random-ports.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-listen-exclusive-random-ports.js) - [parallel/test-net-listen-fd0.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-listen-fd0.js) - [parallel/test-net-listen-ipv6only.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-listen-ipv6only.js) -- [parallel/test-net-local-address-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-local-address-port.js) - [parallel/test-net-normalize-args.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-normalize-args.js) - [parallel/test-net-onread-static-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-onread-static-buffer.js) -- [parallel/test-net-pause-resume-connecting.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-pause-resume-connecting.js) - [parallel/test-net-perf_hooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-perf_hooks.js) -- [parallel/test-net-persistent-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-persistent-keepalive.js) -- [parallel/test-net-persistent-nodelay.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-persistent-nodelay.js) -- [parallel/test-net-persistent-ref-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-persistent-ref-unref.js) - [parallel/test-net-pingpong.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-pingpong.js) -- [parallel/test-net-reconnect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-reconnect.js) -- [parallel/test-net-remote-address-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-remote-address-port.js) -- [parallel/test-net-remote-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-remote-address.js) - [parallel/test-net-server-call-listen-multiple-times.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-call-listen-multiple-times.js) -- [parallel/test-net-server-capture-rejection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-capture-rejection.js) -- [parallel/test-net-server-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-close.js) - [parallel/test-net-server-drop-connections.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-drop-connections.js) - [parallel/test-net-server-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-keepalive.js) - [parallel/test-net-server-listen-handle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-listen-handle.js) - [parallel/test-net-server-max-connections-close-makes-more-available.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-max-connections-close-makes-more-available.js) - [parallel/test-net-server-max-connections.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-max-connections.js) - [parallel/test-net-server-nodelay.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-nodelay.js) -- [parallel/test-net-server-pause-on-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-pause-on-connect.js) - [parallel/test-net-server-reset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-reset.js) - [parallel/test-net-server-simultaneous-accepts-produce-warning-once.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-simultaneous-accepts-produce-warning-once.js) - [parallel/test-net-server-try-ports.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-try-ports.js) -- [parallel/test-net-settimeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-settimeout.js) - [parallel/test-net-socket-byteswritten.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-byteswritten.js) -- [parallel/test-net-socket-close-after-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-close-after-end.js) -- [parallel/test-net-socket-connect-invalid-autoselectfamily.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-connect-invalid-autoselectfamily.js) - [parallel/test-net-socket-connect-invalid-autoselectfamilyattempttimeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-connect-invalid-autoselectfamilyattempttimeout.js) -- [parallel/test-net-socket-connect-without-cb.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-connect-without-cb.js) -- [parallel/test-net-socket-connecting.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-connecting.js) - [parallel/test-net-socket-constructor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-constructor.js) -- [parallel/test-net-socket-destroy-send.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-destroy-send.js) -- [parallel/test-net-socket-end-before-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-end-before-connect.js) -- [parallel/test-net-socket-end-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-end-callback.js) - [parallel/test-net-socket-local-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-local-address.js) -- [parallel/test-net-socket-ready-without-cb.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-ready-without-cb.js) - [parallel/test-net-socket-reset-send.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-reset-send.js) - [parallel/test-net-socket-reset-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-reset-twice.js) -- [parallel/test-net-socket-timeout-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-timeout-unref.js) - [parallel/test-net-socket-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-timeout.js) -- [parallel/test-net-socket-write-after-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-write-after-close.js) -- [parallel/test-net-socket-write-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-write-error.js) - [parallel/test-net-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-stream.js) -- [parallel/test-net-sync-cork.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-sync-cork.js) - [parallel/test-net-throttle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-throttle.js) -- [parallel/test-net-writable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-writable.js) - [parallel/test-net-write-after-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-write-after-close.js) - [parallel/test-net-write-after-end-nt.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-write-after-end-nt.js) - [parallel/test-net-write-cb-on-destroy-before-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-write-cb-on-destroy-before-connect.js) -- [parallel/test-net-write-connect-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-write-connect-write.js) -- [parallel/test-net-write-fully-async-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-write-fully-async-buffer.js) -- [parallel/test-net-write-fully-async-hex-string.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-write-fully-async-hex-string.js) -- [parallel/test-net-write-slow.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-write-slow.js) -- [parallel/test-next-tick-domain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-next-tick-domain.js) -- [parallel/test-next-tick-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-next-tick-errors.js) - [parallel/test-no-addons-resolution-condition.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-no-addons-resolution-condition.js) -- [parallel/test-no-node-snapshot.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-no-node-snapshot.js) - [parallel/test-npm-install.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-npm-install.js) - [parallel/test-npm-version.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-npm-version.js) - [parallel/test-openssl-ca-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-openssl-ca-options.js) - [parallel/test-options-binding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-options-binding.js) - [parallel/test-os-checked-function.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-os-checked-function.js) - [parallel/test-os-eol.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-os-eol.js) -- [parallel/test-os-homedir-no-envvar.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-os-homedir-no-envvar.js) - [parallel/test-os-process-priority.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-os-process-priority.js) - [parallel/test-os-userinfo-handles-getter-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-os-userinfo-handles-getter-errors.js) - [parallel/test-path-posix-relative-on-windows.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-path-posix-relative-on-windows.js) - [parallel/test-pending-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pending-deprecation.js) -- [parallel/test-perf-gc-crash.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-perf-gc-crash.js) - [parallel/test-perf-hooks-histogram.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-perf-hooks-histogram.js) - [parallel/test-perf-hooks-resourcetiming.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-perf-hooks-resourcetiming.js) - [parallel/test-perf-hooks-usertiming.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-perf-hooks-usertiming.js) @@ -1898,7 +1530,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-performance-nodetiming.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-performance-nodetiming.js) - [parallel/test-performance-resourcetimingbufferfull.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-performance-resourcetimingbufferfull.js) - [parallel/test-performance-resourcetimingbuffersize.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-performance-resourcetimingbuffersize.js) -- [parallel/test-performanceobserver-gc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-performanceobserver-gc.js) - [parallel/test-performanceobserver.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-performanceobserver.js) - [parallel/test-permission-allow-child-process-cli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-allow-child-process-cli.js) - [parallel/test-permission-allow-worker-cli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-permission-allow-worker-cli.js) @@ -1927,10 +1558,8 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-pipe-file-to-http.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-file-to-http.js) - [parallel/test-pipe-head.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-head.js) - [parallel/test-pipe-outgoing-message-data-emitted-after-ended.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-outgoing-message-data-emitted-after-ended.js) -- [parallel/test-pipe-return-val.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-return-val.js) - [parallel/test-pipe-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-stream.js) - [parallel/test-pipe-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-unref.js) -- [parallel/test-pipe-writev.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-pipe-writev.js) - [parallel/test-policy-crypto-default-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-policy-crypto-default-encoding.js) - [parallel/test-policy-crypto-hash-tampering.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-policy-crypto-hash-tampering.js) - [parallel/test-policy-dependencies.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-policy-dependencies.js) @@ -1950,12 +1579,9 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-primordials-promise.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-primordials-promise.js) - [parallel/test-primordials-regexp.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-primordials-regexp.js) - [parallel/test-priority-queue.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-priority-queue.js) -- [parallel/test-process-abort.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-abort.js) -- [parallel/test-process-argv-0.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-argv-0.js) - [parallel/test-process-assert.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-assert.js) - [parallel/test-process-beforeexit-throw-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-beforeexit-throw-exit.js) - [parallel/test-process-binding-util.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-binding-util.js) -- [parallel/test-process-binding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-binding.js) - [parallel/test-process-chdir-errormessage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-chdir-errormessage.js) - [parallel/test-process-chdir.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-chdir.js) - [parallel/test-process-config.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-config.js) @@ -1963,19 +1589,14 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-process-constrained-memory.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-constrained-memory.js) - [parallel/test-process-cpuUsage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-cpuUsage.js) - [parallel/test-process-dlopen-error-message-crash.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-dlopen-error-message-crash.js) -- [parallel/test-process-dlopen-undefined-exports.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-dlopen-undefined-exports.js) -- [parallel/test-process-domain-segfault.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-domain-segfault.js) - [parallel/test-process-emit-warning-from-native.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-emit-warning-from-native.js) - [parallel/test-process-emit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-emit.js) -- [parallel/test-process-emitwarning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-emitwarning.js) - [parallel/test-process-env-allowed-flags-are-documented.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env-allowed-flags-are-documented.js) -- [parallel/test-process-env-delete.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env-delete.js) - [parallel/test-process-env-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env-deprecation.js) - [parallel/test-process-env-ignore-getter-setter.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env-ignore-getter-setter.js) - [parallel/test-process-env-sideeffects.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env-sideeffects.js) - [parallel/test-process-env-symbols.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env-symbols.js) - [parallel/test-process-env-tz.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env-tz.js) -- [parallel/test-process-env-windows-error-reset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env-windows-error-reset.js) - [parallel/test-process-env.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-env.js) - [parallel/test-process-euid-egid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-euid-egid.js) - [parallel/test-process-exception-capture-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-exception-capture-errors.js) @@ -1997,17 +1618,11 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-process-getactiveresources-track-multiple-timers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-getactiveresources-track-multiple-timers.js) - [parallel/test-process-getactiveresources-track-timer-lifetime.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-getactiveresources-track-timer-lifetime.js) - [parallel/test-process-getactiveresources.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-getactiveresources.js) -- [parallel/test-process-getgroups.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-getgroups.js) -- [parallel/test-process-hrtime-bigint.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-hrtime-bigint.js) - [parallel/test-process-hrtime.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-hrtime.js) - [parallel/test-process-initgroups.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-initgroups.js) - [parallel/test-process-kill-null.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-kill-null.js) -- [parallel/test-process-next-tick.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-next-tick.js) -- [parallel/test-process-no-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-no-deprecation.js) -- [parallel/test-process-ppid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-ppid.js) - [parallel/test-process-prototype.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-prototype.js) - [parallel/test-process-raw-debug.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-raw-debug.js) -- [parallel/test-process-really-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-really-exit.js) - [parallel/test-process-redirect-warnings-env.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-redirect-warnings-env.js) - [parallel/test-process-redirect-warnings.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-redirect-warnings.js) - [parallel/test-process-release.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-release.js) @@ -2021,8 +1636,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-process-umask.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-umask.js) - [parallel/test-process-uncaught-exception-monitor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-uncaught-exception-monitor.js) - [parallel/test-process-versions.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-versions.js) -- [parallel/test-process-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-process-warning.js) -- [parallel/test-promise-handled-rejection-no-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-handled-rejection-no-warning.js) - [parallel/test-promise-hook-create-hook.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-hook-create-hook.js) - [parallel/test-promise-hook-exceptions.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-hook-exceptions.js) - [parallel/test-promise-hook-on-after.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promise-hook-on-after.js) @@ -2044,16 +1657,8 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-promises-warning-on-unhandled-rejection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-promises-warning-on-unhandled-rejection.js) - [parallel/test-queue-microtask-uncaught-asynchooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-queue-microtask-uncaught-asynchooks.js) - [parallel/test-queue-microtask.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-queue-microtask.js) -- [parallel/test-readable-from-iterator-closing.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readable-from-iterator-closing.js) - [parallel/test-readable-from-web-enqueue-then-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readable-from-web-enqueue-then-close.js) -- [parallel/test-readable-from.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readable-from.js) -- [parallel/test-readable-large-hwm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readable-large-hwm.js) -- [parallel/test-readable-single-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readable-single-end.js) - [parallel/test-readline-async-iterators-backpressure.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-async-iterators-backpressure.js) -- [parallel/test-readline-async-iterators-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-async-iterators-destroy.js) -- [parallel/test-readline-async-iterators.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-async-iterators.js) -- [parallel/test-readline-carriage-return-between-chunks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-carriage-return-between-chunks.js) -- [parallel/test-readline-csi.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-csi.js) - [parallel/test-readline-input-onerror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-input-onerror.js) - [parallel/test-readline-interface-no-trailing-newline.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-interface-no-trailing-newline.js) - [parallel/test-readline-interface-recursive-writes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-interface-recursive-writes.js) @@ -2061,8 +1666,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-readline-promises-interface.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-promises-interface.js) - [parallel/test-readline-promises-tab-complete.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-promises-tab-complete.js) - [parallel/test-readline-tab-complete.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-tab-complete.js) -- [parallel/test-ref-unref-return.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-ref-unref-return.js) -- [parallel/test-regression-object-prototype.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-regression-object-prototype.js) - [parallel/test-release-changelog.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-release-changelog.js) - [parallel/test-release-npm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-release-npm.js) - [parallel/test-repl-array-prototype-tempering.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-repl-array-prototype-tempering.js) @@ -2150,13 +1753,9 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js) - [parallel/test-require-extensions-same-filename-as-dir.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-extensions-same-filename-as-dir.js) - [parallel/test-require-invalid-main-no-exports.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-invalid-main-no-exports.js) -- [parallel/test-require-invalid-package.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-invalid-package.js) - [parallel/test-require-json.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-json.js) -- [parallel/test-require-long-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-long-path.js) - [parallel/test-require-mjs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-mjs.js) - [parallel/test-require-node-prefix.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-node-prefix.js) -- [parallel/test-require-nul.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-nul.js) -- [parallel/test-require-process.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-process.js) - [parallel/test-require-resolve.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-resolve.js) - [parallel/test-require-symlink.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-symlink.js) - [parallel/test-require-unicode.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-require-unicode.js) @@ -2197,8 +1796,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-shadow-realm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-shadow-realm.js) - [parallel/test-sigint-infinite-loop.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-sigint-infinite-loop.js) - [parallel/test-signal-args.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-signal-args.js) -- [parallel/test-signal-handler-remove-on-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-signal-handler-remove-on-exit.js) -- [parallel/test-signal-handler.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-signal-handler.js) - [parallel/test-signal-safety.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-signal-safety.js) - [parallel/test-signal-unregister.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-signal-unregister.js) - [parallel/test-single-executable-blob-config-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-single-executable-blob-config-errors.js) @@ -2224,113 +1821,68 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-snapshot-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-warning.js) - [parallel/test-snapshot-weak-reference.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-weak-reference.js) - [parallel/test-snapshot-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-snapshot-worker.js) -- [parallel/test-socket-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-socket-address.js) - [parallel/test-socket-options-invalid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-socket-options-invalid.js) -- [parallel/test-socket-write-after-fin-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-socket-write-after-fin-error.js) - [parallel/test-socket-write-after-fin.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-socket-write-after-fin.js) - [parallel/test-socket-writes-before-passed-to-tls-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-socket-writes-before-passed-to-tls-socket.js) - [parallel/test-socketaddress.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-socketaddress.js) - [parallel/test-source-map-api.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-source-map-api.js) -- [parallel/test-source-map-enable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-source-map-enable.js) -- [parallel/test-spawn-cmd-named-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-spawn-cmd-named-pipe.js) - [parallel/test-stack-size-limit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stack-size-limit.js) - [parallel/test-startup-empty-regexp-statics.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-startup-empty-regexp-statics.js) - [parallel/test-startup-large-pages.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-startup-large-pages.js) - [parallel/test-stdin-child-proc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-child-proc.js) - [parallel/test-stdin-from-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-from-file.js) -- [parallel/test-stdin-hang.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-hang.js) - [parallel/test-stdin-pause-resume-sync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-pause-resume-sync.js) - [parallel/test-stdin-pause-resume.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-pause-resume.js) -- [parallel/test-stdin-pipe-large.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-pipe-large.js) -- [parallel/test-stdin-pipe-resume.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-pipe-resume.js) - [parallel/test-stdin-resume-pause.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-resume-pause.js) -- [parallel/test-stdin-script-child-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-script-child-option.js) - [parallel/test-stdin-script-child.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdin-script-child.js) - [parallel/test-stdio-closed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdio-closed.js) -- [parallel/test-stdio-pipe-access.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdio-pipe-access.js) -- [parallel/test-stdio-pipe-redirect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdio-pipe-redirect.js) -- [parallel/test-stdio-pipe-stderr.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdio-pipe-stderr.js) -- [parallel/test-stdio-undestroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdio-undestroy.js) -- [parallel/test-stdout-cannot-be-closed-child-process-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdout-cannot-be-closed-child-process-pipe.js) - [parallel/test-stdout-close-catch.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdout-close-catch.js) - [parallel/test-stdout-close-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdout-close-unref.js) -- [parallel/test-stdout-pipeline-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdout-pipeline-destroy.js) -- [parallel/test-stdout-stderr-reading.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdout-stderr-reading.js) -- [parallel/test-stdout-stderr-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdout-stderr-write.js) - [parallel/test-stdout-to-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stdout-to-file.js) - [parallel/test-strace-openat-openssl.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-strace-openat-openssl.js) - [parallel/test-stream-base-prototype-accessors-enumerability.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-base-prototype-accessors-enumerability.js) - [parallel/test-stream-base-typechecking.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-base-typechecking.js) -- [parallel/test-stream-catch-rejections.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-catch-rejections.js) - [parallel/test-stream-compose-operator.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-compose-operator.js) - [parallel/test-stream-compose.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-compose.js) - [parallel/test-stream-consumers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-consumers.js) -- [parallel/test-stream-decoder-objectmode.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-decoder-objectmode.js) - [parallel/test-stream-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-destroy.js) - [parallel/test-stream-drop-take.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-drop-take.js) -- [parallel/test-stream-duplex-readable-writable.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-duplex-readable-writable.js) -- [parallel/test-stream-end-of-streams.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-end-of-streams.js) -- [parallel/test-stream-filter.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-filter.js) - [parallel/test-stream-finished.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-finished.js) -- [parallel/test-stream-flatMap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-flatMap.js) -- [parallel/test-stream-forEach.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-forEach.js) - [parallel/test-stream-map.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-map.js) -- [parallel/test-stream-passthrough-drain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-passthrough-drain.js) - [parallel/test-stream-pipe-deadlock.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-pipe-deadlock.js) -- [parallel/test-stream-pipe-error-unhandled.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-pipe-error-unhandled.js) -- [parallel/test-stream-pipeline-duplex.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-pipeline-duplex.js) - [parallel/test-stream-pipeline-http2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-pipeline-http2.js) -- [parallel/test-stream-pipeline-listeners.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-pipeline-listeners.js) - [parallel/test-stream-pipeline-process.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-pipeline-process.js) -- [parallel/test-stream-pipeline-uncaught.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-pipeline-uncaught.js) - [parallel/test-stream-pipeline.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-pipeline.js) - [parallel/test-stream-preprocess.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-preprocess.js) - [parallel/test-stream-promises.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-promises.js) -- [parallel/test-stream-push-order.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-push-order.js) - [parallel/test-stream-readable-async-iterators.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-readable-async-iterators.js) - [parallel/test-stream-readable-default-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-readable-default-encoding.js) - [parallel/test-stream-readable-dispose.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-readable-dispose.js) -- [parallel/test-stream-readable-strategy-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-readable-strategy-option.js) -- [parallel/test-stream-readable-unpipe-resume.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-readable-unpipe-resume.js) -- [parallel/test-stream-reduce.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-reduce.js) - [parallel/test-stream-set-default-hwm.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-set-default-hwm.js) -- [parallel/test-stream-toArray.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-toArray.js) -- [parallel/test-stream-toWeb-allows-server-response.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-toWeb-allows-server-response.js) -- [parallel/test-stream-transform-hwm0.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-transform-hwm0.js) - [parallel/test-stream-wrap-drain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-wrap-drain.js) - [parallel/test-stream-wrap-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-wrap-encoding.js) - [parallel/test-stream-wrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-wrap.js) -- [parallel/test-stream-writable-end-cb-uncaught.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-writable-end-cb-uncaught.js) - [parallel/test-stream-writable-samecb-singletick.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream-writable-samecb-singletick.js) -- [parallel/test-stream2-finish-pipe-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream2-finish-pipe-error.js) - [parallel/test-stream2-httpclient-response-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream2-httpclient-response-end.js) -- [parallel/test-stream3-pipeline-async-iterator.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stream3-pipeline-async-iterator.js) - [parallel/test-string-decoder-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-string-decoder-end.js) - [parallel/test-string-decoder-fuzz.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-string-decoder-fuzz.js) -- [parallel/test-stringbytes-external.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-stringbytes-external.js) - [parallel/test-structuredClone-global.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-structuredClone-global.js) -- [parallel/test-sync-fileread.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-sync-fileread.js) - [parallel/test-sync-io-option.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-sync-io-option.js) -- [parallel/test-sys.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-sys.js) - [parallel/test-tcp-wrap-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tcp-wrap-connect.js) - [parallel/test-tcp-wrap-listen.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tcp-wrap-listen.js) - [parallel/test-tcp-wrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tcp-wrap.js) -- [parallel/test-tick-processor-arguments.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tick-processor-arguments.js) - [parallel/test-tick-processor-version-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tick-processor-version-check.js) - [parallel/test-timer-immediate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timer-immediate.js) - [parallel/test-timers-active.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-active.js) -- [parallel/test-timers-clearImmediate-als.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-clearImmediate-als.js) - [parallel/test-timers-destroyed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-destroyed.js) - [parallel/test-timers-dispose.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-dispose.js) - [parallel/test-timers-enroll-invalid-msecs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-enroll-invalid-msecs.js) - [parallel/test-timers-enroll-second-time.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-enroll-second-time.js) - [parallel/test-timers-immediate-promisified.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-immediate-promisified.js) - [parallel/test-timers-immediate-queue-throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-immediate-queue-throw.js) -- [parallel/test-timers-immediate-queue.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-immediate-queue.js) - [parallel/test-timers-immediate-unref-nested-once.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-immediate-unref-nested-once.js) - [parallel/test-timers-immediate-unref-simple.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-immediate-unref-simple.js) - [parallel/test-timers-immediate-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-immediate-unref.js) -- [parallel/test-timers-immediate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-immediate.js) - [parallel/test-timers-interval-promisified.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-interval-promisified.js) - [parallel/test-timers-linked-list.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-linked-list.js) - [parallel/test-timers-max-duration-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-max-duration-warning.js) @@ -2339,10 +1891,7 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-timers-now.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-now.js) - [parallel/test-timers-ordering.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-ordering.js) - [parallel/test-timers-promises-scheduler.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-promises-scheduler.js) -- [parallel/test-timers-refresh-in-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-refresh-in-callback.js) - [parallel/test-timers-reset-process-domain-on-throw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-reset-process-domain-on-throw.js) -- [parallel/test-timers-setimmediate-infinite-loop.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-setimmediate-infinite-loop.js) -- [parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js) - [parallel/test-timers-this.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-this.js) - [parallel/test-timers-throw-when-cb-not-function.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-throw-when-cb-not-function.js) - [parallel/test-timers-timeout-promisified.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-timeout-promisified.js) @@ -2352,16 +1901,9 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-timers-unref-active.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-unref-active.js) - [parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js) - [parallel/test-timers-unref-remove-other-unref-timers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-unref-remove-other-unref-timers.js) -- [parallel/test-timers-unref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-unref.js) -- [parallel/test-timers-unrefd-interval-still-fires.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-unrefd-interval-still-fires.js) -- [parallel/test-timers-unrefed-in-beforeexit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-unrefed-in-beforeexit.js) -- [parallel/test-timers-unrefed-in-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers-unrefed-in-callback.js) -- [parallel/test-timers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-timers.js) - [parallel/test-tls-0-dns-altname.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-0-dns-altname.js) - [parallel/test-tls-add-context.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-add-context.js) - [parallel/test-tls-addca.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-addca.js) -- [parallel/test-tls-alert-handling.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-alert-handling.js) -- [parallel/test-tls-alert.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-alert.js) - [parallel/test-tls-alpn-server-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-alpn-server-client.js) - [parallel/test-tls-async-cb-after-socket-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-async-cb-after-socket-end.js) - [parallel/test-tls-basic-validations.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-basic-validations.js) @@ -2391,7 +1933,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-tls-client-reject-12.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-reject-12.js) - [parallel/test-tls-client-reject.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-reject.js) - [parallel/test-tls-client-renegotiation-13.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-renegotiation-13.js) -- [parallel/test-tls-client-renegotiation-limit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-renegotiation-limit.js) - [parallel/test-tls-client-resume-12.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-resume-12.js) - [parallel/test-tls-client-resume.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-resume.js) - [parallel/test-tls-client-verify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-client-verify.js) @@ -2419,19 +1960,12 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-tls-destroy-stream-12.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-destroy-stream-12.js) - [parallel/test-tls-destroy-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-destroy-stream.js) - [parallel/test-tls-destroy-whilst-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-destroy-whilst-write.js) -- [parallel/test-tls-dhe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-dhe.js) - [parallel/test-tls-disable-renegotiation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-disable-renegotiation.js) -- [parallel/test-tls-ecdh-auto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-ecdh-auto.js) -- [parallel/test-tls-ecdh-multiple.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-ecdh-multiple.js) -- [parallel/test-tls-ecdh.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-ecdh.js) - [parallel/test-tls-econnreset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-econnreset.js) - [parallel/test-tls-empty-sni-context.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-empty-sni-context.js) - [parallel/test-tls-enable-keylog-cli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-enable-keylog-cli.js) -- [parallel/test-tls-enable-trace-cli.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-enable-trace-cli.js) -- [parallel/test-tls-enable-trace.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-enable-trace.js) - [parallel/test-tls-env-bad-extra-ca.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-env-bad-extra-ca.js) - [parallel/test-tls-env-extra-ca-file-load.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-env-extra-ca-file-load.js) -- [parallel/test-tls-env-extra-ca-no-crypto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-env-extra-ca-no-crypto.js) - [parallel/test-tls-env-extra-ca.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-env-extra-ca.js) - [parallel/test-tls-error-servername.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-error-servername.js) - [parallel/test-tls-exportkeyingmaterial.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-exportkeyingmaterial.js) @@ -2473,7 +2007,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-tls-no-rsa-key.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-no-rsa-key.js) - [parallel/test-tls-no-sslv23.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-no-sslv23.js) - [parallel/test-tls-no-sslv3.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-no-sslv3.js) -- [parallel/test-tls-ocsp-callback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-ocsp-callback.js) - [parallel/test-tls-on-empty-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-on-empty-socket.js) - [parallel/test-tls-onread-static-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-onread-static-buffer.js) - [parallel/test-tls-options-boolean-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-options-boolean-check.js) @@ -2486,7 +2019,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-tls-pfx-authorizationerror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-pfx-authorizationerror.js) - [parallel/test-tls-psk-circuit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-psk-circuit.js) - [parallel/test-tls-psk-errors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-psk-errors.js) -- [parallel/test-tls-psk-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-psk-server.js) - [parallel/test-tls-reduced-SECLEVEL-in-cipher.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-reduced-SECLEVEL-in-cipher.js) - [parallel/test-tls-reinitialize-listeners.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-reinitialize-listeners.js) - [parallel/test-tls-request-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-request-timeout.js) @@ -2497,16 +2029,12 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-tls-secure-session.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-secure-session.js) - [parallel/test-tls-securepair-fiftharg.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-securepair-fiftharg.js) - [parallel/test-tls-securepair-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-securepair-leak.js) -- [parallel/test-tls-securepair-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-securepair-server.js) - [parallel/test-tls-server-capture-rejection.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-server-capture-rejection.js) - [parallel/test-tls-server-connection-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-server-connection-server.js) - [parallel/test-tls-server-failed-handshake-emits-clienterror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-server-failed-handshake-emits-clienterror.js) - [parallel/test-tls-server-parent-constructor-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-server-parent-constructor-options.js) - [parallel/test-tls-server-setoptions-clientcertengine.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-server-setoptions-clientcertengine.js) -- [parallel/test-tls-server-verify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-server-verify.js) -- [parallel/test-tls-session-cache.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-session-cache.js) - [parallel/test-tls-set-ciphers-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-set-ciphers-error.js) -- [parallel/test-tls-set-ciphers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-set-ciphers.js) - [parallel/test-tls-set-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-set-encoding.js) - [parallel/test-tls-set-secure-context.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-set-secure-context.js) - [parallel/test-tls-set-sigalgs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-set-sigalgs.js) @@ -2533,7 +2061,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-tls-tlswrap-segfault-2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-tlswrap-segfault-2.js) - [parallel/test-tls-tlswrap-segfault.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-tlswrap-segfault.js) - [parallel/test-tls-translate-peer-certificate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-translate-peer-certificate.js) -- [parallel/test-tls-transport-destroy-after-own-gc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-transport-destroy-after-own-gc.js) - [parallel/test-tls-use-after-free-regression.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-use-after-free-regression.js) - [parallel/test-tls-wrap-econnreset-localaddress.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-wrap-econnreset-localaddress.js) - [parallel/test-tls-wrap-econnreset-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tls-wrap-econnreset-pipe.js) @@ -2550,8 +2077,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-trace-events-all.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-all.js) - [parallel/test-trace-events-api-worker-disabled.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-api-worker-disabled.js) - [parallel/test-trace-events-api.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-api.js) -- [parallel/test-trace-events-async-hooks-dynamic.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-async-hooks-dynamic.js) -- [parallel/test-trace-events-async-hooks-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-async-hooks-worker.js) - [parallel/test-trace-events-async-hooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-async-hooks.js) - [parallel/test-trace-events-binding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-binding.js) - [parallel/test-trace-events-bootstrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-trace-events-bootstrap.js) @@ -2580,7 +2105,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-tty-stdin-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tty-stdin-pipe.js) - [parallel/test-ttywrap-invalid-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-ttywrap-invalid-fd.js) - [parallel/test-ttywrap-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-ttywrap-stack.js) -- [parallel/test-tz-version.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tz-version.js) - [parallel/test-unhandled-exception-rethrow-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-unhandled-exception-rethrow-error.js) - [parallel/test-unhandled-exception-with-worker-inuse.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-unhandled-exception-with-worker-inuse.js) - [parallel/test-unicode-node-options.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-unicode-node-options.js) @@ -2588,36 +2112,24 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-url-is-url.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-url-is-url.js) - [parallel/test-url-null-char.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-url-null-char.js) - [parallel/test-url-parse-format.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-url-parse-format.js) -- [parallel/test-utf8-scripts.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-utf8-scripts.js) - [parallel/test-util-callbackify.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-util-callbackify.js) - [parallel/test-util-emit-experimental-warning.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-util-emit-experimental-warning.js) -- [parallel/test-util-inspect-getters-accessing-this.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-util-inspect-getters-accessing-this.js) - [parallel/test-util-internal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-util-internal.js) - [parallel/test-util-log.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-util-log.js) -- [parallel/test-util-primordial-monkeypatching.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-util-primordial-monkeypatching.js) - [parallel/test-util-sigint-watchdog.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-util-sigint-watchdog.js) - [parallel/test-util-sleep.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-util-sleep.js) -- [parallel/test-uv-binding-constant.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-uv-binding-constant.js) - [parallel/test-uv-errmap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-uv-errmap.js) - [parallel/test-uv-errno.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-uv-errno.js) -- [parallel/test-uv-unmapped-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-uv-unmapped-exception.js) - [parallel/test-v8-collect-gc-profile-exit-before-stop.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-collect-gc-profile-exit-before-stop.js) - [parallel/test-v8-collect-gc-profile-in-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-collect-gc-profile-in-worker.js) - [parallel/test-v8-collect-gc-profile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-collect-gc-profile.js) -- [parallel/test-v8-coverage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-coverage.js) -- [parallel/test-v8-deserialize-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-deserialize-buffer.js) -- [parallel/test-v8-flag-pool-size-0.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-flag-pool-size-0.js) - [parallel/test-v8-flag-type-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-flag-type-check.js) - [parallel/test-v8-flags.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-flags.js) - [parallel/test-v8-getheapsnapshot-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-getheapsnapshot-twice.js) -- [parallel/test-v8-global-setter.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-global-setter.js) - [parallel/test-v8-serdes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-serdes.js) - [parallel/test-v8-serialize-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-serialize-leak.js) - [parallel/test-v8-startup-snapshot-api.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-startup-snapshot-api.js) - [parallel/test-v8-stats.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-stats.js) -- [parallel/test-v8-stop-coverage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-stop-coverage.js) -- [parallel/test-v8-take-coverage-noop.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-take-coverage-noop.js) -- [parallel/test-v8-take-coverage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-take-coverage.js) - [parallel/test-v8-version-tag.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-version-tag.js) - [parallel/test-validators.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-validators.js) - [parallel/test-vfs.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vfs.js) @@ -2651,7 +2163,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-vm-timeout-escape-promise-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-vm-timeout-escape-promise-module.js) - [parallel/test-warn-sigprof.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-warn-sigprof.js) - [parallel/test-warn-stream-wrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-warn-stream-wrap.js) -- [parallel/test-weakref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-weakref.js) - [parallel/test-webcrypto-constructors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-constructors.js) - [parallel/test-webcrypto-cryptokey-workers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-cryptokey-workers.js) - [parallel/test-webcrypto-derivebits-cfrg.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-derivebits-cfrg.js) @@ -2664,7 +2175,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-webcrypto-digest.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-digest.js) - [parallel/test-webcrypto-encrypt-decrypt-aes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-encrypt-decrypt-aes.js) - [parallel/test-webcrypto-encrypt-decrypt-rsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-encrypt-decrypt-rsa.js) -- [parallel/test-webcrypto-encrypt-decrypt.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-encrypt-decrypt.js) - [parallel/test-webcrypto-export-import-cfrg.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-export-import-cfrg.js) - [parallel/test-webcrypto-export-import-ec.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-export-import-ec.js) - [parallel/test-webcrypto-export-import-rsa.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-export-import-rsa.js) @@ -2679,10 +2189,8 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-webcrypto-util.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-util.js) - [parallel/test-webcrypto-webidl.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-webidl.js) - [parallel/test-webcrypto-wrap-unwrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webcrypto-wrap-unwrap.js) -- [parallel/test-websocket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-websocket.js) - [parallel/test-webstream-encoding-inspect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webstream-encoding-inspect.js) - [parallel/test-webstream-readablestream-pipeto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webstream-readablestream-pipeto.js) -- [parallel/test-webstream-string-tag.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webstream-string-tag.js) - [parallel/test-webstreams-abort-controller.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webstreams-abort-controller.js) - [parallel/test-webstreams-compose.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webstreams-compose.js) - [parallel/test-webstreams-finished.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-webstreams-finished.js) @@ -2699,7 +2207,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-whatwg-events-eventtarget-this-of-listener.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-events-eventtarget-this-of-listener.js) - [parallel/test-whatwg-readablebytestream-bad-buffers-and-views.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-readablebytestream-bad-buffers-and-views.js) - [parallel/test-whatwg-readablebytestream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-readablebytestream.js) -- [parallel/test-whatwg-readablebytestreambyob.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-readablebytestreambyob.js) - [parallel/test-whatwg-readablestream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-readablestream.js) - [parallel/test-whatwg-transformstream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-transformstream.js) - [parallel/test-whatwg-url-canparse.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-whatwg-url-canparse.js) @@ -2746,7 +2253,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-worker-broadcastchannel-wpt.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-broadcastchannel-wpt.js) - [parallel/test-worker-broadcastchannel.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-broadcastchannel.js) - [parallel/test-worker-cjs-workerdata.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-cjs-workerdata.js) -- [parallel/test-worker-cleanexit-with-js.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-cleanexit-with-js.js) - [parallel/test-worker-cleanexit-with-moduleload.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-cleanexit-with-moduleload.js) - [parallel/test-worker-cleanup-handles.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-cleanup-handles.js) - [parallel/test-worker-console-listeners.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-console-listeners.js) @@ -2817,7 +2323,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-worker-no-sab.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-no-sab.js) - [parallel/test-worker-no-stdin-stdout-interaction.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-no-stdin-stdout-interaction.js) - [parallel/test-worker-non-fatal-uncaught-exception.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-non-fatal-uncaught-exception.js) -- [parallel/test-worker-on-process-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-on-process-exit.js) - [parallel/test-worker-onmessage-not-a-function.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-onmessage-not-a-function.js) - [parallel/test-worker-onmessage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-onmessage.js) - [parallel/test-worker-parent-port-ref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-parent-port-ref.js) @@ -2826,7 +2331,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-worker-process-env-shared.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-process-env-shared.js) - [parallel/test-worker-process-env.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-process-env.js) - [parallel/test-worker-process-exit-async-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-process-exit-async-module.js) -- [parallel/test-worker-ref-onexit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-ref-onexit.js) - [parallel/test-worker-ref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-ref.js) - [parallel/test-worker-relative-path-double-dot.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-relative-path-double-dot.js) - [parallel/test-worker-relative-path.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-relative-path.js) @@ -2846,7 +2350,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-worker-terminate-ref-public-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-terminate-ref-public-port.js) - [parallel/test-worker-terminate-source-map.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-terminate-source-map.js) - [parallel/test-worker-terminate-timers.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-terminate-timers.js) -- [parallel/test-worker-terminate-unrefed.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-terminate-unrefed.js) - [parallel/test-worker-track-unmanaged-fds.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-track-unmanaged-fds.js) - [parallel/test-worker-type-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-type-check.js) - [parallel/test-worker-uncaught-exception-async.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-worker-uncaught-exception-async.js) @@ -2874,7 +2377,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-zlib-bytes-read.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-bytes-read.js) - [parallel/test-zlib-close-in-ondata.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-close-in-ondata.js) - [parallel/test-zlib-const.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-const.js) -- [parallel/test-zlib-create-raw.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-create-raw.js) - [parallel/test-zlib-deflate-constructors.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-deflate-constructors.js) - [parallel/test-zlib-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-destroy.js) - [parallel/test-zlib-dictionary-fail.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-dictionary-fail.js) @@ -2883,7 +2385,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-zlib-flush-drain-longblock.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-flush-drain-longblock.js) - [parallel/test-zlib-flush-drain.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-flush-drain.js) - [parallel/test-zlib-flush-flags.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-flush-flags.js) -- [parallel/test-zlib-flush-write-sync-interleaved.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-flush-write-sync-interleaved.js) - [parallel/test-zlib-flush.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-flush.js) - [parallel/test-zlib-from-concatenated-gzip.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-from-concatenated-gzip.js) - [parallel/test-zlib-from-gzip-with-trailing-garbage.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js) @@ -2912,9 +2413,7 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [pseudo-tty/test-handle-wrap-hasref-tty.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-handle-wrap-hasref-tty.js) - [pseudo-tty/test-readable-tty-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-readable-tty-keepalive.js) - [pseudo-tty/test-repl-external-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-repl-external-module.js) -- [pseudo-tty/test-set-raw-mode-reset-process-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-set-raw-mode-reset-process-exit.js) - [pseudo-tty/test-set-raw-mode-reset-signal.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-set-raw-mode-reset-signal.js) -- [pseudo-tty/test-set-raw-mode-reset.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-set-raw-mode-reset.js) - [pseudo-tty/test-stderr-stdout-handle-sigwinch.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js) - [pseudo-tty/test-stdin-write.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-stdin-write.js) - [pseudo-tty/test-stdout-read.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-stdout-read.js) @@ -2923,22 +2422,15 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [pseudo-tty/test-trace-sigint.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-trace-sigint.js) - [pseudo-tty/test-tty-color-support.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-tty-color-support.js) - [pseudo-tty/test-tty-isatty.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-tty-isatty.js) -- [pseudo-tty/test-tty-stdin-call-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-tty-stdin-call-end.js) - [pseudo-tty/test-tty-stdout-resize.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-tty-stdout-resize.js) - [pseudo-tty/test-tty-stream-constructors.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-tty-stream-constructors.js) - [pseudo-tty/test-tty-window-size.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-tty-window-size.js) - [pseudo-tty/test-tty-wrap.js](https://github.com/nodejs/node/tree/v20.11.1/test/pseudo-tty/test-tty-wrap.js) - [pummel/test-child-process-spawn-loop.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-child-process-spawn-loop.js) -- [pummel/test-crypto-dh-hash.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-crypto-dh-hash.js) - [pummel/test-crypto-dh-keys.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-crypto-dh-keys.js) -- [pummel/test-crypto-timing-safe-equal-benchmarks.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-crypto-timing-safe-equal-benchmarks.js) -- [pummel/test-dh-regr.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-dh-regr.js) -- [pummel/test-fs-largefile.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-fs-largefile.js) -- [pummel/test-fs-readfile-tostring-fail.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-fs-readfile-tostring-fail.js) - [pummel/test-fs-watch-file-slow.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-fs-watch-file-slow.js) - [pummel/test-fs-watch-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-fs-watch-file.js) - [pummel/test-fs-watch-non-recursive.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-fs-watch-non-recursive.js) -- [pummel/test-fs-watch-system-limit.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-fs-watch-system-limit.js) - [pummel/test-hash-seed.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-hash-seed.js) - [pummel/test-heapdump-dns.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapdump-dns.js) - [pummel/test-heapdump-env.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapdump-env.js) @@ -2949,7 +2441,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [pummel/test-heapdump-tls.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapdump-tls.js) - [pummel/test-heapdump-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapdump-worker.js) - [pummel/test-heapdump-zlib.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapdump-zlib.js) -- [pummel/test-heapsnapshot-near-heap-limit-big.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapsnapshot-near-heap-limit-big.js) - [pummel/test-heapsnapshot-near-heap-limit-bounded.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapsnapshot-near-heap-limit-bounded.js) - [pummel/test-heapsnapshot-near-heap-limit-by-api.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapsnapshot-near-heap-limit-by-api.js) - [pummel/test-heapsnapshot-near-heap-limit.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-heapsnapshot-near-heap-limit.js) @@ -2958,9 +2449,7 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [pummel/test-https-large-response.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-https-large-response.js) - [pummel/test-https-no-reader.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-https-no-reader.js) - [pummel/test-keep-alive.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-keep-alive.js) -- [pummel/test-net-many-clients.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-net-many-clients.js) - [pummel/test-net-pause.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-net-pause.js) -- [pummel/test-net-pingpong-delay.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-net-pingpong-delay.js) - [pummel/test-net-pingpong.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-net-pingpong.js) - [pummel/test-net-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-net-timeout.js) - [pummel/test-net-timeout2.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-net-timeout2.js) @@ -2973,10 +2462,8 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [pummel/test-policy-integrity-worker-commonjs.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-policy-integrity-worker-commonjs.js) - [pummel/test-policy-integrity-worker-module.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-policy-integrity-worker-module.js) - [pummel/test-policy-integrity-worker-no-package-json.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-policy-integrity-worker-no-package-json.js) -- [pummel/test-process-cpuUsage.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-process-cpuUsage.js) - [pummel/test-process-hrtime.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-process-hrtime.js) - [pummel/test-regress-GH-892.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-regress-GH-892.js) -- [pummel/test-stream-pipe-multi.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-stream-pipe-multi.js) - [pummel/test-timers.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-timers.js) - [pummel/test-tls-server-large-request.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-tls-server-large-request.js) - [pummel/test-tls-throttle.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-tls-throttle.js) @@ -2986,7 +2473,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [pummel/test-webcrypto-derivebits-pbkdf2.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-webcrypto-derivebits-pbkdf2.js) - [pummel/test-worker-take-heapsnapshot.js](https://github.com/nodejs/node/tree/v20.11.1/test/pummel/test-worker-take-heapsnapshot.js) - [sequential/test-async-wrap-getasyncid.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-async-wrap-getasyncid.js) -- [sequential/test-buffer-creation-regression.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-buffer-creation-regression.js) - [sequential/test-child-process-emfile.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-child-process-emfile.js) - [sequential/test-child-process-execsync.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-child-process-execsync.js) - [sequential/test-child-process-pass-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-child-process-pass-fd.js) @@ -3038,7 +2524,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [sequential/test-http-max-sockets.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http-max-sockets.js) - [sequential/test-http-regr-gh-2928.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http-regr-gh-2928.js) - [sequential/test-http-server-keep-alive-timeout-slow-client-headers.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http-server-keep-alive-timeout-slow-client-headers.js) -- [sequential/test-http-server-keep-alive-timeout-slow-server.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http-server-keep-alive-timeout-slow-server.js) - [sequential/test-http2-large-file.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http2-large-file.js) - [sequential/test-http2-max-session-memory.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http2-max-session-memory.js) - [sequential/test-http2-ping-flood.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-http2-ping-flood.js) @@ -3051,16 +2536,10 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [sequential/test-inspector-port-cluster.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-inspector-port-cluster.js) - [sequential/test-module-loading.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-module-loading.js) - [sequential/test-net-GH-5504.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-GH-5504.js) -- [sequential/test-net-better-error-messages-port.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-better-error-messages-port.js) - [sequential/test-net-connect-econnrefused.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-connect-econnrefused.js) -- [sequential/test-net-connect-handle-econnrefused.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-connect-handle-econnrefused.js) -- [sequential/test-net-connect-local-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-connect-local-error.js) - [sequential/test-net-listen-shared-ports.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-listen-shared-ports.js) - [sequential/test-net-localport.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-localport.js) -- [sequential/test-net-reconnect-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-reconnect-error.js) -- [sequential/test-net-response-size.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-response-size.js) - [sequential/test-net-server-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-server-address.js) -- [sequential/test-net-server-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-net-server-bind.js) - [sequential/test-next-tick-error-spin.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-next-tick-error-spin.js) - [sequential/test-perf-hooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-perf-hooks.js) - [sequential/test-performance-eventloopdelay.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-performance-eventloopdelay.js) @@ -3081,10 +2560,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [sequential/test-timers-block-eventloop.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-timers-block-eventloop.js) - [sequential/test-timers-set-interval-excludes-callback-duration.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-timers-set-interval-excludes-callback-duration.js) - [sequential/test-tls-connect.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-tls-connect.js) -- [sequential/test-tls-lookup.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-tls-lookup.js) -- [sequential/test-tls-psk-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-tls-psk-client.js) -- [sequential/test-tls-securepair-client.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-tls-securepair-client.js) -- [sequential/test-tls-session-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-tls-session-timeout.js) - [sequential/test-util-debug.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-util-debug.js) - [sequential/test-vm-break-on-sigint.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-vm-break-on-sigint.js) - [sequential/test-vm-timeout-escape-promise-module-2.js](https://github.com/nodejs/node/tree/v20.11.1/test/sequential/test-vm-timeout-escape-promise-module-2.js) diff --git a/tests/node_compat/test/abort/test-addon-uv-handle-leak.js b/tests/node_compat/test/abort/test-addon-uv-handle-leak.js new file mode 100644 index 0000000000..618eea481d --- /dev/null +++ b/tests/node_compat/test/abort/test-addon-uv-handle-leak.js @@ -0,0 +1,143 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); +const cp = require('child_process'); +const { spawnSync } = require('child_process'); + +// This is a sibling test to test/addons/uv-handle-leak. + +const bindingPath = path.resolve( + __dirname, '..', 'addons', 'uv-handle-leak', 'build', + `${common.buildType}/binding.node`); + +if (!fs.existsSync(bindingPath)) + common.skip('binding not built yet'); + +if (process.argv[2] === 'child') { + + const { Worker } = require('worker_threads'); + + // The worker thread loads and then unloads `bindingPath`. Because of this the + // symbols in `bindingPath` are lost when the worker thread quits, but the + // number of open handles in the worker thread's event loop is assessed in the + // main thread afterwards, and the names of the callbacks associated with the + // open handles is retrieved at that time as well. Thus, we require + // `bindingPath` here so that the symbols and their names survive the life + // cycle of the worker thread. + require(bindingPath); + + new Worker(` + const binding = require(${JSON.stringify(bindingPath)}); + + binding.leakHandle(); + binding.leakHandle(0); + binding.leakHandle(0x42); + `, { eval: true }); +} else { + const child = cp.spawnSync(process.execPath, [__filename, 'child']); + const stderr = child.stderr.toString(); + + assert.strictEqual(child.stdout.toString(), ''); + + const lines = stderr.split('\n'); + + let state = 'initial'; + + // Parse output that is formatted like this: + + // uv loop at [0x559b65ed5770] has open handles: + // [0x7f2de0018430] timer (active) + // Close callback: 0x7f2df31de220 CloseCallback(uv_handle_s*) [...] + // Data: 0x7f2df33df140 example_instance [...] + // (First field): 0x7f2df33dedc0 vtable for ExampleOwnerClass [...] + // [0x7f2de000b870] timer + // Close callback: 0x7f2df31de220 CloseCallback(uv_handle_s*) [...] + // Data: (nil) + // [0x7f2de000b910] timer + // Close callback: 0x7f2df31de220 CloseCallback(uv_handle_s*) [...] + // Data: 0x42 + // uv loop at [0x559b65ed5770] has 3 open handles in total + + function isGlibc() { + try { + const lddOut = spawnSync('ldd', [process.execPath]).stdout; + const libcInfo = lddOut.toString().split('\n').map( + (line) => line.match(/libc\.so.+=>\s*(\S+)\s/)).filter((info) => info); + if (libcInfo.length === 0) + return false; + const nmOut = spawnSync('nm', ['-D', libcInfo[0][1]]).stdout; + if (/gnu_get_libc_version/.test(nmOut)) + return true; + } catch { + return false; + } + } + + + if (!(common.isFreeBSD || + common.isAIX || + common.isIBMi || + (common.isLinux && !isGlibc()) || + common.isWindows)) { + assert(stderr.includes('ExampleOwnerClass'), stderr); + assert(stderr.includes('CloseCallback'), stderr); + assert(stderr.includes('example_instance'), stderr); + } + + while (lines.length > 0) { + const line = lines.shift().trim(); + if (line.length === 0) { + continue; // Skip empty lines. + } + + switch (state) { + case 'initial': + assert.match(line, /^uv loop at \[.+\] has open handles:$/); + state = 'handle-start'; + break; + case 'handle-start': + if (/^uv loop at \[.+\] has \d+ open handles in total$/.test(line)) { + state = 'source-line'; + break; + } + assert.match(line, /^\[.+\] timer( \(active\))?$/); + state = 'close-callback'; + break; + case 'close-callback': + assert.match(line, /^Close callback:/); + state = 'data'; + break; + case 'data': + assert.match(line, /^Data: .+$/); + state = 'maybe-first-field'; + break; + case 'maybe-first-field': + if (!/^\(First field\)/.test(line)) { + lines.unshift(line); + } + state = 'handle-start'; + break; + case 'source-line': + assert.match(line, /CheckedUvLoopClose/); + state = 'assertion-failure'; + break; + case 'assertion-failure': + assert.match(line, /Assertion failed:/); + state = 'done'; + break; + case 'done': + break; + } + } + + assert.strictEqual(state, 'done'); +} diff --git a/tests/node_compat/test/benchmark/test-benchmark-async-hooks.js b/tests/node_compat/test/benchmark/test-benchmark-async-hooks.js new file mode 100644 index 0000000000..282d1b2fcf --- /dev/null +++ b/tests/node_compat/test/benchmark/test-benchmark-async-hooks.js @@ -0,0 +1,20 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.enoughTestMem) + common.skip('Insufficient memory for async_hooks benchmark test'); + +const runBenchmark = require('../common/benchmark'); + +runBenchmark('async_hooks'); diff --git a/tests/node_compat/test/benchmark/test-benchmark-http.js b/tests/node_compat/test/benchmark/test-benchmark-http.js new file mode 100644 index 0000000000..ee54b6ba37 --- /dev/null +++ b/tests/node_compat/test/benchmark/test-benchmark-http.js @@ -0,0 +1,21 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +if (!common.enoughTestMem) + common.skip('Insufficient memory for HTTP benchmark test'); + +// Because the http benchmarks use hardcoded ports, this should be in sequential +// rather than parallel to make sure it does not conflict with tests that choose +// random available ports. + +const runBenchmark = require('../common/benchmark'); + +runBenchmark('http', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/tests/node_compat/test/benchmark/test-benchmark-http2.js b/tests/node_compat/test/benchmark/test-benchmark-http2.js new file mode 100644 index 0000000000..d880132577 --- /dev/null +++ b/tests/node_compat/test/benchmark/test-benchmark-http2.js @@ -0,0 +1,23 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.enoughTestMem) + common.skip('Insufficient memory for HTTP/2 benchmark test'); + +// Because the http benchmarks use hardcoded ports, this should be in sequential +// rather than parallel to make sure it does not conflict with tests that choose +// random available ports. + +const runBenchmark = require('../common/benchmark'); + +runBenchmark('http2', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/tests/node_compat/test/benchmark/test-benchmark-tls.js b/tests/node_compat/test/benchmark/test-benchmark-tls.js new file mode 100644 index 0000000000..ae97d09872 --- /dev/null +++ b/tests/node_compat/test/benchmark/test-benchmark-tls.js @@ -0,0 +1,24 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.enoughTestMem) + common.skip('Insufficient memory for TLS benchmark test'); + +// Because the TLS benchmarks use hardcoded ports, this should be in sequential +// rather than parallel to make sure it does not conflict with tests that choose +// random available ports. + +const runBenchmark = require('../common/benchmark'); + +runBenchmark('tls', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/tests/node_compat/test/benchmark/test-benchmark-worker.js b/tests/node_compat/test/benchmark/test-benchmark-worker.js new file mode 100644 index 0000000000..ef65c9cc21 --- /dev/null +++ b/tests/node_compat/test/benchmark/test-benchmark-worker.js @@ -0,0 +1,21 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +if (!common.enoughTestMem) + common.skip('Insufficient memory for Worker benchmark test'); + +// Because the worker benchmarks can run on different threads, +// this should be in sequential rather than parallel to make sure +// it does not conflict with tests that choose random available ports. + +const runBenchmark = require('../common/benchmark'); + +runBenchmark('worker', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/tests/node_compat/test/es-module/test-cjs-prototype-pollution.js b/tests/node_compat/test/es-module/test-cjs-prototype-pollution.js new file mode 100644 index 0000000000..8859653f49 --- /dev/null +++ b/tests/node_compat/test/es-module/test-cjs-prototype-pollution.js @@ -0,0 +1,19 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const { mustNotCall, mustCall } = require('../common'); + +Object.defineProperties(Object.prototype, { + then: { + set: mustNotCall('set %Object.prototype%.then'), + get: mustNotCall('get %Object.prototype%.then'), + }, +}); + +import('data:text/javascript,').then(mustCall()); diff --git a/tests/node_compat/test/es-module/test-esm-dynamic-import-mutating-fs.js b/tests/node_compat/test/es-module/test-esm-dynamic-import-mutating-fs.js new file mode 100644 index 0000000000..7e5050a87d --- /dev/null +++ b/tests/node_compat/test/es-module/test-esm-dynamic-import-mutating-fs.js @@ -0,0 +1,29 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const tmpdir = require('../common/tmpdir'); + +const assert = require('node:assert'); +const fs = require('node:fs/promises'); + +tmpdir.refresh(); +const target = tmpdir.fileURL(`${Math.random()}.mjs`); + +(async () => { + + await assert.rejects(import(target), { code: 'ERR_MODULE_NOT_FOUND' }); + + await fs.writeFile(target, 'export default "actual target"\n'); + + const moduleRecord = await import(target); + + await fs.rm(target); + + assert.strictEqual(await import(target), moduleRecord); +})().then(common.mustCall()); diff --git a/tests/node_compat/test/es-module/test-esm-loader-cache-clearing.js b/tests/node_compat/test/es-module/test-esm-loader-cache-clearing.js new file mode 100644 index 0000000000..0f511fc867 --- /dev/null +++ b/tests/node_compat/test/es-module/test-esm-loader-cache-clearing.js @@ -0,0 +1,17 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); + +const { cache } = require; + +Object.keys(cache).forEach((key) => { + delete cache[key]; +}); +// Require the same module again triggers the crash +require('../common'); diff --git a/tests/node_compat/test/es-module/test-esm-windows.js b/tests/node_compat/test/es-module/test-esm-windows.js new file mode 100644 index 0000000000..9150dbc1d9 --- /dev/null +++ b/tests/node_compat/test/es-module/test-esm-windows.js @@ -0,0 +1,54 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// This test ensures that JavaScript file that includes +// a reserved Windows word can be loaded as ESM module + +const common = require('../common'); +const tmpdir = require('../common/tmpdir'); +const assert = require('assert'); +const fs = require('fs').promises; +const path = require('path'); + +const imp = (file) => { + return import(path.relative(__dirname, file).replace(/\\/g, '/')); +}; + +(async () => { + tmpdir.refresh(); + const rel = (file) => tmpdir.resolve(file); + + { // Load a single script + const file = rel('con.mjs'); + await fs.writeFile(file, 'export default "ok"'); + assert.strictEqual((await imp(file)).default, 'ok'); + await fs.unlink(file); + } + + { // Load a module + const entry = rel('entry.mjs'); + const nmDir = rel('node_modules'); + const mDir = rel('node_modules/con'); + const pkg = rel('node_modules/con/package.json'); + const script = rel('node_modules/con/index.mjs'); + + await fs.writeFile(entry, 'export {default} from "con"'); + await fs.mkdir(nmDir); + await fs.mkdir(mDir); + await fs.writeFile(pkg, '{"main":"index.mjs"}'); + await fs.writeFile(script, 'export default "ok"'); + + assert.strictEqual((await imp(entry)).default, 'ok'); + await fs.unlink(script); + await fs.unlink(pkg); + await fs.rmdir(mDir); + await fs.rmdir(nmDir); + await fs.unlink(entry); + } +})().then(common.mustCall()); diff --git a/tests/node_compat/test/es-module/test-vm-compile-function-lineoffset.js b/tests/node_compat/test/es-module/test-vm-compile-function-lineoffset.js new file mode 100644 index 0000000000..d287a3afb6 --- /dev/null +++ b/tests/node_compat/test/es-module/test-vm-compile-function-lineoffset.js @@ -0,0 +1,41 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); + +const assert = require('assert'); +const { compileFunction } = require('node:vm'); + +const min = -2147483648; +const max = 2147483647; + +compileFunction('', [], { lineOffset: min, columnOffset: min }); +compileFunction('', [], { lineOffset: max, columnOffset: max }); + +assert.throws( + () => { + compileFunction('', [], { lineOffset: min - 1, columnOffset: max }); + }, + { + code: 'ERR_OUT_OF_RANGE', + name: 'RangeError', + message: /The value of "options\.lineOffset" is out of range/, + } +); + +assert.throws( + () => { + compileFunction('', [], { lineOffset: min, columnOffset: min - 1 }); + }, + { + code: 'ERR_OUT_OF_RANGE', + name: 'RangeError', + message: /The value of "options\.columnOffset" is out of range/, + } +); diff --git a/tests/node_compat/test/message/eval_messages.js b/tests/node_compat/test/message/eval_messages.js new file mode 100644 index 0000000000..c8e41c9109 --- /dev/null +++ b/tests/node_compat/test/message/eval_messages.js @@ -0,0 +1,60 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +require('../common'); + +const spawn = require('child_process').spawn; + +function run(cmd, strict, cb) { + const args = []; + if (strict) args.push('--use_strict'); + args.push('-pe', cmd); + const child = spawn(process.execPath, args); + child.stdout.pipe(process.stdout); + child.stderr.pipe(process.stdout); + child.on('close', cb); +} + +const queue = + [ 'with(this){__filename}', + '42', + 'throw new Error("hello")', + 'var x = 100; y = x;', + 'var ______________________________________________; throw 10' ]; + +function go() { + const c = queue.shift(); + if (!c) return console.log('done'); + run(c, false, function() { + run(c, true, go); + }); +} + +go(); diff --git a/tests/node_compat/test/message/max_tick_depth.js b/tests/node_compat/test/message/max_tick_depth.js new file mode 100644 index 0000000000..5a2afb5967 --- /dev/null +++ b/tests/node_compat/test/message/max_tick_depth.js @@ -0,0 +1,38 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); + +process.maxTickDepth = 10; +let i = 20; +process.nextTick(function f() { + console.error(`tick ${i}`); + if (i-- > 0) + process.nextTick(f); +}); diff --git a/tests/node_compat/test/message/stdin_messages.js b/tests/node_compat/test/message/stdin_messages.js new file mode 100644 index 0000000000..15911b6999 --- /dev/null +++ b/tests/node_compat/test/message/stdin_messages.js @@ -0,0 +1,61 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +require('../common'); + +const spawn = require('child_process').spawn; + +function run(cmd, strict, cb) { + const args = []; + if (strict) args.push('--use_strict'); + args.push('-p'); + const child = spawn(process.execPath, args); + child.stdout.pipe(process.stdout); + child.stderr.pipe(process.stdout); + child.stdin.end(cmd); + child.on('close', cb); +} + +const queue = + [ 'with(this){__filename}', + '42', + 'throw new Error("hello")', + 'let x = 100; y = x;', + 'let ______________________________________________; throw 10' ]; + +function go() { + const c = queue.shift(); + if (!c) return console.log('done'); + run(c, false, function() { + run(c, true, go); + }); +} + +go(); diff --git a/tests/node_compat/test/message/util_inspect_error.js b/tests/node_compat/test/message/util_inspect_error.js new file mode 100644 index 0000000000..d3aad09fcd --- /dev/null +++ b/tests/node_compat/test/message/util_inspect_error.js @@ -0,0 +1,19 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const util = require('util'); + +const err = new Error('foo\nbar'); + +console.log(util.inspect({ err, nested: { err } }, { compact: true })); +console.log(util.inspect({ err, nested: { err } }, { compact: false })); + +err.foo = 'bar'; +console.log(util.inspect(err, { compact: true, breakLength: 5 })); diff --git a/tests/node_compat/test/parallel/test-arm-math-illegal-instruction.js b/tests/node_compat/test/parallel/test-arm-math-illegal-instruction.js new file mode 100644 index 0000000000..9eccee9887 --- /dev/null +++ b/tests/node_compat/test/parallel/test-arm-math-illegal-instruction.js @@ -0,0 +1,22 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); + +// This test ensures Math functions don't fail with an "illegal instruction" +// error on ARM devices (primarily on the Raspberry Pi 1) +// See https://github.com/nodejs/node/issues/1376 +// and https://code.google.com/p/v8/issues/detail?id=4019 + +// Iterate over all Math functions +Object.getOwnPropertyNames(Math).forEach((functionName) => { + if (!/[A-Z]/.test(functionName)) { + // The function names don't have capital letters. + Math[functionName](-0.5); + } +}); diff --git a/tests/node_compat/test/parallel/test-async-hooks-run-in-async-scope-caught-exception.js b/tests/node_compat/test/parallel/test-async-hooks-run-in-async-scope-caught-exception.js new file mode 100644 index 0000000000..17e1e35a87 --- /dev/null +++ b/tests/node_compat/test/parallel/test-async-hooks-run-in-async-scope-caught-exception.js @@ -0,0 +1,18 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const { AsyncResource } = require('async_hooks'); + +try { + new AsyncResource('foo').runInAsyncScope(() => { throw new Error('bar'); }); +} catch { + // Continue regardless of error. +} +// Should abort (fail the case) if async id is not matching. diff --git a/tests/node_compat/test/parallel/test-async-hooks-run-in-async-scope-this-arg.js b/tests/node_compat/test/parallel/test-async-hooks-run-in-async-scope-this-arg.js new file mode 100644 index 0000000000..f6886347fb --- /dev/null +++ b/tests/node_compat/test/parallel/test-async-hooks-run-in-async-scope-this-arg.js @@ -0,0 +1,24 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// Test that passing thisArg to runInAsyncScope() works. + +const common = require('../common'); +const assert = require('assert'); +const { AsyncResource } = require('async_hooks'); + +const thisArg = {}; + +const res = new AsyncResource('fhqwhgads'); + +function callback() { + assert.strictEqual(this, thisArg); +} + +res.runInAsyncScope(common.mustCall(callback), thisArg); diff --git a/tests/node_compat/test/parallel/test-async-local-storage-bind.js b/tests/node_compat/test/parallel/test-async-local-storage-bind.js new file mode 100644 index 0000000000..2036c47aa9 --- /dev/null +++ b/tests/node_compat/test/parallel/test-async-local-storage-bind.js @@ -0,0 +1,24 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const { AsyncLocalStorage } = require('async_hooks'); + +[1, false, '', {}, []].forEach((i) => { + assert.throws(() => AsyncLocalStorage.bind(i), { + code: 'ERR_INVALID_ARG_TYPE' + }); +}); + +const fn = common.mustCall(AsyncLocalStorage.bind(() => 123)); +assert.strictEqual(fn(), 123); + +const fn2 = AsyncLocalStorage.bind(common.mustCall((arg) => assert.strictEqual(arg, 'test'))); +fn2('test'); diff --git a/tests/node_compat/test/parallel/test-async-local-storage-contexts.js b/tests/node_compat/test/parallel/test-async-local-storage-contexts.js new file mode 100644 index 0000000000..de31622c14 --- /dev/null +++ b/tests/node_compat/test/parallel/test-async-local-storage-contexts.js @@ -0,0 +1,42 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const assert = require('assert'); +const vm = require('vm'); +const { AsyncLocalStorage } = require('async_hooks'); + +// Regression test for https://github.com/nodejs/node/issues/38781 + +const context = vm.createContext({ + AsyncLocalStorage, + assert +}); + +vm.runInContext(` + const storage = new AsyncLocalStorage() + async function test() { + return storage.run({ test: 'vm' }, async () => { + assert.strictEqual(storage.getStore().test, 'vm'); + await 42; + assert.strictEqual(storage.getStore().test, 'vm'); + }); + } + test() +`, context); + +const storage = new AsyncLocalStorage(); +async function test() { + return storage.run({ test: 'main context' }, async () => { + assert.strictEqual(storage.getStore().test, 'main context'); + await 42; + assert.strictEqual(storage.getStore().test, 'main context'); + }); +} +test(); diff --git a/tests/node_compat/test/parallel/test-async-local-storage-deep-stack.js b/tests/node_compat/test/parallel/test-async-local-storage-deep-stack.js new file mode 100644 index 0000000000..ee51af0eab --- /dev/null +++ b/tests/node_compat/test/parallel/test-async-local-storage-deep-stack.js @@ -0,0 +1,22 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const { AsyncLocalStorage } = require('async_hooks'); + +// Regression test for: https://github.com/nodejs/node/issues/34556 + +const als = new AsyncLocalStorage(); + +const done = common.mustCall(); + +function run(count) { + if (count !== 0) return als.run({}, run, --count); + done(); +} +run(1000); diff --git a/tests/node_compat/test/parallel/test-async-local-storage-http-multiclients.js b/tests/node_compat/test/parallel/test-async-local-storage-http-multiclients.js new file mode 100644 index 0000000000..44e07f4c6b --- /dev/null +++ b/tests/node_compat/test/parallel/test-async-local-storage-http-multiclients.js @@ -0,0 +1,72 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const Countdown = require('../common/countdown'); +const assert = require('assert'); +const { AsyncLocalStorage } = require('async_hooks'); +const http = require('http'); +const cls = new AsyncLocalStorage(); +const NUM_CLIENTS = 10; + +// Run multiple clients that receive data from a server +// in multiple chunks, in a single non-closure function. +// Use the AsyncLocalStorage (ALS) APIs to maintain the context +// and data download. Make sure that individual clients +// receive their respective data, with no conflicts. + +// Set up a server that sends large buffers of data, filled +// with cardinal numbers, increasing per request +let index = 0; +const server = http.createServer((q, r) => { + // Send a large chunk as response, otherwise the data + // may be sent in a single chunk, and the callback in the + // client may be called only once, defeating the purpose of test + r.end((index++ % 10).toString().repeat(1024 * 1024)); +}); + +const countdown = new Countdown(NUM_CLIENTS, () => { + server.close(); +}); + +server.listen(0, common.mustCall(() => { + for (let i = 0; i < NUM_CLIENTS; i++) { + cls.run(new Map(), common.mustCall(() => { + const options = { port: server.address().port }; + const req = http.get(options, common.mustCall((res) => { + const store = cls.getStore(); + store.set('data', ''); + + // Make ondata and onend non-closure + // functions and fully dependent on ALS + res.setEncoding('utf8'); + res.on('data', ondata); + res.on('end', common.mustCall(onend)); + })); + req.end(); + })); + } +})); + +// Accumulate the current data chunk with the store data +function ondata(d) { + const store = cls.getStore(); + assert.notStrictEqual(store, undefined); + let chunk = store.get('data'); + chunk += d; + store.set('data', chunk); +} + +// Retrieve the store data, and test for homogeneity +function onend() { + const store = cls.getStore(); + assert.notStrictEqual(store, undefined); + const data = store.get('data'); + assert.strictEqual(data, data[0].repeat(data.length)); + countdown.dec(); +} diff --git a/tests/node_compat/test/parallel/test-async-local-storage-snapshot.js b/tests/node_compat/test/parallel/test-async-local-storage-snapshot.js new file mode 100644 index 0000000000..70fd7aa1c7 --- /dev/null +++ b/tests/node_compat/test/parallel/test-async-local-storage-snapshot.js @@ -0,0 +1,23 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { strictEqual } = require('assert'); +const { AsyncLocalStorage } = require('async_hooks'); + +const asyncLocalStorage = new AsyncLocalStorage(); +const runInAsyncScope = + asyncLocalStorage.run(123, common.mustCall(() => AsyncLocalStorage.snapshot())); +const result = + asyncLocalStorage.run(321, common.mustCall(() => { + return runInAsyncScope(() => { + return asyncLocalStorage.getStore(); + }); + })); +strictEqual(result, 123); diff --git a/tests/node_compat/test/parallel/test-atomics-wake.js b/tests/node_compat/test/parallel/test-atomics-wake.js new file mode 100644 index 0000000000..c7a4eca36a --- /dev/null +++ b/tests/node_compat/test/parallel/test-atomics-wake.js @@ -0,0 +1,14 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const assert = require('assert'); + +// https://github.com/nodejs/node/issues/21219 +assert.strictEqual(Atomics.wake, undefined); diff --git a/tests/node_compat/test/parallel/test-beforeexit-event-exit.js b/tests/node_compat/test/parallel/test-beforeexit-event-exit.js new file mode 100644 index 0000000000..ef8963abf5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-beforeexit-event-exit.js @@ -0,0 +1,34 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const { mustNotCall } = require('../common'); + +process.on('beforeExit', mustNotCall('exit should not allow this to occur')); + +process.exit(); diff --git a/tests/node_compat/test/parallel/test-blob-buffer-too-large.js b/tests/node_compat/test/parallel/test-blob-buffer-too-large.js new file mode 100644 index 0000000000..8ae291fda2 --- /dev/null +++ b/tests/node_compat/test/parallel/test-blob-buffer-too-large.js @@ -0,0 +1,31 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --no-warnings +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const { Blob, kMaxLength } = require('buffer'); + +if (common.isFreeBSD) + common.skip('Oversized buffer make the FreeBSD CI runner crash'); + +try { + new Blob([new Uint8Array(kMaxLength), [1]]); +} catch (e) { + if ( + e.message === 'Array buffer allocation failed' || + e.message === `Invalid typed array length: ${kMaxLength}` + ) { + common.skip( + 'Insufficient memory on this platform for oversized buffer test.' + ); + } else { + assert.strictEqual(e.code, 'ERR_BUFFER_TOO_LARGE'); + } +} diff --git a/tests/node_compat/test/parallel/test-buffer-sharedarraybuffer.js b/tests/node_compat/test/parallel/test-buffer-sharedarraybuffer.js new file mode 100644 index 0000000000..a7e8f03d92 --- /dev/null +++ b/tests/node_compat/test/parallel/test-buffer-sharedarraybuffer.js @@ -0,0 +1,34 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const assert = require('assert'); + +const sab = new SharedArrayBuffer(24); +const arr1 = new Uint16Array(sab); +const arr2 = new Uint16Array(12); +arr2[0] = 5000; +arr1[0] = 5000; +arr1[1] = 4000; +arr2[1] = 4000; + +const arr_buf = Buffer.from(arr1.buffer); +const ar_buf = Buffer.from(arr2.buffer); + +assert.deepStrictEqual(arr_buf, ar_buf); + +arr1[1] = 6000; +arr2[1] = 6000; + +assert.deepStrictEqual(arr_buf, ar_buf); + +// Checks for calling Buffer.byteLength on a SharedArrayBuffer. +assert.strictEqual(Buffer.byteLength(sab), sab.byteLength); + +Buffer.from({ buffer: sab }); // Should not throw. diff --git a/tests/node_compat/test/parallel/test-buffer-write.js b/tests/node_compat/test/parallel/test-buffer-write.js new file mode 100644 index 0000000000..672d5d0bc2 --- /dev/null +++ b/tests/node_compat/test/parallel/test-buffer-write.js @@ -0,0 +1,115 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); + +[-1, 10].forEach((offset) => { + assert.throws( + () => Buffer.alloc(9).write('foo', offset), + { + code: 'ERR_OUT_OF_RANGE', + name: 'RangeError', + message: 'The value of "offset" is out of range. ' + + `It must be >= 0 && <= 9. Received ${offset}` + } + ); +}); + +const resultMap = new Map([ + ['utf8', Buffer.from([102, 111, 111, 0, 0, 0, 0, 0, 0])], + ['ucs2', Buffer.from([102, 0, 111, 0, 111, 0, 0, 0, 0])], + ['ascii', Buffer.from([102, 111, 111, 0, 0, 0, 0, 0, 0])], + ['latin1', Buffer.from([102, 111, 111, 0, 0, 0, 0, 0, 0])], + ['binary', Buffer.from([102, 111, 111, 0, 0, 0, 0, 0, 0])], + ['utf16le', Buffer.from([102, 0, 111, 0, 111, 0, 0, 0, 0])], + ['base64', Buffer.from([102, 111, 111, 0, 0, 0, 0, 0, 0])], + ['base64url', Buffer.from([102, 111, 111, 0, 0, 0, 0, 0, 0])], + ['hex', Buffer.from([102, 111, 111, 0, 0, 0, 0, 0, 0])], +]); + +// utf8, ucs2, ascii, latin1, utf16le +const encodings = ['utf8', 'utf-8', 'ucs2', 'ucs-2', 'ascii', 'latin1', + 'binary', 'utf16le', 'utf-16le']; + +encodings + .reduce((es, e) => es.concat(e, e.toUpperCase()), []) + .forEach((encoding) => { + const buf = Buffer.alloc(9); + const len = Buffer.byteLength('foo', encoding); + assert.strictEqual(buf.write('foo', 0, len, encoding), len); + + if (encoding.includes('-')) + encoding = encoding.replace('-', ''); + + assert.deepStrictEqual(buf, resultMap.get(encoding.toLowerCase())); + }); + +// base64 +['base64', 'BASE64', 'base64url', 'BASE64URL'].forEach((encoding) => { + const buf = Buffer.alloc(9); + const len = Buffer.byteLength('Zm9v', encoding); + + assert.strictEqual(buf.write('Zm9v', 0, len, encoding), len); + assert.deepStrictEqual(buf, resultMap.get(encoding.toLowerCase())); +}); + +// hex +['hex', 'HEX'].forEach((encoding) => { + const buf = Buffer.alloc(9); + const len = Buffer.byteLength('666f6f', encoding); + + assert.strictEqual(buf.write('666f6f', 0, len, encoding), len); + assert.deepStrictEqual(buf, resultMap.get(encoding.toLowerCase())); +}); + +// Invalid encodings +for (let i = 1; i < 10; i++) { + const encoding = String(i).repeat(i); + const error = common.expectsError({ + code: 'ERR_UNKNOWN_ENCODING', + name: 'TypeError', + message: `Unknown encoding: ${encoding}` + }); + + assert.ok(!Buffer.isEncoding(encoding)); + assert.throws(() => Buffer.alloc(9).write('foo', encoding), error); +} + +// UCS-2 overflow CVE-2018-12115 +for (let i = 1; i < 4; i++) { + // Allocate two Buffers sequentially off the pool. Run more than once in case + // we hit the end of the pool and don't get sequential allocations + const x = Buffer.allocUnsafe(4).fill(0); + const y = Buffer.allocUnsafe(4).fill(1); + // Should not write anything, pos 3 doesn't have enough room for a 16-bit char + assert.strictEqual(x.write('ыыыыыы', 3, 'ucs2'), 0); + // CVE-2018-12115 experienced via buffer overrun to next block in the pool + assert.strictEqual(Buffer.compare(y, Buffer.alloc(4, 1)), 0); +} + +// Should not write any data when there is no space for 16-bit chars +const z = Buffer.alloc(4, 0); +assert.strictEqual(z.write('\u0001', 3, 'ucs2'), 0); +assert.strictEqual(Buffer.compare(z, Buffer.alloc(4, 0)), 0); +// Make sure longer strings are written up to the buffer end. +assert.strictEqual(z.write('abcd', 2), 2); +assert.deepStrictEqual([...z], [0, 0, 0x61, 0x62]); + +// Large overrun could corrupt the process +assert.strictEqual(Buffer.alloc(4) + .write('ыыыыыы'.repeat(100), 3, 'utf16le'), 0); + +{ + // .write() does not affect the byte after the written-to slice of the Buffer. + // Refs: https://github.com/nodejs/node/issues/26422 + const buf = Buffer.alloc(8); + assert.strictEqual(buf.write('ыы', 1, 'utf16le'), 4); + assert.deepStrictEqual([...buf], [0, 0x4b, 0x04, 0x4b, 0x04, 0, 0, 0]); +} diff --git a/tests/node_compat/test/parallel/test-child-process-fork3.js b/tests/node_compat/test/parallel/test-child-process-fork3.js new file mode 100644 index 0000000000..cda9098a3b --- /dev/null +++ b/tests/node_compat/test/parallel/test-child-process-fork3.js @@ -0,0 +1,34 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const child_process = require('child_process'); +const fixtures = require('../common/fixtures'); + +child_process.fork(fixtures.path('empty.js')); // should not hang diff --git a/tests/node_compat/test/parallel/test-child-process-send-type-error.js b/tests/node_compat/test/parallel/test-child-process-send-type-error.js new file mode 100644 index 0000000000..0ee7a8c9c3 --- /dev/null +++ b/tests/node_compat/test/parallel/test-child-process-send-type-error.js @@ -0,0 +1,36 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +const assert = require('assert'); +const cp = require('child_process'); + +function fail(proc, args) { + assert.throws(() => { + proc.send.apply(proc, args); + }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' }); +} + +let target = process; + +if (process.argv[2] !== 'child') { + target = cp.fork(__filename, ['child']); + target.on('exit', common.mustCall((code, signal) => { + assert.strictEqual(code, 0); + assert.strictEqual(signal, null); + })); +} + +fail(target, ['msg', null, null]); +fail(target, ['msg', null, '']); +fail(target, ['msg', null, 'foo']); +fail(target, ['msg', null, 0]); +fail(target, ['msg', null, NaN]); +fail(target, ['msg', null, 1]); +fail(target, ['msg', null, null, common.mustNotCall()]); diff --git a/tests/node_compat/test/parallel/test-child-process-stdin-ipc.js b/tests/node_compat/test/parallel/test-child-process-stdin-ipc.js new file mode 100644 index 0000000000..46bfdc7be6 --- /dev/null +++ b/tests/node_compat/test/parallel/test-child-process-stdin-ipc.js @@ -0,0 +1,47 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +const spawn = require('child_process').spawn; + +if (process.argv[2] === 'child') { + // Just reference stdin, it should start it + process.stdin; // eslint-disable-line no-unused-expressions + return; +} + +const proc = spawn(process.execPath, [__filename, 'child'], { + stdio: ['ipc', 'inherit', 'inherit'] +}); + +proc.on('exit', common.mustCall(function(code) { + assert.strictEqual(code, 0); +})); diff --git a/tests/node_compat/test/parallel/test-child-process-stdio-overlapped.js b/tests/node_compat/test/parallel/test-child-process-stdio-overlapped.js new file mode 100644 index 0000000000..9ee17df49f --- /dev/null +++ b/tests/node_compat/test/parallel/test-child-process-stdio-overlapped.js @@ -0,0 +1,86 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Test for "overlapped" stdio option. This test uses the "overlapped-checker" +// helper program which basically a specialized echo program. +// +// The test has two goals: +// +// - Verify that overlapped I/O works on windows. The test program will deadlock +// if stdin doesn't have the FILE_FLAG_OVERLAPPED flag set on startup (see +// test/overlapped-checker/main_win.c for more details). +// - Verify that "overlapped" stdio option works transparently as a pipe (on +// unix/windows) +// +// This is how the test works: +// +// - This script assumes only numeric strings are written to the test program +// stdout. +// - The test program will be spawned with "overlapped" set on stdin and "pipe" +// set on stdout/stderr and at startup writes a number to its stdout +// - When this script receives some data, it will parse the number, add 50 and +// write to the test program's stdin. +// - The test program will then echo the number back to us which will repeat the +// cycle until the number reaches 200, at which point we send the "exit" +// string, which causes the test program to exit. +// - Extra assertion: Every time the test program writes a string to its stdout, +// it will write the number of bytes written to stderr. +// - If overlapped I/O is not setup correctly, this test is going to hang. +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); +const child_process = require('child_process'); + +const exeExtension = process.platform === 'win32' ? '.exe' : ''; +const exe = 'overlapped-checker' + exeExtension; +const exePath = path.join(path.dirname(process.execPath), exe); + +if (!require('fs').existsSync(exePath)) { + common.skip(exe + ' binary is not available'); +} + +const child = child_process.spawn(exePath, [], { + stdio: ['overlapped', 'pipe', 'pipe'] +}); + +child.stdin.setEncoding('utf8'); +child.stdout.setEncoding('utf8'); +child.stderr.setEncoding('utf8'); + +function writeNext(n) { + child.stdin.write((n + 50).toString()); +} + +child.stdout.on('data', (s) => { + const n = Number(s); + if (n >= 200) { + child.stdin.write('exit'); + return; + } + writeNext(n); +}); + +let stderr = ''; +child.stderr.on('data', (s) => { + stderr += s; +}); + +child.stderr.on('end', common.mustCall(() => { + // This is the sequence of numbers sent to us: + // - 0 (1 byte written) + // - 50 (2 bytes written) + // - 100 (3 bytes written) + // - 150 (3 bytes written) + // - 200 (3 bytes written) + assert.strictEqual(stderr, '12333'); +})); + +child.on('exit', common.mustCall((status) => { + // The test program will return the number of writes as status code. + assert.strictEqual(status, 0); +})); diff --git a/tests/node_compat/test/parallel/test-client-request-destroy.js b/tests/node_compat/test/parallel/test-client-request-destroy.js new file mode 100644 index 0000000000..dabdb8c4d3 --- /dev/null +++ b/tests/node_compat/test/parallel/test-client-request-destroy.js @@ -0,0 +1,20 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// Test that http.ClientRequest,prototype.destroy() returns `this`. +require('../common'); + +const assert = require('assert'); +const http = require('http'); +const clientRequest = new http.ClientRequest({ createConnection: () => {} }); + +assert.strictEqual(clientRequest.destroyed, false); +assert.strictEqual(clientRequest.destroy(), clientRequest); +assert.strictEqual(clientRequest.destroyed, true); +assert.strictEqual(clientRequest.destroy(), clientRequest); diff --git a/tests/node_compat/test/parallel/test-cluster-uncaught-exception.js b/tests/node_compat/test/parallel/test-cluster-uncaught-exception.js new file mode 100644 index 0000000000..96a5d26186 --- /dev/null +++ b/tests/node_compat/test/parallel/test-cluster-uncaught-exception.js @@ -0,0 +1,56 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +// Installing a custom uncaughtException handler should override the default +// one that the cluster module installs. +// https://github.com/joyent/node/issues/2556 + +const common = require('../common'); +const assert = require('assert'); +const cluster = require('cluster'); +const fork = require('child_process').fork; + +const MAGIC_EXIT_CODE = 42; + +const isTestRunner = process.argv[2] !== 'child'; + +if (isTestRunner) { + const primary = fork(__filename, ['child']); + primary.on('exit', common.mustCall((code) => { + assert.strictEqual(code, MAGIC_EXIT_CODE); + })); +} else if (cluster.isPrimary) { + process.on('uncaughtException', common.mustCall(() => { + process.nextTick(() => process.exit(MAGIC_EXIT_CODE)); + })); + cluster.fork(); + throw new Error('kill primary'); +} else { // worker + process.exit(); +} diff --git a/tests/node_compat/test/parallel/test-console-assign-undefined.js b/tests/node_compat/test/parallel/test-console-assign-undefined.js new file mode 100644 index 0000000000..f19fb5c1f7 --- /dev/null +++ b/tests/node_compat/test/parallel/test-console-assign-undefined.js @@ -0,0 +1,35 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// Patch global.console before importing modules that may modify the console +// object. + +const tmp = global.console; +global.console = 42; + +require('../common'); +const assert = require('assert'); + +// Originally the console had a getter. Test twice to verify it had no side +// effect. +assert.strictEqual(global.console, 42); +assert.strictEqual(global.console, 42); + +assert.throws( + () => console.log('foo'), + { name: 'TypeError' } +); + +global.console = 1; +assert.strictEqual(global.console, 1); +assert.strictEqual(console, 1); + +// Reset the console +global.console = tmp; +console.log('foo'); diff --git a/tests/node_compat/test/parallel/test-console-formatTime.js b/tests/node_compat/test/parallel/test-console-formatTime.js new file mode 100644 index 0000000000..3ab6e9ca8a --- /dev/null +++ b/tests/node_compat/test/parallel/test-console-formatTime.js @@ -0,0 +1,21 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +// Flags: --expose-internals +require('../common'); +const { formatTime } = require('internal/console/constructor'); +const assert = require('assert'); + +assert.strictEqual(formatTime(100.0096), '100.01ms'); +assert.strictEqual(formatTime(100.0115), '100.011ms'); +assert.strictEqual(formatTime(1500.04), '1.500s'); +assert.strictEqual(formatTime(1000.056), '1.000s'); +assert.strictEqual(formatTime(60300.3), '1:00.300 (m:ss.mmm)'); +assert.strictEqual(formatTime(4000457.4), '1:06:40.457 (h:mm:ss.mmm)'); +assert.strictEqual(formatTime(3601310.4), '1:00:01.310 (h:mm:ss.mmm)'); +assert.strictEqual(formatTime(3213601017.6), '892:40:01.018 (h:mm:ss.mmm)'); diff --git a/tests/node_compat/test/parallel/test-console-not-call-toString.js b/tests/node_compat/test/parallel/test-console-not-call-toString.js new file mode 100644 index 0000000000..fd7416dc2d --- /dev/null +++ b/tests/node_compat/test/parallel/test-console-not-call-toString.js @@ -0,0 +1,41 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); + +function func() {} +let toStringCalled = false; +func.toString = function() { + toStringCalled = true; +}; + +require('util').inspect(func); + +assert.ok(!toStringCalled); diff --git a/tests/node_compat/test/parallel/test-console-self-assign.js b/tests/node_compat/test/parallel/test-console-self-assign.js new file mode 100644 index 0000000000..780bbfa81c --- /dev/null +++ b/tests/node_compat/test/parallel/test-console-self-assign.js @@ -0,0 +1,13 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); + +// Assigning to itself should not throw. +global.console = global.console; // eslint-disable-line no-self-assign diff --git a/tests/node_compat/test/parallel/test-crypto-dh-errors.js b/tests/node_compat/test/parallel/test-crypto-dh-errors.js new file mode 100644 index 0000000000..73224a715c --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-dh-errors.js @@ -0,0 +1,118 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const crypto = require('crypto'); + +// https://github.com/nodejs/node/issues/32738 +// XXX(bnoordhuis) validateInt32() throwing ERR_OUT_OF_RANGE and RangeError +// instead of ERR_INVALID_ARG_TYPE and TypeError is questionable, IMO. +assert.throws(() => crypto.createDiffieHellman(13.37), { + code: 'ERR_OUT_OF_RANGE', + name: 'RangeError', + message: 'The value of "sizeOrKey" is out of range. ' + + 'It must be an integer. Received 13.37', +}); + +assert.throws(() => crypto.createDiffieHellman('abcdef', 13.37), { + code: 'ERR_OUT_OF_RANGE', + name: 'RangeError', + message: 'The value of "generator" is out of range. ' + + 'It must be an integer. Received 13.37', +}); + +for (const bits of [-1, 0, 1]) { + if (common.hasOpenSSL3) { + assert.throws(() => crypto.createDiffieHellman(bits), { + code: 'ERR_OSSL_DH_MODULUS_TOO_SMALL', + name: 'Error', + message: /modulus too small/, + }); + } else { + assert.throws(() => crypto.createDiffieHellman(bits), { + code: 'ERR_OSSL_BN_BITS_TOO_SMALL', + name: 'Error', + message: /bits too small/, + }); + } +} + +for (const g of [-1, 1]) { + const ex = { + code: 'ERR_OSSL_DH_BAD_GENERATOR', + name: 'Error', + message: /bad generator/, + }; + assert.throws(() => crypto.createDiffieHellman('abcdef', g), ex); + assert.throws(() => crypto.createDiffieHellman('abcdef', 'hex', g), ex); +} + +for (const g of [Buffer.from([]), + Buffer.from([0]), + Buffer.from([1])]) { + const ex = { + code: 'ERR_OSSL_DH_BAD_GENERATOR', + name: 'Error', + message: /bad generator/, + }; + assert.throws(() => crypto.createDiffieHellman('abcdef', g), ex); + assert.throws(() => crypto.createDiffieHellman('abcdef', 'hex', g), ex); +} + +[ + [0x1, 0x2], + () => { }, + /abc/, + {}, +].forEach((input) => { + assert.throws( + () => crypto.createDiffieHellman(input), + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + } + ); +}); + +// Invalid test: curve argument is undefined +assert.throws( + () => crypto.createECDH(), + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + message: 'The "curve" argument must be of type string. ' + + 'Received undefined' + }); + +assert.throws( + function() { + crypto.getDiffieHellman('unknown-group'); + }, + { + name: 'Error', + code: 'ERR_CRYPTO_UNKNOWN_DH_GROUP', + message: 'Unknown DH group' + }, + 'crypto.getDiffieHellman(\'unknown-group\') ' + + 'failed to throw the expected error.' +); + +assert.throws( + () => crypto.createDiffieHellman('', true), + { + code: 'ERR_INVALID_ARG_TYPE' + } +); +[true, Symbol(), {}, () => {}, []].forEach((generator) => assert.throws( + () => crypto.createDiffieHellman('', 'base64', generator), + { code: 'ERR_INVALID_ARG_TYPE' } +)); diff --git a/tests/node_compat/test/parallel/test-crypto-dh-odd-key.js b/tests/node_compat/test/parallel/test-crypto-dh-odd-key.js new file mode 100644 index 0000000000..ba5e64f945 --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-dh-odd-key.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const crypto = require('crypto'); + +function test() { + const odd = Buffer.alloc(39, 'A'); + + const c = crypto.createDiffieHellman(common.hasOpenSSL3 ? 1024 : 32); + c.setPrivateKey(odd); + c.generateKeys(); +} + +// FIPS requires a length of at least 1024 +if (!common.hasFipsCrypto) { + test(); +} else { + assert.throws(function() { test(); }, /key size too small/); +} diff --git a/tests/node_compat/test/parallel/test-crypto-domain.js b/tests/node_compat/test/parallel/test-crypto-domain.js new file mode 100644 index 0000000000..e0a7c7f11e --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-domain.js @@ -0,0 +1,56 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const crypto = require('crypto'); +const domain = require('domain'); + +const test = (fn) => { + const ex = new Error('BAM'); + const d = domain.create(); + d.on('error', common.mustCall(function(err) { + assert.strictEqual(err, ex); + })); + const cb = common.mustCall(function() { + throw ex; + }); + d.run(cb); +}; + +test(function(cb) { + crypto.pbkdf2('password', 'salt', 1, 8, cb); +}); + +test(function(cb) { + crypto.randomBytes(32, cb); +}); diff --git a/tests/node_compat/test/parallel/test-crypto-from-binary.js b/tests/node_compat/test/parallel/test-crypto-from-binary.js new file mode 100644 index 0000000000..f1eee30a96 --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-from-binary.js @@ -0,0 +1,72 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +// This is the same as test/simple/test-crypto, but from before the shift +// to use buffers by default. + + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const crypto = require('crypto'); + +const EXTERN_APEX = 0xFBEE9; + +// Manually controlled string for checking binary output +let ucs2_control = 'a\u0000'; + +// Grow the strings to proper length +while (ucs2_control.length <= EXTERN_APEX) { + ucs2_control = ucs2_control.repeat(2); +} + + +// Check resultant buffer and output string +const b = Buffer.from(ucs2_control + ucs2_control, 'ucs2'); + +// +// Test updating from birant data +// +{ + const datum1 = b.slice(700000); + const hash1_converted = crypto.createHash('sha1') + .update(datum1.toString('base64'), 'base64') + .digest('hex'); + const hash1_direct = crypto.createHash('sha1').update(datum1).digest('hex'); + assert.strictEqual(hash1_direct, hash1_converted); + + const datum2 = b; + const hash2_converted = crypto.createHash('sha1') + .update(datum2.toString('base64'), 'base64') + .digest('hex'); + const hash2_direct = crypto.createHash('sha1').update(datum2).digest('hex'); + assert.strictEqual(hash2_direct, hash2_converted); +} diff --git a/tests/node_compat/test/parallel/test-crypto-keygen-dh-classic.js b/tests/node_compat/test/parallel/test-crypto-keygen-dh-classic.js new file mode 100644 index 0000000000..172a91470d --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-keygen-dh-classic.js @@ -0,0 +1,30 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const { + generateKeyPair, +} = require('crypto'); + +// Test classic Diffie-Hellman key generation. +{ + generateKeyPair('dh', { + primeLength: 512 + }, common.mustSucceed((publicKey, privateKey) => { + assert.strictEqual(publicKey.type, 'public'); + assert.strictEqual(publicKey.asymmetricKeyType, 'dh'); + + assert.strictEqual(privateKey.type, 'private'); + assert.strictEqual(privateKey.asymmetricKeyType, 'dh'); + })); +} diff --git a/tests/node_compat/test/parallel/test-crypto-keygen-duplicate-deprecated-option.js b/tests/node_compat/test/parallel/test-crypto-keygen-duplicate-deprecated-option.js new file mode 100644 index 0000000000..300c8d893d --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-keygen-duplicate-deprecated-option.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const { + generateKeyPair, +} = require('crypto'); + +// This test makes sure deprecated and new options may be used +// simultaneously so long as they're identical values. +{ + generateKeyPair('rsa-pss', { + modulusLength: 512, + saltLength: 16, + hash: 'sha256', + hashAlgorithm: 'sha256', + mgf1Hash: 'sha256', + mgf1HashAlgorithm: 'sha256' + }, common.mustSucceed((publicKey, privateKey) => { + assert.strictEqual(publicKey.type, 'public'); + assert.strictEqual(publicKey.asymmetricKeyType, 'rsa-pss'); + assert.deepStrictEqual(publicKey.asymmetricKeyDetails, { + modulusLength: 512, + publicExponent: 65537n, + hashAlgorithm: 'sha256', + mgf1HashAlgorithm: 'sha256', + saltLength: 16 + }); + + assert.strictEqual(privateKey.type, 'private'); + assert.strictEqual(privateKey.asymmetricKeyType, 'rsa-pss'); + assert.deepStrictEqual(privateKey.asymmetricKeyDetails, { + modulusLength: 512, + publicExponent: 65537n, + hashAlgorithm: 'sha256', + mgf1HashAlgorithm: 'sha256', + saltLength: 16 + }); + })); +} diff --git a/tests/node_compat/test/parallel/test-crypto-keygen-empty-passphrase-no-error.js b/tests/node_compat/test/parallel/test-crypto-keygen-empty-passphrase-no-error.js new file mode 100644 index 0000000000..ad6f10931c --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-keygen-empty-passphrase-no-error.js @@ -0,0 +1,36 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const { + generateKeyPair, +} = require('crypto'); + +// Passing an empty passphrase string should not throw ERR_OSSL_CRYPTO_MALLOC_FAILURE even on OpenSSL 3. +// Regression test for https://github.com/nodejs/node/issues/41428. +generateKeyPair('rsa', { + modulusLength: 1024, + publicKeyEncoding: { + type: 'spki', + format: 'pem' + }, + privateKeyEncoding: { + type: 'pkcs8', + format: 'pem', + cipher: 'aes-256-cbc', + passphrase: '' + } +}, common.mustSucceed((publicKey, privateKey) => { + assert.strictEqual(typeof publicKey, 'string'); + assert.strictEqual(typeof privateKey, 'string'); +})); diff --git a/tests/node_compat/test/parallel/test-crypto-keygen-key-objects.js b/tests/node_compat/test/parallel/test-crypto-keygen-key-objects.js new file mode 100644 index 0000000000..e0dba54297 --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-keygen-key-objects.js @@ -0,0 +1,40 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const { + generateKeyPairSync, +} = require('crypto'); + +// Test sync key generation with key objects. +{ + const { publicKey, privateKey } = generateKeyPairSync('rsa', { + modulusLength: 512 + }); + + assert.strictEqual(typeof publicKey, 'object'); + assert.strictEqual(publicKey.type, 'public'); + assert.strictEqual(publicKey.asymmetricKeyType, 'rsa'); + assert.deepStrictEqual(publicKey.asymmetricKeyDetails, { + modulusLength: 512, + publicExponent: 65537n + }); + + assert.strictEqual(typeof privateKey, 'object'); + assert.strictEqual(privateKey.type, 'private'); + assert.strictEqual(privateKey.asymmetricKeyType, 'rsa'); + assert.deepStrictEqual(privateKey.asymmetricKeyDetails, { + modulusLength: 512, + publicExponent: 65537n + }); +} diff --git a/tests/node_compat/test/parallel/test-crypto-keygen-missing-oid.js b/tests/node_compat/test/parallel/test-crypto-keygen-missing-oid.js new file mode 100644 index 0000000000..0d7e0cb693 --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-keygen-missing-oid.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const { + generateKeyPair, + generateKeyPairSync, + getCurves, +} = require('crypto'); + +// This test creates EC key pairs on curves without associated OIDs. +// Specifying a key encoding should not crash. +{ + if (process.versions.openssl >= '1.1.1i') { + for (const namedCurve of ['Oakley-EC2N-3', 'Oakley-EC2N-4']) { + if (!getCurves().includes(namedCurve)) + continue; + + const expectedErrorCode = + common.hasOpenSSL3 ? 'ERR_OSSL_MISSING_OID' : 'ERR_OSSL_EC_MISSING_OID'; + const params = { + namedCurve, + publicKeyEncoding: { + format: 'der', + type: 'spki' + } + }; + + assert.throws(() => { + generateKeyPairSync('ec', params); + }, { + code: expectedErrorCode + }); + + generateKeyPair('ec', params, common.mustCall((err) => { + assert.strictEqual(err.code, expectedErrorCode); + })); + } + } +} diff --git a/tests/node_compat/test/parallel/test-crypto-keygen-non-standard-public-exponent.js b/tests/node_compat/test/parallel/test-crypto-keygen-non-standard-public-exponent.js new file mode 100644 index 0000000000..b769bb2437 --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-keygen-non-standard-public-exponent.js @@ -0,0 +1,42 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const { + generateKeyPairSync, +} = require('crypto'); + +// Test sync key generation with key objects with a non-standard +// publicExponent +{ + const { publicKey, privateKey } = generateKeyPairSync('rsa', { + publicExponent: 3, + modulusLength: 512 + }); + + assert.strictEqual(typeof publicKey, 'object'); + assert.strictEqual(publicKey.type, 'public'); + assert.strictEqual(publicKey.asymmetricKeyType, 'rsa'); + assert.deepStrictEqual(publicKey.asymmetricKeyDetails, { + modulusLength: 512, + publicExponent: 3n + }); + + assert.strictEqual(typeof privateKey, 'object'); + assert.strictEqual(privateKey.type, 'private'); + assert.strictEqual(privateKey.asymmetricKeyType, 'rsa'); + assert.deepStrictEqual(privateKey.asymmetricKeyDetails, { + modulusLength: 512, + publicExponent: 3n + }); +} diff --git a/tests/node_compat/test/parallel/test-crypto-keygen-rfc8017-9-1.js b/tests/node_compat/test/parallel/test-crypto-keygen-rfc8017-9-1.js new file mode 100644 index 0000000000..2019f03f6a --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-keygen-rfc8017-9-1.js @@ -0,0 +1,39 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const { + generateKeyPair, +} = require('crypto'); + +// RFC 8017, 9.1.: "Assuming that the mask generation function is based on a +// hash function, it is RECOMMENDED that the hash function be the same as the +// one that is applied to the message." +{ + + generateKeyPair('rsa-pss', { + modulusLength: 512, + hashAlgorithm: 'sha256', + saltLength: 16 + }, common.mustSucceed((publicKey, privateKey) => { + const expectedKeyDetails = { + modulusLength: 512, + publicExponent: 65537n, + hashAlgorithm: 'sha256', + mgf1HashAlgorithm: 'sha256', + saltLength: 16 + }; + assert.deepStrictEqual(publicKey.asymmetricKeyDetails, expectedKeyDetails); + assert.deepStrictEqual(privateKey.asymmetricKeyDetails, expectedKeyDetails); + })); +} diff --git a/tests/node_compat/test/parallel/test-crypto-keygen-rfc8017-a-2-3.js b/tests/node_compat/test/parallel/test-crypto-keygen-rfc8017-a-2-3.js new file mode 100644 index 0000000000..fe732269a3 --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-keygen-rfc8017-a-2-3.js @@ -0,0 +1,53 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const { + generateKeyPair, +} = require('crypto'); + +// RFC 8017, A.2.3.: "For a given hashAlgorithm, the default value of +// saltLength is the octet length of the hash value." +{ + generateKeyPair('rsa-pss', { + modulusLength: 512, + hashAlgorithm: 'sha512' + }, common.mustSucceed((publicKey, privateKey) => { + const expectedKeyDetails = { + modulusLength: 512, + publicExponent: 65537n, + hashAlgorithm: 'sha512', + mgf1HashAlgorithm: 'sha512', + saltLength: 64 + }; + assert.deepStrictEqual(publicKey.asymmetricKeyDetails, expectedKeyDetails); + assert.deepStrictEqual(privateKey.asymmetricKeyDetails, expectedKeyDetails); + })); + + // It is still possible to explicitly set saltLength to 0. + generateKeyPair('rsa-pss', { + modulusLength: 512, + hashAlgorithm: 'sha512', + saltLength: 0 + }, common.mustSucceed((publicKey, privateKey) => { + const expectedKeyDetails = { + modulusLength: 512, + publicExponent: 65537n, + hashAlgorithm: 'sha512', + mgf1HashAlgorithm: 'sha512', + saltLength: 0 + }; + assert.deepStrictEqual(publicKey.asymmetricKeyDetails, expectedKeyDetails); + assert.deepStrictEqual(privateKey.asymmetricKeyDetails, expectedKeyDetails); + })); +} diff --git a/tests/node_compat/test/parallel/test-crypto-lazy-transform-writable.js b/tests/node_compat/test/parallel/test-crypto-lazy-transform-writable.js new file mode 100644 index 0000000000..af0cf7d688 --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-lazy-transform-writable.js @@ -0,0 +1,43 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const crypto = require('crypto'); +const Stream = require('stream'); + +const hasher1 = crypto.createHash('sha256'); +const hasher2 = crypto.createHash('sha256'); + +// Calculate the expected result. +hasher1.write(Buffer.from('hello world')); +hasher1.end(); + +const expected = hasher1.read().toString('hex'); + +class OldStream extends Stream { + constructor() { + super(); + this.readable = true; + } +} + +const stream = new OldStream(); + +stream.pipe(hasher2).on('finish', common.mustCall(function() { + const hash = hasher2.read().toString('hex'); + assert.strictEqual(hash, expected); +})); + +stream.emit('data', Buffer.from('hello')); +stream.emit('data', Buffer.from(' world')); +stream.emit('end'); diff --git a/tests/node_compat/test/parallel/test-crypto-no-algorithm.js b/tests/node_compat/test/parallel/test-crypto-no-algorithm.js new file mode 100644 index 0000000000..32265ae8e5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-no-algorithm.js @@ -0,0 +1,45 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.hasOpenSSL3) + common.skip('this test requires OpenSSL 3.x'); + +const assert = require('node:assert/strict'); +const crypto = require('node:crypto'); + +if (common.isMainThread) { + // TODO(richardlau): Decide if `crypto.setFips` should error if the + // provider named "fips" is not available. + crypto.setFips(1); + crypto.randomBytes(20, common.mustCall((err) => { + // crypto.randomBytes should either succeed or fail but not hang. + if (err) { + assert.match(err.message, /digital envelope routines::unsupported/); + const expected = /random number generator::unable to fetch drbg/; + assert(err.opensslErrorStack.some((msg) => expected.test(msg)), + `did not find ${expected} in ${err.opensslErrorStack}`); + } + })); +} + +{ + // Startup test. Should not hang. + const { path } = require('../common/fixtures'); + const { spawnSync } = require('node:child_process'); + const baseConf = path('openssl3-conf', 'base_only.cnf'); + const cp = spawnSync(process.execPath, + [ `--openssl-config=${baseConf}`, '-p', '"hello"' ], + { encoding: 'utf8' }); + assert(common.nodeProcessAborted(cp.status, cp.signal), + `process did not abort, code:${cp.status} signal:${cp.signal}`); +} diff --git a/tests/node_compat/test/parallel/test-crypto-op-during-process-exit.js b/tests/node_compat/test/parallel/test-crypto-op-during-process-exit.js new file mode 100644 index 0000000000..2c75cbfcb7 --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-op-during-process-exit.js @@ -0,0 +1,35 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) { common.skip('missing crypto'); } +const assert = require('assert'); +const { generateKeyPair } = require('crypto'); + +if (common.isWindows) { + // Remove this conditional once the libuv change is in Node.js. + common.skip('crashing due to https://github.com/libuv/libuv/pull/2983'); +} + +// Regression test for a race condition: process.exit() might lead to OpenSSL +// cleaning up state from the exit() call via calling its destructor, but +// running OpenSSL operations on another thread might lead to them attempting +// to initialize OpenSSL, leading to a crash. +// This test crashed consistently on x64 Linux on Node v14.9.0. + +generateKeyPair('rsa', { + modulusLength: 2048, + privateKeyEncoding: { + type: 'pkcs1', + format: 'pem' + } +}, (err/* , publicKey, privateKey */) => { + assert.ifError(err); +}); + +setTimeout(() => process.exit(), common.platformTimeout(10)); diff --git a/tests/node_compat/test/parallel/test-crypto-padding-aes256.js b/tests/node_compat/test/parallel/test-crypto-padding-aes256.js new file mode 100644 index 0000000000..812755a95c --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-padding-aes256.js @@ -0,0 +1,67 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const crypto = require('crypto'); + +const iv = Buffer.from('00000000000000000000000000000000', 'hex'); +const key = Buffer.from('0123456789abcdef0123456789abcdef' + + '0123456789abcdef0123456789abcdef', 'hex'); + +function encrypt(val, pad) { + const c = crypto.createCipheriv('aes256', key, iv); + c.setAutoPadding(pad); + return c.update(val, 'utf8', 'latin1') + c.final('latin1'); +} + +function decrypt(val, pad) { + const c = crypto.createDecipheriv('aes256', key, iv); + c.setAutoPadding(pad); + return c.update(val, 'latin1', 'utf8') + c.final('utf8'); +} + +// echo 0123456789abcdef0123456789abcdef \ +// | openssl enc -e -aes256 -nopad -K -iv \ +// | openssl enc -d -aes256 -nopad -K -iv +let plaintext = '0123456789abcdef0123456789abcdef'; // Multiple of block size +let encrypted = encrypt(plaintext, false); +let decrypted = decrypt(encrypted, false); +assert.strictEqual(decrypted, plaintext); + +// echo 0123456789abcdef0123456789abcde \ +// | openssl enc -e -aes256 -K -iv \ +// | openssl enc -d -aes256 -K -iv +plaintext = '0123456789abcdef0123456789abcde'; // not a multiple +encrypted = encrypt(plaintext, true); +decrypted = decrypt(encrypted, true); +assert.strictEqual(decrypted, plaintext); diff --git a/tests/node_compat/test/parallel/test-crypto-psychic-signatures.js b/tests/node_compat/test/parallel/test-crypto-psychic-signatures.js new file mode 100644 index 0000000000..f24d2d8b36 --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-psychic-signatures.js @@ -0,0 +1,107 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); + +const crypto = require('crypto'); + +// Tests for CVE-2022-21449 +// https://neilmadden.blog/2022/04/19/psychic-signatures-in-java/ +// Dubbed "Psychic Signatures", these signatures bypassed the ECDSA signature +// verification implementation in Java in 15, 16, 17, and 18. OpenSSL is not +// (and was not) vulnerable so these are a precaution. + +const vectors = { + 'ieee-p1363': [ + Buffer.from('0000000000000000000000000000000000000000000000000000000000000000' + + '0000000000000000000000000000000000000000000000000000000000000000', 'hex'), + Buffer.from('ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551' + + 'ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551', 'hex'), + ], + 'der': [ + Buffer.from('3046022100' + + '0000000000000000000000000000000000000000000000000000000000000000' + + '022100' + + '0000000000000000000000000000000000000000000000000000000000000000', 'hex'), + Buffer.from('3046022100' + + 'ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551' + + '022100' + + 'ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551', 'hex'), + ], +}; + +const keyPair = crypto.generateKeyPairSync('ec', { + namedCurve: 'P-256', + publicKeyEncoding: { + format: 'der', + type: 'spki' + }, +}); + +const data = Buffer.from('Hello!'); + +for (const [encoding, signatures] of Object.entries(vectors)) { + for (const signature of signatures) { + const key = { + key: keyPair.publicKey, + format: 'der', + type: 'spki', + dsaEncoding: encoding, + }; + + // one-shot sync + assert.strictEqual( + crypto.verify( + 'sha256', + data, + key, + signature, + ), + false, + ); + + // one-shot async + crypto.verify( + 'sha256', + data, + key, + signature, + common.mustSucceed((verified) => assert.strictEqual(verified, false)), + ); + + // stream + assert.strictEqual( + crypto.createVerify('sha256') + .update(data) + .verify(key, signature), + false, + ); + + // webcrypto + globalThis.crypto.subtle.importKey( + 'spki', + keyPair.publicKey, + { name: 'ECDSA', namedCurve: 'P-256' }, + false, + ['verify'], + ).then((publicKey) => { + return globalThis.crypto.subtle.verify( + { name: 'ECDSA', hash: 'SHA-256' }, + publicKey, + signature, + data, + ); + }).then(common.mustCall((verified) => { + assert.strictEqual(verified, false); + })); + } +} diff --git a/tests/node_compat/test/parallel/test-crypto-publicDecrypt-fails-first-time.js b/tests/node_compat/test/parallel/test-crypto-publicDecrypt-fails-first-time.js new file mode 100644 index 0000000000..3248788592 --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-publicDecrypt-fails-first-time.js @@ -0,0 +1,48 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +// Test for https://github.com/nodejs/node/issues/40814 + +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.hasOpenSSL3) + common.skip('only openssl3'); // https://github.com/nodejs/node/pull/42793#issuecomment-1107491901 + +const assert = require('assert'); +const crypto = require('crypto'); + +const { privateKey, publicKey } = crypto.generateKeyPairSync('rsa', { + modulusLength: 2048, + publicKeyEncoding: { + type: 'spki', + format: 'pem' + }, + privateKeyEncoding: { + type: 'pkcs8', + format: 'pem', + cipher: 'aes-128-ecb', + passphrase: 'abcdef' + } +}); +assert.notStrictEqual(privateKey.toString(), ''); + +const msg = 'The quick brown fox jumps over the lazy dog'; + +const encryptedString = crypto.privateEncrypt({ + key: privateKey, + passphrase: 'abcdef' +}, Buffer.from(msg)).toString('base64'); +const decryptedString = crypto.publicDecrypt(publicKey, Buffer.from(encryptedString, 'base64')).toString(); +console.log(`Encrypted: ${encryptedString}`); +console.log(`Decrypted: ${decryptedString}`); + +assert.notStrictEqual(encryptedString, ''); +assert.strictEqual(decryptedString, msg); diff --git a/tests/node_compat/test/parallel/test-crypto-randomfillsync-regression.js b/tests/node_compat/test/parallel/test-crypto-randomfillsync-regression.js new file mode 100644 index 0000000000..e81ec39272 --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-randomfillsync-regression.js @@ -0,0 +1,25 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const { randomFillSync } = require('crypto'); +const { notStrictEqual } = require('assert'); + +const ab = new ArrayBuffer(20); +const buf = Buffer.from(ab, 10); + +const before = buf.toString('hex'); + +randomFillSync(buf); + +const after = buf.toString('hex'); + +notStrictEqual(before, after); diff --git a/tests/node_compat/test/parallel/test-crypto-scrypt.js b/tests/node_compat/test/parallel/test-crypto-scrypt.js new file mode 100644 index 0000000000..427e22537c --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-scrypt.js @@ -0,0 +1,266 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const crypto = require('crypto'); + +const { internalBinding } = require('internal/test/binding'); +if (typeof internalBinding('crypto').ScryptJob !== 'function') + common.skip('no scrypt support'); + +const good = [ + // Zero-length key is legal, functions as a parameter validation check. + { + pass: '', + salt: '', + keylen: 0, + N: 16, + p: 1, + r: 1, + expected: '', + }, + // Test vectors from https://tools.ietf.org/html/rfc7914#page-13 that + // should pass. Note that the test vector with N=1048576 is omitted + // because it takes too long to complete and uses over 1 GiB of memory. + { + pass: '', + salt: '', + keylen: 64, + N: 16, + p: 1, + r: 1, + expected: + '77d6576238657b203b19ca42c18a0497f16b4844e3074ae8dfdffa3fede21442' + + 'fcd0069ded0948f8326a753a0fc81f17e8d3e0fb2e0d3628cf35e20c38d18906', + }, + { + pass: 'password', + salt: 'NaCl', + keylen: 64, + N: 1024, + p: 16, + r: 8, + expected: + 'fdbabe1c9d3472007856e7190d01e9fe7c6ad7cbc8237830e77376634b373162' + + '2eaf30d92e22a3886ff109279d9830dac727afb94a83ee6d8360cbdfa2cc0640', + }, + { + pass: 'pleaseletmein', + salt: 'SodiumChloride', + keylen: 64, + N: 16384, + p: 1, + r: 8, + expected: + '7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2' + + 'd5432955613f0fcf62d49705242a9af9e61e85dc0d651e40dfcf017b45575887', + }, + { + pass: '', + salt: '', + keylen: 64, + cost: 16, + parallelization: 1, + blockSize: 1, + expected: + '77d6576238657b203b19ca42c18a0497f16b4844e3074ae8dfdffa3fede21442' + + 'fcd0069ded0948f8326a753a0fc81f17e8d3e0fb2e0d3628cf35e20c38d18906', + }, + { + pass: 'password', + salt: 'NaCl', + keylen: 64, + cost: 1024, + parallelization: 16, + blockSize: 8, + expected: + 'fdbabe1c9d3472007856e7190d01e9fe7c6ad7cbc8237830e77376634b373162' + + '2eaf30d92e22a3886ff109279d9830dac727afb94a83ee6d8360cbdfa2cc0640', + }, + { + pass: 'pleaseletmein', + salt: 'SodiumChloride', + keylen: 64, + cost: 16384, + parallelization: 1, + blockSize: 8, + expected: + '7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2' + + 'd5432955613f0fcf62d49705242a9af9e61e85dc0d651e40dfcf017b45575887', + }, +]; + +// Test vectors that should fail. +const bad = [ + { N: 1, p: 1, r: 1 }, // N < 2 + { N: 3, p: 1, r: 1 }, // Not power of 2. + { N: 1, cost: 1 }, // Both N and cost + { p: 1, parallelization: 1 }, // Both p and parallelization + { r: 1, blockSize: 1 }, // Both r and blocksize +]; + +// Test vectors where 128*N*r exceeds maxmem. +const toobig = [ + { N: 2 ** 16, p: 1, r: 1 }, // N >= 2**(r*16) + { N: 2, p: 2 ** 30, r: 1 }, // p > (2**30-1)/r + { N: 2 ** 20, p: 1, r: 8 }, + { N: 2 ** 10, p: 1, r: 8, maxmem: 2 ** 20 }, +]; + +const badargs = [ + { + args: [], + expected: { code: 'ERR_INVALID_ARG_TYPE', message: /"password"/ }, + }, + { + args: [null], + expected: { code: 'ERR_INVALID_ARG_TYPE', message: /"password"/ }, + }, + { + args: [''], + expected: { code: 'ERR_INVALID_ARG_TYPE', message: /"salt"/ }, + }, + { + args: ['', null], + expected: { code: 'ERR_INVALID_ARG_TYPE', message: /"salt"/ }, + }, + { + args: ['', ''], + expected: { code: 'ERR_INVALID_ARG_TYPE', message: /"keylen"/ }, + }, + { + args: ['', '', null], + expected: { code: 'ERR_INVALID_ARG_TYPE', message: /"keylen"/ }, + }, + { + args: ['', '', .42], + expected: { code: 'ERR_OUT_OF_RANGE', message: /"keylen"/ }, + }, + { + args: ['', '', -42], + expected: { code: 'ERR_OUT_OF_RANGE', message: /"keylen"/ }, + }, + { + args: ['', '', 2 ** 31], + expected: { code: 'ERR_OUT_OF_RANGE', message: /"keylen"/ }, + }, + { + args: ['', '', 2147485780], + expected: { code: 'ERR_OUT_OF_RANGE', message: /"keylen"/ }, + }, + { + args: ['', '', 2 ** 32], + expected: { code: 'ERR_OUT_OF_RANGE', message: /"keylen"/ }, + }, +]; + +for (const options of good) { + const { pass, salt, keylen, expected } = options; + const actual = crypto.scryptSync(pass, salt, keylen, options); + assert.strictEqual(actual.toString('hex'), expected); + crypto.scrypt(pass, salt, keylen, options, common.mustSucceed((actual) => { + assert.strictEqual(actual.toString('hex'), expected); + })); +} + +for (const options of bad) { + const expected = { + message: /Invalid scrypt param/, + }; + assert.throws(() => crypto.scrypt('pass', 'salt', 1, options, () => {}), + expected); + assert.throws(() => crypto.scryptSync('pass', 'salt', 1, options), + expected); +} + +for (const options of toobig) { + const expected = { + message: /Invalid scrypt param/ + }; + assert.throws(() => crypto.scrypt('pass', 'salt', 1, options, () => {}), + expected); + assert.throws(() => crypto.scryptSync('pass', 'salt', 1, options), + expected); +} + +{ + const defaults = { N: 16384, p: 1, r: 8 }; + const expected = crypto.scryptSync('pass', 'salt', 1, defaults); + const actual = crypto.scryptSync('pass', 'salt', 1); + assert.deepStrictEqual(actual.toString('hex'), expected.toString('hex')); + crypto.scrypt('pass', 'salt', 1, common.mustSucceed((actual) => { + assert.deepStrictEqual(actual.toString('hex'), expected.toString('hex')); + })); +} + +for (const { args, expected } of badargs) { + assert.throws(() => crypto.scrypt(...args), expected); + assert.throws(() => crypto.scryptSync(...args), expected); +} + +{ + const expected = { code: 'ERR_INVALID_ARG_TYPE' }; + assert.throws(() => crypto.scrypt('', '', 42, null), expected); + assert.throws(() => crypto.scrypt('', '', 42, {}, null), expected); + assert.throws(() => crypto.scrypt('', '', 42, {}), expected); + assert.throws(() => crypto.scrypt('', '', 42, {}, {}), expected); +} + +{ + // Values for maxmem that do not fit in 32 bits but that are still safe + // integers should be allowed. + crypto.scrypt('', '', 4, { maxmem: 2 ** 52 }, + common.mustSucceed((actual) => { + assert.strictEqual(actual.toString('hex'), 'd72c87d0'); + })); + + // Values that exceed Number.isSafeInteger should not be allowed. + assert.throws(() => crypto.scryptSync('', '', 0, { maxmem: 2 ** 53 }), { + code: 'ERR_OUT_OF_RANGE' + }); +} + +{ + // Regression test for https://github.com/nodejs/node/issues/28836. + + function testParameter(name, value) { + let accessCount = 0; + + // Find out how often the value is accessed. + crypto.scryptSync('', '', 1, { + get [name]() { + accessCount++; + return value; + } + }); + + // Try to crash the process on the last access. + assert.throws(() => { + crypto.scryptSync('', '', 1, { + get [name]() { + if (--accessCount === 0) + return ''; + return value; + } + }); + }, { + code: 'ERR_INVALID_ARG_TYPE' + }); + } + + [ + ['N', 16384], ['cost', 16384], + ['r', 8], ['blockSize', 8], + ['p', 1], ['parallelization', 1], + ].forEach((arg) => testParameter(...arg)); +} diff --git a/tests/node_compat/test/parallel/test-crypto-subtle-zero-length.js b/tests/node_compat/test/parallel/test-crypto-subtle-zero-length.js new file mode 100644 index 0000000000..7aa73660a5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-crypto-subtle-zero-length.js @@ -0,0 +1,46 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const { subtle } = globalThis.crypto; + +(async () => { + const k = await subtle.importKey( + 'raw', + new Uint8Array(32), + { name: 'AES-GCM' }, + false, + [ 'encrypt', 'decrypt' ]); + assert(k instanceof CryptoKey); + + const e = await subtle.encrypt({ + name: 'AES-GCM', + iv: new Uint8Array(12), + }, k, new Uint8Array(0)); + assert(e instanceof ArrayBuffer); + assert.deepStrictEqual( + Buffer.from(e), + Buffer.from([ + 0x53, 0x0f, 0x8a, 0xfb, 0xc7, 0x45, 0x36, 0xb9, + 0xa9, 0x63, 0xb4, 0xf1, 0xc4, 0xcb, 0x73, 0x8b ])); + + const v = await subtle.decrypt({ + name: 'AES-GCM', + iv: new Uint8Array(12), + }, k, e); + assert(v instanceof ArrayBuffer); + assert.strictEqual(v.byteLength, 0); +})().then(common.mustCall()).catch((e) => { + assert.ifError(e); +}); diff --git a/tests/node_compat/test/parallel/test-dgram-address.js b/tests/node_compat/test/parallel/test-dgram-address.js new file mode 100644 index 0000000000..63e7c9e1ac --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-address.js @@ -0,0 +1,88 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +{ + // IPv4 Test + const socket = dgram.createSocket('udp4'); + + socket.on('listening', common.mustCall(() => { + const address = socket.address(); + + assert.strictEqual(address.address, common.localhostIPv4); + assert.strictEqual(typeof address.port, 'number'); + assert.ok(isFinite(address.port)); + assert.ok(address.port > 0); + assert.strictEqual(address.family, 'IPv4'); + socket.close(); + })); + + socket.on('error', (err) => { + socket.close(); + assert.fail(`Unexpected error on udp4 socket. ${err.toString()}`); + }); + + socket.bind(0, common.localhostIPv4); +} + +if (common.hasIPv6) { + // IPv6 Test + const socket = dgram.createSocket('udp6'); + const localhost = '::1'; + + socket.on('listening', common.mustCall(() => { + const address = socket.address(); + + assert.strictEqual(address.address, localhost); + assert.strictEqual(typeof address.port, 'number'); + assert.ok(isFinite(address.port)); + assert.ok(address.port > 0); + assert.strictEqual(address.family, 'IPv6'); + socket.close(); + })); + + socket.on('error', (err) => { + socket.close(); + assert.fail(`Unexpected error on udp6 socket. ${err.toString()}`); + }); + + socket.bind(0, localhost); +} + +{ + // Verify that address() throws if the socket is not bound. + const socket = dgram.createSocket('udp4'); + + assert.throws(() => { + socket.address(); + }, /^Error: getsockname EBADF$/); +} diff --git a/tests/node_compat/test/parallel/test-dgram-bind-default-address.js b/tests/node_compat/test/parallel/test-dgram-bind-default-address.js new file mode 100644 index 0000000000..ec3ab66a20 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-bind-default-address.js @@ -0,0 +1,60 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +// Skip test in FreeBSD jails since 0.0.0.0 will resolve to default interface +if (common.inFreeBSDJail) + common.skip('In a FreeBSD jail'); + +const assert = require('assert'); +const dgram = require('dgram'); + +dgram.createSocket('udp4').bind(0, common.mustCall(function() { + assert.strictEqual(typeof this.address().port, 'number'); + assert.ok(isFinite(this.address().port)); + assert.ok(this.address().port > 0); + assert.strictEqual(this.address().address, '0.0.0.0'); + this.close(); +})); + +if (!common.hasIPv6) { + common.printSkipMessage('udp6 part of test, because no IPv6 support'); + return; +} + +dgram.createSocket('udp6').bind(0, common.mustCall(function() { + assert.strictEqual(typeof this.address().port, 'number'); + assert.ok(isFinite(this.address().port)); + assert.ok(this.address().port > 0); + let address = this.address().address; + if (address === '::ffff:0.0.0.0') + address = '::'; + assert.strictEqual(address, '::'); + this.close(); +})); diff --git a/tests/node_compat/test/parallel/test-dgram-bind-error-repeat.js b/tests/node_compat/test/parallel/test-dgram-bind-error-repeat.js new file mode 100644 index 0000000000..d03b133bf4 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-bind-error-repeat.js @@ -0,0 +1,34 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const dgram = require('dgram'); + +// Regression test for https://github.com/nodejs/node/issues/30209 +// No warning should be emitted when re-trying `.bind()` on UDP sockets +// repeatedly. + +process.on('warning', common.mustNotCall()); + +const reservePortSocket = dgram.createSocket('udp4'); +reservePortSocket.bind(() => { + const { port } = reservePortSocket.address(); + + const newSocket = dgram.createSocket('udp4'); + + let errors = 0; + newSocket.on('error', common.mustCall(() => { + if (++errors < 20) { + newSocket.bind(port, common.mustNotCall()); + } else { + newSocket.close(); + reservePortSocket.close(); + } + }, 20)); + newSocket.bind(port, common.mustNotCall()); +}); diff --git a/tests/node_compat/test/parallel/test-dgram-bind.js b/tests/node_compat/test/parallel/test-dgram-bind.js new file mode 100644 index 0000000000..010d795f83 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-bind.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +const socket = dgram.createSocket('udp4'); + +socket.on('listening', common.mustCall(() => { + assert.throws(() => { + socket.bind(); + }, { + code: 'ERR_SOCKET_ALREADY_BOUND', + name: 'Error', + message: /^Socket is already bound$/ + }); + + socket.close(); +})); + +const result = socket.bind(); // Should not throw. + +assert.strictEqual(result, socket); // Should have returned itself. diff --git a/tests/node_compat/test/parallel/test-dgram-bytes-length.js b/tests/node_compat/test/parallel/test-dgram-bytes-length.js new file mode 100644 index 0000000000..df2a960803 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-bytes-length.js @@ -0,0 +1,46 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +const message = Buffer.from('Some bytes'); +const client = dgram.createSocket('udp4'); +client.send( + message, + 0, + message.length, + 41234, + 'localhost', + function(err, bytes) { + assert.strictEqual(bytes, message.length); + client.close(); + } +); diff --git a/tests/node_compat/test/parallel/test-dgram-close-in-listening.js b/tests/node_compat/test/parallel/test-dgram-close-in-listening.js new file mode 100644 index 0000000000..fc0827d86f --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-close-in-listening.js @@ -0,0 +1,33 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +// Ensure that if a dgram socket is closed before the sendQueue is drained +// will not crash + +const common = require('../common'); +const dgram = require('dgram'); + +const buf = Buffer.alloc(1024, 42); + +const socket = dgram.createSocket('udp4'); + +socket.on('listening', function() { + socket.close(); +}); + +// Get a random port for send +const portGetter = dgram.createSocket('udp4') + .bind(0, 'localhost', common.mustCall(() => { + // Adds a listener to 'listening' to send the data when + // the socket is available + socket.send(buf, 0, buf.length, + portGetter.address().port, + portGetter.address().address); + + portGetter.close(); + })); diff --git a/tests/node_compat/test/parallel/test-dgram-close-is-not-callback.js b/tests/node_compat/test/parallel/test-dgram-close-is-not-callback.js new file mode 100644 index 0000000000..6af6dcf956 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-close-is-not-callback.js @@ -0,0 +1,28 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const dgram = require('dgram'); + +const buf = Buffer.alloc(1024, 42); + +const socket = dgram.createSocket('udp4'); + +// Get a random port for send +const portGetter = dgram.createSocket('udp4') + .bind(0, 'localhost', common.mustCall(() => { + socket.send(buf, 0, buf.length, + portGetter.address().port, + portGetter.address().address); + + // If close callback is not function, ignore the argument. + socket.close('bad argument'); + portGetter.close(); + + socket.on('close', common.mustCall()); + })); diff --git a/tests/node_compat/test/parallel/test-dgram-close.js b/tests/node_compat/test/parallel/test-dgram-close.js new file mode 100644 index 0000000000..0bd7e78d10 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-close.js @@ -0,0 +1,63 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// Flags: --expose-internals +'use strict'; +// Ensure that if a dgram socket is closed before the DNS lookup completes, it +// won't crash. + +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); +const { kStateSymbol } = require('internal/dgram'); + +const buf = Buffer.alloc(1024, 42); + +let socket = dgram.createSocket('udp4'); +const { handle } = socket[kStateSymbol]; + +// Get a random port for send +const portGetter = dgram.createSocket('udp4') + .bind(0, 'localhost', common.mustCall(() => { + socket.send(buf, 0, buf.length, + portGetter.address().port, + portGetter.address().address); + + assert.strictEqual(socket.close(common.mustCall()), socket); + socket.on('close', common.mustCall()); + socket = null; + + // Verify that accessing handle after closure doesn't throw + setImmediate(function() { + setImmediate(function() { + console.log('Handle fd is: ', handle.fd); + }); + }); + + portGetter.close(); + })); diff --git a/tests/node_compat/test/parallel/test-dgram-connect-send-callback-buffer-length.js b/tests/node_compat/test/parallel/test-dgram-connect-send-callback-buffer-length.js new file mode 100644 index 0000000000..aa8e32eecc --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-connect-send-callback-buffer-length.js @@ -0,0 +1,30 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); + +const dgram = require('dgram'); +const client = dgram.createSocket('udp4'); + +const buf = Buffer.allocUnsafe(256); +const offset = 20; +const len = buf.length - offset; + +const messageSent = common.mustSucceed(function messageSent(bytes) { + assert.notStrictEqual(bytes, buf.length); + assert.strictEqual(bytes, buf.length - offset); + client.close(); +}); + +client.bind(0, common.mustCall(() => { + client.connect(client.address().port, common.mustCall(() => { + client.send(buf, offset, len, messageSent); + })); +})); diff --git a/tests/node_compat/test/parallel/test-dgram-connect-send-callback-buffer.js b/tests/node_compat/test/parallel/test-dgram-connect-send-callback-buffer.js new file mode 100644 index 0000000000..19e01d6af8 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-connect-send-callback-buffer.js @@ -0,0 +1,27 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp4'); + +const buf = Buffer.allocUnsafe(256); + +const onMessage = common.mustSucceed((bytes) => { + assert.strictEqual(bytes, buf.length); + client.close(); +}); + +client.bind(0, common.mustCall(() => { + client.connect(client.address().port, common.mustCall(() => { + client.send(buf, onMessage); + })); +})); diff --git a/tests/node_compat/test/parallel/test-dgram-connect-send-callback-multi-buffer.js b/tests/node_compat/test/parallel/test-dgram-connect-send-callback-multi-buffer.js new file mode 100644 index 0000000000..4f0a19ceab --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-connect-send-callback-multi-buffer.js @@ -0,0 +1,36 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp4'); + +const messageSent = common.mustCall((err, bytes) => { + assert.strictEqual(bytes, buf1.length + buf2.length); +}); + +const buf1 = Buffer.alloc(256, 'x'); +const buf2 = Buffer.alloc(256, 'y'); + +client.on('listening', common.mustCall(() => { + const port = client.address().port; + client.connect(port, common.mustCall(() => { + client.send([buf1, buf2], messageSent); + })); +})); + +client.on('message', common.mustCall((buf, info) => { + const expected = Buffer.concat([buf1, buf2]); + assert.ok(buf.equals(expected), 'message was received correctly'); + client.close(); +})); + +client.bind(0); diff --git a/tests/node_compat/test/parallel/test-dgram-connect-send-default-host.js b/tests/node_compat/test/parallel/test-dgram-connect-send-default-host.js new file mode 100644 index 0000000000..7ca49680d6 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-connect-send-default-host.js @@ -0,0 +1,55 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp4'); +const server = dgram.createSocket('udp4'); + +const toSend = [Buffer.alloc(256, 'x'), + Buffer.alloc(256, 'y'), + Buffer.alloc(256, 'z'), + 'hello']; + +const received = []; + +server.on('listening', common.mustCall(() => { + const port = server.address().port; + client.connect(port, (err) => { + assert.ifError(err); + client.send(toSend[0], 0, toSend[0].length); + client.send(toSend[1]); + client.send([toSend[2]]); + client.send(toSend[3], 0, toSend[3].length); + + client.send(new Uint8Array(toSend[0]), 0, toSend[0].length); + client.send(new Uint8Array(toSend[1])); + client.send([new Uint8Array(toSend[2])]); + client.send(new Uint8Array(Buffer.from(toSend[3])), + 0, toSend[3].length); + }); +})); + +server.on('message', common.mustCall((buf, info) => { + received.push(buf.toString()); + + if (received.length === toSend.length * 2) { + // The replies may arrive out of order -> sort them before checking. + received.sort(); + + const expected = toSend.concat(toSend).map(String).sort(); + assert.deepStrictEqual(received, expected); + client.close(); + server.close(); + } +}, toSend.length * 2)); + +server.bind(0); diff --git a/tests/node_compat/test/parallel/test-dgram-connect-send-empty-array.js b/tests/node_compat/test/parallel/test-dgram-connect-send-empty-array.js new file mode 100644 index 0000000000..a47645c104 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-connect-send-empty-array.js @@ -0,0 +1,29 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp4'); + +client.on('message', common.mustCall((buf, info) => { + const expected = Buffer.alloc(0); + assert.ok(buf.equals(expected), `Expected empty message but got ${buf}`); + client.close(); +})); + +client.on('listening', common.mustCall(() => { + client.connect(client.address().port, + common.localhostIPv4, + common.mustCall(() => client.send([]))); +})); + +client.bind(0); diff --git a/tests/node_compat/test/parallel/test-dgram-connect-send-empty-buffer.js b/tests/node_compat/test/parallel/test-dgram-connect-send-empty-buffer.js new file mode 100644 index 0000000000..17e10aa804 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-connect-send-empty-buffer.js @@ -0,0 +1,27 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp4'); + +client.bind(0, common.mustCall(function() { + const port = this.address().port; + client.connect(port, common.mustCall(() => { + const buf = Buffer.alloc(0); + client.send(buf, 0, 0, common.mustSucceed()); + })); + + client.on('message', common.mustCall((buffer) => { + assert.strictEqual(buffer.length, 0); + client.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-dgram-connect-send-empty-packet.js b/tests/node_compat/test/parallel/test-dgram-connect-send-empty-packet.js new file mode 100644 index 0000000000..8c4d52af82 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-connect-send-empty-packet.js @@ -0,0 +1,35 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp4'); + +client.bind(0, common.mustCall(function() { + client.connect(client.address().port, common.mustCall(() => { + client.on('message', common.mustCall(callback)); + const buf = Buffer.alloc(1); + + const interval = setInterval(function() { + client.send(buf, 0, 0, common.mustCall(callback)); + }, 10); + + function callback(firstArg) { + // If client.send() callback, firstArg should be null. + // If client.on('message') listener, firstArg should be a 0-length buffer. + if (firstArg instanceof Buffer) { + assert.strictEqual(firstArg.length, 0); + clearInterval(interval); + client.close(); + } + } + })); +})); diff --git a/tests/node_compat/test/parallel/test-dgram-connect-send-multi-buffer-copy.js b/tests/node_compat/test/parallel/test-dgram-connect-send-multi-buffer-copy.js new file mode 100644 index 0000000000..e561ffbdca --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-connect-send-multi-buffer-copy.js @@ -0,0 +1,36 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp4'); + +const onMessage = common.mustCall(common.mustSucceed((bytes) => { + assert.strictEqual(bytes, buf1.length + buf2.length); +})); + +const buf1 = Buffer.alloc(256, 'x'); +const buf2 = Buffer.alloc(256, 'y'); + +client.on('listening', common.mustCall(function() { + const toSend = [buf1, buf2]; + client.connect(client.address().port, common.mustCall(() => { + client.send(toSend, onMessage); + })); +})); + +client.on('message', common.mustCall(function onMessage(buf, info) { + const expected = Buffer.concat([buf1, buf2]); + assert.ok(buf.equals(expected), 'message was received correctly'); + client.close(); +})); + +client.bind(0); diff --git a/tests/node_compat/test/parallel/test-dgram-connect-send-multi-string-array.js b/tests/node_compat/test/parallel/test-dgram-connect-send-multi-string-array.js new file mode 100644 index 0000000000..9f94a59b3c --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-connect-send-multi-string-array.js @@ -0,0 +1,24 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); +const socket = dgram.createSocket('udp4'); +const data = ['foo', 'bar', 'baz']; + +socket.on('message', common.mustCall((msg, rinfo) => { + socket.close(); + assert.deepStrictEqual(msg.toString(), data.join('')); +})); + +socket.bind(0, () => { + socket.connect(socket.address().port, common.mustCall(() => { + socket.send(data); + })); +}); diff --git a/tests/node_compat/test/parallel/test-dgram-connect.js b/tests/node_compat/test/parallel/test-dgram-connect.js new file mode 100644 index 0000000000..d6c2df6f46 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-connect.js @@ -0,0 +1,73 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +const PORT = 12345; + +const client = dgram.createSocket('udp4'); +client.connect(PORT, common.mustCall(() => { + const remoteAddr = client.remoteAddress(); + assert.strictEqual(remoteAddr.port, PORT); + assert.throws(() => { + client.connect(PORT, common.mustNotCall()); + }, { + name: 'Error', + message: 'Already connected', + code: 'ERR_SOCKET_DGRAM_IS_CONNECTED' + }); + + client.disconnect(); + assert.throws(() => { + client.disconnect(); + }, { + name: 'Error', + message: 'Not connected', + code: 'ERR_SOCKET_DGRAM_NOT_CONNECTED' + }); + + assert.throws(() => { + client.remoteAddress(); + }, { + name: 'Error', + message: 'Not connected', + code: 'ERR_SOCKET_DGRAM_NOT_CONNECTED' + }); + + client.once('connect', common.mustCall(() => client.close())); + client.connect(PORT); +})); + +assert.throws(() => { + client.connect(PORT); +}, { + name: 'Error', + message: 'Already connected', + code: 'ERR_SOCKET_DGRAM_IS_CONNECTED' +}); + +assert.throws(() => { + client.disconnect(); +}, { + name: 'Error', + message: 'Not connected', + code: 'ERR_SOCKET_DGRAM_NOT_CONNECTED' +}); + +[ 0, null, 78960, undefined ].forEach((port) => { + assert.throws(() => { + client.connect(port); + }, { + name: 'RangeError', + message: /^Port should be > 0 and < 65536/, + code: 'ERR_SOCKET_BAD_PORT' + }); +}); diff --git a/tests/node_compat/test/parallel/test-dgram-createSocket-type.js b/tests/node_compat/test/parallel/test-dgram-createSocket-type.js new file mode 100644 index 0000000000..78f77b5544 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-createSocket-type.js @@ -0,0 +1,68 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); +const invalidTypes = [ + 'test', + ['udp4'], + new String('udp4'), + 1, + {}, + true, + false, + null, + undefined, +]; +const validTypes = [ + 'udp4', + 'udp6', + { type: 'udp4' }, + { type: 'udp6' }, +]; +const errMessage = /^Bad socket type specified\. Valid types are: udp4, udp6$/; + +// Error must be thrown with invalid types +invalidTypes.forEach((invalidType) => { + assert.throws(() => { + dgram.createSocket(invalidType); + }, { + code: 'ERR_SOCKET_BAD_TYPE', + name: 'TypeError', + message: errMessage + }); +}); + +// Error must not be thrown with valid types +validTypes.forEach((validType) => { + const socket = dgram.createSocket(validType); + socket.close(); +}); + +// Ensure buffer sizes can be set +{ + const socket = dgram.createSocket({ + type: 'udp4', + recvBufferSize: 10000, + sendBufferSize: 15000 + }); + + socket.bind(common.mustCall(() => { + // note: linux will double the buffer size + assert.ok(socket.getRecvBufferSize() === 10000 || + socket.getRecvBufferSize() === 20000, + 'SO_RCVBUF not 10000 or 20000, ' + + `was ${socket.getRecvBufferSize()}`); + assert.ok(socket.getSendBufferSize() === 15000 || + socket.getSendBufferSize() === 30000, + 'SO_SNDBUF not 15000 or 30000, ' + + `was ${socket.getRecvBufferSize()}`); + socket.close(); + })); +} diff --git a/tests/node_compat/test/parallel/test-dgram-error-message-address.js b/tests/node_compat/test/parallel/test-dgram-error-message-address.js new file mode 100644 index 0000000000..b8fab2d3cb --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-error-message-address.js @@ -0,0 +1,64 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +// IPv4 Test +const socket_ipv4 = dgram.createSocket('udp4'); + +socket_ipv4.on('listening', common.mustNotCall()); + +socket_ipv4.on('error', common.mustCall(function(e) { + assert.strictEqual(e.port, undefined); + assert.strictEqual(e.message, 'bind EADDRNOTAVAIL 1.1.1.1'); + assert.strictEqual(e.address, '1.1.1.1'); + assert.strictEqual(e.code, 'EADDRNOTAVAIL'); + socket_ipv4.close(); +})); + +socket_ipv4.bind(0, '1.1.1.1'); + +// IPv6 Test +const socket_ipv6 = dgram.createSocket('udp6'); + +socket_ipv6.on('listening', common.mustNotCall()); + +socket_ipv6.on('error', common.mustCall(function(e) { + // EAFNOSUPPORT or EPROTONOSUPPORT means IPv6 is disabled on this system. + const allowed = ['EADDRNOTAVAIL', 'EAFNOSUPPORT', 'EPROTONOSUPPORT']; + assert(allowed.includes(e.code), `'${e.code}' was not one of ${allowed}.`); + assert.strictEqual(e.port, undefined); + assert.strictEqual(e.message, `bind ${e.code} 111::1`); + assert.strictEqual(e.address, '111::1'); + socket_ipv6.close(); +})); + +socket_ipv6.bind(0, '111::1'); diff --git a/tests/node_compat/test/parallel/test-dgram-implicit-bind.js b/tests/node_compat/test/parallel/test-dgram-implicit-bind.js new file mode 100644 index 0000000000..dfafc2d1ac --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-implicit-bind.js @@ -0,0 +1,53 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const dgram = require('dgram'); + +const source = dgram.createSocket('udp4'); +const target = dgram.createSocket('udp4'); +let messages = 0; + +target.on('message', common.mustCall(function(buf) { + if (buf.toString() === 'abc') ++messages; + if (buf.toString() === 'def') ++messages; + if (messages === 2) { + source.close(); + target.close(); + } +}, 2)); + +target.on('listening', common.mustCall(function() { + // Second .send() call should not throw a bind error. + const port = this.address().port; + source.send(Buffer.from('abc'), 0, 3, port, '127.0.0.1'); + source.send(Buffer.from('def'), 0, 3, port, '127.0.0.1'); +})); + +target.bind(0); diff --git a/tests/node_compat/test/parallel/test-dgram-listen-after-bind.js b/tests/node_compat/test/parallel/test-dgram-listen-after-bind.js new file mode 100644 index 0000000000..7cfdd824ea --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-listen-after-bind.js @@ -0,0 +1,52 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +const socket = dgram.createSocket('udp4'); + +socket.bind(); + +let fired = false; +const timer = setTimeout(() => { + socket.close(); +}, 100); + +socket.on('listening', common.mustCall(() => { + clearTimeout(timer); + fired = true; + socket.close(); +})); + +socket.on('close', common.mustCall(() => { + assert(fired, 'listening should fire after bind'); +})); diff --git a/tests/node_compat/test/parallel/test-dgram-msgsize.js b/tests/node_compat/test/parallel/test-dgram-msgsize.js new file mode 100644 index 0000000000..81754f6650 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-msgsize.js @@ -0,0 +1,46 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +// Send a too big datagram. The destination doesn't matter because it's +// not supposed to get sent out anyway. +const buf = Buffer.allocUnsafe(256 * 1024); +const sock = dgram.createSocket('udp4'); +sock.send(buf, 0, buf.length, 12345, '127.0.0.1', common.mustCall(cb)); +function cb(err) { + assert(err instanceof Error); + assert.strictEqual(err.code, 'EMSGSIZE'); + assert.strictEqual(err.address, '127.0.0.1'); + assert.strictEqual(err.port, 12345); + assert.strictEqual(err.message, 'send EMSGSIZE 127.0.0.1:12345'); + sock.close(); +} diff --git a/tests/node_compat/test/parallel/test-dgram-oob-buffer.js b/tests/node_compat/test/parallel/test-dgram-oob-buffer.js new file mode 100644 index 0000000000..af9629c3ac --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-oob-buffer.js @@ -0,0 +1,52 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +// Some operating systems report errors when an UDP message is sent to an +// unreachable host. This error can be reported by sendto() and even by +// recvfrom(). Node should not propagate this error to the user. + +const common = require('../common'); +const dgram = require('dgram'); + +const socket = dgram.createSocket('udp4'); +const buf = Buffer.from([1, 2, 3, 4]); +const portGetter = dgram.createSocket('udp4') + .bind(0, 'localhost', common.mustCall(() => { + const { address, port } = portGetter.address(); + portGetter.close(common.mustCall(() => { + socket.send(buf, 0, 0, port, address, common.mustNotCall()); + socket.send(buf, 0, 4, port, address, common.mustNotCall()); + socket.send(buf, 1, 3, port, address, common.mustNotCall()); + socket.send(buf, 3, 1, port, address, common.mustNotCall()); + // Since length of zero means nothing, don't error despite OOB. + socket.send(buf, 4, 0, port, address, common.mustNotCall()); + + socket.close(); + })); + })); diff --git a/tests/node_compat/test/parallel/test-dgram-recv-error.js b/tests/node_compat/test/parallel/test-dgram-recv-error.js new file mode 100644 index 0000000000..3bbdb300aa --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-recv-error.js @@ -0,0 +1,26 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); +const { kStateSymbol } = require('internal/dgram'); +const s = dgram.createSocket('udp4'); +const { handle } = s[kStateSymbol]; + +s.on('error', common.mustCall((err) => { + s.close(); + + // Don't check the full error message, as the errno is not important here. + assert.match(String(err), /^Error: recvmsg/); + assert.strictEqual(err.syscall, 'recvmsg'); +})); + +s.on('message', common.mustNotCall('no message should be received.')); +s.bind(common.mustCall(() => handle.onmessage(-1, handle, null, null))); diff --git a/tests/node_compat/test/parallel/test-dgram-ref.js b/tests/node_compat/test/parallel/test-dgram-ref.js new file mode 100644 index 0000000000..7cd9200955 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-ref.js @@ -0,0 +1,42 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const dgram = require('dgram'); + +// Should not hang, see https://github.com/nodejs/node-v0.x-archive/issues/1282 +dgram.createSocket('udp4'); +dgram.createSocket('udp6'); + +{ + // Test the case of ref()'ing a socket with no handle. + const s = dgram.createSocket('udp4'); + + s.close(common.mustCall(() => s.ref())); +} diff --git a/tests/node_compat/test/parallel/test-dgram-send-bad-arguments.js b/tests/node_compat/test/parallel/test-dgram-send-bad-arguments.js new file mode 100644 index 0000000000..a99f359663 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-send-bad-arguments.js @@ -0,0 +1,162 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +const buf = Buffer.from('test'); +const host = '127.0.0.1'; +const sock = dgram.createSocket('udp4'); + +function checkArgs(connected) { + // First argument should be a buffer. + assert.throws( + () => { sock.send(); }, + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + message: 'The "buffer" argument must be of type string or an instance ' + + 'of Buffer, TypedArray, or DataView. Received undefined' + } + ); + + // send(buf, offset, length, port, host) + if (connected) { + assert.throws( + () => { sock.send(buf, 1, 1, -1, host); }, + { + code: 'ERR_SOCKET_DGRAM_IS_CONNECTED', + name: 'Error', + message: 'Already connected' + } + ); + + assert.throws( + () => { sock.send(buf, 1, 1, 0, host); }, + { + code: 'ERR_SOCKET_DGRAM_IS_CONNECTED', + name: 'Error', + message: 'Already connected' + } + ); + + assert.throws( + () => { sock.send(buf, 1, 1, 65536, host); }, + { + code: 'ERR_SOCKET_DGRAM_IS_CONNECTED', + name: 'Error', + message: 'Already connected' + } + ); + + assert.throws( + () => { sock.send(buf, 1234, '127.0.0.1', common.mustNotCall()); }, + { + code: 'ERR_SOCKET_DGRAM_IS_CONNECTED', + name: 'Error', + message: 'Already connected' + } + ); + + const longArray = [1, 2, 3, 4, 5, 6, 7, 8]; + for (const input of ['hello', + Buffer.from('hello'), + Buffer.from('hello world').subarray(0, 5), + Buffer.from('hello world').subarray(4, 9), + Buffer.from('hello world').subarray(6), + new Uint8Array([1, 2, 3, 4, 5]), + new Uint8Array(longArray).subarray(0, 5), + new Uint8Array(longArray).subarray(2, 7), + new Uint8Array(longArray).subarray(3), + new DataView(new ArrayBuffer(5), 0), + new DataView(new ArrayBuffer(6), 1), + new DataView(new ArrayBuffer(7), 1, 5)]) { + assert.throws( + () => { sock.send(input, 6, 0); }, + { + code: 'ERR_BUFFER_OUT_OF_BOUNDS', + name: 'RangeError', + message: '"offset" is outside of buffer bounds', + } + ); + + assert.throws( + () => { sock.send(input, 0, 6); }, + { + code: 'ERR_BUFFER_OUT_OF_BOUNDS', + name: 'RangeError', + message: '"length" is outside of buffer bounds', + } + ); + + assert.throws( + () => { sock.send(input, 3, 4); }, + { + code: 'ERR_BUFFER_OUT_OF_BOUNDS', + name: 'RangeError', + message: '"length" is outside of buffer bounds', + } + ); + } + } else { + assert.throws(() => { sock.send(buf, 1, 1, -1, host); }, RangeError); + assert.throws(() => { sock.send(buf, 1, 1, 0, host); }, RangeError); + assert.throws(() => { sock.send(buf, 1, 1, 65536, host); }, RangeError); + } + + // send(buf, port, host) + assert.throws( + () => { sock.send(23, 12345, host); }, + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + message: 'The "buffer" argument must be of type string or an instance ' + + 'of Buffer, TypedArray, or DataView. Received type number (23)' + } + ); + + // send([buf1, ..], port, host) + assert.throws( + () => { sock.send([buf, 23], 12345, host); }, + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + message: 'The "buffer list arguments" argument must be of type string ' + + 'or an instance of Buffer, TypedArray, or DataView. ' + + 'Received an instance of Array' + } + ); +} + +checkArgs(); +sock.connect(12345, common.mustCall(() => { + checkArgs(true); + sock.close(); +})); diff --git a/tests/node_compat/test/parallel/test-dgram-send-callback-buffer-empty-address.js b/tests/node_compat/test/parallel/test-dgram-send-callback-buffer-empty-address.js new file mode 100644 index 0000000000..c9b8d08f03 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-send-callback-buffer-empty-address.js @@ -0,0 +1,23 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp4'); + +const buf = Buffer.alloc(256, 'x'); + +const onMessage = common.mustSucceed((bytes) => { + assert.strictEqual(bytes, buf.length); + client.close(); +}); + +client.bind(0, () => client.send(buf, client.address().port, onMessage)); diff --git a/tests/node_compat/test/parallel/test-dgram-send-callback-buffer-length-empty-address.js b/tests/node_compat/test/parallel/test-dgram-send-callback-buffer-length-empty-address.js new file mode 100644 index 0000000000..aeab74b411 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-send-callback-buffer-length-empty-address.js @@ -0,0 +1,28 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); + +const dgram = require('dgram'); +const client = dgram.createSocket('udp4'); + +const buf = Buffer.alloc(256, 'x'); +const offset = 20; +const len = buf.length - offset; + +const onMessage = common.mustSucceed(function messageSent(bytes) { + assert.notStrictEqual(bytes, buf.length); + assert.strictEqual(bytes, buf.length - offset); + client.close(); +}); + +client.bind(0, () => client.send(buf, offset, len, + client.address().port, + onMessage)); diff --git a/tests/node_compat/test/parallel/test-dgram-send-callback-buffer-length.js b/tests/node_compat/test/parallel/test-dgram-send-callback-buffer-length.js new file mode 100644 index 0000000000..decb1388e5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-send-callback-buffer-length.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); + +const dgram = require('dgram'); +const client = dgram.createSocket('udp4'); + +const buf = Buffer.allocUnsafe(256); +const offset = 20; +const len = buf.length - offset; + +const messageSent = common.mustSucceed(function messageSent(bytes) { + assert.notStrictEqual(bytes, buf.length); + assert.strictEqual(bytes, buf.length - offset); + client.close(); +}); + +client.bind(0, () => client.send(buf, offset, len, + client.address().port, + '127.0.0.1', + messageSent)); diff --git a/tests/node_compat/test/parallel/test-dgram-send-callback-buffer.js b/tests/node_compat/test/parallel/test-dgram-send-callback-buffer.js new file mode 100644 index 0000000000..73593844db --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-send-callback-buffer.js @@ -0,0 +1,26 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp4'); + +const buf = Buffer.allocUnsafe(256); + +const onMessage = common.mustSucceed((bytes) => { + assert.strictEqual(bytes, buf.length); + client.close(); +}); + +client.bind(0, () => client.send(buf, + client.address().port, + common.localhostIPv4, + onMessage)); diff --git a/tests/node_compat/test/parallel/test-dgram-send-callback-multi-buffer-empty-address.js b/tests/node_compat/test/parallel/test-dgram-send-callback-multi-buffer-empty-address.js new file mode 100644 index 0000000000..4a9d80eb57 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-send-callback-multi-buffer-empty-address.js @@ -0,0 +1,34 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp4'); + +const messageSent = common.mustSucceed(function messageSent(bytes) { + assert.strictEqual(bytes, buf1.length + buf2.length); +}); + +const buf1 = Buffer.alloc(256, 'x'); +const buf2 = Buffer.alloc(256, 'y'); + +client.on('listening', function() { + const port = this.address().port; + client.send([buf1, buf2], port, messageSent); +}); + +client.on('message', common.mustCall(function onMessage(buf) { + const expected = Buffer.concat([buf1, buf2]); + assert.ok(buf.equals(expected), 'message was received correctly'); + client.close(); +})); + +client.bind(0); diff --git a/tests/node_compat/test/parallel/test-dgram-send-callback-multi-buffer.js b/tests/node_compat/test/parallel/test-dgram-send-callback-multi-buffer.js new file mode 100644 index 0000000000..b775978be5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-send-callback-multi-buffer.js @@ -0,0 +1,34 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp4'); + +const messageSent = common.mustCall((err, bytes) => { + assert.strictEqual(bytes, buf1.length + buf2.length); +}); + +const buf1 = Buffer.alloc(256, 'x'); +const buf2 = Buffer.alloc(256, 'y'); + +client.on('listening', () => { + const port = client.address().port; + client.send([buf1, buf2], port, common.localhostIPv4, messageSent); +}); + +client.on('message', common.mustCall((buf, info) => { + const expected = Buffer.concat([buf1, buf2]); + assert.ok(buf.equals(expected), 'message was received correctly'); + client.close(); +})); + +client.bind(0); diff --git a/tests/node_compat/test/parallel/test-dgram-send-callback-recursive.js b/tests/node_compat/test/parallel/test-dgram-send-callback-recursive.js new file mode 100644 index 0000000000..27579516c8 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-send-callback-recursive.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +const dgram = require('dgram'); +const client = dgram.createSocket('udp4'); +const chunk = 'abc'; +let received = 0; +let sent = 0; +const limit = 10; +let async = false; +let port; + +function onsend() { + if (sent++ < limit) { + client.send(chunk, 0, chunk.length, port, common.localhostIPv4, onsend); + } else { + assert.strictEqual(async, true); + } +} + +client.on('listening', function() { + port = this.address().port; + + process.nextTick(() => { + async = true; + }); + + onsend(); +}); + +client.on('message', (buf, info) => { + received++; + if (received === limit) { + client.close(); + } +}); + +client.on('close', common.mustCall(function() { + assert.strictEqual(received, limit); +})); + +client.bind(0); diff --git a/tests/node_compat/test/parallel/test-dgram-send-default-host.js b/tests/node_compat/test/parallel/test-dgram-send-default-host.js new file mode 100644 index 0000000000..989dca888b --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-send-default-host.js @@ -0,0 +1,79 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp4'); + +const toSend = [Buffer.alloc(256, 'x'), + Buffer.alloc(256, 'y'), + Buffer.alloc(256, 'z'), + 'hello']; + +const received = []; +let totalBytesSent = 0; +let totalBytesReceived = 0; +const arrayBufferViewsCount = common.getArrayBufferViews( + Buffer.from('') +).length; + +client.on('listening', common.mustCall(() => { + const port = client.address().port; + + client.send(toSend[0], 0, toSend[0].length, port); + client.send(toSend[1], port); + client.send([toSend[2]], port); + client.send(toSend[3], 0, toSend[3].length, port); + + totalBytesSent += toSend.map((buf) => buf.length) + .reduce((a, b) => a + b, 0); + + for (const msgBuf of common.getArrayBufferViews(toSend[0])) { + client.send(msgBuf, 0, msgBuf.byteLength, port); + totalBytesSent += msgBuf.byteLength; + } + for (const msgBuf of common.getArrayBufferViews(toSend[1])) { + client.send(msgBuf, port); + totalBytesSent += msgBuf.byteLength; + } + for (const msgBuf of common.getArrayBufferViews(toSend[2])) { + client.send([msgBuf], port); + totalBytesSent += msgBuf.byteLength; + } +})); + +client.on('message', common.mustCall((buf, info) => { + received.push(buf.toString()); + totalBytesReceived += info.size; + + if (totalBytesReceived === totalBytesSent) { + client.close(); + } + // For every buffer in `toSend`, we send the raw Buffer, + // as well as every TypedArray in getArrayBufferViews() +}, toSend.length + (toSend.length - 1) * arrayBufferViewsCount)); + +client.on('close', common.mustCall((buf, info) => { + // The replies may arrive out of order -> sort them before checking. + received.sort(); + + const repeated = [...toSend]; + for (let i = 0; i < arrayBufferViewsCount; i++) { + repeated.push(...toSend.slice(0, 3)); + } + + assert.strictEqual(totalBytesSent, totalBytesReceived); + + const expected = repeated.map(String).sort(); + assert.deepStrictEqual(received, expected); +})); + +client.bind(0); diff --git a/tests/node_compat/test/parallel/test-dgram-send-empty-array.js b/tests/node_compat/test/parallel/test-dgram-send-empty-array.js new file mode 100644 index 0000000000..cf2508d9ca --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-send-empty-array.js @@ -0,0 +1,32 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp4'); + +let interval; + +client.on('message', common.mustCall(function onMessage(buf, info) { + const expected = Buffer.alloc(0); + assert.ok(buf.equals(expected), `Expected empty message but got ${buf}`); + clearInterval(interval); + client.close(); +})); + +client.on('listening', common.mustCall(function() { + interval = setInterval(function() { + client.send([], client.address().port, common.localhostIPv4); + }, 10); +})); + +client.bind(0); diff --git a/tests/node_compat/test/parallel/test-dgram-send-empty-buffer.js b/tests/node_compat/test/parallel/test-dgram-send-empty-buffer.js new file mode 100644 index 0000000000..de5101cbd2 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-send-empty-buffer.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); + +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp4'); + +client.bind(0, common.mustCall(function() { + const port = this.address().port; + + client.on('message', common.mustCall(function onMessage(buffer) { + assert.strictEqual(buffer.length, 0); + clearInterval(interval); + client.close(); + })); + + const buf = Buffer.alloc(0); + const interval = setInterval(function() { + client.send(buf, 0, 0, port, '127.0.0.1', common.mustCall()); + }, 10); +})); diff --git a/tests/node_compat/test/parallel/test-dgram-send-empty-packet.js b/tests/node_compat/test/parallel/test-dgram-send-empty-packet.js new file mode 100644 index 0000000000..01f7a459ce --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-send-empty-packet.js @@ -0,0 +1,36 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp4'); + +client.bind(0, common.mustCall(function() { + + client.on('message', common.mustCall(callback)); + + const port = this.address().port; + const buf = Buffer.alloc(1); + + const interval = setInterval(function() { + client.send(buf, 0, 0, port, '127.0.0.1', common.mustCall(callback)); + }, 10); + + function callback(firstArg) { + // If client.send() callback, firstArg should be null. + // If client.on('message') listener, firstArg should be a 0-length buffer. + if (firstArg instanceof Buffer) { + assert.strictEqual(firstArg.length, 0); + clearInterval(interval); + client.close(); + } + } +})); diff --git a/tests/node_compat/test/parallel/test-dgram-send-error.js b/tests/node_compat/test/parallel/test-dgram-send-error.js new file mode 100644 index 0000000000..8b0887e349 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-send-error.js @@ -0,0 +1,77 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); +const { internalBinding } = require('internal/test/binding'); +const { UV_UNKNOWN } = internalBinding('uv'); +const { getSystemErrorName } = require('util'); +const { kStateSymbol } = require('internal/dgram'); +const mockError = new Error('mock DNS error'); + +function getSocket(callback) { + const socket = dgram.createSocket('udp4'); + + socket.on('message', common.mustNotCall('Should not receive any messages.')); + socket.bind(common.mustCall(() => { + socket[kStateSymbol].handle.lookup = function(address, callback) { + process.nextTick(callback, mockError); + }; + + callback(socket); + })); + return socket; +} + +getSocket((socket) => { + socket.on('error', common.mustCall((err) => { + socket.close(); + assert.strictEqual(err, mockError); + })); + + socket.send('foo', socket.address().port, 'localhost'); +}); + +getSocket((socket) => { + const callback = common.mustCall((err) => { + socket.close(); + assert.strictEqual(err, mockError); + }); + + socket.send('foo', socket.address().port, 'localhost', callback); +}); + +{ + const socket = dgram.createSocket('udp4'); + + socket.on('message', common.mustNotCall('Should not receive any messages.')); + + socket.bind(common.mustCall(() => { + const port = socket.address().port; + const callback = common.mustCall((err) => { + socket.close(); + assert.strictEqual(err.code, 'UNKNOWN'); + assert.strictEqual(getSystemErrorName(err.errno), 'UNKNOWN'); + assert.strictEqual(err.syscall, 'send'); + assert.strictEqual(err.address, common.localhostIPv4); + assert.strictEqual(err.port, port); + assert.strictEqual( + err.message, + `${err.syscall} ${err.code} ${err.address}:${err.port}` + ); + }); + + socket[kStateSymbol].handle.send = function() { + return UV_UNKNOWN; + }; + + socket.send('foo', port, common.localhostIPv4, callback); + })); +} diff --git a/tests/node_compat/test/parallel/test-dgram-send-invalid-msg-type.js b/tests/node_compat/test/parallel/test-dgram-send-invalid-msg-type.js new file mode 100644 index 0000000000..7fbe1730a4 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-send-invalid-msg-type.js @@ -0,0 +1,43 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); + +// This test ensures that a TypeError is raised when the argument to `send()` +// or `sendto()` is anything but a Buffer. +// https://github.com/nodejs/node-v0.x-archive/issues/4496 + +const assert = require('assert'); +const dgram = require('dgram'); + +// Should throw but not crash. +const socket = dgram.createSocket('udp4'); +assert.throws(function() { socket.send(true, 0, 1, 1, 'host'); }, TypeError); +assert.throws(function() { socket.sendto(5, 0, 1, 1, 'host'); }, TypeError); +socket.close(); diff --git a/tests/node_compat/test/parallel/test-dgram-send-multi-buffer-copy.js b/tests/node_compat/test/parallel/test-dgram-send-multi-buffer-copy.js new file mode 100644 index 0000000000..bb5217de71 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-send-multi-buffer-copy.js @@ -0,0 +1,35 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp4'); + +const onMessage = common.mustCall(function(err, bytes) { + assert.strictEqual(bytes, buf1.length + buf2.length); +}); + +const buf1 = Buffer.alloc(256, 'x'); +const buf2 = Buffer.alloc(256, 'y'); + +client.on('listening', function() { + const toSend = [buf1, buf2]; + client.send(toSend, this.address().port, common.localhostIPv4, onMessage); + toSend.splice(0, 2); +}); + +client.on('message', common.mustCall(function onMessage(buf, info) { + const expected = Buffer.concat([buf1, buf2]); + assert.ok(buf.equals(expected), 'message was received correctly'); + client.close(); +})); + +client.bind(0); diff --git a/tests/node_compat/test/parallel/test-dgram-send-multi-string-array.js b/tests/node_compat/test/parallel/test-dgram-send-multi-string-array.js new file mode 100644 index 0000000000..ae77a421ed --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-send-multi-string-array.js @@ -0,0 +1,20 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); +const socket = dgram.createSocket('udp4'); +const data = ['foo', 'bar', 'baz']; + +socket.on('message', common.mustCall((msg, rinfo) => { + socket.close(); + assert.deepStrictEqual(msg.toString(), data.join('')); +})); + +socket.bind(() => socket.send(data, socket.address().port, 'localhost')); diff --git a/tests/node_compat/test/parallel/test-dgram-udp4.js b/tests/node_compat/test/parallel/test-dgram-udp4.js new file mode 100644 index 0000000000..f477746a0d --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-udp4.js @@ -0,0 +1,59 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); +const message_to_send = 'A message to send'; + +const server = dgram.createSocket('udp4'); +server.on('message', common.mustCall((msg, rinfo) => { + assert.strictEqual(rinfo.address, common.localhostIPv4); + assert.strictEqual(msg.toString(), message_to_send.toString()); + server.send(msg, 0, msg.length, rinfo.port, rinfo.address); +})); +server.on('listening', common.mustCall(() => { + const client = dgram.createSocket('udp4'); + const port = server.address().port; + client.on('message', common.mustCall((msg, rinfo) => { + assert.strictEqual(rinfo.address, common.localhostIPv4); + assert.strictEqual(rinfo.port, port); + assert.strictEqual(msg.toString(), message_to_send.toString()); + client.close(); + server.close(); + })); + client.send(message_to_send, + 0, + message_to_send.length, + port, + 'localhost'); + client.on('close', common.mustCall()); +})); +server.on('close', common.mustCall()); +server.bind(0); diff --git a/tests/node_compat/test/parallel/test-dgram-udp6-send-default-host.js b/tests/node_compat/test/parallel/test-dgram-udp6-send-default-host.js new file mode 100644 index 0000000000..039df7615b --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-udp6-send-default-host.js @@ -0,0 +1,83 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasIPv6) + common.skip('no IPv6 support'); + +const assert = require('assert'); +const dgram = require('dgram'); + +const client = dgram.createSocket('udp6'); + +const toSend = [Buffer.alloc(256, 'x'), + Buffer.alloc(256, 'y'), + Buffer.alloc(256, 'z'), + 'hello']; + +const received = []; +let totalBytesSent = 0; +let totalBytesReceived = 0; +const arrayBufferViewLength = common.getArrayBufferViews( + Buffer.from('') +).length; + +client.on('listening', common.mustCall(() => { + const port = client.address().port; + + client.send(toSend[0], 0, toSend[0].length, port); + client.send(toSend[1], port); + client.send([toSend[2]], port); + client.send(toSend[3], 0, toSend[3].length, port); + + totalBytesSent += toSend.map((buf) => buf.length) + .reduce((a, b) => a + b, 0); + + for (const msgBuf of common.getArrayBufferViews(toSend[0])) { + client.send(msgBuf, 0, msgBuf.byteLength, port); + totalBytesSent += msgBuf.byteLength; + } + for (const msgBuf of common.getArrayBufferViews(toSend[1])) { + client.send(msgBuf, port); + totalBytesSent += msgBuf.byteLength; + } + for (const msgBuf of common.getArrayBufferViews(toSend[2])) { + client.send([msgBuf], port); + totalBytesSent += msgBuf.byteLength; + } +})); + +client.on('message', common.mustCall((buf, info) => { + received.push(buf.toString()); + totalBytesReceived += info.size; + + if (totalBytesReceived === totalBytesSent) { + client.close(); + } + // For every buffer in `toSend`, we send the raw Buffer, + // as well as every TypedArray in getArrayBufferViews() +}, toSend.length + (toSend.length - 1) * arrayBufferViewLength)); + +client.on('close', common.mustCall((buf, info) => { + // The replies may arrive out of order -> sort them before checking. + received.sort(); + + const repeated = [...toSend]; + for (let i = 0; i < arrayBufferViewLength; i++) { + // We get arrayBufferViews only for toSend[0..2]. + repeated.push(...toSend.slice(0, 3)); + } + + assert.strictEqual(totalBytesSent, totalBytesReceived); + + const expected = repeated.map(String).sort(); + assert.deepStrictEqual(received, expected); +})); + +client.bind(0); diff --git a/tests/node_compat/test/parallel/test-dgram-unref.js b/tests/node_compat/test/parallel/test-dgram-unref.js new file mode 100644 index 0000000000..282c3ec3be --- /dev/null +++ b/tests/node_compat/test/parallel/test-dgram-unref.js @@ -0,0 +1,47 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const dgram = require('dgram'); + +{ + // Test the case of unref()'ing a socket with a handle. + const s = dgram.createSocket('udp4'); + s.bind(); + s.unref(); +} + +{ + // Test the case of unref()'ing a socket with no handle. + const s = dgram.createSocket('udp4'); + + s.close(common.mustCall(() => s.unref())); +} + +setTimeout(common.mustNotCall(), 1000).unref(); diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-bind-store.js b/tests/node_compat/test/parallel/test-diagnostics-channel-bind-store.js new file mode 100644 index 0000000000..823c5bb63c --- /dev/null +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-bind-store.js @@ -0,0 +1,115 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const dc = require('diagnostics_channel'); +const { AsyncLocalStorage } = require('async_hooks'); + +let n = 0; +const thisArg = new Date(); +const inputs = [ + { foo: 'bar' }, + { baz: 'buz' }, +]; + +const channel = dc.channel('test'); + +// Bind a storage directly to published data +const store1 = new AsyncLocalStorage(); +channel.bindStore(store1); +let store1bound = true; + +// Bind a store with transformation of published data +const store2 = new AsyncLocalStorage(); +channel.bindStore(store2, common.mustCall((data) => { + assert.strictEqual(data, inputs[n]); + return { data }; +}, 4)); + +// Regular subscribers should see publishes from runStores calls +channel.subscribe(common.mustCall((data) => { + if (store1bound) { + assert.deepStrictEqual(data, store1.getStore()); + } + assert.deepStrictEqual({ data }, store2.getStore()); + assert.strictEqual(data, inputs[n]); +}, 4)); + +// Verify stores are empty before run +assert.strictEqual(store1.getStore(), undefined); +assert.strictEqual(store2.getStore(), undefined); + +channel.runStores(inputs[n], common.mustCall(function(a, b) { + // Verify this and argument forwarding + assert.strictEqual(this, thisArg); + assert.strictEqual(a, 1); + assert.strictEqual(b, 2); + + // Verify store 1 state matches input + assert.strictEqual(store1.getStore(), inputs[n]); + + // Verify store 2 state has expected transformation + assert.deepStrictEqual(store2.getStore(), { data: inputs[n] }); + + // Should support nested contexts + n++; + channel.runStores(inputs[n], common.mustCall(function() { + // Verify this and argument forwarding + assert.strictEqual(this, undefined); + + // Verify store 1 state matches input + assert.strictEqual(store1.getStore(), inputs[n]); + + // Verify store 2 state has expected transformation + assert.deepStrictEqual(store2.getStore(), { data: inputs[n] }); + })); + n--; + + // Verify store 1 state matches input + assert.strictEqual(store1.getStore(), inputs[n]); + + // Verify store 2 state has expected transformation + assert.deepStrictEqual(store2.getStore(), { data: inputs[n] }); +}), thisArg, 1, 2); + +// Verify stores are empty after run +assert.strictEqual(store1.getStore(), undefined); +assert.strictEqual(store2.getStore(), undefined); + +// Verify unbinding works +assert.ok(channel.unbindStore(store1)); +store1bound = false; + +// Verify unbinding a store that is not bound returns false +assert.ok(!channel.unbindStore(store1)); + +n++; +channel.runStores(inputs[n], common.mustCall(() => { + // Verify after unbinding store 1 will remain undefined + assert.strictEqual(store1.getStore(), undefined); + + // Verify still bound store 2 receives expected data + assert.deepStrictEqual(store2.getStore(), { data: inputs[n] }); +})); + +// Contain transformer errors and emit on next tick +const fail = new Error('fail'); +channel.bindStore(store1, () => { + throw fail; +}); + +let calledRunStores = false; +process.once('uncaughtException', common.mustCall((err) => { + assert.strictEqual(calledRunStores, true); + assert.strictEqual(err, fail); +})); + +channel.runStores(inputs[n], common.mustCall()); +calledRunStores = true; diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-safe-subscriber-errors.js b/tests/node_compat/test/parallel/test-diagnostics-channel-safe-subscriber-errors.js new file mode 100644 index 0000000000..62a4edafdf --- /dev/null +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-safe-subscriber-errors.js @@ -0,0 +1,36 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const dc = require('diagnostics_channel'); +const assert = require('assert'); + +const input = { + foo: 'bar' +}; + +const channel = dc.channel('fail'); + +const error = new Error('nope'); + +process.on('uncaughtException', common.mustCall((err) => { + assert.strictEqual(err, error); +})); + +channel.subscribe(common.mustCall((message, name) => { + throw error; +})); + +// The failing subscriber should not stop subsequent subscribers from running +channel.subscribe(common.mustCall()); + +// Publish should continue without throwing +const fn = common.mustCall(); +channel.publish(input); +fn(); diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-async-error.js b/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-async-error.js new file mode 100644 index 0000000000..fa48387a26 --- /dev/null +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-async-error.js @@ -0,0 +1,53 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const dc = require('diagnostics_channel'); +const assert = require('assert'); + +const channel = dc.tracingChannel('test'); + +const expectedError = new Error('test'); +const input = { foo: 'bar' }; +const thisArg = { baz: 'buz' }; + +function check(found) { + assert.deepStrictEqual(found, input); +} + +const handlers = { + start: common.mustCall(check, 2), + end: common.mustCall(check, 2), + asyncStart: common.mustCall(check, 2), + asyncEnd: common.mustCall(check, 2), + error: common.mustCall((found) => { + check(found); + assert.deepStrictEqual(found.error, expectedError); + }, 2) +}; + +channel.subscribe(handlers); + +channel.traceCallback(function(cb, err) { + assert.deepStrictEqual(this, thisArg); + setImmediate(cb, err); +}, 0, input, thisArg, common.mustCall((err, res) => { + assert.strictEqual(err, expectedError); + assert.strictEqual(res, undefined); +}), expectedError); + +channel.tracePromise(function(value) { + assert.deepStrictEqual(this, thisArg); + return Promise.reject(value); +}, input, thisArg, expectedError).then( + common.mustNotCall(), + common.mustCall((value) => { + assert.deepStrictEqual(value, expectedError); + }) +); diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-async.js b/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-async.js new file mode 100644 index 0000000000..25c67f77ce --- /dev/null +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-async.js @@ -0,0 +1,67 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const dc = require('diagnostics_channel'); +const assert = require('assert'); + +const channel = dc.tracingChannel('test'); + +const expectedResult = { foo: 'bar' }; +const input = { foo: 'bar' }; +const thisArg = { baz: 'buz' }; + +function check(found) { + assert.deepStrictEqual(found, input); +} + +const handlers = { + start: common.mustCall(check, 2), + end: common.mustCall(check, 2), + asyncStart: common.mustCall((found) => { + check(found); + assert.strictEqual(found.error, undefined); + assert.deepStrictEqual(found.result, expectedResult); + }, 2), + asyncEnd: common.mustCall((found) => { + check(found); + assert.strictEqual(found.error, undefined); + assert.deepStrictEqual(found.result, expectedResult); + }, 2), + error: common.mustNotCall() +}; + +channel.subscribe(handlers); + +channel.traceCallback(function(cb, err, res) { + assert.deepStrictEqual(this, thisArg); + setImmediate(cb, err, res); +}, 0, input, thisArg, common.mustCall((err, res) => { + assert.strictEqual(err, null); + assert.deepStrictEqual(res, expectedResult); +}), null, expectedResult); + +channel.tracePromise(function(value) { + assert.deepStrictEqual(this, thisArg); + return Promise.resolve(value); +}, input, thisArg, expectedResult).then( + common.mustCall((value) => { + assert.deepStrictEqual(value, expectedResult); + }), + common.mustNotCall() +); + +let failed = false; +try { + channel.traceCallback(common.mustNotCall(), 0, input, thisArg, 1, 2, 3); +} catch (err) { + assert.ok(/"callback" argument must be of type function/.test(err.message)); + failed = true; +} +assert.strictEqual(failed, true); diff --git a/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-run-stores.js b/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-run-stores.js new file mode 100644 index 0000000000..8efaaf4e27 --- /dev/null +++ b/tests/node_compat/test/parallel/test-diagnostics-channel-tracing-channel-run-stores.js @@ -0,0 +1,28 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { AsyncLocalStorage } = require('async_hooks'); +const dc = require('diagnostics_channel'); +const assert = require('assert'); + +const channel = dc.tracingChannel('test'); +const store = new AsyncLocalStorage(); + +const context = { foo: 'bar' }; + +channel.start.bindStore(store, common.mustCall(() => { + return context; +})); + +assert.strictEqual(store.getStore(), undefined); +channel.traceSync(common.mustCall(() => { + assert.deepStrictEqual(store.getStore(), context); +})); +assert.strictEqual(store.getStore(), undefined); diff --git a/tests/node_compat/test/parallel/test-dns-multi-channel.js b/tests/node_compat/test/parallel/test-dns-multi-channel.js new file mode 100644 index 0000000000..708b49648f --- /dev/null +++ b/tests/node_compat/test/parallel/test-dns-multi-channel.js @@ -0,0 +1,59 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const dnstools = require('../common/dns'); +const { Resolver } = require('dns'); +const assert = require('assert'); +const dgram = require('dgram'); + +const servers = [ + { + socket: dgram.createSocket('udp4'), + reply: { type: 'A', address: '1.2.3.4', ttl: 123, domain: 'example.org' } + }, + { + socket: dgram.createSocket('udp4'), + reply: { type: 'A', address: '5.6.7.8', ttl: 123, domain: 'example.org' } + }, +]; + +let waiting = servers.length; +for (const { socket, reply } of servers) { + socket.on('message', common.mustCall((msg, { address, port }) => { + const parsed = dnstools.parseDNSPacket(msg); + const domain = parsed.questions[0].domain; + assert.strictEqual(domain, 'example.org'); + + socket.send(dnstools.writeDNSPacket({ + id: parsed.id, + questions: parsed.questions, + answers: [reply], + }), port, address); + })); + + socket.bind(0, common.mustCall(() => { + if (--waiting === 0) ready(); + })); +} + + +function ready() { + const resolvers = servers.map((server) => ({ + server, + resolver: new Resolver() + })); + + for (const { server: { socket, reply }, resolver } of resolvers) { + resolver.setServers([`127.0.0.1:${socket.address().port}`]); + resolver.resolve4('example.org', common.mustSucceed((res) => { + assert.deepStrictEqual(res, [reply.address]); + socket.close(); + })); + } +} diff --git a/tests/node_compat/test/parallel/test-domain-crypto.js b/tests/node_compat/test/parallel/test-domain-crypto.js new file mode 100644 index 0000000000..1d289eea6c --- /dev/null +++ b/tests/node_compat/test/parallel/test-domain-crypto.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +const common = require('../common'); + +if (!common.hasCrypto) + common.skip('node compiled without OpenSSL.'); + +const crypto = require('crypto'); + +// Pollution of global is intentional as part of test. +common.allowGlobals(require('domain')); +// See https://github.com/nodejs/node/commit/d1eff9ab +global.domain = require('domain'); + +// Should not throw a 'TypeError: undefined is not a function' exception +crypto.randomBytes(8); +crypto.randomBytes(8, common.mustSucceed()); +const buf = Buffer.alloc(8); +crypto.randomFillSync(buf); +crypto.pseudoRandomBytes(8); +crypto.pseudoRandomBytes(8, common.mustSucceed()); +crypto.pbkdf2('password', 'salt', 8, 8, 'sha1', common.mustSucceed()); diff --git a/tests/node_compat/test/parallel/test-domain-ee-error-listener.js b/tests/node_compat/test/parallel/test-domain-ee-error-listener.js new file mode 100644 index 0000000000..a89345fafe --- /dev/null +++ b/tests/node_compat/test/parallel/test-domain-ee-error-listener.js @@ -0,0 +1,27 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const domain = require('domain').create(); +const EventEmitter = require('events'); + +domain.on('error', common.mustNotCall()); + +const ee = new EventEmitter(); + +const plainObject = { justAn: 'object' }; +ee.once('error', common.mustCall((err) => { + assert.deepStrictEqual(err, plainObject); +})); +ee.emit('error', plainObject); + +const err = new Error('test error'); +ee.once('error', common.expectsError(err)); +ee.emit('error', err); diff --git a/tests/node_compat/test/parallel/test-domain-nested-throw.js b/tests/node_compat/test/parallel/test-domain-nested-throw.js new file mode 100644 index 0000000000..fa8d5763c2 --- /dev/null +++ b/tests/node_compat/test/parallel/test-domain-nested-throw.js @@ -0,0 +1,108 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); + +const domain = require('domain'); + +if (process.argv[2] !== 'child') { + parent(); + return; +} + +function parent() { + const node = process.execPath; + const spawn = require('child_process').spawn; + const opt = { stdio: 'inherit' }; + const child = spawn(node, [__filename, 'child'], opt); + child.on('exit', function(c) { + assert(!c); + console.log('ok'); + }); +} + +let gotDomain1Error = false; +let gotDomain2Error = false; + +let threw1 = false; +let threw2 = false; + +function throw1() { + threw1 = true; + throw new Error('handled by domain1'); +} + +function throw2() { + threw2 = true; + throw new Error('handled by domain2'); +} + +function inner(throw1, throw2) { + const domain1 = domain.createDomain(); + + domain1.on('error', function(err) { + if (gotDomain1Error) { + console.error('got domain 1 twice'); + process.exit(1); + } + gotDomain1Error = true; + throw2(); + }); + + domain1.run(function() { + throw1(); + }); +} + +function outer() { + const domain2 = domain.createDomain(); + + domain2.on('error', function(err) { + if (gotDomain2Error) { + console.error('got domain 2 twice'); + process.exit(1); + } + gotDomain2Error = true; + }); + + domain2.run(function() { + inner(throw1, throw2); + }); +} + +process.on('exit', function() { + assert(gotDomain1Error); + assert(gotDomain2Error); + assert(threw1); + assert(threw2); + console.log('ok'); +}); + +outer(); diff --git a/tests/node_compat/test/parallel/test-domain-nested.js b/tests/node_compat/test/parallel/test-domain-nested.js new file mode 100644 index 0000000000..8bffb960c2 --- /dev/null +++ b/tests/node_compat/test/parallel/test-domain-nested.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +// Make sure that the nested domains don't cause the domain stack to grow + +require('../common'); +const assert = require('assert'); +const domain = require('domain'); + +process.on('exit', function(c) { + assert.strictEqual(domain._stack.length, 0); +}); + +domain.create().run(function() { + domain.create().run(function() { + domain.create().run(function() { + domain.create().on('error', function(e) { + // Don't need to do anything here + }).run(function() { + throw new Error('died'); + }); + }); + }); +}); diff --git a/tests/node_compat/test/parallel/test-domain-stack.js b/tests/node_compat/test/parallel/test-domain-stack.js new file mode 100644 index 0000000000..b7399ff296 --- /dev/null +++ b/tests/node_compat/test/parallel/test-domain-stack.js @@ -0,0 +1,55 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +// Make sure that the domain stack doesn't get out of hand. + +require('../common'); +const domain = require('domain'); + +const a = domain.create(); +a.name = 'a'; + +a.on('error', function() { + if (domain._stack.length > 5) { + console.error('leaking!', domain._stack); + process.exit(1); + } +}); + +const foo = a.bind(function() { + throw new Error('error from foo'); +}); + +for (let i = 0; i < 1000; i++) { + process.nextTick(foo); +} + +process.on('exit', function(c) { + if (!c) console.log('ok'); +}); diff --git a/tests/node_compat/test/parallel/test-domain-top-level-error-handler-clears-stack.js b/tests/node_compat/test/parallel/test-domain-top-level-error-handler-clears-stack.js new file mode 100644 index 0000000000..718159c0f4 --- /dev/null +++ b/tests/node_compat/test/parallel/test-domain-top-level-error-handler-clears-stack.js @@ -0,0 +1,38 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const domain = require('domain'); + +// Make sure that the domains stack is cleared after a top-level domain +// error handler exited gracefully. +const d = domain.create(); + +d.on('error', common.mustCall(() => { + // Scheduling a callback with process.nextTick _could_ enter a _new_ domain, + // but domain's error handlers are called outside of their domain's context. + // So there should _no_ domain on the domains stack if the domains stack was + // cleared properly when the domain error handler was called. + process.nextTick(() => { + if (domain._stack.length !== 0) { + // Do not use assert to perform this test: this callback runs in a + // different callstack as the original process._fatalException that + // handled the original error, thus throwing here would trigger another + // call to process._fatalException, and so on recursively and + // indefinitely. + console.error('domains stack length should be 0, but instead is:', + domain._stack.length); + process.exit(1); + } + }); +})); + +d.run(() => { + throw new Error('Error from domain'); +}); diff --git a/tests/node_compat/test/parallel/test-dsa-fips-invalid-key.js b/tests/node_compat/test/parallel/test-dsa-fips-invalid-key.js new file mode 100644 index 0000000000..90a41e2568 --- /dev/null +++ b/tests/node_compat/test/parallel/test-dsa-fips-invalid-key.js @@ -0,0 +1,26 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const fixtures = require('../common/fixtures'); + +if (!common.hasFipsCrypto) + common.skip('node compiled without FIPS OpenSSL.'); + +const assert = require('assert'); +const crypto = require('crypto'); + +const input = 'hello'; + +const dsapri = fixtures.readKey('dsa_private_1025.pem'); +const sign = crypto.createSign('SHA1'); +sign.update(input); + +assert.throws(function() { + sign.sign(dsapri); +}, /PEM_read_bio_PrivateKey failed/); diff --git a/tests/node_compat/test/parallel/test-env-newprotomethod-remove-unnecessary-prototypes.js b/tests/node_compat/test/parallel/test-env-newprotomethod-remove-unnecessary-prototypes.js new file mode 100644 index 0000000000..bded14a407 --- /dev/null +++ b/tests/node_compat/test/parallel/test-env-newprotomethod-remove-unnecessary-prototypes.js @@ -0,0 +1,26 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; +require('../common'); + +// This test ensures that unnecessary prototypes are no longer +// being generated by node::NewFunctionTemplate. + +const assert = require('assert'); +const { internalBinding } = require('internal/test/binding'); +[ + internalBinding('udp_wrap').UDP.prototype.bind6, + internalBinding('tcp_wrap').TCP.prototype.bind6, + internalBinding('udp_wrap').UDP.prototype.send6, + internalBinding('tcp_wrap').TCP.prototype.bind, + internalBinding('udp_wrap').UDP.prototype.close, + internalBinding('tcp_wrap').TCP.prototype.open, +].forEach((binding, i) => { + assert.strictEqual('prototype' in binding, false, `Test ${i} failed`); +}); diff --git a/tests/node_compat/test/parallel/test-error-aggregateTwoErrors.js b/tests/node_compat/test/parallel/test-error-aggregateTwoErrors.js new file mode 100644 index 0000000000..1ae41a0c12 --- /dev/null +++ b/tests/node_compat/test/parallel/test-error-aggregateTwoErrors.js @@ -0,0 +1,66 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; + +require('../common'); +const assert = require('assert'); +const { aggregateTwoErrors } = require('internal/errors'); + +assert.strictEqual(aggregateTwoErrors(null, null), null); + +{ + const err = new Error(); + assert.strictEqual(aggregateTwoErrors(null, err), err); +} + +{ + const err = new Error(); + assert.strictEqual(aggregateTwoErrors(err, null), err); +} + +{ + const err0 = new Error('original'); + const err1 = new Error('second error'); + + err0.code = 'ERR0'; + err1.code = 'ERR1'; + + const chainedError = aggregateTwoErrors(err1, err0); + assert.strictEqual(chainedError.message, err0.message); + assert.strictEqual(chainedError.code, err0.code); + assert.deepStrictEqual(chainedError.errors, [err0, err1]); +} + +{ + const err0 = new Error('original'); + const err1 = new Error('second error'); + const err2 = new Error('third error'); + + err0.code = 'ERR0'; + err1.code = 'ERR1'; + err2.code = 'ERR2'; + + const chainedError = aggregateTwoErrors(err2, aggregateTwoErrors(err1, err0)); + assert.strictEqual(chainedError.message, err0.message); + assert.strictEqual(chainedError.code, err0.code); + assert.deepStrictEqual(chainedError.errors, [err0, err1, err2]); +} + +{ + const err0 = new Error('original'); + const err1 = new Error('second error'); + + err0.code = 'ERR0'; + err1.code = 'ERR1'; + + const chainedError = aggregateTwoErrors(null, aggregateTwoErrors(err1, err0)); + assert.strictEqual(chainedError.message, err0.message); + assert.strictEqual(chainedError.code, err0.code); + assert.deepStrictEqual(chainedError.errors, [err0, err1]); +} diff --git a/tests/node_compat/test/parallel/test-error-prepare-stack-trace.js b/tests/node_compat/test/parallel/test-error-prepare-stack-trace.js new file mode 100644 index 0000000000..ede87825cb --- /dev/null +++ b/tests/node_compat/test/parallel/test-error-prepare-stack-trace.js @@ -0,0 +1,26 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --enable-source-maps +'use strict'; + +require('../common'); +const assert = require('assert'); + +// Error.prepareStackTrace() can be overridden with source maps enabled. +{ + let prepareCalled = false; + Error.prepareStackTrace = (_error, trace) => { + prepareCalled = true; + }; + try { + throw new Error('foo'); + } catch (err) { + err.stack; // eslint-disable-line no-unused-expressions + } + assert(prepareCalled); +} diff --git a/tests/node_compat/test/parallel/test-errors-aborterror.js b/tests/node_compat/test/parallel/test-errors-aborterror.js new file mode 100644 index 0000000000..38c4df0873 --- /dev/null +++ b/tests/node_compat/test/parallel/test-errors-aborterror.js @@ -0,0 +1,38 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; + +require('../common'); +const { + strictEqual, + throws, +} = require('assert'); +const { AbortError } = require('internal/errors'); + +{ + const err = new AbortError(); + strictEqual(err.message, 'The operation was aborted'); + strictEqual(err.cause, undefined); +} + +{ + const cause = new Error('boom'); + const err = new AbortError('bang', { cause }); + strictEqual(err.message, 'bang'); + strictEqual(err.cause, cause); +} + +{ + throws(() => new AbortError('', false), { + code: 'ERR_INVALID_ARG_TYPE' + }); + throws(() => new AbortError('', ''), { + code: 'ERR_INVALID_ARG_TYPE' + }); +} diff --git a/tests/node_compat/test/parallel/test-event-capture-rejections.js b/tests/node_compat/test/parallel/test-event-capture-rejections.js new file mode 100644 index 0000000000..ae34d26b49 --- /dev/null +++ b/tests/node_compat/test/parallel/test-event-capture-rejections.js @@ -0,0 +1,327 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const { EventEmitter, captureRejectionSymbol } = require('events'); +const { inherits } = require('util'); + +// Inherits from EE without a call to the +// parent constructor. +function NoConstructor() { +} + +// captureRejections param validation +{ + [1, [], function() {}, {}, Infinity, Math.PI, 'meow'].forEach((arg) => { + assert.throws( + () => new EventEmitter({ captureRejections: arg }), + { + name: 'TypeError', + code: 'ERR_INVALID_ARG_TYPE', + message: 'The "options.captureRejections" property must be of type boolean.' + + common.invalidArgTypeHelper(arg), + } + ); + }); +} + +inherits(NoConstructor, EventEmitter); + +function captureRejections() { + const ee = new EventEmitter({ captureRejections: true }); + const _err = new Error('kaboom'); + ee.on('something', common.mustCall(async (value) => { + throw _err; + })); + + ee.on('error', common.mustCall((err) => { + assert.strictEqual(err, _err); + process.nextTick(captureRejectionsTwoHandlers); + })); + + ee.emit('something'); +} + +function captureRejectionsTwoHandlers() { + const ee = new EventEmitter({ captureRejections: true }); + const _err = new Error('kaboom'); + + ee.on('something', common.mustCall(async (value) => { + throw _err; + })); + + // throw twice + ee.on('something', common.mustCall(async (value) => { + throw _err; + })); + + let count = 0; + + ee.on('error', common.mustCall((err) => { + assert.strictEqual(err, _err); + if (++count === 2) { + process.nextTick(defaultValue); + } + }, 2)); + + ee.emit('something'); +} + +function defaultValue() { + const ee = new EventEmitter(); + const _err = new Error('kaboom'); + ee.on('something', common.mustCall(async (value) => { + throw _err; + })); + + process.removeAllListeners('unhandledRejection'); + + process.once('unhandledRejection', common.mustCall((err) => { + // restore default + process.on('unhandledRejection', (err) => { throw err; }); + + assert.strictEqual(err, _err); + process.nextTick(globalSetting); + })); + + ee.emit('something'); +} + +function globalSetting() { + assert.strictEqual(EventEmitter.captureRejections, false); + EventEmitter.captureRejections = true; + const ee = new EventEmitter(); + const _err = new Error('kaboom'); + ee.on('something', common.mustCall(async (value) => { + throw _err; + })); + + ee.on('error', common.mustCall((err) => { + assert.strictEqual(err, _err); + + // restore default + EventEmitter.captureRejections = false; + process.nextTick(configurable); + })); + + ee.emit('something'); +} + +// We need to be able to configure this for streams, as we would +// like to call destroy(err) there. +function configurable() { + const ee = new EventEmitter({ captureRejections: true }); + const _err = new Error('kaboom'); + ee.on('something', common.mustCall(async (...args) => { + assert.deepStrictEqual(args, [42, 'foobar']); + throw _err; + })); + + assert.strictEqual(captureRejectionSymbol, Symbol.for('nodejs.rejection')); + + ee[captureRejectionSymbol] = common.mustCall((err, type, ...args) => { + assert.strictEqual(err, _err); + assert.strictEqual(type, 'something'); + assert.deepStrictEqual(args, [42, 'foobar']); + process.nextTick(globalSettingNoConstructor); + }); + + ee.emit('something', 42, 'foobar'); +} + +function globalSettingNoConstructor() { + assert.strictEqual(EventEmitter.captureRejections, false); + EventEmitter.captureRejections = true; + const ee = new NoConstructor(); + const _err = new Error('kaboom'); + ee.on('something', common.mustCall(async (value) => { + throw _err; + })); + + ee.on('error', common.mustCall((err) => { + assert.strictEqual(err, _err); + + // restore default + EventEmitter.captureRejections = false; + process.nextTick(thenable); + })); + + ee.emit('something'); +} + +function thenable() { + const ee = new EventEmitter({ captureRejections: true }); + const _err = new Error('kaboom'); + ee.on('something', common.mustCall((value) => { + const obj = {}; + + Object.defineProperty(obj, 'then', { + get: common.mustCall(() => { + return common.mustCall((resolved, rejected) => { + assert.strictEqual(resolved, undefined); + rejected(_err); + }); + }, 1), // Only 1 call for Promises/A+ compat. + }); + + return obj; + })); + + ee.on('error', common.mustCall((err) => { + assert.strictEqual(err, _err); + process.nextTick(avoidLoopOnRejection); + })); + + ee.emit('something'); +} + +function avoidLoopOnRejection() { + const ee = new EventEmitter({ captureRejections: true }); + const _err1 = new Error('kaboom'); + const _err2 = new Error('kaboom2'); + ee.on('something', common.mustCall(async (value) => { + throw _err1; + })); + + ee[captureRejectionSymbol] = common.mustCall(async (err) => { + assert.strictEqual(err, _err1); + throw _err2; + }); + + process.removeAllListeners('unhandledRejection'); + + process.once('unhandledRejection', common.mustCall((err) => { + // restore default + process.on('unhandledRejection', (err) => { throw err; }); + + assert.strictEqual(err, _err2); + process.nextTick(avoidLoopOnError); + })); + + ee.emit('something'); +} + +function avoidLoopOnError() { + const ee = new EventEmitter({ captureRejections: true }); + const _err1 = new Error('kaboom'); + const _err2 = new Error('kaboom2'); + ee.on('something', common.mustCall(async (value) => { + throw _err1; + })); + + ee.on('error', common.mustCall(async (err) => { + assert.strictEqual(err, _err1); + throw _err2; + })); + + process.removeAllListeners('unhandledRejection'); + + process.once('unhandledRejection', common.mustCall((err) => { + // restore default + process.on('unhandledRejection', (err) => { throw err; }); + + assert.strictEqual(err, _err2); + process.nextTick(thenableThatThrows); + })); + + ee.emit('something'); +} + +function thenableThatThrows() { + const ee = new EventEmitter({ captureRejections: true }); + const _err = new Error('kaboom'); + ee.on('something', common.mustCall((value) => { + const obj = {}; + + Object.defineProperty(obj, 'then', { + get: common.mustCall(() => { + throw _err; + }, 1), // Only 1 call for Promises/A+ compat. + }); + + return obj; + })); + + ee.on('error', common.mustCall((err) => { + assert.strictEqual(err, _err); + process.nextTick(resetCaptureOnThrowInError); + })); + + ee.emit('something'); +} + +function resetCaptureOnThrowInError() { + const ee = new EventEmitter({ captureRejections: true }); + ee.on('something', common.mustCall(async (value) => { + throw new Error('kaboom'); + })); + + ee.once('error', common.mustCall((err) => { + throw err; + })); + + process.removeAllListeners('uncaughtException'); + + process.once('uncaughtException', common.mustCall((err) => { + process.nextTick(next); + })); + + ee.emit('something'); + + function next() { + process.on('uncaughtException', common.mustNotCall()); + + const _err = new Error('kaboom2'); + ee.on('something2', common.mustCall(async (value) => { + throw _err; + })); + + ee.on('error', common.mustCall((err) => { + assert.strictEqual(err, _err); + + process.removeAllListeners('uncaughtException'); + + // restore default + process.on('uncaughtException', (err) => { throw err; }); + + process.nextTick(argValidation); + })); + + ee.emit('something2'); + } +} + +function argValidation() { + + function testType(obj) { + const received = obj.constructor.name !== 'Number' ? + `an instance of ${obj.constructor.name}` : + `type number (${obj})`; + + assert.throws(() => new EventEmitter({ captureRejections: obj }), { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + message: 'The "options.captureRejections" property must be of type ' + + `boolean. Received ${received}`, + }); + + assert.throws(() => EventEmitter.captureRejections = obj, { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + message: 'The "EventEmitter.captureRejections" property must be of ' + + `type boolean. Received ${received}`, + }); + } + + testType([]); + testType({ hello: 42 }); + testType(42); +} + +captureRejections(); diff --git a/tests/node_compat/test/parallel/test-event-emitter-check-listener-leaks.js b/tests/node_compat/test/parallel/test-event-emitter-check-listener-leaks.js new file mode 100644 index 0000000000..3233ca06a6 --- /dev/null +++ b/tests/node_compat/test/parallel/test-event-emitter-check-listener-leaks.js @@ -0,0 +1,110 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const events = require('events'); + +// default +{ + const e = new events.EventEmitter(); + + for (let i = 0; i < 10; i++) { + e.on('default', common.mustNotCall()); + } + assert.ok(!Object.hasOwn(e._events.default, 'warned')); + e.on('default', common.mustNotCall()); + assert.ok(e._events.default.warned); + + // symbol + const symbol = Symbol('symbol'); + e.setMaxListeners(1); + e.on(symbol, common.mustNotCall()); + assert.ok(!Object.hasOwn(e._events[symbol], 'warned')); + e.on(symbol, common.mustNotCall()); + assert.ok(Object.hasOwn(e._events[symbol], 'warned')); + + // specific + e.setMaxListeners(5); + for (let i = 0; i < 5; i++) { + e.on('specific', common.mustNotCall()); + } + assert.ok(!Object.hasOwn(e._events.specific, 'warned')); + e.on('specific', common.mustNotCall()); + assert.ok(e._events.specific.warned); + + // only one + e.setMaxListeners(1); + e.on('only one', common.mustNotCall()); + assert.ok(!Object.hasOwn(e._events['only one'], 'warned')); + e.on('only one', common.mustNotCall()); + assert.ok(Object.hasOwn(e._events['only one'], 'warned')); + + // unlimited + e.setMaxListeners(0); + for (let i = 0; i < 1000; i++) { + e.on('unlimited', common.mustNotCall()); + } + assert.ok(!Object.hasOwn(e._events.unlimited, 'warned')); +} + +// process-wide +{ + events.EventEmitter.defaultMaxListeners = 42; + const e = new events.EventEmitter(); + + for (let i = 0; i < 42; ++i) { + e.on('fortytwo', common.mustNotCall()); + } + assert.ok(!Object.hasOwn(e._events.fortytwo, 'warned')); + e.on('fortytwo', common.mustNotCall()); + assert.ok(Object.hasOwn(e._events.fortytwo, 'warned')); + delete e._events.fortytwo.warned; + + events.EventEmitter.defaultMaxListeners = 44; + e.on('fortytwo', common.mustNotCall()); + assert.ok(!Object.hasOwn(e._events.fortytwo, 'warned')); + e.on('fortytwo', common.mustNotCall()); + assert.ok(Object.hasOwn(e._events.fortytwo, 'warned')); +} + +// But _maxListeners still has precedence over defaultMaxListeners +{ + events.EventEmitter.defaultMaxListeners = 42; + const e = new events.EventEmitter(); + e.setMaxListeners(1); + e.on('uno', common.mustNotCall()); + assert.ok(!Object.hasOwn(e._events.uno, 'warned')); + e.on('uno', common.mustNotCall()); + assert.ok(Object.hasOwn(e._events.uno, 'warned')); + + // chainable + assert.strictEqual(e, e.setMaxListeners(1)); +} diff --git a/tests/node_compat/test/parallel/test-event-emitter-max-listeners-warning-for-null.js b/tests/node_compat/test/parallel/test-event-emitter-max-listeners-warning-for-null.js new file mode 100644 index 0000000000..1e3435ef39 --- /dev/null +++ b/tests/node_compat/test/parallel/test-event-emitter-max-listeners-warning-for-null.js @@ -0,0 +1,30 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --no-warnings +// The flag suppresses stderr output but the warning event will still emit +'use strict'; + +const common = require('../common'); +const events = require('events'); +const assert = require('assert'); + +const e = new events.EventEmitter(); +e.setMaxListeners(1); + +process.on('warning', common.mustCall((warning) => { + assert.ok(warning instanceof Error); + assert.strictEqual(warning.name, 'MaxListenersExceededWarning'); + assert.strictEqual(warning.emitter, e); + assert.strictEqual(warning.count, 2); + assert.strictEqual(warning.type, null); + assert.ok(warning.message.includes( + '2 null listeners added to [EventEmitter].')); +})); + +e.on(null, () => {}); +e.on(null, () => {}); diff --git a/tests/node_compat/test/parallel/test-event-emitter-max-listeners-warning-for-symbol.js b/tests/node_compat/test/parallel/test-event-emitter-max-listeners-warning-for-symbol.js new file mode 100644 index 0000000000..113fba229c --- /dev/null +++ b/tests/node_compat/test/parallel/test-event-emitter-max-listeners-warning-for-symbol.js @@ -0,0 +1,32 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --no-warnings +// The flag suppresses stderr output but the warning event will still emit +'use strict'; + +const common = require('../common'); +const events = require('events'); +const assert = require('assert'); + +const symbol = Symbol('symbol'); + +const e = new events.EventEmitter(); +e.setMaxListeners(1); + +process.on('warning', common.mustCall((warning) => { + assert.ok(warning instanceof Error); + assert.strictEqual(warning.name, 'MaxListenersExceededWarning'); + assert.strictEqual(warning.emitter, e); + assert.strictEqual(warning.count, 2); + assert.strictEqual(warning.type, symbol); + assert.ok(warning.message.includes( + '2 Symbol(symbol) listeners added to [EventEmitter].')); +})); + +e.on(symbol, () => {}); +e.on(symbol, () => {}); diff --git a/tests/node_compat/test/parallel/test-event-emitter-max-listeners-warning.js b/tests/node_compat/test/parallel/test-event-emitter-max-listeners-warning.js new file mode 100644 index 0000000000..69977a9679 --- /dev/null +++ b/tests/node_compat/test/parallel/test-event-emitter-max-listeners-warning.js @@ -0,0 +1,38 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --no-warnings +// The flag suppresses stderr output but the warning event will still emit +'use strict'; + +const common = require('../common'); +const events = require('events'); +const assert = require('assert'); + +class FakeInput extends events.EventEmitter { + resume() {} + pause() {} + write() {} + end() {} +} + +const e = new FakeInput(); +e.setMaxListeners(1); + +process.on('warning', common.mustCall((warning) => { + assert.ok(warning instanceof Error); + assert.strictEqual(warning.name, 'MaxListenersExceededWarning'); + assert.strictEqual(warning.emitter, e); + assert.strictEqual(warning.count, 2); + assert.strictEqual(warning.type, 'event-type'); + assert.ok(warning.message.includes( + '2 event-type listeners added to [FakeInput].')); +})); + +e.on('event-type', () => {}); +e.on('event-type', () => {}); // Trigger warning. +e.on('event-type', () => {}); // Verify that warning is emitted only once. diff --git a/tests/node_compat/test/parallel/test-eventtarget-once-twice.js b/tests/node_compat/test/parallel/test-eventtarget-once-twice.js new file mode 100644 index 0000000000..82877c7987 --- /dev/null +++ b/tests/node_compat/test/parallel/test-eventtarget-once-twice.js @@ -0,0 +1,21 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const { once } = require('events'); + +const et = new EventTarget(); +(async function() { + await once(et, 'foo'); + await once(et, 'foo'); +})().then(common.mustCall()); + +et.dispatchEvent(new Event('foo')); +setImmediate(() => { + et.dispatchEvent(new Event('foo')); +}); diff --git a/tests/node_compat/test/parallel/test-fs-buffertype-writesync.js b/tests/node_compat/test/parallel/test-fs-buffertype-writesync.js new file mode 100644 index 0000000000..f2e8c97ee7 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-buffertype-writesync.js @@ -0,0 +1,23 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); + +// This test ensures that writeSync throws for invalid data input. + +const assert = require('assert'); +const fs = require('fs'); + +[ + true, false, 0, 1, Infinity, () => {}, {}, [], undefined, null, +].forEach((value) => { + assert.throws( + () => fs.writeSync(1, value), + { message: /"buffer"/, code: 'ERR_INVALID_ARG_TYPE' } + ); +}); diff --git a/tests/node_compat/test/parallel/test-fs-close.js b/tests/node_compat/test/parallel/test-fs-close.js new file mode 100644 index 0000000000..1efb90ecd3 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-close.js @@ -0,0 +1,19 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +const assert = require('assert'); +const fs = require('fs'); + +const fd = fs.openSync(__filename, 'r'); + +fs.close(fd, common.mustCall(function(...args) { + assert.deepStrictEqual(args, [null]); +})); diff --git a/tests/node_compat/test/parallel/test-fs-constants.js b/tests/node_compat/test/parallel/test-fs-constants.js new file mode 100644 index 0000000000..f6599ae859 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-constants.js @@ -0,0 +1,15 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const fs = require('fs'); +const assert = require('assert'); + +// Check if the two constants accepted by chmod() on Windows are defined. +assert.notStrictEqual(fs.constants.S_IRUSR, undefined); +assert.notStrictEqual(fs.constants.S_IWUSR, undefined); diff --git a/tests/node_compat/test/parallel/test-fs-fmap.js b/tests/node_compat/test/parallel/test-fs-fmap.js new file mode 100644 index 0000000000..728cdc8c54 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-fmap.js @@ -0,0 +1,35 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const fs = require('fs'); + +const { + O_CREAT = 0, + O_RDONLY = 0, + O_TRUNC = 0, + O_WRONLY = 0, + UV_FS_O_FILEMAP = 0 +} = fs.constants; + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +// Run this test on all platforms. While UV_FS_O_FILEMAP is only available on +// Windows, it should be silently ignored on other platforms. + +const filename = tmpdir.resolve('fmap.txt'); +const text = 'Memory File Mapping Test'; + +const mw = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY; +const mr = UV_FS_O_FILEMAP | O_RDONLY; + +fs.writeFileSync(filename, text, { flag: mw }); +const r1 = fs.readFileSync(filename, { encoding: 'utf8', flag: mr }); +assert.strictEqual(r1, text); diff --git a/tests/node_compat/test/parallel/test-fs-long-path.js b/tests/node_compat/test/parallel/test-fs-long-path.js new file mode 100644 index 0000000000..9b818cb75b --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-long-path.js @@ -0,0 +1,56 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +if (!common.isWindows) + common.skip('this test is Windows-specific.'); + +const fs = require('fs'); +const path = require('path'); + +const tmpdir = require('../common/tmpdir'); + +// Make a path that will be at least 260 chars long. +const fileNameLen = Math.max(260 - tmpdir.path.length - 1, 1); +const fileName = tmpdir.resolve('x'.repeat(fileNameLen)); +const fullPath = path.resolve(fileName); + +tmpdir.refresh(); + +console.log({ + filenameLength: fileName.length, + fullPathLength: fullPath.length +}); + +fs.writeFile(fullPath, 'ok', common.mustSucceed(() => { + fs.stat(fullPath, common.mustSucceed()); + + // Tests https://github.com/nodejs/node/issues/39721 + fs.realpath.native(fullPath, common.mustSucceed()); +})); diff --git a/tests/node_compat/test/parallel/test-fs-non-number-arguments-throw.js b/tests/node_compat/test/parallel/test-fs-non-number-arguments-throw.js new file mode 100644 index 0000000000..404ef6c298 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-non-number-arguments-throw.js @@ -0,0 +1,54 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const tmpdir = require('../common/tmpdir'); +const tempFile = tmpdir.resolve('fs-non-number-arguments-throw'); + +tmpdir.refresh(); +fs.writeFileSync(tempFile, 'abc\ndef'); + +// A sanity check when using numbers instead of strings +const sanity = 'def'; +const saneEmitter = fs.createReadStream(tempFile, { start: 4, end: 6 }); + +assert.throws( + () => { + fs.createReadStream(tempFile, { start: '4', end: 6 }); + }, + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError' + }); + +assert.throws( + () => { + fs.createReadStream(tempFile, { start: 4, end: '6' }); + }, + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError' + }); + +assert.throws( + () => { + fs.createWriteStream(tempFile, { start: '4' }); + }, + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError' + }); + +saneEmitter.on('data', common.mustCall(function(data) { + assert.strictEqual( + sanity, data.toString('utf8'), + `read ${data.toString('utf8')} instead of ${sanity}`); +})); diff --git a/tests/node_compat/test/parallel/test-fs-promises-exists.js b/tests/node_compat/test/parallel/test-fs-promises-exists.js new file mode 100644 index 0000000000..1455047175 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-promises-exists.js @@ -0,0 +1,16 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const fsPromises = require('fs/promises'); + +assert.strictEqual(fsPromises, fs.promises); +assert.strictEqual(fsPromises.constants, fs.constants); diff --git a/tests/node_compat/test/parallel/test-fs-promises-file-handle-write.js b/tests/node_compat/test/parallel/test-fs-promises-file-handle-write.js new file mode 100644 index 0000000000..994ce4ee6d --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-promises-file-handle-write.js @@ -0,0 +1,84 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +// The following tests validate base functionality for the fs.promises +// FileHandle.write method. + +const fs = require('fs'); +const { open } = fs.promises; +const path = require('path'); +const tmpdir = require('../common/tmpdir'); +const assert = require('assert'); +const tmpDir = tmpdir.path; + +tmpdir.refresh(); + +async function validateWrite() { + const filePathForHandle = path.resolve(tmpDir, 'tmp-write.txt'); + const fileHandle = await open(filePathForHandle, 'w+'); + const buffer = Buffer.from('Hello world'.repeat(100), 'utf8'); + + await fileHandle.write(buffer, 0, buffer.length); + const readFileData = fs.readFileSync(filePathForHandle); + assert.deepStrictEqual(buffer, readFileData); + + await fileHandle.close(); +} + +async function validateEmptyWrite() { + const filePathForHandle = path.resolve(tmpDir, 'tmp-empty-write.txt'); + const fileHandle = await open(filePathForHandle, 'w+'); + const buffer = Buffer.from(''); // empty buffer + + await fileHandle.write(buffer, 0, buffer.length); + const readFileData = fs.readFileSync(filePathForHandle); + assert.deepStrictEqual(buffer, readFileData); + + await fileHandle.close(); +} + +async function validateNonUint8ArrayWrite() { + const filePathForHandle = path.resolve(tmpDir, 'tmp-data-write.txt'); + const fileHandle = await open(filePathForHandle, 'w+'); + const buffer = Buffer.from('Hello world', 'utf8').toString('base64'); + + await fileHandle.write(buffer, 0, buffer.length); + const readFileData = fs.readFileSync(filePathForHandle); + assert.deepStrictEqual(Buffer.from(buffer, 'utf8'), readFileData); + + await fileHandle.close(); +} + +async function validateNonStringValuesWrite() { + const filePathForHandle = path.resolve(tmpDir, 'tmp-non-string-write.txt'); + const fileHandle = await open(filePathForHandle, 'w+'); + const nonStringValues = [ + 123, {}, new Map(), null, undefined, 0n, () => {}, Symbol(), true, + new String('notPrimitive'), + { toString() { return 'amObject'; } }, + { [Symbol.toPrimitive]: (hint) => 'amObject' }, + ]; + for (const nonStringValue of nonStringValues) { + await assert.rejects( + fileHandle.write(nonStringValue), + { message: /"buffer"/, code: 'ERR_INVALID_ARG_TYPE' } + ); + } + + await fileHandle.close(); +} + +Promise.all([ + validateWrite(), + validateEmptyWrite(), + validateNonUint8ArrayWrite(), + validateNonStringValuesWrite(), +]).then(common.mustCall()); diff --git a/tests/node_compat/test/parallel/test-fs-promises-readfile-empty.js b/tests/node_compat/test/parallel/test-fs-promises-readfile-empty.js new file mode 100644 index 0000000000..3a72b0c6e6 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-promises-readfile-empty.js @@ -0,0 +1,24 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); + +const assert = require('assert'); +const { promises: fs } = require('fs'); +const fixtures = require('../common/fixtures'); + +const fn = fixtures.path('empty.txt'); + +fs.readFile(fn) + .then(assert.ok); + +fs.readFile(fn, 'utf8') + .then(assert.strictEqual.bind(this, '')); + +fs.readFile(fn, { encoding: 'utf8' }) + .then(assert.strictEqual.bind(this, '')); diff --git a/tests/node_compat/test/parallel/test-fs-promises-readfile-with-fd.js b/tests/node_compat/test/parallel/test-fs-promises-readfile-with-fd.js new file mode 100644 index 0000000000..f5a0199d93 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-promises-readfile-with-fd.js @@ -0,0 +1,41 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// This test makes sure that `readFile()` always reads from the current +// position of the file, instead of reading from the beginning of the file. + +const common = require('../common'); +const assert = require('assert'); +const { writeFileSync } = require('fs'); +const { open } = require('fs').promises; + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +const fn = tmpdir.resolve('test.txt'); +writeFileSync(fn, 'Hello World'); + +async function readFileTest() { + const handle = await open(fn, 'r'); + + /* Read only five bytes, so that the position moves to five. */ + const buf = Buffer.alloc(5); + const { bytesRead } = await handle.read(buf, 0, 5, null); + assert.strictEqual(bytesRead, 5); + assert.strictEqual(buf.toString(), 'Hello'); + + /* readFile() should read from position five, instead of zero. */ + assert.strictEqual((await handle.readFile()).toString(), ' World'); + + await handle.close(); +} + + +readFileTest() + .then(common.mustCall()); diff --git a/tests/node_compat/test/parallel/test-fs-read-file-sync-hostname.js b/tests/node_compat/test/parallel/test-fs-read-file-sync-hostname.js new file mode 100644 index 0000000000..104f1c2b92 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-read-file-sync-hostname.js @@ -0,0 +1,40 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +if (!common.isLinux) + common.skip('Test is linux specific.'); + +const assert = require('assert'); +const fs = require('fs'); + +// Test to make sure reading a file under the /proc directory works. See: +// https://groups.google.com/forum/#!topic/nodejs-dev/rxZ_RoH1Gn0 +const hostname = fs.readFileSync('/proc/sys/kernel/hostname'); +assert.ok(hostname.length > 0); diff --git a/tests/node_compat/test/parallel/test-fs-read-file-sync.js b/tests/node_compat/test/parallel/test-fs-read-file-sync.js new file mode 100644 index 0000000000..ae50907fd8 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-read-file-sync.js @@ -0,0 +1,41 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const fixtures = require('../common/fixtures'); + +const fn = fixtures.path('elipses.txt'); + +const s = fs.readFileSync(fn, 'utf8'); +for (let i = 0; i < s.length; i++) { + assert.strictEqual(s[i], '\u2026'); +} +assert.strictEqual(s.length, 10000); diff --git a/tests/node_compat/test/parallel/test-fs-read-stream-fd-leak.js b/tests/node_compat/test/parallel/test-fs-read-stream-fd-leak.js new file mode 100644 index 0000000000..88025721ca --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-read-stream-fd-leak.js @@ -0,0 +1,69 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const fixtures = require('../common/fixtures'); + +let openCount = 0; +const _fsopen = fs.open; +const _fsclose = fs.close; + +const loopCount = 50; +const totalCheck = 50; +const emptyTxt = fixtures.path('empty.txt'); + +fs.open = function() { + openCount++; + return _fsopen.apply(null, arguments); +}; + +fs.close = function() { + openCount--; + return _fsclose.apply(null, arguments); +}; + +function testLeak(endFn, callback) { + console.log(`testing for leaks from fs.createReadStream().${endFn}()...`); + + let i = 0; + let check = 0; + + function checkFunction() { + if (openCount !== 0 && check < totalCheck) { + check++; + setTimeout(checkFunction, 100); + return; + } + + assert.strictEqual( + openCount, + 0, + `no leaked file descriptors using ${endFn}() (got ${openCount})` + ); + + openCount = 0; + callback && setTimeout(callback, 100); + } + + setInterval(function() { + const s = fs.createReadStream(emptyTxt); + s[endFn](); + + if (++i === loopCount) { + clearTimeout(this); + setTimeout(checkFunction, 100); + } + }, 2); +} + +testLeak('close', function() { + testLeak('destroy'); +}); diff --git a/tests/node_compat/test/parallel/test-fs-read-stream-pos.js b/tests/node_compat/test/parallel/test-fs-read-stream-pos.js new file mode 100644 index 0000000000..58a79794e1 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-read-stream-pos.js @@ -0,0 +1,89 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// Refs: https://github.com/nodejs/node/issues/33940 + +const common = require('../common'); +const tmpdir = require('../common/tmpdir'); +const fs = require('fs'); +const assert = require('assert'); + +tmpdir.refresh(); + +const file = tmpdir.resolve('read_stream_pos_test.txt'); + +fs.writeFileSync(file, ''); + +let counter = 0; + +const writeInterval = setInterval(() => { + counter = counter + 1; + const line = `hello at ${counter}\n`; + fs.writeFileSync(file, line, { flag: 'a' }); +}, 1); + +const hwm = 10; +let bufs = []; +let isLow = false; +let cur = 0; +let stream; + +const readInterval = setInterval(() => { + if (stream) return; + + stream = fs.createReadStream(file, { + highWaterMark: hwm, + start: cur + }); + stream.on('data', common.mustCallAtLeast((chunk) => { + cur += chunk.length; + bufs.push(chunk); + if (isLow) { + const brokenLines = Buffer.concat(bufs).toString() + .split('\n') + .filter((line) => { + const s = 'hello at'.slice(0, line.length); + if (line && !line.startsWith(s)) { + return true; + } + return false; + }); + assert.strictEqual(brokenLines.length, 0); + exitTest(); + return; + } + if (chunk.length !== hwm) { + isLow = true; + } + })); + stream.on('end', () => { + stream = null; + isLow = false; + bufs = []; + }); +}, 10); + +// Time longer than 90 seconds to exit safely +const endTimer = setTimeout(() => { + exitTest(); +}, 90000); + +const exitTest = () => { + clearInterval(readInterval); + clearInterval(writeInterval); + clearTimeout(endTimer); + if (stream && !stream.destroyed) { + stream.on('close', () => { + process.exit(); + }); + stream.destroy(); + } else { + process.exit(); + } +}; diff --git a/tests/node_compat/test/parallel/test-fs-readfile-unlink.js b/tests/node_compat/test/parallel/test-fs-readfile-unlink.js new file mode 100644 index 0000000000..e9e4b67b17 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-readfile-unlink.js @@ -0,0 +1,53 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); + +// Test that unlink succeeds immediately after readFile completes. + +const assert = require('assert'); +const fs = require('fs'); + +const tmpdir = require('../common/tmpdir'); + +const fileName = tmpdir.resolve('test.bin'); +const buf = Buffer.alloc(512 * 1024, 42); + +tmpdir.refresh(); + +fs.writeFileSync(fileName, buf); + +fs.readFile(fileName, common.mustSucceed((data) => { + assert.strictEqual(data.length, buf.length); + assert.strictEqual(buf[0], 42); + + // Unlink should not throw. This is part of the test. It used to throw on + // Windows due to a bug. + fs.unlinkSync(fileName); +})); diff --git a/tests/node_compat/test/parallel/test-fs-readfile-zero-byte-liar.js b/tests/node_compat/test/parallel/test-fs-readfile-zero-byte-liar.js new file mode 100644 index 0000000000..e2481554c6 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-readfile-zero-byte-liar.js @@ -0,0 +1,62 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); + +// Test that readFile works even when stat returns size 0. + +const assert = require('assert'); +const fs = require('fs'); + +const dataExpected = fs.readFileSync(__filename, 'utf8'); + +// Sometimes stat returns size=0, but it's a lie. +fs._fstat = fs.fstat; +fs._fstatSync = fs.fstatSync; + +fs.fstat = (fd, cb) => { + fs._fstat(fd, (er, st) => { + if (er) return cb(er); + st.size = 0; + return cb(er, st); + }); +}; + +fs.fstatSync = (fd) => { + const st = fs._fstatSync(fd); + st.size = 0; + return st; +}; + +const d = fs.readFileSync(__filename, 'utf8'); +assert.strictEqual(d, dataExpected); + +fs.readFile(__filename, 'utf8', common.mustCall((er, d) => { + assert.strictEqual(d, dataExpected); +})); diff --git a/tests/node_compat/test/parallel/test-fs-readfilesync-enoent.js b/tests/node_compat/test/parallel/test-fs-readfilesync-enoent.js new file mode 100644 index 0000000000..ba888cee5a --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-readfilesync-enoent.js @@ -0,0 +1,39 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +// This test is only relevant on Windows. +if (!common.isWindows) + common.skip('Windows specific test.'); + +// This test ensures fs.realpathSync works on properly on Windows without +// throwing ENOENT when the path involves a fileserver. +// https://github.com/nodejs/node-v0.x-archive/issues/3542 + +const assert = require('assert'); +const fs = require('fs'); +const os = require('os'); +const path = require('path'); + +function test(p) { + const result = fs.realpathSync(p); + assert.strictEqual(result.toLowerCase(), path.resolve(p).toLowerCase()); + + fs.realpath(p, common.mustSucceed((result) => { + assert.strictEqual(result.toLowerCase(), path.resolve(p).toLowerCase()); + })); +} + +test(`//${os.hostname()}/c$/Windows/System32`); +test(`//${os.hostname()}/c$/Windows`); +test(`//${os.hostname()}/c$/`); +test(`\\\\${os.hostname()}\\c$\\`); +test('C:\\'); +test('C:'); +test(process.env.windir); diff --git a/tests/node_compat/test/parallel/test-fs-ready-event-stream.js b/tests/node_compat/test/parallel/test-fs-ready-event-stream.js new file mode 100644 index 0000000000..12f1b04443 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-ready-event-stream.js @@ -0,0 +1,27 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const tmpdir = require('../common/tmpdir'); + +const readStream = fs.createReadStream(__filename); +assert.strictEqual(readStream.pending, true); +readStream.on('ready', common.mustCall(() => { + assert.strictEqual(readStream.pending, false); +})); + +const writeFile = tmpdir.resolve('write-fsreadyevent.txt'); +tmpdir.refresh(); +const writeStream = fs.createWriteStream(writeFile, { autoClose: true }); +assert.strictEqual(writeStream.pending, true); +writeStream.on('ready', common.mustCall(() => { + assert.strictEqual(writeStream.pending, false); + writeStream.end(); +})); diff --git a/tests/node_compat/test/parallel/test-fs-sir-writes-alot.js b/tests/node_compat/test/parallel/test-fs-sir-writes-alot.js new file mode 100644 index 0000000000..4cf0fbe4e8 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-sir-writes-alot.js @@ -0,0 +1,77 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const fs = require('fs'); +const assert = require('assert'); + +const tmpdir = require('../common/tmpdir'); + +const filename = tmpdir.resolve('out.txt'); + +tmpdir.refresh(); + +const fd = fs.openSync(filename, 'w'); + +const line = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaa\n'; + +const N = 10240; +let complete = 0; + +for (let i = 0; i < N; i++) { + // Create a new buffer for each write. Before the write is actually + // executed by the thread pool, the buffer will be collected. + const buffer = Buffer.from(line); + fs.write(fd, buffer, 0, buffer.length, null, function(er, written) { + complete++; + if (complete === N) { + fs.closeSync(fd); + const s = fs.createReadStream(filename); + s.on('data', testBuffer); + } + }); +} + +let bytesChecked = 0; + +function testBuffer(b) { + for (let i = 0; i < b.length; i++) { + bytesChecked++; + if (b[i] !== 'a'.charCodeAt(0) && b[i] !== '\n'.charCodeAt(0)) { + throw new Error(`invalid char ${i},${b[i]}`); + } + } +} + +process.on('exit', function() { + // Probably some of the writes are going to overlap, so we can't assume + // that we get (N * line.length). Let's just make sure we've checked a + // few... + assert.ok(bytesChecked > 1000); +}); diff --git a/tests/node_compat/test/parallel/test-fs-stream-construct-compat-error-read.js b/tests/node_compat/test/parallel/test-fs-stream-construct-compat-error-read.js new file mode 100644 index 0000000000..210217ca17 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-stream-construct-compat-error-read.js @@ -0,0 +1,39 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const fs = require('fs'); +const assert = require('assert'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +{ + // Compat error. + + function ReadStream(...args) { + fs.ReadStream.call(this, ...args); + } + Object.setPrototypeOf(ReadStream.prototype, fs.ReadStream.prototype); + Object.setPrototypeOf(ReadStream, fs.ReadStream); + + ReadStream.prototype.open = common.mustCall(function ReadStream$open() { + const that = this; + fs.open(that.path, that.flags, that.mode, (err, fd) => { + that.emit('error', err); + }); + }); + + const r = new ReadStream('/doesnotexist', { emitClose: true }) + .on('error', common.mustCall((err) => { + assert.strictEqual(err.code, 'ENOENT'); + assert.strictEqual(r.destroyed, true); + r.on('close', common.mustCall()); + })); +} diff --git a/tests/node_compat/test/parallel/test-fs-stream-construct-compat-graceful-fs.js b/tests/node_compat/test/parallel/test-fs-stream-construct-compat-graceful-fs.js new file mode 100644 index 0000000000..7df6566f83 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-stream-construct-compat-graceful-fs.js @@ -0,0 +1,77 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const fs = require('fs'); +const assert = require('assert'); +const fixtures = require('../common/fixtures'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +{ + // Compat with graceful-fs. + + function ReadStream(...args) { + fs.ReadStream.call(this, ...args); + } + Object.setPrototypeOf(ReadStream.prototype, fs.ReadStream.prototype); + Object.setPrototypeOf(ReadStream, fs.ReadStream); + + ReadStream.prototype.open = common.mustCall(function ReadStream$open() { + const that = this; + fs.open(that.path, that.flags, that.mode, (err, fd) => { + if (err) { + if (that.autoClose) + that.destroy(); + + that.emit('error', err); + } else { + that.fd = fd; + that.emit('open', fd); + that.read(); + } + }); + }); + + const r = new ReadStream(fixtures.path('x.txt')) + .on('open', common.mustCall((fd) => { + assert.strictEqual(fd, r.fd); + r.destroy(); + })); +} + +{ + // Compat with graceful-fs. + + function WriteStream(...args) { + fs.WriteStream.call(this, ...args); + } + Object.setPrototypeOf(WriteStream.prototype, fs.WriteStream.prototype); + Object.setPrototypeOf(WriteStream, fs.WriteStream); + + WriteStream.prototype.open = common.mustCall(function WriteStream$open() { + const that = this; + fs.open(that.path, that.flags, that.mode, function(err, fd) { + if (err) { + that.destroy(); + that.emit('error', err); + } else { + that.fd = fd; + that.emit('open', fd); + } + }); + }); + + const w = new WriteStream(`${tmpdir.path}/dummy`) + .on('open', common.mustCall((fd) => { + assert.strictEqual(fd, w.fd); + w.destroy(); + })); +} diff --git a/tests/node_compat/test/parallel/test-fs-stream-construct-compat-old-node.js b/tests/node_compat/test/parallel/test-fs-stream-construct-compat-old-node.js new file mode 100644 index 0000000000..12ff3984b9 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-stream-construct-compat-old-node.js @@ -0,0 +1,104 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const fs = require('fs'); +const assert = require('assert'); +const fixtures = require('../common/fixtures'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +{ + // Compat with old node. + + function ReadStream(...args) { + fs.ReadStream.call(this, ...args); + } + Object.setPrototypeOf(ReadStream.prototype, fs.ReadStream.prototype); + Object.setPrototypeOf(ReadStream, fs.ReadStream); + + ReadStream.prototype.open = common.mustCall(function() { + fs.open(this.path, this.flags, this.mode, (er, fd) => { + if (er) { + if (this.autoClose) { + this.destroy(); + } + this.emit('error', er); + return; + } + + this.fd = fd; + this.emit('open', fd); + this.emit('ready'); + }); + }); + + let readyCalled = false; + let ticked = false; + const r = new ReadStream(fixtures.path('x.txt')) + .on('ready', common.mustCall(() => { + readyCalled = true; + // Make sure 'ready' is emitted in same tick as 'open'. + assert.strictEqual(ticked, false); + })) + .on('error', common.mustNotCall()) + .on('open', common.mustCall((fd) => { + process.nextTick(() => { + ticked = true; + r.destroy(); + }); + assert.strictEqual(readyCalled, false); + assert.strictEqual(fd, r.fd); + })); +} + +{ + // Compat with old node. + + function WriteStream(...args) { + fs.WriteStream.call(this, ...args); + } + Object.setPrototypeOf(WriteStream.prototype, fs.WriteStream.prototype); + Object.setPrototypeOf(WriteStream, fs.WriteStream); + + WriteStream.prototype.open = common.mustCall(function() { + fs.open(this.path, this.flags, this.mode, (er, fd) => { + if (er) { + if (this.autoClose) { + this.destroy(); + } + this.emit('error', er); + return; + } + + this.fd = fd; + this.emit('open', fd); + this.emit('ready'); + }); + }); + + let readyCalled = false; + let ticked = false; + const w = new WriteStream(`${tmpdir.path}/dummy`) + .on('ready', common.mustCall(() => { + readyCalled = true; + // Make sure 'ready' is emitted in same tick as 'open'. + assert.strictEqual(ticked, false); + })) + .on('error', common.mustNotCall()) + .on('open', common.mustCall((fd) => { + process.nextTick(() => { + ticked = true; + w.destroy(); + }); + assert.strictEqual(readyCalled, false); + assert.strictEqual(fd, w.fd); + })); +} diff --git a/tests/node_compat/test/parallel/test-fs-stream-destroy-emit-error.js b/tests/node_compat/test/parallel/test-fs-stream-destroy-emit-error.js new file mode 100644 index 0000000000..1a3008895f --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-stream-destroy-emit-error.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +{ + const stream = fs.createReadStream(__filename); + stream.on('close', common.mustCall()); + test(stream); +} + +{ + const stream = fs.createWriteStream(`${tmpdir.path}/dummy`); + stream.on('close', common.mustCall()); + test(stream); +} + +{ + const stream = fs.createReadStream(__filename, { emitClose: true }); + stream.on('close', common.mustCall()); + test(stream); +} + +{ + const stream = fs.createWriteStream(`${tmpdir.path}/dummy2`, + { emitClose: true }); + stream.on('close', common.mustCall()); + test(stream); +} + + +function test(stream) { + const err = new Error('DESTROYED'); + stream.on('open', function() { + stream.destroy(err); + }); + stream.on('error', common.mustCall(function(err_) { + assert.strictEqual(err_, err); + })); +} diff --git a/tests/node_compat/test/parallel/test-fs-stream-double-close.js b/tests/node_compat/test/parallel/test-fs-stream-double-close.js new file mode 100644 index 0000000000..01894e2602 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-stream-double-close.js @@ -0,0 +1,61 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const fs = require('fs'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +test1(fs.createReadStream(__filename)); +test2(fs.createReadStream(__filename)); +test3(fs.createReadStream(__filename)); + +test1(fs.createWriteStream(`${tmpdir.path}/dummy1`)); +test2(fs.createWriteStream(`${tmpdir.path}/dummy2`)); +test3(fs.createWriteStream(`${tmpdir.path}/dummy3`)); + +function test1(stream) { + stream.destroy(); + stream.destroy(); +} + +function test2(stream) { + stream.destroy(); + stream.on('open', common.mustCall(function(fd) { + stream.destroy(); + })); +} + +function test3(stream) { + stream.on('open', common.mustCall(function(fd) { + stream.destroy(); + stream.destroy(); + })); +} diff --git a/tests/node_compat/test/parallel/test-fs-stream-fs-options.js b/tests/node_compat/test/parallel/test-fs-stream-fs-options.js new file mode 100644 index 0000000000..3740962b7a --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-stream-fs-options.js @@ -0,0 +1,79 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const fixtures = require('../common/fixtures'); +const fs = require('fs'); +const assert = require('assert'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +const streamOpts = ['open', 'close']; +const writeStreamOptions = [...streamOpts, 'write']; +const readStreamOptions = [...streamOpts, 'read']; +const originalFs = { fs }; + +{ + const file = tmpdir.resolve('write-end-test0.txt'); + + writeStreamOptions.forEach((fn) => { + const overrideFs = Object.assign({}, originalFs.fs, { [fn]: null }); + if (fn === 'write') overrideFs.writev = null; + + const opts = { + fs: overrideFs + }; + assert.throws( + () => fs.createWriteStream(file, opts), { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + message: `The "options.fs.${fn}" property must be of type function. ` + + 'Received null' + }, + `createWriteStream options.fs.${fn} should throw if isn't a function` + ); + }); +} + +{ + const file = tmpdir.resolve('write-end-test0.txt'); + const overrideFs = Object.assign({}, originalFs.fs, { writev: 'not a fn' }); + const opts = { + fs: overrideFs + }; + assert.throws( + () => fs.createWriteStream(file, opts), { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + message: 'The "options.fs.writev" property must be of type function. ' + + 'Received type string (\'not a fn\')' + }, + 'createWriteStream options.fs.writev should throw if isn\'t a function' + ); +} + +{ + const file = fixtures.path('x.txt'); + readStreamOptions.forEach((fn) => { + const overrideFs = Object.assign({}, originalFs.fs, { [fn]: null }); + const opts = { + fs: overrideFs + }; + assert.throws( + () => fs.createReadStream(file, opts), { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + message: `The "options.fs.${fn}" property must be of type function. ` + + 'Received null' + }, + `createReadStream options.fs.${fn} should throw if isn't a function` + ); + }); +} diff --git a/tests/node_compat/test/parallel/test-fs-stream-options.js b/tests/node_compat/test/parallel/test-fs-stream-options.js new file mode 100644 index 0000000000..1733d19193 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-stream-options.js @@ -0,0 +1,56 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const { mustNotMutateObjectDeep } = require('../common'); + +const assert = require('assert'); +const fs = require('fs'); + +{ + const fd = 'k'; + + assert.throws( + () => { + fs.createReadStream(null, mustNotMutateObjectDeep({ fd })); + }, + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + }); + + assert.throws( + () => { + fs.createWriteStream(null, mustNotMutateObjectDeep({ fd })); + }, + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + }); +} + +{ + const path = 46; + + assert.throws( + () => { + fs.createReadStream(path); + }, + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + }); + + assert.throws( + () => { + fs.createWriteStream(path); + }, + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + }); +} diff --git a/tests/node_compat/test/parallel/test-fs-symlink-dir-junction-relative.js b/tests/node_compat/test/parallel/test-fs-symlink-dir-junction-relative.js new file mode 100644 index 0000000000..90487f51f5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-symlink-dir-junction-relative.js @@ -0,0 +1,65 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +// Test creating and resolving relative junction or symbolic link + +const common = require('../common'); +const fixtures = require('../common/fixtures'); +const assert = require('assert'); +const fs = require('fs'); + +const tmpdir = require('../common/tmpdir'); + +const linkPath1 = tmpdir.resolve('junction1'); +const linkPath2 = tmpdir.resolve('junction2'); +const linkTarget = fixtures.fixturesDir; +const linkData = fixtures.fixturesDir; + +tmpdir.refresh(); + +// Test fs.symlink() +fs.symlink(linkData, linkPath1, 'junction', common.mustSucceed(() => { + verifyLink(linkPath1); +})); + +// Test fs.symlinkSync() +fs.symlinkSync(linkData, linkPath2, 'junction'); +verifyLink(linkPath2); + +function verifyLink(linkPath) { + const stats = fs.lstatSync(linkPath); + assert.ok(stats.isSymbolicLink()); + + const data1 = fs.readFileSync(`${linkPath}/x.txt`, 'ascii'); + const data2 = fs.readFileSync(`${linkTarget}/x.txt`, 'ascii'); + assert.strictEqual(data1, data2); + + // Clean up. + fs.unlinkSync(linkPath); +} diff --git a/tests/node_compat/test/parallel/test-fs-timestamp-parsing-error.js b/tests/node_compat/test/parallel/test-fs-timestamp-parsing-error.js new file mode 100644 index 0000000000..1319f998b9 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-timestamp-parsing-error.js @@ -0,0 +1,36 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const fs = require('fs'); + +for (const input of [Infinity, -Infinity, NaN]) { + assert.throws( + () => { + fs._toUnixTimestamp(input); + }, + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError' + }); +} + +assert.throws( + () => { + fs._toUnixTimestamp({}); + }, + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError' + }); + +const okInputs = [1, -1, '1', '-1', Date.now()]; +for (const input of okInputs) { + fs._toUnixTimestamp(input); +} diff --git a/tests/node_compat/test/parallel/test-fs-truncate-clear-file-zero.js b/tests/node_compat/test/parallel/test-fs-truncate-clear-file-zero.js new file mode 100644 index 0000000000..0dc50ef563 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-truncate-clear-file-zero.js @@ -0,0 +1,63 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const tmpdir = require('../common/tmpdir'); + +// This test ensures that `fs.truncate` opens the file with `r+` and not `w`, +// which had earlier resulted in the target file's content getting zeroed out. +// https://github.com/nodejs/node-v0.x-archive/issues/6233 + +const assert = require('assert'); +const fs = require('fs'); + +const filename = `${tmpdir.path}/truncate-file.txt`; + +tmpdir.refresh(); + +// Synchronous test. +{ + fs.writeFileSync(filename, '0123456789'); + assert.strictEqual(fs.readFileSync(filename).toString(), '0123456789'); + fs.truncateSync(filename, 5); + assert.strictEqual(fs.readFileSync(filename).toString(), '01234'); +} + +// Asynchronous test. +{ + fs.writeFileSync(filename, '0123456789'); + assert.strictEqual(fs.readFileSync(filename).toString(), '0123456789'); + fs.truncate( + filename, + 5, + common.mustSucceed(() => { + assert.strictEqual(fs.readFileSync(filename).toString(), '01234'); + }) + ); +} diff --git a/tests/node_compat/test/parallel/test-fs-util-validateoffsetlength.js b/tests/node_compat/test/parallel/test-fs-util-validateoffsetlength.js new file mode 100644 index 0000000000..7186df4071 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-util-validateoffsetlength.js @@ -0,0 +1,94 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; + +const common = require('../common'); + +const assert = require('assert'); +const { + validateOffsetLengthRead, + validateOffsetLengthWrite, +} = require('internal/fs/utils'); + +{ + const offset = -1; + assert.throws( + () => validateOffsetLengthRead(offset, 0, 0), + common.expectsError({ + code: 'ERR_OUT_OF_RANGE', + name: 'RangeError', + message: 'The value of "offset" is out of range. ' + + `It must be >= 0. Received ${offset}` + }) + ); +} + +{ + const length = -1; + assert.throws( + () => validateOffsetLengthRead(0, length, 0), + common.expectsError({ + code: 'ERR_OUT_OF_RANGE', + name: 'RangeError', + message: 'The value of "length" is out of range. ' + + `It must be >= 0. Received ${length}` + }) + ); +} + +{ + const offset = 1; + const length = 1; + const byteLength = offset + length - 1; + assert.throws( + () => validateOffsetLengthRead(offset, length, byteLength), + common.expectsError({ + code: 'ERR_OUT_OF_RANGE', + name: 'RangeError', + message: 'The value of "length" is out of range. ' + + `It must be <= ${byteLength - offset}. Received ${length}` + }) + ); +} + +// Most platforms don't allow reads or writes >= 2 GiB. +// See https://github.com/libuv/libuv/pull/1501. +const kIoMaxLength = 2 ** 31 - 1; + +// RangeError when offset > byteLength +{ + const offset = 100; + const length = 100; + const byteLength = 50; + assert.throws( + () => validateOffsetLengthWrite(offset, length, byteLength), + common.expectsError({ + code: 'ERR_OUT_OF_RANGE', + name: 'RangeError', + message: 'The value of "offset" is out of range. ' + + `It must be <= ${byteLength}. Received ${offset}` + }) + ); +} + +// RangeError when byteLength < kIoMaxLength, and length > byteLength - offset. +{ + const offset = kIoMaxLength - 150; + const length = 200; + const byteLength = kIoMaxLength - 100; + assert.throws( + () => validateOffsetLengthWrite(offset, length, byteLength), + common.expectsError({ + code: 'ERR_OUT_OF_RANGE', + name: 'RangeError', + message: 'The value of "length" is out of range. ' + + `It must be <= ${byteLength - offset}. Received ${length}` + }) + ); +} diff --git a/tests/node_compat/test/parallel/test-fs-utimes-y2K38.js b/tests/node_compat/test/parallel/test-fs-utimes-y2K38.js new file mode 100644 index 0000000000..381b46b1fb --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-utimes-y2K38.js @@ -0,0 +1,73 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +const assert = require('assert'); +const fs = require('fs'); + +// Check for Y2K38 support. For Windows, assume it's there. Windows +// doesn't have `touch` and `date -r` which are used in the check for support. +if (!common.isWindows) { + const testFilePath = `${tmpdir.path}/y2k38-test`; + const testFileDate = '204001020304'; + const { spawnSync } = require('child_process'); + const touchResult = spawnSync('touch', + ['-t', testFileDate, testFilePath], + { encoding: 'utf8' }); + if (touchResult.status !== 0) { + common.skip('File system appears to lack Y2K38 support (touch failed)'); + } + + // On some file systems that lack Y2K38 support, `touch` will succeed but + // the time will be incorrect. + const dateResult = spawnSync('date', + ['-r', testFilePath, '+%Y%m%d%H%M'], + { encoding: 'utf8' }); + if (dateResult.status === 0) { + if (dateResult.stdout.trim() !== testFileDate) { + common.skip('File system appears to lack Y2k38 support (date failed)'); + } + } else { + // On some platforms `date` may not support the `-r` option. Usually + // this will result in a non-zero status and usage information printed. + // In this case optimistically proceed -- the earlier `touch` succeeded + // but validation that the file has the correct time is not easily possible. + assert.match(dateResult.stderr, /[Uu]sage:/); + } +} + +// Ref: https://github.com/nodejs/node/issues/13255 +const path = `${tmpdir.path}/test-utimes-precision`; +fs.writeFileSync(path, ''); + +const Y2K38_mtime = 2 ** 31; +fs.utimesSync(path, Y2K38_mtime, Y2K38_mtime); +const Y2K38_stats = fs.statSync(path); +assert.strictEqual(Y2K38_stats.mtime.getTime() / 1000, Y2K38_mtime); + +if (common.isWindows) { + // This value would get converted to (double)1713037251359.9998 + const truncate_mtime = 1713037251360; + fs.utimesSync(path, truncate_mtime / 1000, truncate_mtime / 1000); + const truncate_stats = fs.statSync(path); + assert.strictEqual(truncate_stats.mtime.getTime(), truncate_mtime); + + // test Y2K38 for windows + // This value if treaded as a `signed long` gets converted to -2135622133469. + // POSIX systems stores timestamps in {long t_sec, long t_usec}. + // NTFS stores times in nanoseconds in a single `uint64_t`, so when libuv + // calculates (long)`uv_timespec_t.tv_sec` we get 2's complement. + const overflow_mtime = 2159345162531; + fs.utimesSync(path, overflow_mtime / 1000, overflow_mtime / 1000); + const overflow_stats = fs.statSync(path); + assert.strictEqual(overflow_stats.mtime.getTime(), overflow_mtime); +} diff --git a/tests/node_compat/test/parallel/test-fs-watch-file-enoent-after-deletion.js b/tests/node_compat/test/parallel/test-fs-watch-file-enoent-after-deletion.js new file mode 100644 index 0000000000..5b4c892d00 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-watch-file-enoent-after-deletion.js @@ -0,0 +1,54 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); + +// Make sure the deletion event gets reported in the following scenario: +// 1. Watch a file. +// 2. The initial stat() goes okay. +// 3. Something deletes the watched file. +// 4. The second stat() fails with ENOENT. + +// The second stat() translates into the first 'change' event but a logic error +// stopped it from getting emitted. +// https://github.com/nodejs/node-v0.x-archive/issues/4027 + +const fs = require('fs'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +const filename = tmpdir.resolve('watched'); +fs.writeFileSync(filename, 'quis custodiet ipsos custodes'); + +fs.watchFile(filename, { interval: 50 }, common.mustCall(function(curr, prev) { + fs.unwatchFile(filename); +})); + +fs.unlinkSync(filename); diff --git a/tests/node_compat/test/parallel/test-fs-watch-recursive-add-file-with-url.js b/tests/node_compat/test/parallel/test-fs-watch-recursive-add-file-with-url.js new file mode 100644 index 0000000000..eb79cc85a9 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-watch-recursive-add-file-with-url.js @@ -0,0 +1,59 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { setTimeout } = require('timers/promises'); + +if (common.isIBMi) + common.skip('IBMi does not support `fs.watch()`'); + +// fs-watch on folders have limited capability in AIX. +// The testcase makes use of folder watching, and causes +// hang. This behavior is documented. Skip this for AIX. + +if (common.isAIX) + common.skip('folder watch capability is limited in AIX.'); + +const assert = require('assert'); +const path = require('path'); +const fs = require('fs'); +const { pathToFileURL } = require('url'); + +const tmpdir = require('../common/tmpdir'); +const testDir = tmpdir.path; +tmpdir.refresh(); + +(async () => { + // Add a file to already watching folder, and use URL as the path + + const rootDirectory = fs.mkdtempSync(testDir + path.sep); + const testDirectory = path.join(rootDirectory, 'test-5'); + fs.mkdirSync(testDirectory); + + const filePath = path.join(testDirectory, 'file-8.txt'); + const url = pathToFileURL(testDirectory); + + const watcher = fs.watch(url, { recursive: true }); + let watcherClosed = false; + watcher.on('change', function(event, filename) { + assert.strictEqual(event, 'rename'); + + if (filename === path.basename(filePath)) { + watcher.close(); + watcherClosed = true; + } + }); + + await setTimeout(common.platformTimeout(100)); + fs.writeFileSync(filePath, 'world'); + + process.on('exit', function() { + assert(watcherClosed, 'watcher Object was not closed'); + }); +})().then(common.mustCall()); diff --git a/tests/node_compat/test/parallel/test-fs-watch-recursive-add-file.js b/tests/node_compat/test/parallel/test-fs-watch-recursive-add-file.js new file mode 100644 index 0000000000..d572026da5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-watch-recursive-add-file.js @@ -0,0 +1,57 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { setTimeout } = require('timers/promises'); + +if (common.isIBMi) + common.skip('IBMi does not support `fs.watch()`'); + +// fs-watch on folders have limited capability in AIX. +// The testcase makes use of folder watching, and causes +// hang. This behavior is documented. Skip this for AIX. + +if (common.isAIX) + common.skip('folder watch capability is limited in AIX.'); + +const assert = require('assert'); +const path = require('path'); +const fs = require('fs'); + +const tmpdir = require('../common/tmpdir'); +const testDir = tmpdir.path; +tmpdir.refresh(); + +(async () => { + // Add a file to already watching folder + + const rootDirectory = fs.mkdtempSync(testDir + path.sep); + const testDirectory = path.join(rootDirectory, 'test-1'); + fs.mkdirSync(testDirectory); + + const testFile = path.join(testDirectory, 'file-1.txt'); + + const watcher = fs.watch(testDirectory, { recursive: true }); + let watcherClosed = false; + watcher.on('change', function(event, filename) { + assert.strictEqual(event, 'rename'); + + if (filename === path.basename(testFile)) { + watcher.close(); + watcherClosed = true; + } + }); + + await setTimeout(common.platformTimeout(100)); + fs.writeFileSync(testFile, 'world'); + + process.once('exit', function() { + assert(watcherClosed, 'watcher Object was not closed'); + }); +})().then(common.mustCall()); diff --git a/tests/node_compat/test/parallel/test-fs-watch-recursive-add-folder.js b/tests/node_compat/test/parallel/test-fs-watch-recursive-add-folder.js new file mode 100644 index 0000000000..46345443c5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-watch-recursive-add-folder.js @@ -0,0 +1,57 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { setTimeout } = require('timers/promises'); + +if (common.isIBMi) + common.skip('IBMi does not support `fs.watch()`'); + +// fs-watch on folders have limited capability in AIX. +// The testcase makes use of folder watching, and causes +// hang. This behavior is documented. Skip this for AIX. + +if (common.isAIX) + common.skip('folder watch capability is limited in AIX.'); + +const assert = require('assert'); +const path = require('path'); +const fs = require('fs'); + +const tmpdir = require('../common/tmpdir'); +const testDir = tmpdir.path; +tmpdir.refresh(); + +(async () => { + // Add a folder to already watching folder + + const rootDirectory = fs.mkdtempSync(testDir + path.sep); + const testDirectory = path.join(rootDirectory, 'test-2'); + fs.mkdirSync(testDirectory); + + const testFile = path.join(testDirectory, 'folder-2'); + + const watcher = fs.watch(testDirectory, { recursive: true }); + let watcherClosed = false; + watcher.on('change', function(event, filename) { + assert.strictEqual(event, 'rename'); + + if (filename === path.basename(testFile)) { + watcher.close(); + watcherClosed = true; + } + }); + + await setTimeout(common.platformTimeout(100)); + fs.mkdirSync(testFile); + + process.once('exit', function() { + assert(watcherClosed, 'watcher Object was not closed'); + }); +})().then(common.mustCall()); diff --git a/tests/node_compat/test/parallel/test-fs-watch-recursive-update-file.js b/tests/node_compat/test/parallel/test-fs-watch-recursive-update-file.js new file mode 100644 index 0000000000..185db0d645 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-watch-recursive-update-file.js @@ -0,0 +1,59 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { setTimeout } = require('timers/promises'); + +if (common.isIBMi) + common.skip('IBMi does not support `fs.watch()`'); + +// fs-watch on folders have limited capability in AIX. +// The testcase makes use of folder watching, and causes +// hang. This behavior is documented. Skip this for AIX. + +if (common.isAIX) + common.skip('folder watch capability is limited in AIX.'); + +const assert = require('assert'); +const path = require('path'); +const fs = require('fs'); + +const tmpdir = require('../common/tmpdir'); +const testDir = tmpdir.path; +tmpdir.refresh(); + +(async () => { + // Watch a folder and update an already existing file in it. + + const rootDirectory = fs.mkdtempSync(testDir + path.sep); + const testDirectory = path.join(rootDirectory, 'test-0'); + fs.mkdirSync(testDirectory); + + const testFile = path.join(testDirectory, 'file-1.txt'); + fs.writeFileSync(testFile, 'hello'); + + const watcher = fs.watch(testDirectory, { recursive: true }); + let watcherClosed = false; + watcher.on('change', common.mustCallAtLeast(function(event, filename) { + // Libuv inconsistenly emits a rename event for the file we are watching + assert.ok(event === 'change' || event === 'rename'); + + if (filename === path.basename(testFile)) { + watcher.close(); + watcherClosed = true; + } + })); + + await setTimeout(common.platformTimeout(100)); + fs.writeFileSync(testFile, 'hello'); + + process.once('exit', function() { + assert(watcherClosed, 'watcher Object was not closed'); + }); +})().then(common.mustCall()); diff --git a/tests/node_compat/test/parallel/test-fs-write-negativeoffset.js b/tests/node_compat/test/parallel/test-fs-write-negativeoffset.js new file mode 100644 index 0000000000..101b6ecc3b --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-write-negativeoffset.js @@ -0,0 +1,58 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// Tests that passing a negative offset does not crash the process + +const common = require('../common'); + +const { + closeSync, + open, + write, + writeSync, +} = require('fs'); + +const assert = require('assert'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +const filename = tmpdir.resolve('test.txt'); + +open(filename, 'w+', common.mustSucceed((fd) => { + assert.throws(() => { + write(fd, Buffer.alloc(0), -1, common.mustNotCall()); + }, { + code: 'ERR_OUT_OF_RANGE', + }); + assert.throws(() => { + writeSync(fd, Buffer.alloc(0), -1); + }, { + code: 'ERR_OUT_OF_RANGE', + }); + closeSync(fd); +})); + +const filename2 = tmpdir.resolve('test2.txt'); + +// Make sure negative length's don't cause aborts either + +open(filename2, 'w+', common.mustSucceed((fd) => { + assert.throws(() => { + write(fd, Buffer.alloc(0), 0, -1, common.mustNotCall()); + }, { + code: 'ERR_OUT_OF_RANGE', + }); + assert.throws(() => { + writeSync(fd, Buffer.alloc(0), 0, -1); + }, { + code: 'ERR_OUT_OF_RANGE', + }); + closeSync(fd); +})); diff --git a/tests/node_compat/test/parallel/test-fs-write-stream-encoding.js b/tests/node_compat/test/parallel/test-fs-write-stream-encoding.js new file mode 100644 index 0000000000..85f63bd7e9 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-write-stream-encoding.js @@ -0,0 +1,42 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const fixtures = require('../common/fixtures'); +const fs = require('fs'); +const stream = require('stream'); +const tmpdir = require('../common/tmpdir'); +const firstEncoding = 'base64'; +const secondEncoding = 'latin1'; + +const examplePath = fixtures.path('x.txt'); +const dummyPath = tmpdir.resolve('x.txt'); + +tmpdir.refresh(); + +const exampleReadStream = fs.createReadStream(examplePath, { + encoding: firstEncoding +}); + +const dummyWriteStream = fs.createWriteStream(dummyPath, { + encoding: firstEncoding +}); + +exampleReadStream.pipe(dummyWriteStream).on('finish', function() { + const assertWriteStream = new stream.Writable({ + write: function(chunk, enc, next) { + const expected = Buffer.from('xyz\n'); + assert(chunk.equals(expected)); + } + }); + assertWriteStream.setDefaultEncoding(secondEncoding); + fs.createReadStream(dummyPath, { + encoding: secondEncoding + }).pipe(assertWriteStream); +}); diff --git a/tests/node_compat/test/parallel/test-fs-write-stream-patch-open.js b/tests/node_compat/test/parallel/test-fs-write-stream-patch-open.js new file mode 100644 index 0000000000..8f9b15c59c --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-write-stream-patch-open.js @@ -0,0 +1,43 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const fs = require('fs'); + +const tmpdir = require('../common/tmpdir'); + +// Run in a child process because 'out' is opened twice, blocking the tmpdir +// and preventing cleanup. +if (process.argv[2] !== 'child') { + // Parent + const assert = require('assert'); + const { fork } = require('child_process'); + tmpdir.refresh(); + + // Run test + const child = fork(__filename, ['child'], { stdio: 'inherit' }); + child.on('exit', common.mustCall(function(code) { + assert.strictEqual(code, 0); + })); + + return; +} + +// Child + +common.expectWarning( + 'DeprecationWarning', + 'WriteStream.prototype.open() is deprecated', 'DEP0135'); +const s = fs.createWriteStream(`${tmpdir.path}/out`); +s.open(); + +process.nextTick(() => { + // Allow overriding open(). + fs.WriteStream.prototype.open = common.mustCall(); + fs.createWriteStream('asd'); +}); diff --git a/tests/node_compat/test/parallel/test-fs-writev.js b/tests/node_compat/test/parallel/test-fs-writev.js new file mode 100644 index 0000000000..2212aa65f4 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-writev.js @@ -0,0 +1,113 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const tmpdir = require('../common/tmpdir'); + +tmpdir.refresh(); + +const expected = 'ümlaut. Лорем 運務ホソモ指及 आपको करने विकास 紙読決多密所 أضف'; + +const getFileName = (i) => tmpdir.resolve(`writev_${i}.txt`); + +/** + * Testing with a array of buffers input + */ + +// fs.writev with array of buffers with all parameters +{ + const filename = getFileName(1); + const fd = fs.openSync(filename, 'w'); + + const buffer = Buffer.from(expected); + const bufferArr = [buffer, buffer]; + + const done = common.mustSucceed((written, buffers) => { + assert.deepStrictEqual(bufferArr, buffers); + const expectedLength = bufferArr.length * buffer.byteLength; + assert.deepStrictEqual(written, expectedLength); + fs.closeSync(fd); + + assert(Buffer.concat(bufferArr).equals(fs.readFileSync(filename))); + }); + + fs.writev(fd, bufferArr, null, done); +} + +// fs.writev with array of buffers without position +{ + const filename = getFileName(2); + const fd = fs.openSync(filename, 'w'); + + const buffer = Buffer.from(expected); + const bufferArr = [buffer, buffer]; + + const done = common.mustSucceed((written, buffers) => { + assert.deepStrictEqual(bufferArr, buffers); + + const expectedLength = bufferArr.length * buffer.byteLength; + assert.deepStrictEqual(written, expectedLength); + fs.closeSync(fd); + + assert(Buffer.concat(bufferArr).equals(fs.readFileSync(filename))); + }); + + fs.writev(fd, bufferArr, done); +} + + +// fs.writev with empty array of buffers +{ + const filename = getFileName(3); + const fd = fs.openSync(filename, 'w'); + const bufferArr = []; + let afterSyncCall = false; + + const done = common.mustSucceed((written, buffers) => { + assert.strictEqual(buffers.length, 0); + assert.strictEqual(written, 0); + assert(afterSyncCall); + fs.closeSync(fd); + }); + + fs.writev(fd, bufferArr, done); + afterSyncCall = true; +} + +/** + * Testing with wrong input types + */ +{ + const filename = getFileName(4); + const fd = fs.openSync(filename, 'w'); + + [false, 'test', {}, [{}], ['sdf'], null, undefined].forEach((i) => { + assert.throws( + () => fs.writev(fd, i, null, common.mustNotCall()), { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError' + } + ); + }); + + fs.closeSync(fd); +} + +// fs.writev with wrong fd types +[false, 'test', {}, [{}], null, undefined].forEach((i) => { + assert.throws( + () => fs.writev(i, common.mustNotCall()), + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError' + } + ); +}); diff --git a/tests/node_compat/test/parallel/test-global-domexception.js b/tests/node_compat/test/parallel/test-global-domexception.js new file mode 100644 index 0000000000..1b88a08916 --- /dev/null +++ b/tests/node_compat/test/parallel/test-global-domexception.js @@ -0,0 +1,18 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); + +const assert = require('assert'); + +assert.strictEqual(typeof DOMException, 'function'); + +assert.throws(() => { + atob('我要抛错!'); +}, DOMException); diff --git a/tests/node_compat/test/parallel/test-global-encoder.js b/tests/node_compat/test/parallel/test-global-encoder.js new file mode 100644 index 0000000000..4a2db0d2f3 --- /dev/null +++ b/tests/node_compat/test/parallel/test-global-encoder.js @@ -0,0 +1,15 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const { strictEqual } = require('assert'); +const util = require('util'); + +strictEqual(TextDecoder, util.TextDecoder); +strictEqual(TextEncoder, util.TextEncoder); diff --git a/tests/node_compat/test/parallel/test-global-webcrypto.js b/tests/node_compat/test/parallel/test-global-webcrypto.js new file mode 100644 index 0000000000..b2074cf8bf --- /dev/null +++ b/tests/node_compat/test/parallel/test-global-webcrypto.js @@ -0,0 +1,20 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const crypto = require('crypto'); + +/* eslint-disable no-restricted-syntax */ +assert.strictEqual(globalThis.crypto, crypto.webcrypto); +assert.strictEqual(Crypto, crypto.webcrypto.constructor); +assert.strictEqual(SubtleCrypto, crypto.webcrypto.subtle.constructor); diff --git a/tests/node_compat/test/parallel/test-global-webstreams.js b/tests/node_compat/test/parallel/test-global-webstreams.js new file mode 100644 index 0000000000..ae61fbe9fb --- /dev/null +++ b/tests/node_compat/test/parallel/test-global-webstreams.js @@ -0,0 +1,31 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); + +const assert = require('assert'); +const webstreams = require('stream/web'); + +assert.strictEqual(ReadableStream, webstreams.ReadableStream); +assert.strictEqual(ReadableStreamDefaultReader, webstreams.ReadableStreamDefaultReader); +assert.strictEqual(ReadableStreamBYOBReader, webstreams.ReadableStreamBYOBReader); +assert.strictEqual(ReadableStreamBYOBRequest, webstreams.ReadableStreamBYOBRequest); +assert.strictEqual(ReadableByteStreamController, webstreams.ReadableByteStreamController); +assert.strictEqual(ReadableStreamDefaultController, webstreams.ReadableStreamDefaultController); +assert.strictEqual(TransformStream, webstreams.TransformStream); +assert.strictEqual(TransformStreamDefaultController, webstreams.TransformStreamDefaultController); +assert.strictEqual(WritableStream, webstreams.WritableStream); +assert.strictEqual(WritableStreamDefaultWriter, webstreams.WritableStreamDefaultWriter); +assert.strictEqual(WritableStreamDefaultController, webstreams.WritableStreamDefaultController); +assert.strictEqual(ByteLengthQueuingStrategy, webstreams.ByteLengthQueuingStrategy); +assert.strictEqual(CountQueuingStrategy, webstreams.CountQueuingStrategy); +assert.strictEqual(TextEncoderStream, webstreams.TextEncoderStream); +assert.strictEqual(TextDecoderStream, webstreams.TextDecoderStream); +assert.strictEqual(CompressionStream, webstreams.CompressionStream); +assert.strictEqual(DecompressionStream, webstreams.DecompressionStream); diff --git a/tests/node_compat/test/parallel/test-http-abort-before-end.js b/tests/node_compat/test/parallel/test-http-abort-before-end.js new file mode 100644 index 0000000000..f144dff65d --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-abort-before-end.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const http = require('http'); + +const server = http.createServer(common.mustNotCall()); + +server.listen(0, common.mustCall(() => { + const req = http.request({ + method: 'GET', + host: '127.0.0.1', + port: server.address().port + }); + + req.on('abort', common.mustCall(() => { + server.close(); + })); + + req.on('error', common.mustNotCall()); + + req.abort(); + req.end(); +})); diff --git a/tests/node_compat/test/parallel/test-http-addrequest-localaddress.js b/tests/node_compat/test/parallel/test-http-addrequest-localaddress.js new file mode 100644 index 0000000000..7f4cbc3f31 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-addrequest-localaddress.js @@ -0,0 +1,44 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); + +// This test ensures that `addRequest`'s Legacy API accepts `localAddress` +// correctly instead of accepting `path`. +// https://github.com/nodejs/node/issues/5051 + +const assert = require('assert'); +const agent = require('http').globalAgent; + +// Small stub just so we can call addRequest directly +const req = { + getHeader: () => {} +}; + +agent.maxSockets = 0; + +// `localAddress` is used when naming requests / sockets while using the Legacy +// API. Port 8080 is hardcoded since this does not create a network connection. +agent.addRequest(req, 'localhost', 8080, '127.0.0.1'); +assert.strictEqual(Object.keys(agent.requests).length, 1); +assert.strictEqual( + Object.keys(agent.requests)[0], + 'localhost:8080:127.0.0.1'); + +// `path` is *not* used when naming requests / sockets. +// Port 8080 is hardcoded since this does not create a network connection +agent.addRequest(req, { + host: 'localhost', + port: 8080, + localAddress: '127.0.0.1', + path: '/foo' +}); +assert.strictEqual(Object.keys(agent.requests).length, 1); +assert.strictEqual( + Object.keys(agent.requests)[0], + 'localhost:8080:127.0.0.1'); diff --git a/tests/node_compat/test/parallel/test-http-agent-false.js b/tests/node_compat/test/parallel/test-http-agent-false.js new file mode 100644 index 0000000000..60dc16d9b0 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-agent-false.js @@ -0,0 +1,53 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const http = require('http'); + +// Sending `agent: false` when `port: null` is also passed in (i.e. the result +// of a `url.parse()` call with the default port used, 80 or 443), should not +// result in an assertion error... +const opts = { + host: '127.0.0.1', + port: null, + path: '/', + method: 'GET', + agent: false +}; + +// We just want an "error" (no local HTTP server on port 80) or "response" +// to happen (user happens ot have HTTP server running on port 80). +// As long as the process doesn't crash from a C++ assertion then we're good. +const req = http.request(opts); + +// Will be called by either the response event or error event, not both +const oneResponse = common.mustCall(); +req.on('response', oneResponse); +req.on('error', oneResponse); +req.end(); diff --git a/tests/node_compat/test/parallel/test-http-agent-keepalive-delay.js b/tests/node_compat/test/parallel/test-http-agent-keepalive-delay.js new file mode 100644 index 0000000000..7cc6120d73 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-agent-keepalive-delay.js @@ -0,0 +1,43 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const { Agent } = require('_http_agent'); + +const agent = new Agent({ + keepAlive: true, + keepAliveMsecs: 1000, +}); + +const server = http.createServer(common.mustCall((req, res) => { + res.end('ok'); +})); + +server.listen(0, common.mustCall(() => { + const createConnection = agent.createConnection; + agent.createConnection = (options, ...args) => { + assert.strictEqual(options.keepAlive, true); + assert.strictEqual(options.keepAliveInitialDelay, agent.keepAliveMsecs); + return createConnection.call(agent, options, ...args); + }; + http.get({ + host: 'localhost', + port: server.address().port, + agent: agent, + path: '/' + }, common.mustCall((res) => { + // for emit end event + res.on('data', () => {}); + res.on('end', () => { + server.close(); + }); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http-agent-maxtotalsockets.js b/tests/node_compat/test/parallel/test-http-agent-maxtotalsockets.js new file mode 100644 index 0000000000..ee7e2bb5d5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-agent-maxtotalsockets.js @@ -0,0 +1,118 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const Countdown = require('../common/countdown'); + +assert.throws(() => new http.Agent({ + maxTotalSockets: 'test', +}), { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + message: 'The "maxTotalSockets" argument must be of type number. ' + + "Received type string ('test')", +}); + +[-1, 0, NaN].forEach((item) => { + assert.throws(() => new http.Agent({ + maxTotalSockets: item, + }), { + code: 'ERR_OUT_OF_RANGE', + name: 'RangeError', + }); +}); + +assert.ok(new http.Agent({ + maxTotalSockets: Infinity, +})); + +function start(param = {}) { + const { maxTotalSockets, maxSockets } = param; + + const agent = new http.Agent({ + keepAlive: true, + keepAliveMsecs: 1000, + maxTotalSockets, + maxSockets, + maxFreeSockets: 3 + }); + + const server = http.createServer(common.mustCall((req, res) => { + res.end('hello world'); + }, 6)); + const server2 = http.createServer(common.mustCall((req, res) => { + res.end('hello world'); + }, 6)); + + server.keepAliveTimeout = 0; + server2.keepAliveTimeout = 0; + + const countdown = new Countdown(12, () => { + assert.strictEqual(getRequestCount(), 0); + agent.destroy(); + server.close(); + server2.close(); + }); + + function handler(s) { + for (let i = 0; i < 6; i++) { + http.get({ + host: 'localhost', + port: s.address().port, + agent, + path: `/${i}`, + }, common.mustCall((res) => { + assert.strictEqual(res.statusCode, 200); + res.resume(); + res.on('end', common.mustCall(() => { + for (const key of Object.keys(agent.sockets)) { + assert(agent.sockets[key].length <= maxSockets); + } + assert(getTotalSocketsCount() <= maxTotalSockets); + countdown.dec(); + })); + })); + } + } + + function getTotalSocketsCount() { + let num = 0; + for (const key of Object.keys(agent.sockets)) { + num += agent.sockets[key].length; + } + return num; + } + + function getRequestCount() { + let num = 0; + for (const key of Object.keys(agent.requests)) { + num += agent.requests[key].length; + } + return num; + } + + server.listen(0, common.mustCall(() => handler(server))); + server2.listen(0, common.mustCall(() => handler(server2))); +} + +// If maxTotalSockets is larger than maxSockets, +// then the origin check will be skipped +// when the socket is removed. +[{ + maxTotalSockets: 2, + maxSockets: 3, +}, { + maxTotalSockets: 3, + maxSockets: 2, +}, { + maxTotalSockets: 2, + maxSockets: 2, +}].forEach(start); diff --git a/tests/node_compat/test/parallel/test-http-agent-no-protocol.js b/tests/node_compat/test/parallel/test-http-agent-no-protocol.js new file mode 100644 index 0000000000..58a43792a9 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-agent-no-protocol.js @@ -0,0 +1,48 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const http = require('http'); +const url = require('url'); + +const server = http.createServer(common.mustCall((req, res) => { + res.end(); +})).listen(0, '127.0.0.1', common.mustCall(() => { + const opts = url.parse(`http://127.0.0.1:${server.address().port}/`); + + // Remove the `protocol` field… the `http` module should fall back + // to "http:", as defined by the global, default `http.Agent` instance. + opts.agent = new http.Agent(); + opts.agent.protocol = null; + + http.get(opts, common.mustCall((res) => { + res.resume(); + server.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http-agent-null.js b/tests/node_compat/test/parallel/test-http-agent-null.js new file mode 100644 index 0000000000..7619be7ecd --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-agent-null.js @@ -0,0 +1,44 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const http = require('http'); + +const server = http.createServer(common.mustCall((req, res) => { + res.end(); +})).listen(0, common.mustCall(() => { + const options = { + agent: null, + port: server.address().port + }; + http.get(options, common.mustCall((res) => { + res.resume(); + server.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http-allow-req-after-204-res.js b/tests/node_compat/test/parallel/test-http-allow-req-after-204-res.js new file mode 100644 index 0000000000..04d2560a44 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-allow-req-after-204-res.js @@ -0,0 +1,68 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const http = require('http'); +const assert = require('assert'); +const Countdown = require('../common/countdown'); + +// first 204 or 304 works, subsequent anything fails +const codes = [204, 200]; + +const countdown = new Countdown(codes.length, () => server.close()); + +const server = http.createServer(common.mustCall((req, res) => { + const code = codes.shift(); + assert.strictEqual(typeof code, 'number'); + assert.ok(code > 0); + res.writeHead(code, {}); + res.end(); +}, codes.length)); + +function nextRequest() { + + const request = http.get({ + port: server.address().port, + path: '/' + }, common.mustCall((response) => { + response.on('end', common.mustCall(() => { + if (countdown.dec()) { + // throws error: + nextRequest(); + // TODO: investigate why this does not work fine even though it should. + // works just fine: + // process.nextTick(nextRequest); + } + })); + response.resume(); + })); + request.end(); +} + +server.listen(0, nextRequest); diff --git a/tests/node_compat/test/parallel/test-http-bind-twice.js b/tests/node_compat/test/parallel/test-http-bind-twice.js new file mode 100644 index 0000000000..6ec3d20708 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-bind-twice.js @@ -0,0 +1,43 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const server1 = http.createServer(common.mustNotCall()); +server1.listen(0, '127.0.0.1', common.mustCall(function() { + const server2 = http.createServer(common.mustNotCall()); + server2.listen(this.address().port, '127.0.0.1', common.mustNotCall()); + + server2.on('error', common.mustCall(function(e) { + assert.strictEqual(e.code, 'EADDRINUSE'); + server1.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http-buffer-sanity.js b/tests/node_compat/test/parallel/test-http-buffer-sanity.js new file mode 100644 index 0000000000..b9b5832be0 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-buffer-sanity.js @@ -0,0 +1,78 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const bufferSize = 5 * 1024 * 1024; +let measuredSize = 0; + +const buffer = Buffer.allocUnsafe(bufferSize); +for (let i = 0; i < buffer.length; i++) { + buffer[i] = i % 256; +} + +const server = http.Server(function(req, res) { + server.close(); + + let i = 0; + + req.on('data', (d) => { + measuredSize += d.length; + for (let j = 0; j < d.length; j++) { + assert.strictEqual(d[j], buffer[i]); + i++; + } + }); + + req.on('end', common.mustCall(() => { + assert.strictEqual(measuredSize, bufferSize); + res.writeHead(200); + res.write('thanks'); + res.end(); + })); +}); + +server.listen(0, common.mustCall(() => { + const req = http.request({ + port: server.address().port, + method: 'POST', + path: '/', + headers: { 'content-length': buffer.length } + }, common.mustCall((res) => { + res.setEncoding('utf8'); + let data = ''; + res.on('data', (chunk) => data += chunk); + res.on('end', common.mustCall(() => { + assert.strictEqual(data, 'thanks'); + })); + })); + req.end(buffer); +})); diff --git a/tests/node_compat/test/parallel/test-http-chunked-smuggling.js b/tests/node_compat/test/parallel/test-http-chunked-smuggling.js new file mode 100644 index 0000000000..ef85d16798 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-chunked-smuggling.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const http = require('http'); +const net = require('net'); +const assert = require('assert'); + +// Verify that invalid chunk extensions cannot be used to perform HTTP request +// smuggling attacks. + +const server = http.createServer(common.mustCall((request, response) => { + assert.notStrictEqual(request.url, '/admin'); + response.end('hello world'); +}), 1); + +server.listen(0, common.mustCall(start)); + +function start() { + const sock = net.connect(server.address().port); + + sock.write('' + + 'GET / HTTP/1.1\r\n' + + 'Host: localhost:8080\r\n' + + 'Transfer-Encoding: chunked\r\n' + + '\r\n' + + '2;\n' + + 'xx\r\n' + + '4c\r\n' + + '0\r\n' + + '\r\n' + + 'GET /admin HTTP/1.1\r\n' + + 'Host: localhost:8080\r\n' + + 'Transfer-Encoding: chunked\r\n' + + '\r\n' + + '0\r\n' + + '\r\n' + ); + + sock.resume(); + sock.on('end', common.mustCall(function() { + server.close(); + })); +} diff --git a/tests/node_compat/test/parallel/test-http-chunked.js b/tests/node_compat/test/parallel/test-http-chunked.js new file mode 100644 index 0000000000..13a7c62b95 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-chunked.js @@ -0,0 +1,63 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const UTF8_STRING = '南越国是前203年至前111年存在于岭南地区的一个国家,' + + '国都位于番禺,疆域包括今天中国的广东、广西两省区的大部份地区,福建省、湖南、' + + '贵州、云南的一小部份地区和越南的北部。南越国是秦朝灭亡后,' + + '由南海郡尉赵佗于前203年起兵兼并桂林郡和象郡后建立。前196年和前179年,' + + '南越国曾先后两次名义上臣属于西汉,成为西汉的“外臣”。前112年,' + + '南越国末代君主赵建德与西汉发生战争,被汉武帝于前111年所灭。' + + '南越国共存在93年,历经五代君主。南越国是岭南地区的第一个有记载的政权国家,' + + '采用封建制和郡县制并存的制度,它的建立保证了秦末乱世岭南地区社会秩序的稳定,' + + '有效的改善了岭南地区落后的政治、经济现状。'; + +const server = http.createServer(common.mustCall((req, res) => { + res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf8' }); + res.end(UTF8_STRING, 'utf8'); +})); +server.listen(0, common.mustCall(() => { + let data = ''; + http.get({ + path: '/', + host: 'localhost', + port: server.address().port + }, common.mustCall((x) => { + x.setEncoding('utf8'); + x.on('data', (c) => data += c); + x.on('end', common.mustCall(() => { + assert.strictEqual(typeof data, 'string'); + assert.strictEqual(UTF8_STRING, data); + server.close(); + })); + })).end(); +})); diff --git a/tests/node_compat/test/parallel/test-http-client-abort2.js b/tests/node_compat/test/parallel/test-http-client-abort2.js new file mode 100644 index 0000000000..f179e49514 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-abort2.js @@ -0,0 +1,45 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const http = require('http'); + +const server = http.createServer(common.mustCall((req, res) => { + res.end('Hello'); +})); + +server.listen(0, common.mustCall(() => { + const options = { port: server.address().port }; + const req = http.get(options, common.mustCall((res) => { + res.on('data', (data) => { + req.abort(); + server.close(); + }); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http-client-check-http-token.js b/tests/node_compat/test/parallel/test-http-client-check-http-token.js new file mode 100644 index 0000000000..2457523b21 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-check-http-token.js @@ -0,0 +1,41 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const Countdown = require('../common/countdown'); + +const expectedSuccesses = [undefined, null, 'GET', 'post']; +const expectedFails = [-1, 1, 0, {}, true, false, [], Symbol()]; + +const countdown = + new Countdown(expectedSuccesses.length, + common.mustCall(() => server.close())); + +const server = http.createServer(common.mustCall((req, res) => { + res.end(); + countdown.dec(); +}, expectedSuccesses.length)); + +server.listen(0, common.mustCall(() => { + expectedFails.forEach((method) => { + assert.throws(() => { + http.request({ method, path: '/' }, common.mustNotCall()); + }, { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + message: 'The "options.method" property must be of type string.' + + common.invalidArgTypeHelper(method) + }); + }); + + expectedSuccesses.forEach((method) => { + http.request({ method, port: server.address().port }).end(); + }); +})); diff --git a/tests/node_compat/test/parallel/test-http-client-close-with-default-agent.js b/tests/node_compat/test/parallel/test-http-client-close-with-default-agent.js new file mode 100644 index 0000000000..67c2ae6156 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-close-with-default-agent.js @@ -0,0 +1,30 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const server = http.createServer(function(req, res) { + res.writeHead(200); + res.end(); +}); + +server.listen(0, common.mustCall(() => { + const req = http.get({ port: server.address().port }, (res) => { + assert.strictEqual(res.statusCode, 200); + res.resume(); + server.close(); + }); + + req.end(); +})); + +// This timer should never go off as the server will close the socket +setTimeout(common.mustNotCall(), common.platformTimeout(1000)).unref(); diff --git a/tests/node_compat/test/parallel/test-http-client-default-headers-exist.js b/tests/node_compat/test/parallel/test-http-client-default-headers-exist.js new file mode 100644 index 0000000000..883154db3d --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-default-headers-exist.js @@ -0,0 +1,77 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const { once } = require('events'); + +const expectedHeaders = { + 'DELETE': ['host', 'connection'], + 'GET': ['host', 'connection'], + 'HEAD': ['host', 'connection'], + 'OPTIONS': ['host', 'connection'], + 'POST': ['host', 'connection', 'content-length'], + 'PUT': ['host', 'connection', 'content-length'], + 'TRACE': ['host', 'connection'] +}; + +const expectedMethods = Object.keys(expectedHeaders); + +const server = http.createServer(common.mustCall((req, res) => { + res.end(); + + assert(Object.hasOwn(expectedHeaders, req.method), + `${req.method} was an unexpected method`); + + const requestHeaders = Object.keys(req.headers); + requestHeaders.forEach((header) => { + assert.ok( + expectedHeaders[req.method].includes(header.toLowerCase()), + `${header} should not exist for method ${req.method}` + ); + }); + + assert.strictEqual( + requestHeaders.length, + expectedHeaders[req.method].length, + `some headers were missing for method: ${req.method}` + ); +}, expectedMethods.length)); + +server.listen(0, common.mustCall(() => { + Promise.all(expectedMethods.map(async (method) => { + const request = http.request({ + method: method, + port: server.address().port + }).end(); + return once(request, 'response'); + })).then(common.mustCall(() => { server.close(); })); +})); diff --git a/tests/node_compat/test/parallel/test-http-client-defaults.js b/tests/node_compat/test/parallel/test-http-client-defaults.js new file mode 100644 index 0000000000..815dd60c0d --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-defaults.js @@ -0,0 +1,30 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const assert = require('assert'); +const ClientRequest = require('http').ClientRequest; + +{ + const req = new ClientRequest({ createConnection: () => {} }); + assert.strictEqual(req.path, '/'); + assert.strictEqual(req.method, 'GET'); +} + +{ + const req = new ClientRequest({ method: '', createConnection: () => {} }); + assert.strictEqual(req.path, '/'); + assert.strictEqual(req.method, 'GET'); +} + +{ + const req = new ClientRequest({ path: '', createConnection: () => {} }); + assert.strictEqual(req.path, '/'); + assert.strictEqual(req.method, 'GET'); +} diff --git a/tests/node_compat/test/parallel/test-http-client-encoding.js b/tests/node_compat/test/parallel/test-http-client-encoding.js new file mode 100644 index 0000000000..3003bdf6e0 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-encoding.js @@ -0,0 +1,46 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const server = http.createServer((req, res) => { + res.end('ok'); + server.close(); +}).listen(0, common.mustCall(() => { + http.request({ + port: server.address().port, + encoding: 'utf8' + }, common.mustCall((res) => { + let data = ''; + res.on('data', (chunk) => data += chunk); + res.on('end', common.mustCall(() => assert.strictEqual(data, 'ok'))); + })).end(); +})); diff --git a/tests/node_compat/test/parallel/test-http-client-headers-array.js b/tests/node_compat/test/parallel/test-http-client-headers-array.js new file mode 100644 index 0000000000..9558d22f6a --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-headers-array.js @@ -0,0 +1,77 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); + +const assert = require('assert'); +const http = require('http'); + +function execute(options) { + http.createServer(function(req, res) { + const expectHeaders = { + 'x-foo': 'boom', + 'cookie': 'a=1; b=2; c=3', + 'connection': 'keep-alive', + 'host': 'example.com', + }; + + // no Host header when you set headers an array + if (!Array.isArray(options.headers)) { + expectHeaders.host = `localhost:${this.address().port}`; + } + + // no Authorization header when you set headers an array + if (options.auth && !Array.isArray(options.headers)) { + expectHeaders.authorization = + `Basic ${Buffer.from(options.auth).toString('base64')}`; + } + + this.close(); + + assert.deepStrictEqual(req.headers, expectHeaders); + + res.writeHead(200, { 'Connection': 'close' }); + res.end(); + }).listen(0, function() { + options = Object.assign(options, { + port: this.address().port, + path: '/' + }); + const req = http.request(options); + req.end(); + }); +} + +// Should be the same except for implicit Host header on the first two +execute({ headers: { 'x-foo': 'boom', 'cookie': 'a=1; b=2; c=3' } }); +execute({ headers: { 'x-foo': 'boom', 'cookie': [ 'a=1', 'b=2', 'c=3' ] } }); +execute({ headers: [ + [ 'x-foo', 'boom' ], + [ 'cookie', 'a=1; b=2; c=3' ], + [ 'Host', 'example.com' ], +] }); +execute({ headers: [ + [ 'x-foo', 'boom' ], + [ 'cookie', [ 'a=1', 'b=2', 'c=3' ]], + [ 'Host', 'example.com' ], +] }); +execute({ headers: [ + [ 'x-foo', 'boom' ], [ 'cookie', 'a=1' ], + [ 'cookie', 'b=2' ], [ 'cookie', 'c=3' ], + [ 'Host', 'example.com'], +] }); + +// Authorization and Host header both missing from the second +execute({ auth: 'foo:bar', headers: + { 'x-foo': 'boom', 'cookie': 'a=1; b=2; c=3' } }); +execute({ auth: 'foo:bar', headers: [ + [ 'x-foo', 'boom' ], [ 'cookie', 'a=1' ], + [ 'cookie', 'b=2' ], [ 'cookie', 'c=3'], + [ 'Host', 'example.com'], +] }); diff --git a/tests/node_compat/test/parallel/test-http-client-invalid-path.js b/tests/node_compat/test/parallel/test-http-client-invalid-path.js new file mode 100644 index 0000000000..096d767498 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-invalid-path.js @@ -0,0 +1,20 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); + +assert.throws(() => { + http.request({ + path: '/thisisinvalid\uffe2' + }).end(); +}, { + code: 'ERR_UNESCAPED_CHARACTERS', + name: 'TypeError' +}); diff --git a/tests/node_compat/test/parallel/test-http-client-keep-alive-hint.js b/tests/node_compat/test/parallel/test-http-client-keep-alive-hint.js new file mode 100644 index 0000000000..91141329e0 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-keep-alive-hint.js @@ -0,0 +1,34 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const server = http.createServer( + { keepAliveTimeout: common.platformTimeout(60000) }, + function(req, res) { + req.resume(); + res.writeHead(200, { 'Connection': 'keep-alive', 'Keep-Alive': 'timeout=1' }); + res.end('FOO'); + } +); + +server.listen(0, common.mustCall(() => { + http.get({ port: server.address().port }, (res) => { + assert.strictEqual(res.statusCode, 200); + + res.resume(); + server.close(); + }); +})); + + +// This timer should never go off as the agent will parse the hint and terminate earlier +setTimeout(common.mustNotCall(), common.platformTimeout(3000)).unref(); diff --git a/tests/node_compat/test/parallel/test-http-client-race-2.js b/tests/node_compat/test/parallel/test-http-client-race-2.js new file mode 100644 index 0000000000..09e77070fd --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-race-2.js @@ -0,0 +1,119 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); + +// +// Slight variation on test-http-client-race to test for another race +// condition involving the parsers FreeList used internally by http.Client. +// + +const body1_s = '1111111111111111'; +const body2_s = '22222'; +const body3_s = '3333333333333333333'; + +const server = http.createServer(function(req, res) { + const pathname = url.parse(req.url).pathname; + + let body; + switch (pathname) { + case '/1': body = body1_s; break; + case '/2': body = body2_s; break; + default: body = body3_s; + } + + res.writeHead(200, { + 'Content-Type': 'text/plain', + 'Content-Length': body.length + }); + res.end(body); +}); +server.listen(0); + +let body1 = ''; +let body2 = ''; +let body3 = ''; + +server.on('listening', function() { + // + // Client #1 is assigned Parser #1 + // + const req1 = http.get({ port: this.address().port, path: '/1' }); + req1.on('response', function(res1) { + res1.setEncoding('utf8'); + + res1.on('data', function(chunk) { + body1 += chunk; + }); + + res1.on('end', function() { + // + // Delay execution a little to allow the 'close' event to be processed + // (required to trigger this bug!) + // + setTimeout(function() { + // + // The bug would introduce itself here: Client #2 would be allocated the + // parser that previously belonged to Client #1. But we're not finished + // with Client #1 yet! + // + // At this point, the bug would manifest itself and crash because the + // internal state of the parser was no longer valid for use by Client #1 + // + const req2 = http.get({ port: server.address().port, path: '/2' }); + req2.on('response', function(res2) { + res2.setEncoding('utf8'); + res2.on('data', function(chunk) { body2 += chunk; }); + res2.on('end', function() { + + // + // Just to be really sure we've covered all our bases, execute a + // request using client2. + // + const req3 = http.get({ port: server.address().port, path: '/3' }); + req3.on('response', function(res3) { + res3.setEncoding('utf8'); + res3.on('data', function(chunk) { body3 += chunk; }); + res3.on('end', function() { server.close(); }); + }); + }); + }); + }, 500); + }); + }); +}); + +process.on('exit', function() { + assert.strictEqual(body1_s, body1); + assert.strictEqual(body2_s, body2); + assert.strictEqual(body3_s, body3); +}); diff --git a/tests/node_compat/test/parallel/test-http-client-race.js b/tests/node_compat/test/parallel/test-http-client-race.js new file mode 100644 index 0000000000..0dff9ce830 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-race.js @@ -0,0 +1,76 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); + +const body1_s = '1111111111111111'; +const body2_s = '22222'; + +const server = http.createServer(function(req, res) { + const body = url.parse(req.url).pathname === '/1' ? body1_s : body2_s; + res.writeHead(200, { + 'Content-Type': 'text/plain', + 'Content-Length': body.length + }); + res.end(body); +}); +server.listen(0); + +let body1 = ''; +let body2 = ''; + +server.on('listening', function() { + const req1 = http.request({ port: this.address().port, path: '/1' }); + req1.end(); + req1.on('response', function(res1) { + res1.setEncoding('utf8'); + + res1.on('data', function(chunk) { + body1 += chunk; + }); + + res1.on('end', function() { + const req2 = http.request({ port: server.address().port, path: '/2' }); + req2.end(); + req2.on('response', function(res2) { + res2.setEncoding('utf8'); + res2.on('data', function(chunk) { body2 += chunk; }); + res2.on('end', function() { server.close(); }); + }); + }); + }); +}); + +process.on('exit', function() { + assert.strictEqual(body1_s, body1); + assert.strictEqual(body2_s, body2); +}); diff --git a/tests/node_compat/test/parallel/test-http-client-reject-unexpected-agent.js b/tests/node_compat/test/parallel/test-http-client-reject-unexpected-agent.js new file mode 100644 index 0000000000..4bfd4210a9 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-reject-unexpected-agent.js @@ -0,0 +1,76 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const baseOptions = { + method: 'GET', + port: undefined, + host: common.localhostIPv4, +}; + +const failingAgentOptions = [ + true, + 'agent', + {}, + 1, + () => null, + Symbol(), +]; + +const acceptableAgentOptions = [ + false, + undefined, + null, + new http.Agent(), +]; + +const server = http.createServer((req, res) => { + res.end('hello'); +}); + +let numberOfResponses = 0; + +function createRequest(agent) { + const options = Object.assign(baseOptions, { agent }); + const request = http.request(options); + request.end(); + request.on('response', common.mustCall(() => { + numberOfResponses++; + if (numberOfResponses === acceptableAgentOptions.length) { + server.close(); + } + })); +} + +server.listen(0, baseOptions.host, common.mustCall(function() { + baseOptions.port = this.address().port; + + failingAgentOptions.forEach((agent) => { + assert.throws( + () => createRequest(agent), + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + message: 'The "options.agent" property must be one of Agent-like ' + + 'Object, undefined, or false.' + + common.invalidArgTypeHelper(agent) + } + ); + }); + + acceptableAgentOptions.forEach((agent) => { + createRequest(agent); + }); +})); + +process.on('exit', () => { + assert.strictEqual(numberOfResponses, acceptableAgentOptions.length); +}); diff --git a/tests/node_compat/test/parallel/test-http-client-timeout-connect-listener.js b/tests/node_compat/test/parallel/test-http-client-timeout-connect-listener.js new file mode 100644 index 0000000000..c151d16556 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-timeout-connect-listener.js @@ -0,0 +1,49 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +// This test ensures that `ClientRequest.prototype.setTimeout()` does +// not add a listener for the `'connect'` event to the socket if the +// socket is already connected. + +const assert = require('assert'); +const http = require('http'); + +// Maximum allowed value for timeouts. +const timeout = 2 ** 31 - 1; + +const server = http.createServer((req, res) => { + res.end(); +}); + +server.listen(0, common.mustCall(() => { + const agent = new http.Agent({ keepAlive: true, maxSockets: 1 }); + const options = { port: server.address().port, agent: agent }; + + doRequest(options, common.mustCall(() => { + const req = doRequest(options, common.mustCall(() => { + agent.destroy(); + server.close(); + })); + + req.on('socket', common.mustCall((socket) => { + assert.strictEqual(socket.listenerCount('connect'), 0); + })); + })); +})); + +function doRequest(options, callback) { + const req = http.get(options, (res) => { + res.on('end', callback); + res.resume(); + }); + + req.setTimeout(timeout); + return req; +} diff --git a/tests/node_compat/test/parallel/test-http-client-timeout-with-data.js b/tests/node_compat/test/parallel/test-http-client-timeout-with-data.js new file mode 100644 index 0000000000..9e0f521b2e --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-timeout-with-data.js @@ -0,0 +1,70 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +let nchunks = 0; + +const options = { + method: 'GET', + port: undefined, + host: '127.0.0.1', + path: '/' +}; + +const server = http.createServer(function(req, res) { + res.writeHead(200, { 'Content-Length': '2' }); + res.write('*'); + server.once('timeout', common.mustCall(function() { res.end('*'); })); +}); + +server.listen(0, options.host, function() { + options.port = this.address().port; + const req = http.request(options, onresponse); + req.end(); + + function onresponse(res) { + req.setTimeout(50, common.mustCall(function() { + assert.strictEqual(nchunks, 1); // Should have received the first chunk + server.emit('timeout'); + })); + + res.on('data', common.mustCall(function(data) { + assert.strictEqual(String(data), '*'); + nchunks++; + }, 2)); + + res.on('end', common.mustCall(function() { + assert.strictEqual(nchunks, 2); + server.close(); + })); + } +}); diff --git a/tests/node_compat/test/parallel/test-http-client-unescaped-path.js b/tests/node_compat/test/parallel/test-http-client-unescaped-path.js new file mode 100644 index 0000000000..6ae8106390 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-unescaped-path.js @@ -0,0 +1,44 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +for (let i = 0; i <= 32; i += 1) { + const path = `bad${String.fromCharCode(i)}path`; + assert.throws( + () => http.get({ path }, common.mustNotCall()), + { + code: 'ERR_UNESCAPED_CHARACTERS', + name: 'TypeError', + message: 'Request path contains unescaped characters' + } + ); +} diff --git a/tests/node_compat/test/parallel/test-http-client-upload-buf.js b/tests/node_compat/test/parallel/test-http-client-upload-buf.js new file mode 100644 index 0000000000..a8299363fc --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-upload-buf.js @@ -0,0 +1,71 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const N = 1024; + +const server = http.createServer(common.mustCall(function(req, res) { + assert.strictEqual(req.method, 'POST'); + let bytesReceived = 0; + + req.on('data', function(chunk) { + bytesReceived += chunk.length; + }); + + req.on('end', common.mustCall(function() { + assert.strictEqual(N, bytesReceived); + console.log('request complete from server'); + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.write('hello\n'); + res.end(); + })); +})); +server.listen(0); + +server.on('listening', common.mustCall(function() { + const req = http.request({ + port: this.address().port, + method: 'POST', + path: '/' + }, common.mustCall(function(res) { + res.setEncoding('utf8'); + res.on('data', function(chunk) { + console.log(chunk); + }); + res.on('end', common.mustCall(function() { + server.close(); + })); + })); + + req.write(Buffer.allocUnsafe(N)); + req.end(); +})); diff --git a/tests/node_compat/test/parallel/test-http-client-upload.js b/tests/node_compat/test/parallel/test-http-client-upload.js new file mode 100644 index 0000000000..4501c1e5fe --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-client-upload.js @@ -0,0 +1,74 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const server = http.createServer(common.mustCall(function(req, res) { + assert.strictEqual(req.method, 'POST'); + req.setEncoding('utf8'); + + let sent_body = ''; + + req.on('data', function(chunk) { + console.log(`server got: ${JSON.stringify(chunk)}`); + sent_body += chunk; + }); + + req.on('end', common.mustCall(function() { + assert.strictEqual(sent_body, '1\n2\n3\n'); + console.log('request complete from server'); + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.write('hello\n'); + res.end(); + })); +})); +server.listen(0); + +server.on('listening', common.mustCall(function() { + const req = http.request({ + port: this.address().port, + method: 'POST', + path: '/' + }, common.mustCall(function(res) { + res.setEncoding('utf8'); + res.on('data', function(chunk) { + console.log(chunk); + }); + res.on('end', common.mustCall(function() { + server.close(); + })); + })); + + req.write('1\n'); + req.write('2\n'); + req.write('3\n'); + req.end(); +})); diff --git a/tests/node_compat/test/parallel/test-http-common.js b/tests/node_compat/test/parallel/test-http-common.js new file mode 100644 index 0000000000..ce900ea72b --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-common.js @@ -0,0 +1,40 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const httpCommon = require('_http_common'); +const checkIsHttpToken = httpCommon._checkIsHttpToken; +const checkInvalidHeaderChar = httpCommon._checkInvalidHeaderChar; + +// checkIsHttpToken +assert(checkIsHttpToken('t')); +assert(checkIsHttpToken('tt')); +assert(checkIsHttpToken('ttt')); +assert(checkIsHttpToken('tttt')); +assert(checkIsHttpToken('ttttt')); + +assert.strictEqual(checkIsHttpToken(''), false); +assert.strictEqual(checkIsHttpToken(' '), false); +assert.strictEqual(checkIsHttpToken('あ'), false); +assert.strictEqual(checkIsHttpToken('あa'), false); +assert.strictEqual(checkIsHttpToken('aaaaあaaaa'), false); + +// checkInvalidHeaderChar +assert(checkInvalidHeaderChar('あ')); +assert(checkInvalidHeaderChar('aaaaあaaaa')); + +assert.strictEqual(checkInvalidHeaderChar(''), false); +assert.strictEqual(checkInvalidHeaderChar(1), false); +assert.strictEqual(checkInvalidHeaderChar(' '), false); +assert.strictEqual(checkInvalidHeaderChar(false), false); +assert.strictEqual(checkInvalidHeaderChar('t'), false); +assert.strictEqual(checkInvalidHeaderChar('tt'), false); +assert.strictEqual(checkInvalidHeaderChar('ttt'), false); +assert.strictEqual(checkInvalidHeaderChar('tttt'), false); +assert.strictEqual(checkInvalidHeaderChar('ttttt'), false); diff --git a/tests/node_compat/test/parallel/test-http-contentLength0.js b/tests/node_compat/test/parallel/test-http-contentLength0.js new file mode 100644 index 0000000000..8a0dc19ff3 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-contentLength0.js @@ -0,0 +1,51 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const http = require('http'); + +// Simple test of Node's HTTP Client choking on a response +// with a 'Content-Length: 0 ' response header. +// I.E. a space character after the 'Content-Length' throws an `error` event. + + +const s = http.createServer(function(req, res) { + res.writeHead(200, { 'Content-Length': '0 ' }); + res.end(); +}); +s.listen(0, function() { + + const request = http.request({ port: this.address().port }, (response) => { + console.log(`STATUS: ${response.statusCode}`); + s.close(); + response.resume(); + }); + + request.end(); +}); diff --git a/tests/node_compat/test/parallel/test-http-correct-hostname.js b/tests/node_compat/test/parallel/test-http-correct-hostname.js new file mode 100644 index 0000000000..a38d57f03d --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-correct-hostname.js @@ -0,0 +1,35 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +/* eslint-disable node-core/crypto-check */ +// Flags: --expose-internals +'use strict'; + +const common = require('../common'); +const assert = require('assert'); + +const { kOutHeaders } = require('internal/http'); + +const http = require('http'); +const modules = { http }; + +if (common.hasCrypto) { + const https = require('https'); + modules.https = https; +} + +Object.keys(modules).forEach((module) => { + const doNotCall = common.mustNotCall( + `${module}.request should not connect to ${module}://example.com%60x.example.com` + ); + const req = modules[module].request(`${module}://example.com%60x.example.com`, doNotCall); + assert.deepStrictEqual(req[kOutHeaders].host, [ + 'Host', + 'example.com`x.example.com', + ]); + req.abort(); +}); diff --git a/tests/node_compat/test/parallel/test-http-date-header.js b/tests/node_compat/test/parallel/test-http-date-header.js new file mode 100644 index 0000000000..4299a6848a --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-date-header.js @@ -0,0 +1,62 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); + +const testResBody = 'other stuff!\n'; + +const server = http.createServer((req, res) => { + assert.ok(!('date' in req.headers), + 'Request headers contained a Date.'); + res.writeHead(200, { + 'Content-Type': 'text/plain' + }); + res.end(testResBody); +}); +server.listen(0); + + +server.addListener('listening', () => { + const options = { + port: server.address().port, + path: '/', + method: 'GET' + }; + const req = http.request(options, (res) => { + assert.ok('date' in res.headers, + 'Response headers didn\'t contain a Date.'); + res.addListener('end', () => { + server.close(); + }); + res.resume(); + }); + req.end(); +}); diff --git a/tests/node_compat/test/parallel/test-http-decoded-auth.js b/tests/node_compat/test/parallel/test-http-decoded-auth.js new file mode 100644 index 0000000000..a0d2eb953e --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-decoded-auth.js @@ -0,0 +1,55 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); + +const testCases = [ + { + username: 'test@test"', + password: '123456^', + expected: 'dGVzdEB0ZXN0IjoxMjM0NTZe' + }, + { + username: 'test%40test', + password: '123456', + expected: 'dGVzdEB0ZXN0OjEyMzQ1Ng==' + }, + { + username: 'not%3Agood', + password: 'god', + expected: 'bm90Omdvb2Q6Z29k' + }, + { + username: 'not%22good', + password: 'g%5Eod', + expected: 'bm90Imdvb2Q6Z15vZA==' + }, + { + username: 'test1234::::', + password: 'mypass', + expected: 'dGVzdDEyMzQ6Ojo6Om15cGFzcw==' + }, +]; + +for (const testCase of testCases) { + const server = http.createServer(function(request, response) { + // The correct authorization header is be passed + assert.strictEqual(request.headers.authorization, `Basic ${testCase.expected}`); + response.writeHead(200, {}); + response.end('ok'); + server.close(); + }); + + server.listen(0, function() { + // make the request + const url = new URL(`http://${testCase.username}:${testCase.password}@localhost:${this.address().port}`); + http.request(url).end(); + }); +} diff --git a/tests/node_compat/test/parallel/test-http-default-encoding.js b/tests/node_compat/test/parallel/test-http-default-encoding.js new file mode 100644 index 0000000000..a87831c632 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-default-encoding.js @@ -0,0 +1,65 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); + +const expected = 'This is a unicode text: سلام'; +let result = ''; + +const server = http.Server((req, res) => { + req.setEncoding('utf8'); + req.on('data', (chunk) => { + result += chunk; + }).on('end', () => { + res.writeHead(200); + res.end('hello world\n'); + server.close(); + }); + +}); + +server.listen(0, function() { + http.request({ + port: this.address().port, + path: '/', + method: 'POST' + }, (res) => { + console.log(res.statusCode); + res.resume(); + }).on('error', (e) => { + console.log(e.message); + process.exit(1); + }).end(expected); +}); + +process.on('exit', () => { + assert.strictEqual(result, expected); +}); diff --git a/tests/node_compat/test/parallel/test-http-dump-req-when-res-ends.js b/tests/node_compat/test/parallel/test-http-dump-req-when-res-ends.js new file mode 100644 index 0000000000..3b94250f5a --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-dump-req-when-res-ends.js @@ -0,0 +1,73 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const { mustCall } = require('../common'); + +const fs = require('fs'); +const http = require('http'); +const { strictEqual } = require('assert'); + +const server = http.createServer(mustCall(function(req, res) { + strictEqual(req.socket.listenerCount('data'), 1); + req.socket.once('data', mustCall(function() { + // Ensure that a chunk of data is received before calling `res.end()`. + res.end('hello world'); + })); + // This checks if the request gets dumped + // resume will be triggered by res.end(). + req.on('resume', mustCall(function() { + // There is no 'data' event handler anymore + // it gets automatically removed when dumping the request. + strictEqual(req.listenerCount('data'), 0); + req.on('data', mustCall()); + })); + + // We explicitly pause the stream + // so that the following on('data') does not cause + // a resume. + req.pause(); + req.on('data', function() {}); + + // Start sending the response. + res.flushHeaders(); +})); + +server.listen(0, mustCall(function() { + const req = http.request({ + method: 'POST', + port: server.address().port + }); + + // Send the http request without waiting + // for the body. + req.flushHeaders(); + + req.on('response', mustCall(function(res) { + // Pipe the body as soon as we get the headers of the + // response back. + fs.createReadStream(__filename).pipe(req); + + res.resume(); + + // On some platforms the `'end'` event might not be emitted because the + // socket could be destroyed by the other peer while data is still being + // sent. In this case the 'aborted'` event is emitted instead of `'end'`. + // `'close'` is used here because it is always emitted and does not + // invalidate the test. + res.on('close', function() { + server.close(); + }); + })); + + req.on('error', function() { + // An error can happen if there is some data still + // being sent, as the other side is calling .destroy() + // this is safe to ignore. + }); +})); diff --git a/tests/node_compat/test/parallel/test-http-end-throw-socket-handling.js b/tests/node_compat/test/parallel/test-http-end-throw-socket-handling.js new file mode 100644 index 0000000000..2e963648e8 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-end-throw-socket-handling.js @@ -0,0 +1,60 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const Countdown = require('../common/countdown'); + +// Make sure that throwing in 'end' handler doesn't lock +// up the socket forever. +// +// This is NOT a good way to handle errors in general, but all +// the same, we should not be so brittle and easily broken. + +const http = require('http'); +const countdown = new Countdown(10, () => server.close()); + +const server = http.createServer((req, res) => { + countdown.dec(); + res.end('ok'); +}); + +server.listen(0, common.mustCall(() => { + for (let i = 0; i < 10; i++) { + const options = { port: server.address().port }; + const req = http.request(options, (res) => { + res.resume(); + res.on('end', common.mustCall(() => { + throw new Error('gleep glorp'); + })); + }); + req.end(); + } +})); + +process.on('uncaughtException', common.mustCall(10)); diff --git a/tests/node_compat/test/parallel/test-http-eof-on-connect.js b/tests/node_compat/test/parallel/test-http-eof-on-connect.js new file mode 100644 index 0000000000..7a682a03c0 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-eof-on-connect.js @@ -0,0 +1,48 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +const common = require('../common'); +const net = require('net'); +const http = require('http'); + +// This is a regression test for https://github.com/joyent/node/issues/44 +// It is separate from test-http-malformed-request.js because it is only +// reproducible on the first packet on the first connection to a server. + +const server = http.createServer(common.mustNotCall()); +server.listen(0); + +server.on('listening', function() { + net.createConnection(this.address().port).on('connect', function() { + this.destroy(); + }).on('close', function() { + server.close(); + }); +}); diff --git a/tests/node_compat/test/parallel/test-http-extra-response.js b/tests/node_compat/test/parallel/test-http-extra-response.js new file mode 100644 index 0000000000..5d2ba9d36f --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-extra-response.js @@ -0,0 +1,87 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); + +// If an HTTP server is broken and sends data after the end of the response, +// node should ignore it and drop the connection. +// Demos this bug: https://github.com/joyent/node/issues/680 + +const body = 'hello world\r\n'; +const fullResponse = + 'HTTP/1.1 500 Internal Server Error\r\n' + + `Content-Length: ${body.length}\r\n` + + 'Content-Type: text/plain\r\n' + + 'Date: Fri + 18 Feb 2011 06:22:45 GMT\r\n' + + 'Host: 10.20.149.2\r\n' + + 'Access-Control-Allow-Credentials: true\r\n' + + 'Server: badly broken/0.1 (OS NAME)\r\n' + + '\r\n' + + body; + +const server = net.createServer(function(socket) { + let postBody = ''; + + socket.setEncoding('utf8'); + + socket.on('data', function(chunk) { + postBody += chunk; + + if (postBody.includes('\r\n')) { + socket.write(fullResponse); + socket.end(fullResponse); + } + }); + + socket.on('error', function(err) { + assert.strictEqual(err.code, 'ECONNRESET'); + }); +}); + + +server.listen(0, common.mustCall(function() { + http.get({ port: this.address().port }, common.mustCall(function(res) { + let buffer = ''; + console.log(`Got res code: ${res.statusCode}`); + + res.setEncoding('utf8'); + res.on('data', function(chunk) { + buffer += chunk; + }); + + res.on('end', common.mustCall(function() { + console.log(`Response ended, read ${buffer.length} bytes`); + assert.strictEqual(body, buffer); + server.close(); + })); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http-flush-headers.js b/tests/node_compat/test/parallel/test-http-flush-headers.js new file mode 100644 index 0000000000..5b5fe34199 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-flush-headers.js @@ -0,0 +1,27 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); + +const server = http.createServer(); +server.on('request', function(req, res) { + assert.strictEqual(req.headers.foo, 'bar'); + res.end('ok'); + server.close(); +}); +server.listen(0, '127.0.0.1', function() { + const req = http.request({ + method: 'GET', + host: '127.0.0.1', + port: this.address().port, + }); + req.setHeader('foo', 'bar'); + req.flushHeaders(); +}); diff --git a/tests/node_compat/test/parallel/test-http-full-response.js b/tests/node_compat/test/parallel/test-http-full-response.js new file mode 100644 index 0000000000..cef22c7c80 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-full-response.js @@ -0,0 +1,88 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +// This test requires the program 'ab' +const http = require('http'); +const exec = require('child_process').exec; + +const bodyLength = 12345; + +const body = 'c'.repeat(bodyLength); + +const server = http.createServer(function(req, res) { + res.writeHead(200, { + 'Content-Length': bodyLength, + 'Content-Type': 'text/plain' + }); + res.end(body); +}); + +function runAb(opts, callback) { + const command = `ab ${opts} http://127.0.0.1:${server.address().port}/`; + exec(command, function(err, stdout, stderr) { + if (err) { + if (/ab|apr/i.test(stderr)) { + common.printSkipMessage(`problem spawning \`ab\`.\n${stderr}`); + process.reallyExit(0); + } + throw err; + } + + let m = /Document Length:\s*(\d+) bytes/i.exec(stdout); + const documentLength = parseInt(m[1]); + + m = /Complete requests:\s*(\d+)/i.exec(stdout); + const completeRequests = parseInt(m[1]); + + m = /HTML transferred:\s*(\d+) bytes/i.exec(stdout); + const htmlTransferred = parseInt(m[1]); + + assert.strictEqual(bodyLength, documentLength); + assert.strictEqual(completeRequests * documentLength, htmlTransferred); + + if (callback) callback(); + }); +} + +server.listen(0, common.mustCall(function() { + runAb('-c 1 -n 10', common.mustCall(function() { + console.log('-c 1 -n 10 okay'); + + runAb('-c 1 -n 100', common.mustCall(function() { + console.log('-c 1 -n 100 okay'); + + runAb('-c 1 -n 1000', common.mustCall(function() { + console.log('-c 1 -n 1000 okay'); + server.close(); + })); + })); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http-head-request.js b/tests/node_compat/test/parallel/test-http-head-request.js new file mode 100644 index 0000000000..fe3cc09ed1 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-head-request.js @@ -0,0 +1,64 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const http = require('http'); + +const body = 'hello world\n'; + +function test(headers) { + const server = http.createServer(function(req, res) { + console.error('req: %s headers: %j', req.method, headers); + res.writeHead(200, headers); + res.end(); + server.close(); + }); + + server.listen(0, common.mustCall(function() { + const request = http.request({ + port: this.address().port, + method: 'HEAD', + path: '/' + }, common.mustCall(function(response) { + console.error('response start'); + response.on('end', common.mustCall(function() { + console.error('response end'); + })); + response.resume(); + })); + request.end(); + })); +} + +test({ + 'Transfer-Encoding': 'chunked' +}); +test({ + 'Content-Length': body.length +}); diff --git a/tests/node_compat/test/parallel/test-http-head-response-has-no-body-end-implicit-headers.js b/tests/node_compat/test/parallel/test-http-head-response-has-no-body-end-implicit-headers.js new file mode 100644 index 0000000000..514fb4584b --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-head-response-has-no-body-end-implicit-headers.js @@ -0,0 +1,34 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const http = require('http'); + +// This test is to make sure that when the HTTP server +// responds to a HEAD request with data to res.end, +// it does not send any body but the response is sent +// anyway. + +const server = http.createServer(function(req, res) { + res.end('FAIL'); // broken: sends FAIL from hot path. +}); +server.listen(0); + +server.on('listening', common.mustCall(function() { + const req = http.request({ + port: this.address().port, + method: 'HEAD', + path: '/' + }, common.mustCall(function(res) { + res.on('end', common.mustCall(function() { + server.close(); + })); + res.resume(); + })); + req.end(); +})); diff --git a/tests/node_compat/test/parallel/test-http-head-response-has-no-body-end.js b/tests/node_compat/test/parallel/test-http-head-response-has-no-body-end.js new file mode 100644 index 0000000000..9b831751a8 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-head-response-has-no-body-end.js @@ -0,0 +1,55 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const http = require('http'); + +// This test is to make sure that when the HTTP server +// responds to a HEAD request with data to res.end, +// it does not send any body. + +const server = http.createServer(function(req, res) { + res.writeHead(200); + res.end('FAIL'); // broken: sends FAIL from hot path. +}); +server.listen(0); + +server.on('listening', common.mustCall(function() { + const req = http.request({ + port: this.address().port, + method: 'HEAD', + path: '/' + }, common.mustCall(function(res) { + res.on('end', common.mustCall(function() { + server.close(); + })); + res.resume(); + })); + req.end(); +})); diff --git a/tests/node_compat/test/parallel/test-http-head-response-has-no-body.js b/tests/node_compat/test/parallel/test-http-head-response-has-no-body.js new file mode 100644 index 0000000000..334c89193d --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-head-response-has-no-body.js @@ -0,0 +1,55 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const http = require('http'); + +// This test is to make sure that when the HTTP server +// responds to a HEAD request, it does not send any body. +// In this case it was sending '0\r\n\r\n' + +const server = http.createServer(function(req, res) { + res.writeHead(200); // broken: defaults to TE chunked + res.end(); +}); +server.listen(0); + +server.on('listening', common.mustCall(function() { + const req = http.request({ + port: this.address().port, + method: 'HEAD', + path: '/' + }, common.mustCall(function(res) { + res.on('end', common.mustCall(function() { + server.close(); + })); + res.resume(); + })); + req.end(); +})); diff --git a/tests/node_compat/test/parallel/test-http-head-throw-on-response-body-write.js b/tests/node_compat/test/parallel/test-http-head-throw-on-response-body-write.js new file mode 100644 index 0000000000..237cc1d891 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-head-throw-on-response-body-write.js @@ -0,0 +1,109 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +{ + const server = http.createServer((req, res) => { + res.writeHead(200); + res.end('this is content'); + }); + server.listen(0); + + server.on('listening', common.mustCall(function() { + const req = http.request({ + port: this.address().port, + method: 'HEAD', + path: '/' + }, common.mustCall((res) => { + res.resume(); + res.on('end', common.mustCall(function() { + server.close(); + })); + })); + req.end(); + })); +} + +{ + const server = http.createServer({ + rejectNonStandardBodyWrites: true, + }, (req, res) => { + res.writeHead(204); + assert.throws(() => { + res.write('this is content'); + }, { + code: 'ERR_HTTP_BODY_NOT_ALLOWED', + name: 'Error', + message: 'Adding content for this request method or response status is not allowed.' + }); + res.end(); + }); + server.listen(0); + + server.on('listening', common.mustCall(function() { + const req = http.request({ + port: this.address().port, + method: 'GET', + path: '/' + }, common.mustCall((res) => { + res.resume(); + res.on('end', common.mustCall(function() { + server.close(); + })); + })); + req.end(); + })); +} + +{ + const server = http.createServer({ + rejectNonStandardBodyWrites: false, + }, (req, res) => { + res.writeHead(200); + res.end('this is content'); + }); + server.listen(0); + + server.on('listening', common.mustCall(function() { + const req = http.request({ + port: this.address().port, + method: 'HEAD', + path: '/' + }, common.mustCall((res) => { + res.resume(); + res.on('end', common.mustCall(function() { + server.close(); + })); + })); + req.end(); + })); +} diff --git a/tests/node_compat/test/parallel/test-http-header-obstext.js b/tests/node_compat/test/parallel/test-http-header-obstext.js new file mode 100644 index 0000000000..acdcef81ad --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-header-obstext.js @@ -0,0 +1,28 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +// This test ensures that the http-parser can handle UTF-8 characters +// in the http header. + +const http = require('http'); +const assert = require('assert'); + +const server = http.createServer(common.mustCall((req, res) => { + res.end('ok'); +})); +server.listen(0, () => { + http.get({ + port: server.address().port, + headers: { 'Test': 'Düsseldorf' } + }, common.mustCall((res) => { + assert.strictEqual(res.statusCode, 200); + server.close(); + })); +}); diff --git a/tests/node_compat/test/parallel/test-http-header-owstext.js b/tests/node_compat/test/parallel/test-http-header-owstext.js new file mode 100644 index 0000000000..488f14d026 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-header-owstext.js @@ -0,0 +1,56 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +// This test ensures that the http-parser strips leading and trailing OWS from +// header values. It sends the header values in chunks to force the parser to +// build the string up through multiple calls to on_header_value(). + +const assert = require('assert'); +const http = require('http'); +const net = require('net'); + +function check(hdr, snd, rcv) { + const server = http.createServer(common.mustCall((req, res) => { + assert.strictEqual(req.headers[hdr], rcv); + req.pipe(res); + })); + + server.listen(0, common.mustCall(function() { + const client = net.connect(this.address().port, start); + function start() { + client.write('GET / HTTP/1.1\r\n' + hdr + ':', drain); + } + + function drain() { + if (snd.length === 0) { + return client.write('\r\nConnection: close\r\n\r\n'); + } + client.write(snd.shift(), drain); + } + + const bufs = []; + client.on('data', function(chunk) { + bufs.push(chunk); + }); + client.on('end', common.mustCall(function() { + const head = Buffer.concat(bufs) + .toString('latin1') + .split('\r\n')[0]; + assert.strictEqual(head, 'HTTP/1.1 200 OK'); + server.close(); + })); + })); +} + +check('host', [' \t foo.com\t'], 'foo.com'); +check('host', [' \t foo\tcom\t'], 'foo\tcom'); +check('host', [' \t', ' ', ' foo.com\t', '\t '], 'foo.com'); +check('host', [' \t', ' \t'.repeat(100), '\t '], ''); +check('host', [' \t', ' - - - - ', '\t '], '- - - -'); diff --git a/tests/node_compat/test/parallel/test-http-header-read.js b/tests/node_compat/test/parallel/test-http-header-read.js new file mode 100644 index 0000000000..cc57cc7a9e --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-header-read.js @@ -0,0 +1,59 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); + +// Verify that ServerResponse.getHeader() works correctly even after +// the response header has been sent. Issue 752 on github. + +const s = http.createServer(function(req, res) { + const contentType = 'Content-Type'; + const plain = 'text/plain'; + res.setHeader(contentType, plain); + assert.ok(!res.headersSent); + res.writeHead(200); + assert.ok(res.headersSent); + res.end('hello world\n'); + // This checks that after the headers have been sent, getHeader works + // and does not throw an exception (Issue 752) + assert.strictEqual(plain, res.getHeader(contentType)); +}); + +s.listen(0, runTest); + +function runTest() { + http.get({ port: this.address().port }, function(response) { + response.on('end', function() { + s.close(); + }); + response.resume(); + }); +} diff --git a/tests/node_compat/test/parallel/test-http-hex-write.js b/tests/node_compat/test/parallel/test-http-hex-write.js new file mode 100644 index 0000000000..d855676ced --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-hex-write.js @@ -0,0 +1,56 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +const http = require('http'); + +const expect = 'hex\nutf8\n'; + +http.createServer(function(q, s) { + s.setHeader('content-length', expect.length); + s.write('6865780a', 'hex'); + s.write('utf8\n'); + s.end(); + this.close(); +}).listen(0, common.mustCall(function() { + http.request({ port: this.address().port }) + .on('response', common.mustCall(function(res) { + let data = ''; + + res.setEncoding('ascii'); + res.on('data', function(c) { + data += c; + }); + res.on('end', common.mustCall(function() { + assert.strictEqual(data, expect); + })); + })).end(); +})); diff --git a/tests/node_compat/test/parallel/test-http-highwatermark.js b/tests/node_compat/test/parallel/test-http-highwatermark.js new file mode 100644 index 0000000000..52d892f246 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-highwatermark.js @@ -0,0 +1,59 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); +const http = require('http'); + +// These test cases to check socketOnDrain where needPause becomes false. +// When send large response enough to exceed highWaterMark, it expect the socket +// to be paused and res.write would be failed. +// And it should be resumed when outgoingData falls below highWaterMark. + +let requestReceived = 0; + +const server = http.createServer(function(req, res) { + const id = ++requestReceived; + const enoughToDrain = req.connection.writableHighWaterMark; + const body = 'x'.repeat(enoughToDrain * 100); + + if (id === 1) { + // Case of needParse = false + req.connection.once('pause', common.mustCall(() => { + assert(req.connection._paused, '_paused must be true because it exceeds' + + 'highWaterMark by second request'); + })); + } else { + // Case of needParse = true + const resume = req.connection.parser.resume.bind(req.connection.parser); + req.connection.parser.resume = common.mustCall((...args) => { + const paused = req.connection._paused; + assert(!paused, '_paused must be false because it become false by ' + + 'socketOnDrain when outgoingData falls below ' + + 'highWaterMark'); + return resume(...args); + }); + } + assert(!res.write(body), 'res.write must return false because it will ' + + 'exceed highWaterMark on this call'); + res.end(); +}).on('listening', () => { + const c = net.createConnection(server.address().port, () => { + c.write('GET / HTTP/1.1\r\n\r\n'); + c.write('GET / HTTP/1.1\r\n\r\n', + () => setImmediate(() => c.resume())); + c.end(); + }); + + c.on('end', () => { + server.close(); + }); +}); + +server.listen(0); diff --git a/tests/node_compat/test/parallel/test-http-host-headers.js b/tests/node_compat/test/parallel/test-http-host-headers.js new file mode 100644 index 0000000000..e3de017967 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-host-headers.js @@ -0,0 +1,103 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const http = require('http'); +const assert = require('assert'); +const httpServer = http.createServer(reqHandler); + +function reqHandler(req, res) { + if (req.url === '/setHostFalse5') { + assert.strictEqual(req.headers.host, undefined); + } else { + assert.strictEqual( + req.headers.host, `localhost:${this.address().port}`, + `Wrong host header for req[${req.url}]: ${req.headers.host}`); + } + res.writeHead(200, {}); + res.end('ok'); +} + +testHttp(); + +function testHttp() { + + let counter = 0; + + function cb(res) { + counter--; + if (counter === 0) { + httpServer.close(); + } + res.resume(); + } + + httpServer.listen(0, (er) => { + assert.ifError(er); + http.get({ + method: 'GET', + path: `/${counter++}`, + host: 'localhost', + port: httpServer.address().port, + rejectUnauthorized: false + }, cb).on('error', common.mustNotCall()); + + http.request({ + method: 'GET', + path: `/${counter++}`, + host: 'localhost', + port: httpServer.address().port, + rejectUnauthorized: false + }, cb).on('error', common.mustNotCall()).end(); + + http.request({ + method: 'POST', + path: `/${counter++}`, + host: 'localhost', + port: httpServer.address().port, + rejectUnauthorized: false + }, cb).on('error', common.mustNotCall()).end(); + + http.request({ + method: 'PUT', + path: `/${counter++}`, + host: 'localhost', + port: httpServer.address().port, + rejectUnauthorized: false + }, cb).on('error', common.mustNotCall()).end(); + + http.request({ + method: 'DELETE', + path: `/${counter++}`, + host: 'localhost', + port: httpServer.address().port, + rejectUnauthorized: false + }, cb).on('error', common.mustNotCall()).end(); + }); +} diff --git a/tests/node_compat/test/parallel/test-http-hostname-typechecking.js b/tests/node_compat/test/parallel/test-http-hostname-typechecking.js new file mode 100644 index 0000000000..e42384504b --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-hostname-typechecking.js @@ -0,0 +1,49 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +// All of these values should cause http.request() to throw synchronously +// when passed as the value of either options.hostname or options.host +const vals = [{}, [], NaN, Infinity, -Infinity, true, false, 1, 0, new Date()]; + +vals.forEach((v) => { + const received = common.invalidArgTypeHelper(v); + assert.throws( + () => http.request({ hostname: v }), + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + message: 'The "options.hostname" property must be of ' + + 'type string or one of undefined or null.' + + received + } + ); + + assert.throws( + () => http.request({ host: v }), + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + message: 'The "options.host" property must be of ' + + 'type string or one of undefined or null.' + + received + } + ); +}); + +// These values are OK and should not throw synchronously. +// Only testing for 'hostname' validation so ignore connection errors. +const dontCare = () => {}; +['', undefined, null].forEach((v) => { + http.request({ hostname: v }).on('error', dontCare).end(); + http.request({ host: v }).on('error', dontCare).end(); +}); diff --git a/tests/node_compat/test/parallel/test-http-incoming-message-destroy.js b/tests/node_compat/test/parallel/test-http-incoming-message-destroy.js new file mode 100644 index 0000000000..0c41570d9a --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-incoming-message-destroy.js @@ -0,0 +1,17 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// Test that http.IncomingMessage,prototype.destroy() returns `this`. +require('../common'); + +const assert = require('assert'); +const http = require('http'); +const incomingMessage = new http.IncomingMessage(); + +assert.strictEqual(incomingMessage.destroy(), incomingMessage); diff --git a/tests/node_compat/test/parallel/test-http-invalid-path-chars.js b/tests/node_compat/test/parallel/test-http-invalid-path-chars.js new file mode 100644 index 0000000000..be037050d5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-invalid-path-chars.js @@ -0,0 +1,27 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const assert = require('assert'); +const http = require('http'); + +const theExperimentallyDeterminedNumber = 39; + +for (let i = 0; i <= theExperimentallyDeterminedNumber; i++) { + const prefix = 'a'.repeat(i); + for (let i = 0; i <= 32; i++) { + assert.throws(() => { + http.request({ path: prefix + String.fromCodePoint(i) }, assert.fail); + }, { + code: 'ERR_UNESCAPED_CHARACTERS', + name: 'TypeError', + message: 'Request path contains unescaped characters' + }); + } +} diff --git a/tests/node_compat/test/parallel/test-http-invalidheaderfield.js b/tests/node_compat/test/parallel/test-http-invalidheaderfield.js new file mode 100644 index 0000000000..93d8d99f88 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-invalidheaderfield.js @@ -0,0 +1,59 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +const assert = require('assert'); +const EventEmitter = require('events'); +const http = require('http'); + +const ee = new EventEmitter(); +let count = 3; + +const server = http.createServer(function(req, res) { + res.setHeader('testing_123', 123); + assert.throws(function() { + res.setHeader('testing 123', 123); + }, TypeError); + res.end(''); +}); +server.listen(0, function() { + + http.get({ port: this.address().port }, function() { + ee.emit('done'); + }); + + assert.throws( + function() { + const options = { + port: server.address().port, + headers: { 'testing 123': 123 } + }; + http.get(options, common.mustNotCall()); + }, + function(err) { + ee.emit('done'); + if (err instanceof TypeError) return true; + } + ); + + // Should not throw. + const options = { + port: server.address().port, + headers: { 'testing_123': 123 } + }; + http.get(options, function() { + ee.emit('done'); + }); +}); + +ee.on('done', function() { + if (--count === 0) { + server.close(); + } +}); diff --git a/tests/node_compat/test/parallel/test-http-invalidheaderfield2.js b/tests/node_compat/test/parallel/test-http-invalidheaderfield2.js new file mode 100644 index 0000000000..e6c0f976b6 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-invalidheaderfield2.js @@ -0,0 +1,95 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const inspect = require('util').inspect; +const { _checkIsHttpToken, _checkInvalidHeaderChar } = require('_http_common'); + +// Good header field names +[ + 'TCN', + 'ETag', + 'date', + 'alt-svc', + 'Content-Type', + '0', + 'Set-Cookie2', + 'Set_Cookie', + 'foo`bar^', + 'foo|bar', + '~foobar', + 'FooBar!', + '#Foo', + '$et-Cookie', + '%%Test%%', + 'Test&123', + 'It\'s_fun', + '2*3', + '4+2', + '3.14159265359', +].forEach(function(str) { + assert.strictEqual( + _checkIsHttpToken(str), true, + `_checkIsHttpToken(${inspect(str)}) unexpectedly failed`); +}); +// Bad header field names +[ + ':', + '@@', + '中文呢', // unicode + '((((())))', + ':alternate-protocol', + 'alternate-protocol:', + 'foo\nbar', + 'foo\rbar', + 'foo\r\nbar', + 'foo\x00bar', + '\x7FMe!', + '{Start', + '(Start', + '[Start', + 'End}', + 'End)', + 'End]', + '"Quote"', + 'This,That', +].forEach(function(str) { + assert.strictEqual( + _checkIsHttpToken(str), false, + `_checkIsHttpToken(${inspect(str)}) unexpectedly succeeded`); +}); + + +// Good header field values +[ + 'foo bar', + 'foo\tbar', + '0123456789ABCdef', + '!@#$%^&*()-_=+\\;\':"[]{}<>,./?|~`', +].forEach(function(str) { + assert.strictEqual( + _checkInvalidHeaderChar(str), false, + `_checkInvalidHeaderChar(${inspect(str)}) unexpectedly failed`); +}); + +// Bad header field values +[ + 'foo\rbar', + 'foo\nbar', + 'foo\r\nbar', + '中文呢', // unicode + '\x7FMe!', + 'Testing 123\x00', + 'foo\vbar', + 'Ding!\x07', +].forEach(function(str) { + assert.strictEqual( + _checkInvalidHeaderChar(str), true, + `_checkInvalidHeaderChar(${inspect(str)}) unexpectedly succeeded`); +}); diff --git a/tests/node_compat/test/parallel/test-http-keep-alive-timeout-custom.js b/tests/node_compat/test/parallel/test-http-keep-alive-timeout-custom.js new file mode 100644 index 0000000000..eb48c8c0bd --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-keep-alive-timeout-custom.js @@ -0,0 +1,38 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const http = require('http'); +const assert = require('assert'); + +const server = http.createServer(common.mustCall((req, res) => { + const body = 'hello world\n'; + + res.writeHead(200, { + 'Content-Length': body.length, + 'Keep-Alive': 'timeout=50' + }); + res.write(body); + res.end(); +})); +server.keepAliveTimeout = 12010; + +const agent = new http.Agent({ maxSockets: 1, keepAlive: true }); + +server.listen(0, common.mustCall(function() { + http.get({ + path: '/', port: this.address().port, agent: agent + }, common.mustCall((response) => { + response.resume(); + assert.strictEqual( + response.headers['keep-alive'], 'timeout=50'); + server.close(); + agent.destroy(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http-listening.js b/tests/node_compat/test/parallel/test-http-listening.js new file mode 100644 index 0000000000..9963e377b5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-listening.js @@ -0,0 +1,23 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const server = http.createServer(); + +assert.strictEqual(server.listening, false); + +server.listen(0, common.mustCall(() => { + assert.strictEqual(server.listening, true); + + server.close(common.mustCall(() => { + assert.strictEqual(server.listening, false); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http-localaddress-bind-error.js b/tests/node_compat/test/parallel/test-http-localaddress-bind-error.js new file mode 100644 index 0000000000..d951652e1b --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-localaddress-bind-error.js @@ -0,0 +1,59 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const invalidLocalAddress = '1.2.3.4'; + +const server = http.createServer(function(req, res) { + console.log(`Connect from: ${req.connection.remoteAddress}`); + + req.on('end', function() { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.end(`You are from: ${req.connection.remoteAddress}`); + }); + req.resume(); +}); + +server.listen(0, '127.0.0.1', common.mustCall(function() { + http.request({ + host: 'localhost', + port: this.address().port, + path: '/', + method: 'GET', + localAddress: invalidLocalAddress + }, function(res) { + assert.fail('unexpectedly got response from server'); + }).on('error', common.mustCall(function(e) { + console.log(`client got error: ${e.message}`); + server.close(); + })).end(); +})); diff --git a/tests/node_compat/test/parallel/test-http-methods.js b/tests/node_compat/test/parallel/test-http-methods.js new file mode 100644 index 0000000000..163fb571dd --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-methods.js @@ -0,0 +1,74 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); + +// This test ensures all http methods from HTTP parser are exposed +// to http library + +const methods = [ + 'ACL', + 'BIND', + 'CHECKOUT', + 'CONNECT', + 'COPY', + 'DELETE', + 'GET', + 'HEAD', + 'LINK', + 'LOCK', + 'M-SEARCH', + 'MERGE', + 'MKACTIVITY', + 'MKCALENDAR', + 'MKCOL', + 'MOVE', + 'NOTIFY', + 'OPTIONS', + 'PATCH', + 'POST', + 'PROPFIND', + 'PROPPATCH', + 'PURGE', + 'PUT', + 'REBIND', + 'REPORT', + 'SEARCH', + 'SOURCE', + 'SUBSCRIBE', + 'TRACE', + 'UNBIND', + 'UNLINK', + 'UNLOCK', + 'UNSUBSCRIBE', +]; + +assert.deepStrictEqual(http.METHODS, methods.sort()); diff --git a/tests/node_compat/test/parallel/test-http-outgoing-end-types.js b/tests/node_compat/test/parallel/test-http-outgoing-end-types.js new file mode 100644 index 0000000000..30e466c4a8 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-outgoing-end-types.js @@ -0,0 +1,25 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const httpServer = http.createServer(common.mustCall(function(req, res) { + httpServer.close(); + assert.throws(() => { + res.end(['Throws.']); + }, { + code: 'ERR_INVALID_ARG_TYPE' + }); + res.end(); +})); + +httpServer.listen(0, common.mustCall(function() { + http.get({ port: this.address().port }); +})); diff --git a/tests/node_compat/test/parallel/test-http-outgoing-finished.js b/tests/node_compat/test/parallel/test-http-outgoing-finished.js new file mode 100644 index 0000000000..543f4d7c6d --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-outgoing-finished.js @@ -0,0 +1,39 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const { finished } = require('stream'); + +const http = require('http'); +const assert = require('assert'); + +const server = http.createServer(function(req, res) { + let closed = false; + res + .on('close', common.mustCall(() => { + closed = true; + finished(res, common.mustCall(() => { + server.close(); + })); + })) + .end(); + finished(res, common.mustCall(() => { + assert.strictEqual(closed, true); + })); + +}).listen(0, function() { + http + .request({ + port: this.address().port, + method: 'GET' + }) + .on('response', function(res) { + res.resume(); + }) + .end(); +}); diff --git a/tests/node_compat/test/parallel/test-http-outgoing-write-types.js b/tests/node_compat/test/parallel/test-http-outgoing-write-types.js new file mode 100644 index 0000000000..101f70581c --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-outgoing-write-types.js @@ -0,0 +1,31 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const httpServer = http.createServer(common.mustCall(function(req, res) { + httpServer.close(); + assert.throws(() => { + res.write(['Throws.']); + }, { + code: 'ERR_INVALID_ARG_TYPE' + }); + // should not throw + res.write('1a2b3c'); + // should not throw + res.write(new Uint8Array(1024)); + // should not throw + res.write(Buffer.from('1'.repeat(1024))); + res.end(); +})); + +httpServer.listen(0, common.mustCall(function() { + http.get({ port: this.address().port }); +})); diff --git a/tests/node_compat/test/parallel/test-http-parser-free.js b/tests/node_compat/test/parallel/test-http-parser-free.js new file mode 100644 index 0000000000..d1fe71e254 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-parser-free.js @@ -0,0 +1,59 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); +const Countdown = require('../common/countdown'); +const N = 100; + +const server = http.createServer(function(req, res) { + res.end('Hello'); +}); + +const countdown = new Countdown(N, () => server.close()); + +server.listen(0, function() { + http.globalAgent.maxSockets = 1; + let parser; + for (let i = 0; i < N; ++i) { + (function makeRequest(i) { + const req = http.get({ port: server.address().port }, function(res) { + if (!parser) { + parser = req.parser; + } else { + assert.strictEqual(req.parser, parser); + } + + countdown.dec(); + res.resume(); + }); + })(i); + } +}); diff --git a/tests/node_compat/test/parallel/test-http-pause-no-dump.js b/tests/node_compat/test/parallel/test-http-pause-no-dump.js new file mode 100644 index 0000000000..0e9fb6605d --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-pause-no-dump.js @@ -0,0 +1,40 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const server = http.createServer(common.mustCall(function(req, res) { + req.once('data', common.mustCall(() => { + req.pause(); + res.writeHead(200); + res.end(); + res.on('finish', common.mustCall(() => { + assert(!req._dumped); + })); + })); +})); +server.listen(0); + +server.on('listening', common.mustCall(function() { + const req = http.request({ + port: this.address().port, + method: 'POST', + path: '/' + }, common.mustCall(function(res) { + assert.strictEqual(res.statusCode, 200); + res.resume(); + res.on('end', common.mustCall(() => { + server.close(); + })); + })); + + req.end(Buffer.allocUnsafe(1024)); +})); diff --git a/tests/node_compat/test/parallel/test-http-pause-resume-one-end.js b/tests/node_compat/test/parallel/test-http-pause-resume-one-end.js new file mode 100644 index 0000000000..c7b0126e62 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-pause-resume-one-end.js @@ -0,0 +1,62 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const http = require('http'); +const assert = require('assert'); + +const server = http.Server(function(req, res) { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.end('Hello World\n'); + server.close(); +}); + +server.listen(0, common.mustCall(function() { + const opts = { + port: this.address().port, + headers: { connection: 'close' } + }; + + http.get(opts, common.mustCall(function(res) { + res.on('data', common.mustCall(function() { + res.pause(); + setImmediate(function() { + res.resume(); + }); + })); + + res.on('end', common.mustCall(() => { + assert.strictEqual(res.destroyed, false); + })); + assert.strictEqual(res.destroyed, false); + res.on('close', common.mustCall(() => { + assert.strictEqual(res.destroyed, true); + })); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http-pause.js b/tests/node_compat/test/parallel/test-http-pause.js new file mode 100644 index 0000000000..a9e377de90 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-pause.js @@ -0,0 +1,85 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); + +const expectedServer = 'Request Body from Client'; +let resultServer = ''; +const expectedClient = 'Response Body from Server'; +let resultClient = ''; + +const server = http.createServer((req, res) => { + console.error('pause server request'); + req.pause(); + setTimeout(() => { + console.error('resume server request'); + req.resume(); + req.setEncoding('utf8'); + req.on('data', (chunk) => { + resultServer += chunk; + }); + req.on('end', () => { + console.error(resultServer); + res.writeHead(200); + res.end(expectedClient); + }); + }, 100); +}); + +server.listen(0, function() { + // Anonymous function rather than arrow function to test `this` value. + assert.strictEqual(this, server); + const req = http.request({ + port: this.address().port, + path: '/', + method: 'POST' + }, (res) => { + console.error('pause client response'); + res.pause(); + setTimeout(() => { + console.error('resume client response'); + res.resume(); + res.on('data', (chunk) => { + resultClient += chunk; + }); + res.on('end', () => { + console.error(resultClient); + server.close(); + }); + }, 100); + }); + req.end(expectedServer); +}); + +process.on('exit', () => { + assert.strictEqual(resultServer, expectedServer); + assert.strictEqual(resultClient, expectedClient); +}); diff --git a/tests/node_compat/test/parallel/test-http-pipe-fs.js b/tests/node_compat/test/parallel/test-http-pipe-fs.js new file mode 100644 index 0000000000..3fcd2e1f2c --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-pipe-fs.js @@ -0,0 +1,72 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const http = require('http'); +const fs = require('fs'); +const Countdown = require('../common/countdown'); +const NUMBER_OF_STREAMS = 2; + +const countdown = new Countdown(NUMBER_OF_STREAMS, () => server.close()); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +const file = tmpdir.resolve('http-pipe-fs-test.txt'); + +const server = http.createServer(common.mustCall(function(req, res) { + const stream = fs.createWriteStream(file); + req.pipe(stream); + stream.on('close', function() { + res.writeHead(200); + res.end(); + }); +}, 2)).listen(0, function() { + http.globalAgent.maxSockets = 1; + + for (let i = 0; i < NUMBER_OF_STREAMS; ++i) { + const req = http.request({ + port: server.address().port, + method: 'POST', + headers: { + 'Content-Length': 5 + } + }, function(res) { + res.on('end', function() { + console.error(`res${i + 1} end`); + countdown.dec(); + }); + res.resume(); + }); + req.on('socket', function(s) { + console.error(`req${i + 1} start`); + }); + req.end('12345'); + } +}); diff --git a/tests/node_compat/test/parallel/test-http-pipeline-requests-connection-leak.js b/tests/node_compat/test/parallel/test-http-pipeline-requests-connection-leak.js new file mode 100644 index 0000000000..3a5498113b --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-pipeline-requests-connection-leak.js @@ -0,0 +1,41 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const Countdown = require('../common/countdown'); + +// This test ensures Node.js doesn't behave erratically when receiving pipelined +// requests +// https://github.com/nodejs/node/issues/3332 + +const http = require('http'); +const net = require('net'); + +const big = Buffer.alloc(16 * 1024, 'A'); + +const COUNT = 1e4; + +const countdown = new Countdown(COUNT, () => { + server.close(); + client.end(); +}); + +let client; +const server = http + .createServer(function(req, res) { + res.end(big, function() { + countdown.dec(); + }); + }) + .listen(0, function() { + const req = 'GET / HTTP/1.1\r\nHost: example.com\r\n\r\n'.repeat(COUNT); + client = net.connect(this.address().port, function() { + client.write(req); + }); + client.resume(); + }); diff --git a/tests/node_compat/test/parallel/test-http-proxy.js b/tests/node_compat/test/parallel/test-http-proxy.js new file mode 100644 index 0000000000..a457275239 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-proxy.js @@ -0,0 +1,114 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); + +const cookies = [ + 'session_token=; path=/; expires=Sun, 15-Sep-2030 13:48:52 GMT', + 'prefers_open_id=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT', +]; + +const headers = { 'content-type': 'text/plain', + 'set-cookie': cookies, + 'hello': 'world' }; + +const backend = http.createServer(function(req, res) { + console.error('backend request'); + res.writeHead(200, headers); + res.write('hello world\n'); + res.end(); +}); + +const proxy = http.createServer(function(req, res) { + console.error(`proxy req headers: ${JSON.stringify(req.headers)}`); + http.get({ + port: backend.address().port, + path: url.parse(req.url).pathname + }, function(proxy_res) { + + console.error(`proxy res headers: ${JSON.stringify(proxy_res.headers)}`); + + assert.strictEqual(proxy_res.headers.hello, 'world'); + assert.strictEqual(proxy_res.headers['content-type'], 'text/plain'); + assert.deepStrictEqual(proxy_res.headers['set-cookie'], cookies); + + res.writeHead(proxy_res.statusCode, proxy_res.headers); + + proxy_res.on('data', function(chunk) { + res.write(chunk); + }); + + proxy_res.on('end', function() { + res.end(); + console.error('proxy res'); + }); + }); +}); + +let body = ''; + +let nlistening = 0; +function startReq() { + nlistening++; + if (nlistening < 2) return; + + http.get({ + port: proxy.address().port, + path: '/test' + }, function(res) { + console.error('got res'); + assert.strictEqual(res.statusCode, 200); + + assert.strictEqual(res.headers.hello, 'world'); + assert.strictEqual(res.headers['content-type'], 'text/plain'); + assert.deepStrictEqual(res.headers['set-cookie'], cookies); + + res.setEncoding('utf8'); + res.on('data', function(chunk) { body += chunk; }); + res.on('end', function() { + proxy.close(); + backend.close(); + console.error('closed both'); + }); + }); + console.error('client req'); +} + +console.error('listen proxy'); +proxy.listen(0, startReq); + +console.error('listen backend'); +backend.listen(0, startReq); + +process.on('exit', function() { + assert.strictEqual(body, 'hello world\n'); +}); diff --git a/tests/node_compat/test/parallel/test-http-readable-data-event.js b/tests/node_compat/test/parallel/test-http-readable-data-event.js new file mode 100644 index 0000000000..6c91ebe526 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-readable-data-event.js @@ -0,0 +1,65 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const helloWorld = 'Hello World!'; +const helloAgainLater = 'Hello again later!'; + +let next = null; + +const server = http.createServer((req, res) => { + res.writeHead(200, { + 'Content-Length': `${(helloWorld.length + helloAgainLater.length)}` + }); + + // We need to make sure the data is flushed + // before writing again + next = () => { + res.end(helloAgainLater); + next = () => { }; + }; + + res.write(helloWorld); +}).listen(0, function() { + const opts = { + hostname: 'localhost', + port: server.address().port, + path: '/' + }; + + const expectedData = [helloWorld, helloAgainLater]; + const expectedRead = [helloWorld, null, helloAgainLater, null, null]; + + const req = http.request(opts, (res) => { + res.on('error', common.mustNotCall()); + + res.on('readable', common.mustCall(() => { + let data; + + do { + data = res.read(); + assert.strictEqual(data, expectedRead.shift()); + next(); + } while (data !== null); + }, 3)); + + res.setEncoding('utf8'); + res.on('data', common.mustCall((data) => { + assert.strictEqual(data, expectedData.shift()); + }, 2)); + + res.on('end', common.mustCall(() => { + server.close(); + })); + }); + + req.end(); +}); diff --git a/tests/node_compat/test/parallel/test-http-request-arguments.js b/tests/node_compat/test/parallel/test-http-request-arguments.js new file mode 100644 index 0000000000..d15bfc40ea --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-request-arguments.js @@ -0,0 +1,35 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +// Test providing both a url and options, with the options partially +// replacing address and port portions of the URL provided. +{ + const server = http.createServer( + common.mustCall((req, res) => { + assert.strictEqual(req.url, '/testpath'); + res.end(); + server.close(); + }) + ); + server.listen( + 0, + common.mustCall(() => { + http.get( + 'http://example.com/testpath', + { hostname: 'localhost', port: server.address().port }, + common.mustCall((res) => { + res.resume(); + }) + ); + }) + ); +} diff --git a/tests/node_compat/test/parallel/test-http-request-dont-override-options.js b/tests/node_compat/test/parallel/test-http-request-dont-override-options.js new file mode 100644 index 0000000000..caa87bd953 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-request-dont-override-options.js @@ -0,0 +1,47 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + + +const server = http.createServer(common.mustCall(function(req, res) { + res.writeHead(200); + res.end('ok'); +})); + +server.listen(0, function() { + const agent = new http.Agent(); + agent.defaultPort = this.address().port; + + // Options marked as explicitly undefined for readability + // in this test, they should STAY undefined as options should not + // be mutable / modified + const options = { + host: undefined, + hostname: common.localhostIPv4, + port: undefined, + defaultPort: undefined, + path: undefined, + method: undefined, + agent: agent + }; + + http.request(options, function(res) { + res.resume(); + server.close(); + assert.strictEqual(options.host, undefined); + assert.strictEqual(options.hostname, common.localhostIPv4); + assert.strictEqual(options.port, undefined); + assert.strictEqual(options.defaultPort, undefined); + assert.strictEqual(options.path, undefined); + assert.strictEqual(options.method, undefined); + }).end(); +}); diff --git a/tests/node_compat/test/parallel/test-http-request-end-twice.js b/tests/node_compat/test/parallel/test-http-request-end-twice.js new file mode 100644 index 0000000000..34c3aee390 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-request-end-twice.js @@ -0,0 +1,46 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); + +const server = http.Server(function(req, res) { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.end('hello world\n'); +}); +server.listen(0, function() { + const req = http.get({ port: this.address().port }, function(res) { + res.on('end', function() { + assert.strictEqual(req.end(), req); + server.close(); + }); + res.resume(); + }); +}); diff --git a/tests/node_compat/test/parallel/test-http-request-end.js b/tests/node_compat/test/parallel/test-http-request-end.js new file mode 100644 index 0000000000..4c71cd1432 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-request-end.js @@ -0,0 +1,69 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); + +const expected = 'Post Body For Test'; + +const server = http.Server(function(req, res) { + let result = ''; + + req.setEncoding('utf8'); + req.on('data', function(chunk) { + result += chunk; + }); + + req.on('end', function() { + assert.strictEqual(result, expected); + res.writeHead(200); + res.end('hello world\n'); + server.close(); + }); + +}); + +server.listen(0, function() { + const req = http.request({ + port: this.address().port, + path: '/', + method: 'POST' + }, function(res) { + console.log(res.statusCode); + res.resume(); + }).on('error', function(e) { + console.log(e.message); + process.exit(1); + }); + + const result = req.end(expected); + + assert.strictEqual(req, result); +}); diff --git a/tests/node_compat/test/parallel/test-http-request-invalid-method-error.js b/tests/node_compat/test/parallel/test-http-request-invalid-method-error.js new file mode 100644 index 0000000000..570966056e --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-request-invalid-method-error.js @@ -0,0 +1,20 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); + +assert.throws( + () => http.request({ method: '\0' }), + { + code: 'ERR_INVALID_HTTP_TOKEN', + name: 'TypeError', + message: 'Method must be a valid HTTP token ["\u0000"]' + } +); diff --git a/tests/node_compat/test/parallel/test-http-request-large-payload.js b/tests/node_compat/test/parallel/test-http-request-large-payload.js new file mode 100644 index 0000000000..80e36297eb --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-request-large-payload.js @@ -0,0 +1,33 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); + +// This test ensures Node.js doesn't throw an error when making requests with +// the payload 16kb or more in size. +// https://github.com/nodejs/node/issues/2821 + +const http = require('http'); + +const server = http.createServer(function(req, res) { + res.writeHead(200); + res.end(); + + server.close(); +}); + +server.listen(0, function() { + const req = http.request({ + method: 'POST', + port: this.address().port + }); + + const payload = Buffer.alloc(16390, 'Й'); + req.write(payload); + req.end(); +}); diff --git a/tests/node_compat/test/parallel/test-http-request-methods.js b/tests/node_compat/test/parallel/test-http-request-methods.js new file mode 100644 index 0000000000..69fb7aa5b1 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-request-methods.js @@ -0,0 +1,72 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); +const http = require('http'); + +// Test that the DELETE, PATCH and PURGE verbs get passed through correctly + +['DELETE', 'PATCH', 'PURGE'].forEach(function(method, index) { + const server = http.createServer(common.mustCall(function(req, res) { + assert.strictEqual(req.method, method); + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.write('hello '); + res.write('world\n'); + res.end(); + })); + server.listen(0); + + server.on('listening', common.mustCall(function() { + const c = net.createConnection(this.address().port); + let server_response = ''; + + c.setEncoding('utf8'); + + c.on('connect', function() { + c.write(`${method} / HTTP/1.0\r\n\r\n`); + }); + + c.on('data', function(chunk) { + console.log(chunk); + server_response += chunk; + }); + + c.on('end', common.mustCall(function() { + const m = server_response.split('\r\n\r\n'); + assert.strictEqual(m[1], 'hello world\n'); + c.end(); + })); + + c.on('close', function() { + server.close(); + }); + })); +}); diff --git a/tests/node_compat/test/parallel/test-http-res-write-end-dont-take-array.js b/tests/node_compat/test/parallel/test-http-res-write-end-dont-take-array.js new file mode 100644 index 0000000000..8d99963823 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-res-write-end-dont-take-array.js @@ -0,0 +1,80 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const server = http.createServer(); + +server.once('request', common.mustCall((req, res) => { + server.on('request', common.mustCall((req, res) => { + res.end(Buffer.from('asdf')); + })); + // `res.write()` should accept `string`. + res.write('string'); + // `res.write()` should accept `buffer`. + res.write(Buffer.from('asdf')); + + const expectedError = { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + }; + + // `res.write()` should not accept an Array. + assert.throws( + () => { + res.write(['array']); + }, + expectedError + ); + + // `res.end()` should not accept an Array. + assert.throws( + () => { + res.end(['moo']); + }, + expectedError + ); + + // `res.end()` should accept `string`. + res.end('string'); +})); + +server.listen(0, function() { + // Just make a request, other tests handle responses. + http.get({ port: this.address().port }, (res) => { + res.resume(); + // Do it again to test .end(Buffer); + http.get({ port: server.address().port }, (res) => { + res.resume(); + server.close(); + }); + }); +}); diff --git a/tests/node_compat/test/parallel/test-http-response-multiheaders.js b/tests/node_compat/test/parallel/test-http-response-multiheaders.js new file mode 100644 index 0000000000..27bfbcdca5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-response-multiheaders.js @@ -0,0 +1,78 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const http = require('http'); +const assert = require('assert'); +const Countdown = require('../common/countdown'); + +// Test that certain response header fields do not repeat. +// 'content-length' should also be in this list but it is +// handled differently because multiple content-lengths are +// an error (see test-http-response-multi-content-length.js). +const norepeat = [ + 'content-type', + 'user-agent', + 'referer', + 'host', + 'authorization', + 'proxy-authorization', + 'if-modified-since', + 'if-unmodified-since', + 'from', + 'location', + 'max-forwards', + 'retry-after', + 'etag', + 'last-modified', + 'server', + 'age', + 'expires', +]; +const runCount = 2; + +const server = http.createServer(function(req, res) { + const num = req.headers['x-num']; + if (num === '1') { + for (const name of norepeat) { + res.setHeader(name, ['A', 'B']); + } + res.setHeader('X-A', ['A', 'B']); + } else if (num === '2') { + const headers = {}; + for (const name of norepeat) { + headers[name] = ['A', 'B']; + } + headers['X-A'] = ['A', 'B']; + res.writeHead(200, headers); + } + res.end('ok'); +}); + +server.listen(0, common.mustCall(function() { + const countdown = new Countdown(runCount, () => server.close()); + for (let n = 1; n <= runCount; n++) { + // This runs twice, the first time, the server will use + // setHeader, the second time it uses writeHead. The + // result on the client side should be the same in + // either case -- only the first instance of the header + // value should be reported for the header fields listed + // in the norepeat array. + http.get( + { port: this.address().port, headers: { 'x-num': n } }, + common.mustCall(function(res) { + countdown.dec(); + for (const name of norepeat) { + assert.strictEqual(res.headers[name], 'A'); + } + assert.strictEqual(res.headers['x-a'], 'A, B'); + }) + ); + } +})); diff --git a/tests/node_compat/test/parallel/test-http-response-readable.js b/tests/node_compat/test/parallel/test-http-response-readable.js new file mode 100644 index 0000000000..3d2ca1a859 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-response-readable.js @@ -0,0 +1,48 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); + +const testServer = new http.Server(function(req, res) { + res.writeHead(200); + res.end('Hello world'); +}); + +testServer.listen(0, function() { + http.get({ port: this.address().port }, function(res) { + assert.strictEqual(res.readable, true); + res.on('end', function() { + assert.strictEqual(res.readable, false); + testServer.close(); + }); + res.resume(); + }); +}); diff --git a/tests/node_compat/test/parallel/test-http-response-writehead-returns-this.js b/tests/node_compat/test/parallel/test-http-response-writehead-returns-this.js new file mode 100644 index 0000000000..a9796890f4 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-response-writehead-returns-this.js @@ -0,0 +1,29 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const http = require('http'); +const assert = require('assert'); + +const server = http.createServer((req, res) => { + res.writeHead(200, { 'a-header': 'a-header-value' }).end('abc'); +}); + +server.listen(0, () => { + http.get({ port: server.address().port }, (res) => { + assert.strictEqual(res.headers['a-header'], 'a-header-value'); + + const chunks = []; + + res.on('data', (chunk) => chunks.push(chunk)); + res.on('end', () => { + assert.strictEqual(Buffer.concat(chunks).toString(), 'abc'); + server.close(); + }); + }); +}); diff --git a/tests/node_compat/test/parallel/test-http-server-delete-parser.js b/tests/node_compat/test/parallel/test-http-server-delete-parser.js new file mode 100644 index 0000000000..fbb242366f --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-server-delete-parser.js @@ -0,0 +1,31 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +const http = require('http'); + +const server = http.createServer(common.mustCall((req, res) => { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.write('okay', common.mustCall(() => { + delete res.socket.parser; + })); + res.end(); +})); + +server.listen(0, '127.0.0.1', common.mustCall(() => { + const req = http.request({ + port: server.address().port, + host: '127.0.0.1', + method: 'GET', + }); + req.end(); +})); + +server.unref(); diff --git a/tests/node_compat/test/parallel/test-http-server-write-after-end.js b/tests/node_compat/test/parallel/test-http-server-write-after-end.js new file mode 100644 index 0000000000..c7e0cb48eb --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-server-write-after-end.js @@ -0,0 +1,36 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const http = require('http'); + +// Fix for https://github.com/nodejs/node/issues/14368 + +const server = http.createServer(handle); + +function handle(req, res) { + res.on('error', common.mustNotCall()); + + res.write('hello'); + res.end(); + + setImmediate(common.mustCall(() => { + res.write('world', common.mustCall((err) => { + common.expectsError({ + code: 'ERR_STREAM_WRITE_AFTER_END', + name: 'Error' + })(err); + server.close(); + })); + })); +} + +server.listen(0, common.mustCall(() => { + http.get(`http://localhost:${server.address().port}`); +})); diff --git a/tests/node_compat/test/parallel/test-http-server-write-end-after-end.js b/tests/node_compat/test/parallel/test-http-server-write-end-after-end.js new file mode 100644 index 0000000000..eb05ea93cc --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-server-write-end-after-end.js @@ -0,0 +1,38 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const http = require('http'); + +const server = http.createServer(handle); + +function handle(req, res) { + res.on('error', common.mustNotCall()); + + res.write('hello'); + res.end(); + + setImmediate(common.mustCall(() => { + res.end('world'); + process.nextTick(() => { + server.close(); + }); + res.write('world', common.mustCall((err) => { + common.expectsError({ + code: 'ERR_STREAM_WRITE_AFTER_END', + name: 'Error' + })(err); + server.close(); + })); + })); +} + +server.listen(0, common.mustCall(() => { + http.get(`http://localhost:${server.address().port}`); +})); diff --git a/tests/node_compat/test/parallel/test-http-set-cookies.js b/tests/node_compat/test/parallel/test-http-set-cookies.js new file mode 100644 index 0000000000..d8c7627b7a --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-set-cookies.js @@ -0,0 +1,84 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); +const Countdown = require('../common/countdown'); + +const countdown = new Countdown(2, () => server.close()); +const server = http.createServer(function(req, res) { + if (req.url === '/one') { + res.writeHead(200, [['set-cookie', 'A'], + ['content-type', 'text/plain']]); + res.end('one\n'); + } else { + res.writeHead(200, [['set-cookie', 'A'], + ['set-cookie', 'B'], + ['content-type', 'text/plain']]); + res.end('two\n'); + } +}); +server.listen(0); + +server.on('listening', function() { + // + // one set-cookie header + // + http.get({ port: this.address().port, path: '/one' }, function(res) { + // set-cookie headers are always return in an array. + // even if there is only one. + assert.deepStrictEqual(res.headers['set-cookie'], ['A']); + assert.strictEqual(res.headers['content-type'], 'text/plain'); + + res.on('data', function(chunk) { + console.log(chunk.toString()); + }); + + res.on('end', function() { + countdown.dec(); + }); + }); + + // Two set-cookie headers + + http.get({ port: this.address().port, path: '/two' }, function(res) { + assert.deepStrictEqual(res.headers['set-cookie'], ['A', 'B']); + assert.strictEqual(res.headers['content-type'], 'text/plain'); + + res.on('data', function(chunk) { + console.log(chunk.toString()); + }); + + res.on('end', function() { + countdown.dec(); + }); + }); + +}); diff --git a/tests/node_compat/test/parallel/test-http-set-header-chain.js b/tests/node_compat/test/parallel/test-http-set-header-chain.js new file mode 100644 index 0000000000..80f59711ae --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-set-header-chain.js @@ -0,0 +1,36 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const http = require('http'); +const assert = require('assert'); +const expected = { + '__proto__': null, + 'testheader1': 'foo', + 'testheader2': 'bar', + 'testheader3': 'xyz' +}; +const server = http.createServer(common.mustCall((req, res) => { + let retval = res.setHeader('testheader1', 'foo'); + + // Test that the setHeader returns the same response object. + assert.strictEqual(retval, res); + + retval = res.setHeader('testheader2', 'bar').setHeader('testheader3', 'xyz'); + // Test that chaining works for setHeader. + assert.deepStrictEqual(res.getHeaders(), expected); + res.end('ok'); +})); +server.listen(0, () => { + http.get({ port: server.address().port }, common.mustCall((res) => { + res.on('data', () => {}); + res.on('end', common.mustCall(() => { + server.close(); + })); + })); +}); diff --git a/tests/node_compat/test/parallel/test-http-status-code.js b/tests/node_compat/test/parallel/test-http-status-code.js new file mode 100644 index 0000000000..7880864006 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-status-code.js @@ -0,0 +1,65 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); +const Countdown = require('../common/countdown'); + +// Simple test of Node's HTTP ServerResponse.statusCode +// ServerResponse.prototype.statusCode + +const tests = [200, 202, 300, 404, 451, 500]; +let test; +const countdown = new Countdown(tests.length, () => s.close()); + +const s = http.createServer(function(req, res) { + res.writeHead(test, { 'Content-Type': 'text/plain' }); + console.log(`--\nserver: statusCode after writeHead: ${res.statusCode}`); + assert.strictEqual(res.statusCode, test); + res.end('hello world\n'); +}); + +s.listen(0, nextTest); + + +function nextTest() { + test = tests.shift(); + + http.get({ port: s.address().port }, function(response) { + console.log(`client: expected status: ${test}`); + console.log(`client: statusCode: ${response.statusCode}`); + assert.strictEqual(response.statusCode, test); + response.on('end', function() { + if (countdown.dec()) + nextTest(); + }); + response.resume(); + }); +} diff --git a/tests/node_compat/test/parallel/test-http-status-reason-invalid-chars.js b/tests/node_compat/test/parallel/test-http-status-reason-invalid-chars.js new file mode 100644 index 0000000000..cdf36c7cf6 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-status-reason-invalid-chars.js @@ -0,0 +1,54 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const Countdown = require('../common/countdown'); + +function explicit(req, res) { + assert.throws(() => { + res.writeHead(200, 'OK\r\nContent-Type: text/html\r\n'); + }, /Invalid character in statusMessage/); + + assert.throws(() => { + res.writeHead(200, 'OK\u010D\u010AContent-Type: gotcha\r\n'); + }, /Invalid character in statusMessage/); + + res.statusMessage = 'OK'; + res.end(); +} + +function implicit(req, res) { + assert.throws(() => { + res.statusMessage = 'OK\r\nContent-Type: text/html\r\n'; + res.writeHead(200); + }, /Invalid character in statusMessage/); + res.statusMessage = 'OK'; + res.end(); +} + +const server = http.createServer((req, res) => { + if (req.url === '/explicit') { + explicit(req, res); + } else { + implicit(req, res); + } +}).listen(0, common.mustCall(() => { + const hostname = 'localhost'; + const countdown = new Countdown(2, () => server.close()); + const url = `http://${hostname}:${server.address().port}`; + const check = common.mustCall((res) => { + assert.notStrictEqual(res.headers['content-type'], 'text/html'); + assert.notStrictEqual(res.headers['content-type'], 'gotcha'); + countdown.dec(); + }, 2); + http.get(`${url}/explicit`, check).end(); + http.get(`${url}/implicit`, check).end(); +})); diff --git a/tests/node_compat/test/parallel/test-http-uncaught-from-request-callback.js b/tests/node_compat/test/parallel/test-http-uncaught-from-request-callback.js new file mode 100644 index 0000000000..32185e57dc --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-uncaught-from-request-callback.js @@ -0,0 +1,36 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const asyncHooks = require('async_hooks'); +const http = require('http'); + +// Regression test for https://github.com/nodejs/node/issues/31796 + +asyncHooks.createHook({ + after: () => {} +}).enable(); + + +process.once('uncaughtException', common.mustCall(() => { + server.close(); +})); + +const server = http.createServer(common.mustCall((request, response) => { + response.writeHead(200, { 'Content-Type': 'text/plain' }); + response.end(); +})); + +server.listen(0, common.mustCall(() => { + http.get({ + host: 'localhost', + port: server.address().port + }, common.mustCall(() => { + throw new Error('whoah'); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http-url.parse-auth.js b/tests/node_compat/test/parallel/test-http-url.parse-auth.js new file mode 100644 index 0000000000..9c80578338 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-url.parse-auth.js @@ -0,0 +1,55 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); + +function check(request) { + // The correct authorization header is be passed + assert.strictEqual(request.headers.authorization, 'Basic dXNlcjpwYXNzOg=='); +} + +const server = http.createServer(function(request, response) { + // Run the check function + check(request); + response.writeHead(200, {}); + response.end('ok'); + server.close(); +}); + +server.listen(0, function() { + const port = this.address().port; + // username = "user", password = "pass:" + const testURL = url.parse(`http://user:pass%3A@localhost:${port}`); + + // make the request + http.request(testURL).end(); +}); diff --git a/tests/node_compat/test/parallel/test-http-url.parse-basic.js b/tests/node_compat/test/parallel/test-http-url.parse-basic.js new file mode 100644 index 0000000000..62fa40431f --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-url.parse-basic.js @@ -0,0 +1,65 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); + +let testURL; + +// Make sure the basics work +function check(request) { + // Default method should still be 'GET' + assert.strictEqual(request.method, 'GET'); + // There are no URL params, so you should not see any + assert.strictEqual(request.url, '/'); + // The host header should use the url.parse.hostname + assert.strictEqual(request.headers.host, + `${testURL.hostname}:${testURL.port}`); +} + +const server = http.createServer(function(request, response) { + // Run the check function + check(request); + response.writeHead(200, {}); + response.end('ok'); + server.close(); +}); + +server.listen(0, function() { + testURL = url.parse(`http://localhost:${this.address().port}`); + + // make the request + const clientRequest = http.request(testURL); + // Since there is a little magic with the agent + // make sure that an http request uses the http.Agent + assert.ok(clientRequest.agent instanceof http.Agent); + clientRequest.end(); +}); diff --git a/tests/node_compat/test/parallel/test-http-url.parse-path.js b/tests/node_compat/test/parallel/test-http-url.parse-path.js new file mode 100644 index 0000000000..1fb44adf62 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-url.parse-path.js @@ -0,0 +1,53 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); + +function check(request) { + // A path should come over + assert.strictEqual(request.url, '/asdf'); +} + +const server = http.createServer(function(request, response) { + // Run the check function + check(request); + response.writeHead(200, {}); + response.end('ok'); + server.close(); +}); + +server.listen(0, function() { + const testURL = url.parse(`http://localhost:${this.address().port}/asdf`); + + // make the request + http.request(testURL).end(); +}); diff --git a/tests/node_compat/test/parallel/test-http-url.parse-post.js b/tests/node_compat/test/parallel/test-http-url.parse-post.js new file mode 100644 index 0000000000..1756191379 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-url.parse-post.js @@ -0,0 +1,61 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); + +let testURL; + +function check(request) { + // url.parse should not mess with the method + assert.strictEqual(request.method, 'POST'); + // Everything else should be right + assert.strictEqual(request.url, '/asdf?qwer=zxcv'); + // The host header should use the url.parse.hostname + assert.strictEqual(request.headers.host, + `${testURL.hostname}:${testURL.port}`); +} + +const server = http.createServer(function(request, response) { + // Run the check function + check(request); + response.writeHead(200, {}); + response.end('ok'); + server.close(); +}); + +server.listen(0, function() { + testURL = url.parse(`http://localhost:${this.address().port}/asdf?qwer=zxcv`); + testURL.method = 'POST'; + + // make the request + http.request(testURL).end(); +}); diff --git a/tests/node_compat/test/parallel/test-http-url.parse-search.js b/tests/node_compat/test/parallel/test-http-url.parse-search.js new file mode 100644 index 0000000000..181e1a1fdc --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-url.parse-search.js @@ -0,0 +1,54 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); +const url = require('url'); + +function check(request) { + // A path should come over with params + assert.strictEqual(request.url, '/asdf?qwer=zxcv'); +} + +const server = http.createServer(function(request, response) { + // Run the check function + check(request); + response.writeHead(200, {}); + response.end('ok'); + server.close(); +}); + +server.listen(0, function() { + const port = this.address().port; + const testURL = url.parse(`http://localhost:${port}/asdf?qwer=zxcv`); + + // make the request + http.request(testURL).end(); +}); diff --git a/tests/node_compat/test/parallel/test-http-wget.js b/tests/node_compat/test/parallel/test-http-wget.js new file mode 100644 index 0000000000..ea31a22acb --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-wget.js @@ -0,0 +1,85 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); +const http = require('http'); + +// `wget` sends an HTTP/1.0 request with Connection: Keep-Alive +// +// Sending back a chunked response to an HTTP/1.0 client would be wrong, +// so what has to happen in this case is that the connection is closed +// by the server after the entity body if the Content-Length was not +// sent. +// +// If the Content-Length was sent, we can probably safely honor the +// keep-alive request, even though HTTP 1.0 doesn't say that the +// connection can be kept open. Presumably any client sending this +// header knows that it is extending HTTP/1.0 and can handle the +// response. We don't test that here however, just that if the +// content-length is not provided, that the connection is in fact +// closed. + +const server = http.createServer((req, res) => { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.write('hello '); + res.write('world\n'); + res.end(); +}); +server.listen(0); + +server.on('listening', common.mustCall(() => { + const c = net.createConnection(server.address().port); + let server_response = ''; + + c.setEncoding('utf8'); + + c.on('connect', () => { + c.write('GET / HTTP/1.0\r\n' + + 'Connection: Keep-Alive\r\n\r\n'); + }); + + c.on('data', (chunk) => { + console.log(chunk); + server_response += chunk; + }); + + c.on('end', common.mustCall(() => { + const m = server_response.split('\r\n\r\n'); + assert.strictEqual(m[1], 'hello world\n'); + console.log('got end'); + c.end(); + })); + + c.on('close', common.mustCall(() => { + console.log('got close'); + server.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http-write-empty-string.js b/tests/node_compat/test/parallel/test-http-write-empty-string.js new file mode 100644 index 0000000000..362a2a5cbf --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-write-empty-string.js @@ -0,0 +1,61 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +const http = require('http'); + +const server = http.createServer(function(request, response) { + console.log(`responding to ${request.url}`); + + response.writeHead(200, { 'Content-Type': 'text/plain' }); + response.write('1\n'); + response.write(''); + response.write('2\n'); + response.write(''); + response.end('3\n'); + + this.close(); +}); + +server.listen(0, common.mustCall(() => { + http.get({ port: server.address().port }, common.mustCall((res) => { + let response = ''; + + assert.strictEqual(res.statusCode, 200); + res.setEncoding('ascii'); + res.on('data', (chunk) => { + response += chunk; + }); + res.on('end', common.mustCall(() => { + assert.strictEqual(response, '1\n2\n3\n'); + })); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http-zerolengthbuffer.js b/tests/node_compat/test/parallel/test-http-zerolengthbuffer.js new file mode 100644 index 0000000000..ff41874fa6 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http-zerolengthbuffer.js @@ -0,0 +1,30 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +// Serving up a zero-length buffer should work. + +const common = require('../common'); +const http = require('http'); + +const server = http.createServer((req, res) => { + const buffer = Buffer.alloc(0); + res.writeHead(200, { 'Content-Type': 'text/html', + 'Content-Length': buffer.length }); + res.end(buffer); +}); + +server.listen(0, common.mustCall(() => { + http.get({ port: server.address().port }, common.mustCall((res) => { + + res.on('data', common.mustNotCall()); + + res.on('end', (d) => { + server.close(); + }); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http2-client-request-listeners-warning.js b/tests/node_compat/test/parallel/test-http2-client-request-listeners-warning.js new file mode 100644 index 0000000000..0d1f5e07a8 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-client-request-listeners-warning.js @@ -0,0 +1,48 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const http2 = require('http2'); +const EventEmitter = require('events'); + +// This test ensures that a MaxListenersExceededWarning isn't emitted if +// more than EventEmitter.defaultMaxListeners requests are started on a +// ClientHttp2Session before it has finished connecting. + +process.on('warning', common.mustNotCall('A warning was emitted')); + +const server = http2.createServer(); +server.on('stream', (stream) => { + stream.respond(); + stream.end(); +}); + +server.listen(common.mustCall(() => { + const client = http2.connect(`http://localhost:${server.address().port}`); + + function request() { + return new Promise((resolve, reject) => { + const stream = client.request(); + stream.on('error', reject); + stream.on('response', resolve); + stream.end(); + }); + } + + const requests = []; + for (let i = 0; i < EventEmitter.defaultMaxListeners + 1; i++) { + requests.push(request()); + } + + Promise.all(requests).then(common.mustCall()).finally(common.mustCall(() => { + server.close(); + client.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http2-compat-expect-handling.js b/tests/node_compat/test/parallel/test-http2-compat-expect-handling.js new file mode 100644 index 0000000000..074c76680a --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-compat-expect-handling.js @@ -0,0 +1,52 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const assert = require('assert'); +const http2 = require('http2'); + +const expectValue = 'meoww'; + +const server = http2.createServer(common.mustNotCall()); + +server.once('checkExpectation', common.mustCall((req, res) => { + assert.strictEqual(req.headers.expect, expectValue); + res.statusCode = 417; + res.end(); +})); + +server.listen(0, common.mustCall(() => nextTest(2))); + +function nextTest(testsToRun) { + if (!testsToRun) { + return server.close(); + } + + const port = server.address().port; + const client = http2.connect(`http://localhost:${port}`); + const req = client.request({ + ':path': '/', + ':method': 'GET', + ':scheme': 'http', + ':authority': `localhost:${port}`, + 'expect': expectValue + }); + + req.on('response', common.mustCall((headers) => { + assert.strictEqual(headers[':status'], 417); + req.resume(); + })); + + req.on('end', common.mustCall(() => { + client.close(); + nextTest(testsToRun - 1); + })); +} diff --git a/tests/node_compat/test/parallel/test-http2-compat-socket-set.js b/tests/node_compat/test/parallel/test-http2-compat-socket-set.js new file mode 100644 index 0000000000..1346226863 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-compat-socket-set.js @@ -0,0 +1,104 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const assert = require('assert'); +const h2 = require('http2'); + +// Tests behavior of the proxied socket in Http2ServerRequest +// & Http2ServerResponse - specifically property setters + +const errMsg = { + code: 'ERR_HTTP2_NO_SOCKET_MANIPULATION', + name: 'Error', + message: 'HTTP/2 sockets should not be directly manipulated ' + + '(e.g. read and written)' +}; + +const server = h2.createServer(); + +server.on('request', common.mustCall(function(request, response) { + const noop = () => {}; + + assert.strictEqual(request.stream.destroyed, false); + request.socket.destroyed = true; + assert.strictEqual(request.stream.destroyed, true); + request.socket.destroyed = false; + + assert.strictEqual(request.stream.readable, true); + request.socket.readable = false; + assert.strictEqual(request.stream.readable, false); + + assert.strictEqual(request.stream.writable, true); + request.socket.writable = false; + assert.strictEqual(request.stream.writable, false); + + const realOn = request.stream.on; + request.socket.on = noop; + assert.strictEqual(request.stream.on, noop); + request.stream.on = realOn; + + const realOnce = request.stream.once; + request.socket.once = noop; + assert.strictEqual(request.stream.once, noop); + request.stream.once = realOnce; + + const realEnd = request.stream.end; + request.socket.end = noop; + assert.strictEqual(request.stream.end, noop); + request.socket.end = common.mustCall(); + request.socket.end(); + request.stream.end = realEnd; + + const realEmit = request.stream.emit; + request.socket.emit = noop; + assert.strictEqual(request.stream.emit, noop); + request.stream.emit = realEmit; + + const realDestroy = request.stream.destroy; + request.socket.destroy = noop; + assert.strictEqual(request.stream.destroy, noop); + request.stream.destroy = realDestroy; + + request.socket.setTimeout = noop; + assert.strictEqual(request.stream.session.setTimeout, noop); + + assert.strictEqual(request.stream.session.socket._isProcessing, undefined); + request.socket._isProcessing = true; + assert.strictEqual(request.stream.session.socket._isProcessing, true); + + assert.throws(() => request.socket.read = noop, errMsg); + assert.throws(() => request.socket.write = noop, errMsg); + assert.throws(() => request.socket.pause = noop, errMsg); + assert.throws(() => request.socket.resume = noop, errMsg); + + response.stream.destroy(); +})); + +server.listen(0, common.mustCall(function() { + const port = server.address().port; + const url = `http://localhost:${port}`; + const client = h2.connect(url, common.mustCall(function() { + const headers = { + ':path': '/', + ':method': 'GET', + ':scheme': 'http', + ':authority': `localhost:${port}` + }; + const request = client.request(headers); + request.on('end', common.mustCall(() => { + client.close(); + server.close(); + })); + request.end(); + request.resume(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http2-connect-options.js b/tests/node_compat/test/parallel/test-http2-connect-options.js new file mode 100644 index 0000000000..fa9272ff33 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-connect-options.js @@ -0,0 +1,48 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.hasMultiLocalhost()) + common.skip('platform-specific test.'); + +const http2 = require('http2'); +const assert = require('assert'); + +const server = http2.createServer((req, res) => { + console.log(`Connect from: ${req.connection.remoteAddress}`); + assert.strictEqual(req.connection.remoteAddress, '127.0.0.2'); + + req.on('end', common.mustCall(() => { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.end(`You are from: ${req.connection.remoteAddress}`); + })); + req.resume(); +}); + +server.listen(0, '127.0.0.1', common.mustCall(() => { + const options = { localAddress: '127.0.0.2', family: 4 }; + + const client = http2.connect( + 'http://localhost:' + server.address().port, + options + ); + const req = client.request({ + ':path': '/' + }); + req.on('data', () => req.resume()); + req.on('end', common.mustCall(function() { + client.close(); + req.close(); + server.close(); + })); + req.end(); +})); diff --git a/tests/node_compat/test/parallel/test-http2-date-header.js b/tests/node_compat/test/parallel/test-http2-date-header.js new file mode 100644 index 0000000000..0a8b9c9df3 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-date-header.js @@ -0,0 +1,36 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const assert = require('assert'); +const http2 = require('http2'); + +const server = http2.createServer(); + +server.on('stream', common.mustCall((stream) => { + // Date header is defaulted + stream.respond(); + stream.end(); +})); + +server.listen(0, common.mustCall(() => { + const client = http2.connect(`http://localhost:${server.address().port}`); + const req = client.request(); + req.on('response', common.mustCall((headers) => { + // The date header must be set to a non-invalid value + assert.notStrictEqual((new Date()).toString(), 'Invalid Date'); + })); + req.resume(); + req.on('end', common.mustCall(() => { + server.close(); + client.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http2-dont-override.js b/tests/node_compat/test/parallel/test-http2-dont-override.js new file mode 100644 index 0000000000..c14863be39 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-dont-override.js @@ -0,0 +1,56 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const assert = require('assert'); +const http2 = require('http2'); + +const options = {}; + +const server = http2.createServer(options); + +// Options are defaulted but the options are not modified +assert.deepStrictEqual(Object.keys(options), []); + +server.on('stream', common.mustCall((stream) => { + const headers = {}; + const options = {}; + stream.respond(headers, options); + + // The headers are defaulted but the original object is not modified + assert.deepStrictEqual(Object.keys(headers), []); + + // Options are defaulted but the original object is not modified + assert.deepStrictEqual(Object.keys(options), []); + + stream.end(); +})); + +server.listen(0, common.mustCall(() => { + const client = http2.connect(`http://localhost:${server.address().port}`); + + const headers = {}; + const options = {}; + + const req = client.request(headers, options); + + // The headers are defaulted but the original object is not modified + assert.deepStrictEqual(Object.keys(headers), []); + + // Options are defaulted but the original object is not modified + assert.deepStrictEqual(Object.keys(options), []); + + req.resume(); + req.on('end', common.mustCall(() => { + server.close(); + client.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http2-endafterheaders.js b/tests/node_compat/test/parallel/test-http2-endafterheaders.js new file mode 100644 index 0000000000..c1f9f0a553 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-endafterheaders.js @@ -0,0 +1,57 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const assert = require('assert'); +const http2 = require('http2'); +const Countdown = require('../common/countdown'); + +const server = http2.createServer(); +server.on('stream', common.mustCall((stream, headers) => { + const check = headers[':method'] === 'GET'; + assert.strictEqual(stream.endAfterHeaders, check); + stream.on('data', common.mustNotCall()); + stream.on('end', common.mustCall()); + stream.respond(); + stream.end('ok'); +}, 2)); + +const countdown = new Countdown(2, () => server.close()); + +server.listen(0, common.mustCall(() => { + { + const client = http2.connect(`http://localhost:${server.address().port}`); + const req = client.request(); + + req.resume(); + req.on('response', common.mustCall(() => { + assert.strictEqual(req.endAfterHeaders, false); + })); + req.on('end', common.mustCall(() => { + client.close(); + countdown.dec(); + })); + } + { + const client = http2.connect(`http://localhost:${server.address().port}`); + const req = client.request({ ':method': 'POST' }); + + req.resume(); + req.end(); + req.on('response', common.mustCall(() => { + assert.strictEqual(req.endAfterHeaders, false); + })); + req.on('end', common.mustCall(() => { + client.close(); + countdown.dec(); + })); + } +})); diff --git a/tests/node_compat/test/parallel/test-http2-methods.js b/tests/node_compat/test/parallel/test-http2-methods.js new file mode 100644 index 0000000000..b1597f8c03 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-methods.js @@ -0,0 +1,56 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const assert = require('assert'); +const h2 = require('http2'); + +const server = h2.createServer(); + +const methods = ['GET', 'POST', 'PATCH', 'FOO', 'A_B_C']; +let expected = methods.length; + +// We use the lower-level API here +server.on('stream', common.mustCall(onStream, expected)); + +function onStream(stream, headers, flags) { + const method = headers[':method']; + assert.notStrictEqual(method, undefined); + assert(methods.includes(method), `method ${method} not included`); + stream.respond({ + 'content-type': 'text/html', + ':status': 200 + }); + stream.end('hello world'); +} + +server.listen(0); + +server.on('listening', common.mustCall(() => { + + const client = h2.connect(`http://localhost:${server.address().port}`); + + const headers = { ':path': '/' }; + + methods.forEach((method) => { + headers[':method'] = method; + const req = client.request(headers); + req.on('response', common.mustCall()); + req.resume(); + req.on('end', common.mustCall(() => { + if (--expected === 0) { + server.close(); + client.close(); + } + })); + req.end(); + }); +})); diff --git a/tests/node_compat/test/parallel/test-http2-request-response-proto.js b/tests/node_compat/test/parallel/test-http2-request-response-proto.js new file mode 100644 index 0000000000..8f34cbc339 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-request-response-proto.js @@ -0,0 +1,25 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const assert = require('assert'); +const http2 = require('http2'); + +const { + Http2ServerRequest, + Http2ServerResponse, +} = http2; + +const protoRequest = { __proto__: Http2ServerRequest.prototype }; +const protoResponse = { __proto__: Http2ServerResponse.prototype }; + +assert.strictEqual(protoRequest instanceof Http2ServerRequest, true); +assert.strictEqual(protoResponse instanceof Http2ServerResponse, true); diff --git a/tests/node_compat/test/parallel/test-http2-respond-file-204.js b/tests/node_compat/test/parallel/test-http2-respond-file-204.js new file mode 100644 index 0000000000..f0a87337dc --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-respond-file-204.js @@ -0,0 +1,49 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const fixtures = require('../common/fixtures'); +const assert = require('assert'); +const http2 = require('http2'); + +const { + HTTP2_HEADER_CONTENT_TYPE, + HTTP2_HEADER_STATUS +} = http2.constants; + +const fname = fixtures.path('elipses.txt'); + +const server = http2.createServer(); +server.on('stream', (stream) => { + assert.throws(() => { + stream.respondWithFile(fname, { + [HTTP2_HEADER_STATUS]: 204, + [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain' + }); + }, { + code: 'ERR_HTTP2_PAYLOAD_FORBIDDEN', + name: 'Error', + message: 'Responses with 204 status must not have a payload' + }); + stream.respond({}); + stream.end(); +}); +server.listen(0, () => { + const client = http2.connect(`http://localhost:${server.address().port}`); + const req = client.request(); + req.on('response', common.mustCall()); + req.on('data', common.mustNotCall()); + req.on('end', common.mustCall(() => { + client.close(); + server.close(); + })); + req.end(); +}); diff --git a/tests/node_compat/test/parallel/test-http2-respond-file-compat.js b/tests/node_compat/test/parallel/test-http2-respond-file-compat.js new file mode 100644 index 0000000000..e8c78ce3ab --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-respond-file-compat.js @@ -0,0 +1,31 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const http2 = require('http2'); +const fixtures = require('../common/fixtures'); + +const fname = fixtures.path('elipses.txt'); + +const server = http2.createServer(common.mustCall((request, response) => { + response.stream.respondWithFile(fname); +})); +server.listen(0, () => { + const client = http2.connect(`http://localhost:${server.address().port}`); + const req = client.request(); + req.on('response', common.mustCall()); + req.on('end', common.mustCall(() => { + client.close(); + server.close(); + })); + req.end(); + req.resume(); +}); diff --git a/tests/node_compat/test/parallel/test-http2-session-timeout.js b/tests/node_compat/test/parallel/test-http2-session-timeout.js new file mode 100644 index 0000000000..84c549aa96 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-session-timeout.js @@ -0,0 +1,71 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const assert = require('assert'); +const http2 = require('http2'); +const hrtime = process.hrtime.bigint; +const NS_PER_MS = 1_000_000n; + +let requests = 0; +const mustNotCall = () => { + assert.fail(`Timeout after ${requests} request(s)`); +}; + +const server = http2.createServer(); +// Disable server timeout until first request. We will set the timeout based on +// how long the first request takes. +server.timeout = 0n; + +server.on('request', (req, res) => res.end()); +server.on('timeout', mustNotCall); + +server.listen(0, common.mustCall(() => { + const port = server.address().port; + + const url = `http://localhost:${port}`; + const client = http2.connect(url); + let startTime = hrtime(); + makeReq(); + + function makeReq() { + const request = client.request({ + ':path': '/foobar', + ':method': 'GET', + ':scheme': 'http', + ':authority': `localhost:${port}`, + }); + request.resume(); + request.end(); + + requests += 1; + + request.on('end', () => { + const diff = hrtime() - startTime; + const milliseconds = diff / NS_PER_MS; + if (server.timeout === 0n) { + // Set the timeout now. First connection will take significantly longer + // than subsequent connections, so using the duration of the first + // connection as the timeout should be robust. Double it anyway for good + // measure. + server.timeout = milliseconds * 2n; + startTime = hrtime(); + makeReq(); + } else if (milliseconds < server.timeout * 2n) { + makeReq(); + } else { + server.removeListener('timeout', mustNotCall); + server.close(); + client.close(); + } + }); + } +})); diff --git a/tests/node_compat/test/parallel/test-http2-socket-proxy.js b/tests/node_compat/test/parallel/test-http2-socket-proxy.js new file mode 100644 index 0000000000..c24ca29982 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-socket-proxy.js @@ -0,0 +1,133 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const assert = require('assert'); +const h2 = require('http2'); +const net = require('net'); +const util = require('util'); + +const { kTimeout } = require('internal/timers'); + +// Tests behavior of the proxied socket on Http2Session + +const errMsg = { + code: 'ERR_HTTP2_NO_SOCKET_MANIPULATION', + name: 'Error', + message: 'HTTP/2 sockets should not be directly manipulated ' + + '(e.g. read and written)' +}; + +const server = h2.createServer(); + +server.on('stream', common.mustCall(function(stream, headers) { + const socket = stream.session.socket; + const session = stream.session; + + assert.ok(socket instanceof net.Socket); + + assert.strictEqual(socket.writable, true); + assert.strictEqual(socket.readable, true); + assert.strictEqual(typeof socket.address(), 'object'); + + socket.setTimeout(987); + assert.strictEqual(session[kTimeout]._idleTimeout, 987); + + // The indentation is corrected depending on the depth. + let inspectedTimeout = util.inspect(session[kTimeout]); + assert(inspectedTimeout.includes(' _idlePrev: [TimersList]')); + assert(inspectedTimeout.includes(' _idleNext: [TimersList]')); + assert(!inspectedTimeout.includes(' _idleNext: [TimersList]')); + + inspectedTimeout = util.inspect([ session[kTimeout] ]); + assert(inspectedTimeout.includes(' _idlePrev: [TimersList]')); + assert(inspectedTimeout.includes(' _idleNext: [TimersList]')); + assert(!inspectedTimeout.includes(' _idleNext: [TimersList]')); + + const inspectedTimersList = util.inspect([[ session[kTimeout]._idlePrev ]]); + assert(inspectedTimersList.includes(' _idlePrev: [Timeout]')); + assert(inspectedTimersList.includes(' _idleNext: [Timeout]')); + assert(!inspectedTimersList.includes(' _idleNext: [Timeout]')); + + assert.throws(() => socket.destroy, errMsg); + assert.throws(() => socket.emit, errMsg); + assert.throws(() => socket.end, errMsg); + assert.throws(() => socket.pause, errMsg); + assert.throws(() => socket.read, errMsg); + assert.throws(() => socket.resume, errMsg); + assert.throws(() => socket.write, errMsg); + assert.throws(() => socket.setEncoding, errMsg); + assert.throws(() => socket.setKeepAlive, errMsg); + assert.throws(() => socket.setNoDelay, errMsg); + + assert.throws(() => (socket.destroy = undefined), errMsg); + assert.throws(() => (socket.emit = undefined), errMsg); + assert.throws(() => (socket.end = undefined), errMsg); + assert.throws(() => (socket.pause = undefined), errMsg); + assert.throws(() => (socket.read = undefined), errMsg); + assert.throws(() => (socket.resume = undefined), errMsg); + assert.throws(() => (socket.write = undefined), errMsg); + assert.throws(() => (socket.setEncoding = undefined), errMsg); + assert.throws(() => (socket.setKeepAlive = undefined), errMsg); + assert.throws(() => (socket.setNoDelay = undefined), errMsg); + + // Resetting the socket listeners to their own value should not throw. + socket.on = socket.on; // eslint-disable-line no-self-assign + socket.once = socket.once; // eslint-disable-line no-self-assign + + socket.unref(); + assert.strictEqual(socket._handle.hasRef(), false); + socket.ref(); + assert.strictEqual(socket._handle.hasRef(), true); + + stream.respond(); + + socket.writable = true; + socket.readable = true; + assert.strictEqual(socket.writable, true); + assert.strictEqual(socket.readable, true); + socket.writable = false; + socket.readable = false; + assert.strictEqual(socket.writable, false); + assert.strictEqual(socket.readable, false); + + stream.end(); + + // Setting socket properties sets the session properties correctly. + const fn = () => {}; + socket.setTimeout = fn; + assert.strictEqual(session.setTimeout, fn); + + socket.ref = fn; + assert.strictEqual(session.ref, fn); + + socket.unref = fn; + assert.strictEqual(session.unref, fn); + + stream.session.on('close', common.mustCall(() => { + assert.strictEqual(session.socket, undefined); + })); +})); + +server.listen(0, common.mustCall(function() { + const port = server.address().port; + const url = `http://localhost:${port}`; + const client = h2.connect(url, common.mustCall(() => { + const request = client.request(); + request.on('end', common.mustCall(() => { + client.close(); + server.close(); + })); + request.resume(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http2-status-code-invalid.js b/tests/node_compat/test/parallel/test-http2-status-code-invalid.js new file mode 100644 index 0000000000..3a5e46af84 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-status-code-invalid.js @@ -0,0 +1,48 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const assert = require('assert'); +const http2 = require('http2'); + +const server = http2.createServer(); + +function expectsError(code) { + return common.expectsError({ + code: 'ERR_HTTP2_STATUS_INVALID', + name: 'RangeError', + message: `Invalid status code: ${code}` + }); +} + +server.on('stream', common.mustCall((stream) => { + + // Anything lower than 100 and greater than 599 is rejected + [ 99, 700, 1000 ].forEach((i) => { + assert.throws(() => stream.respond({ ':status': i }), expectsError(i)); + }); + + stream.respond(); + stream.end(); +})); + +server.listen(0, common.mustCall(() => { + const client = http2.connect(`http://localhost:${server.address().port}`); + const req = client.request(); + req.on('response', common.mustCall((headers) => { + assert.strictEqual(headers[':status'], 200); + })); + req.resume(); + req.on('end', common.mustCall(() => { + server.close(); + client.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-http2-status-code.js b/tests/node_compat/test/parallel/test-http2-status-code.js new file mode 100644 index 0000000000..4af94b0cb7 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-status-code.js @@ -0,0 +1,48 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const assert = require('assert'); +const http2 = require('http2'); + +const codes = [ 200, 202, 300, 400, 404, 451, 500 ]; +let test = 0; + +const server = http2.createServer(); + +server.on('stream', common.mustCall((stream) => { + const status = codes[test++]; + stream.respond({ ':status': status }, { endStream: true }); +}, 7)); + +server.listen(0, common.mustCall(() => { + const client = http2.connect(`http://localhost:${server.address().port}`); + + let remaining = codes.length; + function maybeClose() { + if (--remaining === 0) { + client.close(); + server.close(); + } + } + + function doTest(expected) { + const req = client.request(); + req.on('response', common.mustCall((headers) => { + assert.strictEqual(headers[':status'], expected); + })); + req.resume(); + req.on('end', common.mustCall(maybeClose)); + } + + for (let n = 0; n < codes.length; n++) + doTest(codes[n]); +})); diff --git a/tests/node_compat/test/parallel/test-http2-stream-removelisteners-after-close.js b/tests/node_compat/test/parallel/test-http2-stream-removelisteners-after-close.js new file mode 100644 index 0000000000..e528dc2670 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-stream-removelisteners-after-close.js @@ -0,0 +1,38 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const http2 = require('http2'); + +// Regression test for https://github.com/nodejs/node/issues/29457: +// HTTP/2 stream event listeners can be added and removed after the +// session has been destroyed. + +const server = http2.createServer((req, res) => { + res.end('Hi!\n'); +}); + +server.listen(0, common.mustCall(() => { + const client = http2.connect(`http://localhost:${server.address().port}`); + const headers = { ':path': '/' }; + const req = client.request(headers); + + req.on('close', common.mustCall(() => { + req.removeAllListeners(); + req.on('priority', common.mustNotCall()); + server.close(); + })); + + req.on('priority', common.mustNotCall()); + req.on('error', common.mustCall()); + + client.destroy(); +})); diff --git a/tests/node_compat/test/parallel/test-http2-write-empty-string.js b/tests/node_compat/test/parallel/test-http2-write-empty-string.js new file mode 100644 index 0000000000..aea523d5d5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-http2-write-empty-string.js @@ -0,0 +1,48 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const assert = require('assert'); +const http2 = require('http2'); + +const server = http2.createServer(function(request, response) { + response.writeHead(200, { 'Content-Type': 'text/plain' }); + response.write('1\n'); + response.write(''); + response.write('2\n'); + response.write(''); + response.end('3\n'); + + this.close(); +}); + +server.listen(0, common.mustCall(function() { + const client = http2.connect(`http://localhost:${this.address().port}`); + const headers = { ':path': '/' }; + const req = client.request(headers).setEncoding('ascii'); + + let res = ''; + + req.on('response', common.mustCall(function(headers) { + assert.strictEqual(headers[':status'], 200); + })); + + req.on('data', (chunk) => { + res += chunk; + }); + + req.on('end', common.mustCall(function() { + assert.strictEqual(res, '1\n2\n3\n'); + client.close(); + })); + + req.end(); +})); diff --git a/tests/node_compat/test/parallel/test-https-client-renegotiation-limit.js b/tests/node_compat/test/parallel/test-https-client-renegotiation-limit.js new file mode 100644 index 0000000000..a612de29a6 --- /dev/null +++ b/tests/node_compat/test/parallel/test-https-client-renegotiation-limit.js @@ -0,0 +1,118 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.opensslCli) + common.skip('node compiled without OpenSSL CLI.'); + +const assert = require('assert'); +const tls = require('tls'); +const https = require('https'); +const fixtures = require('../common/fixtures'); + +// Renegotiation as a protocol feature was dropped after TLS1.2. +tls.DEFAULT_MAX_VERSION = 'TLSv1.2'; + +// Renegotiation limits to test +const LIMITS = [0, 1, 2, 3, 5, 10, 16]; + +{ + let n = 0; + function next() { + if (n >= LIMITS.length) return; + tls.CLIENT_RENEG_LIMIT = LIMITS[n++]; + test(next); + } + next(); +} + +function test(next) { + const options = { + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem'), + }; + + const server = https.createServer(options, (req, res) => { + const conn = req.connection; + conn.on('error', (err) => { + console.error(`Caught exception: ${err}`); + assert.match(err.message, /TLS session renegotiation attack/); + conn.destroy(); + }); + res.end('ok'); + }); + + server.listen(0, () => { + const agent = https.Agent({ + keepAlive: true, + }); + + let client; + let renegs = 0; + + const options = { + rejectUnauthorized: false, + agent, + }; + + const { port } = server.address(); + + https.get(`https://localhost:${port}/`, options, (res) => { + client = res.socket; + + client.on('close', (hadErr) => { + assert.strictEqual(hadErr, false); + assert.strictEqual(renegs, tls.CLIENT_RENEG_LIMIT + 1); + server.close(); + process.nextTick(next); + }); + + client.on('error', (err) => { + console.log('CLIENT ERR', err); + throw err; + }); + + spam(); + + // Simulate renegotiation attack + function spam() { + client.renegotiate({}, (err) => { + assert.ifError(err); + assert.ok(renegs <= tls.CLIENT_RENEG_LIMIT); + setImmediate(spam); + }); + renegs++; + } + }); + + }); +} diff --git a/tests/node_compat/test/parallel/test-https-connecting-to-http.js b/tests/node_compat/test/parallel/test-https-connecting-to-http.js new file mode 100644 index 0000000000..ecb049fba2 --- /dev/null +++ b/tests/node_compat/test/parallel/test-https-connecting-to-http.js @@ -0,0 +1,47 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +// This tests the situation where you try to connect a https client +// to an http server. You should get an error and exit. +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const http = require('http'); +const https = require('https'); +const server = http.createServer(common.mustNotCall()); + +server.listen(0, common.mustCall(function() { + const req = https.get({ port: this.address().port }, common.mustNotCall()); + + req.on('error', common.mustCall(function(e) { + console.log('Got expected error: ', e.message); + server.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-https-foafssl.js b/tests/node_compat/test/parallel/test-https-foafssl.js new file mode 100644 index 0000000000..faa5376f01 --- /dev/null +++ b/tests/node_compat/test/parallel/test-https-foafssl.js @@ -0,0 +1,96 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.opensslCli) + common.skip('node compiled without OpenSSL CLI.'); + +const assert = require('assert'); +const fixtures = require('../common/fixtures'); +const https = require('https'); +const spawn = require('child_process').spawn; + +const options = { + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + requestCert: true, + rejectUnauthorized: false +}; + +const webIdUrl = 'URI:http://example.com/#me'; +const modulus = fixtures.readKey('rsa_cert_foafssl_b.modulus', 'ascii').replace(/\n/g, ''); +const exponent = fixtures.readKey('rsa_cert_foafssl_b.exponent', 'ascii').replace(/\n/g, ''); + +const CRLF = '\r\n'; +const body = 'hello world\n'; +let cert; + +const server = https.createServer(options, common.mustCall(function(req, res) { + console.log('got request'); + + cert = req.connection.getPeerCertificate(); + + assert.strictEqual(cert.subjectaltname, webIdUrl); + assert.strictEqual(cert.exponent, exponent); + assert.strictEqual(cert.modulus, modulus); + res.writeHead(200, { 'content-type': 'text/plain' }); + res.end(body, () => { console.log('stream finished'); }); + console.log('sent response'); +})); + +server.listen(0, function() { + const args = ['s_client', + '-quiet', + '-connect', `127.0.0.1:${this.address().port}`, + '-cert', fixtures.path('keys/rsa_cert_foafssl_b.crt'), + '-key', fixtures.path('keys/rsa_private_b.pem')]; + + const client = spawn(common.opensslCli, args); + + client.stdout.on('data', function(data) { + console.log('response received'); + const message = data.toString(); + const contents = message.split(CRLF + CRLF).pop(); + assert.strictEqual(body, contents); + server.close((e) => { + assert.ifError(e); + console.log('server closed'); + }); + console.log('server.close() called'); + }); + + client.stdin.write('GET /\n\n'); + + client.on('error', function(error) { + throw error; + }); +}); diff --git a/tests/node_compat/test/parallel/test-https-localaddress-bind-error.js b/tests/node_compat/test/parallel/test-https-localaddress-bind-error.js new file mode 100644 index 0000000000..304f0b2857 --- /dev/null +++ b/tests/node_compat/test/parallel/test-https-localaddress-bind-error.js @@ -0,0 +1,69 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const https = require('https'); + +const fixtures = require('../common/fixtures'); + +const options = { + key: fixtures.readKey('agent1-key.pem'), + cert: fixtures.readKey('agent1-cert.pem') +}; + +const invalidLocalAddress = '1.2.3.4'; + +const server = https.createServer(options, function(req, res) { + console.log(`Connect from: ${req.connection.remoteAddress}`); + + req.on('end', function() { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.end(`You are from: ${req.connection.remoteAddress}`); + }); + req.resume(); +}); + +server.listen(0, '127.0.0.1', common.mustCall(function() { + https.request({ + host: 'localhost', + port: this.address().port, + path: '/', + method: 'GET', + localAddress: invalidLocalAddress + }, function(res) { + assert.fail('unexpectedly got response from server'); + }).on('error', common.mustCall(function(e) { + console.log(`client got error: ${e.message}`); + server.close(); + })).end(); +})); diff --git a/tests/node_compat/test/parallel/test-https-localaddress.js b/tests/node_compat/test/parallel/test-https-localaddress.js new file mode 100644 index 0000000000..a988c94a38 --- /dev/null +++ b/tests/node_compat/test/parallel/test-https-localaddress.js @@ -0,0 +1,76 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// Flags: --expose-internals +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.hasMultiLocalhost()) + common.skip('platform-specific test.'); + +const fixtures = require('../common/fixtures'); +const assert = require('assert'); +const https = require('https'); + +const options = { + key: fixtures.readKey('agent1-key.pem'), + cert: fixtures.readKey('agent1-cert.pem') +}; + +const server = https.createServer(options, function(req, res) { + console.log(`Connect from: ${req.connection.remoteAddress}`); + assert.strictEqual(req.connection.remoteAddress, '127.0.0.2'); + + req.on('end', function() { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.end(`You are from: ${req.connection.remoteAddress}`); + }); + req.resume(); +}); + +server.listen(0, '127.0.0.1', function() { + const options = { + host: 'localhost', + port: this.address().port, + family: 4, + path: '/', + method: 'GET', + localAddress: '127.0.0.2', + rejectUnauthorized: false + }; + + const req = https.request(options, function(res) { + res.on('end', function() { + server.close(); + }); + res.resume(); + }); + req.end(); +}); diff --git a/tests/node_compat/test/parallel/test-icu-data-dir.js b/tests/node_compat/test/parallel/test-icu-data-dir.js new file mode 100644 index 0000000000..5054de86ef --- /dev/null +++ b/tests/node_compat/test/parallel/test-icu-data-dir.js @@ -0,0 +1,40 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; +const common = require('../common'); +const { spawnSyncAndExit } = require('../common/child_process'); +const { internalBinding } = require('internal/test/binding'); + +const { hasSmallICU } = internalBinding('config'); +if (!(common.hasIntl && hasSmallICU)) + common.skip('missing Intl'); + +{ + spawnSyncAndExit( + process.execPath, + ['--icu-data-dir=/', '-e', '0'], + { + status: 9, + signal: null, + stderr: /Could not initialize ICU/ + }); +} + +{ + const env = { ...process.env, NODE_ICU_DATA: '/' }; + spawnSyncAndExit( + process.execPath, + ['-e', '0'], + { env }, + { + status: 9, + signal: null, + stderr: /Could not initialize ICU/ + }); +} diff --git a/tests/node_compat/test/parallel/test-icu-env.js b/tests/node_compat/test/parallel/test-icu-env.js new file mode 100644 index 0000000000..4a9545d2ca --- /dev/null +++ b/tests/node_compat/test/parallel/test-icu-env.js @@ -0,0 +1,295 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const { execFileSync } = require('child_process'); + +// system-icu should not be tested +const hasBuiltinICU = process.config.variables.icu_gyp_path === 'tools/icu/icu-generic.gyp'; +if (!hasBuiltinICU) + common.skip('system ICU'); + +// small-icu doesn't support non-English locales +const hasFullICU = (() => { + try { + const january = new Date(9e8); + const spanish = new Intl.DateTimeFormat('es', { month: 'long' }); + return spanish.format(january) === 'enero'; + } catch { + return false; + } +})(); +if (!hasFullICU) + common.skip('small ICU'); + +const icuVersionMajor = Number(process.config.variables.icu_ver_major ?? 0); +if (icuVersionMajor < 71) + common.skip('ICU too old'); + + +function runEnvOutside(addEnv, code, ...args) { + return execFileSync( + process.execPath, + ['-e', `process.stdout.write(String(${code}));`], + { env: { ...process.env, ...addEnv }, encoding: 'utf8' } + ); +} + +function runEnvInside(addEnv, func, ...args) { + Object.assign(process.env, addEnv); // side effects! + return func(...args); +} + +function isPack(array) { + const firstItem = array[0]; + return array.every((item) => item === firstItem); +} + +function isSet(array) { + const deduped = new Set(array); + return array.length === deduped.size; +} + + +const localesISO639 = [ + 'eng', 'cmn', 'hin', 'spa', + 'fra', 'arb', 'ben', 'rus', + 'por', 'urd', 'ind', 'deu', + 'jpn', 'pcm', 'mar', 'tel', +]; + +const locales = [ + 'en', 'zh', 'hi', 'es', + 'fr', 'ar', 'bn', 'ru', + 'pt', 'ur', 'id', 'de', + 'ja', 'pcm', 'mr', 'te', +]; + +// These must not overlap +const zones = [ + 'America/New_York', + 'UTC', + 'Asia/Irkutsk', + 'Australia/North', + 'Antarctica/South_Pole', +]; + + +assert.deepStrictEqual(Intl.getCanonicalLocales(localesISO639), locales); + + +// On some platforms these keep original locale (for example, 'January') +const enero = runEnvOutside( + { LANG: 'es' }, + 'new Intl.DateTimeFormat(undefined, { month: "long" } ).format(new Date(9e8))' +); +const janvier = runEnvOutside( + { LANG: 'fr' }, + 'new Intl.DateTimeFormat(undefined, { month: "long" } ).format(new Date(9e8))' +); +const isMockable = enero !== janvier; + +// Tests with mocked env +if (isMockable) { + assert.strictEqual( + isSet(zones.map((TZ) => runEnvOutside({ TZ }, 'new Date(333333333333).toString()'))), + true + ); + assert.strictEqual( + isSet(zones.map((TZ) => runEnvOutside({ TZ }, 'new Date(333333333333).toLocaleString()'))), + true + ); + assert.deepStrictEqual( + locales.map((LANG) => runEnvOutside({ LANG, TZ: 'Europe/Zurich' }, 'new Date(333333333333).toString()')), + [ + 'Fri Jul 25 1980 01:35:33 GMT+0100 (Central European Standard Time)', + 'Fri Jul 25 1980 01:35:33 GMT+0100 (中欧标准时间)', + 'Fri Jul 25 1980 01:35:33 GMT+0100 (मध्य यूरोपीय मानक समय)', + 'Fri Jul 25 1980 01:35:33 GMT+0100 (hora estándar de Europa central)', + 'Fri Jul 25 1980 01:35:33 GMT+0100 (heure normale d’Europe centrale)', + 'Fri Jul 25 1980 01:35:33 GMT+0100 (توقيت وسط أوروبا الرسمي)', + 'Fri Jul 25 1980 01:35:33 GMT+0100 (মধ্য ইউরোপীয় মানক সময়)', + 'Fri Jul 25 1980 01:35:33 GMT+0100 (Центральная Европа, стандартное время)', + 'Fri Jul 25 1980 01:35:33 GMT+0100 (Horário Padrão da Europa Central)', + 'Fri Jul 25 1980 01:35:33 GMT+0100 (وسطی یورپ کا معیاری وقت)', + 'Fri Jul 25 1980 01:35:33 GMT+0100 (Waktu Standar Eropa Tengah)', + 'Fri Jul 25 1980 01:35:33 GMT+0100 (Mitteleuropäische Normalzeit)', + 'Fri Jul 25 1980 01:35:33 GMT+0100 (中央ヨーロッパ標準時)', + 'Fri Jul 25 1980 01:35:33 GMT+0100 (Mídúl Yúrop Fíksd Taim)', + 'Fri Jul 25 1980 01:35:33 GMT+0100 (मध्‍य युरोपियन प्रमाण वेळ)', + 'Fri Jul 25 1980 01:35:33 GMT+0100 (సెంట్రల్ యూరోపియన్ ప్రామాణిక సమయం)', + ] + ); + assert.deepStrictEqual( + locales.map((LANG) => runEnvOutside({ LANG, TZ: 'Europe/Zurich' }, 'new Date(333333333333).toLocaleString()')), + [ + '7/25/1980, 1:35:33 AM', + '1980/7/25 01:35:33', + '25/7/1980, 1:35:33 am', + '25/7/1980, 1:35:33', + '25/07/1980 01:35:33', + '٢٥‏/٧‏/١٩٨٠، ١:٣٥:٣٣ ص', + '২৫/৭/১৯৮০, ১:৩৫:৩৩ AM', + '25.07.1980, 01:35:33', + '25/07/1980, 01:35:33', + '25/7/1980، 1:35:33 AM', + '25/7/1980, 01.35.33', + '25.7.1980, 01:35:33', + '1980/7/25 1:35:33', + '25/7/1980 01:35:33', + '२५/७/१९८०, १:३५:३३ AM', + '25/7/1980 1:35:33 AM', + ] + ); + assert.strictEqual( + runEnvOutside({ LANG: 'en' }, '["z", "ä"].sort(new Intl.Collator().compare)'), + 'ä,z' + ); + assert.strictEqual( + runEnvOutside({ LANG: 'sv' }, '["z", "ä"].sort(new Intl.Collator().compare)'), + 'z,ä' + ); + assert.deepStrictEqual( + locales.map( + (LANG) => runEnvOutside({ LANG, TZ: 'Europe/Zurich' }, 'new Intl.DateTimeFormat().format(333333333333)') + ), + [ + '7/25/1980', '1980/7/25', + '25/7/1980', '25/7/1980', + '25/07/1980', '٢٥‏/٧‏/١٩٨٠', + '২৫/৭/১৯৮০', '25.07.1980', + '25/07/1980', '25/7/1980', + '25/7/1980', '25.7.1980', + '1980/7/25', '25/7/1980', + '२५/७/१९८०', '25/7/1980', + ] + ); + assert.deepStrictEqual( + locales.map((LANG) => runEnvOutside({ LANG }, 'new Intl.DisplayNames(undefined, { type: "region" }).of("CH")')), + [ + 'Switzerland', '瑞士', + 'स्विट्ज़रलैंड', 'Suiza', + 'Suisse', 'سويسرا', + 'সুইজারল্যান্ড', 'Швейцария', + 'Suíça', 'سوئٹزر لینڈ', + 'Swiss', 'Schweiz', + 'スイス', 'Swítsaland', + 'स्वित्झर्लंड', 'స్విట్జర్లాండ్', + ] + ); + assert.deepStrictEqual( + locales.map((LANG) => runEnvOutside({ LANG }, 'new Intl.NumberFormat().format(275760.913)')), + [ + '275,760.913', '275,760.913', + '2,75,760.913', '275.760,913', + '275 760,913', '٢٧٥٬٧٦٠٫٩١٣', + '২,৭৫,৭৬০.৯১৩', '275 760,913', + '275.760,913', '275,760.913', + '275.760,913', '275.760,913', + '275,760.913', '275,760.913', + '२,७५,७६०.९१३', '2,75,760.913', + ] + ); + assert.deepStrictEqual( + locales.map((LANG) => runEnvOutside({ LANG }, 'new Intl.PluralRules().select(0)')), + [ + 'other', 'other', 'one', 'other', + 'one', 'zero', 'one', 'many', + 'one', 'other', 'other', 'other', + 'other', 'one', 'other', 'other', + ] + ); + assert.deepStrictEqual( + locales.map((LANG) => runEnvOutside({ LANG }, 'new Intl.RelativeTimeFormat().format(-586920.617, "hour")')), + [ + '586,920.617 hours ago', + '586,920.617小时前', + '5,86,920.617 घंटे पहले', + 'hace 586.920,617 horas', + 'il y a 586 920,617 heures', + 'قبل ٥٨٦٬٩٢٠٫٦١٧ ساعة', + '৫,৮৬,৯২০.৬১৭ ঘন্টা আগে', + '586 920,617 часа назад', + 'há 586.920,617 horas', + '586,920.617 گھنٹے پہلے', + '586.920,617 jam yang lalu', + 'vor 586.920,617 Stunden', + '586,920.617 時間前', + '586,920.617 áwa wé dọ́n pas', + '५,८६,९२०.६१७ तासांपूर्वी', + '5,86,920.617 గంటల క్రితం', + ] + ); +} + + +// Tests with process.env mutated inside +{ + // process.env.TZ is not intercepted in Workers + if (common.isMainThread) { + assert.strictEqual( + isSet(zones.map((TZ) => runEnvInside({ TZ }, () => new Date(333333333333).toString()))), + true + ); + assert.strictEqual( + isSet(zones.map((TZ) => runEnvInside({ TZ }, () => new Date(333333333333).toLocaleString()))), + true + ); + } else { + assert.strictEqual( + isPack(zones.map((TZ) => runEnvInside({ TZ }, () => new Date(333333333333).toString()))), + true + ); + assert.strictEqual( + isPack(zones.map((TZ) => runEnvInside({ TZ }, () => new Date(333333333333).toLocaleString()))), + true + ); + } + + assert.strictEqual( + isPack(locales.map((LANG) => runEnvInside({ LANG, TZ: 'Europe/Zurich' }, () => new Date(333333333333).toString()))), + true + ); + assert.strictEqual( + isPack(locales.map( + (LANG) => runEnvInside({ LANG, TZ: 'Europe/Zurich' }, () => new Date(333333333333).toLocaleString()) + )), + true + ); + assert.deepStrictEqual( + runEnvInside({ LANG: 'en' }, () => ['z', 'ä'].sort(new Intl.Collator().compare)), + runEnvInside({ LANG: 'sv' }, () => ['z', 'ä'].sort(new Intl.Collator().compare)) + ); + assert.strictEqual( + isPack(locales.map( + (LANG) => runEnvInside({ LANG, TZ: 'Europe/Zurich' }, () => new Intl.DateTimeFormat().format(333333333333)) + )), + true + ); + assert.strictEqual( + isPack(locales.map( + (LANG) => runEnvInside({ LANG }, () => new Intl.DisplayNames(undefined, { type: 'region' }).of('CH')) + )), + true + ); + assert.strictEqual( + isPack(locales.map((LANG) => runEnvInside({ LANG }, () => new Intl.NumberFormat().format(275760.913)))), + true + ); + assert.strictEqual( + isPack(locales.map((LANG) => runEnvInside({ LANG }, () => new Intl.PluralRules().select(0)))), + true + ); + assert.strictEqual( + isPack(locales.map( + (LANG) => runEnvInside({ LANG }, () => new Intl.RelativeTimeFormat().format(-586920.617, 'hour')) + )), + true + ); +} diff --git a/tests/node_compat/test/parallel/test-icu-stringwidth.js b/tests/node_compat/test/parallel/test-icu-stringwidth.js new file mode 100644 index 0000000000..3e3c1f0c31 --- /dev/null +++ b/tests/node_compat/test/parallel/test-icu-stringwidth.js @@ -0,0 +1,102 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; +const common = require('../common'); + +const assert = require('assert'); +const { getStringWidth } = require('internal/util/inspect'); + +// Test column width + +// Ll (Lowercase Letter): LATIN SMALL LETTER A +assert.strictEqual(getStringWidth('a'), 1); +assert.strictEqual(getStringWidth(String.fromCharCode(0x0061)), 1); +// Lo (Other Letter) +assert.strictEqual(getStringWidth('丁'), 2); +assert.strictEqual(getStringWidth(String.fromCharCode(0x4E01)), 2); +// Surrogate pairs +assert.strictEqual(getStringWidth('\ud83d\udc78\ud83c\udfff'), 4); +assert.strictEqual(getStringWidth('👅'), 2); +// Cs (Surrogate): High Surrogate +assert.strictEqual(getStringWidth('\ud83d'), 1); +// Cs (Surrogate): Low Surrogate +assert.strictEqual(getStringWidth('\udc78'), 1); +// Cc (Control): NULL +assert.strictEqual(getStringWidth('\u0000'), 0); +// Cc (Control): BELL +assert.strictEqual(getStringWidth(String.fromCharCode(0x0007)), 0); +// Cc (Control): LINE FEED +assert.strictEqual(getStringWidth('\n'), 0); +// Cf (Format): SOFT HYPHEN +assert.strictEqual(getStringWidth(String.fromCharCode(0x00AD)), 1); +// Cf (Format): LEFT-TO-RIGHT MARK +// Cf (Format): RIGHT-TO-LEFT MARK +assert.strictEqual(getStringWidth('\u200Ef\u200F'), 1); +// Cn (Unassigned): Not a character +assert.strictEqual(getStringWidth(String.fromCharCode(0x10FFEF)), 1); +// Cn (Unassigned): Not a character (but in a CJK range) +assert.strictEqual(getStringWidth(String.fromCharCode(0x3FFEF)), 1); +// Mn (Nonspacing Mark): COMBINING ACUTE ACCENT +assert.strictEqual(getStringWidth(String.fromCharCode(0x0301)), 0); +// Mc (Spacing Mark): BALINESE ADEG ADEG +// Chosen as its Canonical_Combining_Class is not 0, but is not a 0-width +// character. +assert.strictEqual(getStringWidth(String.fromCharCode(0x1B44)), 1); +// Me (Enclosing Mark): COMBINING ENCLOSING CIRCLE +assert.strictEqual(getStringWidth(String.fromCharCode(0x20DD)), 0); + +// The following is an emoji sequence with ZWJ (zero-width-joiner). In some +// implementations, it is represented as a single glyph, in other +// implementations as a sequence of individual glyphs. By default, each +// component will be counted individually, since not a lot of systems support +// these fully. +// See https://www.unicode.org/reports/tr51/tr51-16.html#Emoji_ZWJ_Sequences +assert.strictEqual(getStringWidth('👩‍👩‍👧‍👧'), 8); +// TODO(BridgeAR): This should have a width of two and six. The heart contains +// the \uFE0F variation selector that indicates that it should be displayed as +// emoji instead of as text. Emojis are all full width characters when not being +// rendered as text. +// https://en.wikipedia.org/wiki/Variation_Selectors_(Unicode_block) +assert.strictEqual(getStringWidth('❤️'), 1); +assert.strictEqual(getStringWidth('👩‍❤️‍👩'), 5); +// The length of one is correct. It is an emoji treated as text. +assert.strictEqual(getStringWidth('❤'), 1); + +// By default, unicode characters whose width is considered ambiguous will +// be considered half-width. For these characters, getStringWidth will return +// 1. In some contexts, however, it is more appropriate to consider them full +// width. By default, the algorithm will assume half width. +assert.strictEqual(getStringWidth('\u01d4'), 1); + +// Control chars and combining chars are zero +assert.strictEqual(getStringWidth('\u200E\n\u220A\u20D2'), 1); + +// Test that the fast path for ASCII characters yields results consistent +// with the 'slow' path. +for (let i = 0; i < 256; i++) { + const char = String.fromCharCode(i); + assert.strictEqual( + getStringWidth(char + '🎉'), + getStringWidth(char) + 2); + + if (i < 32 || (i >= 127 && i < 160)) { // Control character + assert.strictEqual(getStringWidth(char), 0); + } else { // Regular ASCII character + assert.strictEqual(getStringWidth(char), 1); + } +} + +if (common.hasIntl) { + const a = '한글'.normalize('NFD'); // 한글 + const b = '한글'.normalize('NFC'); // 한글 + assert.strictEqual(a.length, 6); + assert.strictEqual(b.length, 2); + assert.strictEqual(getStringWidth(a), 4); + assert.strictEqual(getStringWidth(b), 4); +} diff --git a/tests/node_compat/test/parallel/test-inspector-stops-no-file.js b/tests/node_compat/test/parallel/test-inspector-stops-no-file.js new file mode 100644 index 0000000000..0eea1e3b16 --- /dev/null +++ b/tests/node_compat/test/parallel/test-inspector-stops-no-file.js @@ -0,0 +1,23 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); + +const spawn = require('child_process').spawn; + +const child = spawn(process.execPath, + [ '--inspect', 'no-such-script.js' ], + { 'stdio': 'inherit' }); + +function signalHandler() { + child.kill(); + process.exit(1); +} + +process.on('SIGINT', signalHandler); +process.on('SIGTERM', signalHandler); diff --git a/tests/node_compat/test/parallel/test-instanceof.js b/tests/node_compat/test/parallel/test-instanceof.js new file mode 100644 index 0000000000..2d81c1cf15 --- /dev/null +++ b/tests/node_compat/test/parallel/test-instanceof.js @@ -0,0 +1,18 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const assert = require('assert'); + + +// Regression test for instanceof, see +// https://github.com/nodejs/node/issues/7592 +const F = () => {}; +F.prototype = {}; +assert({ __proto__: F.prototype } instanceof F); diff --git a/tests/node_compat/test/parallel/test-internal-fs.js b/tests/node_compat/test/parallel/test-internal-fs.js new file mode 100644 index 0000000000..b0abd04e9b --- /dev/null +++ b/tests/node_compat/test/parallel/test-internal-fs.js @@ -0,0 +1,60 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; + +require('../common'); +const assert = require('assert'); +const fs = require('internal/fs/utils'); + +// Valid encodings and no args should not throw. +fs.assertEncoding(); +fs.assertEncoding('utf8'); + +assert.throws( + () => fs.assertEncoding('foo'), + { code: 'ERR_INVALID_ARG_VALUE', name: 'TypeError' } +); + +// Test junction symlinks +{ + const pathString = 'c:\\test1'; + const linkPathString = '\\test2'; + + const preprocessSymlinkDestination = fs.preprocessSymlinkDestination( + pathString, + 'junction', + linkPathString + ); + + if (process.platform === 'win32') { + assert.match(preprocessSymlinkDestination, /^\\\\\?\\/); + } else { + assert.strictEqual(preprocessSymlinkDestination, pathString); + } +} + +// Test none junction symlinks +{ + const pathString = 'c:\\test1'; + const linkPathString = '\\test2'; + + const preprocessSymlinkDestination = fs.preprocessSymlinkDestination( + pathString, + undefined, + linkPathString + ); + + if (process.platform === 'win32') { + // There should not be any forward slashes + assert.strictEqual( + /\//.test(preprocessSymlinkDestination), false); + } else { + assert.strictEqual(preprocessSymlinkDestination, pathString); + } +} diff --git a/tests/node_compat/test/parallel/test-internal-util-normalizeencoding.js b/tests/node_compat/test/parallel/test-internal-util-normalizeencoding.js new file mode 100644 index 0000000000..9a85f6192e --- /dev/null +++ b/tests/node_compat/test/parallel/test-internal-util-normalizeencoding.js @@ -0,0 +1,62 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; + +require('../common'); +const assert = require('assert'); +const util = require('internal/util'); + +const tests = [ + [undefined, 'utf8'], + [null, 'utf8'], + ['', 'utf8'], + ['utf8', 'utf8'], + ['utf-8', 'utf8'], + ['UTF-8', 'utf8'], + ['UTF8', 'utf8'], + ['Utf8', 'utf8'], + ['uTf-8', 'utf8'], + ['utF-8', 'utf8'], + ['ucs2', 'utf16le'], + ['UCS2', 'utf16le'], + ['UcS2', 'utf16le'], + ['ucs-2', 'utf16le'], + ['UCS-2', 'utf16le'], + ['UcS-2', 'utf16le'], + ['utf16le', 'utf16le'], + ['utf-16le', 'utf16le'], + ['UTF-16LE', 'utf16le'], + ['UTF16LE', 'utf16le'], + ['binary', 'latin1'], + ['BINARY', 'latin1'], + ['latin1', 'latin1'], + ['LaTiN1', 'latin1'], + ['base64', 'base64'], + ['BASE64', 'base64'], + ['Base64', 'base64'], + ['base64url', 'base64url'], + ['BASE64url', 'base64url'], + ['Base64url', 'base64url'], + ['hex', 'hex'], + ['HEX', 'hex'], + ['ASCII', 'ascii'], + ['AsCii', 'ascii'], + ['foo', undefined], + [1, undefined], + [false, undefined], + [NaN, undefined], + [0, undefined], + [[], undefined], + [{}, undefined], +]; + +tests.forEach((e, i) => { + const res = util.normalizeEncoding(e[0]); + assert.strictEqual(res, e[1], `#${i} failed: expected ${e[1]}, got ${res}`); +}); diff --git a/tests/node_compat/test/parallel/test-kill-segfault-freebsd.js b/tests/node_compat/test/parallel/test-kill-segfault-freebsd.js new file mode 100644 index 0000000000..b42901a322 --- /dev/null +++ b/tests/node_compat/test/parallel/test-kill-segfault-freebsd.js @@ -0,0 +1,26 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); + +// This test ensures Node.js doesn't crash on hitting Ctrl+C in order to +// terminate the currently running process (especially on FreeBSD). +// https://github.com/nodejs/node-v0.x-archive/issues/9326 + +const assert = require('assert'); +const child_process = require('child_process'); + +// NOTE: Was crashing on FreeBSD +const cp = child_process.spawn(process.execPath, [ + '-e', + 'process.kill(process.pid, "SIGINT")', +]); + +cp.on('exit', function(code) { + assert.notStrictEqual(code, 0); +}); diff --git a/tests/node_compat/test/parallel/test-listen-fd-detached-inherit.js b/tests/node_compat/test/parallel/test-listen-fd-detached-inherit.js new file mode 100644 index 0000000000..60ef9ac4b5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-listen-fd-detached-inherit.js @@ -0,0 +1,125 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +if (common.isWindows) + common.skip('This test is disabled on windows.'); + +const assert = require('assert'); +const http = require('http'); +const net = require('net'); +const spawn = require('child_process').spawn; + +switch (process.argv[2]) { + case 'child': return child(); + case 'parent': return parent(); + default: return test(); +} + +// Spawn the parent, and listen for it to tell us the pid of the child. +// WARNING: This is an example of listening on some arbitrary FD number +// that has already been bound elsewhere in advance. However, binding +// server handles to stdio fd's is NOT a good or reliable way to do +// concurrency in HTTP servers! Use the cluster module, or if you want +// a more low-level approach, use child process IPC manually. +function test() { + const parent = spawn(process.execPath, [__filename, 'parent'], { + stdio: [ 0, 'pipe', 2 ] + }); + let json = ''; + parent.stdout.on('data', function(c) { + json += c.toString(); + if (json.includes('\n')) next(); + }); + function next() { + console.error('output from parent = %s', json); + const child = JSON.parse(json); + // Now make sure that we can request to the subprocess, then kill it. + http.get({ + server: 'localhost', + port: child.port, + path: '/', + }).on('response', function(res) { + let s = ''; + res.on('data', function(c) { + s += c.toString(); + }); + res.on('end', function() { + // Kill the subprocess before we start doing asserts. + // It's really annoying when tests leave orphans! + process.kill(child.pid, 'SIGKILL'); + try { + parent.kill(); + } catch { + // Continue regardless of error. + } + + assert.strictEqual(s, 'hello from child\n'); + assert.strictEqual(res.statusCode, 200); + }); + }); + } +} + +// Listen on port, and then pass the handle to the detached child. +// Then output the child's pid, and immediately exit. +function parent() { + const server = net.createServer(function(conn) { + conn.end('HTTP/1.1 403 Forbidden\r\n\r\nI got problems.\r\n'); + throw new Error('Should not see connections on parent'); + }).listen(0, function() { + console.error('server listening on %d', this.address().port); + + const child = spawn(process.execPath, [__filename, 'child'], { + stdio: [ 0, 1, 2, server._handle ], + detached: true + }); + + console.log('%j\n', { pid: child.pid, port: this.address().port }); + + // Now close the parent, so that the child is the only thing + // referencing that handle. Note that connections will still + // be accepted, because the child has the fd open, but the parent + // will exit gracefully. + server.close(); + child.unref(); + }); +} + +// Run as a child of the parent() mode. +function child() { + // Start a server on fd=3 + http.createServer(function(req, res) { + console.error('request on child'); + console.error('%s %s', req.method, req.url, req.headers); + res.end('hello from child\n'); + }).listen({ fd: 3 }, function() { + console.error('child listening on fd=3'); + }); +} diff --git a/tests/node_compat/test/parallel/test-listen-fd-detached.js b/tests/node_compat/test/parallel/test-listen-fd-detached.js new file mode 100644 index 0000000000..2bef173a2f --- /dev/null +++ b/tests/node_compat/test/parallel/test-listen-fd-detached.js @@ -0,0 +1,122 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +if (common.isWindows) + common.skip('This test is disabled on windows.'); + +const assert = require('assert'); +const http = require('http'); +const net = require('net'); +const spawn = require('child_process').spawn; + +switch (process.argv[2]) { + case 'child': return child(); + case 'parent': return parent(); + default: return test(); +} + +// Spawn the parent, and listen for it to tell us the pid of the child. +// WARNING: This is an example of listening on some arbitrary FD number +// that has already been bound elsewhere in advance. However, binding +// server handles to stdio fd's is NOT a good or reliable way to do +// concurrency in HTTP servers! Use the cluster module, or if you want +// a more low-level approach, use child process IPC manually. +function test() { + const parent = spawn(process.execPath, [__filename, 'parent'], { + stdio: [ 0, 'pipe', 2 ] + }); + let json = ''; + parent.stdout.on('data', function(c) { + json += c.toString(); + if (json.includes('\n')) next(); + }); + function next() { + console.error('output from parent = %s', json); + const child = JSON.parse(json); + // Now make sure that we can request to the subprocess, then kill it. + http.get({ + server: 'localhost', + port: child.port, + path: '/', + }).on('response', function(res) { + let s = ''; + res.on('data', function(c) { + s += c.toString(); + }); + res.on('end', function() { + // Kill the subprocess before we start doing asserts. + // it's really annoying when tests leave orphans! + process.kill(child.pid, 'SIGKILL'); + try { + parent.kill(); + } catch { + // Continue regardless of error. + } + + assert.strictEqual(s, 'hello from child\n'); + assert.strictEqual(res.statusCode, 200); + }); + }); + } +} + +function parent() { + const server = net.createServer(function(conn) { + console.error('connection on parent'); + conn.end('hello from parent\n'); + }).listen(0, function() { + console.error('server listening on %d', this.address().port); + + const child = spawn(process.execPath, [__filename, 'child'], { + stdio: [ 'ignore', 'ignore', 'ignore', server._handle ], + detached: true + }); + + console.log('%j\n', { pid: child.pid, port: this.address().port }); + + // Now close the parent, so that the child is the only thing + // referencing that handle. Note that connections will still + // be accepted, because the child has the fd open, but the parent + // will exit gracefully. + server.close(); + child.unref(); + }); +} + +function child() { + // Start a server on fd=3 + http.createServer(function(req, res) { + console.error('request on child'); + console.error('%s %s', req.method, req.url, req.headers); + res.end('hello from child\n'); + }).listen({ fd: 3 }, function() { + console.error('child listening on fd=3'); + }); +} diff --git a/tests/node_compat/test/parallel/test-memory-usage-emfile.js b/tests/node_compat/test/parallel/test-memory-usage-emfile.js new file mode 100644 index 0000000000..4a89be3cb5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-memory-usage-emfile.js @@ -0,0 +1,25 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +// On IBMi, the rss memory always returns zero +if (common.isIBMi) + common.skip('On IBMi, the rss memory always returns zero'); + +const assert = require('assert'); + +const fs = require('fs'); + +const files = []; + +while (files.length < 256) + files.push(fs.openSync(__filename, 'r')); + +const r = process.memoryUsage.rss(); +assert.strictEqual(r > 0, true); diff --git a/tests/node_compat/test/parallel/test-memory-usage.js b/tests/node_compat/test/parallel/test-memory-usage.js new file mode 100644 index 0000000000..8227b7b122 --- /dev/null +++ b/tests/node_compat/test/parallel/test-memory-usage.js @@ -0,0 +1,56 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// Flags: --predictable-gc-schedule +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +const r = process.memoryUsage(); +// On IBMi, the rss memory always returns zero +if (!common.isIBMi) { + assert.ok(r.rss > 0); + assert.ok(process.memoryUsage.rss() > 0); +} + +assert.ok(r.heapTotal > 0); +assert.ok(r.heapUsed > 0); +assert.ok(r.external > 0); + +assert.strictEqual(typeof r.arrayBuffers, 'number'); +if (r.arrayBuffers > 0) { + const size = 10 * 1024 * 1024; + // eslint-disable-next-line no-unused-vars + const ab = new ArrayBuffer(size); + + const after = process.memoryUsage(); + assert.ok(after.external - r.external >= size, + `${after.external} - ${r.external} >= ${size}`); + assert.strictEqual(after.arrayBuffers - r.arrayBuffers, size, + `${after.arrayBuffers} - ${r.arrayBuffers} === ${size}`); +} diff --git a/tests/node_compat/test/parallel/test-messagechannel.js b/tests/node_compat/test/parallel/test-messagechannel.js new file mode 100644 index 0000000000..44ddf6d7aa --- /dev/null +++ b/tests/node_compat/test/parallel/test-messagechannel.js @@ -0,0 +1,19 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +// See: https://github.com/nodejs/node/issues/49940 +(async () => { + new MessageChannel().port1.postMessage({}, { + transfer: { + *[Symbol.iterator]() {} + } + }); +})().then(common.mustCall()); diff --git a/tests/node_compat/test/parallel/test-microtask-queue-integration.js b/tests/node_compat/test/parallel/test-microtask-queue-integration.js new file mode 100644 index 0000000000..8abb41d364 --- /dev/null +++ b/tests/node_compat/test/parallel/test-microtask-queue-integration.js @@ -0,0 +1,70 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); + +const implementations = [ + function(fn) { + Promise.resolve().then(fn); + }, +]; + +let expected = 0; +let done = 0; + +process.on('exit', function() { + assert.strictEqual(done, expected); +}); + +function test(scheduleMicrotask) { + let nextTickCalled = false; + expected++; + + scheduleMicrotask(function() { + process.nextTick(function() { + nextTickCalled = true; + }); + + setTimeout(function() { + assert(nextTickCalled); + done++; + }, 0); + }); +} + +// first tick case +implementations.forEach(test); + +// tick callback case +setTimeout(function() { + implementations.forEach(function(impl) { + process.nextTick(test.bind(null, impl)); + }); +}, 0); diff --git a/tests/node_compat/test/parallel/test-microtask-queue-run-immediate.js b/tests/node_compat/test/parallel/test-microtask-queue-run-immediate.js new file mode 100644 index 0000000000..a1dff2c7e9 --- /dev/null +++ b/tests/node_compat/test/parallel/test-microtask-queue-run-immediate.js @@ -0,0 +1,66 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); + +function enqueueMicrotask(fn) { + Promise.resolve().then(fn); +} + +let done = 0; + +process.on('exit', function() { + assert.strictEqual(done, 2); +}); + +// No nextTick, microtask +setImmediate(function() { + enqueueMicrotask(function() { + done++; + }); +}); + + +// No nextTick, microtask with nextTick +setImmediate(function() { + let called = false; + + enqueueMicrotask(function() { + process.nextTick(function() { + called = true; + }); + }); + + setImmediate(function() { + if (called) + done++; + }); + +}); diff --git a/tests/node_compat/test/parallel/test-microtask-queue-run.js b/tests/node_compat/test/parallel/test-microtask-queue-run.js new file mode 100644 index 0000000000..43900006f0 --- /dev/null +++ b/tests/node_compat/test/parallel/test-microtask-queue-run.js @@ -0,0 +1,66 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); + +function enqueueMicrotask(fn) { + Promise.resolve().then(fn); +} + +let done = 0; + +process.on('exit', function() { + assert.strictEqual(done, 2); +}); + +// No nextTick, microtask +setTimeout(function() { + enqueueMicrotask(function() { + done++; + }); +}, 0); + + +// No nextTick, microtask with nextTick +setTimeout(function() { + let called = false; + + enqueueMicrotask(function() { + process.nextTick(function() { + called = true; + }); + }); + + setTimeout(function() { + if (called) + done++; + }, 0); + +}, 0); diff --git a/tests/node_compat/test/parallel/test-module-cache.js b/tests/node_compat/test/parallel/test-module-cache.js new file mode 100644 index 0000000000..01935e9c87 --- /dev/null +++ b/tests/node_compat/test/parallel/test-module-cache.js @@ -0,0 +1,25 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +const filePath = tmpdir.resolve('test-module-cache.json'); +assert.throws( + () => require(filePath), + { code: 'MODULE_NOT_FOUND' } +); + +fs.writeFileSync(filePath, '[]'); + +const content = require(filePath); +assert.strictEqual(Array.isArray(content), true); +assert.strictEqual(content.length, 0); diff --git a/tests/node_compat/test/parallel/test-module-circular-symlinks.js b/tests/node_compat/test/parallel/test-module-circular-symlinks.js new file mode 100644 index 0000000000..0b32980588 --- /dev/null +++ b/tests/node_compat/test/parallel/test-module-circular-symlinks.js @@ -0,0 +1,75 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// This tests to make sure that modules with symlinked circular dependencies +// do not blow out the module cache and recurse forever. See issue +// https://github.com/nodejs/node/pull/5950 for context. PR #5950 attempted +// to solve a problem with symlinked peer dependencies by caching using the +// symlink path. Unfortunately, that breaks the case tested in this module +// because each symlinked module, despite pointing to the same code on disk, +// is loaded and cached as a separate module instance, which blows up the +// cache and leads to a recursion bug. + +// This test should pass in Node.js v4 and v5. It should pass in Node.js v6 +// after https://github.com/nodejs/node/pull/5950 has been reverted. + +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); +const fs = require('fs'); + +// {tmpDir} +// ├── index.js +// └── node_modules +// ├── moduleA +// │ ├── index.js +// │ └── node_modules +// │ └── moduleB -> {tmpDir}/node_modules/moduleB +// └── moduleB +// ├── index.js +// └── node_modules +// └── moduleA -> {tmpDir}/node_modules/moduleA + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); +const tmpDir = tmpdir.path; + +const node_modules = path.join(tmpDir, 'node_modules'); +const moduleA = path.join(node_modules, 'moduleA'); +const moduleB = path.join(node_modules, 'moduleB'); +const moduleA_link = path.join(moduleB, 'node_modules', 'moduleA'); +const moduleB_link = path.join(moduleA, 'node_modules', 'moduleB'); + +fs.mkdirSync(node_modules); +fs.mkdirSync(moduleA); +fs.mkdirSync(moduleB); +fs.mkdirSync(path.join(moduleA, 'node_modules')); +fs.mkdirSync(path.join(moduleB, 'node_modules')); + +try { + fs.symlinkSync(moduleA, moduleA_link); + fs.symlinkSync(moduleB, moduleB_link); +} catch (err) { + if (err.code !== 'EPERM') throw err; + common.skip('insufficient privileges for symlinks'); +} + +fs.writeFileSync(path.join(tmpDir, 'index.js'), + 'module.exports = require(\'moduleA\');', 'utf8'); +fs.writeFileSync(path.join(moduleA, 'index.js'), + 'module.exports = {b: require(\'moduleB\')};', 'utf8'); +fs.writeFileSync(path.join(moduleB, 'index.js'), + 'module.exports = {a: require(\'moduleA\')};', 'utf8'); + +// Ensure that the symlinks are not followed forever... +const obj = require(path.join(tmpDir, 'index')); +assert.ok(obj); +assert.ok(obj.b); +assert.ok(obj.b.a); +assert.ok(!obj.b.a.b); diff --git a/tests/node_compat/test/parallel/test-module-isBuiltin.js b/tests/node_compat/test/parallel/test-module-isBuiltin.js new file mode 100644 index 0000000000..13746a9116 --- /dev/null +++ b/tests/node_compat/test/parallel/test-module-isBuiltin.js @@ -0,0 +1,23 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const { isBuiltin } = require('module'); + +// Includes modules in lib/ (even deprecated ones) +assert(isBuiltin('http')); +assert(isBuiltin('sys')); +assert(isBuiltin('node:fs')); +assert(isBuiltin('node:test')); + +// Does not include internal modules +assert(!isBuiltin('internal/errors')); +assert(!isBuiltin('test')); +assert(!isBuiltin('')); +assert(!isBuiltin(undefined)); diff --git a/tests/node_compat/test/parallel/test-module-multi-extensions.js b/tests/node_compat/test/parallel/test-module-multi-extensions.js new file mode 100644 index 0000000000..36de3187f9 --- /dev/null +++ b/tests/node_compat/test/parallel/test-module-multi-extensions.js @@ -0,0 +1,100 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// Refs: https://github.com/nodejs/node/issues/4778 + +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const Module = require('module'); +const tmpdir = require('../common/tmpdir'); +const file = tmpdir.resolve('test-extensions.foo.bar'); +const dotfile = tmpdir.resolve('.bar'); +const dotfileWithExtension = tmpdir.resolve('.foo.bar'); + +tmpdir.refresh(); +fs.writeFileSync(file, 'console.log(__filename);', 'utf8'); +fs.writeFileSync(dotfile, 'console.log(__filename);', 'utf8'); +fs.writeFileSync(dotfileWithExtension, 'console.log(__filename);', 'utf8'); + +{ + require.extensions['.bar'] = common.mustNotCall(); + require.extensions['.foo.bar'] = common.mustCall(); + const modulePath = tmpdir.resolve('test-extensions'); + require(modulePath); + require(file); + delete require.cache[file]; + delete require.extensions['.bar']; + delete require.extensions['.foo.bar']; + Module._pathCache = { __proto__: null }; +} + +{ + require.extensions['.foo.bar'] = common.mustCall(); + const modulePath = tmpdir.resolve('test-extensions'); + require(modulePath); + assert.throws( + () => require(`${modulePath}.foo`), + (err) => err.message.startsWith(`Cannot find module '${modulePath}.foo'`) + ); + require(`${modulePath}.foo.bar`); + delete require.cache[file]; + delete require.extensions['.foo.bar']; + Module._pathCache = { __proto__: null }; +} + +{ + const modulePath = tmpdir.resolve('test-extensions'); + assert.throws( + () => require(modulePath), + (err) => err.message.startsWith(`Cannot find module '${modulePath}'`) + ); + delete require.cache[file]; + Module._pathCache = { __proto__: null }; +} + +{ + require.extensions['.bar'] = common.mustNotCall(); + require.extensions['.foo.bar'] = common.mustCall(); + const modulePath = tmpdir.resolve('test-extensions.foo'); + require(modulePath); + delete require.cache[file]; + delete require.extensions['.bar']; + delete require.extensions['.foo.bar']; + Module._pathCache = { __proto__: null }; +} + +{ + require.extensions['.foo.bar'] = common.mustNotCall(); + const modulePath = tmpdir.resolve('test-extensions.foo'); + assert.throws( + () => require(modulePath), + (err) => err.message.startsWith(`Cannot find module '${modulePath}'`) + ); + delete require.extensions['.foo.bar']; + Module._pathCache = { __proto__: null }; +} + +{ + require.extensions['.bar'] = common.mustNotCall(); + require(dotfile); + delete require.cache[dotfile]; + delete require.extensions['.bar']; + Module._pathCache = { __proto__: null }; +} + +{ + require.extensions['.bar'] = common.mustCall(); + require.extensions['.foo.bar'] = common.mustNotCall(); + require(dotfileWithExtension); + delete require.cache[dotfileWithExtension]; + delete require.extensions['.bar']; + delete require.extensions['.foo.bar']; + Module._pathCache = { __proto__: null }; +} diff --git a/tests/node_compat/test/parallel/test-module-nodemodulepaths.js b/tests/node_compat/test/parallel/test-module-nodemodulepaths.js new file mode 100644 index 0000000000..cccbbee7f2 --- /dev/null +++ b/tests/node_compat/test/parallel/test-module-nodemodulepaths.js @@ -0,0 +1,134 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const _module = require('module'); + +const cases = { + 'WIN': [{ + file: 'C:\\Users\\hefangshi\\AppData\\Roaming\ +\\npm\\node_modules\\npm\\node_modules\\minimatch', + expect: [ + 'C:\\Users\\hefangshi\\AppData\\Roaming\ +\\npm\\node_modules\\npm\\node_modules\\minimatch\\node_modules', + 'C:\\Users\\hefangshi\\AppData\\Roaming\ +\\npm\\node_modules\\npm\\node_modules', + 'C:\\Users\\hefangshi\\AppData\\Roaming\\npm\\node_modules', + 'C:\\Users\\hefangshi\\AppData\\Roaming\\node_modules', + 'C:\\Users\\hefangshi\\AppData\\node_modules', + 'C:\\Users\\hefangshi\\node_modules', + 'C:\\Users\\node_modules', + 'C:\\node_modules', + ] + }, { + file: 'C:\\Users\\Rocko Artischocko\\node_stuff\\foo', + expect: [ + 'C:\\Users\\Rocko Artischocko\\node_stuff\\foo\\node_modules', + 'C:\\Users\\Rocko Artischocko\\node_stuff\\node_modules', + 'C:\\Users\\Rocko Artischocko\\node_modules', + 'C:\\Users\\node_modules', + 'C:\\node_modules', + ] + }, { + file: 'C:\\Users\\Rocko Artischocko\\node_stuff\\foo_node_modules', + expect: [ + 'C:\\Users\\Rocko \ +Artischocko\\node_stuff\\foo_node_modules\\node_modules', + 'C:\\Users\\Rocko Artischocko\\node_stuff\\node_modules', + 'C:\\Users\\Rocko Artischocko\\node_modules', + 'C:\\Users\\node_modules', + 'C:\\node_modules', + ] + }, { + file: 'C:\\node_modules', + expect: [ + 'C:\\node_modules', + ] + }, { + file: 'C:\\', + expect: [ + 'C:\\node_modules', + ] + }], + 'POSIX': [{ + file: '/usr/lib/node_modules/npm/node_modules/\ +node-gyp/node_modules/glob/node_modules/minimatch', + expect: [ + '/usr/lib/node_modules/npm/node_modules/\ +node-gyp/node_modules/glob/node_modules/minimatch/node_modules', + '/usr/lib/node_modules/npm/node_modules/\ +node-gyp/node_modules/glob/node_modules', + '/usr/lib/node_modules/npm/node_modules/node-gyp/node_modules', + '/usr/lib/node_modules/npm/node_modules', + '/usr/lib/node_modules', + '/usr/node_modules', + '/node_modules', + ] + }, { + file: '/usr/test/lib/node_modules/npm/foo', + expect: [ + '/usr/test/lib/node_modules/npm/foo/node_modules', + '/usr/test/lib/node_modules/npm/node_modules', + '/usr/test/lib/node_modules', + '/usr/test/node_modules', + '/usr/node_modules', + '/node_modules', + ] + }, { + file: '/usr/test/lib/node_modules/npm/foo_node_modules', + expect: [ + '/usr/test/lib/node_modules/npm/foo_node_modules/node_modules', + '/usr/test/lib/node_modules/npm/node_modules', + '/usr/test/lib/node_modules', + '/usr/test/node_modules', + '/usr/node_modules', + '/node_modules', + ] + }, { + file: '/node_modules', + expect: [ + '/node_modules', + ] + }, { + file: '/', + expect: [ + '/node_modules', + ] + }] +}; + +const platformCases = common.isWindows ? cases.WIN : cases.POSIX; +platformCases.forEach((c) => { + const paths = _module._nodeModulePaths(c.file); + assert.deepStrictEqual( + c.expect, paths, + `case ${c.file} failed, actual paths is ${JSON.stringify(paths)}`); +}); diff --git a/tests/node_compat/test/parallel/test-module-readonly.js b/tests/node_compat/test/parallel/test-module-readonly.js new file mode 100644 index 0000000000..f231f8f940 --- /dev/null +++ b/tests/node_compat/test/parallel/test-module-readonly.js @@ -0,0 +1,55 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +if (!common.isWindows) { + // TODO: Similar checks on *nix-like systems (e.g using chmod or the like) + common.skip('test only runs on Windows'); +} + +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); +const cp = require('child_process'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +// Create readOnlyMod.js and set to read only +const readOnlyMod = tmpdir.resolve('readOnlyMod'); +const readOnlyModRelative = path.relative(__dirname, readOnlyMod); +const readOnlyModFullPath = `${readOnlyMod}.js`; + +fs.writeFileSync(readOnlyModFullPath, 'module.exports = 42;'); + +// Removed any inherited ACEs, and any explicitly granted ACEs for the +// current user +cp.execSync( + `icacls.exe "${readOnlyModFullPath}" /inheritance:r /remove "%USERNAME%"`); + +// Grant the current user read & execute only +cp.execSync(`icacls.exe "${readOnlyModFullPath}" /grant "%USERNAME%":RX`); + +let except = null; +try { + // Attempt to load the module. Will fail if write access is required + require(readOnlyModRelative); +} catch (err) { + except = err; +} + +// Remove the explicitly granted rights, and re-enable inheritance +cp.execSync( + `icacls.exe "${readOnlyModFullPath}" /remove "%USERNAME%" /inheritance:e`); + +// Delete the test module (note: tmpdir should get cleaned anyway) +fs.unlinkSync(readOnlyModFullPath); + +assert.ifError(except); diff --git a/tests/node_compat/test/parallel/test-module-relative-lookup.js b/tests/node_compat/test/parallel/test-module-relative-lookup.js new file mode 100644 index 0000000000..4e714f070f --- /dev/null +++ b/tests/node_compat/test/parallel/test-module-relative-lookup.js @@ -0,0 +1,31 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const _module = require('module'); // Avoid collision with global.module + +// Current directory gets highest priority for local modules +function testFirstInPath(moduleName, isLocalModule) { + const assertFunction = isLocalModule ? + assert.strictEqual : + assert.notStrictEqual; + + let paths = _module._resolveLookupPaths(moduleName); + + assertFunction(paths[0], '.'); + + paths = _module._resolveLookupPaths(moduleName, null); + assertFunction(paths && paths[0], '.'); +} + +testFirstInPath('./lodash', true); + +// Relative path on Windows, but a regular file name elsewhere +testFirstInPath('.\\lodash', common.isWindows); diff --git a/tests/node_compat/test/parallel/test-net-after-close.js b/tests/node_compat/test/parallel/test-net-after-close.js new file mode 100644 index 0000000000..2f4428c6ca --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-after-close.js @@ -0,0 +1,58 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +const server = net.createServer(common.mustCall((s) => { + console.error('SERVER: got connection'); + s.end(); +})); + +server.listen(0, common.mustCall(() => { + const c = net.createConnection(server.address().port); + c.on('close', common.mustCall(() => { + /* eslint-disable no-unused-expressions */ + console.error('connection closed'); + assert.strictEqual(c._handle, null); + // Calling functions / accessing properties of a closed socket should not + // throw. + c.setNoDelay(); + c.setKeepAlive(); + c.bufferSize; + c.pause(); + c.resume(); + c.address(); + c.remoteAddress; + c.remotePort; + server.close(); + /* eslint-enable no-unused-expressions */ + })); +})); diff --git a/tests/node_compat/test/parallel/test-net-better-error-messages-listen.js b/tests/node_compat/test/parallel/test-net-better-error-messages-listen.js new file mode 100644 index 0000000000..f3ddc597ab --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-better-error-messages-listen.js @@ -0,0 +1,19 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +const server = net.createServer(common.mustNotCall()); +server.listen(1, '1.1.1.1', common.mustNotCall()); +server.on('error', common.mustCall(function(e) { + assert.strictEqual(e.address, '1.1.1.1'); + assert.strictEqual(e.port, 1); + assert.strictEqual(e.syscall, 'listen'); +})); diff --git a/tests/node_compat/test/parallel/test-net-bind-twice.js b/tests/node_compat/test/parallel/test-net-bind-twice.js new file mode 100644 index 0000000000..1794c9a54f --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-bind-twice.js @@ -0,0 +1,43 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +const server1 = net.createServer(common.mustNotCall()); +server1.listen(0, '127.0.0.1', common.mustCall(function() { + const server2 = net.createServer(common.mustNotCall()); + server2.listen(this.address().port, '127.0.0.1', common.mustNotCall()); + + server2.on('error', common.mustCall(function(e) { + assert.strictEqual(e.code, 'EADDRINUSE'); + server1.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-net-buffersize.js b/tests/node_compat/test/parallel/test-net-buffersize.js new file mode 100644 index 0000000000..71560688c2 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-buffersize.js @@ -0,0 +1,59 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +const iter = 10; + +const server = net.createServer(function(socket) { + socket.on('readable', function() { + socket.read(); + }); + + socket.on('end', function() { + server.close(); + }); +}); + +server.listen(0, common.mustCall(function() { + const client = net.connect(this.address().port); + + client.on('finish', common.mustCall(() => { + assert.strictEqual(client.bufferSize, 0); + })); + + for (let i = 1; i < iter; i++) { + client.write('a'); + assert.strictEqual(client.bufferSize, i); + } + + client.end(); +})); diff --git a/tests/node_compat/test/parallel/test-net-bytes-written-large.js b/tests/node_compat/test/parallel/test-net-bytes-written-large.js new file mode 100644 index 0000000000..0eae9f10d3 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-bytes-written-large.js @@ -0,0 +1,74 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +// Regression test for https://github.com/nodejs/node/issues/19562: +// Writing to a socket first tries to push through as much data as possible +// without blocking synchronously, and, if that is not enough, queues more +// data up for asynchronous writing. +// Check that `bytesWritten` accounts for both parts of a write. + +const N = 10000000; +{ + // Variant 1: Write a Buffer. + const server = net.createServer(common.mustCall((socket) => { + socket.end(Buffer.alloc(N), common.mustCall(() => { + assert.strictEqual(socket.bytesWritten, N); + })); + assert.strictEqual(socket.bytesWritten, N); + })).listen(0, common.mustCall(() => { + const client = net.connect(server.address().port); + client.resume(); + client.on('close', common.mustCall(() => { + assert.strictEqual(client.bytesRead, N); + server.close(); + })); + })); +} + +{ + // Variant 2: Write a string. + const server = net.createServer(common.mustCall((socket) => { + socket.end('a'.repeat(N), common.mustCall(() => { + assert.strictEqual(socket.bytesWritten, N); + })); + assert.strictEqual(socket.bytesWritten, N); + })).listen(0, common.mustCall(() => { + const client = net.connect(server.address().port); + client.resume(); + client.on('close', common.mustCall(() => { + assert.strictEqual(client.bytesRead, N); + server.close(); + })); + })); +} + +{ + // Variant 2: writev() with mixed data. + const server = net.createServer(common.mustCall((socket) => { + socket.cork(); + socket.write('a'.repeat(N)); + assert.strictEqual(socket.bytesWritten, N); + socket.write(Buffer.alloc(N)); + assert.strictEqual(socket.bytesWritten, 2 * N); + socket.end('', common.mustCall(() => { + assert.strictEqual(socket.bytesWritten, 2 * N); + })); + socket.uncork(); + })).listen(0, common.mustCall(() => { + const client = net.connect(server.address().port); + client.resume(); + client.on('close', common.mustCall(() => { + assert.strictEqual(client.bytesRead, 2 * N); + server.close(); + })); + })); +} diff --git a/tests/node_compat/test/parallel/test-net-can-reset-timeout.js b/tests/node_compat/test/parallel/test-net-can-reset-timeout.js new file mode 100644 index 0000000000..1abd0a16a5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-can-reset-timeout.js @@ -0,0 +1,64 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); + +// Ref: https://github.com/nodejs/node-v0.x-archive/issues/481 + +const net = require('net'); + +const server = net.createServer(common.mustCall(function(stream) { + stream.setTimeout(100); + + stream.resume(); + + stream.once('timeout', common.mustCall(function() { + console.log('timeout'); + // Try to reset the timeout. + stream.write('WHAT.'); + })); + + stream.on('end', common.mustCall(function() { + console.log('server side end'); + stream.end(); + })); +})); + +server.listen(0, common.mustCall(function() { + const c = net.createConnection(this.address().port); + + c.on('data', function() { + c.end(); + }); + + c.on('end', function() { + console.log('client side end'); + server.close(); + }); +})); diff --git a/tests/node_compat/test/parallel/test-net-connect-call-socket-connect.js b/tests/node_compat/test/parallel/test-net-connect-call-socket-connect.js new file mode 100644 index 0000000000..db0cef479e --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-connect-call-socket-connect.js @@ -0,0 +1,46 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +// This test checks that calling `net.connect` internally calls +// `Socket.prototype.connect`. +// +// This is important for people who monkey-patch `Socket.prototype.connect` +// since it's not possible to monkey-patch `net.connect` directly (as the core +// `connect` function is called internally in Node instead of calling the +// `exports.connect` function). +// +// Monkey-patching of `Socket.prototype.connect` is done by - among others - +// most APM vendors, the async-listener module and the +// continuation-local-storage module. +// +// Related: +// - https://github.com/nodejs/node/pull/12342 +// - https://github.com/nodejs/node/pull/12852 + +const net = require('net'); +const Socket = net.Socket; + +// Monkey patch Socket.prototype.connect to check that it's called. +const orig = Socket.prototype.connect; +Socket.prototype.connect = common.mustCall(function() { + return orig.apply(this, arguments); +}); + +const server = net.createServer(); + +server.listen(common.mustCall(function() { + const port = server.address().port; + const client = net.connect({ port }, common.mustCall(function() { + client.end(); + })); + client.on('end', common.mustCall(function() { + server.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-net-connect-options-fd.js b/tests/node_compat/test/parallel/test-net-connect-options-fd.js new file mode 100644 index 0000000000..f9aa99c12b --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-connect-options-fd.js @@ -0,0 +1,110 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; +const common = require('../common'); +if (common.isWindows) + common.skip('Does not support wrapping sockets with fd on Windows'); + +const assert = require('assert'); +const net = require('net'); +const path = require('path'); +const { internalBinding } = require('internal/test/binding'); +const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +function testClients(getSocketOpt, getConnectOpt, getConnectCb) { + const cloneOptions = (index) => + ({ ...getSocketOpt(index), ...getConnectOpt(index) }); + return [ + net.connect(cloneOptions(0), getConnectCb(0)), + net.connect(cloneOptions(1)) + .on('connect', getConnectCb(1)), + net.createConnection(cloneOptions(2), getConnectCb(2)), + net.createConnection(cloneOptions(3)) + .on('connect', getConnectCb(3)), + new net.Socket(getSocketOpt(4)).connect(getConnectOpt(4), getConnectCb(4)), + new net.Socket(getSocketOpt(5)).connect(getConnectOpt(5)) + .on('connect', getConnectCb(5)), + ]; +} + +const CLIENT_VARIANTS = 6; // Same length as array above +const forAllClients = (cb) => common.mustCall(cb, CLIENT_VARIANTS); + +// Test Pipe fd is wrapped correctly +{ + // Use relative path to avoid hitting 108-char length limit + // for socket paths in libuv. + const prefix = path.relative('.', `${common.PIPE}-net-connect-options-fd`); + const serverPath = `${prefix}-server`; + let counter = 0; + let socketCounter = 0; + const handleMap = new Map(); + const server = net.createServer() + .on('connection', forAllClients(function serverOnConnection(socket) { + let clientFd; + socket.on('data', common.mustCall(function(data) { + clientFd = data.toString(); + console.error(`[Pipe]Received data from fd ${clientFd}`); + socket.end(); + })); + socket.on('end', common.mustCall(function() { + counter++; + console.error(`[Pipe]Received end from fd ${clientFd}, total ${counter}`); + if (counter === CLIENT_VARIANTS) { + setTimeout(() => { + console.error(`[Pipe]Server closed by fd ${clientFd}`); + server.close(); + }, 10); + } + }, 1)); + })) + .on('close', function() { + setTimeout(() => { + for (const pair of handleMap) { + console.error(`[Pipe]Clean up handle with fd ${pair[1].fd}`); + pair[1].close(); // clean up handles + } + }, 10); + }) + .on('error', function(err) { + console.error(err); + assert.fail(`[Pipe server]${err}`); + }) + .listen({ path: serverPath }, common.mustCall(function serverOnListen() { + const getSocketOpt = (index) => { + const handle = new Pipe(PipeConstants.SOCKET); + const err = handle.bind(`${prefix}-client-${socketCounter++}`); + assert(err >= 0, String(err)); + assert.notStrictEqual(handle.fd, -1); + handleMap.set(index, handle); + console.error(`[Pipe]Bound handle with Pipe ${handle.fd}`); + return { fd: handle.fd, readable: true, writable: true }; + }; + const getConnectOpt = () => ({ + path: serverPath + }); + const getConnectCb = (index) => common.mustCall(function clientOnConnect() { + // Test if it's wrapping an existing fd + assert(handleMap.has(index)); + const oldHandle = handleMap.get(index); + assert.strictEqual(oldHandle.fd, this._handle.fd); + this.write(String(oldHandle.fd)); + console.error(`[Pipe]Sending data through fd ${oldHandle.fd}`); + this.on('error', function(err) { + console.error(err); + assert.fail(`[Pipe Client]${err}`); + }); + }); + + testClients(getSocketOpt, getConnectOpt, getConnectCb); + })); +} diff --git a/tests/node_compat/test/parallel/test-net-connect-options-ipv6.js b/tests/node_compat/test/parallel/test-net-connect-options-ipv6.js new file mode 100644 index 0000000000..de309e7be2 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-connect-options-ipv6.js @@ -0,0 +1,74 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// Test that the family option of net.connect is honored. + +'use strict'; +const common = require('../common'); +if (!common.hasIPv6) + common.skip('no IPv6 support'); + +const assert = require('assert'); +const net = require('net'); + +const hostAddrIPv6 = '::1'; +const HOSTNAME = 'dummy'; + +const server = net.createServer({ allowHalfOpen: true }, (socket) => { + socket.resume(); + socket.on('end', common.mustCall()); + socket.end(); +}); + +function tryConnect() { + const connectOpt = { + host: HOSTNAME, + port: server.address().port, + family: 6, + allowHalfOpen: true, + lookup: common.mustCall((addr, opt, cb) => { + assert.strictEqual(addr, HOSTNAME); + assert.strictEqual(opt.family, 6); + cb(null, hostAddrIPv6, opt.family); + }) + }; + // No `mustCall`, since test could skip, and it's the only path to `close`. + const client = net.connect(connectOpt, () => { + client.resume(); + client.on('end', () => { + // Wait for next uv tick and make sure the socket stream is writable. + setTimeout(function() { + assert(client.writable); + client.end(); + }, 10); + }); + client.on('close', () => server.close()); + }); +} + +server.listen(0, hostAddrIPv6, tryConnect); diff --git a/tests/node_compat/test/parallel/test-net-connect-options-port.js b/tests/node_compat/test/parallel/test-net-connect-options-port.js new file mode 100644 index 0000000000..b4f747b3ef --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-connect-options-port.js @@ -0,0 +1,237 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const dns = require('dns'); +const net = require('net'); + +// Test wrong type of ports +{ + const portTypeError = { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError' + }; + + syncFailToConnect(true, portTypeError); + syncFailToConnect(false, portTypeError); + syncFailToConnect([], portTypeError, true); + syncFailToConnect({}, portTypeError, true); + syncFailToConnect(null, portTypeError); +} + +// Test out of range ports +{ + const portRangeError = { + code: 'ERR_SOCKET_BAD_PORT', + name: 'RangeError' + }; + + syncFailToConnect('', portRangeError); + syncFailToConnect(' ', portRangeError); + syncFailToConnect('0x', portRangeError, true); + syncFailToConnect('-0x1', portRangeError, true); + syncFailToConnect(NaN, portRangeError); + syncFailToConnect(Infinity, portRangeError); + syncFailToConnect(-1, portRangeError); + syncFailToConnect(65536, portRangeError); +} + +// Test invalid hints +{ + // connect({hint}, cb) and connect({hint}) + const hints = (dns.ADDRCONFIG | dns.V4MAPPED | dns.ALL) + 42; + const hintOptBlocks = doConnect([{ port: 42, hints }], + () => common.mustNotCall()); + for (const fn of hintOptBlocks) { + assert.throws(fn, { + code: 'ERR_INVALID_ARG_VALUE', + name: 'TypeError', + message: /The argument 'hints' is invalid\. Received \d+/ + }); + } +} + +// Test valid combinations of connect(port) and connect(port, host) +{ + const expectedConnections = 72; + let serverConnected = 0; + + const server = net.createServer(common.mustCall((socket) => { + socket.end('ok'); + if (++serverConnected === expectedConnections) { + server.close(); + } + }, expectedConnections)); + + server.listen(0, common.localhostIPv4, common.mustCall(() => { + const port = server.address().port; + + // Total connections = 3 * 4(canConnect) * 6(doConnect) = 72 + canConnect(port); + canConnect(String(port)); + canConnect(`0x${port.toString(16)}`); + })); + + // Try connecting to random ports, but do so once the server is closed + server.on('close', () => { + asyncFailToConnect(0); + }); +} + +function doConnect(args, getCb) { + return [ + function createConnectionWithCb() { + return net.createConnection.apply(net, args.concat(getCb())) + .resume(); + }, + function createConnectionWithoutCb() { + return net.createConnection.apply(net, args) + .on('connect', getCb()) + .resume(); + }, + function connectWithCb() { + return net.connect.apply(net, args.concat(getCb())) + .resume(); + }, + function connectWithoutCb() { + return net.connect.apply(net, args) + .on('connect', getCb()) + .resume(); + }, + function socketConnectWithCb() { + const socket = new net.Socket(); + return socket.connect.apply(socket, args.concat(getCb())) + .resume(); + }, + function socketConnectWithoutCb() { + const socket = new net.Socket(); + return socket.connect.apply(socket, args) + .on('connect', getCb()) + .resume(); + }, + ]; +} + +function syncFailToConnect(port, assertErr, optOnly) { + const family = 4; + if (!optOnly) { + // connect(port, cb) and connect(port) + const portArgFunctions = doConnect([{ port, family }], + () => common.mustNotCall()); + for (const fn of portArgFunctions) { + assert.throws(fn, assertErr, `${fn.name}(${port})`); + } + + // connect(port, host, cb) and connect(port, host) + const portHostArgFunctions = doConnect([{ port, + host: 'localhost', + family }], + () => common.mustNotCall()); + for (const fn of portHostArgFunctions) { + assert.throws(fn, assertErr, `${fn.name}(${port}, 'localhost')`); + } + } + // connect({port}, cb) and connect({port}) + const portOptFunctions = doConnect([{ port, family }], + () => common.mustNotCall()); + for (const fn of portOptFunctions) { + assert.throws(fn, assertErr, `${fn.name}({port: ${port}})`); + } + + // connect({port, host}, cb) and connect({port, host}) + const portHostOptFunctions = doConnect([{ port: port, + host: 'localhost', + family: family }], + () => common.mustNotCall()); + for (const fn of portHostOptFunctions) { + assert.throws(fn, + assertErr, + `${fn.name}({port: ${port}, host: 'localhost'})`); + } +} + +function canConnect(port) { + const noop = () => common.mustCall(); + const family = 4; + + // connect(port, cb) and connect(port) + const portArgFunctions = doConnect([{ port, family }], noop); + for (const fn of portArgFunctions) { + fn(); + } + + // connect(port, host, cb) and connect(port, host) + const portHostArgFunctions = doConnect([{ port, host: 'localhost', family }], + noop); + for (const fn of portHostArgFunctions) { + fn(); + } + + // connect({port}, cb) and connect({port}) + const portOptFunctions = doConnect([{ port, family }], noop); + for (const fn of portOptFunctions) { + fn(); + } + + // connect({port, host}, cb) and connect({port, host}) + const portHostOptFns = doConnect([{ port, host: 'localhost', family }], + noop); + for (const fn of portHostOptFns) { + fn(); + } +} + +function asyncFailToConnect(port) { + const onError = () => common.mustCall((err) => { + const regexp = /^Error: connect E\w+.+$/; + assert.match(String(err), regexp); + }); + + const dont = () => common.mustNotCall(); + const family = 4; + // connect(port, cb) and connect(port) + const portArgFunctions = doConnect([{ port, family }], dont); + for (const fn of portArgFunctions) { + fn().on('error', onError()); + } + + // connect({port}, cb) and connect({port}) + const portOptFunctions = doConnect([{ port, family }], dont); + for (const fn of portOptFunctions) { + fn().on('error', onError()); + } + + // connect({port, host}, cb) and connect({port, host}) + const portHostOptFns = doConnect([{ port, host: 'localhost', family }], + dont); + for (const fn of portHostOptFns) { + fn().on('error', onError()); + } +} diff --git a/tests/node_compat/test/parallel/test-net-connect-paused-connection.js b/tests/node_compat/test/parallel/test-net-connect-paused-connection.js new file mode 100644 index 0000000000..81c28aaa89 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-connect-paused-connection.js @@ -0,0 +1,40 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); + +const net = require('net'); + +net.createServer(function(conn) { + conn.unref(); +}).listen(0, common.mustCall(function() { + net.connect(this.address().port, 'localhost').pause(); + + setTimeout(common.mustNotCall('expected to exit'), 1000).unref(); +})).unref(); diff --git a/tests/node_compat/test/parallel/test-net-dns-custom-lookup.js b/tests/node_compat/test/parallel/test-net-dns-custom-lookup.js new file mode 100644 index 0000000000..124a1f804b --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-dns-custom-lookup.js @@ -0,0 +1,74 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +function check(addressType, cb) { + const server = net.createServer(function(client) { + client.end(); + server.close(); + cb && cb(); + }); + + const address = addressType === 4 ? common.localhostIPv4 : '::1'; + server.listen(0, address, common.mustCall(function() { + net.connect({ + port: this.address().port, + host: 'localhost', + family: addressType, + lookup: lookup + }).on('lookup', common.mustCall(function(err, ip, type) { + assert.strictEqual(err, null); + assert.strictEqual(address, ip); + assert.strictEqual(type, addressType); + })); + })); + + function lookup(host, dnsopts, cb) { + dnsopts.family = addressType; + + if (addressType === 4) { + process.nextTick(function() { + if (dnsopts.all) { + cb(null, [{ address: common.localhostIPv4, family: 4 }]); + } else { + cb(null, common.localhostIPv4, 4); + } + }); + } else { + process.nextTick(function() { + if (dnsopts.all) { + cb(null, [{ address: '::1', family: 6 }]); + } else { + cb(null, '::1', 6); + } + }); + } + } +} + +check(4, function() { + common.hasIPv6 && check(6); +}); + +// Verify that bad lookup() IPs are handled. +{ + net.connect({ + host: 'localhost', + port: 80, + lookup(host, dnsopts, cb) { + if (dnsopts.all) { + cb(null, [{ address: undefined, family: 4 }]); + } else { + cb(null, undefined, 4); + } + } + }).on('error', common.expectsError({ code: 'ERR_INVALID_IP_ADDRESS' })); +} diff --git a/tests/node_compat/test/parallel/test-net-dns-lookup-skip.js b/tests/node_compat/test/parallel/test-net-dns-lookup-skip.js new file mode 100644 index 0000000000..5010f73e66 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-dns-lookup-skip.js @@ -0,0 +1,26 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const net = require('net'); + +function check(addressType) { + const server = net.createServer(function(client) { + client.end(); + server.close(); + }); + + const address = addressType === 4 ? '127.0.0.1' : '::1'; + server.listen(0, address, function() { + net.connect(this.address().port, address) + .on('lookup', common.mustNotCall()); + }); +} + +check(4); +common.hasIPv6 && check(6); diff --git a/tests/node_compat/test/parallel/test-net-dns-lookup.js b/tests/node_compat/test/parallel/test-net-dns-lookup.js new file mode 100644 index 0000000000..69278d4fbd --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-dns-lookup.js @@ -0,0 +1,47 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +const server = net.createServer(function(client) { + client.end(); + server.close(); +}); + +server.listen(0, common.mustCall(function() { + net.connect(this.address().port, 'localhost') + .on('lookup', common.mustCallAtLeast(function(err, ip, type, host) { + assert.strictEqual(err, null); + assert.match(ip, /^(127\.0\.0\.1|::1)$/); + assert.match(type.toString(), /^(4|6)$/); + assert.strictEqual(host, 'localhost'); + }, 1)); +})); diff --git a/tests/node_compat/test/parallel/test-net-eaddrinuse.js b/tests/node_compat/test/parallel/test-net-eaddrinuse.js new file mode 100644 index 0000000000..12069e3cb1 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-eaddrinuse.js @@ -0,0 +1,44 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +const server1 = net.createServer(function(socket) { +}); +const server2 = net.createServer(function(socket) { +}); +server1.listen(0, common.mustCall(function() { + server2.on('error', function(error) { + assert.strictEqual(error.message.includes('EADDRINUSE'), true); + server1.close(); + }); + server2.listen(this.address().port); +})); diff --git a/tests/node_compat/test/parallel/test-net-error-twice.js b/tests/node_compat/test/parallel/test-net-error-twice.js new file mode 100644 index 0000000000..950847cb2e --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-error-twice.js @@ -0,0 +1,70 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const net = require('net'); + +const buf = Buffer.alloc(10 * 1024 * 1024, 0x62); + +const errs = []; +let clientSocket; +let serverSocket; + +function ready() { + if (clientSocket && serverSocket) { + clientSocket.destroy(); + serverSocket.write(buf); + } +} + +const server = net.createServer(function onConnection(conn) { + conn.on('error', function(err) { + errs.push(err); + if (errs.length > 1 && errs[0] === errs[1]) + assert.fail('Should not emit the same error twice'); + }); + conn.on('close', function() { + server.unref(); + }); + serverSocket = conn; + ready(); +}).listen(0, function() { + const client = net.connect({ port: this.address().port }); + + client.on('connect', function() { + clientSocket = client; + ready(); + }); +}); + +process.on('exit', function() { + console.log(errs); + assert.strictEqual(errs.length, 1); +}); diff --git a/tests/node_compat/test/parallel/test-net-keepalive.js b/tests/node_compat/test/parallel/test-net-keepalive.js new file mode 100644 index 0000000000..4f01b46751 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-keepalive.js @@ -0,0 +1,59 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +let serverConnection; +let clientConnection; +const echoServer = net.createServer(function(connection) { + serverConnection = connection; + setTimeout(common.mustCall(function() { + // Make sure both connections are still open + assert.strictEqual(serverConnection.readyState, 'open'); + assert.strictEqual(clientConnection.readyState, 'open'); + serverConnection.end(); + clientConnection.end(); + echoServer.close(); + }, 1), common.platformTimeout(100)); + connection.setTimeout(0); + assert.notStrictEqual(connection.setKeepAlive, undefined); + // Send a keepalive packet after 50 ms + connection.setKeepAlive(true, common.platformTimeout(50)); + connection.on('end', function() { + connection.end(); + }); +}); +echoServer.listen(0); + +echoServer.on('listening', function() { + clientConnection = net.createConnection(this.address().port); + clientConnection.setTimeout(0); +}); diff --git a/tests/node_compat/test/parallel/test-net-listen-after-destroying-stdin.js b/tests/node_compat/test/parallel/test-net-listen-after-destroying-stdin.js new file mode 100644 index 0000000000..7dbc610f95 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-listen-after-destroying-stdin.js @@ -0,0 +1,29 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +// Just test that destroying stdin doesn't mess up listening on a server. +// This is a regression test for +// https://github.com/nodejs/node-v0.x-archive/issues/746. + +const common = require('../common'); +const net = require('net'); + +process.stdin.destroy(); + +const server = net.createServer(common.mustCall((socket) => { + console.log('accepted...'); + socket.end(common.mustCall(() => { console.log('finished...'); })); + server.close(common.mustCall(() => { console.log('closed'); })); +})); + + +server.listen(0, common.mustCall(() => { + console.log('listening...'); + + net.createConnection(server.address().port); +})); diff --git a/tests/node_compat/test/parallel/test-net-listen-error.js b/tests/node_compat/test/parallel/test-net-listen-error.js new file mode 100644 index 0000000000..e8a7b2a931 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-listen-error.js @@ -0,0 +1,36 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const net = require('net'); + +const server = net.createServer(function(socket) { +}); +server.listen(1, '1.1.1.1', common.mustNotCall()); // EACCES or EADDRNOTAVAIL +server.on('error', common.mustCall()); diff --git a/tests/node_compat/test/parallel/test-net-local-address-port.js b/tests/node_compat/test/parallel/test-net-local-address-port.js new file mode 100644 index 0000000000..9b18f89ee5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-local-address-port.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +const server = net.createServer(common.mustCall(function(socket) { + assert.strictEqual(socket.localAddress, common.localhostIPv4); + assert.strictEqual(socket.localPort, this.address().port); + assert.strictEqual(socket.localFamily, this.address().family); + socket.on('end', function() { + server.close(); + }); + socket.resume(); +})); + +server.listen(0, common.localhostIPv4, function() { + const client = net.createConnection(this.address() + .port, common.localhostIPv4); + client.on('connect', function() { + client.end(); + }); +}); diff --git a/tests/node_compat/test/parallel/test-net-pause-resume-connecting.js b/tests/node_compat/test/parallel/test-net-pause-resume-connecting.js new file mode 100644 index 0000000000..774ad66742 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-pause-resume-connecting.js @@ -0,0 +1,102 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +let connections = 0; +let dataEvents = 0; +let conn; + + +// Server +const server = net.createServer(function(conn) { + connections++; + conn.end('This was the year he fell to pieces.'); + + if (connections === 5) + server.close(); +}); + +server.listen(0, function() { + // Client 1 + conn = net.createConnection(this.address().port, 'localhost'); + conn.resume(); + conn.on('data', onDataOk); + + + // Client 2 + conn = net.createConnection(this.address().port, 'localhost'); + conn.pause(); + conn.resume(); + conn.on('data', onDataOk); + + + // Client 3 + conn = net.createConnection(this.address().port, 'localhost'); + conn.pause(); + conn.on('data', common.mustNotCall()); + scheduleTearDown(conn); + + + // Client 4 + conn = net.createConnection(this.address().port, 'localhost'); + conn.resume(); + conn.pause(); + conn.resume(); + conn.on('data', onDataOk); + + + // Client 5 + conn = net.createConnection(this.address().port, 'localhost'); + conn.resume(); + conn.resume(); + conn.pause(); + conn.on('data', common.mustNotCall()); + scheduleTearDown(conn); + + function onDataOk() { + dataEvents++; + } + + function scheduleTearDown(conn) { + setTimeout(function() { + conn.removeAllListeners('data'); + conn.resume(); + }, 100); + } +}); + + +// Exit sanity checks +process.on('exit', function() { + assert.strictEqual(connections, 5); + assert.strictEqual(dataEvents, 3); +}); diff --git a/tests/node_compat/test/parallel/test-net-persistent-keepalive.js b/tests/node_compat/test/parallel/test-net-persistent-keepalive.js new file mode 100644 index 0000000000..80ab2a08db --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-persistent-keepalive.js @@ -0,0 +1,41 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const net = require('net'); + +let serverConnection; +let clientConnection; +const echoServer = net.createServer(function(connection) { + serverConnection = connection; + setTimeout(function() { + // Make sure both connections are still open + assert.strictEqual(serverConnection.readyState, 'open'); + assert.strictEqual(clientConnection.readyState, 'open'); + serverConnection.end(); + clientConnection.end(); + echoServer.close(); + }, 600); + connection.setTimeout(0); + assert.strictEqual(typeof connection.setKeepAlive, 'function'); + connection.on('end', function() { + connection.end(); + }); +}); +echoServer.listen(0); + +echoServer.on('listening', function() { + clientConnection = new net.Socket(); + // Send a keepalive packet after 1000 ms + // and make sure it persists + const s = clientConnection.setKeepAlive(true, 400); + assert.ok(s instanceof net.Socket); + clientConnection.connect(this.address().port); + clientConnection.setTimeout(0); +}); diff --git a/tests/node_compat/test/parallel/test-net-persistent-nodelay.js b/tests/node_compat/test/parallel/test-net-persistent-nodelay.js new file mode 100644 index 0000000000..c8733e3138 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-persistent-nodelay.js @@ -0,0 +1,43 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; +require('../common'); +const assert = require('assert'); +const net = require('net'); +const { internalBinding } = require('internal/test/binding'); +const TCPWrap = internalBinding('tcp_wrap').TCP; + +const echoServer = net.createServer(function(connection) { + connection.end(); +}); +echoServer.listen(0); + +let callCount = 0; + +const Socket = net.Socket; +const setNoDelay = TCPWrap.prototype.setNoDelay; + +TCPWrap.prototype.setNoDelay = function(enable) { + setNoDelay.call(this, enable); + callCount++; +}; + +echoServer.on('listening', function() { + const sock1 = new Socket(); + // setNoDelay before the handle is created + // there is probably a better way to test this + + const s = sock1.setNoDelay(); + assert.ok(s instanceof net.Socket); + sock1.connect(this.address().port); + sock1.on('end', function() { + assert.strictEqual(callCount, 1); + echoServer.close(); + }); +}); diff --git a/tests/node_compat/test/parallel/test-net-persistent-ref-unref.js b/tests/node_compat/test/parallel/test-net-persistent-ref-unref.js new file mode 100644 index 0000000000..565f1211b1 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-persistent-ref-unref.js @@ -0,0 +1,48 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; +require('../common'); +const assert = require('assert'); +const net = require('net'); +const { internalBinding } = require('internal/test/binding'); +const TCPWrap = internalBinding('tcp_wrap').TCP; + +const echoServer = net.createServer((conn) => { + conn.end(); +}); + +const ref = TCPWrap.prototype.ref; +const unref = TCPWrap.prototype.unref; + +let refCount = 0; + +TCPWrap.prototype.ref = function() { + ref.call(this); + refCount++; + assert.strictEqual(refCount, 0); +}; + +TCPWrap.prototype.unref = function() { + unref.call(this); + refCount--; + assert.strictEqual(refCount, -1); +}; + +echoServer.listen(0); + +echoServer.on('listening', function() { + const sock = new net.Socket(); + sock.unref(); + sock.ref(); + sock.connect(this.address().port); + sock.on('end', () => { + assert.strictEqual(refCount, 0); + echoServer.close(); + }); +}); diff --git a/tests/node_compat/test/parallel/test-net-reconnect.js b/tests/node_compat/test/parallel/test-net-reconnect.js new file mode 100644 index 0000000000..65a8718e9e --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-reconnect.js @@ -0,0 +1,95 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); + +const net = require('net'); + +const N = 50; +let client_recv_count = 0; +let client_end_count = 0; +let disconnect_count = 0; + +const server = net.createServer(function(socket) { + console.error('SERVER: got socket connection'); + socket.resume(); + + console.error('SERVER connect, writing'); + socket.write('hello\r\n'); + + socket.on('end', () => { + console.error('SERVER socket end, calling end()'); + socket.end(); + }); + + socket.on('close', (had_error) => { + console.log(`SERVER had_error: ${JSON.stringify(had_error)}`); + assert.strictEqual(had_error, false); + }); +}); + +server.listen(0, function() { + console.log('SERVER listening'); + const client = net.createConnection(this.address().port); + + client.setEncoding('UTF8'); + + client.on('connect', () => { + console.error('CLIENT connected', client._writableState); + }); + + client.on('data', function(chunk) { + client_recv_count += 1; + console.log(`client_recv_count ${client_recv_count}`); + assert.strictEqual(chunk, 'hello\r\n'); + console.error('CLIENT: calling end', client._writableState); + client.end(); + }); + + client.on('end', () => { + console.error('CLIENT end'); + client_end_count++; + }); + + client.on('close', (had_error) => { + console.log('CLIENT disconnect'); + assert.strictEqual(had_error, false); + if (disconnect_count++ < N) + client.connect(server.address().port); // reconnect + else + server.close(); + }); +}); + +process.on('exit', () => { + assert.strictEqual(disconnect_count, N + 1); + assert.strictEqual(client_recv_count, N + 1); + assert.strictEqual(client_end_count, N + 1); +}); diff --git a/tests/node_compat/test/parallel/test-net-remote-address-port.js b/tests/node_compat/test/parallel/test-net-remote-address-port.js new file mode 100644 index 0000000000..ff1d209bea --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-remote-address-port.js @@ -0,0 +1,91 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +const net = require('net'); + +let conns_closed = 0; + +const remoteAddrCandidates = [ common.localhostIPv4, + '::1', + '::ffff:127.0.0.1' ]; + +const remoteFamilyCandidates = ['IPv4', 'IPv6']; + +const server = net.createServer(common.mustCall(function(socket) { + assert.ok(remoteAddrCandidates.includes(socket.remoteAddress), + `Invalid remoteAddress: ${socket.remoteAddress}`); + assert.ok(remoteFamilyCandidates.includes(socket.remoteFamily), + `Invalid remoteFamily: ${socket.remoteFamily}`); + assert.ok(socket.remotePort); + assert.notStrictEqual(socket.remotePort, this.address().port); + socket.on('end', function() { + if (++conns_closed === 2) server.close(); + }); + socket.on('close', function() { + assert.ok(remoteAddrCandidates.includes(socket.remoteAddress)); + assert.ok(remoteFamilyCandidates.includes(socket.remoteFamily)); + }); + socket.resume(); +}, 2)); + +server.listen(0, function() { + const client = net.createConnection(this.address().port, '127.0.0.1'); + const client2 = net.createConnection(this.address().port); + + assert.strictEqual(client.remoteAddress, undefined); + assert.strictEqual(client.remoteFamily, undefined); + assert.strictEqual(client.remotePort, undefined); + assert.strictEqual(client2.remoteAddress, undefined); + assert.strictEqual(client2.remoteFamily, undefined); + assert.strictEqual(client2.remotePort, undefined); + + client.on('connect', function() { + assert.ok(remoteAddrCandidates.includes(client.remoteAddress)); + assert.ok(remoteFamilyCandidates.includes(client.remoteFamily)); + assert.strictEqual(client.remotePort, server.address().port); + client.end(); + }); + client.on('close', function() { + assert.ok(remoteAddrCandidates.includes(client.remoteAddress)); + assert.ok(remoteFamilyCandidates.includes(client.remoteFamily)); + }); + client2.on('connect', function() { + assert.ok(remoteAddrCandidates.includes(client2.remoteAddress)); + assert.ok(remoteFamilyCandidates.includes(client2.remoteFamily)); + assert.strictEqual(client2.remotePort, server.address().port); + client2.end(); + }); + client2.on('close', function() { + assert.ok(remoteAddrCandidates.includes(client2.remoteAddress)); + assert.ok(remoteFamilyCandidates.includes(client2.remoteFamily)); + }); +}); diff --git a/tests/node_compat/test/parallel/test-net-remote-address.js b/tests/node_compat/test/parallel/test-net-remote-address.js new file mode 100644 index 0000000000..a157352674 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-remote-address.js @@ -0,0 +1,30 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const net = require('net'); +const { strictEqual } = require('assert'); + +const server = net.createServer(); + +server.listen(common.mustCall(function() { + const socket = net.connect({ port: server.address().port }); + + strictEqual(socket.connecting, true); + strictEqual(socket.remoteAddress, undefined); + + socket.on('connect', common.mustCall(function() { + strictEqual(socket.remoteAddress !== undefined, true); + socket.end(); + })); + + socket.on('end', common.mustCall(function() { + server.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-net-server-capture-rejection.js b/tests/node_compat/test/parallel/test-net-server-capture-rejection.js new file mode 100644 index 0000000000..21289d571d --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-server-capture-rejection.js @@ -0,0 +1,34 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const events = require('events'); +const { createServer, connect } = require('net'); + +events.captureRejections = true; + +const server = createServer(common.mustCall(async (sock) => { + server.close(); + + const _err = new Error('kaboom'); + sock.on('error', common.mustCall((err) => { + assert.strictEqual(err, _err); + })); + throw _err; +})); + +server.listen(0, common.mustCall(() => { + const sock = connect( + server.address().port, + server.address().host + ); + + sock.on('close', common.mustCall()); +})); diff --git a/tests/node_compat/test/parallel/test-net-server-close.js b/tests/node_compat/test/parallel/test-net-server-close.js new file mode 100644 index 0000000000..417bc11d86 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-server-close.js @@ -0,0 +1,52 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +const sockets = []; + +const server = net.createServer(function(c) { + c.on('close', common.mustCall()); + + sockets.push(c); + + if (sockets.length === 2) { + assert.strictEqual(server.close(), server); + sockets.forEach((c) => c.destroy()); + } +}); + +server.on('close', common.mustCall()); + +assert.strictEqual(server, server.listen(0, () => { + net.createConnection(server.address().port); + net.createConnection(server.address().port); +})); diff --git a/tests/node_compat/test/parallel/test-net-server-pause-on-connect.js b/tests/node_compat/test/parallel/test-net-server-pause-on-connect.js new file mode 100644 index 0000000000..eb2b94d51c --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-server-pause-on-connect.js @@ -0,0 +1,79 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); +const msg = 'test'; +let stopped = true; +let server1Sock; + + +const server1ConnHandler = (socket) => { + socket.on('data', function(data) { + if (stopped) { + assert.fail('data event should not have happened yet'); + } + + assert.strictEqual(data.toString(), msg); + socket.end(); + server1.close(); + }); + + server1Sock = socket; +}; + +const server1 = net.createServer({ pauseOnConnect: true }, server1ConnHandler); + +const server2ConnHandler = (socket) => { + socket.on('data', function(data) { + assert.strictEqual(data.toString(), msg); + socket.end(); + server2.close(); + + assert.strictEqual(server1Sock.bytesRead, 0); + server1Sock.resume(); + stopped = false; + }); +}; + +const server2 = net.createServer({ pauseOnConnect: false }, server2ConnHandler); + +server1.listen(0, function() { + const clientHandler = common.mustCall(function() { + server2.listen(0, function() { + net.createConnection({ port: this.address().port }).write(msg); + }); + }); + net.createConnection({ port: this.address().port }).write(msg, clientHandler); +}); + +process.on('exit', function() { + assert.strictEqual(stopped, false); +}); diff --git a/tests/node_compat/test/parallel/test-net-settimeout.js b/tests/node_compat/test/parallel/test-net-settimeout.js new file mode 100644 index 0000000000..a1905b7f19 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-settimeout.js @@ -0,0 +1,57 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +// This example sets a timeout then immediately attempts to disable the timeout +// https://github.com/joyent/node/pull/2245 + +const common = require('../common'); +const net = require('net'); +const assert = require('assert'); + +const T = 100; + +const server = net.createServer(common.mustCall((c) => { + c.write('hello'); +})); + +server.listen(0, function() { + const socket = net.createConnection(this.address().port, 'localhost'); + + const s = socket.setTimeout(T, common.mustNotCall()); + assert.ok(s instanceof net.Socket); + + socket.on('data', common.mustCall(() => { + setTimeout(function() { + socket.destroy(); + server.close(); + }, T * 2); + })); + + socket.setTimeout(0); +}); diff --git a/tests/node_compat/test/parallel/test-net-socket-close-after-end.js b/tests/node_compat/test/parallel/test-net-socket-close-after-end.js new file mode 100644 index 0000000000..27540e8fe6 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-socket-close-after-end.js @@ -0,0 +1,38 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +const assert = require('assert'); +const net = require('net'); + +const server = net.createServer(); + +server.on('connection', (socket) => { + let endEmitted = false; + + socket.once('readable', () => { + setTimeout(() => { + socket.read(); + }, common.platformTimeout(100)); + }); + socket.on('end', () => { + endEmitted = true; + }); + socket.on('close', () => { + assert(endEmitted); + server.close(); + }); + socket.end('foo'); +}); + +server.listen(common.mustCall(() => { + const socket = net.createConnection(server.address().port, () => { + socket.end('foo'); + }); +})); diff --git a/tests/node_compat/test/parallel/test-net-socket-connect-invalid-autoselectfamily.js b/tests/node_compat/test/parallel/test-net-socket-connect-invalid-autoselectfamily.js new file mode 100644 index 0000000000..110aadf7dd --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-socket-connect-invalid-autoselectfamily.js @@ -0,0 +1,16 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const assert = require('assert'); +const net = require('net'); + +assert.throws(() => { + net.connect({ port: 8080, autoSelectFamily: 'INVALID' }); +}, { code: 'ERR_INVALID_ARG_TYPE' }); diff --git a/tests/node_compat/test/parallel/test-net-socket-connect-without-cb.js b/tests/node_compat/test/parallel/test-net-socket-connect-without-cb.js new file mode 100644 index 0000000000..20c493e2a9 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-socket-connect-without-cb.js @@ -0,0 +1,33 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +// This test ensures that socket.connect can be called without callback +// which is optional. + +const net = require('net'); + +const server = net.createServer(common.mustCall(function(conn) { + conn.end(); + server.close(); +})).listen(0, common.mustCall(function() { + const client = new net.Socket(); + + client.on('connect', common.mustCall(function() { + client.end(); + })); + + const address = server.address(); + if (!common.hasIPv6 && address.family === 'IPv6') { + // Necessary to pass CI running inside containers. + client.connect(address.port); + } else { + client.connect(address); + } +})); diff --git a/tests/node_compat/test/parallel/test-net-socket-connecting.js b/tests/node_compat/test/parallel/test-net-socket-connecting.js new file mode 100644 index 0000000000..f5101e81d8 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-socket-connecting.js @@ -0,0 +1,28 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const net = require('net'); + +const server = net.createServer((conn) => { + conn.end(); + server.close(); +}).listen(0, () => { + const client = net.connect(server.address().port, () => { + assert.strictEqual(client.connecting, false); + + // Legacy getter + assert.strictEqual(client._connecting, false); + client.end(); + }); + assert.strictEqual(client.connecting, true); + + // Legacy getter + assert.strictEqual(client._connecting, true); +}); diff --git a/tests/node_compat/test/parallel/test-net-socket-destroy-send.js b/tests/node_compat/test/parallel/test-net-socket-destroy-send.js new file mode 100644 index 0000000000..b76bca875d --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-socket-destroy-send.js @@ -0,0 +1,31 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const net = require('net'); +const assert = require('assert'); + +const server = net.createServer(); +server.listen(0, common.mustCall(function() { + const port = server.address().port; + const conn = net.createConnection(port); + + conn.on('connect', common.mustCall(function() { + // Test destroy returns this, even on multiple calls when it short-circuits. + assert.strictEqual(conn, conn.destroy().destroy()); + conn.on('error', common.mustNotCall()); + + conn.write(Buffer.from('kaboom'), common.expectsError({ + code: 'ERR_STREAM_DESTROYED', + message: 'Cannot call write after a stream was destroyed', + name: 'Error' + })); + server.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-net-socket-end-before-connect.js b/tests/node_compat/test/parallel/test-net-socket-end-before-connect.js new file mode 100644 index 0000000000..afe9664ccd --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-socket-end-before-connect.js @@ -0,0 +1,20 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +const net = require('net'); + +const server = net.createServer(); + +server.listen(common.mustCall(() => { + const socket = net.createConnection(server.address().port); + socket.on('close', common.mustCall(() => server.close())); + socket.end(); +})); diff --git a/tests/node_compat/test/parallel/test-net-socket-end-callback.js b/tests/node_compat/test/parallel/test-net-socket-end-callback.js new file mode 100644 index 0000000000..7b6d3ae5c2 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-socket-end-callback.js @@ -0,0 +1,29 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const net = require('net'); + +const server = net.createServer((socket) => { + socket.resume(); +}).unref(); + +server.listen(common.mustCall(() => { + const connect = (...args) => { + const socket = net.createConnection(server.address().port, () => { + socket.end(...args); + }); + }; + + const cb = common.mustCall(3); + + connect(cb); + connect('foo', cb); + connect('foo', 'utf8', cb); +})); diff --git a/tests/node_compat/test/parallel/test-net-socket-ready-without-cb.js b/tests/node_compat/test/parallel/test-net-socket-ready-without-cb.js new file mode 100644 index 0000000000..0f71f410bd --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-socket-ready-without-cb.js @@ -0,0 +1,27 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +// This test ensures that socket.connect can be called without callback +// which is optional. + +const net = require('net'); + +const server = net.createServer(common.mustCall(function(conn) { + conn.end(); + server.close(); +})).listen(0, 'localhost', common.mustCall(function() { + const client = new net.Socket(); + + client.on('ready', common.mustCall(function() { + client.end(); + })); + + client.connect(server.address()); +})); diff --git a/tests/node_compat/test/parallel/test-net-socket-timeout-unref.js b/tests/node_compat/test/parallel/test-net-socket-timeout-unref.js new file mode 100644 index 0000000000..5e3fc8bd31 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-socket-timeout-unref.js @@ -0,0 +1,63 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +// Test that unref'ed sockets with timeouts do not prevent exit. + +const common = require('../common'); +const net = require('net'); + +const server = net.createServer(function(c) { + c.write('hello'); + c.unref(); +}); +server.listen(0); +server.unref(); + +let connections = 0; +const sockets = []; +const delays = [8, 5, 3, 6, 2, 4]; + +delays.forEach(function(T) { + const socket = net.createConnection(server.address().port, 'localhost'); + socket.on('connect', common.mustCall(function() { + if (++connections === delays.length) { + sockets.forEach(function(s) { + s.socket.setTimeout(s.timeout, function() { + s.socket.destroy(); + throw new Error('socket timed out unexpectedly'); + }); + + s.socket.unref(); + }); + } + })); + + sockets.push({ socket: socket, timeout: T * 1000 }); +}); diff --git a/tests/node_compat/test/parallel/test-net-socket-write-after-close.js b/tests/node_compat/test/parallel/test-net-socket-write-after-close.js new file mode 100644 index 0000000000..9b2150294e --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-socket-write-after-close.js @@ -0,0 +1,49 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +{ + const server = net.createServer(); + + server.listen(common.mustCall(() => { + const port = server.address().port; + const client = net.connect({ port }, common.mustCall(() => { + client.on('error', common.mustCall((err) => { + server.close(); + assert.strictEqual(err.constructor, Error); + assert.strictEqual(err.message, 'write EBADF'); + })); + client._handle.close(); + client.write('foo'); + })); + })); +} + +{ + const server = net.createServer(); + + server.listen(common.mustCall(() => { + const port = server.address().port; + const client = net.connect({ port }, common.mustCall(() => { + client.on('error', common.expectsError({ + code: 'ERR_SOCKET_CLOSED', + message: 'Socket is closed', + name: 'Error' + })); + + server.close(); + + client._handle.close(); + client._handle = null; + client.write('foo'); + })); + })); +} diff --git a/tests/node_compat/test/parallel/test-net-socket-write-error.js b/tests/node_compat/test/parallel/test-net-socket-write-error.js new file mode 100644 index 0000000000..a330058fde --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-socket-write-error.js @@ -0,0 +1,29 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const net = require('net'); +const assert = require('assert'); + +const server = net.createServer().listen(0, connectToServer); + +function connectToServer() { + const client = net.createConnection(this.address().port, () => { + client.on('error', common.mustNotCall()); + assert.throws(() => { + client.write(1337); + }, { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError' + }); + + client.destroy(); + }) + .on('close', () => server.close()); +} diff --git a/tests/node_compat/test/parallel/test-net-sync-cork.js b/tests/node_compat/test/parallel/test-net-sync-cork.js new file mode 100644 index 0000000000..289319c429 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-sync-cork.js @@ -0,0 +1,40 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +const server = net.createServer(handle); + +const N = 100; +const buf = Buffer.alloc(2, 'a'); + +server.listen(0, function() { + const conn = net.connect(this.address().port); + + conn.on('connect', () => { + let res = true; + let i = 0; + for (; i < N && res; i++) { + conn.cork(); + conn.write(buf); + res = conn.write(buf); + conn.uncork(); + } + assert.strictEqual(i, N); + conn.end(); + }); +}); + +function handle(socket) { + socket.resume(); + socket.on('error', common.mustNotCall()) + .on('close', common.mustCall(() => server.close())); +} diff --git a/tests/node_compat/test/parallel/test-net-writable.js b/tests/node_compat/test/parallel/test-net-writable.js new file mode 100644 index 0000000000..86ea2a3c03 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-writable.js @@ -0,0 +1,22 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +const server = net.createServer(common.mustCall(function(s) { + server.close(); + s.end(); +})).listen(0, '127.0.0.1', common.mustCall(function() { + const socket = net.connect(this.address().port, '127.0.0.1'); + socket.on('end', common.mustCall(() => { + assert.strictEqual(socket.writable, true); + socket.write('hello world'); + })); +})); diff --git a/tests/node_compat/test/parallel/test-net-write-connect-write.js b/tests/node_compat/test/parallel/test-net-write-connect-write.js new file mode 100644 index 0000000000..a87d80479e --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-write-connect-write.js @@ -0,0 +1,53 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +const server = net.createServer(function(socket) { + socket.pipe(socket); +}).listen(0, common.mustCall(function() { + const conn = net.connect(this.address().port); + let received = ''; + + conn.setEncoding('utf8'); + conn.write('before'); + conn.on('connect', function() { + conn.write(' after'); + }); + conn.on('data', function(buf) { + received += buf; + conn.end(); + }); + conn.on('end', common.mustCall(function() { + server.close(); + assert.strictEqual(received, 'before after'); + })); +})); diff --git a/tests/node_compat/test/parallel/test-net-write-fully-async-buffer.js b/tests/node_compat/test/parallel/test-net-write-fully-async-buffer.js new file mode 100644 index 0000000000..222c97ed94 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-write-fully-async-buffer.js @@ -0,0 +1,41 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +// Flags: --expose-gc + +// Note: This is a variant of test-net-write-fully-async-hex-string.js. +// This always worked, but it seemed appropriate to add a test that checks the +// behavior for Buffers, too. +const common = require('../common'); +const net = require('net'); + +const data = Buffer.alloc(1000000); + +const server = net.createServer(common.mustCall(function(conn) { + conn.resume(); +})).listen(0, common.mustCall(function() { + const conn = net.createConnection(this.address().port, common.mustCall(() => { + let count = 0; + + function writeLoop() { + if (count++ === 200) { + conn.destroy(); + server.close(); + return; + } + + while (conn.write(Buffer.from(data))); + global.gc({ type: 'minor' }); + // The buffer allocated above should still be alive. + } + + conn.on('drain', writeLoop); + + writeLoop(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-net-write-fully-async-hex-string.js b/tests/node_compat/test/parallel/test-net-write-fully-async-hex-string.js new file mode 100644 index 0000000000..81a3db7010 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-write-fully-async-hex-string.js @@ -0,0 +1,39 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +// Flags: --expose-gc + +// Regression test for https://github.com/nodejs/node/issues/8251. +const common = require('../common'); +const net = require('net'); + +const data = Buffer.alloc(1000000).toString('hex'); + +const server = net.createServer(common.mustCall(function(conn) { + conn.resume(); +})).listen(0, common.mustCall(function() { + const conn = net.createConnection(this.address().port, common.mustCall(() => { + let count = 0; + + function writeLoop() { + if (count++ === 20) { + conn.destroy(); + server.close(); + return; + } + + while (conn.write(data, 'hex')); + global.gc({ type: 'minor' }); + // The buffer allocated inside the .write() call should still be alive. + } + + conn.on('drain', writeLoop); + + writeLoop(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-net-write-slow.js b/tests/node_compat/test/parallel/test-net-write-slow.js new file mode 100644 index 0000000000..0204bb979f --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-write-slow.js @@ -0,0 +1,70 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +const SIZE = 2E5; +const N = 10; +let flushed = 0; +let received = 0; +const buf = Buffer.alloc(SIZE, 'a'); + +const server = net.createServer(function(socket) { + socket.setNoDelay(); + socket.setTimeout(9999); + socket.on('timeout', function() { + assert.fail(`flushed: ${flushed}, received: ${received}/${SIZE * N}`); + }); + + for (let i = 0; i < N; ++i) { + socket.write(buf, function() { + ++flushed; + if (flushed === N) { + socket.setTimeout(0); + } + }); + } + socket.end(); + +}).listen(0, common.mustCall(function() { + const conn = net.connect(this.address().port); + conn.on('data', function(buf) { + received += buf.length; + conn.pause(); + setTimeout(function() { + conn.resume(); + }, 20); + }); + conn.on('end', common.mustCall(function() { + server.close(); + assert.strictEqual(received, SIZE * N); + })); +})); diff --git a/tests/node_compat/test/parallel/test-next-tick-domain.js b/tests/node_compat/test/parallel/test-next-tick-domain.js new file mode 100644 index 0000000000..c39f56bea1 --- /dev/null +++ b/tests/node_compat/test/parallel/test-next-tick-domain.js @@ -0,0 +1,38 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); + +const origNextTick = process.nextTick; + +require('domain'); + +// Requiring domain should not change nextTick. +assert.strictEqual(origNextTick, process.nextTick); diff --git a/tests/node_compat/test/parallel/test-next-tick-errors.js b/tests/node_compat/test/parallel/test-next-tick-errors.js new file mode 100644 index 0000000000..a275029f5a --- /dev/null +++ b/tests/node_compat/test/parallel/test-next-tick-errors.js @@ -0,0 +1,81 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); + +const order = []; +let exceptionHandled = false; + +// This nextTick function will throw an error. It should only be called once. +// When it throws an error, it should still get removed from the queue. +process.nextTick(function() { + order.push('A'); + // cause an error + what(); // eslint-disable-line no-undef +}); + +// This nextTick function should remain in the queue when the first one +// is removed. It should be called if the error in the first one is +// caught (which we do in this test). +process.nextTick(function() { + order.push('C'); +}); + +function testNextTickWith(val) { + assert.throws(() => { + process.nextTick(val); + }, { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError' + }); +} + +testNextTickWith(false); +testNextTickWith(true); +testNextTickWith(1); +testNextTickWith('str'); +testNextTickWith({}); +testNextTickWith([]); + +process.on('uncaughtException', function(err, errorOrigin) { + assert.strictEqual(errorOrigin, 'uncaughtException'); + + if (!exceptionHandled) { + exceptionHandled = true; + order.push('B'); + } else { + // If we get here then the first process.nextTick got called twice + order.push('OOPS!'); + } +}); + +process.on('exit', function() { + assert.deepStrictEqual(order, ['A', 'B', 'C']); +}); diff --git a/tests/node_compat/test/parallel/test-no-node-snapshot.js b/tests/node_compat/test/parallel/test-no-node-snapshot.js new file mode 100644 index 0000000000..a251c9f9d0 --- /dev/null +++ b/tests/node_compat/test/parallel/test-no-node-snapshot.js @@ -0,0 +1,12 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// Flags: --no-node-snapshot + +require('../common'); diff --git a/tests/node_compat/test/parallel/test-os-homedir-no-envvar.js b/tests/node_compat/test/parallel/test-os-homedir-no-envvar.js new file mode 100644 index 0000000000..f687422da8 --- /dev/null +++ b/tests/node_compat/test/parallel/test-os-homedir-no-envvar.js @@ -0,0 +1,37 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const cp = require('child_process'); +const os = require('os'); +const path = require('path'); + + +if (process.argv[2] === 'child') { + if (common.isWindows) + assert.strictEqual(process.env.USERPROFILE, undefined); + else + assert.strictEqual(process.env.HOME, undefined); + + const home = os.homedir(); + + assert.strictEqual(typeof home, 'string'); + assert(home.includes(path.sep)); +} else { + if (common.isWindows) + delete process.env.USERPROFILE; + else + delete process.env.HOME; + + const child = cp.spawnSync(process.execPath, [__filename, 'child'], { + env: process.env + }); + + assert.strictEqual(child.status, 0); +} diff --git a/tests/node_compat/test/parallel/test-perf-gc-crash.js b/tests/node_compat/test/parallel/test-perf-gc-crash.js new file mode 100644 index 0000000000..474d1d0466 --- /dev/null +++ b/tests/node_compat/test/parallel/test-perf-gc-crash.js @@ -0,0 +1,32 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); + +// Refers to https://github.com/nodejs/node/issues/39548 + +// The test fails if this crashes. If it closes normally, +// then all is good. + +const { + PerformanceObserver, +} = require('perf_hooks'); + +// We don't actually care if the observer callback is called here. +const gcObserver = new PerformanceObserver(() => {}); + +gcObserver.observe({ entryTypes: ['gc'] }); + +gcObserver.disconnect(); + +const gcObserver2 = new PerformanceObserver(() => {}); + +gcObserver2.observe({ entryTypes: ['gc'] }); + +gcObserver2.disconnect(); diff --git a/tests/node_compat/test/parallel/test-performanceobserver-gc.js b/tests/node_compat/test/parallel/test-performanceobserver-gc.js new file mode 100644 index 0000000000..b508bc4dfc --- /dev/null +++ b/tests/node_compat/test/parallel/test-performanceobserver-gc.js @@ -0,0 +1,24 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); + +// Verifies that setting up two observers to listen +// to gc performance does not crash. + +const { + PerformanceObserver, +} = require('perf_hooks'); + +// We don't actually care if the callback is ever invoked in this test +const obs = new PerformanceObserver(() => {}); +const obs2 = new PerformanceObserver(() => {}); + +obs.observe({ type: 'gc' }); +obs2.observe({ type: 'gc' }); diff --git a/tests/node_compat/test/parallel/test-pipe-return-val.js b/tests/node_compat/test/parallel/test-pipe-return-val.js new file mode 100644 index 0000000000..c72bb275f8 --- /dev/null +++ b/tests/node_compat/test/parallel/test-pipe-return-val.js @@ -0,0 +1,40 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +// This test ensures SourceStream.pipe(DestStream) returns DestStream + +require('../common'); +const Stream = require('stream').Stream; +const assert = require('assert'); + +const sourceStream = new Stream(); +const destStream = new Stream(); +const result = sourceStream.pipe(destStream); + +assert.strictEqual(result, destStream); diff --git a/tests/node_compat/test/parallel/test-pipe-writev.js b/tests/node_compat/test/parallel/test-pipe-writev.js new file mode 100644 index 0000000000..9004104271 --- /dev/null +++ b/tests/node_compat/test/parallel/test-pipe-writev.js @@ -0,0 +1,52 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +if (common.isWindows) + common.skip('Unix-specific test'); + +const assert = require('assert'); +const net = require('net'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +const server = net.createServer((connection) => { + connection.on('error', (err) => { + throw err; + }); + + const writev = connection._writev.bind(connection); + connection._writev = common.mustCall(writev); + + connection.cork(); + connection.write('pi'); + connection.write('ng'); + connection.end(); +}); + +server.on('error', (err) => { + throw err; +}); + +server.listen(common.PIPE, () => { + const client = net.connect(common.PIPE); + + client.on('error', (err) => { + throw err; + }); + + client.on('data', common.mustCall((data) => { + assert.strictEqual(data.toString(), 'ping'); + })); + + client.on('end', () => { + server.close(); + }); +}); diff --git a/tests/node_compat/test/parallel/test-process-abort.js b/tests/node_compat/test/parallel/test-process-abort.js new file mode 100644 index 0000000000..6117205e61 --- /dev/null +++ b/tests/node_compat/test/parallel/test-process-abort.js @@ -0,0 +1,19 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); + +if (!common.isMainThread) + common.skip('process.abort() is not available in Workers'); + +// Check that our built-in methods do not have a prototype/constructor behaviour +// if they don't need to. This could be tested for any of our C++ methods. +assert.strictEqual(process.abort.prototype, undefined); +assert.throws(() => new process.abort(), TypeError); diff --git a/tests/node_compat/test/parallel/test-process-argv-0.js b/tests/node_compat/test/parallel/test-process-argv-0.js new file mode 100644 index 0000000000..3a4aa69822 --- /dev/null +++ b/tests/node_compat/test/parallel/test-process-argv-0.js @@ -0,0 +1,49 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const path = require('path'); +const assert = require('assert'); +const spawn = require('child_process').spawn; + +if (process.argv[2] !== 'child') { + const child = spawn(process.execPath, [__filename, 'child'], { + cwd: path.dirname(process.execPath) + }); + + let childArgv0 = ''; + child.stdout.on('data', function(chunk) { + childArgv0 += chunk; + }); + process.on('exit', function() { + assert.strictEqual(childArgv0, process.execPath); + }); +} else { + process.stdout.write(process.argv[0]); +} diff --git a/tests/node_compat/test/parallel/test-process-binding.js b/tests/node_compat/test/parallel/test-process-binding.js new file mode 100644 index 0000000000..e4895ed37d --- /dev/null +++ b/tests/node_compat/test/parallel/test-process-binding.js @@ -0,0 +1,21 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +// Flags: --expose-internals +require('../common'); +const assert = require('assert'); +const { internalBinding } = require('internal/test/binding'); + +assert.throws( + function() { + process.binding('test'); + }, + /No such module: test/ +); + +internalBinding('buffer'); diff --git a/tests/node_compat/test/parallel/test-process-dlopen-undefined-exports.js b/tests/node_compat/test/parallel/test-process-dlopen-undefined-exports.js new file mode 100644 index 0000000000..615eaf7aaa --- /dev/null +++ b/tests/node_compat/test/parallel/test-process-dlopen-undefined-exports.js @@ -0,0 +1,17 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const assert = require('assert'); + +const someBindingPath = './test/addons/hello-world/build/Release/binding.node'; + +assert.throws(() => { + process.dlopen({ exports: undefined }, someBindingPath); +}, Error); diff --git a/tests/node_compat/test/parallel/test-process-domain-segfault.js b/tests/node_compat/test/parallel/test-process-domain-segfault.js new file mode 100644 index 0000000000..65a46cebd1 --- /dev/null +++ b/tests/node_compat/test/parallel/test-process-domain-segfault.js @@ -0,0 +1,39 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); + +// This test ensures that setting `process.domain` to `null` does not result in +// node crashing with a segfault. +// https://github.com/nodejs/node-v0.x-archive/issues/4256 + +process.domain = null; +setTimeout(function() { + console.log('this console.log statement should not make node crash'); +}, 1); diff --git a/tests/node_compat/test/parallel/test-process-emitwarning.js b/tests/node_compat/test/parallel/test-process-emitwarning.js new file mode 100644 index 0000000000..7bf6082e7d --- /dev/null +++ b/tests/node_compat/test/parallel/test-process-emitwarning.js @@ -0,0 +1,88 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --no-warnings +// The flag suppresses stderr output but the warning event will still emit +'use strict'; + +const common = require('../common'); +const assert = require('assert'); + +const testMsg = 'A Warning'; +const testCode = 'CODE001'; +const testDetail = 'Some detail'; +const testType = 'CustomWarning'; + +process.on('warning', common.mustCall((warning) => { + assert(warning); + assert.match(warning.name, /^(?:Warning|CustomWarning)/); + assert.strictEqual(warning.message, testMsg); + if (warning.code) assert.strictEqual(warning.code, testCode); + if (warning.detail) assert.strictEqual(warning.detail, testDetail); +}, 15)); + +class CustomWarning extends Error { + constructor() { + super(); + this.name = testType; + this.message = testMsg; + this.code = testCode; + Error.captureStackTrace(this, CustomWarning); + } +} + +[ + [testMsg], + [testMsg, testType], + [testMsg, CustomWarning], + [testMsg, testType, CustomWarning], + [testMsg, testType, testCode], + [testMsg, { type: testType }], + [testMsg, { type: testType, code: testCode }], + [testMsg, { type: testType, code: testCode, detail: testDetail }], + [new CustomWarning()], + // Detail will be ignored for the following. No errors thrown + [testMsg, { type: testType, code: testCode, detail: true }], + [testMsg, { type: testType, code: testCode, detail: [] }], + [testMsg, { type: testType, code: testCode, detail: null }], + [testMsg, { type: testType, code: testCode, detail: 1 }], +].forEach((args) => { + process.emitWarning(...args); +}); + +const warningNoToString = new CustomWarning(); +warningNoToString.toString = null; +process.emitWarning(warningNoToString); + +const warningThrowToString = new CustomWarning(); +warningThrowToString.toString = function() { + throw new Error('invalid toString'); +}; +process.emitWarning(warningThrowToString); + +// TypeError is thrown on invalid input +[ + [1], + [{}], + [true], + [[]], + ['', '', {}], + ['', 1], + ['', '', 1], + ['', true], + ['', '', true], + ['', []], + ['', '', []], + [], + [undefined, 'foo', 'bar'], + [undefined], +].forEach((args) => { + assert.throws( + () => process.emitWarning(...args), + { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' } + ); +}); diff --git a/tests/node_compat/test/parallel/test-process-env-delete.js b/tests/node_compat/test/parallel/test-process-env-delete.js new file mode 100644 index 0000000000..cb74a681d4 --- /dev/null +++ b/tests/node_compat/test/parallel/test-process-env-delete.js @@ -0,0 +1,20 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); + +process.env.foo = 'foo'; +assert.strictEqual(process.env.foo, 'foo'); +process.env.foo = undefined; +assert.strictEqual(process.env.foo, 'undefined'); + +process.env.foo = 'foo'; +assert.strictEqual(process.env.foo, 'foo'); +delete process.env.foo; +assert.strictEqual(process.env.foo, undefined); diff --git a/tests/node_compat/test/parallel/test-process-env-windows-error-reset.js b/tests/node_compat/test/parallel/test-process-env-windows-error-reset.js new file mode 100644 index 0000000000..63b44e98c7 --- /dev/null +++ b/tests/node_compat/test/parallel/test-process-env-windows-error-reset.js @@ -0,0 +1,29 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); + +// This checks that after accessing a missing env var, a subsequent +// env read will succeed even for empty variables. + +{ + process.env.FOO = ''; + process.env.NONEXISTENT_ENV_VAR; // eslint-disable-line no-unused-expressions + const foo = process.env.FOO; + + assert.strictEqual(foo, ''); +} + +{ + process.env.FOO = ''; + process.env.NONEXISTENT_ENV_VAR; // eslint-disable-line no-unused-expressions + const hasFoo = 'FOO' in process.env; + + assert.strictEqual(hasFoo, true); +} diff --git a/tests/node_compat/test/parallel/test-process-getgroups.js b/tests/node_compat/test/parallel/test-process-getgroups.js new file mode 100644 index 0000000000..01eb92bf79 --- /dev/null +++ b/tests/node_compat/test/parallel/test-process-getgroups.js @@ -0,0 +1,59 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); + +// Check `id -G` and `process.getgroups()` return same groups. + +if (common.isOSX) + common.skip('Output of `id -G` is unreliable on Darwin.'); + +const assert = require('assert'); +const exec = require('child_process').exec; + +if (typeof process.getgroups === 'function') { + const groups = unique(process.getgroups()); + assert(Array.isArray(groups)); + assert(groups.length > 0); + exec('id -G', function(err, stdout) { + assert.ifError(err); + const real_groups = unique(stdout.match(/\d+/g).map(Number)); + assert.deepStrictEqual(groups, real_groups); + check(groups, real_groups); + check(real_groups, groups); + }); +} + +function check(a, b) { + for (let i = 0; i < a.length; ++i) assert(b.includes(a[i])); +} + +function unique(groups) { + return [...new Set(groups)].sort(); +} diff --git a/tests/node_compat/test/parallel/test-process-hrtime-bigint.js b/tests/node_compat/test/parallel/test-process-hrtime-bigint.js new file mode 100644 index 0000000000..22c382bb45 --- /dev/null +++ b/tests/node_compat/test/parallel/test-process-hrtime-bigint.js @@ -0,0 +1,21 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// Tests that process.hrtime.bigint() works. + +require('../common'); +const assert = require('assert'); + +const start = process.hrtime.bigint(); +assert.strictEqual(typeof start, 'bigint'); + +const end = process.hrtime.bigint(); +assert.strictEqual(typeof end, 'bigint'); + +assert(end - start >= 0n); diff --git a/tests/node_compat/test/parallel/test-process-next-tick.js b/tests/node_compat/test/parallel/test-process-next-tick.js new file mode 100644 index 0000000000..b755188696 --- /dev/null +++ b/tests/node_compat/test/parallel/test-process-next-tick.js @@ -0,0 +1,56 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const N = 2; + +function cb() { + throw new Error(); +} + +for (let i = 0; i < N; ++i) { + process.nextTick(common.mustCall(cb)); +} + +process.on('uncaughtException', common.mustCall(N)); + +process.on('exit', function() { + process.removeAllListeners('uncaughtException'); +}); + +[null, 1, 'test', {}, [], Infinity, true].forEach((i) => { + assert.throws( + () => process.nextTick(i), + { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError', + } + ); +}); diff --git a/tests/node_compat/test/parallel/test-process-no-deprecation.js b/tests/node_compat/test/parallel/test-process-no-deprecation.js new file mode 100644 index 0000000000..310c3dbe4d --- /dev/null +++ b/tests/node_compat/test/parallel/test-process-no-deprecation.js @@ -0,0 +1,39 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +// Flags: --no-warnings + +// The --no-warnings flag only suppresses writing the warning to stderr, not the +// emission of the corresponding event. This test file can be run without it. + +const common = require('../common'); +process.noDeprecation = true; + +const assert = require('assert'); + +function listener() { + assert.fail('received unexpected warning'); +} + +process.addListener('warning', listener); + +process.emitWarning('Something is deprecated.', 'DeprecationWarning'); + +// The warning would be emitted in the next tick, so continue after that. +process.nextTick(common.mustCall(() => { + // Check that deprecations can be re-enabled. + process.noDeprecation = false; + process.removeListener('warning', listener); + + process.addListener('warning', common.mustCall((warning) => { + assert.strictEqual(warning.name, 'DeprecationWarning'); + assert.strictEqual(warning.message, 'Something else is deprecated.'); + })); + + process.emitWarning('Something else is deprecated.', 'DeprecationWarning'); +})); diff --git a/tests/node_compat/test/parallel/test-process-ppid.js b/tests/node_compat/test/parallel/test-process-ppid.js new file mode 100644 index 0000000000..f9b184e254 --- /dev/null +++ b/tests/node_compat/test/parallel/test-process-ppid.js @@ -0,0 +1,23 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const cp = require('child_process'); + +if (process.argv[2] === 'child') { + // The following console.log() call is part of the test's functionality. + console.log(process.ppid); +} else { + const child = cp.spawnSync(process.execPath, [__filename, 'child']); + + assert.strictEqual(child.status, 0); + assert.strictEqual(child.signal, null); + assert.strictEqual(+child.stdout.toString().trim(), process.pid); + assert.strictEqual(child.stderr.toString().trim(), ''); +} diff --git a/tests/node_compat/test/parallel/test-process-really-exit.js b/tests/node_compat/test/parallel/test-process-really-exit.js new file mode 100644 index 0000000000..ea98eadf35 --- /dev/null +++ b/tests/node_compat/test/parallel/test-process-really-exit.js @@ -0,0 +1,24 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); + +// Ensure that the reallyExit hook is executed. +// see: https://github.com/nodejs/node/issues/25650 +if (process.argv[2] === 'subprocess') { + process.reallyExit = function() { + console.info('really exited'); + }; + process.exit(); +} else { + const { spawnSync } = require('child_process'); + const out = spawnSync(process.execPath, [__filename, 'subprocess']); + const observed = out.output[1].toString('utf8').trim(); + assert.strictEqual(observed, 'really exited'); +} diff --git a/tests/node_compat/test/parallel/test-process-warning.js b/tests/node_compat/test/parallel/test-process-warning.js new file mode 100644 index 0000000000..69514242db --- /dev/null +++ b/tests/node_compat/test/parallel/test-process-warning.js @@ -0,0 +1,75 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { + hijackStderr, + restoreStderr +} = require('../common/hijackstdio'); +const assert = require('assert'); + +function test1() { + // Output is skipped if the argument to the 'warning' event is + // not an Error object. + hijackStderr(common.mustNotCall('stderr.write must not be called')); + process.emit('warning', 'test'); + setImmediate(test2); +} + +function test2() { + // Output is skipped if it's a deprecation warning and + // process.noDeprecation = true + process.noDeprecation = true; + process.emitWarning('test', 'DeprecationWarning'); + process.noDeprecation = false; + setImmediate(test3); +} + +function test3() { + restoreStderr(); + // Type defaults to warning when the second argument is an object + process.emitWarning('test', {}); + process.once('warning', common.mustCall((warning) => { + assert.strictEqual(warning.name, 'Warning'); + })); + setImmediate(test4); +} + +function test4() { + // process.emitWarning will throw when process.throwDeprecation is true + // and type is `DeprecationWarning`. + process.throwDeprecation = true; + process.once('uncaughtException', (err) => { + assert.match(err.toString(), /^DeprecationWarning: test$/); + }); + try { + process.emitWarning('test', 'DeprecationWarning'); + } catch { + assert.fail('Unreachable'); + } + process.throwDeprecation = false; + setImmediate(test5); +} + +function test5() { + // Setting toString to a non-function should not cause an error + const err = new Error('test'); + err.toString = 1; + process.emitWarning(err); + setImmediate(test6); +} + +function test6() { + process.emitWarning('test', { detail: 'foo' }); + process.on('warning', (warning) => { + assert.strictEqual(warning.detail, 'foo'); + }); +} + +test1(); diff --git a/tests/node_compat/test/parallel/test-promise-handled-rejection-no-warning.js b/tests/node_compat/test/parallel/test-promise-handled-rejection-no-warning.js new file mode 100644 index 0000000000..f7d636f187 --- /dev/null +++ b/tests/node_compat/test/parallel/test-promise-handled-rejection-no-warning.js @@ -0,0 +1,14 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +// This test verifies that DEP0018 does not occur when rejections are handled. +process.on('warning', common.mustNotCall()); +process.on('unhandledRejection', common.mustCall()); +Promise.reject(new Error()); diff --git a/tests/node_compat/test/parallel/test-readable-from-iterator-closing.js b/tests/node_compat/test/parallel/test-readable-from-iterator-closing.js new file mode 100644 index 0000000000..fba145d4e7 --- /dev/null +++ b/tests/node_compat/test/parallel/test-readable-from-iterator-closing.js @@ -0,0 +1,204 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const { mustCall, mustNotCall } = require('../common'); +const { Readable } = require('stream'); +const { strictEqual } = require('assert'); + +async function asyncSupport() { + const finallyMustCall = mustCall(); + const bodyMustCall = mustCall(); + + async function* infiniteGenerate() { + try { + while (true) yield 'a'; + } finally { + finallyMustCall(); + } + } + + const stream = Readable.from(infiniteGenerate()); + + for await (const chunk of stream) { + bodyMustCall(); + strictEqual(chunk, 'a'); + break; + } +} + +async function syncSupport() { + const finallyMustCall = mustCall(); + const bodyMustCall = mustCall(); + + function* infiniteGenerate() { + try { + while (true) yield 'a'; + } finally { + finallyMustCall(); + } + } + + const stream = Readable.from(infiniteGenerate()); + + for await (const chunk of stream) { + bodyMustCall(); + strictEqual(chunk, 'a'); + break; + } +} + +async function syncPromiseSupport() { + const returnMustBeAwaited = mustCall(); + const bodyMustCall = mustCall(); + + function* infiniteGenerate() { + try { + while (true) yield Promise.resolve('a'); + } finally { + // eslint-disable-next-line no-unsafe-finally + return { then(cb) { + returnMustBeAwaited(); + cb(); + } }; + } + } + + const stream = Readable.from(infiniteGenerate()); + + for await (const chunk of stream) { + bodyMustCall(); + strictEqual(chunk, 'a'); + break; + } +} + +async function syncRejectedSupport() { + const returnMustBeAwaited = mustCall(); + const bodyMustNotCall = mustNotCall(); + const catchMustCall = mustCall(); + const secondNextMustNotCall = mustNotCall(); + + function* generate() { + try { + yield Promise.reject('a'); + secondNextMustNotCall(); + } finally { + // eslint-disable-next-line no-unsafe-finally + return { then(cb) { + returnMustBeAwaited(); + cb(); + } }; + } + } + + const stream = Readable.from(generate()); + + try { + for await (const chunk of stream) { + bodyMustNotCall(chunk); + } + } catch { + catchMustCall(); + } +} + +async function noReturnAfterThrow() { + const returnMustNotCall = mustNotCall(); + const bodyMustNotCall = mustNotCall(); + const catchMustCall = mustCall(); + const nextMustCall = mustCall(); + + const stream = Readable.from({ + [Symbol.asyncIterator]() { return this; }, + async next() { + nextMustCall(); + throw new Error('a'); + }, + async return() { + returnMustNotCall(); + return { done: true }; + }, + }); + + try { + for await (const chunk of stream) { + bodyMustNotCall(chunk); + } + } catch { + catchMustCall(); + } +} + +async function closeStreamWhileNextIsPending() { + const finallyMustCall = mustCall(); + const dataMustCall = mustCall(); + + let resolveDestroy; + const destroyed = + new Promise((resolve) => { resolveDestroy = mustCall(resolve); }); + let resolveYielded; + const yielded = + new Promise((resolve) => { resolveYielded = mustCall(resolve); }); + + async function* infiniteGenerate() { + try { + while (true) { + yield 'a'; + resolveYielded(); + await destroyed; + } + } finally { + finallyMustCall(); + } + } + + const stream = Readable.from(infiniteGenerate()); + + stream.on('data', (data) => { + dataMustCall(); + strictEqual(data, 'a'); + }); + + yielded.then(() => { + stream.destroy(); + resolveDestroy(); + }); +} + +async function closeAfterNullYielded() { + const finallyMustCall = mustCall(); + const dataMustCall = mustCall(3); + + function* generate() { + try { + yield 'a'; + yield 'a'; + yield 'a'; + } finally { + finallyMustCall(); + } + } + + const stream = Readable.from(generate()); + + stream.on('data', (chunk) => { + dataMustCall(); + strictEqual(chunk, 'a'); + }); +} + +Promise.all([ + asyncSupport(), + syncSupport(), + syncPromiseSupport(), + syncRejectedSupport(), + noReturnAfterThrow(), + closeStreamWhileNextIsPending(), + closeAfterNullYielded(), +]).then(mustCall()); diff --git a/tests/node_compat/test/parallel/test-readable-from.js b/tests/node_compat/test/parallel/test-readable-from.js new file mode 100644 index 0000000000..066532466a --- /dev/null +++ b/tests/node_compat/test/parallel/test-readable-from.js @@ -0,0 +1,230 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const { mustCall } = require('../common'); +const { once } = require('events'); +const { Readable } = require('stream'); +const { strictEqual, throws } = require('assert'); +const common = require('../common'); + +{ + throws(() => { + Readable.from(null); + }, /ERR_INVALID_ARG_TYPE/); +} + +async function toReadableBasicSupport() { + async function* generate() { + yield 'a'; + yield 'b'; + yield 'c'; + } + + const stream = Readable.from(generate()); + + const expected = ['a', 'b', 'c']; + + for await (const chunk of stream) { + strictEqual(chunk, expected.shift()); + } +} + +async function toReadableSyncIterator() { + function* generate() { + yield 'a'; + yield 'b'; + yield 'c'; + } + + const stream = Readable.from(generate()); + + const expected = ['a', 'b', 'c']; + + for await (const chunk of stream) { + strictEqual(chunk, expected.shift()); + } +} + +async function toReadablePromises() { + const promises = [ + Promise.resolve('a'), + Promise.resolve('b'), + Promise.resolve('c'), + ]; + + const stream = Readable.from(promises); + + const expected = ['a', 'b', 'c']; + + for await (const chunk of stream) { + strictEqual(chunk, expected.shift()); + } +} + +async function toReadableString() { + const stream = Readable.from('abc'); + + const expected = ['abc']; + + for await (const chunk of stream) { + strictEqual(chunk, expected.shift()); + } +} + +async function toReadableBuffer() { + const stream = Readable.from(Buffer.from('abc')); + + const expected = ['abc']; + + for await (const chunk of stream) { + strictEqual(chunk.toString(), expected.shift()); + } +} + +async function toReadableOnData() { + async function* generate() { + yield 'a'; + yield 'b'; + yield 'c'; + } + + const stream = Readable.from(generate()); + + let iterations = 0; + const expected = ['a', 'b', 'c']; + + stream.on('data', (chunk) => { + iterations++; + strictEqual(chunk, expected.shift()); + }); + + await once(stream, 'end'); + + strictEqual(iterations, 3); +} + +async function toReadableOnDataNonObject() { + async function* generate() { + yield 'a'; + yield 'b'; + yield 'c'; + } + + const stream = Readable.from(generate(), { objectMode: false }); + + let iterations = 0; + const expected = ['a', 'b', 'c']; + + stream.on('data', (chunk) => { + iterations++; + strictEqual(chunk instanceof Buffer, true); + strictEqual(chunk.toString(), expected.shift()); + }); + + await once(stream, 'end'); + + strictEqual(iterations, 3); +} + +async function destroysTheStreamWhenThrowing() { + async function* generate() { // eslint-disable-line require-yield + throw new Error('kaboom'); + } + + const stream = Readable.from(generate()); + + stream.read(); + + const [err] = await once(stream, 'error'); + strictEqual(err.message, 'kaboom'); + strictEqual(stream.destroyed, true); + +} + +async function asTransformStream() { + async function* generate(stream) { + for await (const chunk of stream) { + yield chunk.toUpperCase(); + } + } + + const source = new Readable({ + objectMode: true, + read() { + this.push('a'); + this.push('b'); + this.push('c'); + this.push(null); + } + }); + + const stream = Readable.from(generate(source)); + + const expected = ['A', 'B', 'C']; + + for await (const chunk of stream) { + strictEqual(chunk, expected.shift()); + } +} + +async function endWithError() { + async function* generate() { + yield 1; + yield 2; + yield Promise.reject('Boum'); + } + + const stream = Readable.from(generate()); + + const expected = [1, 2]; + + try { + for await (const chunk of stream) { + strictEqual(chunk, expected.shift()); + } + throw new Error(); + } catch (err) { + strictEqual(expected.length, 0); + strictEqual(err, 'Boum'); + } +} + +async function destroyingStreamWithErrorThrowsInGenerator() { + const validateError = common.mustCall((e) => { + strictEqual(e, 'Boum'); + }); + async function* generate() { + try { + yield 1; + yield 2; + yield 3; + throw new Error(); + } catch (e) { + validateError(e); + } + } + const stream = Readable.from(generate()); + stream.read(); + stream.once('error', common.mustCall()); + stream.destroy('Boum'); +} + +Promise.all([ + toReadableBasicSupport(), + toReadableSyncIterator(), + toReadablePromises(), + toReadableString(), + toReadableBuffer(), + toReadableOnData(), + toReadableOnDataNonObject(), + destroysTheStreamWhenThrowing(), + asTransformStream(), + endWithError(), + destroyingStreamWithErrorThrowsInGenerator(), +]).then(mustCall()); diff --git a/tests/node_compat/test/parallel/test-readable-large-hwm.js b/tests/node_compat/test/parallel/test-readable-large-hwm.js new file mode 100644 index 0000000000..79a243a9d1 --- /dev/null +++ b/tests/node_compat/test/parallel/test-readable-large-hwm.js @@ -0,0 +1,34 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const { Readable } = require('stream'); + +// Make sure that readable completes +// even when reading larger buffer. +const bufferSize = 10 * 1024 * 1024; +let n = 0; +const r = new Readable({ + read() { + // Try to fill readable buffer piece by piece. + r.push(Buffer.alloc(bufferSize / 10)); + + if (n++ > 10) { + r.push(null); + } + } +}); + +r.on('readable', () => { + while (true) { + const ret = r.read(bufferSize); + if (ret === null) + break; + } +}); +r.on('end', common.mustCall()); diff --git a/tests/node_compat/test/parallel/test-readable-single-end.js b/tests/node_compat/test/parallel/test-readable-single-end.js new file mode 100644 index 0000000000..33eb32e1fb --- /dev/null +++ b/tests/node_compat/test/parallel/test-readable-single-end.js @@ -0,0 +1,23 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { Readable } = require('stream'); + +// This test ensures that there will not be an additional empty 'readable' +// event when stream has ended (only 1 event signalling about end) + +const r = new Readable({ + read: () => {}, +}); + +r.push(null); + +r.on('readable', common.mustCall()); +r.on('end', common.mustCall()); diff --git a/tests/node_compat/test/parallel/test-readline-async-iterators-destroy.js b/tests/node_compat/test/parallel/test-readline-async-iterators-destroy.js new file mode 100644 index 0000000000..2dcc43e05c --- /dev/null +++ b/tests/node_compat/test/parallel/test-readline-async-iterators-destroy.js @@ -0,0 +1,96 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const fs = require('fs'); +const { once } = require('events'); +const readline = require('readline'); +const assert = require('assert'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +const filename = tmpdir.resolve('test.txt'); + +const testContents = [ + '', + '\n', + 'line 1', + 'line 1\nline 2 南越国是前203年至前111年存在于岭南地区的一个国家\nline 3\ntrailing', + 'line 1\nline 2\nline 3 ends with newline\n', +]; + +async function testSimpleDestroy() { + for (const fileContent of testContents) { + fs.writeFileSync(filename, fileContent); + + const readable = fs.createReadStream(filename); + const rli = readline.createInterface({ + input: readable, + crlfDelay: Infinity + }); + + const iteratedLines = []; + for await (const k of rli) { + iteratedLines.push(k); + break; + } + + const expectedLines = fileContent.split('\n'); + if (expectedLines[expectedLines.length - 1] === '') { + expectedLines.pop(); + } + expectedLines.splice(1); + + assert.deepStrictEqual(iteratedLines, expectedLines); + + rli.close(); + readable.destroy(); + + await once(readable, 'close'); + } +} + +async function testMutualDestroy() { + for (const fileContent of testContents) { + fs.writeFileSync(filename, fileContent); + + const readable = fs.createReadStream(filename); + const rli = readline.createInterface({ + input: readable, + crlfDelay: Infinity + }); + + const expectedLines = fileContent.split('\n'); + if (expectedLines[expectedLines.length - 1] === '') { + expectedLines.pop(); + } + expectedLines.splice(2); + + const iteratedLines = []; + for await (const k of rli) { + iteratedLines.push(k); + for await (const l of rli) { + iteratedLines.push(l); + break; + } + assert.deepStrictEqual(iteratedLines, expectedLines); + break; + } + + assert.deepStrictEqual(iteratedLines, expectedLines); + + rli.close(); + readable.destroy(); + + await once(readable, 'close'); + } +} + +testSimpleDestroy().then(testMutualDestroy).then(common.mustCall()); diff --git a/tests/node_compat/test/parallel/test-readline-async-iterators.js b/tests/node_compat/test/parallel/test-readline-async-iterators.js new file mode 100644 index 0000000000..a9e3a282fb --- /dev/null +++ b/tests/node_compat/test/parallel/test-readline-async-iterators.js @@ -0,0 +1,127 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const fs = require('fs'); +const readline = require('readline'); +const { Readable } = require('stream'); +const assert = require('assert'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +const filename = tmpdir.resolve('test.txt'); + +const testContents = [ + '', + '\n', + 'line 1', + 'line 1\nline 2 南越国是前203年至前111年存在于岭南地区的一个国家\nline 3\ntrailing', + 'line 1\nline 2\nline 3 ends with newline\n', +]; + +async function testSimple() { + for (const fileContent of testContents) { + fs.writeFileSync(filename, fileContent); + + const readable = fs.createReadStream(filename); + const rli = readline.createInterface({ + input: readable, + crlfDelay: Infinity + }); + + const iteratedLines = []; + for await (const k of rli) { + iteratedLines.push(k); + } + + const expectedLines = fileContent.split('\n'); + if (expectedLines[expectedLines.length - 1] === '') { + expectedLines.pop(); + } + assert.deepStrictEqual(iteratedLines, expectedLines); + assert.strictEqual(iteratedLines.join(''), fileContent.replace(/\n/g, '')); + } +} + +async function testMutual() { + for (const fileContent of testContents) { + fs.writeFileSync(filename, fileContent); + + const readable = fs.createReadStream(filename); + const rli = readline.createInterface({ + input: readable, + crlfDelay: Infinity + }); + + const expectedLines = fileContent.split('\n'); + if (expectedLines[expectedLines.length - 1] === '') { + expectedLines.pop(); + } + const iteratedLines = []; + let iterated = false; + for await (const k of rli) { + // This outer loop should only iterate once. + assert.strictEqual(iterated, false); + iterated = true; + iteratedLines.push(k); + for await (const l of rli) { + iteratedLines.push(l); + } + assert.deepStrictEqual(iteratedLines, expectedLines); + } + assert.deepStrictEqual(iteratedLines, expectedLines); + } +} + +async function testSlowStreamForLeaks() { + const message = 'a\nb\nc\n'; + const DELAY = 1; + const REPETITIONS = 100; + const warningCallback = common.mustNotCall(); + process.on('warning', warningCallback); + + function getStream() { + const readable = Readable({ + objectMode: true, + }); + readable._read = () => {}; + let i = REPETITIONS; + function schedule() { + setTimeout(() => { + i--; + if (i < 0) { + readable.push(null); + } else { + readable.push(message); + schedule(); + } + }, DELAY); + } + schedule(); + return readable; + } + const iterable = readline.createInterface({ + input: getStream(), + }); + + let lines = 0; + // eslint-disable-next-line no-unused-vars + for await (const _ of iterable) { + lines++; + } + + assert.strictEqual(lines, 3 * REPETITIONS); + process.off('warning', warningCallback); +} + +testSimple() + .then(testMutual) + .then(testSlowStreamForLeaks) + .then(common.mustCall()); diff --git a/tests/node_compat/test/parallel/test-readline-carriage-return-between-chunks.js b/tests/node_compat/test/parallel/test-readline-carriage-return-between-chunks.js new file mode 100644 index 0000000000..b678f8666d --- /dev/null +++ b/tests/node_compat/test/parallel/test-readline-carriage-return-between-chunks.js @@ -0,0 +1,30 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +const assert = require('node:assert'); +const readline = require('node:readline'); +const { Readable } = require('node:stream'); + + +const input = Readable.from((function*() { + yield 'a\nb'; + yield '\r\n'; +})()); +const rl = readline.createInterface({ input, crlfDelay: Infinity }); +let carriageReturns = 0; + +rl.on('line', (line) => { + if (line.includes('\r')) carriageReturns++; +}); + +rl.on('close', common.mustCall(() => { + assert.strictEqual(carriageReturns, 0); +})); diff --git a/tests/node_compat/test/parallel/test-readline-csi.js b/tests/node_compat/test/parallel/test-readline-csi.js new file mode 100644 index 0000000000..e657ed545e --- /dev/null +++ b/tests/node_compat/test/parallel/test-readline-csi.js @@ -0,0 +1,183 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const readline = require('readline'); +const { Writable } = require('stream'); +const { CSI } = require('internal/readline/utils'); + +{ + assert(CSI); + assert.strictEqual(CSI.kClearToLineBeginning, '\x1b[1K'); + assert.strictEqual(CSI.kClearToLineEnd, '\x1b[0K'); + assert.strictEqual(CSI.kClearLine, '\x1b[2K'); + assert.strictEqual(CSI.kClearScreenDown, '\x1b[0J'); + assert.strictEqual(CSI`1${2}3`, '\x1b[123'); +} + +class TestWritable extends Writable { + constructor() { + super(); + this.data = ''; + } + _write(chunk, encoding, callback) { + this.data += chunk.toString(); + callback(); + } +} + +const writable = new TestWritable(); + +assert.strictEqual(readline.clearScreenDown(writable), true); +assert.deepStrictEqual(writable.data, CSI.kClearScreenDown); +assert.strictEqual(readline.clearScreenDown(writable, common.mustCall()), true); + +// Verify that clearScreenDown() throws on invalid callback. +assert.throws(() => { + readline.clearScreenDown(writable, null); +}, /ERR_INVALID_ARG_TYPE/); + +// Verify that clearScreenDown() does not throw on null or undefined stream. +assert.strictEqual(readline.clearScreenDown(null, common.mustCall((err) => { + assert.strictEqual(err, null); +})), true); +assert.strictEqual(readline.clearScreenDown(undefined, common.mustCall()), + true); + +writable.data = ''; +assert.strictEqual(readline.clearLine(writable, -1), true); +assert.deepStrictEqual(writable.data, CSI.kClearToLineBeginning); + +writable.data = ''; +assert.strictEqual(readline.clearLine(writable, 1), true); +assert.deepStrictEqual(writable.data, CSI.kClearToLineEnd); + +writable.data = ''; +assert.strictEqual(readline.clearLine(writable, 0), true); +assert.deepStrictEqual(writable.data, CSI.kClearLine); + +writable.data = ''; +assert.strictEqual(readline.clearLine(writable, -1, common.mustCall()), true); +assert.deepStrictEqual(writable.data, CSI.kClearToLineBeginning); + +// Verify that clearLine() throws on invalid callback. +assert.throws(() => { + readline.clearLine(writable, 0, null); +}, /ERR_INVALID_ARG_TYPE/); + +// Verify that clearLine() does not throw on null or undefined stream. +assert.strictEqual(readline.clearLine(null, 0), true); +assert.strictEqual(readline.clearLine(undefined, 0), true); +assert.strictEqual(readline.clearLine(null, 0, common.mustCall((err) => { + assert.strictEqual(err, null); +})), true); +assert.strictEqual(readline.clearLine(undefined, 0, common.mustCall()), true); + +// Nothing is written when moveCursor 0, 0 +[ + [0, 0, ''], + [1, 0, '\x1b[1C'], + [-1, 0, '\x1b[1D'], + [0, 1, '\x1b[1B'], + [0, -1, '\x1b[1A'], + [1, 1, '\x1b[1C\x1b[1B'], + [-1, 1, '\x1b[1D\x1b[1B'], + [-1, -1, '\x1b[1D\x1b[1A'], + [1, -1, '\x1b[1C\x1b[1A'], +].forEach((set) => { + writable.data = ''; + assert.strictEqual(readline.moveCursor(writable, set[0], set[1]), true); + assert.deepStrictEqual(writable.data, set[2]); + writable.data = ''; + assert.strictEqual( + readline.moveCursor(writable, set[0], set[1], common.mustCall()), + true + ); + assert.deepStrictEqual(writable.data, set[2]); +}); + +// Verify that moveCursor() throws on invalid callback. +assert.throws(() => { + readline.moveCursor(writable, 1, 1, null); +}, /ERR_INVALID_ARG_TYPE/); + +// Verify that moveCursor() does not throw on null or undefined stream. +assert.strictEqual(readline.moveCursor(null, 1, 1), true); +assert.strictEqual(readline.moveCursor(undefined, 1, 1), true); +assert.strictEqual(readline.moveCursor(null, 1, 1, common.mustCall((err) => { + assert.strictEqual(err, null); +})), true); +assert.strictEqual(readline.moveCursor(undefined, 1, 1, common.mustCall()), + true); + +// Undefined or null as stream should not throw. +assert.strictEqual(readline.cursorTo(null), true); +assert.strictEqual(readline.cursorTo(), true); +assert.strictEqual(readline.cursorTo(null, 1, 1, common.mustCall()), true); +assert.strictEqual(readline.cursorTo(undefined, 1, 1, common.mustCall((err) => { + assert.strictEqual(err, null); +})), true); + +writable.data = ''; +assert.strictEqual(readline.cursorTo(writable, 'a'), true); +assert.strictEqual(writable.data, ''); + +writable.data = ''; +assert.strictEqual(readline.cursorTo(writable, 'a', 'b'), true); +assert.strictEqual(writable.data, ''); + +writable.data = ''; +assert.throws( + () => readline.cursorTo(writable, 'a', 1), + { + name: 'TypeError', + code: 'ERR_INVALID_CURSOR_POS', + message: 'Cannot set cursor row without setting its column' + }); +assert.strictEqual(writable.data, ''); + +writable.data = ''; +assert.strictEqual(readline.cursorTo(writable, 1, 'a'), true); +assert.strictEqual(writable.data, '\x1b[2G'); + +writable.data = ''; +assert.strictEqual(readline.cursorTo(writable, 1), true); +assert.strictEqual(writable.data, '\x1b[2G'); + +writable.data = ''; +assert.strictEqual(readline.cursorTo(writable, 1, 2), true); +assert.strictEqual(writable.data, '\x1b[3;2H'); + +writable.data = ''; +assert.strictEqual(readline.cursorTo(writable, 1, 2, common.mustCall()), true); +assert.strictEqual(writable.data, '\x1b[3;2H'); + +writable.data = ''; +assert.strictEqual(readline.cursorTo(writable, 1, common.mustCall()), true); +assert.strictEqual(writable.data, '\x1b[2G'); + +// Verify that cursorTo() throws on invalid callback. +assert.throws(() => { + readline.cursorTo(writable, 1, 1, null); +}, /ERR_INVALID_ARG_TYPE/); + +// Verify that cursorTo() throws if x or y is NaN. +assert.throws(() => { + readline.cursorTo(writable, NaN); +}, /ERR_INVALID_ARG_VALUE/); + +assert.throws(() => { + readline.cursorTo(writable, 1, NaN); +}, /ERR_INVALID_ARG_VALUE/); + +assert.throws(() => { + readline.cursorTo(writable, NaN, NaN); +}, /ERR_INVALID_ARG_VALUE/); diff --git a/tests/node_compat/test/parallel/test-ref-unref-return.js b/tests/node_compat/test/parallel/test-ref-unref-return.js new file mode 100644 index 0000000000..d8f919bf88 --- /dev/null +++ b/tests/node_compat/test/parallel/test-ref-unref-return.js @@ -0,0 +1,19 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const net = require('net'); +const dgram = require('dgram'); + +assert.ok((new net.Server()).ref() instanceof net.Server); +assert.ok((new net.Server()).unref() instanceof net.Server); +assert.ok((new net.Socket()).ref() instanceof net.Socket); +assert.ok((new net.Socket()).unref() instanceof net.Socket); +assert.ok((new dgram.Socket('udp4')).ref() instanceof dgram.Socket); +assert.ok((new dgram.Socket('udp6')).unref() instanceof dgram.Socket); diff --git a/tests/node_compat/test/parallel/test-regression-object-prototype.js b/tests/node_compat/test/parallel/test-regression-object-prototype.js new file mode 100644 index 0000000000..d2b9136048 --- /dev/null +++ b/tests/node_compat/test/parallel/test-regression-object-prototype.js @@ -0,0 +1,35 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +/* eslint-disable node-core/require-common-first, node-core/required-modules */ +'use strict'; + +Object.prototype.xadsadsdasasdxx = function() { +}; + +console.log('puts after'); diff --git a/tests/node_compat/test/parallel/test-require-invalid-package.js b/tests/node_compat/test/parallel/test-require-invalid-package.js new file mode 100644 index 0000000000..7c8b412dcd --- /dev/null +++ b/tests/node_compat/test/parallel/test-require-invalid-package.js @@ -0,0 +1,16 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const assert = require('assert'); + +// Should be an invalid package path. +assert.throws(() => require('package.json'), + { code: 'MODULE_NOT_FOUND' } +); diff --git a/tests/node_compat/test/parallel/test-require-long-path.js b/tests/node_compat/test/parallel/test-require-long-path.js new file mode 100644 index 0000000000..c9329e4626 --- /dev/null +++ b/tests/node_compat/test/parallel/test-require-long-path.js @@ -0,0 +1,35 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +if (!common.isWindows) + common.skip('this test is Windows-specific.'); + +const fs = require('fs'); +const path = require('path'); + +const tmpdir = require('../common/tmpdir'); + +// Make a path that is more than 260 chars long. +const dirNameLen = Math.max(260 - tmpdir.path.length, 1); +const dirName = tmpdir.resolve('x'.repeat(dirNameLen)); +const fullDirPath = path.resolve(dirName); + +const indexFile = path.join(fullDirPath, 'index.js'); +const otherFile = path.join(fullDirPath, 'other.js'); + +tmpdir.refresh(); + +fs.mkdirSync(fullDirPath); +fs.writeFileSync(indexFile, 'require("./other");'); +fs.writeFileSync(otherFile, ''); + +require(indexFile); +require(otherFile); + +tmpdir.refresh(); diff --git a/tests/node_compat/test/parallel/test-require-nul.js b/tests/node_compat/test/parallel/test-require-nul.js new file mode 100644 index 0000000000..b9a77a3004 --- /dev/null +++ b/tests/node_compat/test/parallel/test-require-nul.js @@ -0,0 +1,18 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const assert = require('assert'); + +// Nul bytes should throw, not abort. +/* eslint-disable no-control-regex */ +assert.throws(() => require('\u0000ab'), /Cannot find module '\u0000ab'/); +assert.throws(() => require('a\u0000b'), /Cannot find module 'a\u0000b'/); +assert.throws(() => require('ab\u0000'), /Cannot find module 'ab\u0000'/); +/* eslint-enable no-control-regex */ diff --git a/tests/node_compat/test/parallel/test-require-process.js b/tests/node_compat/test/parallel/test-require-process.js new file mode 100644 index 0000000000..dff056e4f3 --- /dev/null +++ b/tests/node_compat/test/parallel/test-require-process.js @@ -0,0 +1,14 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); + +const nativeProcess = require('process'); +// require('process') should return global process reference +assert.strictEqual(nativeProcess, process); diff --git a/tests/node_compat/test/parallel/test-signal-handler-remove-on-exit.js b/tests/node_compat/test/parallel/test-signal-handler-remove-on-exit.js new file mode 100644 index 0000000000..71ad993e20 --- /dev/null +++ b/tests/node_compat/test/parallel/test-signal-handler-remove-on-exit.js @@ -0,0 +1,16 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); + +// Regression test for https://github.com/nodejs/node/issues/30581 +// This script should not crash. + +function dummy() {} +process.on('SIGINT', dummy); +process.on('exit', () => process.removeListener('SIGINT', dummy)); diff --git a/tests/node_compat/test/parallel/test-signal-handler.js b/tests/node_compat/test/parallel/test-signal-handler.js new file mode 100644 index 0000000000..a4cfad7f4d --- /dev/null +++ b/tests/node_compat/test/parallel/test-signal-handler.js @@ -0,0 +1,63 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +const common = require('../common'); + +if (common.isWindows) + common.skip('SIGUSR1 and SIGHUP signals are not supported'); +if (!common.isMainThread) + common.skip('Signal handling in Workers is not supported'); + +console.log(`process.pid: ${process.pid}`); + +process.on('SIGUSR1', common.mustCall()); + +process.on('SIGUSR1', common.mustCall(function() { + setTimeout(function() { + console.log('End.'); + process.exit(0); + }, 5); +})); + +let i = 0; +setInterval(function() { + console.log(`running process...${++i}`); + + if (i === 5) { + process.kill(process.pid, 'SIGUSR1'); + } +}, 1); + +// Test on condition where a watcher for SIGNAL +// has been previously registered, and `process.listeners(SIGNAL).length === 1` +process.on('SIGHUP', common.mustNotCall()); +process.removeAllListeners('SIGHUP'); +process.on('SIGHUP', common.mustCall()); +process.kill(process.pid, 'SIGHUP'); diff --git a/tests/node_compat/test/parallel/test-socket-address.js b/tests/node_compat/test/parallel/test-socket-address.js new file mode 100644 index 0000000000..7b132402aa --- /dev/null +++ b/tests/node_compat/test/parallel/test-socket-address.js @@ -0,0 +1,24 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +// This tests checks that if server._handle.getsockname +// returns an error number, an error is thrown. + +const server = net.createServer({}); +server.listen(0, common.mustCall(function() { + server._handle.getsockname = function(out) { + return -1; + }; + assert.throws(() => this.address(), + /^Error: address [\w|\s-\d]+$/); + server.close(); +})); diff --git a/tests/node_compat/test/parallel/test-socket-write-after-fin-error.js b/tests/node_compat/test/parallel/test-socket-write-after-fin-error.js new file mode 100644 index 0000000000..525627f434 --- /dev/null +++ b/tests/node_compat/test/parallel/test-socket-write-after-fin-error.js @@ -0,0 +1,69 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); + +// This is similar to simple/test-socket-write-after-fin, except that +// we don't set allowHalfOpen. Then we write after the client has sent +// a FIN, and this is an error. However, the standard "write after end" +// message is too vague, and doesn't actually tell you what happens. + +const net = require('net'); +let serverData = ''; +let gotServerEnd = false; +let clientData = ''; +let gotClientEnd = false; +let gotServerError = false; + +const server = net.createServer(function(sock) { + sock.setEncoding('utf8'); + sock.on('error', function() {}); + + sock.on('data', function(c) { + serverData += c; + }); + sock.on('end', function() { + gotServerEnd = true; + setImmediate(() => { + sock.write(serverData, function(er) { + console.error(`${er.code}: ${er.message}`); + gotServerError = er; + }); + sock.end(); + }); + }); + server.close(); +}); +server.listen(0, function() { + const sock = net.connect(this.address().port); + sock.setEncoding('utf8'); + sock.on('data', function(c) { + clientData += c; + }); + + sock.on('end', function() { + gotClientEnd = true; + }); + + process.on('exit', function() { + assert.strictEqual(clientData, ''); + assert.strictEqual(serverData, 'hello1hello2hello3\nTHUNDERMUSCLE!'); + assert(gotClientEnd); + assert(gotServerEnd); + assert(gotServerError); + assert.strictEqual(gotServerError.code, 'EPIPE'); + assert.notStrictEqual(gotServerError.message, 'write after end'); + console.log('ok'); + }); + + sock.write('hello1'); + sock.write('hello2'); + sock.write('hello3\n'); + sock.end('THUNDERMUSCLE!'); +}); diff --git a/tests/node_compat/test/parallel/test-source-map-enable.js b/tests/node_compat/test/parallel/test-source-map-enable.js new file mode 100644 index 0000000000..b373aadda9 --- /dev/null +++ b/tests/node_compat/test/parallel/test-source-map-enable.js @@ -0,0 +1,388 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +if (!process.features.inspector) return; + +const common = require('../common'); +const assert = require('assert'); +const { dirname } = require('path'); +const fs = require('fs'); +const path = require('path'); +const { spawnSync } = require('child_process'); +const { pathToFileURL } = require('url'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +let dirc = 0; +function nextdir() { + return process.env.NODE_V8_COVERAGE || + tmpdir.resolve(`source_map_${++dirc}`); +} + +// Outputs source maps when event loop is drained, with no async logic. +{ + const coverageDirectory = nextdir(); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/source-map/basic'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + if (output.status !== 0) { + console.log(output.stderr.toString()); + } + assert.strictEqual(output.status, 0); + assert.strictEqual(output.stderr.toString(), ''); + const sourceMap = getSourceMapFromCache('basic.js', coverageDirectory); + assert.strictEqual(sourceMap.url, 'https://ci.nodejs.org/418'); +} + +// Outputs source maps when process.kill(process.pid, "SIGINT"); exits process. +{ + const coverageDirectory = nextdir(); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/source-map/sigint'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + if (!common.isWindows) { + if (output.signal !== 'SIGINT') { + console.log(output.stderr.toString()); + } + assert.strictEqual(output.signal, 'SIGINT'); + } + assert.strictEqual(output.stderr.toString(), ''); + const sourceMap = getSourceMapFromCache('sigint.js', coverageDirectory); + assert.strictEqual(sourceMap.url, 'https://ci.nodejs.org/402'); +} + +// Outputs source maps when source-file calls process.exit(1). +{ + const coverageDirectory = nextdir(); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/source-map/exit-1'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + assert.strictEqual(output.stderr.toString(), ''); + const sourceMap = getSourceMapFromCache('exit-1.js', coverageDirectory); + assert.strictEqual(sourceMap.url, 'https://ci.nodejs.org/404'); +} + +// Outputs source-maps for esm module. +{ + const coverageDirectory = nextdir(); + const output = spawnSync(process.execPath, [ + '--no-warnings', + require.resolve('../fixtures/source-map/esm-basic.mjs'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + assert.strictEqual(output.stderr.toString(), ''); + const sourceMap = getSourceMapFromCache('esm-basic.mjs', coverageDirectory); + assert.strictEqual(sourceMap.url, 'https://ci.nodejs.org/405'); +} + +// Loads source-maps with relative path from .map file on disk. +{ + const coverageDirectory = nextdir(); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/source-map/disk-relative-path'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + assert.strictEqual(output.status, 0); + assert.strictEqual(output.stderr.toString(), ''); + const sourceMap = getSourceMapFromCache( + 'disk-relative-path.js', + coverageDirectory + ); + // Source-map should have been loaded from disk and sources should have been + // rewritten, such that they're absolute paths. + assert.strictEqual( + dirname(pathToFileURL( + require.resolve('../fixtures/source-map/disk-relative-path')).href), + dirname(sourceMap.data.sources[0]) + ); +} + +// Loads source-maps from inline data URL. +{ + const coverageDirectory = nextdir(); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/source-map/inline-base64.js'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + assert.strictEqual(output.status, 0); + assert.strictEqual(output.stderr.toString(), ''); + const sourceMap = getSourceMapFromCache( + 'inline-base64.js', + coverageDirectory + ); + // base64 JSON should have been decoded, and paths to sources should have + // been rewritten such that they're absolute: + assert.strictEqual( + dirname(pathToFileURL( + require.resolve('../fixtures/source-map/inline-base64')).href), + dirname(sourceMap.data.sources[0]) + ); +} + +// base64 encoding error does not crash application. +{ + const coverageDirectory = nextdir(); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/source-map/inline-base64-type-error.js'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + assert.strictEqual(output.status, 0); + assert.strictEqual(output.stderr.toString(), ''); + const sourceMap = getSourceMapFromCache( + 'inline-base64-type-error.js', + coverageDirectory + ); + + assert.strictEqual(sourceMap.data, null); +} + +// JSON error does not crash application. +{ + const coverageDirectory = nextdir(); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/source-map/inline-base64-json-error.js'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + assert.strictEqual(output.status, 0); + assert.strictEqual(output.stderr.toString(), ''); + const sourceMap = getSourceMapFromCache( + 'inline-base64-json-error.js', + coverageDirectory + ); + + assert.strictEqual(sourceMap.data, null); +} + +// Does not apply source-map to stack trace if --experimental-modules +// is not set. +{ + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/source-map/uglify-throw.js'), + ]); + assert.strictEqual( + output.stderr.toString().match(/.*uglify-throw-original\.js:5:9/), + null + ); + assert.strictEqual( + output.stderr.toString().match(/.*uglify-throw-original\.js:9:3/), + null + ); +} + +// Applies source-maps generated by uglifyjs to stack trace. +{ + const output = spawnSync(process.execPath, [ + '--enable-source-maps', + require.resolve('../fixtures/source-map/uglify-throw.js'), + ]); + assert.match( + output.stderr.toString(), + /.*uglify-throw-original\.js:5:9/ + ); + assert.match( + output.stderr.toString(), + /.*uglify-throw-original\.js:9:3/ + ); + assert.match(output.stderr.toString(), /at Hello/); +} + +// Applies source-maps generated by tsc to stack trace. +{ + const output = spawnSync(process.execPath, [ + '--enable-source-maps', + require.resolve('../fixtures/source-map/typescript-throw.js'), + ]); + assert.ok(output.stderr.toString().match(/.*typescript-throw\.ts:18:11/)); + assert.ok(output.stderr.toString().match(/.*typescript-throw\.ts:24:1/)); +} + +// Applies source-maps generated by babel to stack trace. +{ + const output = spawnSync(process.execPath, [ + '--enable-source-maps', + require.resolve('../fixtures/source-map/babel-throw.js'), + ]); + assert.ok( + output.stderr.toString().match(/.*babel-throw-original\.js:18:31/) + ); +} + +// Applies source-maps generated by nyc to stack trace. +{ + const output = spawnSync(process.execPath, [ + '--enable-source-maps', + require.resolve('../fixtures/source-map/istanbul-throw.js'), + ]); + assert.ok( + output.stderr.toString().match(/.*istanbul-throw-original\.js:5:9/) + ); + assert.ok( + output.stderr.toString().match(/.*istanbul-throw-original\.js:9:3/) + ); +} + +// Applies source-maps in esm modules to stack trace. +{ + const output = spawnSync(process.execPath, [ + '--enable-source-maps', + require.resolve('../fixtures/source-map/babel-esm.mjs'), + ]); + assert.ok( + output.stderr.toString().match(/.*babel-esm-original\.mjs:9:29/) + ); +} + +// Does not persist url parameter if source-map has been parsed. +{ + const coverageDirectory = nextdir(); + spawnSync(process.execPath, [ + require.resolve('../fixtures/source-map/inline-base64.js'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + const sourceMap = getSourceMapFromCache( + 'inline-base64.js', + coverageDirectory + ); + assert.strictEqual(sourceMap.url, null); +} + +// Persists line lengths for in-memory representation of source file. +{ + const coverageDirectory = nextdir(); + spawnSync(process.execPath, [ + require.resolve('../fixtures/source-map/istanbul-throw.js'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + const sourceMap = getSourceMapFromCache( + 'istanbul-throw.js', + coverageDirectory + ); + if (common.checkoutEOL === '\r\n') { + assert.deepStrictEqual(sourceMap.lineLengths, [1086, 31, 185, 649, 0]); + } else { + assert.deepStrictEqual(sourceMap.lineLengths, [1085, 30, 184, 648, 0]); + } +} + +// trace.length === 0 . +{ + const output = spawnSync(process.execPath, [ + '--enable-source-maps', + require.resolve('../fixtures/source-map/emptyStackError.js'), + ]); + + assert.ok( + output.stderr.toString().match('emptyStackError') + ); +} + +// Does not attempt to apply path resolution logic to absolute URLs +// with schemes. +// Refs: https://github.com/webpack/webpack/issues/9601 +// Refs: https://sourcemaps.info/spec.html#h.75yo6yoyk7x5 +{ + const output = spawnSync(process.execPath, [ + '--enable-source-maps', + require.resolve('../fixtures/source-map/webpack.js'), + ]); + // Error in original context of source content: + assert.match( + output.stderr.toString(), + /throw new Error\('oh no!'\)\r?\n.*\^/ + ); + // Rewritten stack trace: + assert.match(output.stderr.toString(), /webpack:\/\/\/webpack\.js:14:9/); + assert.match(output.stderr.toString(), /at functionD.*14:9/); + assert.match(output.stderr.toString(), /at functionC.*10:3/); +} + +// Stores and applies source map associated with file that throws while +// being required. +{ + const coverageDirectory = nextdir(); + const output = spawnSync(process.execPath, [ + '--enable-source-maps', + require.resolve('../fixtures/source-map/throw-on-require-entry.js'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + const sourceMap = getSourceMapFromCache( + 'throw-on-require.js', + coverageDirectory + ); + // Rewritten stack trace. + assert.match(output.stderr.toString(), /throw-on-require\.ts:9:9/); + // Source map should have been serialized. + assert.ok(sourceMap); +} + +// Does not throw TypeError when primitive value is thrown. +{ + const coverageDirectory = nextdir(); + const output = spawnSync(process.execPath, [ + '--enable-source-maps', + require.resolve('../fixtures/source-map/throw-string.js'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + const sourceMap = getSourceMapFromCache( + 'throw-string.js', + coverageDirectory + ); + // Original stack trace. + assert.match(output.stderr.toString(), /goodbye/); + // Source map should have been serialized. + assert.ok(sourceMap); +} + +// Does not throw TypeError when exception occurs as result of missing named +// export. +{ + const coverageDirectory = nextdir(); + const output = spawnSync(process.execPath, [ + '--enable-source-maps', + require.resolve('../fixtures/source-map/esm-export-missing.mjs'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + const sourceMap = getSourceMapFromCache( + 'esm-export-missing.mjs', + coverageDirectory + ); + // Module loader error displayed. + assert.match(output.stderr.toString(), + /does not provide an export named 'Something'/); + // Source map should have been serialized. + assert.ok(sourceMap); +} + +// Does not include null for async/await with esm +// Refs: https://github.com/nodejs/node/issues/42417 +{ + const output = spawnSync(process.execPath, [ + '--enable-source-maps', + require.resolve('../fixtures/source-map/throw-async.mjs'), + ]); + // Error in original context of source content: + assert.match( + output.stderr.toString(), + /throw new Error\(message\)\r?\n.*\^/ + ); + // Rewritten stack trace: + assert.match(output.stderr.toString(), /at Throw \([^)]+throw-async\.ts:4:9\)/); +} + +function getSourceMapFromCache(fixtureFile, coverageDirectory) { + const jsonFiles = fs.readdirSync(coverageDirectory); + for (const jsonFile of jsonFiles) { + let maybeSourceMapCache; + try { + maybeSourceMapCache = require( + path.join(coverageDirectory, jsonFile) + )['source-map-cache'] || {}; + } catch (err) { + console.warn(err); + maybeSourceMapCache = {}; + } + const keys = Object.keys(maybeSourceMapCache); + for (const key of keys) { + if (key.includes(fixtureFile)) { + return maybeSourceMapCache[key]; + } + } + } +} diff --git a/tests/node_compat/test/parallel/test-spawn-cmd-named-pipe.js b/tests/node_compat/test/parallel/test-spawn-cmd-named-pipe.js new file mode 100644 index 0000000000..47b012a9ca --- /dev/null +++ b/tests/node_compat/test/parallel/test-spawn-cmd-named-pipe.js @@ -0,0 +1,57 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +// This test is intended for Windows only +if (!common.isWindows) + common.skip('this test is Windows-specific.'); + +const assert = require('assert'); + +if (!process.argv[2]) { + // parent + const net = require('net'); + const spawn = require('child_process').spawn; + const path = require('path'); + + const pipeNamePrefix = `${path.basename(__filename)}.${process.pid}`; + const stdinPipeName = `\\\\.\\pipe\\${pipeNamePrefix}.stdin`; + const stdoutPipeName = `\\\\.\\pipe\\${pipeNamePrefix}.stdout`; + + const stdinPipeServer = net.createServer(function(c) { + c.on('end', common.mustCall()); + c.end('hello'); + }); + stdinPipeServer.listen(stdinPipeName); + + const output = []; + + const stdoutPipeServer = net.createServer(function(c) { + c.on('data', function(x) { + output.push(x); + }); + c.on('end', common.mustCall(function() { + assert.strictEqual(output.join(''), 'hello'); + })); + }); + stdoutPipeServer.listen(stdoutPipeName); + + const args = + [`"${__filename}"`, 'child', '<', stdinPipeName, '>', stdoutPipeName]; + + const child = spawn(`"${process.execPath}"`, args, { shell: true }); + + child.on('exit', common.mustCall(function(exitCode) { + stdinPipeServer.close(); + stdoutPipeServer.close(); + assert.strictEqual(exitCode, 0); + })); +} else { + // child + process.stdin.pipe(process.stdout); +} diff --git a/tests/node_compat/test/parallel/test-stdin-hang.js b/tests/node_compat/test/parallel/test-stdin-hang.js new file mode 100644 index 0000000000..26e98abe03 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stdin-hang.js @@ -0,0 +1,39 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); + +// This test *only* verifies that invoking the stdin getter does not +// cause node to hang indefinitely. +// If it does, then the test-runner will nuke it. + +// invoke the getter. +process.stdin; // eslint-disable-line no-unused-expressions + +console.error('Should exit normally now.'); diff --git a/tests/node_compat/test/parallel/test-stdin-pipe-large.js b/tests/node_compat/test/parallel/test-stdin-pipe-large.js new file mode 100644 index 0000000000..cdc4e9ff05 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stdin-pipe-large.js @@ -0,0 +1,30 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +// See https://github.com/nodejs/node/issues/5927 + +const common = require('../common'); +const assert = require('assert'); +const spawn = require('child_process').spawn; + +if (process.argv[2] === 'child') { + process.stdin.pipe(process.stdout); + return; +} + +const child = spawn(process.execPath, [__filename, 'child'], { stdio: 'pipe' }); + +const expectedBytes = 1024 * 1024; +let readBytes = 0; + +child.stdin.end(Buffer.alloc(expectedBytes)); + +child.stdout.on('data', (chunk) => readBytes += chunk.length); +child.stdout.on('end', common.mustCall(() => { + assert.strictEqual(readBytes, expectedBytes); +})); diff --git a/tests/node_compat/test/parallel/test-stdin-pipe-resume.js b/tests/node_compat/test/parallel/test-stdin-pipe-resume.js new file mode 100644 index 0000000000..52054d2dda --- /dev/null +++ b/tests/node_compat/test/parallel/test-stdin-pipe-resume.js @@ -0,0 +1,34 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +// This tests that piping stdin will cause it to resume() as well. +require('../common'); +const assert = require('assert'); + +if (process.argv[2] === 'child') { + process.stdin.pipe(process.stdout); +} else { + const spawn = require('child_process').spawn; + const buffers = []; + const child = spawn(process.execPath, [__filename, 'child']); + child.stdout.on('data', function(c) { + buffers.push(c); + }); + child.stdout.on('close', function() { + const b = Buffer.concat(buffers).toString(); + assert.strictEqual(b, 'Hello, world\n'); + console.log('ok'); + }); + child.stdin.write('Hel'); + child.stdin.write('lo,'); + child.stdin.write(' wo'); + setTimeout(function() { + child.stdin.write('rld\n'); + child.stdin.end(); + }, 10); +} diff --git a/tests/node_compat/test/parallel/test-stdin-script-child-option.js b/tests/node_compat/test/parallel/test-stdin-script-child-option.js new file mode 100644 index 0000000000..1d4cd00e1e --- /dev/null +++ b/tests/node_compat/test/parallel/test-stdin-script-child-option.js @@ -0,0 +1,24 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +const expected = '--option-to-be-seen-on-child'; + +const { spawn } = require('child_process'); +const child = spawn(process.execPath, ['-', expected], { stdio: 'pipe' }); + +child.stdin.end('console.log(process.argv[2])'); + +let actual = ''; +child.stdout.setEncoding('utf8'); +child.stdout.on('data', (chunk) => actual += chunk); +child.stdout.on('end', common.mustCall(() => { + assert.strictEqual(actual.trim(), expected); +})); diff --git a/tests/node_compat/test/parallel/test-stdio-pipe-access.js b/tests/node_compat/test/parallel/test-stdio-pipe-access.js new file mode 100644 index 0000000000..ab1db54cca --- /dev/null +++ b/tests/node_compat/test/parallel/test-stdio-pipe-access.js @@ -0,0 +1,45 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +if (!common.isMainThread) + common.skip("Workers don't have process-like stdio"); + +// Test if Node handles accessing process.stdin if it is a redirected +// pipe without deadlocking +const { spawn, spawnSync } = require('child_process'); + +const numTries = 5; +const who = process.argv.length <= 2 ? 'runner' : process.argv[2]; + +switch (who) { + case 'runner': + for (let num = 0; num < numTries; ++num) { + spawnSync(process.argv0, + [process.argv[1], 'parent'], + { 'stdio': 'inherit' }); + } + break; + case 'parent': { + const middle = spawn(process.argv0, + [process.argv[1], 'middle'], + { 'stdio': 'pipe' }); + middle.stdout.on('data', () => {}); + break; + } + case 'middle': + spawn(process.argv0, + [process.argv[1], 'bottom'], + { 'stdio': [ process.stdin, + process.stdout, + process.stderr ] }); + break; + case 'bottom': + process.stdin; // eslint-disable-line no-unused-expressions + break; +} diff --git a/tests/node_compat/test/parallel/test-stdio-pipe-redirect.js b/tests/node_compat/test/parallel/test-stdio-pipe-redirect.js new file mode 100644 index 0000000000..d2d51f7a69 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stdio-pipe-redirect.js @@ -0,0 +1,49 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +if (!common.isMainThread) + common.skip("Workers don't have process-like stdio"); + +// Test if Node handles redirecting one child process stdout to another +// process stdin without crashing. +const spawn = require('child_process').spawn; + +const writeSize = 100; +const totalDots = 10000; + +const who = process.argv.length <= 2 ? 'parent' : process.argv[2]; + +switch (who) { + case 'parent': { + const consumer = spawn(process.argv0, [process.argv[1], 'consumer'], { + stdio: ['pipe', 'ignore', 'inherit'], + }); + const producer = spawn(process.argv0, [process.argv[1], 'producer'], { + stdio: ['pipe', consumer.stdin, 'inherit'], + }); + process.stdin.on('data', () => {}); + producer.on('exit', process.exit); + break; + } + case 'producer': { + const buffer = Buffer.alloc(writeSize, '.'); + let written = 0; + const write = () => { + if (written < totalDots) { + written += writeSize; + process.stdout.write(buffer, write); + } + }; + write(); + break; + } + case 'consumer': + process.stdin.on('data', () => {}); + break; +} diff --git a/tests/node_compat/test/parallel/test-stdio-pipe-stderr.js b/tests/node_compat/test/parallel/test-stdio-pipe-stderr.js new file mode 100644 index 0000000000..d8242a916e --- /dev/null +++ b/tests/node_compat/test/parallel/test-stdio-pipe-stderr.js @@ -0,0 +1,43 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const tmpdir = require('../common/tmpdir'); +const assert = require('assert'); +const fs = require('fs'); +const { spawnSync } = require('child_process'); + +// Test that invoking node with require, and piping stderr to file, +// does not result in exception, +// see: https://github.com/nodejs/node/issues/11257 + +tmpdir.refresh(); +const fakeModulePath = tmpdir.resolve('batman.js'); +const stderrOutputPath = tmpdir.resolve('stderr-output.txt'); +// We need to redirect stderr to a file to produce #11257 +const stream = fs.createWriteStream(stderrOutputPath); + +// The error described in #11257 only happens when we require a +// non-built-in module. +fs.writeFileSync(fakeModulePath, '', 'utf8'); + +stream.on('open', () => { + spawnSync(process.execPath, { + input: `require(${JSON.stringify(fakeModulePath)})`, + stdio: ['pipe', 'pipe', stream] + }); + const stderr = fs.readFileSync(stderrOutputPath, 'utf8').trim(); + assert.strictEqual( + stderr, + '', + `piping stderr to file should not result in exception: ${stderr}` + ); + stream.end(); + fs.unlinkSync(stderrOutputPath); + fs.unlinkSync(fakeModulePath); +}); diff --git a/tests/node_compat/test/parallel/test-stdio-undestroy.js b/tests/node_compat/test/parallel/test-stdio-undestroy.js new file mode 100644 index 0000000000..f10ec0726d --- /dev/null +++ b/tests/node_compat/test/parallel/test-stdio-undestroy.js @@ -0,0 +1,43 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const spawn = require('child_process').spawn; + +if (process.argv[2] === 'child') { + process.stdout.destroy(); + process.stderr.destroy(); + console.log('stdout'); + process.stdout.write('rocks\n'); + console.error('stderr'); + setTimeout(function() { + process.stderr.write('rocks too\n'); + }, 10); + return; +} + +const proc = spawn(process.execPath, [__filename, 'child'], { stdio: 'pipe' }); + +let stdout = ''; +proc.stdout.setEncoding('utf8'); +proc.stdout.on('data', common.mustCallAtLeast(function(chunk) { + stdout += chunk; +}, 1)); + +let stderr = ''; +proc.stderr.setEncoding('utf8'); +proc.stderr.on('data', common.mustCallAtLeast(function(chunk) { + stderr += chunk; +}, 1)); + +proc.on('exit', common.mustCall(function(exitCode) { + assert.strictEqual(exitCode, 0); + assert.strictEqual(stdout, 'stdout\nrocks\n'); + assert.strictEqual(stderr, 'stderr\nrocks too\n'); +})); diff --git a/tests/node_compat/test/parallel/test-stdout-cannot-be-closed-child-process-pipe.js b/tests/node_compat/test/parallel/test-stdout-cannot-be-closed-child-process-pipe.js new file mode 100644 index 0000000000..91dfd44cf6 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stdout-cannot-be-closed-child-process-pipe.js @@ -0,0 +1,39 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); + +if (process.argv[2] === 'child') + process.stdout.end('foo'); +else + parent(); + +function parent() { + const spawn = require('child_process').spawn; + const child = spawn(process.execPath, [__filename, 'child']); + let out = ''; + let err = ''; + + child.stdout.setEncoding('utf8'); + child.stderr.setEncoding('utf8'); + + child.stdout.on('data', function(c) { + out += c; + }); + child.stderr.on('data', function(c) { + err += c; + }); + + child.on('close', function(code, signal) { + assert.strictEqual(code, 0); + assert.strictEqual(err, ''); + assert.strictEqual(out, 'foo'); + console.log('ok'); + }); +} diff --git a/tests/node_compat/test/parallel/test-stdout-pipeline-destroy.js b/tests/node_compat/test/parallel/test-stdout-pipeline-destroy.js new file mode 100644 index 0000000000..196f4a96e7 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stdout-pipeline-destroy.js @@ -0,0 +1,38 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { Transform, Readable, pipeline } = require('stream'); +const assert = require('assert'); + +const reader = new Readable({ + read(size) { this.push('foo'); } +}); + +let count = 0; + +const err = new Error('this-error-gets-hidden'); + +const transform = new Transform({ + transform(chunk, enc, cb) { + if (count++ >= 5) + this.emit('error', err); + else + cb(null, count.toString() + '\n'); + } +}); + +pipeline( + reader, + transform, + process.stdout, + common.mustCall((e) => { + assert.strictEqual(e, err); + }) +); diff --git a/tests/node_compat/test/parallel/test-stdout-stderr-reading.js b/tests/node_compat/test/parallel/test-stdout-stderr-reading.js new file mode 100644 index 0000000000..25eb25b7b0 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stdout-stderr-reading.js @@ -0,0 +1,74 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +// Verify that stdout is never read from. +const net = require('net'); +const read = net.Socket.prototype.read; + +net.Socket.prototype.read = function() { + if (this.fd === 1) + throw new Error('reading from stdout!'); + if (this.fd === 2) + throw new Error('reading from stderr!'); + return read.apply(this, arguments); +}; + +if (process.argv[2] === 'child') + child(); +else + parent(); + +function parent() { + const spawn = require('child_process').spawn; + const node = process.execPath; + + const c1 = spawn(node, [__filename, 'child']); + let c1out = ''; + c1.stdout.setEncoding('utf8'); + c1.stdout.on('data', function(chunk) { + c1out += chunk; + }); + c1.stderr.setEncoding('utf8'); + c1.stderr.on('data', function(chunk) { + console.error(`c1err: ${chunk.split('\n').join('\nc1err: ')}`); + }); + c1.on('close', common.mustCall(function(code, signal) { + assert(!code); + assert(!signal); + assert.strictEqual(c1out, 'ok\n'); + console.log('ok'); + })); + + const c2 = spawn(node, ['-e', 'console.log("ok")']); + let c2out = ''; + c2.stdout.setEncoding('utf8'); + c2.stdout.on('data', function(chunk) { + c2out += chunk; + }); + c1.stderr.setEncoding('utf8'); + c1.stderr.on('data', function(chunk) { + console.error(`c1err: ${chunk.split('\n').join('\nc1err: ')}`); + }); + c2.on('close', common.mustCall(function(code, signal) { + assert(!code); + assert(!signal); + assert.strictEqual(c2out, 'ok\n'); + console.log('ok'); + })); +} + +function child() { + // Should not be reading *ever* in here. + net.Socket.prototype.read = function() { + throw new Error('no reading allowed in child'); + }; + console.log('ok'); +} diff --git a/tests/node_compat/test/parallel/test-stdout-stderr-write.js b/tests/node_compat/test/parallel/test-stdout-stderr-write.js new file mode 100644 index 0000000000..afce78d19f --- /dev/null +++ b/tests/node_compat/test/parallel/test-stdout-stderr-write.js @@ -0,0 +1,15 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const assert = require('assert'); + +// https://github.com/nodejs/node/pull/39246 +assert.strictEqual(process.stderr.write('asd'), true); +assert.strictEqual(process.stdout.write('asd'), true); diff --git a/tests/node_compat/test/parallel/test-stream-catch-rejections.js b/tests/node_compat/test/parallel/test-stream-catch-rejections.js new file mode 100644 index 0000000000..909f031b27 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-catch-rejections.js @@ -0,0 +1,58 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const stream = require('stream'); +const assert = require('assert'); + +{ + const r = new stream.Readable({ + captureRejections: true, + read() { + } + }); + r.push('hello'); + r.push('world'); + + const err = new Error('kaboom'); + + r.on('error', common.mustCall((_err) => { + assert.strictEqual(err, _err); + assert.strictEqual(r.destroyed, true); + })); + + r.on('data', async () => { + throw err; + }); +} + +{ + const w = new stream.Writable({ + captureRejections: true, + highWaterMark: 1, + write(chunk, enc, cb) { + process.nextTick(cb); + } + }); + + const err = new Error('kaboom'); + + w.write('hello', () => { + w.write('world'); + }); + + w.on('error', common.mustCall((_err) => { + assert.strictEqual(err, _err); + assert.strictEqual(w.destroyed, true); + })); + + w.on('drain', common.mustCall(async () => { + throw err; + }, 2)); +} diff --git a/tests/node_compat/test/parallel/test-stream-decoder-objectmode.js b/tests/node_compat/test/parallel/test-stream-decoder-objectmode.js new file mode 100644 index 0000000000..816f35a3fa --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-decoder-objectmode.js @@ -0,0 +1,27 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const stream = require('stream'); +const assert = require('assert'); + +const readable = new stream.Readable({ + read: () => {}, + encoding: 'utf16le', + objectMode: true +}); + +readable.push(Buffer.from('abc', 'utf16le')); +readable.push(Buffer.from('def', 'utf16le')); +readable.push(null); + +// Without object mode, these would be concatenated into a single chunk. +assert.strictEqual(readable.read(), 'abc'); +assert.strictEqual(readable.read(), 'def'); +assert.strictEqual(readable.read(), null); diff --git a/tests/node_compat/test/parallel/test-stream-duplex-readable-writable.js b/tests/node_compat/test/parallel/test-stream-duplex-readable-writable.js new file mode 100644 index 0000000000..82dfb54afb --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-duplex-readable-writable.js @@ -0,0 +1,53 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { Duplex } = require('stream'); +const assert = require('assert'); + +{ + const duplex = new Duplex({ + readable: false + }); + assert.strictEqual(duplex.readable, false); + duplex.push('asd'); + duplex.on('error', common.mustCall((err) => { + assert.strictEqual(err.code, 'ERR_STREAM_PUSH_AFTER_EOF'); + })); + duplex.on('data', common.mustNotCall()); + duplex.on('end', common.mustNotCall()); +} + +{ + const duplex = new Duplex({ + writable: false, + write: common.mustNotCall() + }); + assert.strictEqual(duplex.writable, false); + duplex.write('asd'); + duplex.on('error', common.mustCall((err) => { + assert.strictEqual(err.code, 'ERR_STREAM_WRITE_AFTER_END'); + })); + duplex.on('finish', common.mustNotCall()); +} + +{ + const duplex = new Duplex({ + readable: false + }); + assert.strictEqual(duplex.readable, false); + duplex.on('data', common.mustNotCall()); + duplex.on('end', common.mustNotCall()); + async function run() { + for await (const chunk of duplex) { + assert(false, chunk); + } + } + run().then(common.mustCall()); +} diff --git a/tests/node_compat/test/parallel/test-stream-end-of-streams.js b/tests/node_compat/test/parallel/test-stream-end-of-streams.js new file mode 100644 index 0000000000..3ac78238ce --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-end-of-streams.js @@ -0,0 +1,27 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); + +const { Duplex, finished } = require('stream'); + +assert.throws( + () => { + // Passing empty object to mock invalid stream + // should throw error + finished({}, () => {}); + }, + { code: 'ERR_INVALID_ARG_TYPE' } +); + +const streamObj = new Duplex(); +streamObj.end(); +// Below code should not throw any errors as the +// streamObj is `Stream` +finished(streamObj, () => {}); diff --git a/tests/node_compat/test/parallel/test-stream-filter.js b/tests/node_compat/test/parallel/test-stream-filter.js new file mode 100644 index 0000000000..7043365ce9 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-filter.js @@ -0,0 +1,183 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { + Readable, +} = require('stream'); +const assert = require('assert'); +const { once } = require('events'); +const { setTimeout } = require('timers/promises'); + +{ + // Filter works on synchronous streams with a synchronous predicate + const stream = Readable.from([1, 2, 3, 4, 5]).filter((x) => x < 3); + const result = [1, 2]; + (async () => { + for await (const item of stream) { + assert.strictEqual(item, result.shift()); + } + })().then(common.mustCall()); +} + +{ + // Filter works on synchronous streams with an asynchronous predicate + const stream = Readable.from([1, 2, 3, 4, 5]).filter(async (x) => { + await Promise.resolve(); + return x > 3; + }); + const result = [4, 5]; + (async () => { + for await (const item of stream) { + assert.strictEqual(item, result.shift()); + } + })().then(common.mustCall()); +} + +{ + // Map works on asynchronous streams with a asynchronous mapper + const stream = Readable.from([1, 2, 3, 4, 5]).map(async (x) => { + await Promise.resolve(); + return x + x; + }).filter((x) => x > 5); + const result = [6, 8, 10]; + (async () => { + for await (const item of stream) { + assert.strictEqual(item, result.shift()); + } + })().then(common.mustCall()); +} + +{ + // Filter works on an infinite stream + const stream = Readable.from(async function* () { + while (true) yield 1; + }()).filter(common.mustCall(async (x) => { + return x < 3; + }, 5)); + (async () => { + let i = 1; + for await (const item of stream) { + assert.strictEqual(item, 1); + if (++i === 5) break; + } + })().then(common.mustCall()); +} + +{ + // Filter works on constructor created streams + let i = 0; + const stream = new Readable({ + read() { + if (i === 10) { + this.push(null); + return; + } + this.push(Uint8Array.from([i])); + i++; + }, + highWaterMark: 0, + }).filter(common.mustCall(async ([x]) => { + return x !== 5; + }, 10)); + (async () => { + const result = (await stream.toArray()).map((x) => x[0]); + const expected = [...Array(10).keys()].filter((x) => x !== 5); + assert.deepStrictEqual(result, expected); + })().then(common.mustCall()); +} + +{ + // Throwing an error during `filter` (sync) + const stream = Readable.from([1, 2, 3, 4, 5]).filter((x) => { + if (x === 3) { + throw new Error('boom'); + } + return true; + }); + assert.rejects( + stream.map((x) => x + x).toArray(), + /boom/, + ).then(common.mustCall()); +} + +{ + // Throwing an error during `filter` (async) + const stream = Readable.from([1, 2, 3, 4, 5]).filter(async (x) => { + if (x === 3) { + throw new Error('boom'); + } + return true; + }); + assert.rejects( + stream.filter(() => true).toArray(), + /boom/, + ).then(common.mustCall()); +} + +{ + // Concurrency + AbortSignal + const ac = new AbortController(); + let calls = 0; + const stream = Readable.from([1, 2, 3, 4]).filter(async (_, { signal }) => { + calls++; + await once(signal, 'abort'); + }, { signal: ac.signal, concurrency: 2 }); + // pump + assert.rejects(async () => { + for await (const item of stream) { + // nope + console.log(item); + } + }, { + name: 'AbortError', + }).then(common.mustCall()); + + setImmediate(() => { + ac.abort(); + assert.strictEqual(calls, 2); + }); +} + +{ + // Concurrency result order + const stream = Readable.from([1, 2]).filter(async (item, { signal }) => { + await setTimeout(10 - item, { signal }); + return true; + }, { concurrency: 2 }); + + (async () => { + const expected = [1, 2]; + for await (const item of stream) { + assert.strictEqual(item, expected.shift()); + } + })().then(common.mustCall()); +} + +{ + // Error cases + assert.throws(() => Readable.from([1]).filter(1), /ERR_INVALID_ARG_TYPE/); + assert.throws(() => Readable.from([1]).filter((x) => x, { + concurrency: 'Foo' + }), /ERR_OUT_OF_RANGE/); + assert.throws(() => Readable.from([1]).filter((x) => x, 1), /ERR_INVALID_ARG_TYPE/); +} +{ + // Test result is a Readable + const stream = Readable.from([1, 2, 3, 4, 5]).filter((x) => true); + assert.strictEqual(stream.readable, true); +} +{ + const stream = Readable.from([1, 2, 3, 4, 5]); + Object.defineProperty(stream, 'map', { + value: common.mustNotCall(), + }); + // Check that map isn't getting called. + stream.filter(() => true); +} diff --git a/tests/node_compat/test/parallel/test-stream-flatMap.js b/tests/node_compat/test/parallel/test-stream-flatMap.js new file mode 100644 index 0000000000..7575f90d65 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-flatMap.js @@ -0,0 +1,138 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const fixtures = require('../common/fixtures'); +const { + Readable, +} = require('stream'); +const assert = require('assert'); +const { setTimeout } = require('timers/promises'); +const { createReadStream } = require('fs'); + +function oneTo5() { + return Readable.from([1, 2, 3, 4, 5]); +} + +{ + // flatMap works on synchronous streams with a synchronous mapper + (async () => { + assert.deepStrictEqual( + await oneTo5().flatMap((x) => [x + x]).toArray(), + [2, 4, 6, 8, 10] + ); + assert.deepStrictEqual( + await oneTo5().flatMap(() => []).toArray(), + [] + ); + assert.deepStrictEqual( + await oneTo5().flatMap((x) => [x, x]).toArray(), + [1, 1, 2, 2, 3, 3, 4, 4, 5, 5] + ); + })().then(common.mustCall()); +} + + +{ + // flatMap works on sync/async streams with an asynchronous mapper + (async () => { + assert.deepStrictEqual( + await oneTo5().flatMap(async (x) => [x, x]).toArray(), + [1, 1, 2, 2, 3, 3, 4, 4, 5, 5] + ); + const asyncOneTo5 = oneTo5().map(async (x) => x); + assert.deepStrictEqual( + await asyncOneTo5.flatMap(async (x) => [x, x]).toArray(), + [1, 1, 2, 2, 3, 3, 4, 4, 5, 5] + ); + })().then(common.mustCall()); +} +{ + // flatMap works on a stream where mapping returns a stream + (async () => { + const result = await oneTo5().flatMap(async (x) => { + return Readable.from([x, x]); + }).toArray(); + assert.deepStrictEqual(result, [1, 1, 2, 2, 3, 3, 4, 4, 5, 5]); + })().then(common.mustCall()); + // flatMap works on an objectMode stream where mappign returns a stream + (async () => { + const result = await oneTo5().flatMap(() => { + return createReadStream(fixtures.path('x.txt')); + }).toArray(); + // The resultant stream is in object mode so toArray shouldn't flatten + assert.strictEqual(result.length, 5); + assert.deepStrictEqual( + Buffer.concat(result).toString(), + 'xyz\n'.repeat(5) + ); + + })().then(common.mustCall()); + +} + +{ + // Concurrency + AbortSignal + const ac = new AbortController(); + const stream = oneTo5().flatMap(common.mustNotCall(async (_, { signal }) => { + await setTimeout(100, { signal }); + }), { signal: ac.signal, concurrency: 2 }); + // pump + assert.rejects(async () => { + for await (const item of stream) { + // nope + console.log(item); + } + }, { + name: 'AbortError', + }).then(common.mustCall()); + + queueMicrotask(() => { + ac.abort(); + }); +} + +{ + // Already aborted AbortSignal + const stream = oneTo5().flatMap(common.mustNotCall(async (_, { signal }) => { + await setTimeout(100, { signal }); + }), { signal: AbortSignal.abort() }); + // pump + assert.rejects(async () => { + for await (const item of stream) { + // nope + console.log(item); + } + }, { + name: 'AbortError', + }).then(common.mustCall()); +} + +{ + // Error cases + assert.throws(() => Readable.from([1]).flatMap(1), /ERR_INVALID_ARG_TYPE/); + assert.throws(() => Readable.from([1]).flatMap((x) => x, { + concurrency: 'Foo' + }), /ERR_OUT_OF_RANGE/); + assert.throws(() => Readable.from([1]).flatMap((x) => x, 1), /ERR_INVALID_ARG_TYPE/); + assert.throws(() => Readable.from([1]).flatMap((x) => x, { signal: true }), /ERR_INVALID_ARG_TYPE/); +} +{ + // Test result is a Readable + const stream = oneTo5().flatMap((x) => x); + assert.strictEqual(stream.readable, true); +} +{ + const stream = oneTo5(); + Object.defineProperty(stream, 'map', { + value: common.mustNotCall(), + }); + // Check that map isn't getting called. + stream.flatMap(() => true); +} diff --git a/tests/node_compat/test/parallel/test-stream-forEach.js b/tests/node_compat/test/parallel/test-stream-forEach.js new file mode 100644 index 0000000000..748193e1ba --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-forEach.js @@ -0,0 +1,146 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { + Readable, +} = require('stream'); +const assert = require('assert'); +const { once } = require('events'); + +{ + // forEach works on synchronous streams with a synchronous predicate + const stream = Readable.from([1, 2, 3]); + const result = [1, 2, 3]; + (async () => { + await stream.forEach((value) => assert.strictEqual(value, result.shift())); + })().then(common.mustCall()); +} + +{ + // forEach works an asynchronous streams + const stream = Readable.from([1, 2, 3]).filter(async (x) => { + await Promise.resolve(); + return true; + }); + const result = [1, 2, 3]; + (async () => { + await stream.forEach((value) => assert.strictEqual(value, result.shift())); + })().then(common.mustCall()); +} + +{ + // forEach works on asynchronous streams with a asynchronous forEach fn + const stream = Readable.from([1, 2, 3]).filter(async (x) => { + await Promise.resolve(); + return true; + }); + const result = [1, 2, 3]; + (async () => { + await stream.forEach(async (value) => { + await Promise.resolve(); + assert.strictEqual(value, result.shift()); + }); + })().then(common.mustCall()); +} + +{ + // forEach works on an infinite stream + const ac = new AbortController(); + const { signal } = ac; + const stream = Readable.from(async function* () { + while (true) yield 1; + }(), { signal }); + let i = 0; + assert.rejects(stream.forEach(common.mustCall((x) => { + i++; + if (i === 10) ac.abort(); + assert.strictEqual(x, 1); + }, 10)), { name: 'AbortError' }).then(common.mustCall()); +} + +{ + // Emitting an error during `forEach` + const stream = Readable.from([1, 2, 3, 4, 5]); + assert.rejects(stream.forEach(async (x) => { + if (x === 3) { + stream.emit('error', new Error('boom')); + } + }), /boom/).then(common.mustCall()); +} + +{ + // Throwing an error during `forEach` (sync) + const stream = Readable.from([1, 2, 3, 4, 5]); + assert.rejects(stream.forEach((x) => { + if (x === 3) { + throw new Error('boom'); + } + }), /boom/).then(common.mustCall()); +} + +{ + // Throwing an error during `forEach` (async) + const stream = Readable.from([1, 2, 3, 4, 5]); + assert.rejects(stream.forEach(async (x) => { + if (x === 3) { + return Promise.reject(new Error('boom')); + } + }), /boom/).then(common.mustCall()); +} + +{ + // Concurrency + AbortSignal + const ac = new AbortController(); + let calls = 0; + const forEachPromise = + Readable.from([1, 2, 3, 4]).forEach(async (_, { signal }) => { + calls++; + await once(signal, 'abort'); + }, { signal: ac.signal, concurrency: 2, highWaterMark: 0 }); + // pump + assert.rejects(async () => { + await forEachPromise; + }, { + name: 'AbortError', + }).then(common.mustCall()); + + setImmediate(() => { + ac.abort(); + assert.strictEqual(calls, 2); + }); +} + +{ + // Error cases + assert.rejects(async () => { + await Readable.from([1]).forEach(1); + }, /ERR_INVALID_ARG_TYPE/).then(common.mustCall()); + assert.rejects(async () => { + await Readable.from([1]).forEach((x) => x, { + concurrency: 'Foo' + }); + }, /ERR_OUT_OF_RANGE/).then(common.mustCall()); + assert.rejects(async () => { + await Readable.from([1]).forEach((x) => x, 1); + }, /ERR_INVALID_ARG_TYPE/).then(common.mustCall()); +} +{ + // Test result is a Promise + const stream = Readable.from([1, 2, 3, 4, 5]).forEach((_) => true); + assert.strictEqual(typeof stream.then, 'function'); +} +{ + const stream = Readable.from([1, 2, 3, 4, 5]); + Object.defineProperty(stream, 'map', { + value: common.mustNotCall(), + }); + // Check that map isn't getting called. + stream.forEach(() => true); +} diff --git a/tests/node_compat/test/parallel/test-stream-passthrough-drain.js b/tests/node_compat/test/parallel/test-stream-passthrough-drain.js new file mode 100644 index 0000000000..7e4cddc289 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-passthrough-drain.js @@ -0,0 +1,17 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const { PassThrough } = require('stream'); + +const pt = new PassThrough({ highWaterMark: 0 }); +pt.on('drain', common.mustCall()); +assert(!pt.write('hello1')); +pt.read(); +pt.read(); diff --git a/tests/node_compat/test/parallel/test-stream-pipe-error-unhandled.js b/tests/node_compat/test/parallel/test-stream-pipe-error-unhandled.js new file mode 100644 index 0000000000..f4e9f3b4c7 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-pipe-error-unhandled.js @@ -0,0 +1,28 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const { Readable, Writable } = require('stream'); + +process.on('uncaughtException', common.mustCall((err) => { + assert.strictEqual(err.message, 'asd'); +})); + +const r = new Readable({ + read() { + this.push('asd'); + } +}); +const w = new Writable({ + autoDestroy: true, + write() {} +}); + +r.pipe(w); +w.destroy(new Error('asd')); diff --git a/tests/node_compat/test/parallel/test-stream-pipeline-duplex.js b/tests/node_compat/test/parallel/test-stream-pipeline-duplex.js new file mode 100644 index 0000000000..b2c0258fc9 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-pipeline-duplex.js @@ -0,0 +1,28 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { pipeline, Duplex, PassThrough } = require('stream'); +const assert = require('assert'); + +const remote = new PassThrough(); +const local = new Duplex({ + read() {}, + write(chunk, enc, callback) { + callback(); + } +}); + +pipeline(remote, local, remote, common.mustCall((err) => { + assert.strictEqual(err.code, 'ERR_STREAM_PREMATURE_CLOSE'); +})); + +setImmediate(() => { + remote.end(); +}); diff --git a/tests/node_compat/test/parallel/test-stream-pipeline-listeners.js b/tests/node_compat/test/parallel/test-stream-pipeline-listeners.js new file mode 100644 index 0000000000..09ccc7ea47 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-pipeline-listeners.js @@ -0,0 +1,83 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { pipeline, Duplex, PassThrough, Writable } = require('stream'); +const assert = require('assert'); + +process.on('uncaughtException', common.mustCall((err) => { + assert.strictEqual(err.message, 'no way'); +}, 2)); + +// Ensure that listeners is removed if last stream is readable +// And other stream's listeners unchanged +const a = new PassThrough(); +a.end('foobar'); +const b = new Duplex({ + write(chunk, encoding, callback) { + callback(); + } +}); +pipeline(a, b, common.mustCall((error) => { + if (error) { + assert.ifError(error); + } + + assert(a.listenerCount('error') > 0); + assert.strictEqual(b.listenerCount('error'), 0); + setTimeout(() => { + assert.strictEqual(b.listenerCount('error'), 0); + b.destroy(new Error('no way')); + }, 100); +})); + +// Async generators +const c = new PassThrough(); +c.end('foobar'); +const d = pipeline( + c, + async function* (source) { + for await (const chunk of source) { + yield String(chunk).toUpperCase(); + } + }, + common.mustCall((error) => { + if (error) { + assert.ifError(error); + } + + assert(c.listenerCount('error') > 0); + assert.strictEqual(d.listenerCount('error'), 0); + setTimeout(() => { + assert.strictEqual(b.listenerCount('error'), 0); + d.destroy(new Error('no way')); + }, 100); + }) +); + +// If last stream is not readable, will not throw and remove listeners +const e = new PassThrough(); +e.end('foobar'); +const f = new Writable({ + write(chunk, encoding, callback) { + callback(); + } +}); +pipeline(e, f, common.mustCall((error) => { + if (error) { + assert.ifError(error); + } + + assert(e.listenerCount('error') > 0); + assert(f.listenerCount('error') > 0); + setTimeout(() => { + assert(f.listenerCount('error') > 0); + f.destroy(new Error('no way')); + }, 100); +})); diff --git a/tests/node_compat/test/parallel/test-stream-pipeline-uncaught.js b/tests/node_compat/test/parallel/test-stream-pipeline-uncaught.js new file mode 100644 index 0000000000..77c409c967 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-pipeline-uncaught.js @@ -0,0 +1,29 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { + pipeline, + PassThrough +} = require('stream'); +const assert = require('assert'); + +process.on('uncaughtException', common.mustCall((err) => { + assert.strictEqual(err.message, 'error'); +})); + +// Ensure that pipeline that ends with Promise +// still propagates error to uncaughtException. +const s = new PassThrough(); +s.end('data'); +pipeline(s, async function(source) { + for await (const chunk of source) { } // eslint-disable-line no-unused-vars, no-empty +}, common.mustSucceed(() => { + throw new Error('error'); +})); diff --git a/tests/node_compat/test/parallel/test-stream-push-order.js b/tests/node_compat/test/parallel/test-stream-push-order.js new file mode 100644 index 0000000000..c0202df542 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-push-order.js @@ -0,0 +1,59 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const Readable = require('stream').Readable; +const assert = require('assert'); + +const s = new Readable({ + highWaterMark: 20, + encoding: 'ascii' +}); + +const list = ['1', '2', '3', '4', '5', '6']; + +s._read = function(n) { + const one = list.shift(); + if (!one) { + s.push(null); + } else { + const two = list.shift(); + s.push(one); + s.push(two); + } +}; + +s.read(0); + +// ACTUALLY [1, 3, 5, 6, 4, 2] + +process.on('exit', function() { + assert.strictEqual(s.readableBuffer.join(','), '1,2,3,4,5,6'); + console.log('ok'); +}); diff --git a/tests/node_compat/test/parallel/test-stream-readable-strategy-option.js b/tests/node_compat/test/parallel/test-stream-readable-strategy-option.js new file mode 100644 index 0000000000..2c8712ee51 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-readable-strategy-option.js @@ -0,0 +1,82 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const { Readable } = require('stream'); +const assert = require('assert'); +const { strictEqual } = require('assert'); + +{ + // Strategy 2 + const streamData = ['a', 'b', 'c', null]; + + // Fulfill a Readable object + const readable = new Readable({ + read: common.mustCall(() => { + process.nextTick(() => { + readable.push(streamData.shift()); + }); + }, streamData.length), + }); + + // Use helper to convert it to a Web ReadableStream using ByteLength strategy + const readableStream = Readable.toWeb(readable, { + strategy: new ByteLengthQueuingStrategy({ highWaterMark: 1 }), + }); + + assert(!readableStream.locked); + readableStream.getReader().read().then(common.mustCall()); +} + +{ + // Strategy 2 + const streamData = ['a', 'b', 'c', null]; + + // Fulfill a Readable object + const readable = new Readable({ + read: common.mustCall(() => { + process.nextTick(() => { + readable.push(streamData.shift()); + }); + }, streamData.length), + }); + + // Use helper to convert it to a Web ReadableStream using Count strategy + const readableStream = Readable.toWeb(readable, { + strategy: new CountQueuingStrategy({ highWaterMark: 1 }), + }); + + assert(!readableStream.locked); + readableStream.getReader().read().then(common.mustCall()); +} + +{ + const desireSizeExpected = 2; + + const stringStream = new ReadableStream( + { + start(controller) { + // Check if the strategy is being assigned on the init of the ReadableStream + strictEqual(controller.desiredSize, desireSizeExpected); + controller.enqueue('a'); + controller.enqueue('b'); + controller.close(); + }, + }, + new CountQueuingStrategy({ highWaterMark: desireSizeExpected }) + ); + + const reader = stringStream.getReader(); + + reader.read().then(common.mustCall()); + reader.read().then(common.mustCall()); + reader.read().then(({ value, done }) => { + strictEqual(value, undefined); + strictEqual(done, true); + }); +} diff --git a/tests/node_compat/test/parallel/test-stream-readable-unpipe-resume.js b/tests/node_compat/test/parallel/test-stream-readable-unpipe-resume.js new file mode 100644 index 0000000000..f8ff846afa --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-readable-unpipe-resume.js @@ -0,0 +1,27 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const stream = require('stream'); +const fs = require('fs'); + +const readStream = fs.createReadStream(process.execPath); + +const transformStream = new stream.Transform({ + transform: common.mustCall(() => { + readStream.unpipe(); + readStream.resume(); + }) +}); + +readStream.on('end', common.mustCall()); + +readStream + .pipe(transformStream) + .resume(); diff --git a/tests/node_compat/test/parallel/test-stream-reduce.js b/tests/node_compat/test/parallel/test-stream-reduce.js new file mode 100644 index 0000000000..e0ec0f26d9 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-reduce.js @@ -0,0 +1,139 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { + Readable, +} = require('stream'); +const assert = require('assert'); + +function sum(p, c) { + return p + c; +} + +{ + // Does the same thing as `(await stream.toArray()).reduce(...)` + (async () => { + const tests = [ + [[], sum, 0], + [[1], sum, 0], + [[1, 2, 3, 4, 5], sum, 0], + [[...Array(100).keys()], sum, 0], + [['a', 'b', 'c'], sum, ''], + [[1, 2], sum], + [[1, 2, 3], (x, y) => y], + ]; + for (const [values, fn, initial] of tests) { + const streamReduce = await Readable.from(values) + .reduce(fn, initial); + const arrayReduce = values.reduce(fn, initial); + assert.deepStrictEqual(streamReduce, arrayReduce); + } + // Does the same thing as `(await stream.toArray()).reduce(...)` with an + // asynchronous reducer + for (const [values, fn, initial] of tests) { + const streamReduce = await Readable.from(values) + .map(async (x) => x) + .reduce(fn, initial); + const arrayReduce = values.reduce(fn, initial); + assert.deepStrictEqual(streamReduce, arrayReduce); + } + })().then(common.mustCall()); +} +{ + // Works with an async reducer, with or without initial value + (async () => { + const six = await Readable.from([1, 2, 3]).reduce(async (p, c) => p + c, 0); + assert.strictEqual(six, 6); + })().then(common.mustCall()); + (async () => { + const six = await Readable.from([1, 2, 3]).reduce(async (p, c) => p + c); + assert.strictEqual(six, 6); + })().then(common.mustCall()); +} +{ + // Works lazily + assert.rejects(Readable.from([1, 2, 3, 4, 5, 6]) + .map(common.mustCall((x) => { + return x; + }, 3)) // Two consumed and one buffered by `map` due to default concurrency + .reduce(async (p, c) => { + if (p === 1) { + throw new Error('boom'); + } + return c; + }, 0) + , /boom/).then(common.mustCall()); +} + +{ + // Support for AbortSignal + const ac = new AbortController(); + assert.rejects(async () => { + await Readable.from([1, 2, 3]).reduce(async (p, c) => { + if (c === 3) { + await new Promise(() => {}); // Explicitly do not pass signal here + } + return Promise.resolve(); + }, 0, { signal: ac.signal }); + }, { + name: 'AbortError', + }).then(common.mustCall()); + ac.abort(); +} + + +{ + // Support for AbortSignal - pre aborted + const stream = Readable.from([1, 2, 3]); + assert.rejects(async () => { + await stream.reduce(async (p, c) => { + if (c === 3) { + await new Promise(() => {}); // Explicitly do not pass signal here + } + return Promise.resolve(); + }, 0, { signal: AbortSignal.abort() }); + }, { + name: 'AbortError', + }).then(common.mustCall(() => { + assert.strictEqual(stream.destroyed, true); + })); +} + +{ + // Support for AbortSignal - deep + const stream = Readable.from([1, 2, 3]); + assert.rejects(async () => { + await stream.reduce(async (p, c, { signal }) => { + signal.addEventListener('abort', common.mustCall(), { once: true }); + if (c === 3) { + await new Promise(() => {}); // Explicitly do not pass signal here + } + return Promise.resolve(); + }, 0, { signal: AbortSignal.abort() }); + }, { + name: 'AbortError', + }).then(common.mustCall(() => { + assert.strictEqual(stream.destroyed, true); + })); +} + +{ + // Error cases + assert.rejects(() => Readable.from([]).reduce(1), /TypeError/).then(common.mustCall()); + assert.rejects(() => Readable.from([]).reduce('5'), /TypeError/).then(common.mustCall()); + assert.rejects(() => Readable.from([]).reduce((x, y) => x + y, 0, 1), /ERR_INVALID_ARG_TYPE/).then(common.mustCall()); + assert.rejects(() => Readable.from([]).reduce((x, y) => x + y, 0, { signal: true }), /ERR_INVALID_ARG_TYPE/).then(common.mustCall()); +} + +{ + // Test result is a Promise + const result = Readable.from([1, 2, 3, 4, 5]).reduce(sum, 0); + assert.ok(result instanceof Promise); +} diff --git a/tests/node_compat/test/parallel/test-stream-toArray.js b/tests/node_compat/test/parallel/test-stream-toArray.js new file mode 100644 index 0000000000..514c03112a --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-toArray.js @@ -0,0 +1,100 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const { + Readable, +} = require('stream'); +const assert = require('assert'); + +{ + // Works on a synchronous stream + (async () => { + const tests = [ + [], + [1], + [1, 2, 3], + Array(100).fill().map((_, i) => i), + ]; + for (const test of tests) { + const stream = Readable.from(test); + const result = await stream.toArray(); + assert.deepStrictEqual(result, test); + } + })().then(common.mustCall()); +} + +{ + // Works on a non-object-mode stream + (async () => { + const firstBuffer = Buffer.from([1, 2, 3]); + const secondBuffer = Buffer.from([4, 5, 6]); + const stream = Readable.from( + [firstBuffer, secondBuffer], + { objectMode: false }); + const result = await stream.toArray(); + assert.strictEqual(Array.isArray(result), true); + assert.deepStrictEqual(result, [firstBuffer, secondBuffer]); + })().then(common.mustCall()); +} + +{ + // Works on an asynchronous stream + (async () => { + const tests = [ + [], + [1], + [1, 2, 3], + Array(100).fill().map((_, i) => i), + ]; + for (const test of tests) { + const stream = Readable.from(test).map((x) => Promise.resolve(x)); + const result = await stream.toArray(); + assert.deepStrictEqual(result, test); + } + })().then(common.mustCall()); +} + +{ + // Support for AbortSignal + const ac = new AbortController(); + let stream; + assert.rejects(async () => { + stream = Readable.from([1, 2, 3]).map(async (x) => { + if (x === 3) { + await new Promise(() => {}); // Explicitly do not pass signal here + } + return Promise.resolve(x); + }); + await stream.toArray({ signal: ac.signal }); + }, { + name: 'AbortError', + }).then(common.mustCall(() => { + // Only stops toArray, does not destroy the stream + assert(stream.destroyed, false); + })); + ac.abort(); +} +{ + // Test result is a Promise + const result = Readable.from([1, 2, 3, 4, 5]).toArray(); + assert.strictEqual(result instanceof Promise, true); +} +{ + // Error cases + assert.rejects(async () => { + await Readable.from([1]).toArray(1); + }, /ERR_INVALID_ARG_TYPE/).then(common.mustCall()); + + assert.rejects(async () => { + await Readable.from([1]).toArray({ + signal: true + }); + }, /ERR_INVALID_ARG_TYPE/).then(common.mustCall()); +} diff --git a/tests/node_compat/test/parallel/test-stream-toWeb-allows-server-response.js b/tests/node_compat/test/parallel/test-stream-toWeb-allows-server-response.js new file mode 100644 index 0000000000..656013d89d --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-toWeb-allows-server-response.js @@ -0,0 +1,36 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const { Writable } = require('stream'); + +const assert = require('assert'); +const http = require('http'); + +// Check if Writable.toWeb works on the response object after creating a server. +const server = http.createServer( + common.mustCall((req, res) => { + const webStreamResponse = Writable.toWeb(res); + assert.strictEqual(webStreamResponse instanceof WritableStream, true); + res.end(); + }) +); + +server.listen( + 0, + common.mustCall(() => { + http.get( + { + port: server.address().port, + }, + common.mustCall(() => { + server.close(); + }) + ); + }) +); diff --git a/tests/node_compat/test/parallel/test-stream-transform-hwm0.js b/tests/node_compat/test/parallel/test-stream-transform-hwm0.js new file mode 100644 index 0000000000..dad67ae4a0 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-transform-hwm0.js @@ -0,0 +1,35 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const { Transform } = require('stream'); + +const t = new Transform({ + objectMode: true, highWaterMark: 0, + transform(chunk, enc, callback) { + process.nextTick(() => callback(null, chunk, enc)); + } +}); + +assert.strictEqual(t.write(1), false); +t.on('drain', common.mustCall(() => { + assert.strictEqual(t.write(2), false); + t.end(); +})); + +t.once('readable', common.mustCall(() => { + assert.strictEqual(t.read(), 1); + setImmediate(common.mustCall(() => { + assert.strictEqual(t.read(), null); + t.once('readable', common.mustCall(() => { + assert.strictEqual(t.read(), 2); + })); + })); +})); diff --git a/tests/node_compat/test/parallel/test-stream-writable-end-cb-uncaught.js b/tests/node_compat/test/parallel/test-stream-writable-end-cb-uncaught.js new file mode 100644 index 0000000000..40ef4e274c --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream-writable-end-cb-uncaught.js @@ -0,0 +1,31 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const stream = require('stream'); + +process.on('uncaughtException', common.mustCall((err) => { + assert.strictEqual(err.message, 'kaboom'); +})); + +const writable = new stream.Writable(); +const _err = new Error('kaboom'); + +writable._write = (chunk, encoding, cb) => { + cb(); +}; +writable._final = (cb) => { + cb(_err); +}; + +writable.write('asd'); +writable.end(common.mustCall((err) => { + assert.strictEqual(err, _err); +})); diff --git a/tests/node_compat/test/parallel/test-stream2-finish-pipe-error.js b/tests/node_compat/test/parallel/test-stream2-finish-pipe-error.js new file mode 100644 index 0000000000..3a0b820b4d --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream2-finish-pipe-error.js @@ -0,0 +1,27 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const stream = require('stream'); + +process.on('uncaughtException', common.mustCall()); + +const r = new stream.Readable(); +r._read = function(size) { + r.push(Buffer.allocUnsafe(size)); +}; + +const w = new stream.Writable(); +w._write = function(data, encoding, cb) { + cb(null); +}; + +r.pipe(w); + +// end() after pipe should cause unhandled exception +w.end(); diff --git a/tests/node_compat/test/parallel/test-stream3-pipeline-async-iterator.js b/tests/node_compat/test/parallel/test-stream3-pipeline-async-iterator.js new file mode 100644 index 0000000000..6b22012769 --- /dev/null +++ b/tests/node_compat/test/parallel/test-stream3-pipeline-async-iterator.js @@ -0,0 +1,34 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +/* eslint-disable node-core/require-common-first, require-yield */ +'use strict'; +const { pipeline } = require('node:stream/promises'); +{ + // Ensure that async iterators can act as readable and writable streams + async function* myCustomReadable() { + yield 'Hello'; + yield 'World'; + } + + const messages = []; + async function* myCustomWritable(stream) { + for await (const chunk of stream) { + messages.push(chunk); + } + } + + (async () => { + await pipeline( + myCustomReadable, + myCustomWritable, + ); + // Importing here to avoid initializing streams + require('assert').deepStrictEqual(messages, ['Hello', 'World']); + })() + .then(require('../common').mustCall()); +} diff --git a/tests/node_compat/test/parallel/test-stringbytes-external.js b/tests/node_compat/test/parallel/test-stringbytes-external.js new file mode 100644 index 0000000000..78f3c8608f --- /dev/null +++ b/tests/node_compat/test/parallel/test-stringbytes-external.js @@ -0,0 +1,150 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +// Minimum string size to overflow into external string space +const EXTERN_APEX = 0xFBEE9; + +// Manually controlled string for checking binary output +let ucs2_control = 'a\u0000'; +let write_str = 'a'; + + +// First do basic checks +let b = Buffer.from(write_str, 'ucs2'); +// first check latin1 +let c = b.toString('latin1'); +assert.strictEqual(b[0], 0x61); +assert.strictEqual(b[1], 0); +assert.strictEqual(ucs2_control, c); +// now check binary +c = b.toString('binary'); +assert.strictEqual(b[0], 0x61); +assert.strictEqual(b[1], 0); +assert.strictEqual(ucs2_control, c); + +// Now create big strings +const size = 1 << 20; +write_str = write_str.repeat(size); +ucs2_control = ucs2_control.repeat(size); + +// Check resultant buffer and output string +b = Buffer.from(write_str, 'ucs2'); +// Check fist Buffer created from write string +for (let i = 0; i < b.length; i += 2) { + assert.strictEqual(b[i], 0x61); + assert.strictEqual(b[i + 1], 0); +} + +// Create another string to create an external string +const b_ucs = b.toString('ucs2'); + +// Check control against external binary string +const l_bin = b.toString('latin1'); +assert.strictEqual(ucs2_control, l_bin); + +// Check control against external binary string +const b_bin = b.toString('binary'); +assert.strictEqual(ucs2_control, b_bin); + +// Create buffer copy from external +const c_bin = Buffer.from(l_bin, 'latin1'); +const c_ucs = Buffer.from(b_ucs, 'ucs2'); +// Make sure they're the same length +assert.strictEqual(c_bin.length, c_ucs.length); +// Make sure Buffers from externals are the same +for (let i = 0; i < c_bin.length; i++) { + assert.strictEqual(c_bin[i], c_ucs[i]); +} +// Check resultant strings +assert.strictEqual(c_bin.toString('ucs2'), c_ucs.toString('ucs2')); +assert.strictEqual(c_bin.toString('latin1'), ucs2_control); +assert.strictEqual(c_ucs.toString('latin1'), ucs2_control); + + +// Now let's test BASE64 and HEX encoding/decoding +const RADIOS = 2; +const PRE_HALF_APEX = Math.ceil(EXTERN_APEX / 2) - RADIOS; +const PRE_3OF4_APEX = Math.ceil((EXTERN_APEX / 4) * 3) - RADIOS; + +{ + for (let j = 0; j < RADIOS * 2; j += 1) { + const datum = b; + const slice = datum.slice(0, PRE_HALF_APEX + j); + const slice2 = datum.slice(0, PRE_HALF_APEX + j + 2); + const pumped_string = slice.toString('hex'); + const pumped_string2 = slice2.toString('hex'); + const decoded = Buffer.from(pumped_string, 'hex'); + + // The string are the same? + for (let k = 0; k < pumped_string.length; ++k) { + assert.strictEqual(pumped_string[k], pumped_string2[k]); + } + + // The recoded buffer is the same? + for (let i = 0; i < decoded.length; ++i) { + assert.strictEqual(datum[i], decoded[i]); + } + } +} + +{ + for (let j = 0; j < RADIOS * 2; j += 1) { + const datum = b; + const slice = datum.slice(0, PRE_3OF4_APEX + j); + const slice2 = datum.slice(0, PRE_3OF4_APEX + j + 2); + const pumped_string = slice.toString('base64'); + const pumped_string2 = slice2.toString('base64'); + const decoded = Buffer.from(pumped_string, 'base64'); + + // The string are the same? + for (let k = 0; k < pumped_string.length - 3; ++k) { + assert.strictEqual(pumped_string[k], pumped_string2[k]); + } + + // The recoded buffer is the same? + for (let i = 0; i < decoded.length; ++i) { + assert.strictEqual(datum[i], decoded[i]); + } + } +} + +// https://github.com/nodejs/node/issues/1024 +{ + const a = 'x'.repeat(1 << 20 - 1); + const b = Buffer.from(a, 'ucs2').toString('ucs2'); + const c = Buffer.from(b, 'utf8').toString('utf8'); + + assert.strictEqual(a.length, b.length); + assert.strictEqual(b.length, c.length); + + assert.strictEqual(a, b); + assert.strictEqual(b, c); +} diff --git a/tests/node_compat/test/parallel/test-sync-fileread.js b/tests/node_compat/test/parallel/test-sync-fileread.js new file mode 100644 index 0000000000..5d76339867 --- /dev/null +++ b/tests/node_compat/test/parallel/test-sync-fileread.js @@ -0,0 +1,14 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const fixtures = require('../common/fixtures'); + +assert.strictEqual(fs.readFileSync(fixtures.path('x.txt')).toString(), 'xyz\n'); diff --git a/tests/node_compat/test/parallel/test-sys.js b/tests/node_compat/test/parallel/test-sys.js new file mode 100644 index 0000000000..284d622ba4 --- /dev/null +++ b/tests/node_compat/test/parallel/test-sys.js @@ -0,0 +1,35 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const sys = require('sys'); // eslint-disable-line no-restricted-modules +const util = require('util'); + +assert.strictEqual(sys, util); diff --git a/tests/node_compat/test/parallel/test-tick-processor-arguments.js b/tests/node_compat/test/parallel/test-tick-processor-arguments.js new file mode 100644 index 0000000000..3ece0fe78d --- /dev/null +++ b/tests/node_compat/test/parallel/test-tick-processor-arguments.js @@ -0,0 +1,39 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const tmpdir = require('../common/tmpdir'); +const fs = require('fs'); +const assert = require('assert'); +const { spawnSync } = require('child_process'); + +if (!common.enoughTestMem) + common.skip('skipped due to memory requirements'); +if (common.isAIX) + common.skip('does not work on AIX'); + +tmpdir.refresh(); + +// Generate log file. +spawnSync(process.execPath, [ '--prof', '-p', '42' ], { cwd: tmpdir.path }); + +const files = fs.readdirSync(tmpdir.path); +const logfile = files.filter((name) => /\.log$/.test(name))[0]; +assert(logfile); + +// Make sure that the --preprocess argument is passed through correctly, +// as an example flag listed in deps/v8/tools/tickprocessor.js. +// Any of the other flags there should work for this test too, if --preprocess +// is ever removed. +const { stdout } = spawnSync( + process.execPath, + [ '--prof-process', '--preprocess', logfile ], + { cwd: tmpdir.path, encoding: 'utf8', maxBuffer: Infinity }); + +// Make sure that the result is valid JSON. +JSON.parse(stdout); diff --git a/tests/node_compat/test/parallel/test-timers-clearImmediate-als.js b/tests/node_compat/test/parallel/test-timers-clearImmediate-als.js new file mode 100644 index 0000000000..b9a7d9a4d7 --- /dev/null +++ b/tests/node_compat/test/parallel/test-timers-clearImmediate-als.js @@ -0,0 +1,35 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const { AsyncLocalStorage } = require('async_hooks'); + +// This is an asynclocalstorage variant of test-timers-clearImmediate.js +const asyncLocalStorage = new AsyncLocalStorage(); +const N = 3; + +function next() { + const fn = common.mustCall(onImmediate); + asyncLocalStorage.run(new Map(), common.mustCall(() => { + const immediate = setImmediate(fn); + const store = asyncLocalStorage.getStore(); + store.set('immediate', immediate); + })); +} + +function onImmediate() { + const store = asyncLocalStorage.getStore(); + const immediate = store.get('immediate'); + assert.strictEqual(immediate.constructor.name, 'Immediate'); + clearImmediate(immediate); +} + +for (let i = 0; i < N; i++) { + next(); +} diff --git a/tests/node_compat/test/parallel/test-timers-immediate-queue.js b/tests/node_compat/test/parallel/test-timers-immediate-queue.js new file mode 100644 index 0000000000..9a025624f3 --- /dev/null +++ b/tests/node_compat/test/parallel/test-timers-immediate-queue.js @@ -0,0 +1,64 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); + +// setImmediate should run clear its queued cbs once per event loop turn +// but immediates queued while processing the current queue should happen +// on the next turn of the event loop. + +// hit should be the exact same size of QUEUE, if we're letting things +// recursively add to the immediate QUEUE hit will be > QUEUE + +let ticked = false; + +let hit = 0; +const QUEUE = 10; + +function run() { + if (hit === 0) { + setTimeout(() => { ticked = true; }, 1); + const now = Date.now(); + while (Date.now() - now < 2); + } + + if (ticked) return; + + hit += 1; + setImmediate(run); +} + +for (let i = 0; i < QUEUE; i++) + setImmediate(run); + +process.on('exit', function() { + console.log('hit', hit); + assert.strictEqual(hit, QUEUE); +}); diff --git a/tests/node_compat/test/parallel/test-timers-immediate.js b/tests/node_compat/test/parallel/test-timers-immediate.js new file mode 100644 index 0000000000..847901146c --- /dev/null +++ b/tests/node_compat/test/parallel/test-timers-immediate.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +let mainFinished = false; + +setImmediate(common.mustCall(function() { + assert.strictEqual(mainFinished, true); + clearImmediate(immediateB); +})); + +const immediateB = setImmediate(common.mustNotCall()); + +setImmediate(common.mustCall((...args) => { + assert.deepStrictEqual(args, [1, 2, 3]); +}), 1, 2, 3); + +setImmediate(common.mustCall((...args) => { + assert.deepStrictEqual(args, [1, 2, 3, 4, 5]); +}), 1, 2, 3, 4, 5); + +mainFinished = true; diff --git a/tests/node_compat/test/parallel/test-timers-refresh-in-callback.js b/tests/node_compat/test/parallel/test-timers-refresh-in-callback.js new file mode 100644 index 0000000000..8267eff10c --- /dev/null +++ b/tests/node_compat/test/parallel/test-timers-refresh-in-callback.js @@ -0,0 +1,21 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +// This test checks whether a refresh called inside the callback will keep +// the event loop alive to run the timer again. + +let didCall = false; +const timer = setTimeout(common.mustCall(() => { + if (!didCall) { + didCall = true; + timer.refresh(); + } +}, 2), 1); diff --git a/tests/node_compat/test/parallel/test-timers-setimmediate-infinite-loop.js b/tests/node_compat/test/parallel/test-timers-setimmediate-infinite-loop.js new file mode 100644 index 0000000000..bf269db64f --- /dev/null +++ b/tests/node_compat/test/parallel/test-timers-setimmediate-infinite-loop.js @@ -0,0 +1,26 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +// This test ensures that if an Immediate callback clears subsequent +// immediates we don't get stuck in an infinite loop. +// +// If the process does get stuck, it will be timed out by the test +// runner. +// +// Ref: https://github.com/nodejs/node/issues/9756 + +setImmediate(common.mustCall(function() { + clearImmediate(i2); + clearImmediate(i3); +})); + +const i2 = setImmediate(common.mustNotCall()); + +const i3 = setImmediate(common.mustNotCall()); diff --git a/tests/node_compat/test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js b/tests/node_compat/test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js new file mode 100644 index 0000000000..80658b4d67 --- /dev/null +++ b/tests/node_compat/test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// Regression test for https://github.com/nodejs/node-v0.x-archive/issues/8897. + +const common = require('../common'); +const net = require('net'); +const Countdown = require('../common/countdown'); + +const clients = []; + +const server = net.createServer(function onClient(client) { + clients.push(client); + + if (clients.length === 2) { + // Enroll two timers, and make the one supposed to fire first + // unenroll the other one supposed to fire later. This mutates + // the list of unref timers when traversing it, and exposes the + // original issue in joyent/node#8897. + clients[0].setTimeout(1, () => { + clients[1].setTimeout(0); + clients[0].end(); + clients[1].end(); + }); + + // Use a delay that is higher than the lowest timer resolution across all + // supported platforms, so that the two timers don't fire at the same time. + clients[1].setTimeout(50); + } +}); + +server.listen(0, common.mustCall(() => { + const countdown = new Countdown(2, () => server.close()); + + { + const client = net.connect({ port: server.address().port }); + client.on('end', () => countdown.dec()); + } + + { + const client = net.connect({ port: server.address().port }); + client.on('end', () => countdown.dec()); + } +})); diff --git a/tests/node_compat/test/parallel/test-timers-unref.js b/tests/node_compat/test/parallel/test-timers-unref.js new file mode 100644 index 0000000000..ca4145d3ef --- /dev/null +++ b/tests/node_compat/test/parallel/test-timers-unref.js @@ -0,0 +1,88 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +const common = require('../common'); + +const assert = require('assert'); + +let unref_interval = false; +let unref_timer = false; +let checks = 0; + +const LONG_TIME = 10 * 1000; +const SHORT_TIME = 100; + +const timer = setTimeout(() => {}, 10); +assert.strictEqual(timer.hasRef(), true); +// Should not throw. +timer.unref().ref().unref(); +assert.strictEqual(timer.hasRef(), false); + +setInterval(() => {}, 10).unref().ref().unref(); + +setInterval(common.mustNotCall('Interval should not fire'), LONG_TIME).unref(); +setTimeout(common.mustNotCall('Timer should not fire'), LONG_TIME).unref(); + +const interval = setInterval(common.mustCall(() => { + unref_interval = true; + clearInterval(interval); +}), SHORT_TIME); +interval.unref(); + +setTimeout(common.mustCall(() => { + unref_timer = true; +}), SHORT_TIME).unref(); + +const check_unref = setInterval(() => { + if (checks > 5 || (unref_interval && unref_timer)) + clearInterval(check_unref); + checks += 1; +}, 100); + +{ + const timeout = + setTimeout(common.mustCall(() => { + timeout.unref(); + }), SHORT_TIME); +} + +{ + // Should not timeout the test + const timeout = + setInterval(() => timeout.unref(), SHORT_TIME); +} + +// Should not assert on args.Holder()->InternalFieldCount() > 0. +// See https://github.com/nodejs/node-v0.x-archive/issues/4261. +{ + const t = setInterval(() => {}, 1); + process.nextTick(t.unref.bind({})); + process.nextTick(t.unref.bind(t)); +} diff --git a/tests/node_compat/test/parallel/test-timers-unrefd-interval-still-fires.js b/tests/node_compat/test/parallel/test-timers-unrefd-interval-still-fires.js new file mode 100644 index 0000000000..79b68e467d --- /dev/null +++ b/tests/node_compat/test/parallel/test-timers-unrefd-interval-still-fires.js @@ -0,0 +1,29 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +// Regression test for https://github.com/nodejs/node-v0.x-archive/issues/8900. +const common = require('../common'); + +const TEST_DURATION = common.platformTimeout(1000); +let N = 3; + +const keepOpen = + setTimeout( + common.mustNotCall('Test timed out. keepOpen was not canceled.'), + TEST_DURATION); + +const timer = setInterval(common.mustCall(() => { + if (--N === 0) { + clearInterval(timer); + timer._onTimeout = + common.mustNotCall('Unrefd interval fired after being cleared'); + clearTimeout(keepOpen); + } +}, N), 1); + +timer.unref(); diff --git a/tests/node_compat/test/parallel/test-timers-unrefed-in-beforeexit.js b/tests/node_compat/test/parallel/test-timers-unrefed-in-beforeexit.js new file mode 100644 index 0000000000..c551d61373 --- /dev/null +++ b/tests/node_compat/test/parallel/test-timers-unrefed-in-beforeexit.js @@ -0,0 +1,14 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +process.on('beforeExit', common.mustCall(() => { + setTimeout(common.mustNotCall(), 1).unref(); +})); diff --git a/tests/node_compat/test/parallel/test-timers-unrefed-in-callback.js b/tests/node_compat/test/parallel/test-timers-unrefed-in-callback.js new file mode 100644 index 0000000000..362af6516b --- /dev/null +++ b/tests/node_compat/test/parallel/test-timers-unrefed-in-callback.js @@ -0,0 +1,63 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +// Checks that setInterval timers keep running even when they're +// unrefed within their callback. + +const common = require('../common'); +const net = require('net'); + +let counter1 = 0; +let counter2 = 0; + +// Test1 checks that clearInterval works as expected for a timer +// unrefed within its callback: it removes the timer and its callback +// is not called anymore. Note that the only reason why this test is +// robust is that: +// 1. the repeated timer it creates has a delay of 1ms +// 2. when this test is completed, another test starts that creates a +// new repeated timer with the same delay (1ms) +// 3. because of the way timers are implemented in libuv, if two +// repeated timers A and B are created in that order with the same +// delay, it is guaranteed that the first occurrence of timer A +// will fire before the first occurrence of timer B +// 4. as a result, when the timer created by Test2 fired 11 times, if +// the timer created by Test1 hadn't been removed by clearInterval, +// it would have fired 11 more times, and the assertion in the +// process'exit event handler would fail. +function Test1() { + // Server only for maintaining event loop + const server = net.createServer().listen(0); + + const timer1 = setInterval(common.mustCall(() => { + timer1.unref(); + if (counter1++ === 3) { + clearInterval(timer1); + server.close(() => { + Test2(); + }); + } + }, 4), 1); +} + + +// Test2 checks setInterval continues even if it is unrefed within +// timer callback. counter2 continues to be incremented more than 11 +// until server close completed. +function Test2() { + // Server only for maintaining event loop + const server = net.createServer().listen(0); + + const timer2 = setInterval(() => { + timer2.unref(); + if (counter2++ === 3) + server.close(); + }, 1); +} + +Test1(); diff --git a/tests/node_compat/test/parallel/test-timers.js b/tests/node_compat/test/parallel/test-timers.js new file mode 100644 index 0000000000..a2f218df81 --- /dev/null +++ b/tests/node_compat/test/parallel/test-timers.js @@ -0,0 +1,88 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +const inputs = [ + undefined, + null, + true, + false, + '', + [], + {}, + NaN, + +Infinity, + -Infinity, + (1.0 / 0.0), // sanity check + parseFloat('x'), // NaN + -10, + -1, + -0.5, + -0.1, + -0.0, + 0, + 0.0, + 0.1, + 0.5, + 1, + 1.0, + 2147483648, // Browser behavior: timeouts > 2^31-1 run on next tick + 12345678901234, // ditto +]; + +const timeouts = []; +const intervals = []; + +inputs.forEach((value, index) => { + setTimeout(() => { + timeouts[index] = true; + }, value); + + const handle = setInterval(() => { + clearInterval(handle); // Disarm timer or we'll never finish + intervals[index] = true; + }, value); +}); + +// All values in inputs array coerce to 1 ms. Therefore, they should all run +// before a timer set here for 2 ms. + +setTimeout(common.mustCall(() => { + // Assert that all other timers have run + inputs.forEach((value, index) => { + assert(timeouts[index]); + assert(intervals[index]); + }); +}), 2); + +// Test 10 ms timeout separately. +setTimeout(common.mustCall(), 10); +setInterval(common.mustCall(function() { clearInterval(this); }), 10); diff --git a/tests/node_compat/test/parallel/test-tls-alert-handling.js b/tests/node_compat/test/parallel/test-tls-alert-handling.js new file mode 100644 index 0000000000..d682d5bcbb --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-alert-handling.js @@ -0,0 +1,103 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.opensslCli) + common.skip('node compiled without OpenSSL CLI'); + +const assert = require('assert'); +const net = require('net'); +const tls = require('tls'); +const fixtures = require('../common/fixtures'); + +let clientClosed = false; +let errorReceived = false; +function canCloseServer() { + return clientClosed && errorReceived; +} + +function loadPEM(n) { + return fixtures.readKey(`${n}.pem`, 'utf-8'); +} + +const opts = { + key: loadPEM('agent2-key'), + cert: loadPEM('agent2-cert') +}; + +const max_iter = 20; +let iter = 0; + +const errorHandler = common.mustCall((err) => { + assert.strictEqual(err.code, 'ERR_SSL_WRONG_VERSION_NUMBER'); + assert.strictEqual(err.library, 'SSL routines'); + if (!common.hasOpenSSL3) assert.strictEqual(err.function, 'ssl3_get_record'); + assert.strictEqual(err.reason, 'wrong version number'); + errorReceived = true; + if (canCloseServer()) + server.close(); +}); +const server = tls.createServer(opts, common.mustCall(function(s) { + s.pipe(s); + s.on('error', errorHandler); +}, 2)); + +server.listen(0, common.mustCall(function() { + sendClient(); +})); + +server.on('tlsClientError', common.mustNotCall()); + +server.on('error', common.mustNotCall()); + +function sendClient() { + const client = tls.connect(server.address().port, { + rejectUnauthorized: false + }); + client.on('data', common.mustCall(function() { + if (iter++ === 2) sendBADTLSRecord(); + if (iter < max_iter) { + client.write('a'); + return; + } + client.end(); + }, max_iter)); + client.write('a', common.mustCall()); + client.on('error', common.mustNotCall()); + client.on('close', common.mustCall(function() { + clientClosed = true; + if (canCloseServer()) + server.close(); + })); +} + + +function sendBADTLSRecord() { + const BAD_RECORD = Buffer.from([0xff, 0xff, 0xff, 0xff, 0xff, 0xff]); + const socket = net.connect(server.address().port); + const client = tls.connect({ + socket: socket, + rejectUnauthorized: false + }, common.mustCall(function() { + client.write('x'); + client.on('data', (data) => { + socket.end(BAD_RECORD); + }); + })); + client.on('error', common.mustCall((err) => { + assert.strictEqual(err.code, 'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION'); + assert.strictEqual(err.library, 'SSL routines'); + if (!common.hasOpenSSL3) + assert.strictEqual(err.function, 'ssl3_read_bytes'); + assert.strictEqual(err.reason, 'tlsv1 alert protocol version'); + })); +} diff --git a/tests/node_compat/test/parallel/test-tls-alert.js b/tests/node_compat/test/parallel/test-tls-alert.js new file mode 100644 index 0000000000..b3e8a948ce --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-alert.js @@ -0,0 +1,60 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.opensslCli) + common.skip('node compiled without OpenSSL CLI.'); + +const assert = require('assert'); +const { execFile } = require('child_process'); +const tls = require('tls'); +const fixtures = require('../common/fixtures'); + +function loadPEM(n) { + return fixtures.readKey(`${n}.pem`); +} + +const server = tls.Server({ + secureProtocol: 'TLSv1_2_server_method', + key: loadPEM('agent2-key'), + cert: loadPEM('agent2-cert') +}, null).listen(0, common.mustCall(() => { + const args = ['s_client', '-quiet', '-tls1_1', + '-cipher', (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT'), + '-connect', `127.0.0.1:${server.address().port}`]; + + execFile(common.opensslCli, args, common.mustCall((err, _, stderr) => { + assert.strictEqual(err.code, 1); + assert.match(stderr, /SSL alert number 70/); + server.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-tls-client-renegotiation-limit.js b/tests/node_compat/test/parallel/test-tls-client-renegotiation-limit.js new file mode 100644 index 0000000000..9f50d82dde --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-client-renegotiation-limit.js @@ -0,0 +1,108 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.opensslCli) + common.skip('node compiled without OpenSSL CLI.'); + +const assert = require('assert'); +const tls = require('tls'); +const fixtures = require('../common/fixtures'); + +// Renegotiation as a protocol feature was dropped after TLS1.2. +tls.DEFAULT_MAX_VERSION = 'TLSv1.2'; + +// Renegotiation limits to test +const LIMITS = [0, 1, 2, 3, 5, 10, 16]; + +{ + let n = 0; + function next() { + if (n >= LIMITS.length) return; + tls.CLIENT_RENEG_LIMIT = LIMITS[n++]; + test(next); + } + next(); +} + +function test(next) { + const options = { + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem'), + }; + + const server = tls.createServer(options, (conn) => { + conn.on('error', (err) => { + console.error(`Caught exception: ${err}`); + assert.match(err.message, /TLS session renegotiation attack/); + conn.destroy(); + }); + conn.pipe(conn); + }); + + server.listen(0, () => { + const options = { + host: server.address().host, + port: server.address().port, + rejectUnauthorized: false, + }; + const client = tls.connect(options, spam); + + let renegs = 0; + + client.on('close', () => { + assert.strictEqual(renegs, tls.CLIENT_RENEG_LIMIT + 1); + server.close(); + process.nextTick(next); + }); + + client.on('error', (err) => { + console.log('CLIENT ERR', err); + throw err; + }); + + client.on('close', (hadErr) => { + assert.strictEqual(hadErr, false); + }); + + // Simulate renegotiation attack + function spam() { + client.write(''); + client.renegotiate({}, (err) => { + assert.ifError(err); + assert.ok(renegs <= tls.CLIENT_RENEG_LIMIT); + spam(); + }); + renegs++; + } + }); +} diff --git a/tests/node_compat/test/parallel/test-tls-dhe.js b/tests/node_compat/test/parallel/test-tls-dhe.js new file mode 100644 index 0000000000..ea3503f0f6 --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-dhe.js @@ -0,0 +1,119 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --no-warnings +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.opensslCli) + common.skip('missing openssl-cli'); + +const assert = require('assert'); +const { X509Certificate } = require('crypto'); +const { once } = require('events'); +const tls = require('tls'); +const { execFile } = require('child_process'); +const fixtures = require('../common/fixtures'); + +const key = fixtures.readKey('agent2-key.pem'); +const cert = fixtures.readKey('agent2-cert.pem'); + +// Prefer DHE over ECDHE when possible. +const dheCipher = 'DHE-RSA-AES128-SHA256'; +const ecdheCipher = 'ECDHE-RSA-AES128-SHA256'; +const ciphers = `${dheCipher}:${ecdheCipher}`; + +// Test will emit a warning because the DH parameter size is < 2048 bits +common.expectWarning('SecurityWarning', + 'DH parameter is less than 2048 bits'); + +function loadDHParam(n) { + const keyname = `dh${n}.pem`; + return fixtures.readKey(keyname); +} + +function test(dhparam, keylen, expectedCipher) { + const options = { + key, + cert, + ciphers, + dhparam, + maxVersion: 'TLSv1.2', + }; + + const server = tls.createServer(options, (conn) => conn.end()); + + server.listen(0, '127.0.0.1', common.mustCall(() => { + const args = ['s_client', '-connect', `127.0.0.1:${server.address().port}`, + '-cipher', `${ciphers}:@SECLEVEL=1`]; + + execFile(common.opensslCli, args, common.mustSucceed((stdout) => { + assert(keylen === null || + stdout.includes(`Server Temp Key: DH, ${keylen} bits`)); + assert(stdout.includes(`Cipher : ${expectedCipher}`)); + server.close(); + })); + })); + + return once(server, 'close'); +} + +function testCustomParam(keylen, expectedCipher) { + const dhparam = loadDHParam(keylen); + if (keylen === 'error') keylen = null; + return test(dhparam, keylen, expectedCipher); +} + +(async () => { + // By default, DHE is disabled while ECDHE is enabled. + for (const dhparam of [undefined, null]) { + await test(dhparam, null, ecdheCipher); + } + + // The DHE parameters selected by OpenSSL depend on the strength of the + // certificate's key. For this test, we can assume that the modulus length + // of the certificate's key is equal to the size of the DHE parameter, but + // that is really only true for a few modulus lengths. + const { + publicKey: { asymmetricKeyDetails: { modulusLength } } + } = new X509Certificate(cert); + await test('auto', modulusLength, dheCipher); + + assert.throws(() => { + testCustomParam(512); + }, /DH parameter is less than 1024 bits/); + + // Custom DHE parameters are supported (but discouraged). + await testCustomParam(1024, dheCipher); + await testCustomParam(2048, dheCipher); + + // Invalid DHE parameters are discarded. ECDHE remains enabled. + await testCustomParam('error', ecdheCipher); +})().then(common.mustCall()); diff --git a/tests/node_compat/test/parallel/test-tls-ecdh-auto.js b/tests/node_compat/test/parallel/test-tls-ecdh-auto.js new file mode 100644 index 0000000000..c06dbe1b8a --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-ecdh-auto.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +// This test ensures that the value "auto" on ecdhCurve option is +// supported to enable automatic curve selection in TLS server. + +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.opensslCli) + common.skip('missing openssl-cli'); + +const assert = require('assert'); +const tls = require('tls'); +const { execFile } = require('child_process'); +const fixtures = require('../common/fixtures'); + +function loadPEM(n) { + return fixtures.readKey(`${n}.pem`); +} + +const options = { + key: loadPEM('agent2-key'), + cert: loadPEM('agent2-cert'), + ciphers: '-ALL:ECDHE-RSA-AES128-SHA256', + ecdhCurve: 'auto', + maxVersion: 'TLSv1.2', +}; + +const reply = 'I AM THE WALRUS'; // Something recognizable + +const server = tls.createServer(options, (conn) => { + conn.end(reply); +}).listen(0, common.mustCall(() => { + const args = ['s_client', + '-cipher', `${options.ciphers}`, + '-connect', `127.0.0.1:${server.address().port}`]; + + execFile(common.opensslCli, args, common.mustSucceed((stdout) => { + assert(stdout.includes(reply)); + server.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-tls-ecdh-multiple.js b/tests/node_compat/test/parallel/test-tls-ecdh-multiple.js new file mode 100644 index 0000000000..04163acced --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-ecdh-multiple.js @@ -0,0 +1,68 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +// This test ensures that ecdhCurve option of TLS server supports colon +// separated ECDH curve names as value. + +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.opensslCli) + common.skip('missing openssl-cli'); + +const assert = require('assert'); +const tls = require('tls'); +const { execFile } = require('child_process'); +const fixtures = require('../common/fixtures'); + +function loadPEM(n) { + return fixtures.readKey(`${n}.pem`); +} + +const options = { + key: loadPEM('agent2-key'), + cert: loadPEM('agent2-cert'), + ciphers: '-ALL:ECDHE-RSA-AES128-SHA256', + ecdhCurve: 'secp256k1:prime256v1:secp521r1', + maxVersion: 'TLSv1.2', +}; + +const reply = 'I AM THE WALRUS'; // Something recognizable + +const server = tls.createServer(options, (conn) => { + conn.end(reply); +}).listen(0, common.mustCall(() => { + const args = ['s_client', + '-cipher', `${options.ciphers}`, + '-connect', `127.0.0.1:${server.address().port}`]; + + execFile(common.opensslCli, args, common.mustSucceed((stdout) => { + assert(stdout.includes(reply)); + server.close(); + })); +})); + +{ + // Some unsupported curves. + const unsupportedCurves = [ + 'wap-wsg-idm-ecid-wtls1', + 'c2pnb163v1', + 'prime192v3', + ]; + + // Brainpool is not supported in FIPS mode. + if (common.hasFipsCrypto) + unsupportedCurves.push('brainpoolP256r1'); + + unsupportedCurves.forEach((ecdhCurve) => { + assert.throws(() => tls.createServer({ ecdhCurve }), + /Error: Failed to set ECDH curve/); + }); +} diff --git a/tests/node_compat/test/parallel/test-tls-ecdh.js b/tests/node_compat/test/parallel/test-tls-ecdh.js new file mode 100644 index 0000000000..169e629f8a --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-ecdh.js @@ -0,0 +1,66 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const fixtures = require('../common/fixtures'); + +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.opensslCli) + common.skip('missing openssl-cli'); + +const assert = require('assert'); +const tls = require('tls'); + +const exec = require('child_process').exec; + +const options = { + key: fixtures.readKey('agent2-key.pem'), + cert: fixtures.readKey('agent2-cert.pem'), + ciphers: '-ALL:ECDHE-RSA-AES128-SHA256', + ecdhCurve: 'prime256v1', + maxVersion: 'TLSv1.2' +}; + +const reply = 'I AM THE WALRUS'; // Something recognizable + +const server = tls.createServer(options, common.mustCall(function(conn) { + conn.end(reply); +})); + +server.listen(0, '127.0.0.1', common.mustCall(function() { + const cmd = `"${common.opensslCli}" s_client -cipher ${ + options.ciphers} -connect 127.0.0.1:${this.address().port}`; + + exec(cmd, common.mustSucceed((stdout, stderr) => { + assert(stdout.includes(reply)); + server.close(); + })); +})); diff --git a/tests/node_compat/test/parallel/test-tls-enable-trace-cli.js b/tests/node_compat/test/parallel/test-tls-enable-trace-cli.js new file mode 100644 index 0000000000..ba049f611f --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-enable-trace-cli.js @@ -0,0 +1,75 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) common.skip('missing crypto'); +const fixtures = require('../common/fixtures'); + +// Test --trace-tls CLI flag. + +const assert = require('assert'); +const { fork } = require('child_process'); + +if (process.argv[2] === 'test') + return test(); + +const binding = require('internal/test/binding').internalBinding; + +if (!binding('tls_wrap').HAVE_SSL_TRACE) + return common.skip('no SSL_trace() compiled into openssl'); + +const child = fork(__filename, ['test'], { + silent: true, + execArgv: ['--trace-tls'] +}); + +let stdout = ''; +let stderr = ''; +child.stdout.setEncoding('utf8'); +child.stderr.setEncoding('utf8'); +child.stdout.on('data', (data) => stdout += data); +child.stderr.on('data', (data) => stderr += data); +child.on('close', common.mustCall((code, signal) => { + // For debugging and observation of actual trace output. + console.log(stderr); + + assert.strictEqual(code, 0); + assert.strictEqual(signal, null); + assert.strictEqual(stdout.trim(), ''); + assert.match(stderr, /Warning: Enabling --trace-tls can expose sensitive/); + assert.match(stderr, /Sent Record/); +})); + +function test() { + const { + connect, keys + } = require(fixtures.path('tls-connect')); + + connect({ + client: { + checkServerIdentity: (servername, cert) => { }, + ca: `${keys.agent1.cert}\n${keys.agent6.ca}`, + }, + server: { + cert: keys.agent6.cert, + key: keys.agent6.key + }, + }, common.mustCall((err, pair, cleanup) => { + if (pair.server.err) { + console.trace('server', pair.server.err); + } + if (pair.client.err) { + console.trace('client', pair.client.err); + } + assert.ifError(pair.server.err); + assert.ifError(pair.client.err); + + return cleanup(); + })); +} diff --git a/tests/node_compat/test/parallel/test-tls-enable-trace.js b/tests/node_compat/test/parallel/test-tls-enable-trace.js new file mode 100644 index 0000000000..30be82b47e --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-enable-trace.js @@ -0,0 +1,65 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) common.skip('missing crypto'); +const fixtures = require('../common/fixtures'); + +// Test enableTrace: option for TLS. + +const assert = require('assert'); +const { fork } = require('child_process'); + +if (process.argv[2] === 'test') + return test(); + +const binding = require('internal/test/binding').internalBinding; + +if (!binding('tls_wrap').HAVE_SSL_TRACE) + return common.skip('no SSL_trace() compiled into openssl'); + +const child = fork(__filename, ['test'], { silent: true }); + +let stderr = ''; +child.stderr.setEncoding('utf8'); +child.stderr.on('data', (data) => stderr += data); +child.on('close', common.mustCall(() => { + assert.match(stderr, /Received Record/); + assert.match(stderr, /ClientHello/); +})); + +// For debugging and observation of actual trace output. +child.stderr.pipe(process.stderr); +child.stdout.pipe(process.stdout); + +child.on('exit', common.mustCall((code) => { + assert.strictEqual(code, 0); +})); + +function test() { + const { + connect, keys + } = require(fixtures.path('tls-connect')); + + connect({ + client: { + checkServerIdentity: (servername, cert) => { }, + ca: `${keys.agent1.cert}\n${keys.agent6.ca}`, + }, + server: { + cert: keys.agent6.cert, + key: keys.agent6.key, + enableTrace: true, + }, + }, common.mustCall((err, pair, cleanup) => { + pair.client.conn.enableTrace(); + + return cleanup(); + })); +} diff --git a/tests/node_compat/test/parallel/test-tls-env-extra-ca-no-crypto.js b/tests/node_compat/test/parallel/test-tls-env-extra-ca-no-crypto.js new file mode 100644 index 0000000000..7ed55855b5 --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-env-extra-ca-no-crypto.js @@ -0,0 +1,29 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const fixtures = require('../common/fixtures'); +const assert = require('assert'); +const { fork } = require('child_process'); + +// This test ensures that trying to load extra certs won't throw even when +// there is no crypto support, i.e., built with "./configure --without-ssl". +if (process.argv[2] === 'child') { + // exit +} else { + const NODE_EXTRA_CA_CERTS = fixtures.path('keys', 'ca1-cert.pem'); + + fork( + __filename, + ['child'], + { env: { ...process.env, NODE_EXTRA_CA_CERTS } }, + ).on('exit', common.mustCall(function(status) { + // Client did not succeed in connecting + assert.strictEqual(status, 0); + })); +} diff --git a/tests/node_compat/test/parallel/test-tls-ocsp-callback.js b/tests/node_compat/test/parallel/test-tls-ocsp-callback.js new file mode 100644 index 0000000000..ca89ef3838 --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-ocsp-callback.js @@ -0,0 +1,120 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); + +if (!common.opensslCli) + common.skip('node compiled without OpenSSL CLI.'); + +if (!common.hasCrypto) + common.skip('missing crypto'); + +const tls = require('tls'); +const fixtures = require('../common/fixtures'); + +const assert = require('assert'); + +const SSL_OP_NO_TICKET = require('crypto').constants.SSL_OP_NO_TICKET; + +const pfx = fixtures.readKey('agent1.pfx'); +const key = fixtures.readKey('agent1-key.pem'); +const cert = fixtures.readKey('agent1-cert.pem'); +const ca = fixtures.readKey('ca1-cert.pem'); + +function test(testOptions, cb) { + const options = { + key, + cert, + ca: [ca] + }; + const requestCount = testOptions.response ? 0 : 1; + + if (!testOptions.ocsp) + assert.strictEqual(testOptions.response, undefined); + + if (testOptions.pfx) { + delete options.key; + delete options.cert; + options.pfx = testOptions.pfx; + options.passphrase = testOptions.passphrase; + } + + const server = tls.createServer(options, common.mustCall((cleartext) => { + cleartext.on('error', function(er) { + // We're ok with getting ECONNRESET in this test, but it's + // timing-dependent, and thus unreliable. Any other errors + // are just failures, though. + if (er.code !== 'ECONNRESET') + throw er; + }); + cleartext.end(); + }, requestCount)); + + if (!testOptions.ocsp) + server.on('OCSPRequest', common.mustNotCall()); + else + server.on('OCSPRequest', common.mustCall((cert, issuer, callback) => { + assert.ok(Buffer.isBuffer(cert)); + assert.ok(Buffer.isBuffer(issuer)); + + // Callback a little later to ensure that async really works. + return setTimeout(callback, 100, null, testOptions.response ? + Buffer.from(testOptions.response) : null); + })); + + server.listen(0, function() { + const client = tls.connect({ + port: this.address().port, + requestOCSP: testOptions.ocsp, + secureOptions: testOptions.ocsp ? 0 : SSL_OP_NO_TICKET, + rejectUnauthorized: false + }, common.mustCall(requestCount)); + + client.on('OCSPResponse', common.mustCall((resp) => { + if (testOptions.response) { + assert.strictEqual(resp.toString(), testOptions.response); + client.destroy(); + } else { + assert.strictEqual(resp, null); + } + }, testOptions.ocsp === false ? 0 : 1)); + + client.on('close', common.mustCall(() => { + server.close(cb); + })); + }); +} + +test({ ocsp: true, response: false }); +test({ ocsp: true, response: 'hello world' }); +test({ ocsp: false }); + +if (!common.hasFipsCrypto) { + test({ ocsp: true, response: 'hello pfx', pfx: pfx, passphrase: 'sample' }); +} diff --git a/tests/node_compat/test/parallel/test-tls-psk-server.js b/tests/node_compat/test/parallel/test-tls-psk-server.js new file mode 100644 index 0000000000..2263fb901d --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-psk-server.js @@ -0,0 +1,84 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +if (!common.hasCrypto) + common.skip('missing crypto'); +if (!common.opensslCli) + common.skip('missing openssl cli'); + +const assert = require('assert'); + +const tls = require('tls'); +const spawn = require('child_process').spawn; + +const CIPHERS = 'PSK+HIGH'; +const KEY = 'd731ef57be09e5204f0b205b60627028'; +const IDENTITY = 'TestUser'; + +const server = tls.createServer({ + ciphers: CIPHERS, + pskIdentityHint: IDENTITY, + pskCallback(socket, identity) { + assert.ok(socket instanceof tls.TLSSocket); + assert.ok(typeof identity === 'string'); + if (identity === IDENTITY) + return Buffer.from(KEY, 'hex'); + } +}); + +server.on('connection', common.mustCall()); + +server.on('secureConnection', (socket) => { + socket.write('hello\r\n'); + + socket.on('data', (data) => { + socket.write(data); + }); +}); + +let gotHello = false; +let sentWorld = false; +let gotWorld = false; + +server.listen(0, () => { + const client = spawn(common.opensslCli, [ + 's_client', + '-connect', `127.0.0.1:${server.address().port}`, + '-cipher', CIPHERS, + '-psk', KEY, + '-psk_identity', IDENTITY, + ]); + + let out = ''; + + client.stdout.setEncoding('utf8'); + client.stdout.on('data', (d) => { + out += d; + + if (!gotHello && /hello/.test(out)) { + gotHello = true; + client.stdin.write('world\r\n'); + sentWorld = true; + } + + if (!gotWorld && /world/.test(out)) { + gotWorld = true; + client.stdin.end(); + } + }); + + client.on('exit', common.mustCall((code) => { + assert.ok(gotHello); + assert.ok(sentWorld); + assert.ok(gotWorld); + assert.strictEqual(code, 0); + server.close(); + })); +}); diff --git a/tests/node_compat/test/parallel/test-tls-securepair-server.js b/tests/node_compat/test/parallel/test-tls-securepair-server.js new file mode 100644 index 0000000000..67c727f880 --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-securepair-server.js @@ -0,0 +1,152 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.opensslCli) + common.skip('missing openssl-cli'); + +const assert = require('assert'); +const tls = require('tls'); +const net = require('net'); +const spawn = require('child_process').spawn; +const fixtures = require('../common/fixtures'); + +const key = fixtures.readKey('rsa_private.pem'); +const cert = fixtures.readKey('rsa_cert.crt'); + +function log(a) { + console.error('***server***', a); +} + +const server = net.createServer(common.mustCall(function(socket) { + log(`connection fd=${socket.fd}`); + const sslcontext = tls.createSecureContext({ key, cert }); + sslcontext.context.setCiphers('RC4-SHA:AES128-SHA:AES256-SHA'); + + const pair = tls.createSecurePair(sslcontext, true); + + assert.ok(pair.encrypted.writable); + assert.ok(pair.cleartext.writable); + + pair.encrypted.pipe(socket); + socket.pipe(pair.encrypted); + + log('i set it secure'); + + pair.on('secure', function() { + log('connected+secure!'); + pair.cleartext.write('hello\r\n'); + log(pair.cleartext.getPeerCertificate()); + log(pair.cleartext.getCipher()); + }); + + pair.cleartext.on('data', function(data) { + log(`read bytes ${data.length}`); + pair.cleartext.write(data); + }); + + socket.on('end', function() { + log('socket end'); + }); + + pair.cleartext.on('error', function(err) { + log('got error: '); + log(err); + socket.destroy(); + }); + + pair.encrypted.on('error', function(err) { + log('encrypted error: '); + log(err); + socket.destroy(); + }); + + socket.on('error', function(err) { + log('socket error: '); + log(err); + socket.destroy(); + }); + + socket.on('close', function(err) { + log('socket closed'); + }); + + pair.on('error', function(err) { + log('secure error: '); + log(err); + socket.destroy(); + }); +})); + +let gotHello = false; +let sentWorld = false; +let gotWorld = false; + +server.listen(0, common.mustCall(function() { + // To test use: openssl s_client -connect localhost:8000 + + const args = ['s_client', '-connect', `127.0.0.1:${this.address().port}`]; + + const client = spawn(common.opensslCli, args); + + + let out = ''; + + client.stdout.setEncoding('utf8'); + client.stdout.on('data', function(d) { + out += d; + + if (!gotHello && /hello/.test(out)) { + gotHello = true; + client.stdin.write('world\r\n'); + sentWorld = true; + } + + if (!gotWorld && /world/.test(out)) { + gotWorld = true; + client.stdin.end(); + } + }); + + client.stdout.pipe(process.stdout, { end: false }); + + client.on('exit', common.mustCall(function(code) { + assert.strictEqual(code, 0); + server.close(); + })); +})); + +process.on('exit', function() { + assert.ok(gotHello); + assert.ok(sentWorld); + assert.ok(gotWorld); +}); diff --git a/tests/node_compat/test/parallel/test-tls-server-verify.js b/tests/node_compat/test/parallel/test-tls-server-verify.js new file mode 100644 index 0000000000..e4fe6ef4c0 --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-server-verify.js @@ -0,0 +1,355 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); + +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.opensslCli) + common.skip('node compiled without OpenSSL CLI.'); + +// This is a rather complex test which sets up various TLS servers with node +// and connects to them using the 'openssl s_client' command line utility +// with various keys. Depending on the certificate authority and other +// parameters given to the server, the various clients are +// - rejected, +// - accepted and "unauthorized", or +// - accepted and "authorized". + +const assert = require('assert'); +const { spawn } = require('child_process'); +const { SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION } = + require('crypto').constants; +const tls = require('tls'); +const fixtures = require('../common/fixtures'); + +const testCases = + [{ title: 'Do not request certs. Everyone is unauthorized.', + requestCert: false, + rejectUnauthorized: false, + renegotiate: false, + CAs: ['ca1-cert'], + clients: + [{ name: 'agent1', shouldReject: false, shouldAuth: false }, + { name: 'agent2', shouldReject: false, shouldAuth: false }, + { name: 'agent3', shouldReject: false, shouldAuth: false }, + { name: 'nocert', shouldReject: false, shouldAuth: false }, + ] }, + + { title: 'Allow both authed and unauthed connections with CA1', + requestCert: true, + rejectUnauthorized: false, + renegotiate: false, + CAs: ['ca1-cert'], + clients: + [{ name: 'agent1', shouldReject: false, shouldAuth: true }, + { name: 'agent2', shouldReject: false, shouldAuth: false }, + { name: 'agent3', shouldReject: false, shouldAuth: false }, + { name: 'nocert', shouldReject: false, shouldAuth: false }, + ] }, + + { title: 'Do not request certs at connection. Do that later', + requestCert: false, + rejectUnauthorized: false, + renegotiate: true, + CAs: ['ca1-cert'], + clients: + [{ name: 'agent1', shouldReject: false, shouldAuth: true }, + { name: 'agent2', shouldReject: false, shouldAuth: false }, + { name: 'agent3', shouldReject: false, shouldAuth: false }, + { name: 'nocert', shouldReject: false, shouldAuth: false }, + ] }, + + { title: 'Allow only authed connections with CA1', + requestCert: true, + rejectUnauthorized: true, + renegotiate: false, + CAs: ['ca1-cert'], + clients: + [{ name: 'agent1', shouldReject: false, shouldAuth: true }, + { name: 'agent2', shouldReject: true }, + { name: 'agent3', shouldReject: true }, + { name: 'nocert', shouldReject: true }, + ] }, + + { title: 'Allow only authed connections with CA1 and CA2', + requestCert: true, + rejectUnauthorized: true, + renegotiate: false, + CAs: ['ca1-cert', 'ca2-cert'], + clients: + [{ name: 'agent1', shouldReject: false, shouldAuth: true }, + { name: 'agent2', shouldReject: true }, + { name: 'agent3', shouldReject: false, shouldAuth: true }, + { name: 'nocert', shouldReject: true }, + ] }, + + + { title: 'Allow only certs signed by CA2 but not in the CRL', + requestCert: true, + rejectUnauthorized: true, + renegotiate: false, + CAs: ['ca2-cert'], + crl: 'ca2-crl', + clients: [ + { name: 'agent1', shouldReject: true, shouldAuth: false }, + { name: 'agent2', shouldReject: true, shouldAuth: false }, + { name: 'agent3', shouldReject: false, shouldAuth: true }, + // Agent4 has a cert in the CRL. + { name: 'agent4', shouldReject: true, shouldAuth: false }, + { name: 'nocert', shouldReject: true }, + ] }, + ]; + +function filenamePEM(n) { + return fixtures.path('keys', `${n}.pem`); +} + +function loadPEM(n) { + return fixtures.readKey(`${n}.pem`); +} + + +const serverKey = loadPEM('agent2-key'); +const serverCert = loadPEM('agent2-cert'); + + +function runClient(prefix, port, options, cb) { + + // Client can connect in three ways: + // - Self-signed cert + // - Certificate, but not signed by CA. + // - Certificate signed by CA. + + const args = ['s_client', '-connect', `127.0.0.1:${port}`]; + + console.log(`${prefix} connecting with`, options.name); + + switch (options.name) { + case 'agent1': + // Signed by CA1 + args.push('-key'); + args.push(filenamePEM('agent1-key')); + args.push('-cert'); + args.push(filenamePEM('agent1-cert')); + break; + + case 'agent2': + // Self-signed + // This is also the key-cert pair that the server will use. + args.push('-key'); + args.push(filenamePEM('agent2-key')); + args.push('-cert'); + args.push(filenamePEM('agent2-cert')); + break; + + case 'agent3': + // Signed by CA2 + args.push('-key'); + args.push(filenamePEM('agent3-key')); + args.push('-cert'); + args.push(filenamePEM('agent3-cert')); + break; + + case 'agent4': + // Signed by CA2 (rejected by ca2-crl) + args.push('-key'); + args.push(filenamePEM('agent4-key')); + args.push('-cert'); + args.push(filenamePEM('agent4-cert')); + break; + + case 'nocert': + // Do not send certificate + break; + + default: + throw new Error(`${prefix}Unknown agent name`); + } + + // To test use: openssl s_client -connect localhost:8000 + const client = spawn(common.opensslCli, args); + + let out = ''; + + let rejected = true; + let authed = false; + let goodbye = false; + + client.stdout.setEncoding('utf8'); + client.stdout.on('data', function(d) { + out += d; + + if (!goodbye && /_unauthed/.test(out)) { + console.error(`${prefix} * unauthed`); + goodbye = true; + client.kill(); + authed = false; + rejected = false; + } + + if (!goodbye && /_authed/.test(out)) { + console.error(`${prefix} * authed`); + goodbye = true; + client.kill(); + authed = true; + rejected = false; + } + }); + + client.on('exit', function(code) { + if (options.shouldReject) { + assert.strictEqual( + rejected, true, + `${prefix}${options.name} NOT rejected, but should have been`); + } else { + assert.strictEqual( + rejected, false, + `${prefix}${options.name} rejected, but should NOT have been`); + assert.strictEqual( + authed, options.shouldAuth, + `${prefix}${options.name} authed is ${authed} but should have been ${ + options.shouldAuth}`); + } + + cb(); + }); +} + + +// Run the tests +let successfulTests = 0; +function runTest(port, testIndex) { + const prefix = `${testIndex} `; + const tcase = testCases[testIndex]; + if (!tcase) return; + + console.error(`${prefix}Running '${tcase.title}'`); + + const cas = tcase.CAs.map(loadPEM); + + const crl = tcase.crl ? loadPEM(tcase.crl) : null; + + const serverOptions = { + key: serverKey, + cert: serverCert, + ca: cas, + crl: crl, + requestCert: tcase.requestCert, + rejectUnauthorized: tcase.rejectUnauthorized + }; + + // If renegotiating - session might be resumed and openssl won't request + // client's certificate (probably because of bug in the openssl) + if (tcase.renegotiate) { + serverOptions.secureOptions = + SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION; + // Renegotiation as a protocol feature was dropped after TLS1.2. + serverOptions.maxVersion = 'TLSv1.2'; + } + + let renegotiated = false; + const server = tls.Server(serverOptions, function handleConnection(c) { + c.on('error', function(e) { + // child.kill() leads ECONNRESET error in the TLS connection of + // openssl s_client via spawn(). A test result is already + // checked by the data of client.stdout before child.kill() so + // these tls errors can be ignored. + }); + if (tcase.renegotiate && !renegotiated) { + renegotiated = true; + setTimeout(function() { + console.error(`${prefix}- connected, renegotiating`); + c.write('\n_renegotiating\n'); + return c.renegotiate({ + requestCert: true, + rejectUnauthorized: false + }, function(err) { + assert.ifError(err); + c.write('\n_renegotiated\n'); + handleConnection(c); + }); + }, 200); + return; + } + + if (c.authorized) { + console.error(`${prefix}- authed connection: ${ + c.getPeerCertificate().subject.CN}`); + c.write('\n_authed\n'); + } else { + console.error(`${prefix}- unauthed connection: %s`, c.authorizationError); + c.write('\n_unauthed\n'); + } + }); + + function runNextClient(clientIndex) { + const options = tcase.clients[clientIndex]; + if (options) { + runClient(`${prefix}${clientIndex} `, port, options, function() { + runNextClient(clientIndex + 1); + }); + } else { + server.close(); + successfulTests++; + runTest(0, nextTest++); + } + } + + server.listen(port, function() { + port = server.address().port; + if (tcase.debug) { + console.error(`${prefix}TLS server running on port ${port}`); + } else if (tcase.renegotiate) { + runNextClient(0); + } else { + let clientsCompleted = 0; + for (let i = 0; i < tcase.clients.length; i++) { + runClient(`${prefix}${i} `, port, tcase.clients[i], function() { + clientsCompleted++; + if (clientsCompleted === tcase.clients.length) { + server.close(); + successfulTests++; + runTest(0, nextTest++); + } + }); + } + } + }); +} + + +let nextTest = 0; +runTest(0, nextTest++); + + +process.on('exit', function() { + assert.strictEqual(successfulTests, testCases.length); +}); diff --git a/tests/node_compat/test/parallel/test-tls-session-cache.js b/tests/node_compat/test/parallel/test-tls-session-cache.js new file mode 100644 index 0000000000..c1523d7617 --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-session-cache.js @@ -0,0 +1,171 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const fixtures = require('../common/fixtures'); +const assert = require('assert'); +const tls = require('tls'); +const { spawn } = require('child_process'); + +if (!common.opensslCli) + common.skip('node compiled without OpenSSL CLI.'); + + +doTest({ tickets: false }, function() { + doTest({ tickets: true }, function() { + doTest({ tickets: false, invalidSession: true }, function() { + console.error('all done'); + }); + }); +}); + +function doTest(testOptions, callback) { + const key = fixtures.readKey('rsa_private.pem'); + const cert = fixtures.readKey('rsa_cert.crt'); + const options = { + key, + cert, + ca: [cert], + requestCert: true, + rejectUnauthorized: false, + secureProtocol: 'TLS_method', + ciphers: 'RSA@SECLEVEL=0' + }; + let requestCount = 0; + let resumeCount = 0; + let newSessionCount = 0; + let session; + + const server = tls.createServer(options, function(cleartext) { + cleartext.on('error', function(er) { + // We're ok with getting ECONNRESET in this test, but it's + // timing-dependent, and thus unreliable. Any other errors + // are just failures, though. + if (er.code !== 'ECONNRESET') + throw er; + }); + ++requestCount; + cleartext.end(''); + }); + server.on('newSession', function(id, data, cb) { + ++newSessionCount; + // Emulate asynchronous store + setImmediate(() => { + assert.ok(!session); + session = { id, data }; + cb(); + }); + }); + server.on('resumeSession', function(id, callback) { + ++resumeCount; + assert.ok(session); + assert.strictEqual(session.id.toString('hex'), id.toString('hex')); + + let data = session.data; + + // Return an invalid session to test Node does not crash. + if (testOptions.invalidSession) { + data = Buffer.from('INVALID SESSION'); + session = null; + } + + // Just to check that async really works there + setImmediate(() => { + callback(null, data); + }); + }); + + server.listen(0, function() { + const args = [ + 's_client', + '-tls1', + '-cipher', (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT'), + '-connect', `localhost:${this.address().port}`, + '-servername', 'ohgod', + '-key', fixtures.path('keys/rsa_private.pem'), + '-cert', fixtures.path('keys/rsa_cert.crt'), + '-reconnect', + ].concat(testOptions.tickets ? [] : '-no_ticket'); + + function spawnClient() { + const client = spawn(common.opensslCli, args, { + stdio: [ 0, 1, 'pipe' ] + }); + let err = ''; + client.stderr.setEncoding('utf8'); + client.stderr.on('data', function(chunk) { + err += chunk; + }); + + client.on('exit', common.mustCall(function(code, signal) { + if (code !== 0) { + // If SmartOS and connection refused, then retry. See + // https://github.com/nodejs/node/issues/2663. + if (common.isSunOS && err.includes('Connection refused')) { + requestCount = 0; + spawnClient(); + return; + } + assert.fail(`code: ${code}, signal: ${signal}, output: ${err}`); + } + assert.strictEqual(code, 0); + server.close(common.mustCall(function() { + setImmediate(callback); + })); + })); + } + + spawnClient(); + }); + + process.on('exit', function() { + // Each test run connects 6 times: an initial request and 5 reconnect + // requests. + assert.strictEqual(requestCount, 6); + + if (testOptions.tickets) { + // No session cache callbacks are called. + assert.strictEqual(resumeCount, 0); + assert.strictEqual(newSessionCount, 0); + } else if (testOptions.invalidSession) { + // The resume callback was called, but each connection established a + // fresh session. + assert.strictEqual(resumeCount, 5); + assert.strictEqual(newSessionCount, 6); + } else { + // The resume callback was called, and only the initial connection + // establishes a fresh session. + assert.ok(session); + assert.strictEqual(resumeCount, 5); + assert.strictEqual(newSessionCount, 1); + } + }); +} diff --git a/tests/node_compat/test/parallel/test-tls-set-ciphers.js b/tests/node_compat/test/parallel/test-tls-set-ciphers.js new file mode 100644 index 0000000000..c7dddd9aa0 --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-set-ciphers.js @@ -0,0 +1,138 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +if (!common.hasOpenSSL3) + common.skip('missing crypto, or OpenSSL version lower than 3'); + +const fixtures = require('../common/fixtures'); +const { inspect } = require('util'); + +// Test cipher: option for TLS. + +const { + assert, connect, keys +} = require(fixtures.path('tls-connect')); + + +function test(cciphers, sciphers, cipher, cerr, serr, options) { + assert(cipher || cerr || serr, 'test missing any expectations'); + const where = inspect(new Error()).split('\n')[2].replace(/[^(]*/, ''); + + const max_tls_ver = (ciphers, options) => { + if (options instanceof Object && Object.hasOwn(options, 'maxVersion')) + return options.maxVersion; + if ((typeof ciphers === 'string' || ciphers instanceof String) && ciphers.length > 0 && !ciphers.includes('TLS_')) + return 'TLSv1.2'; + + return 'TLSv1.3'; + }; + + connect({ + client: { + checkServerIdentity: (servername, cert) => { }, + ca: `${keys.agent1.cert}\n${keys.agent6.ca}`, + ciphers: cciphers, + maxVersion: max_tls_ver(cciphers, options), + }, + server: { + cert: keys.agent6.cert, + key: keys.agent6.key, + ciphers: sciphers, + maxVersion: max_tls_ver(sciphers, options), + }, + }, common.mustCall((err, pair, cleanup) => { + function u(_) { return _ === undefined ? 'U' : _; } + console.log('test:', u(cciphers), u(sciphers), + 'expect', u(cipher), u(cerr), u(serr)); + console.log(' ', where); + if (!cipher) { + console.log('client', pair.client.err ? pair.client.err.code : undefined); + console.log('server', pair.server.err ? pair.server.err.code : undefined); + if (cerr) { + assert(pair.client.err); + assert.strictEqual(pair.client.err.code, cerr); + } + if (serr) { + assert(pair.server.err); + assert.strictEqual(pair.server.err.code, serr); + } + return cleanup(); + } + + const reply = 'So long and thanks for all the fish.'; + + assert.ifError(err); + assert.ifError(pair.server.err); + assert.ifError(pair.client.err); + assert(pair.server.conn); + assert(pair.client.conn); + assert.strictEqual(pair.client.conn.getCipher().name, cipher); + assert.strictEqual(pair.server.conn.getCipher().name, cipher); + + pair.server.conn.write(reply); + + pair.client.conn.on('data', common.mustCall((data) => { + assert.strictEqual(data.toString(), reply); + return cleanup(); + })); + })); +} + +const U = undefined; + +// Have shared ciphers. +test(U, 'AES256-SHA', 'AES256-SHA'); +test('AES256-SHA', U, 'AES256-SHA'); + +test(U, 'TLS_AES_256_GCM_SHA384', 'TLS_AES_256_GCM_SHA384'); +test('TLS_AES_256_GCM_SHA384', U, 'TLS_AES_256_GCM_SHA384'); +test('TLS_AES_256_GCM_SHA384:!TLS_CHACHA20_POLY1305_SHA256', U, 'TLS_AES_256_GCM_SHA384'); + +// Do not have shared ciphers. +test('TLS_AES_256_GCM_SHA384', 'TLS_CHACHA20_POLY1305_SHA256', + U, 'ERR_SSL_SSLV3_ALERT_HANDSHAKE_FAILURE', 'ERR_SSL_NO_SHARED_CIPHER'); + +test('AES128-SHA', 'AES256-SHA', U, 'ERR_SSL_SSLV3_ALERT_HANDSHAKE_FAILURE', + 'ERR_SSL_NO_SHARED_CIPHER'); +test('AES128-SHA:TLS_AES_256_GCM_SHA384', + 'TLS_CHACHA20_POLY1305_SHA256:AES256-SHA', + U, 'ERR_SSL_SSLV3_ALERT_HANDSHAKE_FAILURE', 'ERR_SSL_NO_SHARED_CIPHER'); + +// Cipher order ignored, TLS1.3 chosen before TLS1.2. +test('AES256-SHA:TLS_AES_256_GCM_SHA384', U, 'TLS_AES_256_GCM_SHA384'); +test(U, 'AES256-SHA:TLS_AES_256_GCM_SHA384', 'TLS_AES_256_GCM_SHA384'); + +// Cipher order ignored, TLS1.3 before TLS1.2 and +// cipher suites are not disabled if TLS ciphers are set only +// TODO: maybe these tests should be reworked so maxVersion clamping +// is done explicitly and not implicitly in the test() function +test('AES256-SHA', U, 'TLS_AES_256_GCM_SHA384', U, U, { maxVersion: 'TLSv1.3' }); +test(U, 'AES256-SHA', 'TLS_AES_256_GCM_SHA384', U, U, { maxVersion: 'TLSv1.3' }); + +// TLS_AES_128_CCM_8_SHA256 & TLS_AES_128_CCM_SHA256 are not enabled by +// default, but work. +test('TLS_AES_128_CCM_8_SHA256', U, + U, 'ERR_SSL_SSLV3_ALERT_HANDSHAKE_FAILURE', 'ERR_SSL_NO_SHARED_CIPHER'); + +test('TLS_AES_128_CCM_8_SHA256', 'TLS_AES_128_CCM_8_SHA256', + 'TLS_AES_128_CCM_8_SHA256'); + +// Invalid cipher values +test(9, 'AES256-SHA', U, 'ERR_INVALID_ARG_TYPE', U); +test('AES256-SHA', 9, U, U, 'ERR_INVALID_ARG_TYPE'); +test(':', 'AES256-SHA', U, 'ERR_INVALID_ARG_VALUE', U); +test('AES256-SHA', ':', U, U, 'ERR_INVALID_ARG_VALUE'); + +// Using '' is synonymous for "use default ciphers" +test('TLS_AES_256_GCM_SHA384', '', 'TLS_AES_256_GCM_SHA384'); +test('', 'TLS_AES_256_GCM_SHA384', 'TLS_AES_256_GCM_SHA384'); + +// Using null should be treated the same as undefined. +test(null, 'AES256-SHA', 'AES256-SHA'); +test('AES256-SHA', null, 'AES256-SHA'); diff --git a/tests/node_compat/test/parallel/test-tls-transport-destroy-after-own-gc.js b/tests/node_compat/test/parallel/test-tls-transport-destroy-after-own-gc.js new file mode 100644 index 0000000000..68ec2c8f90 --- /dev/null +++ b/tests/node_compat/test/parallel/test-tls-transport-destroy-after-own-gc.js @@ -0,0 +1,36 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-gc +'use strict'; + +// Regression test for https://github.com/nodejs/node/issues/17475 +// Unfortunately, this tests only "works" reliably when checked with valgrind or +// a similar tool. + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const { TLSSocket } = require('tls'); +const makeDuplexPair = require('../common/duplexpair'); + +let { clientSide } = makeDuplexPair(); + +let clientTLS = new TLSSocket(clientSide, { isServer: false }); +let clientTLSHandle = clientTLS._handle; // eslint-disable-line no-unused-vars + +setImmediate(() => { + clientTLS = null; + global.gc(); + clientTLSHandle = null; + global.gc(); + setImmediate(() => { + clientSide = null; + global.gc(); + }); +}); diff --git a/tests/node_compat/test/parallel/test-trace-events-async-hooks-dynamic.js b/tests/node_compat/test/parallel/test-trace-events-async-hooks-dynamic.js new file mode 100644 index 0000000000..6c320b54c0 --- /dev/null +++ b/tests/node_compat/test/parallel/test-trace-events-async-hooks-dynamic.js @@ -0,0 +1,69 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// This tests that tracing can be enabled dynamically with the +// trace_events module. + +const common = require('../common'); +try { + require('trace_events'); +} catch { + common.skip('missing trace events'); +} + +const assert = require('assert'); +const cp = require('child_process'); +const fs = require('fs'); + +const enable = `require("trace_events").createTracing( +{ categories: ["node.async_hooks"] }).enable();`; +const code = + 'setTimeout(() => { for (let i = 0; i < 100000; i++) { "test" + i } }, 1)'; + +const tmpdir = require('../common/tmpdir'); +const filename = tmpdir.resolve('node_trace.1.log'); + +tmpdir.refresh(); +const proc = cp.spawnSync( + process.execPath, + ['-e', enable + code ], + { + cwd: tmpdir.path, + env: { ...process.env, + 'NODE_DEBUG_NATIVE': 'tracing', + 'NODE_DEBUG': 'tracing' } + }); + +console.log('process exit with signal:', proc.signal); +console.log('process stderr:', proc.stderr.toString()); + +assert.strictEqual(proc.status, 0); +assert(fs.existsSync(filename)); +const data = fs.readFileSync(filename, 'utf-8'); +const traces = JSON.parse(data).traceEvents; + +function filterTimeoutTraces(trace) { + if (trace.pid !== proc.pid) + return false; + if (trace.cat !== 'node,node.async_hooks') + return false; + if (trace.name !== 'Timeout') + return false; + return true; +} + +{ + const timeoutTraces = traces.filter(filterTimeoutTraces); + assert.notDeepStrictEqual(timeoutTraces, []); + const threads = new Set(); + for (const trace of timeoutTraces) { + threads.add(trace.tid); + } + assert.notDeepStrictEqual(timeoutTraces, []); +} diff --git a/tests/node_compat/test/parallel/test-trace-events-async-hooks-worker.js b/tests/node_compat/test/parallel/test-trace-events-async-hooks-worker.js new file mode 100644 index 0000000000..c924afc56d --- /dev/null +++ b/tests/node_compat/test/parallel/test-trace-events-async-hooks-worker.js @@ -0,0 +1,78 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// This tests that enabling node.async_hooks in main threads also +// affects the workers. + +const common = require('../common'); +try { + require('trace_events'); +} catch { + common.skip('missing trace events'); +} + +const assert = require('assert'); +const cp = require('child_process'); +const fs = require('fs'); + +const code = + 'setTimeout(() => { for (let i = 0; i < 100000; i++) { "test" + i } }, 1)'; +const worker = +`const { Worker } = require('worker_threads'); +const worker = new Worker('${code}', +{ eval: true, stdout: true, stderr: true }); +worker.stdout.on('data', + (chunk) => console.log('worker', chunk.toString())); +worker.stderr.on('data', + (chunk) => console.error('worker', chunk.toString())); +worker.on('exit', () => { ${code} })`; + +const tmpdir = require('../common/tmpdir'); +const filename = tmpdir.resolve('node_trace.1.log'); + +tmpdir.refresh(); +const proc = cp.spawnSync( + process.execPath, + [ '--trace-event-categories', 'node.async_hooks', '-e', worker ], + { + cwd: tmpdir.path, + env: { ...process.env, + 'NODE_DEBUG_NATIVE': 'tracing', + 'NODE_DEBUG': 'tracing' } + }); + +console.log('process exit with signal:', proc.signal); +console.log('process stderr:', proc.stderr.toString()); + +assert.strictEqual(proc.status, 0); +assert(fs.existsSync(filename)); +const data = fs.readFileSync(filename, 'utf-8'); +const traces = JSON.parse(data).traceEvents; + +function filterTimeoutTraces(trace) { + if (trace.pid !== proc.pid) + return false; + if (trace.cat !== 'node,node.async_hooks') + return false; + if (trace.name !== 'Timeout') + return false; + return true; +} + +{ + const timeoutTraces = traces.filter(filterTimeoutTraces); + assert.notDeepStrictEqual(timeoutTraces, []); + const threads = new Set(); + for (const trace of timeoutTraces) { + threads.add(trace.tid); + } + assert.notDeepStrictEqual(timeoutTraces, []); + console.log('Threads with Timeout traces:', threads); + assert.strictEqual(threads.size, 2); +} diff --git a/tests/node_compat/test/parallel/test-tz-version.js b/tests/node_compat/test/parallel/test-tz-version.js new file mode 100644 index 0000000000..e09c23db55 --- /dev/null +++ b/tests/node_compat/test/parallel/test-tz-version.js @@ -0,0 +1,35 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +if (!common.hasIntl) { + common.skip('missing Intl'); +} + +// Refs: https://github.com/nodejs/node/blob/1af63a90ca3a59ca05b3a12ad7dbea04008db7d9/configure.py#L1694-L1711 +if (process.config.variables.icu_path !== 'deps/icu-small') { + // If Node.js is configured to use its built-in ICU, it uses a strict subset + // of ICU formed using `tools/icu/shrink-icu-src.py`, which is present in + // `deps/icu-small`. It is not the same as configuring the build with + // `./configure --with-intl=small-icu`. The latter only uses a subset of the + // locales, i.e., it uses the English locale, `root,en`, by default and other + // locales can also be specified using the `--with-icu-locales` option. + common.skip('not using the icu data file present in deps/icu-small/source/data/in/icudt##l.dat.bz2'); +} + +const fixtures = require('../common/fixtures'); + +// This test ensures the correctness of the automated timezone upgrade PRs. + +const { strictEqual } = require('assert'); +const { readFileSync } = require('fs'); + +const expectedVersion = readFileSync(fixtures.path('tz-version.txt'), 'utf8').trim(); +strictEqual(process.versions.tz, expectedVersion); diff --git a/tests/node_compat/test/parallel/test-utf8-scripts.js b/tests/node_compat/test/parallel/test-utf8-scripts.js new file mode 100644 index 0000000000..e18b4fa71a --- /dev/null +++ b/tests/node_compat/test/parallel/test-utf8-scripts.js @@ -0,0 +1,37 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); + +// üäö + +console.log('Σὲ γνωρίζω ἀπὸ τὴν κόψη'); + +assert.match('Hellö Wörld', /Hellö Wörld/); diff --git a/tests/node_compat/test/parallel/test-util-inspect-getters-accessing-this.js b/tests/node_compat/test/parallel/test-util-inspect-getters-accessing-this.js new file mode 100644 index 0000000000..14a2be456c --- /dev/null +++ b/tests/node_compat/test/parallel/test-util-inspect-getters-accessing-this.js @@ -0,0 +1,74 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); + +// This test ensures that util.inspect logs getters +// which access this. + +const assert = require('assert'); + +const { inspect } = require('util'); + +{ + class X { + constructor() { + this._y = 123; + } + + get y() { + return this._y; + } + } + + const result = inspect(new X(), { + getters: true, + showHidden: true + }); + + assert.strictEqual( + result, + 'X { _y: 123, [y]: [Getter: 123] }' + ); +} + +// Regression test for https://github.com/nodejs/node/issues/37054 +{ + class A { + constructor(B) { + this.B = B; + } + get b() { + return this.B; + } + } + + class B { + constructor() { + this.A = new A(this); + } + get a() { + return this.A; + } + } + + const result = inspect(new B(), { + depth: 1, + getters: true, + showHidden: true + }); + + assert.strictEqual( + result, + ' B {\n' + + ' A: A { B: [Circular *1], [b]: [Getter] [Circular *1] },\n' + + ' [a]: [Getter] A { B: [Circular *1], [b]: [Getter] [Circular *1] }\n' + + '}', + ); +} diff --git a/tests/node_compat/test/parallel/test-util-primordial-monkeypatching.js b/tests/node_compat/test/parallel/test-util-primordial-monkeypatching.js new file mode 100644 index 0000000000..927a350428 --- /dev/null +++ b/tests/node_compat/test/parallel/test-util-primordial-monkeypatching.js @@ -0,0 +1,18 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// Monkeypatch Object.keys() so that it throws an unexpected error. This tests +// that `util.inspect()` is unaffected by monkey-patching `Object`. + +require('../common'); +const assert = require('assert'); +const util = require('util'); + +Object.keys = () => { throw new Error('fhqwhgads'); }; +assert.strictEqual(util.inspect({}), '{}'); diff --git a/tests/node_compat/test/parallel/test-uv-binding-constant.js b/tests/node_compat/test/parallel/test-uv-binding-constant.js new file mode 100644 index 0000000000..a4b74fddae --- /dev/null +++ b/tests/node_compat/test/parallel/test-uv-binding-constant.js @@ -0,0 +1,26 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; + +require('../common'); +const assert = require('assert'); +const { internalBinding } = require('internal/test/binding'); +const uv = internalBinding('uv'); + +// Ensures that the `UV_...` values in internalBinding('uv') +// are constants. + +const keys = Object.keys(uv); +keys.forEach((key) => { + if (key.startsWith('UV_')) { + const val = uv[key]; + assert.throws(() => uv[key] = 1, TypeError); + assert.strictEqual(uv[key], val); + } +}); diff --git a/tests/node_compat/test/parallel/test-uv-unmapped-exception.js b/tests/node_compat/test/parallel/test-uv-unmapped-exception.js new file mode 100644 index 0000000000..7e0ff2b682 --- /dev/null +++ b/tests/node_compat/test/parallel/test-uv-unmapped-exception.js @@ -0,0 +1,33 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --expose-internals +'use strict'; +require('../common'); +const assert = require('assert'); +const { uvException, uvExceptionWithHostPort } = require('internal/errors'); + +{ + const exception = uvException({ errno: 100, syscall: 'open' }); + + assert.strictEqual(exception.message, 'UNKNOWN: unknown error, open'); + assert.strictEqual(exception.errno, 100); + assert.strictEqual(exception.syscall, 'open'); + assert.strictEqual(exception.code, 'UNKNOWN'); +} + +{ + const exception = uvExceptionWithHostPort(100, 'listen', '127.0.0.1', 80); + + assert.strictEqual(exception.message, + 'listen UNKNOWN: unknown error 127.0.0.1:80'); + assert.strictEqual(exception.code, 'UNKNOWN'); + assert.strictEqual(exception.errno, 100); + assert.strictEqual(exception.syscall, 'listen'); + assert.strictEqual(exception.address, '127.0.0.1'); + assert.strictEqual(exception.port, 80); +} diff --git a/tests/node_compat/test/parallel/test-v8-coverage.js b/tests/node_compat/test/parallel/test-v8-coverage.js new file mode 100644 index 0000000000..4b3c01a438 --- /dev/null +++ b/tests/node_compat/test/parallel/test-v8-coverage.js @@ -0,0 +1,212 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +if (!process.features.inspector) return; + +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); +const { spawnSync } = require('child_process'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +let dirc = 0; +function nextdir() { + return `cov_${++dirc}`; +} + +// Outputs coverage when event loop is drained, with no async logic. +{ + const coverageDirectory = tmpdir.resolve(nextdir()); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/v8-coverage/basic'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + if (output.status !== 0) { + console.log(output.stderr.toString()); + } + assert.strictEqual(output.status, 0); + assert.strictEqual(output.stderr.toString(), ''); + const fixtureCoverage = getFixtureCoverage('basic.js', coverageDirectory); + assert.ok(fixtureCoverage); + // First branch executed. + assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); + // Second branch did not execute. + assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); +} + +// Outputs coverage when error is thrown in first tick. +{ + const coverageDirectory = tmpdir.resolve(nextdir()); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/v8-coverage/throw'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + if (output.status !== 1) { + console.log(output.stderr.toString()); + } + assert.strictEqual(output.status, 1); + const fixtureCoverage = getFixtureCoverage('throw.js', coverageDirectory); + assert.ok(fixtureCoverage, 'coverage not found for file'); + // First branch executed. + assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); + // Second branch did not execute. + assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); +} + +// Outputs coverage when process.exit(1) exits process. +{ + const coverageDirectory = tmpdir.resolve(nextdir()); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/v8-coverage/exit-1'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + if (output.status !== 1) { + console.log(output.stderr.toString()); + } + assert.strictEqual(output.status, 1); + assert.strictEqual(output.stderr.toString(), ''); + const fixtureCoverage = getFixtureCoverage('exit-1.js', coverageDirectory); + assert.ok(fixtureCoverage, 'coverage not found for file'); + // First branch executed. + assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); + // Second branch did not execute. + assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); +} + +// Outputs coverage when process.kill(process.pid, "SIGINT"); exits process. +{ + const coverageDirectory = tmpdir.resolve(nextdir()); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/v8-coverage/sigint'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + if (!common.isWindows) { + if (output.signal !== 'SIGINT') { + console.log(output.stderr.toString()); + } + assert.strictEqual(output.signal, 'SIGINT'); + } + assert.strictEqual(output.stderr.toString(), ''); + const fixtureCoverage = getFixtureCoverage('sigint.js', coverageDirectory); + assert.ok(fixtureCoverage); + // First branch executed. + assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); + // Second branch did not execute. + assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); +} + +// Outputs coverage from subprocess. +{ + const coverageDirectory = tmpdir.resolve(nextdir()); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/v8-coverage/spawn-subprocess'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + if (output.status !== 0) { + console.log(output.stderr.toString()); + } + assert.strictEqual(output.status, 0); + assert.strictEqual(output.stderr.toString(), ''); + const fixtureCoverage = getFixtureCoverage('subprocess.js', + coverageDirectory); + assert.ok(fixtureCoverage); + // First branch executed. + assert.strictEqual(fixtureCoverage.functions[1].ranges[0].count, 1); + // Second branch did not execute. + assert.strictEqual(fixtureCoverage.functions[1].ranges[1].count, 0); +} + +// Outputs coverage from worker. +{ + const coverageDirectory = tmpdir.resolve(nextdir()); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/v8-coverage/worker'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + if (output.status !== 0) { + console.log(output.stderr.toString()); + } + assert.strictEqual(output.status, 0); + assert.strictEqual(output.stderr.toString(), ''); + const fixtureCoverage = getFixtureCoverage('subprocess.js', + coverageDirectory); + assert.ok(fixtureCoverage); + // First branch executed. + assert.strictEqual(fixtureCoverage.functions[1].ranges[0].count, 1); + // Second branch did not execute. + assert.strictEqual(fixtureCoverage.functions[1].ranges[1].count, 0); +} + +// Does not output coverage if NODE_V8_COVERAGE is empty. +{ + const coverageDirectory = tmpdir.resolve(nextdir()); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/v8-coverage/spawn-subprocess-no-cov'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + if (output.status !== 0) { + console.log(output.stderr.toString()); + } + assert.strictEqual(output.status, 0); + assert.strictEqual(output.stderr.toString(), ''); + const fixtureCoverage = getFixtureCoverage('subprocess.js', + coverageDirectory); + assert.strictEqual(fixtureCoverage, undefined); +} + +// Disables async hooks before writing coverage. +{ + const coverageDirectory = tmpdir.resolve(nextdir()); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/v8-coverage/async-hooks'), + ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); + if (output.status !== 0) { + console.log(output.stderr.toString()); + } + assert.strictEqual(output.status, 0); + assert.strictEqual(output.stderr.toString(), ''); + const fixtureCoverage = getFixtureCoverage('async-hooks.js', + coverageDirectory); + assert.ok(fixtureCoverage); + // First branch executed. + assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); +} + +// Outputs coverage when the coverage directory is not absolute. +{ + const coverageDirectory = nextdir(); + const absoluteCoverageDirectory = tmpdir.resolve(coverageDirectory); + const output = spawnSync(process.execPath, [ + require.resolve('../fixtures/v8-coverage/basic'), + ], { + cwd: tmpdir.path, + env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } + }); + if (output.status !== 0) { + console.log(output.stderr.toString()); + } + assert.strictEqual(output.status, 0); + assert.strictEqual(output.stderr.toString(), ''); + const fixtureCoverage = getFixtureCoverage('basic.js', + absoluteCoverageDirectory); + assert.ok(fixtureCoverage); + // First branch executed. + assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); + // Second branch did not execute. + assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); +} + +// Extracts the coverage object for a given fixture name. +function getFixtureCoverage(fixtureFile, coverageDirectory) { + const coverageFiles = fs.readdirSync(coverageDirectory); + for (const coverageFile of coverageFiles) { + const coverage = require(path.join(coverageDirectory, coverageFile)); + for (const fixtureCoverage of coverage.result) { + if (fixtureCoverage.url.indexOf(`/${fixtureFile}`) !== -1) { + return fixtureCoverage; + } + } + } +} diff --git a/tests/node_compat/test/parallel/test-v8-deserialize-buffer.js b/tests/node_compat/test/parallel/test-v8-deserialize-buffer.js new file mode 100644 index 0000000000..5740e0dbab --- /dev/null +++ b/tests/node_compat/test/parallel/test-v8-deserialize-buffer.js @@ -0,0 +1,14 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const v8 = require('v8'); + +process.on('warning', common.mustNotCall()); +v8.deserialize(v8.serialize(Buffer.alloc(0))); diff --git a/tests/node_compat/test/parallel/test-v8-flag-pool-size-0.js b/tests/node_compat/test/parallel/test-v8-flag-pool-size-0.js new file mode 100644 index 0000000000..cce685573d --- /dev/null +++ b/tests/node_compat/test/parallel/test-v8-flag-pool-size-0.js @@ -0,0 +1,17 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --v8-pool-size=0 --expose-gc + +'use strict'; + +require('../common'); + +// This verifies that V8 tasks scheduled by GC are handled on worker threads if +// `--v8-pool-size=0` is given. The worker threads are managed by Node.js' +// `v8::Platform` implementation. +globalThis.gc(); diff --git a/tests/node_compat/test/parallel/test-v8-global-setter.js b/tests/node_compat/test/parallel/test-v8-global-setter.js new file mode 100644 index 0000000000..68ee7230f8 --- /dev/null +++ b/tests/node_compat/test/parallel/test-v8-global-setter.js @@ -0,0 +1,36 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); + +// This test ensures v8 correctly sets a property on the global object if it +// has a setter interceptor in strict mode. +// https://github.com/nodejs/node-v0.x-archive/issues/6235 + +require('vm').runInNewContext('"use strict"; var v = 1; v = 2'); diff --git a/tests/node_compat/test/parallel/test-v8-stop-coverage.js b/tests/node_compat/test/parallel/test-v8-stop-coverage.js new file mode 100644 index 0000000000..6092d7115d --- /dev/null +++ b/tests/node_compat/test/parallel/test-v8-stop-coverage.js @@ -0,0 +1,41 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +if (!process.features.inspector) return; + +require('../common'); +const fixtures = require('../common/fixtures'); +const tmpdir = require('../common/tmpdir'); +const assert = require('assert'); +const fs = require('fs'); +const { spawnSync } = require('child_process'); + +tmpdir.refresh(); +const intervals = 20; + +{ + const output = spawnSync(process.execPath, [ + '-r', + fixtures.path('v8-coverage', 'stop-coverage'), + '-r', + fixtures.path('v8-coverage', 'take-coverage'), + fixtures.path('v8-coverage', 'interval'), + ], { + env: { + ...process.env, + NODE_V8_COVERAGE: tmpdir.path, + NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER', + TEST_INTERVALS: intervals + }, + }); + console.log(output.stderr.toString()); + assert.strictEqual(output.status, 0); + const coverageFiles = fs.readdirSync(tmpdir.path); + assert.strictEqual(coverageFiles.length, 0); +} diff --git a/tests/node_compat/test/parallel/test-v8-take-coverage-noop.js b/tests/node_compat/test/parallel/test-v8-take-coverage-noop.js new file mode 100644 index 0000000000..931895097e --- /dev/null +++ b/tests/node_compat/test/parallel/test-v8-take-coverage-noop.js @@ -0,0 +1,39 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +if (!process.features.inspector) return; + +require('../common'); +const fixtures = require('../common/fixtures'); +const tmpdir = require('../common/tmpdir'); +const assert = require('assert'); +const fs = require('fs'); +const { spawnSync } = require('child_process'); + +tmpdir.refresh(); + +// v8.takeCoverage() should be a noop if NODE_V8_COVERAGE is not set. +const intervals = 40; +{ + const output = spawnSync(process.execPath, [ + '-r', + fixtures.path('v8-coverage', 'take-coverage'), + fixtures.path('v8-coverage', 'interval'), + ], { + env: { + ...process.env, + NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER', + TEST_INTERVALS: intervals + }, + }); + console.log(output.stderr.toString()); + assert.strictEqual(output.status, 0); + const coverageFiles = fs.readdirSync(tmpdir.path); + assert.strictEqual(coverageFiles.length, 0); +} diff --git a/tests/node_compat/test/parallel/test-v8-take-coverage.js b/tests/node_compat/test/parallel/test-v8-take-coverage.js new file mode 100644 index 0000000000..af5bd7b402 --- /dev/null +++ b/tests/node_compat/test/parallel/test-v8-take-coverage.js @@ -0,0 +1,91 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +if (!process.features.inspector) return; + +require('../common'); +const fixtures = require('../common/fixtures'); +const tmpdir = require('../common/tmpdir'); +const assert = require('assert'); +const fs = require('fs'); +const { spawnSync } = require('child_process'); + +tmpdir.refresh(); +const intervals = 40; +// Outputs coverage when v8.takeCoverage() is invoked. +{ + const output = spawnSync(process.execPath, [ + '-r', + fixtures.path('v8-coverage', 'take-coverage'), + fixtures.path('v8-coverage', 'interval'), + ], { + env: { + ...process.env, + NODE_V8_COVERAGE: tmpdir.path, + NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER', + TEST_INTERVALS: intervals + }, + }); + console.log(output.stderr.toString()); + assert.strictEqual(output.status, 0); + const coverageFiles = fs.readdirSync(tmpdir.path); + + let coverages = []; + for (const coverageFile of coverageFiles) { + const coverage = require(tmpdir.resolve(coverageFile)); + for (const result of coverage.result) { + if (result.url.includes('/interval')) { + coverages.push({ + file: coverageFile, + func: result.functions.find((f) => f.functionName === 'interval'), + timestamp: coverage.timestamp + }); + } + } + } + + coverages = coverages.sort((a, b) => { return a.timestamp - b.timestamp; }); + // There should be two coverages taken, one triggered by v8.takeCoverage(), + // the other by process exit. + console.log('Coverages:', coverages); + assert.strictEqual(coverages.length, 3); + + let blockHitsTotal = 0; + for (let i = 0; i < coverages.length; ++i) { + const { ranges } = coverages[i].func; + console.log('coverage', i, ranges); + + if (i !== coverages.length - 1) { + // When the first two coverages are taken: + assert.strictEqual(ranges.length, 2); + const blockHits = ranges[0].count; + // The block inside interval() should be hit at least once. + assert.notStrictEqual(blockHits, 0); + blockHitsTotal += blockHits; + // The else branch should not be hit. + const elseBranchHits = ranges[1].count; + assert.strictEqual(elseBranchHits, 0); + } else { + // At process exit: + assert.strictEqual(ranges.length, 3); + const blockHits = ranges[0].count; + // The block inside interval() should be hit at least once more. + assert.notStrictEqual(blockHits, 0); + blockHitsTotal += blockHits; + // The else branch should be hit exactly once. + const elseBranchHits = ranges[2].count; + assert.strictEqual(elseBranchHits, 1); + const ifBranchHits = ranges[1].count; + assert.strictEqual(ifBranchHits, blockHits - elseBranchHits); + } + } + + // The block should be hit `intervals` times in total. + assert.strictEqual(blockHitsTotal, intervals); +} diff --git a/tests/node_compat/test/parallel/test-weakref.js b/tests/node_compat/test/parallel/test-weakref.js new file mode 100644 index 0000000000..119bf612ae --- /dev/null +++ b/tests/node_compat/test/parallel/test-weakref.js @@ -0,0 +1,20 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +// Flags: --expose-gc + +require('../common'); +const assert = require('assert'); + +const w = new globalThis.WeakRef({}); + +setTimeout(() => { + globalThis.gc(); + assert.strictEqual(w.deref(), undefined); +}, 200); diff --git a/tests/node_compat/test/parallel/test-webcrypto-encrypt-decrypt.js b/tests/node_compat/test/parallel/test-webcrypto-encrypt-decrypt.js new file mode 100644 index 0000000000..1bbfd185e1 --- /dev/null +++ b/tests/node_compat/test/parallel/test-webcrypto-encrypt-decrypt.js @@ -0,0 +1,131 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const { subtle } = globalThis.crypto; + +// This is only a partial test. The WebCrypto Web Platform Tests +// will provide much greater coverage. + +// Test Encrypt/Decrypt RSA-OAEP +{ + const buf = globalThis.crypto.getRandomValues(new Uint8Array(50)); + + async function test() { + const ec = new TextEncoder(); + const { publicKey, privateKey } = await subtle.generateKey({ + name: 'RSA-OAEP', + modulusLength: 2048, + publicExponent: new Uint8Array([1, 0, 1]), + hash: 'SHA-384', + }, true, ['encrypt', 'decrypt']); + + const ciphertext = await subtle.encrypt({ + name: 'RSA-OAEP', + label: ec.encode('a label') + }, publicKey, buf); + + const plaintext = await subtle.decrypt({ + name: 'RSA-OAEP', + label: ec.encode('a label') + }, privateKey, ciphertext); + + assert.strictEqual( + Buffer.from(plaintext).toString('hex'), + Buffer.from(buf).toString('hex')); + } + + test().then(common.mustCall()); +} + +// Test Encrypt/Decrypt AES-CTR +{ + const buf = globalThis.crypto.getRandomValues(new Uint8Array(50)); + const counter = globalThis.crypto.getRandomValues(new Uint8Array(16)); + + async function test() { + const key = await subtle.generateKey({ + name: 'AES-CTR', + length: 256 + }, true, ['encrypt', 'decrypt']); + + const ciphertext = await subtle.encrypt( + { name: 'AES-CTR', counter, length: 64 }, key, buf, + ); + + const plaintext = await subtle.decrypt( + { name: 'AES-CTR', counter, length: 64 }, key, ciphertext, + ); + + assert.strictEqual( + Buffer.from(plaintext).toString('hex'), + Buffer.from(buf).toString('hex')); + } + + test().then(common.mustCall()); +} + +// Test Encrypt/Decrypt AES-CBC +{ + const buf = globalThis.crypto.getRandomValues(new Uint8Array(50)); + const iv = globalThis.crypto.getRandomValues(new Uint8Array(16)); + + async function test() { + const key = await subtle.generateKey({ + name: 'AES-CBC', + length: 256 + }, true, ['encrypt', 'decrypt']); + + const ciphertext = await subtle.encrypt( + { name: 'AES-CBC', iv }, key, buf, + ); + + const plaintext = await subtle.decrypt( + { name: 'AES-CBC', iv }, key, ciphertext, + ); + + assert.strictEqual( + Buffer.from(plaintext).toString('hex'), + Buffer.from(buf).toString('hex')); + } + + test().then(common.mustCall()); +} + +// Test Encrypt/Decrypt AES-GCM +{ + const buf = globalThis.crypto.getRandomValues(new Uint8Array(50)); + const iv = globalThis.crypto.getRandomValues(new Uint8Array(12)); + + async function test() { + const key = await subtle.generateKey({ + name: 'AES-GCM', + length: 256 + }, true, ['encrypt', 'decrypt']); + + const ciphertext = await subtle.encrypt( + { name: 'AES-GCM', iv }, key, buf, + ); + + const plaintext = await subtle.decrypt( + { name: 'AES-GCM', iv }, key, ciphertext, + ); + + assert.strictEqual( + Buffer.from(plaintext).toString('hex'), + Buffer.from(buf).toString('hex')); + } + + test().then(common.mustCall()); +} diff --git a/tests/node_compat/test/parallel/test-websocket.js b/tests/node_compat/test/parallel/test-websocket.js new file mode 100644 index 0000000000..3251711732 --- /dev/null +++ b/tests/node_compat/test/parallel/test-websocket.js @@ -0,0 +1,14 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Flags: --experimental-websocket +'use strict'; + +require('../common'); +const assert = require('assert'); + +assert.strictEqual(typeof WebSocket, 'function'); diff --git a/tests/node_compat/test/parallel/test-webstream-string-tag.js b/tests/node_compat/test/parallel/test-webstream-string-tag.js new file mode 100644 index 0000000000..9c44b57ce8 --- /dev/null +++ b/tests/node_compat/test/parallel/test-webstream-string-tag.js @@ -0,0 +1,25 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); + +const assert = require('assert'); + +const classesToBeTested = [ WritableStream, WritableStreamDefaultWriter, WritableStreamDefaultController, + ReadableStream, ReadableStreamBYOBRequest, ReadableStreamDefaultReader, + ReadableStreamBYOBReader, ReadableStreamDefaultController, ReadableByteStreamController, + ByteLengthQueuingStrategy, CountQueuingStrategy, TransformStream, + TransformStreamDefaultController]; + + +classesToBeTested.forEach((cls) => { + assert.strictEqual(cls.prototype[Symbol.toStringTag], cls.name); + assert.deepStrictEqual(Object.getOwnPropertyDescriptor(cls.prototype, Symbol.toStringTag), + { configurable: true, enumerable: false, value: cls.name, writable: false }); +}); diff --git a/tests/node_compat/test/parallel/test-whatwg-readablebytestreambyob.js b/tests/node_compat/test/parallel/test-whatwg-readablebytestreambyob.js new file mode 100644 index 0000000000..db0125bde1 --- /dev/null +++ b/tests/node_compat/test/parallel/test-whatwg-readablebytestreambyob.js @@ -0,0 +1,69 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +const { + open, +} = require('fs/promises'); + +const { + Buffer, +} = require('buffer'); + +class Source { + async start(controller) { + this.file = await open(__filename); + this.controller = controller; + } + + async pull(controller) { + const byobRequest = controller.byobRequest; + const view = byobRequest.view; + + const { + bytesRead, + } = await this.file.read({ + buffer: view, + offset: view.byteOffset, + length: view.byteLength + }); + + if (bytesRead === 0) { + await this.file.close(); + this.controller.close(); + } + + byobRequest.respond(bytesRead); + } + + get type() { return 'bytes'; } + + get autoAllocateChunkSize() { return 1024; } +} + +(async () => { + const source = new Source(); + const stream = new ReadableStream(source); + + const { emitWarning } = process; + + process.emitWarning = common.mustNotCall(); + + try { + const reader = stream.getReader({ mode: 'byob' }); + + let result; + do { + result = await reader.read(Buffer.alloc(100)); + } while (!result.done); + } finally { + process.emitWarning = emitWarning; + } +})().then(common.mustCall()); diff --git a/tests/node_compat/test/parallel/test-worker-cleanexit-with-js.js b/tests/node_compat/test/parallel/test-worker-cleanexit-with-js.js new file mode 100644 index 0000000000..1be06d3347 --- /dev/null +++ b/tests/node_compat/test/parallel/test-worker-cleanexit-with-js.js @@ -0,0 +1,28 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +// Harden the thread interactions on the exit path. +// Ensure workers are able to bail out safe at +// arbitrary execution points. By running a lot of +// JS code in a tight loop, the expectation +// is that those will be at various control flow points +// preferably in the JS land. + +const { Worker } = require('worker_threads'); +const code = 'setInterval(() => {' + + "require('v8').deserialize(require('v8').serialize({ foo: 'bar' }));" + + "require('vm').runInThisContext('x = \"foo\";');" + + "eval('const y = \"vm\";');}, 10);"; +for (let i = 0; i < 9; i++) { + new Worker(code, { eval: true }); +} +new Worker(code, { eval: true }).on('online', common.mustCall((msg) => { + process.exit(0); +})); diff --git a/tests/node_compat/test/parallel/test-worker-on-process-exit.js b/tests/node_compat/test/parallel/test-worker-on-process-exit.js new file mode 100644 index 0000000000..4e821c2ac6 --- /dev/null +++ b/tests/node_compat/test/parallel/test-worker-on-process-exit.js @@ -0,0 +1,29 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); +const { spawnSync } = require('child_process'); +const { Worker } = require('worker_threads'); + +// Test that 'exit' events for Workers are not received when the main thread +// terminates itself through process.exit(). + +if (process.argv[2] !== 'child') { + const { + stdout, stderr, status + } = spawnSync(process.execPath, [__filename, 'child'], { encoding: 'utf8' }); + assert.strictEqual(stderr, ''); + assert.strictEqual(stdout, ''); + assert.strictEqual(status, 0); +} else { + const nestedWorker = new Worker('setInterval(() => {}, 100)', { eval: true }); + // This console.log() should never fire. + nestedWorker.on('exit', () => console.log('exit event received')); + nestedWorker.on('online', () => process.exit()); +} diff --git a/tests/node_compat/test/parallel/test-worker-ref-onexit.js b/tests/node_compat/test/parallel/test-worker-ref-onexit.js new file mode 100644 index 0000000000..6bfccb7e8f --- /dev/null +++ b/tests/node_compat/test/parallel/test-worker-ref-onexit.js @@ -0,0 +1,19 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const { Worker } = require('worker_threads'); + +// Check that worker.unref() makes the 'exit' event not be emitted, if it is +// the only thing we would otherwise be waiting for. + +// Use `setInterval()` to make sure the worker is alive until the end of the +// event loop turn. +const w = new Worker('setInterval(() => {}, 100);', { eval: true }); +w.unref(); +w.on('exit', common.mustNotCall()); diff --git a/tests/node_compat/test/parallel/test-worker-terminate-unrefed.js b/tests/node_compat/test/parallel/test-worker-terminate-unrefed.js new file mode 100644 index 0000000000..3647c96efd --- /dev/null +++ b/tests/node_compat/test/parallel/test-worker-terminate-unrefed.js @@ -0,0 +1,23 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const { once } = require('events'); +const { Worker } = require('worker_threads'); + +// Test that calling worker.terminate() on an unref()’ed Worker instance +// still resolves the returned Promise. + +async function test() { + const worker = new Worker('setTimeout(() => {}, 1000000);', { eval: true }); + await once(worker, 'online'); + worker.unref(); + await worker.terminate(); +} + +test().then(common.mustCall()); diff --git a/tests/node_compat/test/parallel/test-zlib-create-raw.js b/tests/node_compat/test/parallel/test-zlib-create-raw.js new file mode 100644 index 0000000000..d8367a889b --- /dev/null +++ b/tests/node_compat/test/parallel/test-zlib-create-raw.js @@ -0,0 +1,22 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); +const assert = require('assert'); +const zlib = require('zlib'); + +{ + const inflateRaw = zlib.createInflateRaw(); + assert(inflateRaw instanceof zlib.InflateRaw); +} + +{ + const deflateRaw = zlib.createDeflateRaw(); + assert(deflateRaw instanceof zlib.DeflateRaw); +} diff --git a/tests/node_compat/test/parallel/test-zlib-flush-write-sync-interleaved.js b/tests/node_compat/test/parallel/test-zlib-flush-write-sync-interleaved.js new file mode 100644 index 0000000000..c398880fc7 --- /dev/null +++ b/tests/node_compat/test/parallel/test-zlib-flush-write-sync-interleaved.js @@ -0,0 +1,64 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const { createGzip, createGunzip, Z_PARTIAL_FLUSH } = require('zlib'); + +// Verify that .flush() behaves like .write() in terms of ordering, e.g. in +// a sequence like .write() + .flush() + .write() + .flush() each .flush() call +// only affects the data written before it. +// Refs: https://github.com/nodejs/node/issues/28478 + +const compress = createGzip(); +const decompress = createGunzip(); +decompress.setEncoding('utf8'); + +const events = []; +const compressedChunks = []; + +for (const chunk of ['abc', 'def', 'ghi']) { + compress.write(chunk, common.mustCall(() => events.push({ written: chunk }))); + compress.flush(Z_PARTIAL_FLUSH, common.mustCall(() => { + events.push('flushed'); + const chunk = compress.read(); + if (chunk !== null) + compressedChunks.push(chunk); + })); +} + +compress.end(common.mustCall(() => { + events.push('compress end'); + writeToDecompress(); +})); + +function writeToDecompress() { + // Write the compressed chunks to a decompressor, one by one, in order to + // verify that the flushes actually worked. + const chunk = compressedChunks.shift(); + if (chunk === undefined) return decompress.end(); + decompress.write(chunk, common.mustCall(() => { + events.push({ read: decompress.read() }); + writeToDecompress(); + })); +} + +process.on('exit', () => { + assert.deepStrictEqual(events, [ + { written: 'abc' }, + 'flushed', + { written: 'def' }, + 'flushed', + { written: 'ghi' }, + 'flushed', + 'compress end', + { read: 'abc' }, + { read: 'def' }, + { read: 'ghi' }, + ]); +}); diff --git a/tests/node_compat/test/pseudo-tty/test-set-raw-mode-reset-process-exit.js b/tests/node_compat/test/pseudo-tty/test-set-raw-mode-reset-process-exit.js new file mode 100644 index 0000000000..29d2b58232 --- /dev/null +++ b/tests/node_compat/test/pseudo-tty/test-set-raw-mode-reset-process-exit.js @@ -0,0 +1,25 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const child_process = require('child_process'); + +// Tests that exiting through process.exit() resets the TTY mode. + +child_process.spawnSync(process.execPath, [ + '-e', 'process.stdin.setRawMode(true); process.exit(0)', +], { stdio: 'inherit' }); + +const { stdout } = child_process.spawnSync('stty', { + stdio: ['inherit', 'pipe', 'inherit'], + encoding: 'utf8', +}); + +if (stdout.match(/-echo\b/)) { + console.log(stdout); +} diff --git a/tests/node_compat/test/pseudo-tty/test-set-raw-mode-reset.js b/tests/node_compat/test/pseudo-tty/test-set-raw-mode-reset.js new file mode 100644 index 0000000000..2fbfeb3ee8 --- /dev/null +++ b/tests/node_compat/test/pseudo-tty/test-set-raw-mode-reset.js @@ -0,0 +1,26 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const child_process = require('child_process'); + +// Tests that exiting through normal means resets the TTY mode. +// Refs: https://github.com/nodejs/node/issues/21020 + +child_process.spawnSync(process.execPath, [ + '-e', 'process.stdin.setRawMode(true)', +], { stdio: 'inherit' }); + +const { stdout } = child_process.spawnSync('stty', { + stdio: ['inherit', 'pipe', 'inherit'], + encoding: 'utf8', +}); + +if (stdout.match(/-echo\b/)) { + console.log(stdout); +} diff --git a/tests/node_compat/test/pseudo-tty/test-tty-stdin-call-end.js b/tests/node_compat/test/pseudo-tty/test-tty-stdin-call-end.js new file mode 100644 index 0000000000..60570b5746 --- /dev/null +++ b/tests/node_compat/test/pseudo-tty/test-tty-stdin-call-end.js @@ -0,0 +1,15 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +require('../common'); + +// This tests verifies that process.stdin.end() does not +// crash the process with ENOTCONN + +process.stdin.end(); diff --git a/tests/node_compat/test/pummel/test-crypto-dh-hash.js b/tests/node_compat/test/pummel/test-crypto-dh-hash.js new file mode 100644 index 0000000000..846856806c --- /dev/null +++ b/tests/node_compat/test/pummel/test-crypto-dh-hash.js @@ -0,0 +1,66 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); + +if (!common.hasCrypto) { + common.skip('node compiled without OpenSSL.'); +} + +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); +} + +if (!common.hasOpenSSL3) { + common.skip('Too slow when dynamically linked against OpenSSL 1.1.1'); +} + +const assert = require('assert'); +const crypto = require('crypto'); + +const hashes = { + modp1: '630e9acd2cc63f7e80d8507624ba60ac0757201a', + modp2: '18f7aa964484137f57bca64b21917a385b6a0b60', + modp5: 'c0a8eec0c2c8a5ec2f9c26f9661eb339a010ec61', + modp14: 'af5455606fe74cec49782bb374e4c63c9b1d132c', + modp15: '7bdd39e5cdbb9748113933e5c2623b559c534e74', + modp16: 'daea5277a7ad0116e734a8e0d2f297ef759d1161', + modp17: '3b62aaf0142c2720f0bf26a9589b0432c00eadc1', + modp18: 'a870b491bbbec9b131ae9878d07449d32e54f160', +}; + +for (const name in hashes) { + const group = crypto.getDiffieHellman(name); + const prime = group.getPrime('hex'); + const hash1 = hashes[name]; + const hash2 = crypto.createHash('sha1') + .update(prime.toUpperCase()).digest('hex'); + assert.strictEqual(hash1, hash2); + assert.strictEqual(group.getGenerator('hex'), '02'); +} diff --git a/tests/node_compat/test/pummel/test-crypto-timing-safe-equal-benchmarks.js b/tests/node_compat/test/pummel/test-crypto-timing-safe-equal-benchmarks.js new file mode 100644 index 0000000000..e7f7b0fede --- /dev/null +++ b/tests/node_compat/test/pummel/test-crypto-timing-safe-equal-benchmarks.js @@ -0,0 +1,129 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.enoughTestMem) + common.skip('memory-intensive test'); + +const assert = require('assert'); +const crypto = require('crypto'); + +function runOneBenchmark(compareFunc, firstBufFill, secondBufFill, bufSize) { + return eval(` + const firstBuffer = Buffer.alloc(bufSize, firstBufFill); + const secondBuffer = Buffer.alloc(bufSize, secondBufFill); + + const startTime = process.hrtime(); + const result = compareFunc(firstBuffer, secondBuffer); + const endTime = process.hrtime(startTime); + + // Ensure that the result of the function call gets used, so it doesn't + // get discarded due to engine optimizations. + assert.strictEqual(result, firstBufFill === secondBufFill); + + endTime[0] * 1e9 + endTime[1]; + `); +} + +function getTValue(compareFunc) { + const numTrials = 1e5; + const bufSize = 10000; + // Perform benchmarks to verify that timingSafeEqual is actually timing-safe. + + const rawEqualBenches = Array(numTrials); + const rawUnequalBenches = Array(numTrials); + + for (let i = 0; i < numTrials; i++) { + if (Math.random() < 0.5) { + // First benchmark: comparing two equal buffers + rawEqualBenches[i] = runOneBenchmark(compareFunc, 'A', 'A', bufSize); + // Second benchmark: comparing two unequal buffers + rawUnequalBenches[i] = runOneBenchmark(compareFunc, 'B', 'C', bufSize); + } else { + // Flip the order of the benchmarks half of the time. + rawUnequalBenches[i] = runOneBenchmark(compareFunc, 'B', 'C', bufSize); + rawEqualBenches[i] = runOneBenchmark(compareFunc, 'A', 'A', bufSize); + } + } + + const equalBenches = filterOutliers(rawEqualBenches); + const unequalBenches = filterOutliers(rawUnequalBenches); + + // Use a two-sample t-test to determine whether the timing difference between + // the benchmarks is statistically significant. + // https://wikipedia.org/wiki/Student%27s_t-test#Independent_two-sample_t-test + + const equalMean = mean(equalBenches); + const unequalMean = mean(unequalBenches); + + const equalLen = equalBenches.length; + const unequalLen = unequalBenches.length; + + const combinedStd = combinedStandardDeviation(equalBenches, unequalBenches); + const standardErr = combinedStd * Math.sqrt(1 / equalLen + 1 / unequalLen); + + return (equalMean - unequalMean) / standardErr; +} + +// Returns the mean of an array +function mean(array) { + return array.reduce((sum, val) => sum + val, 0) / array.length; +} + +// Returns the sample standard deviation of an array +function standardDeviation(array) { + const arrMean = mean(array); + const total = array.reduce((sum, val) => sum + Math.pow(val - arrMean, 2), 0); + return Math.sqrt(total / (array.length - 1)); +} + +// Returns the common standard deviation of two arrays +function combinedStandardDeviation(array1, array2) { + const sum1 = Math.pow(standardDeviation(array1), 2) * (array1.length - 1); + const sum2 = Math.pow(standardDeviation(array2), 2) * (array2.length - 1); + return Math.sqrt((sum1 + sum2) / (array1.length + array2.length - 2)); +} + +// Filter large outliers from an array. A 'large outlier' is a value that is at +// least 50 times larger than the mean. This prevents the tests from failing +// due to the standard deviation increase when a function unexpectedly takes +// a very long time to execute. +function filterOutliers(array) { + const arrMean = mean(array); + return array.filter((value) => value / arrMean < 50); +} + +// t_(0.99995, ∞) +// i.e. If a given comparison function is indeed timing-safe, the t-test result +// has a 99.99% chance to be below this threshold. Unfortunately, this means +// that this test will be a bit flakey and will fail 0.01% of the time even if +// crypto.timingSafeEqual is working properly. +// t-table ref: http://www.sjsu.edu/faculty/gerstman/StatPrimer/t-table.pdf +// Note that in reality there are roughly `2 * numTrials - 2` degrees of +// freedom, not ∞. However, assuming `numTrials` is large, this doesn't +// significantly affect the threshold. +const T_THRESHOLD = 3.892; + +const t = getTValue(crypto.timingSafeEqual); +assert( + Math.abs(t) < T_THRESHOLD, + `timingSafeEqual should not leak information from its execution time (t=${t})`, +); + +// As a coherence check to make sure the statistical tests are working, run the +// same benchmarks again, this time with an unsafe comparison function. In this +// case the t-value should be above the threshold. +const unsafeCompare = (bufA, bufB) => bufA.equals(bufB); +const t2 = getTValue(unsafeCompare); +assert( + Math.abs(t2) > T_THRESHOLD, + `Buffer#equals should leak information from its execution time (t=${t2})`, +); diff --git a/tests/node_compat/test/pummel/test-dh-regr.js b/tests/node_compat/test/pummel/test-dh-regr.js new file mode 100644 index 0000000000..d09f3a2616 --- /dev/null +++ b/tests/node_compat/test/pummel/test-dh-regr.js @@ -0,0 +1,66 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); + +if (!common.hasCrypto) { + common.skip('missing crypto'); +} + +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); +} + +const assert = require('assert'); +const crypto = require('crypto'); + +// FIPS requires length >= 1024 but we use 512/256 in this test to keep it from +// taking too long and timing out in CI. +const length = (common.hasFipsCrypto) ? 1024 : common.hasOpenSSL3 ? 512 : 256; + +const p = crypto.createDiffieHellman(length).getPrime(); + +for (let i = 0; i < 2000; i++) { + const a = crypto.createDiffieHellman(p); + const b = crypto.createDiffieHellman(p); + + a.generateKeys(); + b.generateKeys(); + + const aSecret = a.computeSecret(b.getPublicKey()); + const bSecret = b.computeSecret(a.getPublicKey()); + + assert.deepStrictEqual( + aSecret, + bSecret, + 'Secrets should be equal.\n' + + `aSecret: ${aSecret.toString('base64')}\n` + + `bSecret: ${bSecret.toString('base64')}`, + ); +} diff --git a/tests/node_compat/test/pummel/test-fs-largefile.js b/tests/node_compat/test/pummel/test-fs-largefile.js new file mode 100644 index 0000000000..2a7741f092 --- /dev/null +++ b/tests/node_compat/test/pummel/test-fs-largefile.js @@ -0,0 +1,63 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); + +const assert = require('assert'); +const fs = require('fs'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +try { + + const filepath = tmpdir.resolve('large.txt'); + const fd = fs.openSync(filepath, 'w+'); + const offset = 5 * 1024 * 1024 * 1024; // 5GB + const message = 'Large File'; + + fs.ftruncateSync(fd, offset); + assert.strictEqual(fs.statSync(filepath).size, offset); + const writeBuf = Buffer.from(message); + fs.writeSync(fd, writeBuf, 0, writeBuf.length, offset); + const readBuf = Buffer.allocUnsafe(writeBuf.length); + fs.readSync(fd, readBuf, 0, readBuf.length, offset); + assert.strictEqual(readBuf.toString(), message); + fs.readSync(fd, readBuf, 0, 1, 0); + assert.strictEqual(readBuf[0], 0); + + // Verify that floating point positions do not throw. + fs.writeSync(fd, writeBuf, 0, writeBuf.length, 42.000001); + fs.close(fd, common.mustCall()); +} catch (e) { + if (e.code !== 'ENOSPC') { + throw e; + } + common.skip('insufficient disk space'); +} diff --git a/tests/node_compat/test/pummel/test-fs-readfile-tostring-fail.js b/tests/node_compat/test/pummel/test-fs-readfile-tostring-fail.js new file mode 100644 index 0000000000..b0df8eec6e --- /dev/null +++ b/tests/node_compat/test/pummel/test-fs-readfile-tostring-fail.js @@ -0,0 +1,84 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); + +if (!common.enoughTestMem) + common.skip('intensive toString tests due to memory confinements'); + +const assert = require('assert'); +const fs = require('fs'); +const cp = require('child_process'); +const kStringMaxLength = require('buffer').constants.MAX_STRING_LENGTH; +if (common.isAIX && (Number(cp.execSync('ulimit -f')) * 512) < kStringMaxLength) + common.skip('intensive toString tests due to file size confinements'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +if (!tmpdir.hasEnoughSpace(kStringMaxLength)) { + common.skip(`Not enough space in ${tmpdir.path}`); +} + +const file = tmpdir.resolve('toobig.txt'); +const stream = fs.createWriteStream(file, { + flags: 'a', +}); + +stream.on('error', (err) => { throw err; }); + +const size = kStringMaxLength / 200; +const a = Buffer.alloc(size, 'a'); +let expectedSize = 0; + +for (let i = 0; i < 201; i++) { + stream.write(a, (err) => { assert.ifError(err); }); + expectedSize += a.length; +} + +stream.end(); +stream.on('finish', common.mustCall(function() { + assert.strictEqual(stream.bytesWritten, expectedSize, + `${stream.bytesWritten} bytes written (expected ${expectedSize} bytes).`); + fs.readFile(file, 'utf8', common.mustCall(function(err, buf) { + assert.ok(err instanceof Error); + if (err.message !== 'Array buffer allocation failed') { + const stringLengthHex = kStringMaxLength.toString(16); + common.expectsError({ + message: 'Cannot create a string longer than ' + + `0x${stringLengthHex} characters`, + code: 'ERR_STRING_TOO_LONG', + name: 'Error', + })(err); + } + assert.strictEqual(buf, undefined); + })); +})); + +function destroy() { + try { + fs.unlinkSync(file); + } catch { + // it may not exist + } +} + +process.on('exit', destroy); + +process.on('SIGINT', function() { + destroy(); + process.exit(); +}); + +// To make sure we don't leave a very large file +// on test machines in the event this test fails. +process.on('uncaughtException', function(err) { + destroy(); + throw err; +}); diff --git a/tests/node_compat/test/pummel/test-fs-watch-system-limit.js b/tests/node_compat/test/pummel/test-fs-watch-system-limit.js new file mode 100644 index 0000000000..cadb48033a --- /dev/null +++ b/tests/node_compat/test/pummel/test-fs-watch-system-limit.js @@ -0,0 +1,77 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const child_process = require('child_process'); +const fs = require('fs'); +const stream = require('stream'); + +if (!common.isLinux) { + common.skip('The fs watch limit is OS-dependent'); +} + +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); +} + +try { + // Ensure inotify limit is low enough for the test to actually exercise the + // limit with small enough resources. + const limit = Number( + fs.readFileSync('/proc/sys/fs/inotify/max_user_watches', 'utf8')); + if (limit > 16384) + common.skip('inotify limit is quite large'); +} catch (e) { + if (e.code === 'ENOENT') + common.skip('the inotify /proc subsystem does not exist'); + // Fail on other errors. + throw e; +} + +const processes = []; +const gatherStderr = new stream.PassThrough(); +gatherStderr.setEncoding('utf8'); +gatherStderr.setMaxListeners(Infinity); + +let finished = false; +function spawnProcesses() { + for (let i = 0; i < 10; ++i) { + const proc = child_process.spawn( + process.execPath, + [ '-e', + `process.chdir(${JSON.stringify(__dirname)}); + for (const file of fs.readdirSync('.')) + fs.watch(file, () => {});`, + ], { stdio: ['inherit', 'inherit', 'pipe'] }); + proc.stderr.pipe(gatherStderr); + processes.push(proc); + } + + setTimeout(() => { + if (!finished && processes.length < 200) + spawnProcesses(); + }, 100); +} + +spawnProcesses(); + +let accumulated = ''; +gatherStderr.on('data', common.mustCallAtLeast((chunk) => { + accumulated += chunk; + if (accumulated.includes('Error:') && !finished) { + assert( + accumulated.includes('ENOSPC: System limit for number ' + + 'of file watchers reached') || + accumulated.includes('EMFILE: '), + accumulated); + console.log(`done after ${processes.length} processes, cleaning up`); + finished = true; + processes.forEach((proc) => proc.kill()); + } +}, 1)); diff --git a/tests/node_compat/test/pummel/test-heapsnapshot-near-heap-limit-big.js b/tests/node_compat/test/pummel/test-heapsnapshot-near-heap-limit-big.js new file mode 100644 index 0000000000..e1bb1280a3 --- /dev/null +++ b/tests/node_compat/test/pummel/test-heapsnapshot-near-heap-limit-big.js @@ -0,0 +1,49 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const tmpdir = require('../common/tmpdir'); +const assert = require('assert'); +const { spawnSync } = require('child_process'); +const fixtures = require('../common/fixtures'); +const fs = require('fs'); +const env = { + ...process.env, + NODE_DEBUG_NATIVE: 'diagnostics', +}; + +if (!common.enoughTestMem) + common.skip('Insufficient memory for snapshot test'); + +{ + console.log('\nTesting limit = 3'); + tmpdir.refresh(); + const child = spawnSync(process.execPath, [ + '--heapsnapshot-near-heap-limit=3', + '--max-old-space-size=512', + fixtures.path('workload', 'grow.js'), + ], { + cwd: tmpdir.path, + env: { + ...env, + TEST_CHUNK: 2000, + }, + }); + const stderr = child.stderr.toString(); + console.log(stderr); + assert(common.nodeProcessAborted(child.status, child.signal), + 'process should have aborted, but did not'); + const list = fs.readdirSync(tmpdir.path) + .filter((file) => file.endsWith('.heapsnapshot')); + const risky = [...stderr.matchAll( + /Not generating snapshots because it's too risky/g)].length; + assert(list.length + risky > 0 && list.length <= 3, + `Generated ${list.length} snapshots ` + + `and ${risky} was too risky`); +} diff --git a/tests/node_compat/test/pummel/test-net-many-clients.js b/tests/node_compat/test/pummel/test-net-many-clients.js new file mode 100644 index 0000000000..a1789fa355 --- /dev/null +++ b/tests/node_compat/test/pummel/test-net-many-clients.js @@ -0,0 +1,107 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +require('../common'); +const assert = require('assert'); +const net = require('net'); + +// settings +const bytes = 1024 * 40; +const concurrency = 50; +const connections_per_client = 3; + +// measured +let total_connections = 0; + +const body = 'C'.repeat(bytes); + +const server = net.createServer(function(c) { + total_connections++; + console.log('connected', total_connections); + c.write(body); + c.end(); +}); + +function runClient(port, callback) { + const client = net.createConnection(port); + + client.connections = 0; + + client.setEncoding('utf8'); + + client.on('connect', function() { + console.log('c'); + client.recved = ''; + client.connections += 1; + }); + + client.on('data', function(chunk) { + this.recved += chunk; + }); + + client.on('end', function() { + client.end(); + }); + + client.on('error', function(e) { + console.log('\n\nERROOOOOr'); + throw e; + }); + + client.on('close', function(had_error) { + console.log('.'); + assert.strictEqual(had_error, false); + assert.strictEqual(client.recved.length, bytes); + + if (client.fd) { + console.log(client.fd); + } + assert.ok(!client.fd); + + if (this.connections < connections_per_client) { + this.connect(port); + } else { + callback(); + } + }); +} + +server.listen(0, function() { + let finished_clients = 0; + for (let i = 0; i < concurrency; i++) { + runClient(server.address().port, function() { + if (++finished_clients === concurrency) server.close(); + }); + } +}); + +process.on('exit', function() { + assert.strictEqual(total_connections, connections_per_client * concurrency); + console.log('\nokay!'); +}); diff --git a/tests/node_compat/test/pummel/test-net-pingpong-delay.js b/tests/node_compat/test/pummel/test-net-pingpong-delay.js new file mode 100644 index 0000000000..8eb3edfa24 --- /dev/null +++ b/tests/node_compat/test/pummel/test-net-pingpong-delay.js @@ -0,0 +1,114 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +function pingPongTest(host, on_complete) { + const N = 100; + const DELAY = 1; + let count = 0; + let client_ended = false; + + const server = net.createServer({ allowHalfOpen: true }, function(socket) { + socket.setEncoding('utf8'); + + socket.on('data', function(data) { + console.log(data); + assert.strictEqual(data, 'PING'); + assert.strictEqual(socket.readyState, 'open'); + assert.strictEqual(count <= N, true); + setTimeout(function() { + assert.strictEqual(socket.readyState, 'open'); + socket.write('PONG'); + }, DELAY); + }); + + socket.on('timeout', function() { + console.error('server-side timeout!!'); + assert.strictEqual(false, true); + }); + + socket.on('end', function() { + console.log('server-side socket EOF'); + assert.strictEqual(socket.readyState, 'writeOnly'); + socket.end(); + }); + + socket.on('close', function(had_error) { + console.log('server-side socket.end'); + assert.strictEqual(had_error, false); + assert.strictEqual(socket.readyState, 'closed'); + socket.server.close(); + }); + }); + + server.listen(0, host, common.mustCall(function() { + const client = net.createConnection(server.address().port, host); + + client.setEncoding('utf8'); + + client.on('connect', function() { + assert.strictEqual(client.readyState, 'open'); + client.write('PING'); + }); + + client.on('data', function(data) { + console.log(data); + assert.strictEqual(data, 'PONG'); + assert.strictEqual(client.readyState, 'open'); + + setTimeout(function() { + assert.strictEqual(client.readyState, 'open'); + if (count++ < N) { + client.write('PING'); + } else { + console.log('closing client'); + client.end(); + client_ended = true; + } + }, DELAY); + }); + + client.on('timeout', function() { + console.error('client-side timeout!!'); + assert.strictEqual(false, true); + }); + + client.on('close', common.mustCall(function() { + console.log('client.end'); + assert.strictEqual(count, N + 1); + assert.ok(client_ended); + if (on_complete) on_complete(); + })); + })); +} + +pingPongTest(); diff --git a/tests/node_compat/test/pummel/test-process-cpuUsage.js b/tests/node_compat/test/pummel/test-process-cpuUsage.js new file mode 100644 index 0000000000..b571e0ced8 --- /dev/null +++ b/tests/node_compat/test/pummel/test-process-cpuUsage.js @@ -0,0 +1,37 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +require('../common'); +const assert = require('assert'); + +const start = process.cpuUsage(); + +// Run a busy-loop for specified # of milliseconds. +const RUN_FOR_MS = 500; + +// Define slop factor for checking maximum expected diff values. +const SLOP_FACTOR = 2; + +// Run a busy loop. +const now = Date.now(); +while (Date.now() - now < RUN_FOR_MS); + +// Get a diff reading from when we started. +const diff = process.cpuUsage(start); + +const MICROSECONDS_PER_MILLISECOND = 1000; + +// Diff usages should be >= 0, <= ~RUN_FOR_MS millis. +// Let's be generous with the slop factor, defined above, in case other things +// are happening on this CPU. The <= check may be invalid if the node process +// is making use of multiple CPUs, in which case, just remove it. +assert(diff.user >= 0); +assert(diff.user <= SLOP_FACTOR * RUN_FOR_MS * MICROSECONDS_PER_MILLISECOND); + +assert(diff.system >= 0); +assert(diff.system <= SLOP_FACTOR * RUN_FOR_MS * MICROSECONDS_PER_MILLISECOND); diff --git a/tests/node_compat/test/pummel/test-stream-pipe-multi.js b/tests/node_compat/test/pummel/test-stream-pipe-multi.js new file mode 100644 index 0000000000..979a722a54 --- /dev/null +++ b/tests/node_compat/test/pummel/test-stream-pipe-multi.js @@ -0,0 +1,129 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +// Test that having a bunch of streams piping in parallel +// doesn't break anything. + +require('../common'); +const assert = require('assert'); +const Stream = require('stream').Stream; +const rr = []; +const ww = []; +const cnt = 100; +const chunks = 1000; +const chunkSize = 250; +const data = Buffer.allocUnsafe(chunkSize); +let wclosed = 0; +let rclosed = 0; + +function FakeStream() { + Stream.apply(this); + this.wait = false; + this.writable = true; + this.readable = true; +} + +FakeStream.prototype = { __proto__: Stream.prototype }; + +FakeStream.prototype.write = function(chunk) { + console.error(this.ID, 'write', this.wait); + if (this.wait) { + process.nextTick(this.emit.bind(this, 'drain')); + } + this.wait = !this.wait; + return this.wait; +}; + +FakeStream.prototype.end = function() { + this.emit('end'); + process.nextTick(this.close.bind(this)); +}; + +// noop - closes happen automatically on end. +FakeStream.prototype.close = function() { + this.emit('close'); +}; + + +// Expect all streams to close properly. +process.on('exit', function() { + assert.strictEqual(wclosed, cnt); + assert.strictEqual(rclosed, cnt); +}); + +for (let i = 0; i < chunkSize; i++) { + data[i] = i; +} + +for (let i = 0; i < cnt; i++) { + const r = new FakeStream(); + r.on('close', function() { + console.error(this.ID, 'read close'); + rclosed++; + }); + rr.push(r); + + const w = new FakeStream(); + w.on('close', function() { + console.error(this.ID, 'write close'); + wclosed++; + }); + ww.push(w); + + r.ID = w.ID = i; + r.pipe(w); +} + +// Now start passing through data. +// Simulate a relatively fast async stream. +rr.forEach(function(r) { + let cnt = chunks; + let paused = false; + + r.on('pause', function() { + paused = true; + }); + + r.on('resume', function() { + paused = false; + step(); + }); + + function step() { + r.emit('data', data); + if (--cnt === 0) { + r.end(); + return; + } + if (paused) return; + process.nextTick(step); + } + + process.nextTick(step); +}); diff --git a/tests/node_compat/test/sequential/test-buffer-creation-regression.js b/tests/node_compat/test/sequential/test-buffer-creation-regression.js new file mode 100644 index 0000000000..d4b46fc894 --- /dev/null +++ b/tests/node_compat/test/sequential/test-buffer-creation-regression.js @@ -0,0 +1,43 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); + +function test(arrayBuffer, offset, length) { + const uint8Array = new Uint8Array(arrayBuffer, offset, length); + for (let i = 0; i < length; i += 1) { + uint8Array[i] = 1; + } + + const buffer = Buffer.from(arrayBuffer, offset, length); + for (let i = 0; i < length; i += 1) { + assert.strictEqual(buffer[i], 1); + } +} + +const acceptableOOMErrors = [ + 'Array buffer allocation failed', + 'Invalid array buffer length', +]; + +const length = 1000; +const offset = 4294967296; /* 1 << 32 */ +const size = offset + length; +let arrayBuffer; + +try { + arrayBuffer = new ArrayBuffer(size); +} catch (e) { + if (e instanceof RangeError && acceptableOOMErrors.includes(e.message)) + common.skip(`Unable to allocate ${size} bytes for ArrayBuffer`); + throw e; +} + +test(arrayBuffer, offset, length); diff --git a/tests/node_compat/test/sequential/test-http-server-keep-alive-timeout-slow-server.js b/tests/node_compat/test/sequential/test-http-server-keep-alive-timeout-slow-server.js new file mode 100644 index 0000000000..c07eae3f8d --- /dev/null +++ b/tests/node_compat/test/sequential/test-http-server-keep-alive-timeout-slow-server.js @@ -0,0 +1,57 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const server = http.createServer(common.mustCall((req, res) => { + if (req.url === '/first') { + res.end('ok'); + return; + } + setTimeout(() => { + res.end('ok'); + }, common.platformTimeout(500)); +}, 2)); + +server.keepAliveTimeout = common.platformTimeout(200); + +const agent = new http.Agent({ + keepAlive: true, + maxSockets: 1 +}); + +function request(path, callback) { + const port = server.address().port; + const req = http.request({ agent, path, port }, common.mustCall((res) => { + assert.strictEqual(res.statusCode, 200); + + res.setEncoding('utf8'); + + let result = ''; + res.on('data', (chunk) => { + result += chunk; + }); + + res.on('end', common.mustCall(() => { + assert.strictEqual(result, 'ok'); + callback(); + })); + })); + req.end(); +} + +server.listen(0, common.mustCall(() => { + request('/first', () => { + request('/second', () => { + server.close(); + }); + }); +})); diff --git a/tests/node_compat/test/sequential/test-net-better-error-messages-port.js b/tests/node_compat/test/sequential/test-net-better-error-messages-port.js new file mode 100644 index 0000000000..f718ca3f84 --- /dev/null +++ b/tests/node_compat/test/sequential/test-net-better-error-messages-port.js @@ -0,0 +1,24 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const net = require('net'); +const assert = require('assert'); + +const c = net.createConnection(common.PORT); + +c.on('connect', common.mustNotCall()); + +c.on('error', common.mustCall(function(error) { + // Family autoselection might be skipped if only a single address is returned by DNS. + const failedAttempt = Array.isArray(error.errors) ? error.errors[0] : error; + + assert.strictEqual(failedAttempt.code, 'ECONNREFUSED'); + assert.strictEqual(failedAttempt.port, common.PORT); + assert.match(failedAttempt.address, /^(127\.0\.0\.1|::1)$/); +})); diff --git a/tests/node_compat/test/sequential/test-net-connect-handle-econnrefused.js b/tests/node_compat/test/sequential/test-net-connect-handle-econnrefused.js new file mode 100644 index 0000000000..629705564b --- /dev/null +++ b/tests/node_compat/test/sequential/test-net-connect-handle-econnrefused.js @@ -0,0 +1,39 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const net = require('net'); +const assert = require('assert'); + +const c = net.createConnection(common.PORT); +c.on('connect', common.mustNotCall()); +c.on('error', common.mustCall((e) => { + assert.strictEqual(c.connecting, false); + assert.strictEqual(e.code, 'ECONNREFUSED'); +})); diff --git a/tests/node_compat/test/sequential/test-net-connect-local-error.js b/tests/node_compat/test/sequential/test-net-connect-local-error.js new file mode 100644 index 0000000000..d11ef37bc3 --- /dev/null +++ b/tests/node_compat/test/sequential/test-net-connect-local-error.js @@ -0,0 +1,53 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +// EADDRINUSE is expected to occur on FreeBSD +// Ref: https://github.com/nodejs/node/issues/13055 +const expectedErrorCodes = ['ECONNREFUSED', 'EADDRINUSE']; + +const optionsIPv4 = { + port: common.PORT, + family: 4, + localPort: common.PORT + 1, + localAddress: common.localhostIPv4 +}; + +const optionsIPv6 = { + host: '::1', + family: 6, + port: common.PORT + 2, + localPort: common.PORT + 3, + localAddress: '::1', +}; + +function onError(err, options) { + assert.ok(expectedErrorCodes.includes(err.code)); + assert.strictEqual(err.syscall, 'connect'); + assert.strictEqual(err.localPort, options.localPort); + assert.strictEqual(err.localAddress, options.localAddress); + assert.strictEqual( + err.message, + `connect ${err.code} ${err.address}:${err.port} ` + + `- Local (${err.localAddress}:${err.localPort})` + ); +} + +const clientIPv4 = net.connect(optionsIPv4); +clientIPv4.on('error', common.mustCall((err) => onError(err, optionsIPv4))); + +if (!common.hasIPv6) { + common.printSkipMessage('ipv6 part of test, no IPv6 support'); + return; +} + +const clientIPv6 = net.connect(optionsIPv6); +clientIPv6.on('error', common.mustCall((err) => onError(err, optionsIPv6))); diff --git a/tests/node_compat/test/sequential/test-net-reconnect-error.js b/tests/node_compat/test/sequential/test-net-reconnect-error.js new file mode 100644 index 0000000000..450a0798bf --- /dev/null +++ b/tests/node_compat/test/sequential/test-net-reconnect-error.js @@ -0,0 +1,50 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); +const net = require('net'); +const assert = require('assert'); +const N = 20; +let disconnectCount = 0; + +const c = net.createConnection(common.PORT); + +c.on('connect', common.mustNotCall('client should not have connected')); + +c.on('error', common.mustCall((error) => { + // Family autoselection might be skipped if only a single address is returned by DNS. + const actualError = Array.isArray(error.errors) ? error.errors[0] : error; + + assert.strictEqual(actualError.code, 'ECONNREFUSED'); +}, N + 1)); + +c.on('close', common.mustCall(() => { + if (disconnectCount++ < N) + c.connect(common.PORT); // reconnect +}, N + 1)); diff --git a/tests/node_compat/test/sequential/test-net-response-size.js b/tests/node_compat/test/sequential/test-net-response-size.js new file mode 100644 index 0000000000..2c279aaad0 --- /dev/null +++ b/tests/node_compat/test/sequential/test-net-response-size.js @@ -0,0 +1,82 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); + +// Make sure the net module's server doesn't throw an error when handling +// responses that are either too long or too small (especially on Windows) +// https://github.com/nodejs/node-v0.x-archive/issues/1697 + +const net = require('net'); +const cp = require('child_process'); + +if (process.argv[2] === 'server') { + // Server + + const server = net.createServer(function(conn) { + conn.on('data', function(data) { + console.log(`server received ${data.length} bytes`); + }); + + conn.on('close', function() { + server.close(); + }); + }); + + server.listen(common.PORT, '127.0.0.1', function() { + console.log('Server running.'); + }); + +} else { + // Client + + const serverProcess = cp.spawn(process.execPath, [process.argv[1], 'server']); + serverProcess.stdout.pipe(process.stdout); + serverProcess.stderr.pipe(process.stdout); + + serverProcess.stdout.once('data', function() { + const client = net.createConnection(common.PORT, '127.0.0.1'); + client.on('connect', function() { + const alot = Buffer.allocUnsafe(1024); + const alittle = Buffer.allocUnsafe(1); + + for (let i = 0; i < 100; i++) { + client.write(alot); + } + + // Block the event loop for 1 second + const start = (new Date()).getTime(); + while ((new Date()).getTime() < start + 1000); + + client.write(alittle); + + client.destroySoon(); + }); + }); +} diff --git a/tests/node_compat/test/sequential/test-net-server-bind.js b/tests/node_compat/test/sequential/test-net-server-bind.js new file mode 100644 index 0000000000..7048c097d6 --- /dev/null +++ b/tests/node_compat/test/sequential/test-net-server-bind.js @@ -0,0 +1,71 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + + +// With only a callback, server should get a port assigned by the OS +{ + const server = net.createServer(common.mustNotCall()); + + server.listen(common.mustCall(function() { + assert.ok(server.address().port > 100); + server.close(); + })); +} + +// No callback to listen(), assume we can bind in 100 ms +{ + const server = net.createServer(common.mustNotCall()); + + server.listen(common.PORT); + + setTimeout(function() { + const address = server.address(); + assert.strictEqual(address.port, common.PORT); + + if (address.family === 'IPv6') + assert.strictEqual(server._connectionKey, `6::::${address.port}`); + else + assert.strictEqual(server._connectionKey, `4:0.0.0.0:${address.port}`); + + server.close(); + }, 100); +} + +// Callback to listen() +{ + const server = net.createServer(common.mustNotCall()); + + server.listen(common.PORT + 1, common.mustCall(function() { + assert.strictEqual(server.address().port, common.PORT + 1); + server.close(); + })); +} + +// Backlog argument +{ + const server = net.createServer(common.mustNotCall()); + + server.listen(common.PORT + 2, '0.0.0.0', 127, common.mustCall(function() { + assert.strictEqual(server.address().port, common.PORT + 2); + server.close(); + })); +} + +// Backlog argument without host argument +{ + const server = net.createServer(common.mustNotCall()); + + server.listen(common.PORT + 3, 127, common.mustCall(function() { + assert.strictEqual(server.address().port, common.PORT + 3); + server.close(); + })); +} diff --git a/tests/node_compat/test/sequential/test-tls-lookup.js b/tests/node_compat/test/sequential/test-tls-lookup.js new file mode 100644 index 0000000000..3801e3073e --- /dev/null +++ b/tests/node_compat/test/sequential/test-tls-lookup.js @@ -0,0 +1,41 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const assert = require('assert'); +const tls = require('tls'); + +['foobar', 1, {}, []].forEach(function connectThrows(input) { + const opts = { + host: 'localhost', + port: common.PORT, + lookup: input + }; + + assert.throws(() => { + tls.connect(opts); + }, { + code: 'ERR_INVALID_ARG_TYPE', + name: 'TypeError' + }); +}); + +connectDoesNotThrow(common.mustCall()); + +function connectDoesNotThrow(input) { + const opts = { + host: 'localhost', + port: common.PORT, + lookup: input + }; + + tls.connect(opts); +} diff --git a/tests/node_compat/test/sequential/test-tls-psk-client.js b/tests/node_compat/test/sequential/test-tls-psk-client.js new file mode 100644 index 0000000000..89b13301f0 --- /dev/null +++ b/tests/node_compat/test/sequential/test-tls-psk-client.js @@ -0,0 +1,117 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +if (!common.hasCrypto) + common.skip('missing crypto'); +if (!common.opensslCli) + common.skip('missing openssl cli'); + +const assert = require('assert'); +const tls = require('tls'); +const net = require('net'); +const { spawn } = require('child_process'); + +const CIPHERS = 'PSK+HIGH'; +const KEY = 'd731ef57be09e5204f0b205b60627028'; +const IDENTITY = 'Client_identity'; // Hardcoded by `openssl s_server` +const useIPv4 = !common.hasIPv6; + +const server = spawn(common.opensslCli, [ + 's_server', + '-accept', common.PORT, + '-cipher', CIPHERS, + '-psk', KEY, + '-psk_hint', IDENTITY, + '-nocert', + '-rev', + ...(useIPv4 ? ['-4'] : []), +], { encoding: 'utf8' }); +let serverErr = ''; +let serverOut = ''; +server.stderr.on('data', (data) => serverErr += data); +server.stdout.on('data', (data) => serverOut += data); +server.on('error', common.mustNotCall()); +server.on('exit', (code, signal) => { + // Server is expected to be terminated by cleanUp(). + assert.strictEqual(code, null, + `'${server.spawnfile} ${server.spawnargs.join(' ')}' unexpected exited with output:\n${serverOut}\n${serverErr}`); + assert.strictEqual(signal, 'SIGTERM'); +}); + +const cleanUp = (err) => { + clearTimeout(timeout); + if (err) + console.log('Failed:', err); + server.kill(); + process.exitCode = err ? 1 : 0; +}; + +const timeout = setTimeout(() => cleanUp('Timed out'), 5000); + +function waitForPort(port, cb) { + const socket = net.connect(common.PORT, () => { + socket.on('data', () => {}); + socket.end(); + socket.on('end', cb); + }); + socket.on('error', (e) => { + if (e.code === 'ENOENT' || e.code === 'ECONNREFUSED') { + setTimeout(() => waitForPort(port, cb), 1000); + } else { + cb(e); + } + }); +} + +waitForPort(common.PORT, common.mustCall((err) => { + if (err) { + cleanUp(err); + return; + } + + const message = 'hello'; + const reverse = message.split('').reverse().join(''); + runClient(message, common.mustCall((err, data) => { + try { + if (!err) assert.strictEqual(data.trim(), reverse); + } finally { + cleanUp(err); + } + })); +})); + +function runClient(message, cb) { + const s = tls.connect(common.PORT, { + ciphers: CIPHERS, + checkServerIdentity: () => {}, + pskCallback(hint) { + // 'hint' will be null in TLS1.3. + if (hint === null || hint === IDENTITY) { + return { + identity: IDENTITY, + psk: Buffer.from(KEY, 'hex') + }; + } + } + }); + s.on('secureConnect', common.mustCall(() => { + let data = ''; + s.on('data', common.mustCallAtLeast((d) => { + data += d; + })); + s.on('end', common.mustCall(() => { + cb(null, data); + })); + s.end(message); + })); + s.on('error', (e) => { + cb(e); + }); +} diff --git a/tests/node_compat/test/sequential/test-tls-securepair-client.js b/tests/node_compat/test/sequential/test-tls-securepair-client.js new file mode 100644 index 0000000000..eed5b221c4 --- /dev/null +++ b/tests/node_compat/test/sequential/test-tls-securepair-client.js @@ -0,0 +1,193 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +const common = require('../common'); + +if (!common.opensslCli) + common.skip('node compiled without OpenSSL CLI.'); + +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (common.isWindows) + common.skip('test does not work on Windows'); // ...but it should! + +const net = require('net'); +const assert = require('assert'); +const fixtures = require('../common/fixtures'); +const tls = require('tls'); +const spawn = require('child_process').spawn; + +const useIPv4 = !common.hasIPv6; + +test1(); + +// simple/test-tls-securepair-client +function test1() { + test('keys/rsa_private.pem', 'keys/rsa_cert.crt', null, test2); +} + +// simple/test-tls-ext-key-usage +function test2() { + function check(pair) { + // "TLS Web Client Authentication" + assert.strictEqual(pair.cleartext.getPeerCertificate().ext_key_usage.length, + 1); + assert.strictEqual(pair.cleartext.getPeerCertificate().ext_key_usage[0], + '1.3.6.1.5.5.7.3.2'); + } + test('keys/agent4-key.pem', 'keys/agent4-cert.pem', check); +} + +function test(keyPath, certPath, check, next) { + const key = fixtures.readSync(keyPath).toString(); + const cert = fixtures.readSync(certPath).toString(); + + const server = spawn(common.opensslCli, ['s_server', + '-accept', 0, + '-cert', fixtures.path(certPath), + '-key', fixtures.path(keyPath), + ...(useIPv4 ? ['-4'] : []), + ]); + server.stdout.pipe(process.stdout); + server.stderr.pipe(process.stdout); + + + let state = 'WAIT-ACCEPT'; + + let serverStdoutBuffer = ''; + server.stdout.setEncoding('utf8'); + server.stdout.on('data', function(s) { + serverStdoutBuffer += s; + console.log(state); + switch (state) { + case 'WAIT-ACCEPT': { + const matches = serverStdoutBuffer.match(/ACCEPT .*?:(\d+)/); + if (matches) { + const port = matches[1]; + state = 'WAIT-HELLO'; + startClient(port); + } + break; + } + case 'WAIT-HELLO': + if (/hello/.test(serverStdoutBuffer)) { + + // End the current SSL connection and exit. + // See s_server(1ssl). + server.stdin.write('Q'); + + state = 'WAIT-SERVER-CLOSE'; + } + break; + + default: + break; + } + }); + + + const timeout = setTimeout(function() { + server.kill(); + process.exit(1); + }, 5000); + + let gotWriteCallback = false; + let serverExitCode = -1; + + server.on('exit', function(code) { + serverExitCode = code; + clearTimeout(timeout); + if (next) next(); + }); + + + function startClient(port) { + const s = new net.Stream(); + + const sslcontext = tls.createSecureContext({ key, cert }); + sslcontext.context.setCiphers('RC4-SHA:AES128-SHA:AES256-SHA'); + + const pair = tls.createSecurePair(sslcontext, false); + + assert.ok(pair.encrypted.writable); + assert.ok(pair.cleartext.writable); + + pair.encrypted.pipe(s); + s.pipe(pair.encrypted); + + s.connect(port); + + s.on('connect', function() { + console.log('client connected'); + setTimeout(function() { + pair.cleartext.write('hello\r\n', function() { + gotWriteCallback = true; + }); + }, 500); + }); + + pair.on('secure', function() { + console.log('client: connected+secure!'); + console.log('client pair.cleartext.getPeerCertificate(): %j', + pair.cleartext.getPeerCertificate()); + console.log('client pair.cleartext.getCipher(): %j', + pair.cleartext.getCipher()); + if (check) check(pair); + }); + + pair.cleartext.on('data', function(d) { + console.log('cleartext: %s', d.toString()); + }); + + s.on('close', function() { + console.log('client close'); + }); + + pair.encrypted.on('error', function(err) { + console.log(`encrypted error: ${err}`); + }); + + s.on('error', function(err) { + console.log(`socket error: ${err}`); + }); + + pair.on('error', function(err) { + console.log(`secure error: ${err}`); + }); + } + + + process.on('exit', function() { + assert.strictEqual(serverExitCode, 0); + assert.strictEqual(state, 'WAIT-SERVER-CLOSE'); + assert.ok(gotWriteCallback); + }); +} diff --git a/tests/node_compat/test/sequential/test-tls-session-timeout.js b/tests/node_compat/test/sequential/test-tls-session-timeout.js new file mode 100644 index 0000000000..b8d03c17ae --- /dev/null +++ b/tests/node_compat/test/sequential/test-tls-session-timeout.js @@ -0,0 +1,140 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; +const common = require('../common'); + +if (!common.opensslCli) + common.skip('node compiled without OpenSSL CLI.'); + +if (!common.hasCrypto) + common.skip('missing crypto'); + +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +doTest(); + +// This test consists of three TLS requests -- +// * The first one should result in a new connection because we don't have +// a valid session ticket. +// * The second one should result in connection resumption because we used +// the session ticket we saved from the first connection. +// * The third one should result in a new connection because the ticket +// that we used has expired by now. + +function doTest() { + const assert = require('assert'); + const tls = require('tls'); + const fs = require('fs'); + const fixtures = require('../common/fixtures'); + const spawn = require('child_process').spawn; + + const SESSION_TIMEOUT = 1; + + const key = fixtures.readKey('rsa_private.pem'); + const cert = fixtures.readKey('rsa_cert.crt'); + const options = { + key: key, + cert: cert, + ca: [cert], + sessionTimeout: SESSION_TIMEOUT, + maxVersion: 'TLSv1.2', + }; + + // We need to store a sample session ticket in the fixtures directory because + // `s_client` behaves incorrectly if we do not pass in both the `-sess_in` + // and the `-sess_out` flags, and the `-sess_in` argument must point to a + // file containing a proper serialization of a session ticket. + // To avoid a source control diff, we copy the ticket to a temporary file. + + const sessionFileName = (function() { + const ticketFileName = 'tls-session-ticket.txt'; + const tmpPath = tmpdir.resolve(ticketFileName); + fs.writeFileSync(tmpPath, fixtures.readSync(ticketFileName)); + return tmpPath; + }()); + + // Expects a callback -- cb(connectionType : enum ['New'|'Reused']) + + function Client(cb) { + const flags = [ + 's_client', + '-connect', `localhost:${common.PORT}`, + '-sess_in', sessionFileName, + '-sess_out', sessionFileName, + ]; + const client = spawn(common.opensslCli, flags, { + stdio: ['ignore', 'pipe', 'ignore'] + }); + + let clientOutput = ''; + client.stdout.on('data', (data) => { + clientOutput += data.toString(); + }); + client.on('exit', (code) => { + let connectionType; + const grepConnectionType = (line) => { + const matches = line.match(/(New|Reused), /); + if (matches) { + connectionType = matches[1]; + return true; + } + }; + const lines = clientOutput.split('\n'); + if (!lines.some(grepConnectionType)) { + throw new Error('unexpected output from openssl client'); + } + assert.strictEqual(code, 0); + cb(connectionType); + }); + } + + const server = tls.createServer(options, (cleartext) => { + cleartext.on('error', (er) => { + if (er.code !== 'ECONNRESET') + throw er; + }); + cleartext.end(); + }); + + server.listen(common.PORT, () => { + Client((connectionType) => { + assert.strictEqual(connectionType, 'New'); + Client((connectionType) => { + assert.strictEqual(connectionType, 'Reused'); + setTimeout(() => { + Client((connectionType) => { + assert.strictEqual(connectionType, 'New'); + server.close(); + }); + }, (SESSION_TIMEOUT + 1) * 1000); + }); + }); + }); +} From 120b3811eb1ea8796daadd7b8da1bd705252bbde Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Wed, 4 Dec 2024 13:06:09 +0100 Subject: [PATCH 210/227] fix(task): don't panic with filter on missing task argument (#27180) We were panicing when running `deno task --filter foo` without a task argument. Fixes https://github.com/denoland/deno/issues/27177 --- cli/tools/task.rs | 128 +++++++++++++----- tests/specs/task/filter/__test__.jsonc | 20 +++ .../filter/deno_filter_no_match_no_task.out | 1 + .../specs/task/filter/deno_filter_no_task.out | 6 + .../filter/npm_filter_no_match_no_task.out | 1 + .../specs/task/filter/npm_filter_no_task.out | 6 + 6 files changed, 131 insertions(+), 31 deletions(-) create mode 100644 tests/specs/task/filter/deno_filter_no_match_no_task.out create mode 100644 tests/specs/task/filter/deno_filter_no_task.out create mode 100644 tests/specs/task/filter/npm_filter_no_match_no_task.out create mode 100644 tests/specs/task/filter/npm_filter_no_task.out diff --git a/cli/tools/task.rs b/cli/tools/task.rs index 21919be3c3..01d6ac16ee 100644 --- a/cli/tools/task.rs +++ b/cli/tools/task.rs @@ -78,41 +78,24 @@ pub async fn execute_script( let packages_task_configs: Vec = if let Some(filter) = &task_flags.filter { - let task_name = task_flags.task.as_ref().unwrap(); - // Filter based on package name let package_regex = arg_to_regex(filter)?; - let task_regex = arg_to_regex(task_name)?; + let workspace = cli_options.workspace(); + let Some(task_name) = &task_flags.task else { + print_available_tasks_workspace( + cli_options, + &package_regex, + filter, + force_use_pkg_json, + )?; + + return Ok(0); + }; + + let task_regex = arg_to_regex(task_name)?; let mut packages_task_info: Vec = vec![]; - fn matches_package( - config: &FolderConfigs, - force_use_pkg_json: bool, - regex: &Regex, - ) -> bool { - if !force_use_pkg_json { - if let Some(deno_json) = &config.deno_json { - if let Some(name) = &deno_json.json.name { - if regex.is_match(name) { - return true; - } - } - } - } - - if let Some(package_json) = &config.pkg_json { - if let Some(name) = &package_json.name { - if regex.is_match(name) { - return true; - } - } - } - - false - } - - let workspace = cli_options.workspace(); for folder in workspace.config_folders() { if !matches_package(folder.1, force_use_pkg_json, &package_regex) { continue; @@ -198,6 +181,7 @@ pub async fn execute_script( &mut std::io::stdout(), &cli_options.start_dir, &tasks_config, + None, )?; return Ok(0); }; @@ -315,6 +299,7 @@ impl<'a> TaskRunner<'a> { &mut std::io::stderr(), &self.cli_options.start_dir, tasks_config, + None, ) } @@ -675,6 +660,32 @@ fn sort_tasks_topo<'a>( Ok(sorted) } +fn matches_package( + config: &FolderConfigs, + force_use_pkg_json: bool, + regex: &Regex, +) -> bool { + if !force_use_pkg_json { + if let Some(deno_json) = &config.deno_json { + if let Some(name) = &deno_json.json.name { + if regex.is_match(name) { + return true; + } + } + } + } + + if let Some(package_json) = &config.pkg_json { + if let Some(name) = &package_json.name { + if regex.is_match(name) { + return true; + } + } + } + + false +} + fn output_task(task_name: &str, script: &str) { log::info!( "{} {} {}", @@ -684,12 +695,67 @@ fn output_task(task_name: &str, script: &str) { ); } +fn print_available_tasks_workspace( + cli_options: &Arc, + package_regex: &Regex, + filter: &str, + force_use_pkg_json: bool, +) -> Result<(), AnyError> { + let workspace = cli_options.workspace(); + + let mut matched = false; + for folder in workspace.config_folders() { + if !matches_package(folder.1, force_use_pkg_json, package_regex) { + continue; + } + matched = true; + + let member_dir = workspace.resolve_member_dir(folder.0); + let mut tasks_config = member_dir.to_tasks_config()?; + + let mut pkg_name = folder + .1 + .deno_json + .as_ref() + .and_then(|deno| deno.json.name.clone()) + .or(folder.1.pkg_json.as_ref().and_then(|pkg| pkg.name.clone())); + + if force_use_pkg_json { + tasks_config = tasks_config.with_only_pkg_json(); + pkg_name = folder.1.pkg_json.as_ref().and_then(|pkg| pkg.name.clone()); + } + + print_available_tasks( + &mut std::io::stdout(), + &cli_options.start_dir, + &tasks_config, + pkg_name, + )?; + } + + if !matched { + log::warn!( + "{}", + colors::red(format!("No package name matched the filter '{}' in available 'deno.json' or 'package.json' files.", filter)) + ); + } + + Ok(()) +} + fn print_available_tasks( writer: &mut dyn std::io::Write, workspace_dir: &Arc, tasks_config: &WorkspaceTasksConfig, + pkg_name: Option, ) -> Result<(), std::io::Error> { - writeln!(writer, "{}", colors::green("Available tasks:"))?; + let heading = if let Some(s) = pkg_name { + format!("Available tasks ({}):", colors::cyan(s)) + } else { + "Available tasks:".to_string() + }; + + writeln!(writer, "{}", colors::green(heading))?; let is_cwd_root_dir = tasks_config.root.is_none(); if tasks_config.is_empty() { diff --git a/tests/specs/task/filter/__test__.jsonc b/tests/specs/task/filter/__test__.jsonc index 8baaf04dd4..45f4e7d7d8 100644 --- a/tests/specs/task/filter/__test__.jsonc +++ b/tests/specs/task/filter/__test__.jsonc @@ -30,6 +30,16 @@ "args": "task --filter @foo/* dev", "output": "npm_workspace_order.out" }, + "npm_filter_no_match_no_task": { + "cwd": "./npm", + "args": "task --filter @asdf", + "output": "npm_filter_no_match_no_task.out" + }, + "npm_filter_no_task": { + "cwd": "./npm", + "args": "task --filter *", + "output": "npm_filter_no_task.out" + }, "deno_all": { "cwd": "./deno", "args": "task --filter * dev", @@ -54,6 +64,16 @@ "cwd": "./deno_workspace_order", "args": "task --filter @foo/* dev", "output": "deno_workspace_order.out" + }, + "deno_filter_no_match_no_task": { + "cwd": "./deno", + "args": "task --filter @asdf", + "output": "deno_filter_no_match_no_task.out" + }, + "deno_filter_no_task": { + "cwd": "./deno", + "args": "task --filter *", + "output": "deno_filter_no_task.out" } } } diff --git a/tests/specs/task/filter/deno_filter_no_match_no_task.out b/tests/specs/task/filter/deno_filter_no_match_no_task.out new file mode 100644 index 0000000000..b2cf6371b0 --- /dev/null +++ b/tests/specs/task/filter/deno_filter_no_match_no_task.out @@ -0,0 +1 @@ +No package name matched the filter '@asdf' in available 'deno.json' or 'package.json' files. diff --git a/tests/specs/task/filter/deno_filter_no_task.out b/tests/specs/task/filter/deno_filter_no_task.out new file mode 100644 index 0000000000..b24b6641e9 --- /dev/null +++ b/tests/specs/task/filter/deno_filter_no_task.out @@ -0,0 +1,6 @@ +Available tasks (@deno/bar): +- dev + echo '@deno/bar' +Available tasks (@deno/foo): +- dev + echo '@deno/foo' diff --git a/tests/specs/task/filter/npm_filter_no_match_no_task.out b/tests/specs/task/filter/npm_filter_no_match_no_task.out new file mode 100644 index 0000000000..b2cf6371b0 --- /dev/null +++ b/tests/specs/task/filter/npm_filter_no_match_no_task.out @@ -0,0 +1 @@ +No package name matched the filter '@asdf' in available 'deno.json' or 'package.json' files. diff --git a/tests/specs/task/filter/npm_filter_no_task.out b/tests/specs/task/filter/npm_filter_no_task.out new file mode 100644 index 0000000000..7863c0f9d6 --- /dev/null +++ b/tests/specs/task/filter/npm_filter_no_task.out @@ -0,0 +1,6 @@ +Available tasks (bar): +- dev (package.json) + echo 'bar' +Available tasks (foo): +- dev (package.json) + echo 'foo' From 5c17bb42874469b95b23ed0fe325226111178363 Mon Sep 17 00:00:00 2001 From: snek Date: Wed, 4 Dec 2024 14:14:37 +0100 Subject: [PATCH 211/227] fix(unstable): otel context with multiple keys (#27230) `SafeMap` treats its argument as an object with a "length" and index properties, rather than a generic iterator, so every time we cloned it, it was dropping all the data. --- ext/telemetry/telemetry.ts | 14 ++++++------ tests/specs/cli/otel_basic/__test__.jsonc | 4 ++++ tests/specs/cli/otel_basic/context.ts | 26 +++++++++++++++++++++++ 3 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 tests/specs/cli/otel_basic/context.ts diff --git a/ext/telemetry/telemetry.ts b/ext/telemetry/telemetry.ts index e8065e8a3b..e9e38d1592 100644 --- a/ext/telemetry/telemetry.ts +++ b/ext/telemetry/telemetry.ts @@ -39,7 +39,6 @@ const { SafeWeakMap, Array, ObjectEntries, - SafeMap, ReflectApply, SymbolFor, Error, @@ -617,26 +616,25 @@ class SpanExporter { const CURRENT = new AsyncVariable(); class Context { - #data = new SafeMap(); + #data: Record = { __proto__: null }; - // deno-lint-ignore no-explicit-any - constructor(data?: Iterable | null | undefined) { - this.#data = data ? new SafeMap(data) : new SafeMap(); + constructor(data?: Record | null | undefined) { + this.#data = { __proto__: null, ...data }; } getValue(key: symbol): unknown { - return this.#data.get(key); + return this.#data[key]; } setValue(key: symbol, value: unknown): Context { const c = new Context(this.#data); - c.#data.set(key, value); + c.#data[key] = value; return c; } deleteValue(key: symbol): Context { const c = new Context(this.#data); - c.#data.delete(key); + delete c.#data[key]; return c; } } diff --git a/tests/specs/cli/otel_basic/__test__.jsonc b/tests/specs/cli/otel_basic/__test__.jsonc index 05e23d32e9..e7f8d17c7a 100644 --- a/tests/specs/cli/otel_basic/__test__.jsonc +++ b/tests/specs/cli/otel_basic/__test__.jsonc @@ -19,6 +19,10 @@ { "args": "run -A main.ts metric.ts", "output": "metric.out" + }, + { + "args": "run -A --unstable-otel context.ts", + "output": "" } ] } diff --git a/tests/specs/cli/otel_basic/context.ts b/tests/specs/cli/otel_basic/context.ts new file mode 100644 index 0000000000..cef0dbd81a --- /dev/null +++ b/tests/specs/cli/otel_basic/context.ts @@ -0,0 +1,26 @@ +import { assertEquals } from "@std/assert"; + +const { ContextManager } = Deno.telemetry; + +const cm = new ContextManager(); + +const a = cm.active(); +const b = a.setValue("b", 1); +const c = b.setValue("c", 2); + +const subB = c.deleteValue("b"); +const subC = subB.deleteValue("c"); + +assertEquals(a.getValue("b"), undefined); +assertEquals(b.getValue("b"), 1); +assertEquals(c.getValue("b"), 1); + +assertEquals(a.getValue("c"), undefined); +assertEquals(b.getValue("c"), undefined); +assertEquals(c.getValue("c"), 2); + +assertEquals(subB.getValue("b"), undefined); +assertEquals(subB.getValue("c"), 2); + +assertEquals(subC.getValue("b"), undefined); +assertEquals(subC.getValue("c"), undefined); From f863a623c9db38f354f73196c883ebac30f34825 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 4 Dec 2024 12:05:34 -0500 Subject: [PATCH 212/227] fix: improve auto-imports for npm packages (#27224) Improves auto-imports when using `"nodeModulesDir": "auto"` --- cli/lsp/analysis.rs | 24 ++++++++++-- cli/lsp/resolver.rs | 20 ++++------ cli/npm/managed/resolvers/local.rs | 17 +++++++- ext/node/ops/require.rs | 8 ++-- resolvers/node/package_json.rs | 4 +- tests/integration/lsp_tests.rs | 63 ++++++++++++++++++++++++++++++ tests/util/server/src/builders.rs | 9 +++++ 7 files changed, 122 insertions(+), 23 deletions(-) diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs index 65ce330dfc..853708221f 100644 --- a/cli/lsp/analysis.rs +++ b/cli/lsp/analysis.rs @@ -353,7 +353,12 @@ impl<'a> TsResponseImportMapper<'a> { let pkg_reqs = npm_resolver.resolve_pkg_reqs_from_pkg_id(&pkg_id); // check if any pkg reqs match what is found in an import map if !pkg_reqs.is_empty() { - let sub_path = self.resolve_package_path(specifier); + let sub_path = npm_resolver + .resolve_pkg_folder_from_pkg_id(&pkg_id) + .ok() + .and_then(|pkg_folder| { + self.resolve_package_path(specifier, &pkg_folder) + }); if let Some(import_map) = self.maybe_import_map { let pkg_reqs = pkg_reqs.iter().collect::>(); let mut matches = Vec::new(); @@ -368,8 +373,13 @@ impl<'a> TsResponseImportMapper<'a> { if let Some(key_sub_path) = sub_path.strip_prefix(value_sub_path) { - matches - .push(format!("{}{}", entry.raw_key, key_sub_path)); + // keys that don't end in a slash can't be mapped to a subpath + if entry.raw_key.ends_with('/') + || key_sub_path.is_empty() + { + matches + .push(format!("{}{}", entry.raw_key, key_sub_path)); + } } } } @@ -413,10 +423,16 @@ impl<'a> TsResponseImportMapper<'a> { fn resolve_package_path( &self, specifier: &ModuleSpecifier, + package_root_folder: &Path, ) -> Option { let package_json = self .resolver - .get_closest_package_json(specifier) + .pkg_json_resolver(specifier) + // the specifier might have a closer package.json, but we + // want the root of the package's package.json + .get_closest_package_json_from_file_path( + &package_root_folder.join("package.json"), + ) .ok() .flatten()?; let root_folder = package_json.path.parent()?; diff --git a/cli/lsp/resolver.rs b/cli/lsp/resolver.rs index c705511f30..2434501a1b 100644 --- a/cli/lsp/resolver.rs +++ b/cli/lsp/resolver.rs @@ -20,14 +20,12 @@ use deno_resolver::DenoResolverOptions; use deno_resolver::NodeAndNpmReqResolver; use deno_runtime::deno_fs; use deno_runtime::deno_node::NodeResolver; -use deno_runtime::deno_node::PackageJson; use deno_runtime::deno_node::PackageJsonResolver; use deno_semver::jsr::JsrPackageReqReference; use deno_semver::npm::NpmPackageReqReference; use deno_semver::package::PackageNv; use deno_semver::package::PackageReq; use indexmap::IndexMap; -use node_resolver::errors::ClosestPkgJsonError; use node_resolver::InNpmPackageChecker; use node_resolver::NodeResolutionKind; use node_resolver::ResolutionMode; @@ -380,6 +378,14 @@ impl LspResolver { resolver.npm_resolver.as_ref().and_then(|r| r.as_managed()) } + pub fn pkg_json_resolver( + &self, + referrer: &ModuleSpecifier, + ) -> &Arc { + let resolver = self.get_scope_resolver(Some(referrer)); + &resolver.pkg_json_resolver + } + pub fn graph_imports_by_referrer( &self, file_referrer: &ModuleSpecifier, @@ -522,16 +528,6 @@ impl LspResolver { .is_some() } - pub fn get_closest_package_json( - &self, - referrer: &ModuleSpecifier, - ) -> Result>, ClosestPkgJsonError> { - let resolver = self.get_scope_resolver(Some(referrer)); - resolver - .pkg_json_resolver - .get_closest_package_json(referrer) - } - pub fn resolve_redirects( &self, specifier: &ModuleSpecifier, diff --git a/cli/npm/managed/resolvers/local.rs b/cli/npm/managed/resolvers/local.rs index 0c279d9e12..d383a5413f 100644 --- a/cli/npm/managed/resolvers/local.rs +++ b/cli/npm/managed/resolvers/local.rs @@ -236,8 +236,21 @@ impl NpmPackageFsResolver for LocalNpmPackageResolver { else { return Ok(None); }; - let folder_name = folder_path.parent().unwrap().to_string_lossy(); - Ok(get_package_folder_id_from_folder_name(&folder_name)) + // ex. project/node_modules/.deno/preact@10.24.3/node_modules/preact/ + let Some(node_modules_ancestor) = folder_path + .ancestors() + .find(|ancestor| ancestor.ends_with("node_modules")) + else { + return Ok(None); + }; + let Some(folder_name) = + node_modules_ancestor.parent().and_then(|p| p.file_name()) + else { + return Ok(None); + }; + Ok(get_package_folder_id_from_folder_name( + &folder_name.to_string_lossy(), + )) } async fn cache_packages(&self) -> Result<(), AnyError> { diff --git a/ext/node/ops/require.rs b/ext/node/ops/require.rs index 1c204f54e8..ddcdec0bbd 100644 --- a/ext/node/ops/require.rs +++ b/ext/node/ops/require.rs @@ -429,7 +429,9 @@ where let pkg_json_resolver = state.borrow::(); let pkg = pkg_json_resolver - .get_closest_package_json_from_path(&PathBuf::from(parent_path.unwrap())) + .get_closest_package_json_from_file_path(&PathBuf::from( + parent_path.unwrap(), + )) .ok() .flatten(); if pkg.is_none() { @@ -620,8 +622,8 @@ where let referrer_path = ensure_read_permission::

(state, &referrer_path) .map_err(RequireErrorKind::Permission)?; let pkg_json_resolver = state.borrow::(); - let Some(pkg) = - pkg_json_resolver.get_closest_package_json_from_path(&referrer_path)? + let Some(pkg) = pkg_json_resolver + .get_closest_package_json_from_file_path(&referrer_path)? else { return Ok(None); }; diff --git a/resolvers/node/package_json.rs b/resolvers/node/package_json.rs index ae016ebe3e..e3793af84a 100644 --- a/resolvers/node/package_json.rs +++ b/resolvers/node/package_json.rs @@ -60,10 +60,10 @@ impl PackageJsonResolver { let Ok(file_path) = deno_path_util::url_to_file_path(url) else { return Ok(None); }; - self.get_closest_package_json_from_path(&file_path) + self.get_closest_package_json_from_file_path(&file_path) } - pub fn get_closest_package_json_from_path( + pub fn get_closest_package_json_from_file_path( &self, file_path: &Path, ) -> Result, ClosestPkgJsonError> { diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 296da75315..decc635ffa 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -9610,6 +9610,69 @@ fn lsp_completions_npm() { client.shutdown(); } +#[test] +fn lsp_auto_imports_npm_auto() { + let context = TestContextBuilder::for_npm().use_temp_cwd().build(); + let temp_dir_path = context.temp_dir().path(); + temp_dir_path.join("deno.json").write_json(&json!({ + "nodeModulesDir": "auto", + "imports": { + "preact": "npm:preact@^10.19.6", + }, + })); + // add a file that uses the import so that typescript knows about it + temp_dir_path + .join("mod.ts") + .write("import { useEffect } from 'preact/hooks'; console.log(useEffect);"); + context.run_deno("cache mod.ts"); + let mut client = context.new_lsp_command().build(); + client.initialize_default(); + let file_uri = temp_dir_path.join("file.ts").url_file(); + let mut diagnostics = client + .did_open(json!({ + "textDocument": { + "uri": file_uri, + "languageId": "typescript", + "version": 1, + "text": "useEffect", + } + })) + .all(); + assert_eq!(diagnostics.len(), 1); + let diagnostic = diagnostics.remove(0); + let res = client.write_request( + "textDocument/codeAction", + json!({ + "textDocument": { + "uri": file_uri, + }, + "range": { + "start": { "line": 0, "character": 0 }, + "end": { "line": 0, "character": 9 } + }, + "context": { + "diagnostics": [diagnostic], + "only": ["quickfix"] + } + }), + ); + assert_eq!( + res + .as_array() + .unwrap() + .first() + .unwrap() + .as_object() + .unwrap() + .get("title") + .unwrap() + .as_str() + .unwrap(), + "Add import from \"preact/hooks\"" + ); + client.shutdown(); +} + #[test] fn lsp_npm_specifier_unopened_file() { let context = TestContextBuilder::new() diff --git a/tests/util/server/src/builders.rs b/tests/util/server/src/builders.rs index 4a1510ce4c..1cc1af2812 100644 --- a/tests/util/server/src/builders.rs +++ b/tests/util/server/src/builders.rs @@ -325,6 +325,15 @@ impl TestContext { builder } + pub fn run_deno(&self, args: impl AsRef) { + self + .new_command() + .name("deno") + .args(args) + .run() + .skip_output_check(); + } + pub fn run_npm(&self, args: impl AsRef) { self .new_command() From f0586238fc2a88b1af3f9e9ab1fec3ce0c362b7f Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 4 Dec 2024 12:19:06 -0500 Subject: [PATCH 213/227] fix(task): kill descendants when killing task process on Windows (#27163) --- Cargo.lock | 85 +++++++++++-------- Cargo.toml | 2 +- cli/Cargo.toml | 2 +- ext/io/bi_pipe.rs | 2 +- .../__test__.jsonc | 5 ++ .../deno.jsonc | 5 ++ .../kill_task_windows_kills_children/main.ts | 75 ++++++++++++++++ .../script.js | 3 + 8 files changed, 142 insertions(+), 37 deletions(-) create mode 100644 tests/specs/task/kill_task_windows_kills_children/__test__.jsonc create mode 100644 tests/specs/task/kill_task_windows_kills_children/deno.jsonc create mode 100644 tests/specs/task/kill_task_windows_kills_children/main.ts create mode 100644 tests/specs/task/kill_task_windows_kills_children/script.js diff --git a/Cargo.lock b/Cargo.lock index 28548ab84c..e9ca3591d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1677,7 +1677,7 @@ dependencies = [ "serde", "thiserror 1.0.64", "winapi", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1767,7 +1767,7 @@ dependencies = [ "tokio", "uuid", "winapi", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1855,7 +1855,7 @@ dependencies = [ "log", "napi_sym", "thiserror 1.0.64", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1974,7 +1974,7 @@ dependencies = [ "url", "webpki-root-certs", "winapi", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "x25519-dalek", "x509-parser", "yoke", @@ -2174,7 +2174,7 @@ dependencies = [ "uuid", "which 4.4.2", "winapi", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2193,9 +2193,9 @@ dependencies = [ [[package]] name = "deno_task_shell" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01e09966ce29f8d26b652a43355397e1df43b85759e7824196bf0ceaeaa9a2f4" +checksum = "fa3763bc068e17b6d488fb73ecda463c13ef792b0a5288b6018bc2119becd635" dependencies = [ "anyhow", "futures", @@ -2206,6 +2206,7 @@ dependencies = [ "path-dedot", "thiserror 1.0.64", "tokio", + "windows-sys 0.59.0", ] [[package]] @@ -4558,7 +4559,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.52.4", + "windows-targets 0.48.5", ] [[package]] @@ -8623,7 +8624,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -8632,7 +8633,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -8650,7 +8651,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -8670,17 +8680,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -8691,9 +8702,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -8703,9 +8714,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -8715,9 +8726,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -8727,9 +8744,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -8739,9 +8756,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -8751,9 +8768,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -8763,9 +8780,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" diff --git a/Cargo.toml b/Cargo.toml index 23670beec3..713b3ed1f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -239,7 +239,7 @@ nix = "=0.27.1" # windows deps junction = "=0.2.0" winapi = "=0.3.9" -windows-sys = { version = "0.52.0", features = ["Win32_Foundation", "Win32_Media", "Win32_Storage_FileSystem", "Win32_System_IO", "Win32_System_WindowsProgramming", "Wdk", "Wdk_System", "Wdk_System_SystemInformation", "Win32_Security", "Win32_System_Pipes", "Wdk_Storage_FileSystem", "Win32_System_Registry", "Win32_System_Kernel"] } +windows-sys = { version = "0.59.0", features = ["Win32_Foundation", "Win32_Media", "Win32_Storage_FileSystem", "Win32_System_IO", "Win32_System_WindowsProgramming", "Wdk", "Wdk_System", "Wdk_System_SystemInformation", "Win32_Security", "Win32_System_Pipes", "Wdk_Storage_FileSystem", "Win32_System_Registry", "Win32_System_Kernel", "Win32_System_Threading", "Win32_UI", "Win32_UI_Shell"] } winres = "=0.1.12" [profile.release] diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 4a343ce747..d8e59b5e35 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -83,7 +83,7 @@ deno_path_util.workspace = true deno_resolver.workspace = true deno_runtime = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_semver.workspace = true -deno_task_shell = "=0.20.1" +deno_task_shell = "=0.20.2" deno_telemetry.workspace = true deno_terminal.workspace = true libsui = "0.5.0" diff --git a/ext/io/bi_pipe.rs b/ext/io/bi_pipe.rs index 3492e2f441..bf65d3037f 100644 --- a/ext/io/bi_pipe.rs +++ b/ext/io/bi_pipe.rs @@ -407,7 +407,7 @@ pub fn bi_pipe_pair_raw( &s, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, - 0, + std::ptr::null_mut(), ); if hd2 == INVALID_HANDLE_VALUE { return Err(io::Error::last_os_error()); diff --git a/tests/specs/task/kill_task_windows_kills_children/__test__.jsonc b/tests/specs/task/kill_task_windows_kills_children/__test__.jsonc new file mode 100644 index 0000000000..f83d24e9aa --- /dev/null +++ b/tests/specs/task/kill_task_windows_kills_children/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "if": "windows", + "args": "run --check -A main.ts", + "output": "[WILDCARD]" // just ensure no failure +} diff --git a/tests/specs/task/kill_task_windows_kills_children/deno.jsonc b/tests/specs/task/kill_task_windows_kills_children/deno.jsonc new file mode 100644 index 0000000000..ee8102bed5 --- /dev/null +++ b/tests/specs/task/kill_task_windows_kills_children/deno.jsonc @@ -0,0 +1,5 @@ +{ + "tasks": { + "start": "deno run -A script.js" + } +} diff --git a/tests/specs/task/kill_task_windows_kills_children/main.ts b/tests/specs/task/kill_task_windows_kills_children/main.ts new file mode 100644 index 0000000000..351a7db6a3 --- /dev/null +++ b/tests/specs/task/kill_task_windows_kills_children/main.ts @@ -0,0 +1,75 @@ +class StdoutReader { + readonly #reader: ReadableStreamDefaultReader; + text = ""; + + constructor(stream: ReadableStream) { + const textStream = stream.pipeThrough(new TextDecoderStream()); + this.#reader = textStream.getReader(); + } + + [Symbol.dispose]() { + this.#reader.releaseLock(); + } + + async waitForText(waitingText: string) { + if (this.text.includes(waitingText)) { + return; + } + + while (true) { + const { value, done } = await this.#reader.read(); + if (value) { + this.text += value; + if (this.text.includes(waitingText)) { + break; + } + } + if (done) { + throw new Error("Did not find text: " + waitingText); + } + } + } +} + +const command = new Deno.Command("deno", { + args: ["task", "start"], + stdout: "piped", +}); + +const child = command.spawn(); + +const reader = new StdoutReader(child.stdout!); +console.log("Waiting..."); +await reader.waitForText("Ready"); +console.log("Received."); +const pid = parseInt(reader.text.split("\n")[0], 10); +console.log("PID", pid); +// ensure this function works +if (!isPidAlive(child.pid)) { + throw new Error("Unexpected."); +} +if (!isPidAlive(pid)) { + throw new Error("Unexpected."); +} +child.kill(); +// now the grandchild shouldn't be alive +if (isPidAlive(pid)) { + throw new Error("Unexpected."); +} + +function isPidAlive(pid: number) { + const command = new Deno.Command("cmd", { + args: ["/c", `wmic process where processid=${pid} get processid`], + }); + + try { + const { stdout } = command.outputSync(); // Execute the command + const output = new TextDecoder().decode(stdout); + + console.log("wmic output:", output.trim()); + return output.includes(pid.toString()); + } catch (error) { + console.error("Error checking PID:", error); + return false; + } +} diff --git a/tests/specs/task/kill_task_windows_kills_children/script.js b/tests/specs/task/kill_task_windows_kills_children/script.js new file mode 100644 index 0000000000..1a98d7280e --- /dev/null +++ b/tests/specs/task/kill_task_windows_kills_children/script.js @@ -0,0 +1,3 @@ +console.log(Deno.pid); +console.log("Ready"); +setInterval(() => {}, 10_000); // stay alive From e718e3f4713686c4f8df4e54cd73f9a1b81b3a17 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:32:48 -0500 Subject: [PATCH 214/227] fix(outdated): allow `--latest` without `--update` (#27227) Ref #27025. it does nothing (it's the default behavior) but it doesn't hurt to allow it --- cli/args/flags.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 5ea28bfec1..c08d81abb0 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -2664,10 +2664,10 @@ Display outdated dependencies: deno outdated deno outdated --compatible -Update dependencies: +Update dependencies to latest semver compatible versions: deno outdated --update +Update dependencies to latest versions, ignoring semver requirements: deno outdated --update --latest - deno outdated --update Filters can be used to select which packages to act on. Filters can include wildcards (*) to match multiple packages. deno outdated --update --latest \"@std/*\" @@ -2703,7 +2703,6 @@ Specific version requirements to update to can be specified: .help( "Update to the latest version, regardless of semver constraints", ) - .requires("update") .conflicts_with("compatible"), ) .arg( @@ -11687,6 +11686,14 @@ Usage: deno repl [OPTIONS] [-- [ARGS]...]\n" recursive: false, }, ), + ( + svec!["--latest"], + OutdatedFlags { + filters: svec![], + kind: OutdatedKind::PrintOutdated { compatible: false }, + recursive: false, + }, + ), ]; for (input, expected) in cases { let mut args = svec!["deno", "outdated"]; From a26b873a7d269212db10a157bc9fdb49b6b83f52 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 4 Dec 2024 17:39:58 -0500 Subject: [PATCH 215/227] refactor: remove usages of `deno_core::resolve_import` for resolving redirects (#27234) This was doing an allocation for reparsing the specifier. Might as well do `.join` here and it means I can extract out this file fetcher code to deno_cache_dir more easily. --- cli/file_fetcher.rs | 3 +-- cli/lsp/resolver.rs | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs index f0adc60e3b..29f9c6ba3f 100644 --- a/cli/file_fetcher.rs +++ b/cli/file_fetcher.rs @@ -59,8 +59,7 @@ impl FileOrRedirect { cache_entry: deno_cache_dir::CacheEntry, ) -> Result { if let Some(redirect_to) = cache_entry.metadata.headers.get("location") { - let redirect = - deno_core::resolve_import(redirect_to, specifier.as_str())?; + let redirect = specifier.join(redirect_to)?; Ok(FileOrRedirect::Redirect(redirect)) } else { Ok(FileOrRedirect::File(File { diff --git a/cli/lsp/resolver.rs b/cli/lsp/resolver.rs index 2434501a1b..363ad43700 100644 --- a/cli/lsp/resolver.rs +++ b/cli/lsp/resolver.rs @@ -941,9 +941,7 @@ impl RedirectResolver { if chain.len() > 10 { break None; } - let Ok(target) = - deno_core::resolve_import(location, specifier.as_str()) - else { + let Ok(target) = specifier.join(location) else { break None; }; chain.push(( From e8d731c05f205654f7d75c0a37267dcd2c615fb0 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Thu, 5 Dec 2024 14:30:43 +0100 Subject: [PATCH 216/227] fix(node/worker_threads): data url not encoded properly with eval (#27184) When using the `eval` option on Node's `worker_threads` the code is passed as a `data:` URL. But we didn't encode the actual code for that, which lead to syntax errors when including characters not allowed in an URL. Fixes a part of https://github.com/denoland/deno/issues/27167 --- ext/node/polyfills/worker_threads.ts | 7 ++++++- tests/unit_node/worker_threads_test.ts | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ext/node/polyfills/worker_threads.ts b/ext/node/polyfills/worker_threads.ts index d4b75fb30c..1b175fb1dd 100644 --- a/ext/node/polyfills/worker_threads.ts +++ b/ext/node/polyfills/worker_threads.ts @@ -42,6 +42,7 @@ const { SafeWeakMap, SafeMap, TypeError, + encodeURIComponent, } = primordials; const debugWorkerThreads = false; @@ -123,7 +124,11 @@ class NodeWorker extends EventEmitter { ); } if (options?.eval) { - specifier = `data:text/javascript,${specifier}`; + const code = typeof specifier === "string" + ? encodeURIComponent(specifier) + // deno-lint-ignore prefer-primordials + : specifier.toString(); + specifier = `data:text/javascript,${code}`; } else if ( !(typeof specifier === "object" && specifier.protocol === "data:") ) { diff --git a/tests/unit_node/worker_threads_test.ts b/tests/unit_node/worker_threads_test.ts index 24a9107898..808fd6116e 100644 --- a/tests/unit_node/worker_threads_test.ts +++ b/tests/unit_node/worker_threads_test.ts @@ -136,6 +136,25 @@ Deno.test({ }, }); +Deno.test({ + name: "[node/worker_threads] Worker eval", + async fn() { + // Check that newlines are encoded properly + const worker = new workerThreads.Worker( + ` + import { parentPort } from "node:worker_threads" + console.log("hey, foo") // comment + parentPort.postMessage("It works!"); + `, + { + eval: true, + }, + ); + assertEquals((await once(worker, "message"))[0], "It works!"); + worker.terminate(); + }, +}); + Deno.test({ name: "[node/worker_threads] worker thread with type module", async fn() { From 25aed5071f811775ca1f29aa30f1d7b32d793690 Mon Sep 17 00:00:00 2001 From: ud2 Date: Thu, 5 Dec 2024 21:55:50 +0800 Subject: [PATCH 217/227] fix(unstable/temporal): respect locale in `Duration.prototype.toLocaleString` (#27000) Adds a temporary polyfill for `Duration.prototype.toLocaleString()` that will be removed once native support in V8 lands. --- runtime/js/99_main.js | 55 +++++++++++++++++++ .../run/unstable_temporal_api_patch/main.out | 1 + .../run/unstable_temporal_api_patch/main.ts | 3 + 3 files changed, 59 insertions(+) diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index e3b14fdafa..19432745d4 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -37,6 +37,7 @@ const { ObjectHasOwn, ObjectKeys, ObjectGetOwnPropertyDescriptor, + ObjectGetOwnPropertyDescriptors, ObjectPrototypeIsPrototypeOf, ObjectSetPrototypeOf, PromisePrototypeThen, @@ -45,6 +46,7 @@ const { Symbol, SymbolIterator, TypeError, + uncurryThis, } = primordials; const { isNativeError, @@ -459,6 +461,51 @@ function exposeUnstableFeaturesForWindowOrWorkerGlobalScope(unstableFeatures) { } } +function shimTemporalDurationToLocaleString() { + const DurationFormat = Intl.DurationFormat; + if (!DurationFormat) { + // Intl.DurationFormat can be disabled with --v8-flags=--no-harmony-intl-duration-format + return; + } + const DurationFormatPrototype = DurationFormat.prototype; + const formatDuration = uncurryThis(DurationFormatPrototype.format); + + const Duration = Temporal.Duration; + const DurationPrototype = Duration.prototype; + const desc = ObjectGetOwnPropertyDescriptors(DurationPrototype); + const assertDuration = uncurryThis(desc.toLocaleString.value); + const getYears = uncurryThis(desc.years.get); + const getMonths = uncurryThis(desc.months.get); + const getWeeks = uncurryThis(desc.weeks.get); + const getDays = uncurryThis(desc.days.get); + const getHours = uncurryThis(desc.hours.get); + const getMinutes = uncurryThis(desc.minutes.get); + const getSeconds = uncurryThis(desc.seconds.get); + const getMilliseconds = uncurryThis(desc.milliseconds.get); + const getMicroseconds = uncurryThis(desc.microseconds.get); + const getNanoseconds = uncurryThis(desc.nanoseconds.get); + + ObjectAssign(DurationPrototype, { + toLocaleString(locales = undefined, options) { + assertDuration(this); + const durationFormat = new DurationFormat(locales, options); + const duration = { + years: getYears(this), + months: getMonths(this), + weeks: getWeeks(this), + days: getDays(this), + hours: getHours(this), + minutes: getMinutes(this), + seconds: getSeconds(this), + milliseconds: getMilliseconds(this), + microseconds: getMicroseconds(this), + nanoseconds: getNanoseconds(this), + }; + return formatDuration(durationFormat, duration); + }, + }); +} + // NOTE(bartlomieju): remove all the ops that have already been imported using // "virtual op module" (`ext:core/ops`). const NOT_IMPORTED_OPS = [ @@ -821,6 +868,12 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) { }); delete globalThis.Temporal.Now.timeZone; } + + // deno-lint-ignore prefer-primordials + if (new Temporal.Duration().toLocaleString("en-US") !== "PT0S") { + throw "V8 supports Temporal.Duration.prototype.toLocaleString now, no need to shim it"; + } + shimTemporalDurationToLocaleString(); } // Setup `Deno` global - we're actually overriding already existing global @@ -1024,6 +1077,8 @@ function bootstrapWorkerRuntime( }); delete globalThis.Temporal.Now.timeZone; } + + shimTemporalDurationToLocaleString(); } // Setup `Deno` global - we're actually overriding already existing global diff --git a/tests/specs/run/unstable_temporal_api_patch/main.out b/tests/specs/run/unstable_temporal_api_patch/main.out index a17d3a9e20..ec12b9e463 100644 --- a/tests/specs/run/unstable_temporal_api_patch/main.out +++ b/tests/specs/run/unstable_temporal_api_patch/main.out @@ -5,3 +5,4 @@ iso8601 UTC undefined undefined +1 day, 6 hr, 30 min diff --git a/tests/specs/run/unstable_temporal_api_patch/main.ts b/tests/specs/run/unstable_temporal_api_patch/main.ts index 6a40780535..ff92cf91c2 100644 --- a/tests/specs/run/unstable_temporal_api_patch/main.ts +++ b/tests/specs/run/unstable_temporal_api_patch/main.ts @@ -9,3 +9,6 @@ console.log(zoned.timeZoneId); console.log(zoned.calendar); // @ts-expect-error: undefined check console.log(zoned.timeZone); + +const duration = Temporal.Duration.from("P1DT6H30M"); +console.log(duration.toLocaleString("en-US")); From ae5c743f338d91fd9290a05fa55ed3ef7f9c110d Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Thu, 5 Dec 2024 15:11:35 +0100 Subject: [PATCH 218/227] chore: update hickory dns crates (#27137) --- Cargo.lock | 196 ++++++++++++++++++++------------- Cargo.toml | 4 +- ext/fetch/dns.rs | 15 +-- ext/fetch/tests.rs | 4 +- ext/net/Cargo.toml | 2 +- ext/net/ops.rs | 25 +++-- tests/Cargo.toml | 5 +- tests/integration/run_tests.rs | 7 +- 8 files changed, 158 insertions(+), 100 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e9ca3591d0..eeac8bdfc7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -284,6 +284,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "async-stream" version = "0.3.5" @@ -806,6 +817,7 @@ dependencies = [ "file_test_runner", "flaky_test", "hickory-client", + "hickory-proto", "hickory-server", "http 1.1.0", "http-body-util", @@ -1293,7 +1305,7 @@ dependencies = [ "test_server", "text-size", "text_lines", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", "tokio-util", "tracing", @@ -1380,7 +1392,7 @@ version = "0.174.0" dependencies = [ "async-trait", "deno_core", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", "uuid", ] @@ -1394,7 +1406,7 @@ dependencies = [ "rusqlite", "serde", "sha2", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", ] @@ -1426,7 +1438,7 @@ dependencies = [ "deno_webgpu", "image", "serde", - "thiserror 1.0.64", + "thiserror 2.0.3", ] [[package]] @@ -1510,7 +1522,7 @@ dependencies = [ "chrono", "deno_core", "saffron", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", ] @@ -1545,7 +1557,7 @@ dependencies = [ "sha2", "signature", "spki", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", "uuid", "x25519-dalek", @@ -1627,7 +1639,7 @@ dependencies = [ "rustls-webpki", "serde", "serde_json", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", "tokio-rustls", "tokio-socks", @@ -1652,7 +1664,7 @@ dependencies = [ "serde", "serde-value", "serde_json", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", "winapi", ] @@ -1675,7 +1687,7 @@ dependencies = [ "rand", "rayon", "serde", - "thiserror 1.0.64", + "thiserror 2.0.3", "winapi", "windows-sys 0.59.0", ] @@ -1744,7 +1756,7 @@ dependencies = [ "scopeguard", "serde", "smallvec", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", "tokio-util", ] @@ -1798,7 +1810,7 @@ dependencies = [ "rand", "rusqlite", "serde", - "thiserror 1.0.64", + "thiserror 2.0.3", "url", ] @@ -1854,7 +1866,7 @@ dependencies = [ "libuv-sys-lite", "log", "napi_sym", - "thiserror 1.0.64", + "thiserror 2.0.3", "windows-sys 0.59.0", ] @@ -1884,7 +1896,7 @@ dependencies = [ "rustls-tokio-stream", "serde", "socket2", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", ] @@ -1929,7 +1941,7 @@ dependencies = [ "http-body-util", "hyper 1.4.1", "hyper-util", - "idna 1.0.3", + "idna", "indexmap 2.3.0", "ipnetwork", "k256", @@ -1968,7 +1980,7 @@ dependencies = [ "sm3", "spki", "stable_deref_trait", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", "tokio-eld", "url", @@ -2024,7 +2036,7 @@ dependencies = [ "serde_json", "tar", "tempfile", - "thiserror 1.0.64", + "thiserror 2.0.3", "url", ] @@ -2084,7 +2096,7 @@ dependencies = [ "once_cell", "percent-encoding", "serde", - "thiserror 1.0.64", + "thiserror 2.0.3", "which 4.4.2", "winapi", ] @@ -2104,7 +2116,7 @@ dependencies = [ "deno_semver", "node_resolver", "test_server", - "thiserror 1.0.64", + "thiserror 2.0.3", "url", ] @@ -2167,7 +2179,7 @@ dependencies = [ "signal-hook-registry", "tempfile", "test_server", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", "tokio-metrics", "twox-hash", @@ -2261,7 +2273,7 @@ dependencies = [ "rustls-tokio-stream", "rustls-webpki", "serde", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", "webpki-roots", ] @@ -2308,7 +2320,7 @@ dependencies = [ "deno_console", "deno_core", "deno_webidl", - "thiserror 1.0.64", + "thiserror 2.0.3", "urlpattern", ] @@ -2329,7 +2341,7 @@ dependencies = [ "flate2", "futures", "serde", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", "uuid", ] @@ -2341,7 +2353,7 @@ dependencies = [ "deno_core", "raw-window-handle", "serde", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", "wgpu-core", "wgpu-types", @@ -2373,7 +2385,7 @@ dependencies = [ "once_cell", "rustls-tokio-stream", "serde", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", ] @@ -2384,7 +2396,7 @@ dependencies = [ "deno_core", "deno_web", "rusqlite", - "thiserror 1.0.64", + "thiserror 2.0.3", ] [[package]] @@ -3698,9 +3710,9 @@ checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" [[package]] name = "hickory-client" -version = "0.24.1" +version = "0.25.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab9683b08d8f8957a857b0236455d80e1886eaa8c6178af556aa7871fb61b55" +checksum = "83536dab9a159b2b5cf2c20c47ecf188cee35316f96be028e63e8e1340d2724d" dependencies = [ "cfg-if", "data-encoding", @@ -3710,17 +3722,18 @@ dependencies = [ "once_cell", "radix_trie", "rand", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", "tracing", ] [[package]] name = "hickory-proto" -version = "0.24.1" +version = "0.25.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" +checksum = "d063c0692ee669aa6d261988aa19ca5510f1cc40e4f211024f50c888499a35d7" dependencies = [ + "async-recursion", "async-trait", "cfg-if", "data-encoding", @@ -3728,12 +3741,12 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna 0.4.0", + "idna", "ipnet", "once_cell", "rand", "serde", - "thiserror 1.0.64", + "thiserror 2.0.3", "tinyvec", "tokio", "tracing", @@ -3742,40 +3755,43 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.24.1" +version = "0.25.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" +checksum = "42bc352e4412fb657e795f79b4efcf2bd60b59ee5ca0187f3554194cd1107a27" dependencies = [ "cfg-if", "futures-util", "hickory-proto", "ipconfig", - "lru-cache", + "moka", "once_cell", "parking_lot", "rand", "resolv-conf", "serde", "smallvec", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", "tracing", ] [[package]] name = "hickory-server" -version = "0.24.1" +version = "0.25.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be0e43c556b9b3fdb6c7c71a9a32153a2275d02419e3de809e520bfcfe40c37" +checksum = "aa7154e905d5c8a79c15427881e479b2ba749c55412804f0dc87723a531e45bd" dependencies = [ "async-trait", "bytes", "cfg-if", + "data-encoding", "enum-as-inner", "futures-util", "hickory-proto", + "ipnet", + "prefix-trie", "serde", - "thiserror 1.0.64", + "thiserror 2.0.3", "time", "tokio", "tokio-util", @@ -4137,16 +4153,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "1.0.3" @@ -4287,6 +4293,9 @@ name = "ipnet" version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +dependencies = [ + "serde", +] [[package]] name = "ipnetwork" @@ -4625,12 +4634,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -4668,15 +4671,6 @@ dependencies = [ "serde", ] -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "lsp-types" version = "0.97.0" @@ -4841,6 +4835,26 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "moka" +version = "0.12.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e0d88686dc561d743b40de8269b26eaf0dc58781bde087b0984646602021d08" +dependencies = [ + "crossbeam-channel", + "crossbeam-epoch", + "crossbeam-utils", + "once_cell", + "parking_lot", + "quanta", + "rustc_version 0.4.0", + "smallvec", + "tagptr", + "thiserror 1.0.64", + "triomphe", + "uuid", +] + [[package]] name = "monch" version = "0.5.0" @@ -4961,7 +4975,7 @@ dependencies = [ "path-clean", "regex", "serde_json", - "thiserror 1.0.64", + "thiserror 2.0.3", "tokio", "url", ] @@ -5120,9 +5134,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "opaque-debug" @@ -5617,6 +5631,16 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "prefix-trie" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4defc8f5ac7522968431b7592a34432215d80cceb1cf7e0c06287087bca4f046" +dependencies = [ + "ipnet", + "num-traits", +] + [[package]] name = "pretty_assertions" version = "1.4.0" @@ -5812,6 +5836,21 @@ dependencies = [ "unicase", ] +[[package]] +name = "quanta" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" +dependencies = [ + "crossbeam-utils", + "libc", + "once_cell", + "raw-cpuid", + "wasi", + "web-sys", + "winapi", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -5976,6 +6015,15 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" +[[package]] +name = "raw-cpuid" +version = "11.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" +dependencies = [ + "bitflags 2.6.0", +] + [[package]] name = "raw-window-handle" version = "0.6.1" @@ -7509,6 +7557,12 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "tagptr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" + [[package]] name = "tap" version = "1.0.1" @@ -8083,12 +8137,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-id" version = "0.3.4" @@ -8163,7 +8211,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" dependencies = [ "form_urlencoded", - "idna 1.0.3", + "idna", "percent-encoding", "serde", ] diff --git a/Cargo.toml b/Cargo.toml index 713b3ed1f5..5d60eb0d7e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -133,7 +133,7 @@ fs3 = "0.5.0" futures = "0.3.21" glob = "0.3.1" h2 = "0.4.4" -hickory-resolver = { version = "0.24", features = ["tokio-runtime", "serde-config"] } +hickory-resolver = { version = "0.25.0-alpha.4", features = ["tokio-runtime", "serde"] } http = "1.0" http-body = "1.0" http-body-util = "0.1.2" @@ -194,7 +194,7 @@ spki = "0.7.2" tar = "=0.4.40" tempfile = "3.4.0" termcolor = "1.1.3" -thiserror = "1.0.61" +thiserror = "2.0.3" tokio = { version = "1.36.0", features = ["full"] } tokio-metrics = { version = "0.3.0", features = ["rt"] } tokio-rustls = { version = "0.26.0", default-features = false, features = ["ring", "tls12"] } diff --git a/ext/fetch/dns.rs b/ext/fetch/dns.rs index 9e21a4c342..fdde4e17bb 100644 --- a/ext/fetch/dns.rs +++ b/ext/fetch/dns.rs @@ -7,10 +7,7 @@ use std::task::Poll; use std::task::{self}; use std::vec; -use hickory_resolver::error::ResolveError; -use hickory_resolver::name_server::GenericConnector; -use hickory_resolver::name_server::TokioRuntimeProvider; -use hickory_resolver::AsyncResolver; +use hickory_resolver::name_server::TokioConnectionProvider; use hyper_util::client::legacy::connect::dns::GaiResolver; use hyper_util::client::legacy::connect::dns::Name; use tokio::task::JoinHandle; @@ -21,7 +18,7 @@ pub enum Resolver { /// A resolver using blocking `getaddrinfo` calls in a threadpool. Gai(GaiResolver), /// hickory-resolver's userspace resolver. - Hickory(AsyncResolver>), + Hickory(hickory_resolver::Resolver), } impl Default for Resolver { @@ -36,14 +33,14 @@ impl Resolver { } /// Create a [`AsyncResolver`] from system conf. - pub fn hickory() -> Result { + pub fn hickory() -> Result { Ok(Self::Hickory( - hickory_resolver::AsyncResolver::tokio_from_system_conf()?, + hickory_resolver::Resolver::tokio_from_system_conf()?, )) } - pub fn hickory_from_async_resolver( - resolver: AsyncResolver>, + pub fn hickory_from_resolver( + resolver: hickory_resolver::Resolver, ) -> Self { Self::Hickory(resolver) } diff --git a/ext/fetch/tests.rs b/ext/fetch/tests.rs index e053c6b1cf..3da29f8aa7 100644 --- a/ext/fetch/tests.rs +++ b/ext/fetch/tests.rs @@ -41,7 +41,7 @@ fn test_userspace_resolver() { // use `localhost` to ensure dns step happens. let addr = format!("localhost:{}", src_addr.port()); - let hickory = hickory_resolver::AsyncResolver::tokio( + let hickory = hickory_resolver::Resolver::tokio( Default::default(), Default::default(), ); @@ -52,7 +52,7 @@ fn test_userspace_resolver() { addr.clone(), "https", http::Version::HTTP_2, - dns::Resolver::hickory_from_async_resolver(hickory), + dns::Resolver::hickory_from_resolver(hickory), ) .await; assert_eq!(thread_counter.load(SeqCst), 0, "userspace resolver shouldn't spawn new threads."); diff --git a/ext/net/Cargo.toml b/ext/net/Cargo.toml index 401ce08ff4..cfdd151f3b 100644 --- a/ext/net/Cargo.toml +++ b/ext/net/Cargo.toml @@ -17,7 +17,7 @@ path = "lib.rs" deno_core.workspace = true deno_permissions.workspace = true deno_tls.workspace = true -hickory-proto = "0.24" +hickory-proto = "0.25.0-alpha.4" hickory-resolver.workspace = true pin-project.workspace = true rustls-tokio-stream.workspace = true diff --git a/ext/net/ops.rs b/ext/net/ops.rs index 8d62bdeb4d..16148ac90d 100644 --- a/ext/net/ops.rs +++ b/ext/net/ops.rs @@ -21,13 +21,14 @@ use deno_core::ResourceId; use hickory_proto::rr::rdata::caa::Value; use hickory_proto::rr::record_data::RData; use hickory_proto::rr::record_type::RecordType; +use hickory_proto::ProtoError; +use hickory_proto::ProtoErrorKind; use hickory_resolver::config::NameServerConfigGroup; use hickory_resolver::config::ResolverConfig; use hickory_resolver::config::ResolverOpts; -use hickory_resolver::error::ResolveError; -use hickory_resolver::error::ResolveErrorKind; use hickory_resolver::system_conf; -use hickory_resolver::AsyncResolver; +use hickory_resolver::ResolveError; +use hickory_resolver::ResolveErrorKind; use serde::Deserialize; use serde::Serialize; use socket2::Domain; @@ -646,7 +647,7 @@ where } } - let resolver = AsyncResolver::tokio(config, opts); + let resolver = hickory_resolver::Resolver::tokio(config, opts); let lookup_fut = resolver.lookup(query, record_type); @@ -674,11 +675,21 @@ where lookup .map_err(|e| match e.kind() { - ResolveErrorKind::NoRecordsFound { .. } => NetError::DnsNotFound(e), - ResolveErrorKind::Message("No connections available") => { + ResolveErrorKind::Proto(ProtoError { kind, .. }) + if matches!(**kind, ProtoErrorKind::NoRecordsFound { .. }) => + { + NetError::DnsNotFound(e) + } + ResolveErrorKind::Proto(ProtoError { kind, .. }) + if matches!(**kind, ProtoErrorKind::NoConnections { .. }) => + { NetError::DnsNotConnected(e) } - ResolveErrorKind::Timeout => NetError::DnsTimedOut(e), + ResolveErrorKind::Proto(ProtoError { kind, .. }) + if matches!(**kind, ProtoErrorKind::Timeout { .. }) => + { + NetError::DnsTimedOut(e) + } _ => NetError::Dns(e), })? .iter() diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 31cc022ce2..fa51d7b77b 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -47,8 +47,9 @@ deno_tls.workspace = true fastwebsockets = { workspace = true, features = ["upgrade", "unstable-split"] } file_test_runner = "0.7.3" flaky_test = "=0.2.2" -hickory-client = "=0.24" -hickory-server = "=0.24" +hickory-client = "0.25.0-alpha.4" +hickory-proto = "0.25.0-alpha.4" +hickory-server = "0.25.0-alpha.4" http.workspace = true http-body-util.workspace = true hyper.workspace = true diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs index 18cded90cb..f0b536aa22 100644 --- a/tests/integration/run_tests.rs +++ b/tests/integration/run_tests.rs @@ -16,7 +16,8 @@ use deno_tls::rustls; use deno_tls::rustls::ClientConnection; use deno_tls::rustls_pemfile; use deno_tls::TlsStream; -use hickory_client::serialize::txt::Parser; +use hickory_proto::serialize::txt::Parser; +use hickory_server::authority::AuthorityObject; use pretty_assertions::assert_eq; use test_util as util; use test_util::itest; @@ -2245,10 +2246,10 @@ async fn test_resolve_dns() { panic!("failed to parse: {:?}", records.err()) } let (origin, records) = records.unwrap(); - let authority = Box::new(Arc::new( + let authority: Vec> = vec![Arc::new( InMemoryAuthority::new(origin, records, ZoneType::Primary, false) .unwrap(), - )); + )]; let mut catalog: Catalog = Catalog::new(); catalog.upsert(Name::root().into(), authority); From 3bae68eda659aebd1eb16fb470cfadead4d9512a Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Fri, 6 Dec 2024 00:25:16 +0900 Subject: [PATCH 219/227] test(ext/node): fix flaky node/http2.createServer() test (#27208) --- tests/unit_node/http2_test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/unit_node/http2_test.ts b/tests/unit_node/http2_test.ts index c540c90f7e..90f2388124 100644 --- a/tests/unit_node/http2_test.ts +++ b/tests/unit_node/http2_test.ts @@ -152,6 +152,7 @@ Deno.test("[node/http2.createServer()]", { // TODO(satyarohith): enable the test on windows. ignore: Deno.build.os === "windows", }, async () => { + const serverListening = Promise.withResolvers(); const server = http2.createServer((_req, res) => { res.setHeader("Content-Type", "text/html"); res.setHeader("X-Foo", "bar"); @@ -159,8 +160,10 @@ Deno.test("[node/http2.createServer()]", { res.write("Hello, World!"); res.end(); }); - server.listen(0); - const port = (server.address() as net.AddressInfo).port; + server.listen(0, () => { + serverListening.resolve((server.address() as net.AddressInfo).port); + }); + const port = await serverListening.promise; const endpoint = `http://localhost:${port}`; const response = await curlRequest([ From ab4568a03dbfb46aedf995e0b742d07ec162678a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 5 Dec 2024 15:48:50 +0000 Subject: [PATCH 220/227] fix: clear dep analysis when module loading is done (#27204) Closes https://github.com/denoland/deno/issues/26663 --- Cargo.lock | 12 ++--- Cargo.toml | 2 +- cli/cache/parsed_source.rs | 10 ++++ cli/module_loader.rs | 94 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 111 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eeac8bdfc7..b047b79f18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1474,9 +1474,9 @@ dependencies = [ [[package]] name = "deno_core" -version = "0.323.0" +version = "0.324.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a781bcfe1b5211b8497f45bf5b3dba73036b8d5d1533c1f05d26ccf0afb25a78" +checksum = "24503eda646f246aa6eb0f794909f9a857c8f05095fed66f36e0eaef92edce23" dependencies = [ "anyhow", "az", @@ -2042,9 +2042,9 @@ dependencies = [ [[package]] name = "deno_ops" -version = "0.199.0" +version = "0.200.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a24a1f3e22029a57d3094b32070b8328eac793920b5a022027d360f085e6b245" +checksum = "03a529a2c488cd3042f12f35666569ebe5b3cf89d2b7d1cafc1a652f6d7bcc8f" dependencies = [ "proc-macro-rules", "proc-macro2", @@ -6684,9 +6684,9 @@ dependencies = [ [[package]] name = "serde_v8" -version = "0.232.0" +version = "0.233.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c9feae92f7293fcc1a32a86be1a399859c0637e55dad8991d5258c43f7ff4d2" +checksum = "307f176b7475480cee690c34c7118f96fe564d1f2a974bf990294b8310ae4983" dependencies = [ "num-bigint", "serde", diff --git a/Cargo.toml b/Cargo.toml index 5d60eb0d7e..079daee33c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ repository = "https://github.com/denoland/deno" [workspace.dependencies] deno_ast = { version = "=0.44.0", features = ["transpiling"] } -deno_core = { version = "0.323.0" } +deno_core = { version = "0.324.0" } deno_bench_util = { version = "0.174.0", path = "./bench_util" } deno_config = { version = "=0.39.3", features = ["workspace", "sync"] } diff --git a/cli/cache/parsed_source.rs b/cli/cache/parsed_source.rs index 7e819ae998..4d031f8bf2 100644 --- a/cli/cache/parsed_source.rs +++ b/cli/cache/parsed_source.rs @@ -95,11 +95,21 @@ impl ParsedSourceCache { self.sources.lock().remove(specifier); } + /// Fress all parsed sources from memory. + pub fn free_all(&self) { + self.sources.lock().clear(); + } + /// Creates a parser that will reuse a ParsedSource from the store /// if it exists, or else parse. pub fn as_capturing_parser(&self) -> CapturingEsParser { CapturingEsParser::new(None, self) } + + #[cfg(test)] + pub fn len(&self) -> usize { + self.sources.lock().len() + } } /// It's ok that this is racy since in non-LSP situations diff --git a/cli/module_loader.rs b/cli/module_loader.rs index 447c85a9ac..c5f80d68e0 100644 --- a/cli/module_loader.rs +++ b/cli/module_loader.rs @@ -7,6 +7,8 @@ use std::path::PathBuf; use std::pin::Pin; use std::rc::Rc; use std::str; +use std::sync::atomic::AtomicU16; +use std::sync::atomic::Ordering; use std::sync::Arc; use crate::args::jsr_url; @@ -49,6 +51,7 @@ use deno_core::error::generic_error; use deno_core::error::AnyError; use deno_core::futures::future::FutureExt; use deno_core::futures::Future; +use deno_core::parking_lot::Mutex; use deno_core::resolve_url; use deno_core::ModuleCodeString; use deno_core::ModuleLoader; @@ -222,6 +225,42 @@ struct SharedCliModuleLoaderState { npm_module_loader: NpmModuleLoader, parsed_source_cache: Arc, resolver: Arc, + in_flight_loads_tracker: InFlightModuleLoadsTracker, +} + +struct InFlightModuleLoadsTracker { + loads_number: Arc, + cleanup_task_timeout: u64, + cleanup_task_handle: Arc>>>, +} + +impl InFlightModuleLoadsTracker { + pub fn increase(&self) { + self.loads_number.fetch_add(1, Ordering::Relaxed); + if let Some(task) = self.cleanup_task_handle.lock().take() { + task.abort(); + } + } + + pub fn decrease(&self, parsed_source_cache: &Arc) { + let prev = self.loads_number.fetch_sub(1, Ordering::Relaxed); + if prev == 1 { + let parsed_source_cache = parsed_source_cache.clone(); + let timeout = self.cleanup_task_timeout; + let task_handle = tokio::spawn(async move { + // We use a timeout here, which is defined to 10s, + // so that in situations when dynamic imports are loaded after the startup, + // we don't need to recompute and analyze multiple modules. + tokio::time::sleep(std::time::Duration::from_millis(timeout)).await; + parsed_source_cache.free_all(); + }); + let maybe_prev_task = + self.cleanup_task_handle.lock().replace(task_handle); + if let Some(prev_task) = maybe_prev_task { + prev_task.abort(); + } + } + } } pub struct CliModuleLoaderFactory { @@ -272,6 +311,11 @@ impl CliModuleLoaderFactory { npm_module_loader, parsed_source_cache, resolver, + in_flight_loads_tracker: InFlightModuleLoadsTracker { + loads_number: Arc::new(AtomicU16::new(0)), + cleanup_task_timeout: 10_000, + cleanup_task_handle: Arc::new(Mutex::new(None)), + }, }), } } @@ -867,6 +911,7 @@ impl ModuleLoader _maybe_referrer: Option, is_dynamic: bool, ) -> Pin>>> { + self.0.shared.in_flight_loads_tracker.increase(); if self.0.shared.in_npm_pkg_checker.in_npm_package(specifier) { return Box::pin(deno_core::futures::future::ready(Ok(()))); } @@ -921,6 +966,14 @@ impl ModuleLoader .boxed_local() } + fn finish_load(&self) { + self + .0 + .shared + .in_flight_loads_tracker + .decrease(&self.0.shared.parsed_source_cache); + } + fn code_cache_ready( &self, specifier: ModuleSpecifier, @@ -1103,3 +1156,44 @@ impl NodeRequireLoader self.cjs_tracker.is_maybe_cjs(specifier, media_type) } } + +#[cfg(test)] +mod tests { + use super::*; + use deno_graph::ParsedSourceStore; + + #[tokio::test] + async fn test_inflight_module_loads_tracker() { + let tracker = InFlightModuleLoadsTracker { + loads_number: Default::default(), + cleanup_task_timeout: 10, + cleanup_task_handle: Default::default(), + }; + + let specifier = ModuleSpecifier::parse("file:///a.js").unwrap(); + let source = "const a = 'hello';"; + let parsed_source_cache = Arc::new(ParsedSourceCache::default()); + let parsed_source = parsed_source_cache + .remove_or_parse_module(&specifier, source.into(), MediaType::JavaScript) + .unwrap(); + parsed_source_cache.set_parsed_source(specifier, parsed_source); + + assert_eq!(parsed_source_cache.len(), 1); + assert!(tracker.cleanup_task_handle.lock().is_none()); + tracker.increase(); + tracker.increase(); + assert!(tracker.cleanup_task_handle.lock().is_none()); + tracker.decrease(&parsed_source_cache); + assert!(tracker.cleanup_task_handle.lock().is_none()); + tracker.decrease(&parsed_source_cache); + assert!(tracker.cleanup_task_handle.lock().is_some()); + assert_eq!(parsed_source_cache.len(), 1); + tracker.increase(); + assert!(tracker.cleanup_task_handle.lock().is_none()); + assert_eq!(parsed_source_cache.len(), 1); + tracker.decrease(&parsed_source_cache); + // Rather long timeout, but to make sure CI is not flaking on it. + tokio::time::sleep(std::time::Duration::from_millis(500)).await; + assert_eq!(parsed_source_cache.len(), 0); + } +} From f098dd02f7d1290952dd3c5badc8e4e56eed7afd Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Thu, 5 Dec 2024 19:00:35 +0100 Subject: [PATCH 221/227] fix(task): `--recursive` option not working (#27183) We didn't handle the `--recursive` option properly in `deno task`. This PR addresses that. Fixes https://github.com/denoland/deno/issues/27174 --- cli/args/flags.rs | 17 +++++++---- cli/tools/task.rs | 10 +++++-- tests/specs/task/filter/__test__.jsonc | 30 +++++++++++++++++++ .../task/filter/deno_filter_recursive.out | 2 ++ tests/specs/task/filter/deno_recursive.out | 4 +++ .../task/filter/deno_recursive_no_pkg.out | 4 +++ .../deno_recursive_no_pkg/bar/deno.json | 5 ++++ .../filter/deno_recursive_no_pkg/deno.json | 6 ++++ .../deno_recursive_no_pkg/foo/deno.json | 5 ++++ .../task/filter/npm_filter_recursive.out | 2 ++ tests/specs/task/filter/npm_recursive.out | 4 +++ .../task/filter/npm_recursive_no_pkg.out | 4 +++ .../npm_recursive_no_pkg/bar/package.json | 5 ++++ .../npm_recursive_no_pkg/foo/package.json | 5 ++++ .../filter/npm_recursive_no_pkg/package.json | 3 ++ 15 files changed, 99 insertions(+), 7 deletions(-) create mode 100644 tests/specs/task/filter/deno_filter_recursive.out create mode 100644 tests/specs/task/filter/deno_recursive.out create mode 100644 tests/specs/task/filter/deno_recursive_no_pkg.out create mode 100644 tests/specs/task/filter/deno_recursive_no_pkg/bar/deno.json create mode 100644 tests/specs/task/filter/deno_recursive_no_pkg/deno.json create mode 100644 tests/specs/task/filter/deno_recursive_no_pkg/foo/deno.json create mode 100644 tests/specs/task/filter/npm_filter_recursive.out create mode 100644 tests/specs/task/filter/npm_recursive.out create mode 100644 tests/specs/task/filter/npm_recursive_no_pkg.out create mode 100644 tests/specs/task/filter/npm_recursive_no_pkg/bar/package.json create mode 100644 tests/specs/task/filter/npm_recursive_no_pkg/foo/package.json create mode 100644 tests/specs/task/filter/npm_recursive_no_pkg/package.json diff --git a/cli/args/flags.rs b/cli/args/flags.rs index c08d81abb0..cdeaa1b335 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -5277,8 +5277,15 @@ fn task_parse( unstable_args_parse(flags, matches, UnstableArgsConfig::ResolutionAndRuntime); node_modules_arg_parse(flags, matches); - let filter = matches.remove_one::("filter"); - let recursive = matches.get_flag("recursive") || filter.is_some(); + let mut recursive = matches.get_flag("recursive"); + let filter = if let Some(filter) = matches.remove_one::("filter") { + recursive = false; + Some(filter) + } else if recursive { + Some("*".to_string()) + } else { + None + }; let mut task_flags = TaskFlags { cwd: matches.remove_one::("cwd"), @@ -10538,7 +10545,7 @@ mod tests { cwd: None, task: Some("build".to_string()), is_run: false, - recursive: true, + recursive: false, filter: Some("*".to_string()), eval: false, }), @@ -10555,7 +10562,7 @@ mod tests { task: Some("build".to_string()), is_run: false, recursive: true, - filter: None, + filter: Some("*".to_string()), eval: false, }), ..Flags::default() @@ -10571,7 +10578,7 @@ mod tests { task: Some("build".to_string()), is_run: false, recursive: true, - filter: None, + filter: Some("*".to_string()), eval: false, }), ..Flags::default() diff --git a/cli/tools/task.rs b/cli/tools/task.rs index 01d6ac16ee..fc1410aa0e 100644 --- a/cli/tools/task.rs +++ b/cli/tools/task.rs @@ -88,6 +88,7 @@ pub async fn execute_script( &package_regex, filter, force_use_pkg_json, + task_flags.recursive, )?; return Ok(0); @@ -97,7 +98,9 @@ pub async fn execute_script( let mut packages_task_info: Vec = vec![]; for folder in workspace.config_folders() { - if !matches_package(folder.1, force_use_pkg_json, &package_regex) { + if !task_flags.recursive + && !matches_package(folder.1, force_use_pkg_json, &package_regex) + { continue; } @@ -700,12 +703,15 @@ fn print_available_tasks_workspace( package_regex: &Regex, filter: &str, force_use_pkg_json: bool, + recursive: bool, ) -> Result<(), AnyError> { let workspace = cli_options.workspace(); let mut matched = false; for folder in workspace.config_folders() { - if !matches_package(folder.1, force_use_pkg_json, package_regex) { + if !recursive + && !matches_package(folder.1, force_use_pkg_json, package_regex) + { continue; } matched = true; diff --git a/tests/specs/task/filter/__test__.jsonc b/tests/specs/task/filter/__test__.jsonc index 45f4e7d7d8..10e2e8f6db 100644 --- a/tests/specs/task/filter/__test__.jsonc +++ b/tests/specs/task/filter/__test__.jsonc @@ -40,6 +40,21 @@ "args": "task --filter *", "output": "npm_filter_no_task.out" }, + "npm_recursive": { + "cwd": "./npm", + "args": "task -r dev", + "output": "npm_recursive.out" + }, + "npm_recursive_no_pkg": { + "cwd": "./npm_recursive_no_pkg", + "args": "task -r dev", + "output": "npm_recursive_no_pkg.out" + }, + "npm_filter_recursive": { + "cwd": "./npm", + "args": "task -r --filter foo dev", + "output": "npm_filter_recursive.out" + }, "deno_all": { "cwd": "./deno", "args": "task --filter * dev", @@ -74,6 +89,21 @@ "cwd": "./deno", "args": "task --filter *", "output": "deno_filter_no_task.out" + }, + "deno_recursive": { + "cwd": "./deno", + "args": "task -r dev", + "output": "deno_recursive.out" + }, + "deno_recursive_no_pkg": { + "cwd": "./deno_recursive_no_pkg", + "args": "task -r dev", + "output": "deno_recursive_no_pkg.out" + }, + "deno_filter_recursive": { + "cwd": "./deno", + "args": "task -r --filter @deno/foo dev", + "output": "deno_filter_recursive.out" } } } diff --git a/tests/specs/task/filter/deno_filter_recursive.out b/tests/specs/task/filter/deno_filter_recursive.out new file mode 100644 index 0000000000..4bfebd6e92 --- /dev/null +++ b/tests/specs/task/filter/deno_filter_recursive.out @@ -0,0 +1,2 @@ +Task dev echo '@deno/foo' +@deno/foo diff --git a/tests/specs/task/filter/deno_recursive.out b/tests/specs/task/filter/deno_recursive.out new file mode 100644 index 0000000000..c3c3441559 --- /dev/null +++ b/tests/specs/task/filter/deno_recursive.out @@ -0,0 +1,4 @@ +Task dev echo '@deno/bar' +@deno/bar +Task dev echo '@deno/foo' +@deno/foo diff --git a/tests/specs/task/filter/deno_recursive_no_pkg.out b/tests/specs/task/filter/deno_recursive_no_pkg.out new file mode 100644 index 0000000000..592d4640cd --- /dev/null +++ b/tests/specs/task/filter/deno_recursive_no_pkg.out @@ -0,0 +1,4 @@ +Task dev echo 'bar' +bar +Task dev echo 'foo' +foo diff --git a/tests/specs/task/filter/deno_recursive_no_pkg/bar/deno.json b/tests/specs/task/filter/deno_recursive_no_pkg/bar/deno.json new file mode 100644 index 0000000000..6a93295d97 --- /dev/null +++ b/tests/specs/task/filter/deno_recursive_no_pkg/bar/deno.json @@ -0,0 +1,5 @@ +{ + "tasks": { + "dev": "echo 'bar'" + } +} diff --git a/tests/specs/task/filter/deno_recursive_no_pkg/deno.json b/tests/specs/task/filter/deno_recursive_no_pkg/deno.json new file mode 100644 index 0000000000..133ab666b4 --- /dev/null +++ b/tests/specs/task/filter/deno_recursive_no_pkg/deno.json @@ -0,0 +1,6 @@ +{ + "workspace": [ + "./foo", + "./bar" + ] +} diff --git a/tests/specs/task/filter/deno_recursive_no_pkg/foo/deno.json b/tests/specs/task/filter/deno_recursive_no_pkg/foo/deno.json new file mode 100644 index 0000000000..64a4cbccf0 --- /dev/null +++ b/tests/specs/task/filter/deno_recursive_no_pkg/foo/deno.json @@ -0,0 +1,5 @@ +{ + "tasks": { + "dev": "echo 'foo'" + } +} diff --git a/tests/specs/task/filter/npm_filter_recursive.out b/tests/specs/task/filter/npm_filter_recursive.out new file mode 100644 index 0000000000..f879b66df8 --- /dev/null +++ b/tests/specs/task/filter/npm_filter_recursive.out @@ -0,0 +1,2 @@ +Task dev echo 'foo' +foo diff --git a/tests/specs/task/filter/npm_recursive.out b/tests/specs/task/filter/npm_recursive.out new file mode 100644 index 0000000000..592d4640cd --- /dev/null +++ b/tests/specs/task/filter/npm_recursive.out @@ -0,0 +1,4 @@ +Task dev echo 'bar' +bar +Task dev echo 'foo' +foo diff --git a/tests/specs/task/filter/npm_recursive_no_pkg.out b/tests/specs/task/filter/npm_recursive_no_pkg.out new file mode 100644 index 0000000000..592d4640cd --- /dev/null +++ b/tests/specs/task/filter/npm_recursive_no_pkg.out @@ -0,0 +1,4 @@ +Task dev echo 'bar' +bar +Task dev echo 'foo' +foo diff --git a/tests/specs/task/filter/npm_recursive_no_pkg/bar/package.json b/tests/specs/task/filter/npm_recursive_no_pkg/bar/package.json new file mode 100644 index 0000000000..cc1907fab4 --- /dev/null +++ b/tests/specs/task/filter/npm_recursive_no_pkg/bar/package.json @@ -0,0 +1,5 @@ +{ + "scripts": { + "dev": "echo 'bar'" + } +} diff --git a/tests/specs/task/filter/npm_recursive_no_pkg/foo/package.json b/tests/specs/task/filter/npm_recursive_no_pkg/foo/package.json new file mode 100644 index 0000000000..636dcd13bd --- /dev/null +++ b/tests/specs/task/filter/npm_recursive_no_pkg/foo/package.json @@ -0,0 +1,5 @@ +{ + "scripts": { + "dev": "echo 'foo'" + } +} diff --git a/tests/specs/task/filter/npm_recursive_no_pkg/package.json b/tests/specs/task/filter/npm_recursive_no_pkg/package.json new file mode 100644 index 0000000000..2d70009f2c --- /dev/null +++ b/tests/specs/task/filter/npm_recursive_no_pkg/package.json @@ -0,0 +1,3 @@ +{ + "workspaces": ["./foo", "./bar"] +} From ffac2828054036cdd5a0541b4b733181d591af19 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Thu, 5 Dec 2024 13:55:35 -0500 Subject: [PATCH 222/227] fix(install): use locked version of jsr package when fetching exports (#27237) Fixes #27193. --- cli/graph_util.rs | 33 +++++++++++-------- cli/tools/registry/pm/cache_deps.rs | 32 +++++++++++------- cli/tools/registry/pm/deps.rs | 16 ++------- .../@denotest/multiple-exports/0.7.0/add.ts | 1 + .../multiple-exports/0.7.0/data.json | 3 ++ .../multiple-exports/0.7.0/subtract.ts | 1 + .../multiple-exports/0.7.0_meta.json | 7 ++++ .../@denotest/multiple-exports/0.7.1/add.ts | 1 + .../multiple-exports/0.7.1/data.json | 3 ++ .../multiple-exports/0.7.1/multiply.ts | 3 ++ .../multiple-exports/0.7.1/subtract.ts | 1 + .../multiple-exports/0.7.1_meta.json | 8 +++++ .../jsr/@denotest/multiple-exports/meta.json | 2 ++ .../jsr_exports_uses_locked/__test__.jsonc | 9 +++++ .../install/jsr_exports_uses_locked/deno.json | 5 +++ .../install/jsr_exports_uses_locked/deno.lock | 28 ++++++++++++++++ .../jsr_exports_uses_locked/install.out | 13 ++++++++ 17 files changed, 128 insertions(+), 38 deletions(-) create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.7.0/add.ts create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.7.0/data.json create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.7.0/subtract.ts create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.7.0_meta.json create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.7.1/add.ts create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.7.1/data.json create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.7.1/multiply.ts create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.7.1/subtract.ts create mode 100644 tests/registry/jsr/@denotest/multiple-exports/0.7.1_meta.json create mode 100644 tests/specs/install/jsr_exports_uses_locked/__test__.jsonc create mode 100644 tests/specs/install/jsr_exports_uses_locked/deno.json create mode 100644 tests/specs/install/jsr_exports_uses_locked/deno.lock create mode 100644 tests/specs/install/jsr_exports_uses_locked/install.out diff --git a/cli/graph_util.rs b/cli/graph_util.rs index 63997dc9ce..22117990d2 100644 --- a/cli/graph_util.rs +++ b/cli/graph_util.rs @@ -109,6 +109,25 @@ pub fn graph_valid( } } +pub fn fill_graph_from_lockfile( + graph: &mut ModuleGraph, + lockfile: &deno_lockfile::Lockfile, +) { + graph.fill_from_lockfile(FillFromLockfileOptions { + redirects: lockfile + .content + .redirects + .iter() + .map(|(from, to)| (from.as_str(), to.as_str())), + package_specifiers: lockfile + .content + .packages + .specifiers + .iter() + .map(|(dep, id)| (dep, id.as_str())), + }); +} + #[derive(Clone)] pub struct GraphWalkErrorsOptions { pub check_js: bool, @@ -603,19 +622,7 @@ impl ModuleGraphBuilder { // populate the information from the lockfile if let Some(lockfile) = &self.lockfile { let lockfile = lockfile.lock(); - graph.fill_from_lockfile(FillFromLockfileOptions { - redirects: lockfile - .content - .redirects - .iter() - .map(|(from, to)| (from.as_str(), to.as_str())), - package_specifiers: lockfile - .content - .packages - .specifiers - .iter() - .map(|(dep, id)| (dep, id.as_str())), - }); + fill_graph_from_lockfile(graph, &lockfile); } } diff --git a/cli/tools/registry/pm/cache_deps.rs b/cli/tools/registry/pm/cache_deps.rs index f9d67e4d4f..dbec8a3b3f 100644 --- a/cli/tools/registry/pm/cache_deps.rs +++ b/cli/tools/registry/pm/cache_deps.rs @@ -1,5 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use std::borrow::Cow; use std::sync::Arc; use crate::factory::CliFactory; @@ -37,6 +38,16 @@ pub async fn cache_top_level_deps( factory.file_fetcher()?.clone(), )) }; + let mut graph_permit = factory + .main_module_graph_container() + .await? + .acquire_update_permit() + .await; + let graph = graph_permit.graph_mut(); + if let Some(lockfile) = cli_options.maybe_lockfile() { + let lockfile = lockfile.lock(); + crate::graph_util::fill_graph_from_lockfile(graph, &lockfile); + } let mut roots = Vec::new(); @@ -67,13 +78,16 @@ pub async fn cache_top_level_deps( if !seen_reqs.insert(req.req().clone()) { continue; } + let resolved_req = graph.packages.mappings().get(req.req()); let jsr_resolver = jsr_resolver.clone(); info_futures.push(async move { - if let Some(nv) = jsr_resolver.req_to_nv(req.req()).await { - if let Some(info) = jsr_resolver.package_version_info(&nv).await - { - return Some((specifier.clone(), info)); - } + let nv = if let Some(req) = resolved_req { + Cow::Borrowed(req) + } else { + Cow::Owned(jsr_resolver.req_to_nv(req.req()).await?) + }; + if let Some(info) = jsr_resolver.package_version_info(&nv).await { + return Some((specifier.clone(), info)); } None }); @@ -106,12 +120,8 @@ pub async fn cache_top_level_deps( } } } - let mut graph_permit = factory - .main_module_graph_container() - .await? - .acquire_update_permit() - .await; - let graph = graph_permit.graph_mut(); + drop(info_futures); + factory .module_load_preparer() .await? diff --git a/cli/tools/registry/pm/deps.rs b/cli/tools/registry/pm/deps.rs index b7e1c0f0d4..d82e9954cd 100644 --- a/cli/tools/registry/pm/deps.rs +++ b/cli/tools/registry/pm/deps.rs @@ -18,7 +18,6 @@ use deno_core::futures::stream::FuturesUnordered; use deno_core::futures::FutureExt; use deno_core::futures::StreamExt; use deno_core::serde_json; -use deno_graph::FillFromLockfileOptions; use deno_package_json::PackageJsonDepsMap; use deno_package_json::PackageJsonRc; use deno_runtime::deno_permissions::PermissionsContainer; @@ -533,19 +532,8 @@ impl DepManager { // populate the information from the lockfile if let Some(lockfile) = &self.lockfile { let lockfile = lockfile.lock(); - graph.fill_from_lockfile(FillFromLockfileOptions { - redirects: lockfile - .content - .redirects - .iter() - .map(|(from, to)| (from.as_str(), to.as_str())), - package_specifiers: lockfile - .content - .packages - .specifiers - .iter() - .map(|(dep, id)| (dep, id.as_str())), - }); + + crate::graph_util::fill_graph_from_lockfile(graph, &lockfile); } let npm_resolver = self.npm_resolver.as_managed().unwrap(); diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.7.0/add.ts b/tests/registry/jsr/@denotest/multiple-exports/0.7.0/add.ts new file mode 100644 index 0000000000..de02f69024 --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.7.0/add.ts @@ -0,0 +1 @@ +export * from "jsr:@denotest/add@1"; diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.7.0/data.json b/tests/registry/jsr/@denotest/multiple-exports/0.7.0/data.json new file mode 100644 index 0000000000..885e71c6cc --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.7.0/data.json @@ -0,0 +1,3 @@ +{ + "a": 1 +} \ No newline at end of file diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.7.0/subtract.ts b/tests/registry/jsr/@denotest/multiple-exports/0.7.0/subtract.ts new file mode 100644 index 0000000000..215c42310d --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.7.0/subtract.ts @@ -0,0 +1 @@ +export * from "jsr:@denotest/subtract@1"; diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.7.0_meta.json b/tests/registry/jsr/@denotest/multiple-exports/0.7.0_meta.json new file mode 100644 index 0000000000..d9f58b9a61 --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.7.0_meta.json @@ -0,0 +1,7 @@ +{ + "exports": { + "./add": "./add.ts", + "./subtract": "./subtract.ts", + "./data-json": "./data.json" + } +} diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.7.1/add.ts b/tests/registry/jsr/@denotest/multiple-exports/0.7.1/add.ts new file mode 100644 index 0000000000..de02f69024 --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.7.1/add.ts @@ -0,0 +1 @@ +export * from "jsr:@denotest/add@1"; diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.7.1/data.json b/tests/registry/jsr/@denotest/multiple-exports/0.7.1/data.json new file mode 100644 index 0000000000..885e71c6cc --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.7.1/data.json @@ -0,0 +1,3 @@ +{ + "a": 1 +} \ No newline at end of file diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.7.1/multiply.ts b/tests/registry/jsr/@denotest/multiple-exports/0.7.1/multiply.ts new file mode 100644 index 0000000000..ce87b38fc8 --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.7.1/multiply.ts @@ -0,0 +1,3 @@ +export function multiply(a: number, b: number): number { + return a * b; +} \ No newline at end of file diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.7.1/subtract.ts b/tests/registry/jsr/@denotest/multiple-exports/0.7.1/subtract.ts new file mode 100644 index 0000000000..215c42310d --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.7.1/subtract.ts @@ -0,0 +1 @@ +export * from "jsr:@denotest/subtract@1"; diff --git a/tests/registry/jsr/@denotest/multiple-exports/0.7.1_meta.json b/tests/registry/jsr/@denotest/multiple-exports/0.7.1_meta.json new file mode 100644 index 0000000000..2897812168 --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/0.7.1_meta.json @@ -0,0 +1,8 @@ +{ + "exports": { + "./add": "./add.ts", + "./subtract": "./subtract.ts", + "./data-json": "./data.json", + "./multiply": "./multiply.ts" + } +} diff --git a/tests/registry/jsr/@denotest/multiple-exports/meta.json b/tests/registry/jsr/@denotest/multiple-exports/meta.json index aaaf18a184..c545ae8f46 100644 --- a/tests/registry/jsr/@denotest/multiple-exports/meta.json +++ b/tests/registry/jsr/@denotest/multiple-exports/meta.json @@ -1,6 +1,8 @@ { "versions": { "1.0.0": {}, + "0.7.1": {}, + "0.7.0": {}, "0.5.0": {}, "0.2.0": {} } diff --git a/tests/specs/install/jsr_exports_uses_locked/__test__.jsonc b/tests/specs/install/jsr_exports_uses_locked/__test__.jsonc new file mode 100644 index 0000000000..254fe8b989 --- /dev/null +++ b/tests/specs/install/jsr_exports_uses_locked/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "tempDir": true, + "steps": [ + { + "args": "install", + "output": "install.out" + } + ] +} diff --git a/tests/specs/install/jsr_exports_uses_locked/deno.json b/tests/specs/install/jsr_exports_uses_locked/deno.json new file mode 100644 index 0000000000..0ede5a3a1d --- /dev/null +++ b/tests/specs/install/jsr_exports_uses_locked/deno.json @@ -0,0 +1,5 @@ +{ + "imports": { + "@denotest/multiple-exports": "jsr:@denotest/multiple-exports@^0.7.0" + } +} diff --git a/tests/specs/install/jsr_exports_uses_locked/deno.lock b/tests/specs/install/jsr_exports_uses_locked/deno.lock new file mode 100644 index 0000000000..cd27474396 --- /dev/null +++ b/tests/specs/install/jsr_exports_uses_locked/deno.lock @@ -0,0 +1,28 @@ +{ + "version": "4", + "specifiers": { + "jsr:@denotest/add@1": "1.0.0", + "jsr:@denotest/multiple-exports@0.7": "0.7.0", + "jsr:@denotest/subtract@1": "1.0.0" + }, + "jsr": { + "@denotest/add@1.0.0": { + "integrity": "3b2e675c1ad7fba2a45bc251992e01aff08a3c974ac09079b11e6a5b95d4bfcb" + }, + "@denotest/multiple-exports@0.7.0": { + "integrity": "efe9748a0c0939c7ac245fee04acc0c42bd7a61874ff71a360c4543e4f5f6b36", + "dependencies": [ + "jsr:@denotest/add", + "jsr:@denotest/subtract" + ] + }, + "@denotest/subtract@1.0.0": { + "integrity": "e178a7101c073e93d9efa6833d5cbf83bc1bc8d509b7c2a5ecbf74265e917597" + } + }, + "workspace": { + "dependencies": [ + "jsr:@denotest/multiple-exports@0.7" + ] + } +} diff --git a/tests/specs/install/jsr_exports_uses_locked/install.out b/tests/specs/install/jsr_exports_uses_locked/install.out new file mode 100644 index 0000000000..b4e8b640f6 --- /dev/null +++ b/tests/specs/install/jsr_exports_uses_locked/install.out @@ -0,0 +1,13 @@ +[UNORDERED_START] +Download http://127.0.0.1:4250/@denotest/multiple-exports/0.7.0_meta.json +Download http://127.0.0.1:4250/@denotest/multiple-exports/meta.json +Download http://127.0.0.1:4250/@denotest/multiple-exports/0.7.0/add.ts +Download http://127.0.0.1:4250/@denotest/multiple-exports/0.7.0/subtract.ts +Download http://127.0.0.1:4250/@denotest/multiple-exports/0.7.0/data.json +Download http://127.0.0.1:4250/@denotest/add/meta.json +Download http://127.0.0.1:4250/@denotest/subtract/meta.json +Download http://127.0.0.1:4250/@denotest/add/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/subtract/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts +Download http://127.0.0.1:4250/@denotest/subtract/1.0.0/mod.ts +[UNORDERED_END] From 2e2d3173d1042ea95b854fc1e3ca3805a45cb2e2 Mon Sep 17 00:00:00 2001 From: denobot <33910674+denobot@users.noreply.github.com> Date: Thu, 5 Dec 2024 20:12:57 -0500 Subject: [PATCH 223/227] chore: forward v2.1.3 release commit to main (#27248) This is the release commit being forwarded back to main for 2.1.3 Co-authored-by: bartlomieju --- .github/workflows/ci.generate.ts | 2 +- .github/workflows/ci.yml | 8 ++--- Cargo.lock | 62 ++++++++++++++++---------------- Cargo.toml | 60 +++++++++++++++---------------- Releases.md | 20 +++++++++++ bench_util/Cargo.toml | 2 +- cli/Cargo.toml | 2 +- ext/broadcast_channel/Cargo.toml | 2 +- ext/cache/Cargo.toml | 2 +- ext/canvas/Cargo.toml | 2 +- ext/console/Cargo.toml | 2 +- ext/cron/Cargo.toml | 2 +- ext/crypto/Cargo.toml | 2 +- ext/fetch/Cargo.toml | 2 +- ext/ffi/Cargo.toml | 2 +- ext/fs/Cargo.toml | 2 +- ext/http/Cargo.toml | 2 +- ext/io/Cargo.toml | 2 +- ext/kv/Cargo.toml | 2 +- ext/napi/Cargo.toml | 2 +- ext/napi/sym/Cargo.toml | 2 +- ext/net/Cargo.toml | 2 +- ext/node/Cargo.toml | 2 +- ext/telemetry/Cargo.toml | 2 +- ext/tls/Cargo.toml | 2 +- ext/url/Cargo.toml | 2 +- ext/web/Cargo.toml | 2 +- ext/webgpu/Cargo.toml | 2 +- ext/webidl/Cargo.toml | 2 +- ext/websocket/Cargo.toml | 2 +- ext/webstorage/Cargo.toml | 2 +- resolvers/deno/Cargo.toml | 2 +- resolvers/node/Cargo.toml | 2 +- resolvers/npm_cache/Cargo.toml | 2 +- runtime/Cargo.toml | 2 +- runtime/permissions/Cargo.toml | 2 +- 36 files changed, 117 insertions(+), 97 deletions(-) diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts index 9a166e6cf0..cb83842c2f 100755 --- a/.github/workflows/ci.generate.ts +++ b/.github/workflows/ci.generate.ts @@ -5,7 +5,7 @@ import { stringify } from "jsr:@std/yaml@^0.221/stringify"; // Bump this number when you want to purge the cache. // Note: the tools/release/01_bump_crate_versions.ts script will update this version // automatically via regex, so ensure that this line maintains this format. -const cacheVersion = 28; +const cacheVersion = 29; const ubuntuX86Runner = "ubuntu-24.04"; const ubuntuX86XlRunner = "ubuntu-24.04-xl"; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd48f1fb0d..6dc71ffa2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -361,8 +361,8 @@ jobs: path: |- ~/.cargo/registry/index ~/.cargo/registry/cache - key: '28-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}' - restore-keys: '28-cargo-home-${{ matrix.os }}-${{ matrix.arch }}' + key: '29-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}' + restore-keys: '29-cargo-home-${{ matrix.os }}-${{ matrix.arch }}' if: '!(matrix.skip)' - name: Restore cache build output (PR) uses: actions/cache/restore@v4 @@ -375,7 +375,7 @@ jobs: !./target/*/*.zip !./target/*/*.tar.gz key: never_saved - restore-keys: '28-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-' + restore-keys: '29-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-' - name: Apply and update mtime cache if: '!(matrix.skip) && (!startsWith(github.ref, ''refs/tags/''))' uses: ./.github/mtime_cache @@ -685,7 +685,7 @@ jobs: !./target/*/*.zip !./target/*/*.sha256sum !./target/*/*.tar.gz - key: '28-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}' + key: '29-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}' publish-canary: name: publish canary runs-on: ubuntu-24.04 diff --git a/Cargo.lock b/Cargo.lock index b047b79f18..20874265bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1206,7 +1206,7 @@ dependencies = [ [[package]] name = "deno" -version = "2.1.2" +version = "2.1.3" dependencies = [ "anstream", "async-trait", @@ -1379,7 +1379,7 @@ dependencies = [ [[package]] name = "deno_bench_util" -version = "0.174.0" +version = "0.175.0" dependencies = [ "bencher", "deno_core", @@ -1388,7 +1388,7 @@ dependencies = [ [[package]] name = "deno_broadcast_channel" -version = "0.174.0" +version = "0.175.0" dependencies = [ "async-trait", "deno_core", @@ -1399,7 +1399,7 @@ dependencies = [ [[package]] name = "deno_cache" -version = "0.112.0" +version = "0.113.0" dependencies = [ "async-trait", "deno_core", @@ -1432,7 +1432,7 @@ dependencies = [ [[package]] name = "deno_canvas" -version = "0.49.0" +version = "0.50.0" dependencies = [ "deno_core", "deno_webgpu", @@ -1467,7 +1467,7 @@ dependencies = [ [[package]] name = "deno_console" -version = "0.180.0" +version = "0.181.0" dependencies = [ "deno_core", ] @@ -1515,7 +1515,7 @@ checksum = "fe4dccb6147bb3f3ba0c7a48e993bfeb999d2c2e47a81badee80e2b370c8d695" [[package]] name = "deno_cron" -version = "0.60.0" +version = "0.61.0" dependencies = [ "anyhow", "async-trait", @@ -1528,7 +1528,7 @@ dependencies = [ [[package]] name = "deno_crypto" -version = "0.194.0" +version = "0.195.0" dependencies = [ "aes", "aes-gcm", @@ -1617,7 +1617,7 @@ dependencies = [ [[package]] name = "deno_fetch" -version = "0.204.0" +version = "0.205.0" dependencies = [ "base64 0.21.7", "bytes", @@ -1651,7 +1651,7 @@ dependencies = [ [[package]] name = "deno_ffi" -version = "0.167.0" +version = "0.168.0" dependencies = [ "deno_core", "deno_permissions", @@ -1671,7 +1671,7 @@ dependencies = [ [[package]] name = "deno_fs" -version = "0.90.0" +version = "0.91.0" dependencies = [ "async-trait", "base32", @@ -1724,7 +1724,7 @@ dependencies = [ [[package]] name = "deno_http" -version = "0.178.0" +version = "0.179.0" dependencies = [ "async-compression", "async-trait", @@ -1763,7 +1763,7 @@ dependencies = [ [[package]] name = "deno_io" -version = "0.90.0" +version = "0.91.0" dependencies = [ "async-trait", "deno_core", @@ -1784,7 +1784,7 @@ dependencies = [ [[package]] name = "deno_kv" -version = "0.88.0" +version = "0.89.0" dependencies = [ "anyhow", "async-trait", @@ -1857,7 +1857,7 @@ dependencies = [ [[package]] name = "deno_napi" -version = "0.111.0" +version = "0.112.0" dependencies = [ "deno_core", "deno_permissions", @@ -1885,7 +1885,7 @@ dependencies = [ [[package]] name = "deno_net" -version = "0.172.0" +version = "0.173.0" dependencies = [ "deno_core", "deno_permissions", @@ -1902,7 +1902,7 @@ dependencies = [ [[package]] name = "deno_node" -version = "0.117.0" +version = "0.118.0" dependencies = [ "aead-gcm-stream", "aes", @@ -2013,7 +2013,7 @@ dependencies = [ [[package]] name = "deno_npm_cache" -version = "0.0.1" +version = "0.1.0" dependencies = [ "anyhow", "async-trait", @@ -2085,7 +2085,7 @@ dependencies = [ [[package]] name = "deno_permissions" -version = "0.40.0" +version = "0.41.0" dependencies = [ "deno_core", "deno_path_util", @@ -2103,7 +2103,7 @@ dependencies = [ [[package]] name = "deno_resolver" -version = "0.12.0" +version = "0.13.0" dependencies = [ "anyhow", "base32", @@ -2122,7 +2122,7 @@ dependencies = [ [[package]] name = "deno_runtime" -version = "0.189.0" +version = "0.190.0" dependencies = [ "color-print", "deno_ast", @@ -2223,7 +2223,7 @@ dependencies = [ [[package]] name = "deno_telemetry" -version = "0.2.0" +version = "0.3.0" dependencies = [ "async-trait", "deno_core", @@ -2264,7 +2264,7 @@ dependencies = [ [[package]] name = "deno_tls" -version = "0.167.0" +version = "0.168.0" dependencies = [ "deno_core", "deno_native_certs", @@ -2314,7 +2314,7 @@ dependencies = [ [[package]] name = "deno_url" -version = "0.180.0" +version = "0.181.0" dependencies = [ "deno_bench_util", "deno_console", @@ -2326,7 +2326,7 @@ dependencies = [ [[package]] name = "deno_web" -version = "0.211.0" +version = "0.212.0" dependencies = [ "async-trait", "base64-simd 0.8.0", @@ -2348,7 +2348,7 @@ dependencies = [ [[package]] name = "deno_webgpu" -version = "0.147.0" +version = "0.148.0" dependencies = [ "deno_core", "raw-window-handle", @@ -2361,7 +2361,7 @@ dependencies = [ [[package]] name = "deno_webidl" -version = "0.180.0" +version = "0.181.0" dependencies = [ "deno_bench_util", "deno_core", @@ -2369,7 +2369,7 @@ dependencies = [ [[package]] name = "deno_websocket" -version = "0.185.0" +version = "0.186.0" dependencies = [ "bytes", "deno_core", @@ -2391,7 +2391,7 @@ dependencies = [ [[package]] name = "deno_webstorage" -version = "0.175.0" +version = "0.176.0" dependencies = [ "deno_core", "deno_web", @@ -4906,7 +4906,7 @@ dependencies = [ [[package]] name = "napi_sym" -version = "0.110.0" +version = "0.111.0" dependencies = [ "quote", "serde", @@ -4961,7 +4961,7 @@ dependencies = [ [[package]] name = "node_resolver" -version = "0.19.0" +version = "0.20.0" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 079daee33c..4698acd06d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,17 +50,17 @@ repository = "https://github.com/denoland/deno" deno_ast = { version = "=0.44.0", features = ["transpiling"] } deno_core = { version = "0.324.0" } -deno_bench_util = { version = "0.174.0", path = "./bench_util" } +deno_bench_util = { version = "0.175.0", path = "./bench_util" } deno_config = { version = "=0.39.3", features = ["workspace", "sync"] } deno_lockfile = "=0.23.2" deno_media_type = { version = "0.2.0", features = ["module_specifier"] } deno_npm = "=0.26.0" deno_path_util = "=0.2.1" -deno_permissions = { version = "0.40.0", path = "./runtime/permissions" } -deno_runtime = { version = "0.189.0", path = "./runtime" } +deno_permissions = { version = "0.41.0", path = "./runtime/permissions" } +deno_runtime = { version = "0.190.0", path = "./runtime" } deno_semver = "=0.6.0" deno_terminal = "0.2.0" -napi_sym = { version = "0.110.0", path = "./ext/napi/sym" } +napi_sym = { version = "0.111.0", path = "./ext/napi/sym" } test_util = { package = "test_server", path = "./tests/util/server" } denokv_proto = "0.8.4" @@ -69,34 +69,34 @@ denokv_remote = "0.8.4" denokv_sqlite = { default-features = false, version = "0.8.4" } # exts -deno_broadcast_channel = { version = "0.174.0", path = "./ext/broadcast_channel" } -deno_cache = { version = "0.112.0", path = "./ext/cache" } -deno_canvas = { version = "0.49.0", path = "./ext/canvas" } -deno_console = { version = "0.180.0", path = "./ext/console" } -deno_cron = { version = "0.60.0", path = "./ext/cron" } -deno_crypto = { version = "0.194.0", path = "./ext/crypto" } -deno_fetch = { version = "0.204.0", path = "./ext/fetch" } -deno_ffi = { version = "0.167.0", path = "./ext/ffi" } -deno_fs = { version = "0.90.0", path = "./ext/fs" } -deno_http = { version = "0.178.0", path = "./ext/http" } -deno_io = { version = "0.90.0", path = "./ext/io" } -deno_kv = { version = "0.88.0", path = "./ext/kv" } -deno_napi = { version = "0.111.0", path = "./ext/napi" } -deno_net = { version = "0.172.0", path = "./ext/net" } -deno_node = { version = "0.117.0", path = "./ext/node" } -deno_telemetry = { version = "0.2.0", path = "./ext/telemetry" } -deno_tls = { version = "0.167.0", path = "./ext/tls" } -deno_url = { version = "0.180.0", path = "./ext/url" } -deno_web = { version = "0.211.0", path = "./ext/web" } -deno_webgpu = { version = "0.147.0", path = "./ext/webgpu" } -deno_webidl = { version = "0.180.0", path = "./ext/webidl" } -deno_websocket = { version = "0.185.0", path = "./ext/websocket" } -deno_webstorage = { version = "0.175.0", path = "./ext/webstorage" } +deno_broadcast_channel = { version = "0.175.0", path = "./ext/broadcast_channel" } +deno_cache = { version = "0.113.0", path = "./ext/cache" } +deno_canvas = { version = "0.50.0", path = "./ext/canvas" } +deno_console = { version = "0.181.0", path = "./ext/console" } +deno_cron = { version = "0.61.0", path = "./ext/cron" } +deno_crypto = { version = "0.195.0", path = "./ext/crypto" } +deno_fetch = { version = "0.205.0", path = "./ext/fetch" } +deno_ffi = { version = "0.168.0", path = "./ext/ffi" } +deno_fs = { version = "0.91.0", path = "./ext/fs" } +deno_http = { version = "0.179.0", path = "./ext/http" } +deno_io = { version = "0.91.0", path = "./ext/io" } +deno_kv = { version = "0.89.0", path = "./ext/kv" } +deno_napi = { version = "0.112.0", path = "./ext/napi" } +deno_net = { version = "0.173.0", path = "./ext/net" } +deno_node = { version = "0.118.0", path = "./ext/node" } +deno_telemetry = { version = "0.3.0", path = "./ext/telemetry" } +deno_tls = { version = "0.168.0", path = "./ext/tls" } +deno_url = { version = "0.181.0", path = "./ext/url" } +deno_web = { version = "0.212.0", path = "./ext/web" } +deno_webgpu = { version = "0.148.0", path = "./ext/webgpu" } +deno_webidl = { version = "0.181.0", path = "./ext/webidl" } +deno_websocket = { version = "0.186.0", path = "./ext/websocket" } +deno_webstorage = { version = "0.176.0", path = "./ext/webstorage" } # resolvers -deno_npm_cache = { version = "0.0.1", path = "./resolvers/npm_cache" } -deno_resolver = { version = "0.12.0", path = "./resolvers/deno" } -node_resolver = { version = "0.19.0", path = "./resolvers/node" } +deno_npm_cache = { version = "0.1.0", path = "./resolvers/npm_cache" } +deno_resolver = { version = "0.13.0", path = "./resolvers/deno" } +node_resolver = { version = "0.20.0", path = "./resolvers/node" } aes = "=0.8.3" anyhow = "1.0.57" diff --git a/Releases.md b/Releases.md index 6f9083ffde..e395934ac1 100644 --- a/Releases.md +++ b/Releases.md @@ -6,6 +6,26 @@ https://github.com/denoland/deno/releases We also have one-line install commands at: https://github.com/denoland/deno_install +### 2.1.3 / 2024.12.05 + +- feat(unstable): add metrics to otel (#27143) +- fix(fmt): stable formatting of HTML files with JS (#27164) +- fix(install): use locked version of jsr package when fetching exports (#27237) +- fix(node/fs): support `recursive` option in readdir (#27179) +- fix(node/worker_threads): data url not encoded properly with eval (#27184) +- fix(outdated): allow `--latest` without `--update` (#27227) +- fix(task): `--recursive` option not working (#27183) +- fix(task): don't panic with filter on missing task argument (#27180) +- fix(task): forward signals to spawned sub-processes on unix (#27141) +- fix(task): kill descendants when killing task process on Windows (#27163) +- fix(task): only pass args to root task (#27213) +- fix(unstable): otel context with multiple keys (#27230) +- fix(unstable/temporal): respect locale in `Duration.prototype.toLocaleString` + (#27000) +- fix: clear dep analysis when module loading is done (#27204) +- fix: improve auto-imports for npm packages (#27224) +- fix: support `workspace:^` and `workspace:~` version constraints (#27096) + ### 2.1.2 / 2024.11.28 - feat(unstable): Instrument Deno.serve (#26964) diff --git a/bench_util/Cargo.toml b/bench_util/Cargo.toml index 4d2284b6d9..65c51c24d5 100644 --- a/bench_util/Cargo.toml +++ b/bench_util/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_bench_util" -version = "0.174.0" +version = "0.175.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/cli/Cargo.toml b/cli/Cargo.toml index d8e59b5e35..4b4b17292c 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno" -version = "2.1.2" +version = "2.1.3" authors.workspace = true default-run = "deno" edition.workspace = true diff --git a/ext/broadcast_channel/Cargo.toml b/ext/broadcast_channel/Cargo.toml index a038359287..fccec9a66a 100644 --- a/ext/broadcast_channel/Cargo.toml +++ b/ext/broadcast_channel/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_broadcast_channel" -version = "0.174.0" +version = "0.175.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/cache/Cargo.toml b/ext/cache/Cargo.toml index edaf443c05..bf067c8e32 100644 --- a/ext/cache/Cargo.toml +++ b/ext/cache/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_cache" -version = "0.112.0" +version = "0.113.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/canvas/Cargo.toml b/ext/canvas/Cargo.toml index db624670f3..5ec468ec18 100644 --- a/ext/canvas/Cargo.toml +++ b/ext/canvas/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_canvas" -version = "0.49.0" +version = "0.50.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/console/Cargo.toml b/ext/console/Cargo.toml index 49ad243456..7e827efc61 100644 --- a/ext/console/Cargo.toml +++ b/ext/console/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_console" -version = "0.180.0" +version = "0.181.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/cron/Cargo.toml b/ext/cron/Cargo.toml index d8f7f20d0c..3762ace1a5 100644 --- a/ext/cron/Cargo.toml +++ b/ext/cron/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_cron" -version = "0.60.0" +version = "0.61.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/crypto/Cargo.toml b/ext/crypto/Cargo.toml index d8b740e087..f13e0a3c66 100644 --- a/ext/crypto/Cargo.toml +++ b/ext/crypto/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_crypto" -version = "0.194.0" +version = "0.195.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/fetch/Cargo.toml b/ext/fetch/Cargo.toml index 96d6a45a1f..2ad19bffde 100644 --- a/ext/fetch/Cargo.toml +++ b/ext/fetch/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_fetch" -version = "0.204.0" +version = "0.205.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/ffi/Cargo.toml b/ext/ffi/Cargo.toml index 23deb30810..23c71d0030 100644 --- a/ext/ffi/Cargo.toml +++ b/ext/ffi/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_ffi" -version = "0.167.0" +version = "0.168.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/fs/Cargo.toml b/ext/fs/Cargo.toml index 3fbcef4475..f9e3359d07 100644 --- a/ext/fs/Cargo.toml +++ b/ext/fs/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_fs" -version = "0.90.0" +version = "0.91.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/http/Cargo.toml b/ext/http/Cargo.toml index 5d7eec7353..4a398db859 100644 --- a/ext/http/Cargo.toml +++ b/ext/http/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_http" -version = "0.178.0" +version = "0.179.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/io/Cargo.toml b/ext/io/Cargo.toml index b8a14acd6f..f5d9e47245 100644 --- a/ext/io/Cargo.toml +++ b/ext/io/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_io" -version = "0.90.0" +version = "0.91.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/kv/Cargo.toml b/ext/kv/Cargo.toml index 3d050d9bbb..c0e030e3c8 100644 --- a/ext/kv/Cargo.toml +++ b/ext/kv/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_kv" -version = "0.88.0" +version = "0.89.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/napi/Cargo.toml b/ext/napi/Cargo.toml index 0910aacc7f..5bd86d31b4 100644 --- a/ext/napi/Cargo.toml +++ b/ext/napi/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_napi" -version = "0.111.0" +version = "0.112.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/napi/sym/Cargo.toml b/ext/napi/sym/Cargo.toml index ed69781fc3..478443e78f 100644 --- a/ext/napi/sym/Cargo.toml +++ b/ext/napi/sym/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "napi_sym" -version = "0.110.0" +version = "0.111.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/net/Cargo.toml b/ext/net/Cargo.toml index cfdd151f3b..efe46a79e7 100644 --- a/ext/net/Cargo.toml +++ b/ext/net/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_net" -version = "0.172.0" +version = "0.173.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/node/Cargo.toml b/ext/node/Cargo.toml index 89def9b0bc..9cd09f6fde 100644 --- a/ext/node/Cargo.toml +++ b/ext/node/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_node" -version = "0.117.0" +version = "0.118.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/telemetry/Cargo.toml b/ext/telemetry/Cargo.toml index 12d7777491..87b330b322 100644 --- a/ext/telemetry/Cargo.toml +++ b/ext/telemetry/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_telemetry" -version = "0.2.0" +version = "0.3.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/tls/Cargo.toml b/ext/tls/Cargo.toml index 2819dc4344..239c8f0834 100644 --- a/ext/tls/Cargo.toml +++ b/ext/tls/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_tls" -version = "0.167.0" +version = "0.168.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/url/Cargo.toml b/ext/url/Cargo.toml index 42cec915b5..8d0f951869 100644 --- a/ext/url/Cargo.toml +++ b/ext/url/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_url" -version = "0.180.0" +version = "0.181.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/web/Cargo.toml b/ext/web/Cargo.toml index 43c6d61053..c05bc2889c 100644 --- a/ext/web/Cargo.toml +++ b/ext/web/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_web" -version = "0.211.0" +version = "0.212.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/webgpu/Cargo.toml b/ext/webgpu/Cargo.toml index f84550553e..a6eea01ced 100644 --- a/ext/webgpu/Cargo.toml +++ b/ext/webgpu/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webgpu" -version = "0.147.0" +version = "0.148.0" authors = ["the Deno authors"] edition.workspace = true license = "MIT" diff --git a/ext/webidl/Cargo.toml b/ext/webidl/Cargo.toml index a60374bb8d..07ee546be8 100644 --- a/ext/webidl/Cargo.toml +++ b/ext/webidl/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webidl" -version = "0.180.0" +version = "0.181.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/websocket/Cargo.toml b/ext/websocket/Cargo.toml index 3807cb8cd5..5ba2172414 100644 --- a/ext/websocket/Cargo.toml +++ b/ext/websocket/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_websocket" -version = "0.185.0" +version = "0.186.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/webstorage/Cargo.toml b/ext/webstorage/Cargo.toml index ca68d17629..5e74700b84 100644 --- a/ext/webstorage/Cargo.toml +++ b/ext/webstorage/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_webstorage" -version = "0.175.0" +version = "0.176.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/resolvers/deno/Cargo.toml b/resolvers/deno/Cargo.toml index f5119478b8..ce5bee3839 100644 --- a/resolvers/deno/Cargo.toml +++ b/resolvers/deno/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_resolver" -version = "0.12.0" +version = "0.13.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/resolvers/node/Cargo.toml b/resolvers/node/Cargo.toml index 40fd5b87aa..111d67ad59 100644 --- a/resolvers/node/Cargo.toml +++ b/resolvers/node/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "node_resolver" -version = "0.19.0" +version = "0.20.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/resolvers/npm_cache/Cargo.toml b/resolvers/npm_cache/Cargo.toml index df01f62131..fab102dee8 100644 --- a/resolvers/npm_cache/Cargo.toml +++ b/resolvers/npm_cache/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_npm_cache" -version = "0.0.1" +version = "0.1.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index e4c0e188de..317e619bf7 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_runtime" -version = "0.189.0" +version = "0.190.0" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/runtime/permissions/Cargo.toml b/runtime/permissions/Cargo.toml index 5ecccdf7ec..0140f0594e 100644 --- a/runtime/permissions/Cargo.toml +++ b/runtime/permissions/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_permissions" -version = "0.40.0" +version = "0.41.0" authors.workspace = true edition.workspace = true license.workspace = true From 1ee13a3544c3b4e7890ea8826b8fb89863f8dbc3 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Fri, 6 Dec 2024 15:22:33 +0900 Subject: [PATCH 224/227] chore: add script to check remaining node compat cases (#27122) --- tests/node_compat/common.ts | 130 ++++++++++++++++++ tests/node_compat/runner/TODO.md | 30 +--- .../node_compat/runner/challenge_new_test.ts | 72 ++++++++++ tests/node_compat/runner/setup.ts | 65 ++------- tests/node_compat/test.ts | 64 +-------- 5 files changed, 217 insertions(+), 144 deletions(-) create mode 100644 tests/node_compat/runner/challenge_new_test.ts diff --git a/tests/node_compat/common.ts b/tests/node_compat/common.ts index 75a06566a6..2982095a29 100644 --- a/tests/node_compat/common.ts +++ b/tests/node_compat/common.ts @@ -2,6 +2,9 @@ import { partition } from "@std/collections/partition"; import { join } from "@std/path"; import * as JSONC from "@std/jsonc"; +import { walk } from "@std/fs/walk"; +import { relative } from "@std/path/posix/relative"; + /** * The test suite matches the folders inside the `test` folder inside the * node repo @@ -61,3 +64,130 @@ export function partitionParallelTestPaths( const partitions = partition(testPaths, (p) => !!p.match(PARALLEL_PATTERN)); return { parallel: partitions[0], sequential: partitions[1] }; } + +export const NODE_IGNORED_TEST_DIRS = [ + "addons", + "async-hooks", + "cctest", + "common", + "doctool", + "embedding", + "fixtures", + "fuzzers", + "js-native-api", + "node-api", + "overlapped-checker", + "report", + "testpy", + "tick-processor", + "tools", + "v8-updates", + "wasi", + "wpt", +]; + +export const VENDORED_NODE_TEST = new URL( + "./runner/suite/test/", + import.meta.url, +); +export const NODE_COMPAT_TEST_DEST_URL = new URL( + "./test/", + import.meta.url, +); + +export async function getNodeTests(): Promise { + const paths: string[] = []; + const rootPath = VENDORED_NODE_TEST.href.slice(7); + for await ( + const item of walk(VENDORED_NODE_TEST, { exts: [".js"] }) + ) { + const path = relative(rootPath, item.path); + if (NODE_IGNORED_TEST_DIRS.every((dir) => !path.startsWith(dir))) { + paths.push(path); + } + } + + return paths.sort(); +} + +export async function getDenoTests() { + const paths: string[] = []; + const rootPath = NODE_COMPAT_TEST_DEST_URL.href.slice(7); + for await ( + const item of walk(NODE_COMPAT_TEST_DEST_URL, { exts: [".js"] }) + ) { + const path = relative(rootPath, item.path); + paths.push(path); + } + + return paths.sort(); +} + +let testSerialId = 0; +const cwd = new URL(".", import.meta.url); + +export async function runNodeCompatTestCase( + testCase: string, + signal?: AbortSignal, +) { + const v8Flags = ["--stack-size=4000"]; + const testSource = await Deno.readTextFile(testCase); + const envVars: Record = {}; + const knownGlobals: string[] = []; + parseFlags(testSource).forEach((flag) => { + switch (flag) { + case "--expose_externalize_string": + v8Flags.push("--expose-externalize-string"); + knownGlobals.push("createExternalizableString"); + break; + case "--expose-gc": + v8Flags.push("--expose-gc"); + knownGlobals.push("gc"); + break; + default: + break; + } + }); + if (knownGlobals.length > 0) { + envVars["NODE_TEST_KNOWN_GLOBALS"] = knownGlobals.join(","); + } + // TODO(nathanwhit): once we match node's behavior on executing + // `node:test` tests when we run a file, we can remove this + const usesNodeTest = testSource.includes("node:test"); + const args = [ + usesNodeTest ? "test" : "run", + "-A", + "--quiet", + "--unstable-unsafe-proto", + "--unstable-bare-node-builtins", + "--unstable-fs", + "--v8-flags=" + v8Flags.join(), + ]; + if (usesNodeTest) { + // deno test typechecks by default + we want to pass script args + args.push("--no-check", "runner.ts", "--", testCase); + } else { + args.push("runner.ts", testCase); + } + + // Pipe stdout in order to output each test result as Deno.test output + // That way the tests will respect the `--quiet` option when provided + return new Deno.Command(Deno.execPath(), { + args, + env: { + TEST_SERIAL_ID: String(testSerialId++), + ...envVars, + }, + cwd, + stdout: "piped", + stderr: "piped", + signal, + }).spawn(); +} + +/** Parses the special "Flags:"" syntax in Node.js test files */ +function parseFlags(source: string): string[] { + const line = /^\/\/ Flags: (.+)$/um.exec(source); + if (line == null) return []; + return line[1].split(" "); +} diff --git a/tests/node_compat/runner/TODO.md b/tests/node_compat/runner/TODO.md index f6393a5e1f..d33231fec7 100644 --- a/tests/node_compat/runner/TODO.md +++ b/tests/node_compat/runner/TODO.md @@ -1,7 +1,7 @@ # Remaining Node Tests -1120 tests out of 3681 have been ported from Node 20.11.1 (30.43% ported, 69.68% remaining). +1163 tests out of 3681 have been ported from Node 20.11.1 (31.59% ported, 68.92% remaining). NOTE: This file should not be manually edited. Please edit `tests/node_compat/config.json` and run `deno task setup` in `tests/node_compat/runner` dir instead. @@ -223,18 +223,12 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-child-process-constructor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-constructor.js) - [parallel/test-child-process-cwd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-cwd.js) - [parallel/test-child-process-destroy.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-destroy.js) -- [parallel/test-child-process-detached.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-detached.js) - [parallel/test-child-process-disconnect.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-disconnect.js) - [parallel/test-child-process-env.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-env.js) - [parallel/test-child-process-exec-any-shells-windows.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-exec-any-shells-windows.js) -- [parallel/test-child-process-exec-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-exec-encoding.js) -- [parallel/test-child-process-exec-std-encoding.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-exec-std-encoding.js) - [parallel/test-child-process-exec-timeout-expire.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-exec-timeout-expire.js) - [parallel/test-child-process-exec-timeout-kill.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-exec-timeout-kill.js) -- [parallel/test-child-process-exec-timeout-not-expired.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-exec-timeout-not-expired.js) - [parallel/test-child-process-execFile-promisified-abortController.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-execFile-promisified-abortController.js) -- [parallel/test-child-process-execfile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-execfile.js) -- [parallel/test-child-process-exit-code.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-exit-code.js) - [parallel/test-child-process-fork-abort-signal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-abort-signal.js) - [parallel/test-child-process-fork-and-spawn.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-and-spawn.js) - [parallel/test-child-process-fork-args.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-args.js) @@ -249,15 +243,12 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-child-process-fork-net-socket.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-net-socket.js) - [parallel/test-child-process-fork-net.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-net.js) - [parallel/test-child-process-fork-no-shell.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-no-shell.js) -- [parallel/test-child-process-fork-ref.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-ref.js) -- [parallel/test-child-process-fork-ref2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-ref2.js) - [parallel/test-child-process-fork-stdio-string-variant.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-stdio-string-variant.js) - [parallel/test-child-process-fork-stdio.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-stdio.js) - [parallel/test-child-process-fork-timeout-kill-signal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork-timeout-kill-signal.js) - [parallel/test-child-process-fork.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-fork.js) - [parallel/test-child-process-http-socket-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-http-socket-leak.js) - [parallel/test-child-process-internal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-internal.js) -- [parallel/test-child-process-ipc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-ipc.js) - [parallel/test-child-process-no-deprecation.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-no-deprecation.js) - [parallel/test-child-process-pipe-dataflow.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-pipe-dataflow.js) - [parallel/test-child-process-promisified.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-promisified.js) @@ -276,19 +267,15 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-child-process-spawn-shell.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawn-shell.js) - [parallel/test-child-process-spawn-timeout-kill-signal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawn-timeout-kill-signal.js) - [parallel/test-child-process-spawn-typeerror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawn-typeerror.js) -- [parallel/test-child-process-spawnsync-env.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawnsync-env.js) - [parallel/test-child-process-spawnsync-input.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawnsync-input.js) - [parallel/test-child-process-spawnsync-kill-signal.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawnsync-kill-signal.js) - [parallel/test-child-process-spawnsync-shell.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawnsync-shell.js) - [parallel/test-child-process-spawnsync-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-spawnsync-timeout.js) - [parallel/test-child-process-stdin.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdin.js) - [parallel/test-child-process-stdio-big-write-end.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio-big-write-end.js) -- [parallel/test-child-process-stdio-inherit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio-inherit.js) - [parallel/test-child-process-stdio-merge-stdouts-into-cat.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio-merge-stdouts-into-cat.js) - [parallel/test-child-process-stdio-reuse-readable-stdio.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio-reuse-readable-stdio.js) - [parallel/test-child-process-stdio.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdio.js) -- [parallel/test-child-process-stdout-flush-exit.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdout-flush-exit.js) -- [parallel/test-child-process-stdout-flush.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdout-flush.js) - [parallel/test-child-process-stdout-ipc.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-stdout-ipc.js) - [parallel/test-child-process-uid-gid.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-uid-gid.js) - [parallel/test-child-process-validate-stdio.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-child-process-validate-stdio.js) @@ -394,7 +381,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-common.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-common.js) - [parallel/test-console-clear.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-clear.js) - [parallel/test-console-count.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-count.js) -- [parallel/test-console-instance.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-instance.js) - [parallel/test-console-issue-43095.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-issue-43095.js) - [parallel/test-console-methods.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-methods.js) - [parallel/test-console-stdio-setters.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-console-stdio-setters.js) @@ -505,21 +491,17 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-dgram-cluster-close-in-listening.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-cluster-close-in-listening.js) - [parallel/test-dgram-create-socket-handle-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-create-socket-handle-fd.js) - [parallel/test-dgram-create-socket-handle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-create-socket-handle.js) -- [parallel/test-dgram-custom-lookup.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-custom-lookup.js) - [parallel/test-dgram-deprecation-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-deprecation-error.js) - [parallel/test-dgram-exclusive-implicit-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-exclusive-implicit-bind.js) -- [parallel/test-dgram-ipv6only.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-ipv6only.js) - [parallel/test-dgram-membership.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-membership.js) - [parallel/test-dgram-multicast-loopback.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-multicast-loopback.js) - [parallel/test-dgram-multicast-set-interface.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-multicast-set-interface.js) - [parallel/test-dgram-multicast-setTTL.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-multicast-setTTL.js) - [parallel/test-dgram-send-address-types.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-address-types.js) -- [parallel/test-dgram-send-cb-quelches-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-cb-quelches-error.js) - [parallel/test-dgram-send-queue-info.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-send-queue-info.js) - [parallel/test-dgram-sendto.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-sendto.js) - [parallel/test-dgram-setBroadcast.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-setBroadcast.js) - [parallel/test-dgram-setTTL.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-setTTL.js) -- [parallel/test-dgram-socket-buffer-size.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-socket-buffer-size.js) - [parallel/test-dgram-udp6-link-local-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-udp6-link-local-address.js) - [parallel/test-dgram-unref-in-cluster.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-unref-in-cluster.js) - [parallel/test-diagnostics-channel-http-server-start.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-diagnostics-channel-http-server-start.js) @@ -544,11 +526,9 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-dns-perf_hooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-perf_hooks.js) - [parallel/test-dns-resolve-promises.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-resolve-promises.js) - [parallel/test-dns-resolveany-bad-ancount.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-resolveany-bad-ancount.js) -- [parallel/test-dns-resolveany.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-resolveany.js) - [parallel/test-dns-set-default-order.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-set-default-order.js) - [parallel/test-dns-setlocaladdress.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-setlocaladdress.js) - [parallel/test-dns-setserver-when-querying.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns-setserver-when-querying.js) -- [parallel/test-dns.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dns.js) - [parallel/test-domain-abort-on-uncaught.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-abort-on-uncaught.js) - [parallel/test-domain-add-remove.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-add-remove.js) - [parallel/test-domain-async-id-map-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-domain-async-id-map-leak.js) @@ -1462,8 +1442,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-net-child-process-connect-reset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-child-process-connect-reset.js) - [parallel/test-net-client-bind-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-client-bind-twice.js) - [parallel/test-net-connect-abort-controller.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-abort-controller.js) -- [parallel/test-net-connect-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-buffer.js) -- [parallel/test-net-connect-buffer2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-buffer2.js) - [parallel/test-net-connect-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-keepalive.js) - [parallel/test-net-connect-memleak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-memleak.js) - [parallel/test-net-connect-nodelay.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-connect-nodelay.js) @@ -1484,7 +1462,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-net-onread-static-buffer.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-onread-static-buffer.js) - [parallel/test-net-perf_hooks.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-perf_hooks.js) - [parallel/test-net-pingpong.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-pingpong.js) -- [parallel/test-net-server-call-listen-multiple-times.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-call-listen-multiple-times.js) - [parallel/test-net-server-drop-connections.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-drop-connections.js) - [parallel/test-net-server-keepalive.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-keepalive.js) - [parallel/test-net-server-listen-handle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-listen-handle.js) @@ -1493,14 +1470,12 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-net-server-nodelay.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-nodelay.js) - [parallel/test-net-server-reset.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-reset.js) - [parallel/test-net-server-simultaneous-accepts-produce-warning-once.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-simultaneous-accepts-produce-warning-once.js) -- [parallel/test-net-server-try-ports.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-server-try-ports.js) - [parallel/test-net-socket-byteswritten.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-byteswritten.js) - [parallel/test-net-socket-connect-invalid-autoselectfamilyattempttimeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-connect-invalid-autoselectfamilyattempttimeout.js) - [parallel/test-net-socket-constructor.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-constructor.js) - [parallel/test-net-socket-local-address.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-local-address.js) - [parallel/test-net-socket-reset-send.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-reset-send.js) - [parallel/test-net-socket-reset-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-reset-twice.js) -- [parallel/test-net-socket-timeout.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-socket-timeout.js) - [parallel/test-net-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-stream.js) - [parallel/test-net-throttle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-throttle.js) - [parallel/test-net-write-after-close.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-net-write-after-close.js) @@ -1662,7 +1637,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-readline-input-onerror.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-input-onerror.js) - [parallel/test-readline-interface-no-trailing-newline.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-interface-no-trailing-newline.js) - [parallel/test-readline-interface-recursive-writes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-interface-recursive-writes.js) -- [parallel/test-readline-interface.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-interface.js) - [parallel/test-readline-promises-interface.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-promises-interface.js) - [parallel/test-readline-promises-tab-complete.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-promises-tab-complete.js) - [parallel/test-readline-tab-complete.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-readline-tab-complete.js) @@ -2103,7 +2077,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-tracing-no-crash.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tracing-no-crash.js) - [parallel/test-tty-backwards-api.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tty-backwards-api.js) - [parallel/test-tty-stdin-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-tty-stdin-pipe.js) -- [parallel/test-ttywrap-invalid-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-ttywrap-invalid-fd.js) - [parallel/test-ttywrap-stack.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-ttywrap-stack.js) - [parallel/test-unhandled-exception-rethrow-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-unhandled-exception-rethrow-error.js) - [parallel/test-unhandled-exception-with-worker-inuse.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-unhandled-exception-with-worker-inuse.js) @@ -2126,7 +2099,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-v8-flag-type-check.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-flag-type-check.js) - [parallel/test-v8-flags.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-flags.js) - [parallel/test-v8-getheapsnapshot-twice.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-getheapsnapshot-twice.js) -- [parallel/test-v8-serdes.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-serdes.js) - [parallel/test-v8-serialize-leak.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-serialize-leak.js) - [parallel/test-v8-startup-snapshot-api.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-startup-snapshot-api.js) - [parallel/test-v8-stats.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-v8-stats.js) diff --git a/tests/node_compat/runner/challenge_new_test.ts b/tests/node_compat/runner/challenge_new_test.ts new file mode 100644 index 0000000000..313bf60490 --- /dev/null +++ b/tests/node_compat/runner/challenge_new_test.ts @@ -0,0 +1,72 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// deno-lint-ignore-file no-console + +import { deadline } from "@std/async/deadline"; +import { ensureDir } from "@std/fs/ensure-dir"; +import { copy } from "@std/fs/copy"; +import { withoutAll } from "@std/collections/without-all"; +import { + getDenoTests, + getNodeTests, + NODE_COMPAT_TEST_DEST_URL, + runNodeCompatTestCase, + VENDORED_NODE_TEST, +} from "../common.ts"; +import { fromFileUrl } from "@std/path/from-file-url"; + +/** The timeout ms for single test execution. If a single test didn't finish in this timeout milliseconds, the test is considered as failure */ +const TIMEOUT = 2000; + +async function main() { + const remainingTests = withoutAll(await getNodeTests(), await getDenoTests()); + + console.log(`Remaining tests: ${remainingTests.length}`); + const success = [] as string[]; + let i = 0; + + Deno.addSignalListener("SIGINT", () => { + console.log(`Success: ${success.length}`); + for (const testPath of success) { + console.log(testPath); + } + Deno.exit(1); + }); + + for (const testPath of remainingTests) { + i++; + const source = new URL(testPath, VENDORED_NODE_TEST); + const dest = new URL(testPath, NODE_COMPAT_TEST_DEST_URL); + + await ensureDir(new URL(".", dest)); + await copy(source, dest); + const num = String(i).padStart(4, " "); + try { + const cp = await runNodeCompatTestCase( + fromFileUrl(dest), + AbortSignal.timeout(TIMEOUT), + ); + const result = await deadline(cp.output(), TIMEOUT + 1000); + if (result.code === 0) { + console.log(`${num} %cPASS`, "color: green", testPath); + success.push(testPath); + } else { + console.log(`${num} %cFAIL`, "color: red", testPath); + } + } catch (e) { + if (e instanceof DOMException && e.name === "TimeoutError") { + console.log(`${num} %cFAIL`, "color: red", testPath); + } else { + console.log(`Unexpected Error`, e); + } + } finally { + await Deno.remove(dest); + } + } + console.log(`Success: ${success.length}`); + for (const testPath of success) { + console.log(testPath); + } + Deno.exit(0); +} + +await main(); diff --git a/tests/node_compat/runner/setup.ts b/tests/node_compat/runner/setup.ts index eeae3ae92d..b655633ead 100755 --- a/tests/node_compat/runner/setup.ts +++ b/tests/node_compat/runner/setup.ts @@ -10,63 +10,20 @@ import { SEPARATOR } from "@std/path/constants"; import { ensureFile } from "@std/fs/ensure-file"; import { writeAll } from "@std/io/write-all"; import { withoutAll } from "@std/collections/without-all"; -import { relative } from "@std/path/posix/relative"; import { version } from "./suite/node_version.ts"; - -import { config, ignoreList } from "../common.ts"; +import { + config, + getDenoTests, + getNodeTests, + ignoreList, + NODE_COMPAT_TEST_DEST_URL, + VENDORED_NODE_TEST, +} from "../common.ts"; const encoder = new TextEncoder(); const NODE_VERSION = version; -export const NODE_IGNORED_TEST_DIRS = [ - "addons", - "async-hooks", - "cctest", - "common", - "doctool", - "embedding", - "fixtures", - "fuzzers", - "js-native-api", - "node-api", - "overlapped-checker", - "report", - "testpy", - "tick-processor", - "tools", - "v8-updates", - "wasi", - "wpt", -]; - -export const VENDORED_NODE_TEST = new URL("./suite/test/", import.meta.url); -export const NODE_COMPAT_TEST_DEST_URL = new URL( - "../test/", - import.meta.url, -); - -export async function getNodeTests(): Promise { - const paths: string[] = []; - const rootPath = VENDORED_NODE_TEST.href.slice(7); - for await ( - const item of walk(VENDORED_NODE_TEST, { exts: [".js"] }) - ) { - const path = relative(rootPath, item.path); - if (NODE_IGNORED_TEST_DIRS.every((dir) => !path.startsWith(dir))) { - paths.push(path); - } - } - - return paths.sort(); -} - -export function getDenoTests() { - return Object.entries(config.tests) - .filter(([testDir]) => !NODE_IGNORED_TEST_DIRS.includes(testDir)) - .flatMap(([testDir, tests]) => tests.map((test) => testDir + "/" + test)); -} - async function updateToDo() { using file = await Deno.open(new URL("./TODO.md", import.meta.url), { write: true, @@ -75,7 +32,7 @@ async function updateToDo() { }); const nodeTests = await getNodeTests(); - const portedTests = getDenoTests(); + const portedTests = await getDenoTests(); const remainingTests = withoutAll(nodeTests, portedTests); const numPorted = portedTests.length; const numMissing = remainingTests.length; @@ -167,7 +124,9 @@ await copyTests(); await updateToDo(); if (Deno.args[0] === "--check") { - const cmd = new Deno.Command("git", { args: ["status", "-s"] }); + const cmd = new Deno.Command("git", { + args: ["status", "-s", "tests/node_compat/test"], + }); const { stdout } = await cmd.output(); if (stdout.length > 0) { diff --git a/tests/node_compat/test.ts b/tests/node_compat/test.ts index 6cb41d2e45..52d2b17169 100644 --- a/tests/node_compat/test.ts +++ b/tests/node_compat/test.ts @@ -24,6 +24,7 @@ import { config, getPathsFromTestSuites, partitionParallelTestPaths, + runNodeCompatTestCase, } from "./common.ts"; // If the test case is invoked like @@ -40,7 +41,6 @@ const testPaths = partitionParallelTestPaths( testPaths.sequential = distinct(testPaths.sequential); testPaths.parallel = distinct(testPaths.parallel); -const cwd = new URL(".", import.meta.url); const windowsIgnorePaths = new Set( getPathsFromTestSuites(config.windowsIgnore), ); @@ -49,13 +49,6 @@ const darwinIgnorePaths = new Set( ); const decoder = new TextDecoder(); -let testSerialId = 0; - -function parseFlags(source: string): string[] { - const line = /^\/\/ Flags: (.+)$/um.exec(source); - if (line == null) return []; - return line[1].split(" "); -} async function runTest(t: Deno.TestContext, path: string): Promise { // If filter patterns are given and any pattern doesn't match @@ -77,60 +70,7 @@ async function runTest(t: Deno.TestContext, path: string): Promise { sanitizeExit: false, fn: async () => { const testCase = join(toolsPath, "test", path); - - const v8Flags = ["--stack-size=4000"]; - const testSource = await Deno.readTextFile(testCase); - const envVars: Record = {}; - const knownGlobals: string[] = []; - parseFlags(testSource).forEach((flag) => { - switch (flag) { - case "--expose_externalize_string": - v8Flags.push("--expose-externalize-string"); - knownGlobals.push("createExternalizableString"); - break; - case "--expose-gc": - v8Flags.push("--expose-gc"); - knownGlobals.push("gc"); - break; - default: - break; - } - }); - if (knownGlobals.length > 0) { - envVars["NODE_TEST_KNOWN_GLOBALS"] = knownGlobals.join(","); - } - // TODO(nathanwhit): once we match node's behavior on executing - // `node:test` tests when we run a file, we can remove this - const usesNodeTest = testSource.includes("node:test"); - const args = [ - usesNodeTest ? "test" : "run", - "-A", - "--quiet", - //"--unsafely-ignore-certificate-errors", - "--unstable-unsafe-proto", - "--unstable-bare-node-builtins", - "--unstable-fs", - "--v8-flags=" + v8Flags.join(), - ]; - if (usesNodeTest) { - // deno test typechecks by default + we want to pass script args - args.push("--no-check", "runner.ts", "--", testCase); - } else { - args.push("runner.ts", testCase); - } - - // Pipe stdout in order to output each test result as Deno.test output - // That way the tests will respect the `--quiet` option when provided - const command = new Deno.Command(Deno.execPath(), { - args, - env: { - TEST_SERIAL_ID: String(testSerialId++), - ...envVars, - }, - cwd, - stdout: "piped", - stderr: "piped", - }).spawn(); + const command = await runNodeCompatTestCase(testCase); const warner = setTimeout(() => { console.error(`Test is running slow: ${testCase}`); }, 2 * 60_000); From 07737b03bc50e4b77c9a287d6caad6eaa40759d8 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Fri, 6 Dec 2024 20:18:08 +0900 Subject: [PATCH 225/227] fix(ext/node): accept file descriptor in fs.readFile(Sync) (#27252) closes #27123 --- ext/node/polyfills/_fs/_fs_readFile.ts | 26 +++-- tests/node_compat/config.jsonc | 1 + tests/node_compat/runner/TODO.md | 3 +- .../test/parallel/test-fs-readfile-fd.js | 101 ++++++++++++++++++ 4 files changed, 120 insertions(+), 11 deletions(-) create mode 100644 tests/node_compat/test/parallel/test-fs-readfile-fd.js diff --git a/ext/node/polyfills/_fs/_fs_readFile.ts b/ext/node/polyfills/_fs/_fs_readFile.ts index 029e57c502..b1bc53675d 100644 --- a/ext/node/polyfills/_fs/_fs_readFile.ts +++ b/ext/node/polyfills/_fs/_fs_readFile.ts @@ -10,7 +10,7 @@ import { TextOptionsArgument, } from "ext:deno_node/_fs/_fs_common.ts"; import { Buffer } from "node:buffer"; -import { readAll } from "ext:deno_io/12_io.js"; +import { readAll, readAllSync } from "ext:deno_io/12_io.js"; import { FileHandle } from "ext:deno_node/internal/fs/handle.ts"; import { pathFromURL } from "ext:deno_web/00_infra.js"; import { @@ -39,7 +39,7 @@ type TextCallback = (err: Error | null, data?: string) => void; type BinaryCallback = (err: Error | null, data?: Buffer) => void; type GenericCallback = (err: Error | null, data?: string | Buffer) => void; type Callback = TextCallback | BinaryCallback | GenericCallback; -type Path = string | URL | FileHandle; +type Path = string | URL | FileHandle | number; export function readFile( path: Path, @@ -76,6 +76,9 @@ export function readFile( if (path instanceof FileHandle) { const fsFile = new FsFile(path.fd, Symbol.for("Deno.internal.FsFile")); p = readAll(fsFile); + } else if (typeof path === "number") { + const fsFile = new FsFile(path, Symbol.for("Deno.internal.FsFile")); + p = readAll(fsFile); } else { p = Deno.readFile(path); } @@ -106,23 +109,28 @@ export function readFilePromise( } export function readFileSync( - path: string | URL, + path: string | URL | number, opt: TextOptionsArgument, ): string; export function readFileSync( - path: string | URL, + path: string | URL | number, opt?: BinaryOptionsArgument, ): Buffer; export function readFileSync( - path: string | URL, + path: string | URL | number, opt?: FileOptionsArgument, ): string | Buffer { path = path instanceof URL ? pathFromURL(path) : path; let data; - try { - data = Deno.readFileSync(path); - } catch (err) { - throw denoErrorToNodeError(err, { path, syscall: "open" }); + if (typeof path === "number") { + const fsFile = new FsFile(path, Symbol.for("Deno.internal.FsFile")); + data = readAllSync(fsFile); + } else { + try { + data = Deno.readFileSync(path); + } catch (err) { + throw denoErrorToNodeError(err, { path, syscall: "open" }); + } } const encoding = getEncoding(opt); if (encoding && encoding !== "binary") { diff --git a/tests/node_compat/config.jsonc b/tests/node_compat/config.jsonc index 04cb4e6e2d..e7d4e9b944 100644 --- a/tests/node_compat/config.jsonc +++ b/tests/node_compat/config.jsonc @@ -503,6 +503,7 @@ "test-fs-readdir-stack-overflow.js", "test-fs-readdir.js", "test-fs-readfile-empty.js", + "test-fs-readfile-fd.js", "test-fs-readfile-unlink.js", "test-fs-readfile-zero-byte-liar.js", "test-fs-readfilesync-enoent.js", diff --git a/tests/node_compat/runner/TODO.md b/tests/node_compat/runner/TODO.md index d33231fec7..994ae84b89 100644 --- a/tests/node_compat/runner/TODO.md +++ b/tests/node_compat/runner/TODO.md @@ -1,7 +1,7 @@ # Remaining Node Tests -1163 tests out of 3681 have been ported from Node 20.11.1 (31.59% ported, 68.92% remaining). +1164 tests out of 3681 have been ported from Node 20.11.1 (31.62% ported, 68.89% remaining). NOTE: This file should not be manually edited. Please edit `tests/node_compat/config.json` and run `deno task setup` in `tests/node_compat/runner` dir instead. @@ -691,7 +691,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-fs-readdir-types.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readdir-types.js) - [parallel/test-fs-readdir-ucs2.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readdir-ucs2.js) - [parallel/test-fs-readfile-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-error.js) -- [parallel/test-fs-readfile-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-fd.js) - [parallel/test-fs-readfile-flags.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-flags.js) - [parallel/test-fs-readfile-pipe-large.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-pipe-large.js) - [parallel/test-fs-readfile-pipe.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-readfile-pipe.js) diff --git a/tests/node_compat/test/parallel/test-fs-readfile-fd.js b/tests/node_compat/test/parallel/test-fs-readfile-fd.js new file mode 100644 index 0000000000..7edfd1d6a9 --- /dev/null +++ b/tests/node_compat/test/parallel/test-fs-readfile-fd.js @@ -0,0 +1,101 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +// Copyright Joyent and Node contributors. All rights reserved. MIT license. +// Taken from Node 20.11.1 +// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. + +'use strict'; +const common = require('../common'); + +// Test fs.readFile using a file descriptor. + +const fixtures = require('../common/fixtures'); +const assert = require('assert'); +const fs = require('fs'); +const fn = fixtures.path('empty.txt'); +const tmpdir = require('../common/tmpdir'); +tmpdir.refresh(); + +tempFd(function(fd, close) { + fs.readFile(fd, function(err, data) { + assert.ok(data); + close(); + }); +}); + +tempFd(function(fd, close) { + fs.readFile(fd, 'utf8', function(err, data) { + assert.strictEqual(data, ''); + close(); + }); +}); + +tempFdSync(function(fd) { + assert.ok(fs.readFileSync(fd)); +}); + +tempFdSync(function(fd) { + assert.strictEqual(fs.readFileSync(fd, 'utf8'), ''); +}); + +function tempFd(callback) { + fs.open(fn, 'r', function(err, fd) { + assert.ifError(err); + callback(fd, function() { + fs.close(fd, function(err) { + assert.ifError(err); + }); + }); + }); +} + +function tempFdSync(callback) { + const fd = fs.openSync(fn, 'r'); + callback(fd); + fs.closeSync(fd); +} + +{ + // This test makes sure that `readFile()` always reads from the current + // position of the file, instead of reading from the beginning of the file, + // when used with file descriptors. + + const filename = tmpdir.resolve('test.txt'); + fs.writeFileSync(filename, 'Hello World'); + + { + // Tests the fs.readFileSync(). + const fd = fs.openSync(filename, 'r'); + + // Read only five bytes, so that the position moves to five. + const buf = Buffer.alloc(5); + assert.strictEqual(fs.readSync(fd, buf, 0, 5), 5); + assert.strictEqual(buf.toString(), 'Hello'); + + // readFileSync() should read from position five, instead of zero. + assert.strictEqual(fs.readFileSync(fd).toString(), ' World'); + + fs.closeSync(fd); + } + + { + // Tests the fs.readFile(). + fs.open(filename, 'r', common.mustSucceed((fd) => { + const buf = Buffer.alloc(5); + + // Read only five bytes, so that the position moves to five. + fs.read(fd, buf, 0, 5, null, common.mustSucceed((bytes) => { + assert.strictEqual(bytes, 5); + assert.strictEqual(buf.toString(), 'Hello'); + + fs.readFile(fd, common.mustSucceed((data) => { + // readFile() should read from position five, instead of zero. + assert.strictEqual(data.toString(), ' World'); + + fs.closeSync(fd); + })); + })); + })); + } +} From 796749c80718c51c5b2ca269c9b540b7b86cb6c4 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Sat, 7 Dec 2024 00:30:04 +0900 Subject: [PATCH 226/227] test(ext/node): remove flaky node:dgram compat test case (#27249) --- tests/node_compat/config.jsonc | 1 - tests/node_compat/runner/TODO.md | 3 +- .../test-dgram-connect-send-empty-packet.js | 35 ------------------- 3 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 tests/node_compat/test/parallel/test-dgram-connect-send-empty-packet.js diff --git a/tests/node_compat/config.jsonc b/tests/node_compat/config.jsonc index e7d4e9b944..105341109c 100644 --- a/tests/node_compat/config.jsonc +++ b/tests/node_compat/config.jsonc @@ -348,7 +348,6 @@ "test-dgram-connect-send-default-host.js", "test-dgram-connect-send-empty-array.js", "test-dgram-connect-send-empty-buffer.js", - "test-dgram-connect-send-empty-packet.js", "test-dgram-connect-send-multi-buffer-copy.js", "test-dgram-connect-send-multi-string-array.js", "test-dgram-connect.js", diff --git a/tests/node_compat/runner/TODO.md b/tests/node_compat/runner/TODO.md index 994ae84b89..09d68aded7 100644 --- a/tests/node_compat/runner/TODO.md +++ b/tests/node_compat/runner/TODO.md @@ -1,7 +1,7 @@ # Remaining Node Tests -1164 tests out of 3681 have been ported from Node 20.11.1 (31.62% ported, 68.89% remaining). +1163 tests out of 3681 have been ported from Node 20.11.1 (31.59% ported, 68.92% remaining). NOTE: This file should not be manually edited. Please edit `tests/node_compat/config.json` and run `deno task setup` in `tests/node_compat/runner` dir instead. @@ -489,6 +489,7 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-dgram-cluster-bind-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-cluster-bind-error.js) - [parallel/test-dgram-cluster-close-during-bind.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-cluster-close-during-bind.js) - [parallel/test-dgram-cluster-close-in-listening.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-cluster-close-in-listening.js) +- [parallel/test-dgram-connect-send-empty-packet.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-connect-send-empty-packet.js) - [parallel/test-dgram-create-socket-handle-fd.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-create-socket-handle-fd.js) - [parallel/test-dgram-create-socket-handle.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-create-socket-handle.js) - [parallel/test-dgram-deprecation-error.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-dgram-deprecation-error.js) diff --git a/tests/node_compat/test/parallel/test-dgram-connect-send-empty-packet.js b/tests/node_compat/test/parallel/test-dgram-connect-send-empty-packet.js deleted file mode 100644 index 8c4d52af82..0000000000 --- a/tests/node_compat/test/parallel/test-dgram-connect-send-empty-packet.js +++ /dev/null @@ -1,35 +0,0 @@ -// deno-fmt-ignore-file -// deno-lint-ignore-file - -// Copyright Joyent and Node contributors. All rights reserved. MIT license. -// Taken from Node 20.11.1 -// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually. - -'use strict'; -const common = require('../common'); - -const assert = require('assert'); -const dgram = require('dgram'); - -const client = dgram.createSocket('udp4'); - -client.bind(0, common.mustCall(function() { - client.connect(client.address().port, common.mustCall(() => { - client.on('message', common.mustCall(callback)); - const buf = Buffer.alloc(1); - - const interval = setInterval(function() { - client.send(buf, 0, 0, common.mustCall(callback)); - }, 10); - - function callback(firstArg) { - // If client.send() callback, firstArg should be null. - // If client.on('message') listener, firstArg should be a 0-length buffer. - if (firstArg instanceof Buffer) { - assert.strictEqual(firstArg.length, 0); - clearInterval(interval); - client.close(); - } - } - })); -})); From 9fe52b1e8da261471a453c50a249e4e5c6ad5201 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 6 Dec 2024 12:39:31 -0500 Subject: [PATCH 227/227] fix: do not panic when fetching invalid file url on Windows (#27259) I tried adding a test, but it's not possible due to a debug assertion in the url crate (https://github.com/servo/rust-url/issues/505) Closes https://github.com/denoland/deno/issues/27258 --- Cargo.lock | 1 + ext/fetch/Cargo.toml | 1 + ext/fetch/lib.rs | 6 +++++- runtime/errors.rs | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 20874265bf..9c42621100 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1623,6 +1623,7 @@ dependencies = [ "bytes", "data-url", "deno_core", + "deno_path_util", "deno_permissions", "deno_tls", "dyn-clone", diff --git a/ext/fetch/Cargo.toml b/ext/fetch/Cargo.toml index 2ad19bffde..959fac574a 100644 --- a/ext/fetch/Cargo.toml +++ b/ext/fetch/Cargo.toml @@ -18,6 +18,7 @@ base64.workspace = true bytes.workspace = true data-url.workspace = true deno_core.workspace = true +deno_path_util.workspace = true deno_permissions.workspace = true deno_tls.workspace = true dyn-clone = "1" diff --git a/ext/fetch/lib.rs b/ext/fetch/lib.rs index 7a525053b3..a3f5d03e64 100644 --- a/ext/fetch/lib.rs +++ b/ext/fetch/lib.rs @@ -41,6 +41,8 @@ use deno_core::OpState; use deno_core::RcRef; use deno_core::Resource; use deno_core::ResourceId; +use deno_path_util::url_from_file_path; +use deno_path_util::PathToUrlError; use deno_permissions::PermissionCheckError; use deno_tls::rustls::RootCertStore; use deno_tls::Proxy; @@ -172,6 +174,8 @@ pub enum FetchError { NetworkError, #[error("Fetching files only supports the GET method: received {0}")] FsNotGet(Method), + #[error(transparent)] + PathToUrl(#[from] PathToUrlError), #[error("Invalid URL {0}")] InvalidUrl(Url), #[error(transparent)] @@ -436,7 +440,7 @@ where let permissions = state.borrow_mut::(); let path = permissions.check_read(&path, "fetch()")?; let url = match path { - Cow::Owned(path) => Url::from_file_path(path).unwrap(), + Cow::Owned(path) => url_from_file_path(&path)?, Cow::Borrowed(_) => url, }; diff --git a/runtime/errors.rs b/runtime/errors.rs index 4268fbd502..22ba640bcf 100644 --- a/runtime/errors.rs +++ b/runtime/errors.rs @@ -696,6 +696,7 @@ fn get_fetch_error(error: &FetchError) -> &'static str { FetchError::Permission(e) => get_permission_check_error_class(e), FetchError::NetworkError => "TypeError", FetchError::FsNotGet(_) => "TypeError", + FetchError::PathToUrl(_) => "TypeError", FetchError::InvalidUrl(_) => "TypeError", FetchError::InvalidHeaderName(_) => "TypeError", FetchError::InvalidHeaderValue(_) => "TypeError",