From d22195e7416e7923e2868e3f250abb457f115fc6 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Mon, 14 Oct 2024 12:41:34 +0530 Subject: fix(ext/napi): pass user context to napi_threadsafe_fn finalizers (#26229) Fixes https://github.com/denoland/deno/issues/26228 --- tests/napi/src/tsfn.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/napi/src/tsfn.rs b/tests/napi/src/tsfn.rs index dabc96f83..a3a231cec 100644 --- a/tests/napi/src/tsfn.rs +++ b/tests/napi/src/tsfn.rs @@ -46,6 +46,7 @@ fn create_custom_gc(env: sys::napi_env) { "Create async resource string in napi_register_module_v1 napi_register_module_v1" ); let mut custom_gc_tsfn = ptr::null_mut(); + let context = Box::into_raw(Box::new(0)) as *mut c_void; check_status_or_panic!( unsafe { sys::napi_create_threadsafe_function( @@ -57,7 +58,7 @@ fn create_custom_gc(env: sys::napi_env) { 1, ptr::null_mut(), Some(custom_gc_finalize), - ptr::null_mut(), + context, Some(custom_gc), &mut custom_gc_tsfn, ) @@ -80,8 +81,9 @@ unsafe extern "C" fn empty( unsafe extern "C" fn custom_gc_finalize( _env: sys::napi_env, _finalize_data: *mut c_void, - _finalize_hint: *mut c_void, + finalize_hint: *mut c_void, ) { + let _ = Box::from_raw(finalize_hint as *mut i32); } extern "C" fn custom_gc( -- cgit v1.2.3 From 68b388a93a3efe443fc5e306e883847bfb8551db Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Mon, 14 Oct 2024 14:00:02 +0530 Subject: fix(ext/node): allow writing to tty columns (#26201) Behave similar to Node.js where modifying `stdout.columns` doesn't really resize the terminal. Ref https://github.com/nodejs/node/issues/17529 Fixes https://github.com/denoland/deno/issues/26196 --- tests/unit_node/process_test.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/unit_node/process_test.ts b/tests/unit_node/process_test.ts index 0e0f169d6..9506fb609 100644 --- a/tests/unit_node/process_test.ts +++ b/tests/unit_node/process_test.ts @@ -1175,3 +1175,8 @@ Deno.test("process.cpuUsage()", () => { assert(typeof cpuUsage.user === "number"); assert(typeof cpuUsage.system === "number"); }); + +Deno.test("process.stdout.columns writable", () => { + process.stdout.columns = 80; + assertEquals(process.stdout.columns, 80); +}); -- cgit v1.2.3 From bbad7c592282dace88c77b0e089d53cb32878673 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Mon, 14 Oct 2024 14:24:26 +0530 Subject: fix(ext/node): compute pem length (upper bound) for key exports (#26231) Fixes https://github.com/denoland/deno/issues/26188 --- tests/unit_node/crypto/crypto_key_test.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests') diff --git a/tests/unit_node/crypto/crypto_key_test.ts b/tests/unit_node/crypto/crypto_key_test.ts index 7995ce5d3..3c7ad4423 100644 --- a/tests/unit_node/crypto/crypto_key_test.ts +++ b/tests/unit_node/crypto/crypto_key_test.ts @@ -656,3 +656,24 @@ z6TExWlQMjt66nV7R8cRAkzmABrG+NW3e8Zpac7Lkuv+zu0S+K7c assertEquals(publicKey.type, "public"); assertEquals(publicKey.asymmetricKeyType, "rsa"); }); + +// https://github.com/denoland/deno/issues/26188 +Deno.test("generateKeyPair large pem", function () { + const passphrase = "mypassphrase"; + const cipher = "aes-256-cbc"; + const modulusLength = 4096; + + generateKeyPairSync("rsa", { + modulusLength, + publicKeyEncoding: { + type: "spki", + format: "pem", + }, + privateKeyEncoding: { + type: "pkcs8", + format: "pem", + cipher, + passphrase, + }, + }); +}); -- cgit v1.2.3 From 3eda179220370e9c9093427fb694eed746548008 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Mon, 14 Oct 2024 13:29:50 +0100 Subject: feat(cli): improve deno info output for npm packages (#25906) --- .../cjs_with_deps/main_info_json.out | 52 +++++++++---- .../cjs_with_deps/main_info_json.out | 52 +++++++++---- .../npm/info_cli_chalk_json/info/chalk_json.out | 18 +++-- .../main_info_json.out | 30 ++++++-- tests/specs/npm/npmrc/__test__.jsonc | 4 + tests/specs/npm/npmrc/info.out | 87 ++++++++++++++++++++++ 6 files changed, 202 insertions(+), 41 deletions(-) create mode 100644 tests/specs/npm/npmrc/info.out (limited to 'tests') diff --git a/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info_json.out b/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info_json.out index 137b9f8ce..2f7dde2d9 100644 --- a/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info_json.out +++ b/tests/specs/npm/info_chalk_json/cjs_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/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out index 137b9f8ce..2f7dde2d9 100644 --- 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/cjs_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/info_cli_chalk_json/info/chalk_json.out b/tests/specs/npm/info_cli_chalk_json/info/chalk_json.out index 21fc7edf1..fd2aa9ab0 100644 --- a/tests/specs/npm/info_cli_chalk_json/info/chalk_json.out +++ b/tests/specs/npm/info_cli_chalk_json/info/chalk_json.out @@ -19,7 +19,8 @@ "version": "4.3.0", "dependencies": [ "color-convert@2.0.1" - ] + ], + "registryUrl": "http://localhost:4260/" }, "chalk@4.1.2": { "name": "chalk", @@ -27,31 +28,36 @@ "dependencies": [ "ansi-styles@4.3.0", "supports-color@7.2.0" - ] + ], + "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/" }, "has-flag@4.0.0": { "name": "has-flag", "version": "4.0.0", - "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/" } } } 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/peer_deps_with_copied_folders/main_info_json.out index 46cc35c65..2ee6268f5 100644 --- 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/peer_deps_with_copied_folders/main_info_json.out @@ -1,7 +1,7 @@ { "version": 1, "roots": [ - "[WILDCARD]/peer_deps_with_copied_folders/main.ts" + "file://[WILDCARD]/main.ts" ], "modules": [ { @@ -46,6 +46,16 @@ "size": 171, "mediaType": "TypeScript", "specifier": "file://[WILDCARD]/main.ts" + }, + { + "kind": "npm", + "specifier": "npm:/@denotest/peer-dep-test-child@1.0.0", + "npmPackage": "@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0" + }, + { + "kind": "npm", + "specifier": "npm:/@denotest/peer-dep-test-child@2.0.0", + "npmPackage": "@denotest/peer-dep-test-child@2.0.0_@denotest+peer-dep-test-peer@2.0.0" } ], "redirects": { @@ -59,7 +69,8 @@ "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" - ] + ], + "registryUrl": "http://localhost:4260/" }, "@denotest/peer-dep-test-child@2.0.0_@denotest+peer-dep-test-peer@2.0.0": { "name": "@denotest/peer-dep-test-child", @@ -67,31 +78,36 @@ "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" - ] + ], + "registryUrl": "http://localhost:4260/" }, "@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" - ] + ], + "registryUrl": "http://localhost:4260/" }, "@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" - ] + ], + "registryUrl": "http://localhost:4260/" }, "@denotest/peer-dep-test-peer@1.0.0": { "name": "@denotest/peer-dep-test-peer", "version": "1.0.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" }, "@denotest/peer-dep-test-peer@2.0.0": { "name": "@denotest/peer-dep-test-peer", "version": "2.0.0", - "dependencies": [] + "dependencies": [], + "registryUrl": "http://localhost:4260/" } } } diff --git a/tests/specs/npm/npmrc/__test__.jsonc b/tests/specs/npm/npmrc/__test__.jsonc index e7588a779..88ef2d810 100644 --- a/tests/specs/npm/npmrc/__test__.jsonc +++ b/tests/specs/npm/npmrc/__test__.jsonc @@ -13,6 +13,10 @@ "run_node_modules_dir": { "args": "run --node-modules-dir=auto -A --quiet main.js", "output": "main.out" + }, + "info": { + "args": "info --node-modules-dir=auto --json main.js", + "output": "info.out" } } } diff --git a/tests/specs/npm/npmrc/info.out b/tests/specs/npm/npmrc/info.out new file mode 100644 index 000000000..8f82b10c9 --- /dev/null +++ b/tests/specs/npm/npmrc/info.out @@ -0,0 +1,87 @@ +[UNORDERED_START] +Download http://localhost:4262/@denotest2/basic +Download http://localhost:4261/@denotest/basic +Download http://localhost:4261/@denotest/basic/1.0.0.tgz +Download http://localhost:4262/@denotest2/basic/1.0.0.tgz +[UNORDERED_END] +[UNORDERED_START] +Initialize @denotest/basic@1.0.0 +Initialize @denotest2/basic@1.0.0 +[UNORDERED_END] +{ + "version": 1, + "roots": [ + "file://[WILDCARD]/main.js" + ], + "modules": [ + { + "kind": "esm", + "dependencies": [ + { + "specifier": "@denotest/basic", + "code": { + "specifier": "npm:@denotest/basic@1.0.0", + "span": { + "start": { + "line": 0, + "character": 35 + }, + "end": { + "line": 0, + "character": 52 + } + } + } + }, + { + "specifier": "@denotest2/basic", + "code": { + "specifier": "npm:@denotest2/basic@1.0.0", + "span": { + "start": { + "line": 1, + "character": 22 + }, + "end": { + "line": 1, + "character": 40 + } + } + } + } + ], + "local": "[WILDCARD]main.js", + "size": 192, + "mediaType": "JavaScript", + "specifier": "file://[WILDCARD]/main.js" + }, + { + "kind": "npm", + "specifier": "npm:/@denotest/basic@1.0.0", + "npmPackage": "@denotest/basic@1.0.0" + }, + { + "kind": "npm", + "specifier": "npm:/@denotest2/basic@1.0.0", + "npmPackage": "@denotest2/basic@1.0.0" + } + ], + "redirects": { + "npm:@denotest/basic@1.0.0": "npm:/@denotest/basic@1.0.0", + "npm:@denotest2/basic@1.0.0": "npm:/@denotest2/basic@1.0.0" + }, + "npmPackages": { + "@denotest/basic@1.0.0": { + "name": "@denotest/basic", + "version": "1.0.0", + "dependencies": [], + "registryUrl": "http://localhost:4261/" + }, + "@denotest2/basic@1.0.0": { + "name": "@denotest2/basic", + "version": "1.0.0", + "dependencies": [], + "registryUrl": "http://localhost:4262/" + } + } +} -- cgit v1.2.3 From c5449d71da2d623e866d733b6db180a6f94ff7c6 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 14 Oct 2024 15:35:52 -0400 Subject: fix(install): support installing npm package with alias (#26246) Just tried this out today and it wasn't properly implemented in https://github.com/denoland/deno/pull/24156 --- tests/specs/add/alias/__test__.jsonc | 13 +++++++++++++ tests/specs/add/alias/package.json | 4 ++++ tests/specs/add/alias/package.json.out | 5 +++++ tests/specs/add/dev/package.json.out | 4 +++- .../install/future_install_local_add_npm/package.json.out | 4 +++- tests/specs/install/install_add_dev/package.json.out | 4 +++- .../install/install_deprecated_package/package.json.out | 4 +++- tests/specs/remove/package_json/rm_add_package.json.out | 4 +++- 8 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 tests/specs/add/alias/__test__.jsonc create mode 100644 tests/specs/add/alias/package.json create mode 100644 tests/specs/add/alias/package.json.out (limited to 'tests') diff --git a/tests/specs/add/alias/__test__.jsonc b/tests/specs/add/alias/__test__.jsonc new file mode 100644 index 000000000..8a16ad3b4 --- /dev/null +++ b/tests/specs/add/alias/__test__.jsonc @@ -0,0 +1,13 @@ +{ + "tempDir": true, + "steps": [{ + "args": "install my-alias@npm:@denotest/add", + "output": "[WILDCARD]" + }, { + "args": [ + "eval", + "console.log(Deno.readTextFileSync('package.json').trim())" + ], + "output": "package.json.out" + }] +} diff --git a/tests/specs/add/alias/package.json b/tests/specs/add/alias/package.json new file mode 100644 index 000000000..9664f260a --- /dev/null +++ b/tests/specs/add/alias/package.json @@ -0,0 +1,4 @@ +{ + "dependencies": { + } +} diff --git a/tests/specs/add/alias/package.json.out b/tests/specs/add/alias/package.json.out new file mode 100644 index 000000000..b6326e8bf --- /dev/null +++ b/tests/specs/add/alias/package.json.out @@ -0,0 +1,5 @@ +{ + "dependencies": { + "my-alias": "npm:@denotest/add@^1.0.0" + } +} diff --git a/tests/specs/add/dev/package.json.out b/tests/specs/add/dev/package.json.out index d5ca56e00..866724397 100644 --- a/tests/specs/add/dev/package.json.out +++ b/tests/specs/add/dev/package.json.out @@ -1,3 +1,5 @@ { - "devDependencies": { "@denotest/esm-basic": "^1.0.0" } + "devDependencies": { + "@denotest/esm-basic": "^1.0.0" + } } diff --git a/tests/specs/install/future_install_local_add_npm/package.json.out b/tests/specs/install/future_install_local_add_npm/package.json.out index ad8518e79..613d98636 100644 --- a/tests/specs/install/future_install_local_add_npm/package.json.out +++ b/tests/specs/install/future_install_local_add_npm/package.json.out @@ -1,3 +1,5 @@ { - "dependencies": { "@denotest/esm-basic": "^1.0.0" } + "dependencies": { + "@denotest/esm-basic": "^1.0.0" + } } diff --git a/tests/specs/install/install_add_dev/package.json.out b/tests/specs/install/install_add_dev/package.json.out index d5ca56e00..866724397 100644 --- a/tests/specs/install/install_add_dev/package.json.out +++ b/tests/specs/install/install_add_dev/package.json.out @@ -1,3 +1,5 @@ { - "devDependencies": { "@denotest/esm-basic": "^1.0.0" } + "devDependencies": { + "@denotest/esm-basic": "^1.0.0" + } } diff --git a/tests/specs/install/install_deprecated_package/package.json.out b/tests/specs/install/install_deprecated_package/package.json.out index 4b4b08087..0cf36cd24 100644 --- a/tests/specs/install/install_deprecated_package/package.json.out +++ b/tests/specs/install/install_deprecated_package/package.json.out @@ -1,3 +1,5 @@ { - "dependencies": { "@denotest/deprecated-package": "^1.0.0" } + "dependencies": { + "@denotest/deprecated-package": "^1.0.0" + } } diff --git a/tests/specs/remove/package_json/rm_add_package.json.out b/tests/specs/remove/package_json/rm_add_package.json.out index d5ca56e00..866724397 100644 --- a/tests/specs/remove/package_json/rm_add_package.json.out +++ b/tests/specs/remove/package_json/rm_add_package.json.out @@ -1,3 +1,5 @@ { - "devDependencies": { "@denotest/esm-basic": "^1.0.0" } + "devDependencies": { + "@denotest/esm-basic": "^1.0.0" + } } -- cgit v1.2.3 From 8dbe77dd29a3791db58fda392dea45d8249b6bc9 Mon Sep 17 00:00:00 2001 From: Mohammad Sulaiman Date: Tue, 15 Oct 2024 01:04:18 +0300 Subject: fix(console/ext/repl): support using parseFloat() (#25900) Fixes #21428 Co-authored-by: tannal --- tests/integration/repl_tests.rs | 14 ++++++++++++++ tests/specs/repl/console_log/093_console_log_format.js | 16 ++++++++++++++++ tests/specs/repl/console_log/093_console_log_format.out | 1 + tests/specs/repl/console_log/__test__.jsonc | 4 ++++ tests/unit/console_test.ts | 8 ++++---- 5 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 tests/specs/repl/console_log/093_console_log_format.js create mode 100644 tests/specs/repl/console_log/093_console_log_format.out create mode 100644 tests/specs/repl/console_log/__test__.jsonc (limited to 'tests') diff --git a/tests/integration/repl_tests.rs b/tests/integration/repl_tests.rs index 4e00398ce..9eceb2f05 100644 --- a/tests/integration/repl_tests.rs +++ b/tests/integration/repl_tests.rs @@ -255,6 +255,20 @@ fn console_log() { console.write_line("'world'"); console.expect("\"world\""); }); + + // https://github.com/denoland/deno/issues/21428 + let (out, err) = util::run_and_collect_output_with_args( + true, + vec![ + "repl", + "--eval-file=./../specs/repl/console_log/093_console_log_format.js", + ], + None, + None, + false, + ); + assert_contains!(out, "0.5"); + assert!(err.is_empty()); } #[test] diff --git a/tests/specs/repl/console_log/093_console_log_format.js b/tests/specs/repl/console_log/093_console_log_format.js new file mode 100644 index 000000000..15022411c --- /dev/null +++ b/tests/specs/repl/console_log/093_console_log_format.js @@ -0,0 +1,16 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +class Frac { + constructor(num, den) { + this.num = num; + this.den = den; + } + [Symbol.toPrimitive]() { + return this.num / this.den; + } + display() { + const result = this.num / this.den; + process.stdout.write(`${result}`); + } +} +const f = new Frac(1, 2); +f.display(); diff --git a/tests/specs/repl/console_log/093_console_log_format.out b/tests/specs/repl/console_log/093_console_log_format.out new file mode 100644 index 000000000..ea2303bc0 --- /dev/null +++ b/tests/specs/repl/console_log/093_console_log_format.out @@ -0,0 +1 @@ +0.5 \ No newline at end of file diff --git a/tests/specs/repl/console_log/__test__.jsonc b/tests/specs/repl/console_log/__test__.jsonc new file mode 100644 index 000000000..641bc1f68 --- /dev/null +++ b/tests/specs/repl/console_log/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run -A --quiet 093_console_log_format.js", + "output": "093_console_log_format.out" +} diff --git a/tests/unit/console_test.ts b/tests/unit/console_test.ts index 878d17ae3..42cff7c70 100644 --- a/tests/unit/console_test.ts +++ b/tests/unit/console_test.ts @@ -1162,7 +1162,7 @@ Deno.test(function consoleTestWithIntegerFormatSpecifier() { assertEquals(stringify("%i"), "%i"); assertEquals(stringify("%i", 42.0), "42"); assertEquals(stringify("%i", 42), "42"); - assertEquals(stringify("%i", "42"), "NaN"); + assertEquals(stringify("%i", "42"), "42"); assertEquals(stringify("%i", 1.5), "1"); assertEquals(stringify("%i", -0.5), "0"); assertEquals(stringify("%i", ""), "NaN"); @@ -1172,7 +1172,7 @@ Deno.test(function consoleTestWithIntegerFormatSpecifier() { assertEquals(stringify("%d", 12345678901234567890123), "1"); assertEquals( stringify("%i", 12345678901234567890123n), - "12345678901234567890123n", + "1.2345678901234568e+22", ); }); @@ -1180,13 +1180,13 @@ Deno.test(function consoleTestWithFloatFormatSpecifier() { assertEquals(stringify("%f"), "%f"); assertEquals(stringify("%f", 42.0), "42"); assertEquals(stringify("%f", 42), "42"); - assertEquals(stringify("%f", "42"), "NaN"); + assertEquals(stringify("%f", "42"), "42"); assertEquals(stringify("%f", 1.5), "1.5"); assertEquals(stringify("%f", -0.5), "-0.5"); assertEquals(stringify("%f", Math.PI), "3.141592653589793"); assertEquals(stringify("%f", ""), "NaN"); assertEquals(stringify("%f", Symbol("foo")), "NaN"); - assertEquals(stringify("%f", 5n), "NaN"); + assertEquals(stringify("%f", 5n), "5"); assertEquals(stringify("%f %f", 42, 43), "42 43"); assertEquals(stringify("%f %f", 42), "42 %f"); }); -- cgit v1.2.3 From 1a0cb5b5312941521ab021cfe9eaed498f35900b Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 14 Oct 2024 20:48:39 -0400 Subject: feat(unstable): `--unstable-detect-cjs` for respecting explicit `"type": "commonjs"` (#26149) When using the `--unstable-detect-cjs` flag or adding `"unstable": ["detect-cjs"]` to a deno.json, it will make a JS file CJS if the closest package.json contains `"type": "commonjs"` and the file is not an ESM module (no TLA, no `import.meta`, no `import`/`export`). --- tests/specs/compile/detect_cjs/__test__.jsonc | 24 +++++++++++++++ tests/specs/compile/detect_cjs/add.js | 3 ++ tests/specs/compile/detect_cjs/compile.out | 3 ++ tests/specs/compile/detect_cjs/deno.json | 5 ++++ tests/specs/compile/detect_cjs/main.js | 3 ++ tests/specs/compile/detect_cjs/output.out | 1 + tests/specs/compile/detect_cjs/package.json | 3 ++ .../run/package_json_type/commonjs/__test__.jsonc | 34 ++++++++++++++++++++++ tests/specs/run/package_json_type/commonjs/add.js | 3 ++ .../run/package_json_type/commonjs/deno.jsonc | 5 ++++ .../commonjs/import_import_meta.js | 3 ++ .../run/package_json_type/commonjs/import_meta.js | 1 + .../run/package_json_type/commonjs/main_cjs.js | 2 ++ .../run/package_json_type/commonjs/main_esm.js | 3 ++ .../commonjs/main_esm_import_meta.js | 2 ++ .../commonjs/main_esm_import_meta.out | 2 ++ .../run/package_json_type/commonjs/main_mix.js | 6 ++++ .../run/package_json_type/commonjs/main_mix.out | 5 ++++ .../package_json_type/commonjs/not_import_meta.js | 8 +++++ .../run/package_json_type/commonjs/package.json | 3 ++ tests/specs/run/package_json_type/commonjs/tla.js | 2 ++ .../run/package_json_type/none/__test__.jsonc | 18 ++++++++++++ tests/specs/run/package_json_type/none/add.js | 3 ++ .../run/package_json_type/none/commonjs/add.js | 3 ++ .../package_json_type/none/commonjs/package.json | 3 ++ tests/specs/run/package_json_type/none/deno.jsonc | 5 ++++ tests/specs/run/package_json_type/none/main_cjs.js | 2 ++ .../specs/run/package_json_type/none/main_cjs.out | 4 +++ tests/specs/run/package_json_type/none/main_esm.js | 3 ++ .../specs/run/package_json_type/none/main_esm.out | 4 +++ .../specs/run/package_json_type/none/package.json | 2 ++ .../run/package_json_type/none/sub_folder_cjs.js | 3 ++ 32 files changed, 171 insertions(+) create mode 100644 tests/specs/compile/detect_cjs/__test__.jsonc create mode 100644 tests/specs/compile/detect_cjs/add.js create mode 100644 tests/specs/compile/detect_cjs/compile.out create mode 100644 tests/specs/compile/detect_cjs/deno.json create mode 100644 tests/specs/compile/detect_cjs/main.js create mode 100644 tests/specs/compile/detect_cjs/output.out create mode 100644 tests/specs/compile/detect_cjs/package.json create mode 100644 tests/specs/run/package_json_type/commonjs/__test__.jsonc create mode 100644 tests/specs/run/package_json_type/commonjs/add.js create mode 100644 tests/specs/run/package_json_type/commonjs/deno.jsonc create mode 100644 tests/specs/run/package_json_type/commonjs/import_import_meta.js create mode 100644 tests/specs/run/package_json_type/commonjs/import_meta.js create mode 100644 tests/specs/run/package_json_type/commonjs/main_cjs.js create mode 100644 tests/specs/run/package_json_type/commonjs/main_esm.js create mode 100644 tests/specs/run/package_json_type/commonjs/main_esm_import_meta.js create mode 100644 tests/specs/run/package_json_type/commonjs/main_esm_import_meta.out create mode 100644 tests/specs/run/package_json_type/commonjs/main_mix.js create mode 100644 tests/specs/run/package_json_type/commonjs/main_mix.out create mode 100644 tests/specs/run/package_json_type/commonjs/not_import_meta.js create mode 100644 tests/specs/run/package_json_type/commonjs/package.json create mode 100644 tests/specs/run/package_json_type/commonjs/tla.js create mode 100644 tests/specs/run/package_json_type/none/__test__.jsonc create mode 100644 tests/specs/run/package_json_type/none/add.js create mode 100644 tests/specs/run/package_json_type/none/commonjs/add.js create mode 100644 tests/specs/run/package_json_type/none/commonjs/package.json create mode 100644 tests/specs/run/package_json_type/none/deno.jsonc create mode 100644 tests/specs/run/package_json_type/none/main_cjs.js create mode 100644 tests/specs/run/package_json_type/none/main_cjs.out create mode 100644 tests/specs/run/package_json_type/none/main_esm.js create mode 100644 tests/specs/run/package_json_type/none/main_esm.out create mode 100644 tests/specs/run/package_json_type/none/package.json create mode 100644 tests/specs/run/package_json_type/none/sub_folder_cjs.js (limited to 'tests') diff --git a/tests/specs/compile/detect_cjs/__test__.jsonc b/tests/specs/compile/detect_cjs/__test__.jsonc new file mode 100644 index 000000000..32bebb7a5 --- /dev/null +++ b/tests/specs/compile/detect_cjs/__test__.jsonc @@ -0,0 +1,24 @@ +{ + "tempDir": true, + "steps": [{ + "if": "unix", + "args": "compile --allow-read --output main main.js", + "output": "compile.out" + }, { + "if": "unix", + "commandName": "./main", + "args": [], + "output": "output.out", + "exitCode": 1 + }, { + "if": "windows", + "args": "compile --allow-read --output main.exe main.js", + "output": "compile.out" + }, { + "if": "windows", + "commandName": "./main.exe", + "args": [], + "output": "output.out", + "exitCode": 1 + }] +} diff --git a/tests/specs/compile/detect_cjs/add.js b/tests/specs/compile/detect_cjs/add.js new file mode 100644 index 000000000..2a886fbc1 --- /dev/null +++ b/tests/specs/compile/detect_cjs/add.js @@ -0,0 +1,3 @@ +module.exports.add = function (a, b) { + return a + b; +}; diff --git a/tests/specs/compile/detect_cjs/compile.out b/tests/specs/compile/detect_cjs/compile.out new file mode 100644 index 000000000..6509b7f29 --- /dev/null +++ b/tests/specs/compile/detect_cjs/compile.out @@ -0,0 +1,3 @@ +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/deno.json b/tests/specs/compile/detect_cjs/deno.json new file mode 100644 index 000000000..35f64c86f --- /dev/null +++ b/tests/specs/compile/detect_cjs/deno.json @@ -0,0 +1,5 @@ +{ + "unstable": [ + "detect-cjs" + ] +} diff --git a/tests/specs/compile/detect_cjs/main.js b/tests/specs/compile/detect_cjs/main.js new file mode 100644 index 000000000..8c55f673b --- /dev/null +++ b/tests/specs/compile/detect_cjs/main.js @@ -0,0 +1,3 @@ +import { add } from "./add.js"; + +console.log(add(1, 2)); diff --git a/tests/specs/compile/detect_cjs/output.out b/tests/specs/compile/detect_cjs/output.out new file mode 100644 index 000000000..b53c44369 --- /dev/null +++ b/tests/specs/compile/detect_cjs/output.out @@ -0,0 +1 @@ +error: Module not found: file:///[WILDLINE]/add.js diff --git a/tests/specs/compile/detect_cjs/package.json b/tests/specs/compile/detect_cjs/package.json new file mode 100644 index 000000000..5bbefffba --- /dev/null +++ b/tests/specs/compile/detect_cjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/tests/specs/run/package_json_type/commonjs/__test__.jsonc b/tests/specs/run/package_json_type/commonjs/__test__.jsonc new file mode 100644 index 000000000..85b7219fa --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/__test__.jsonc @@ -0,0 +1,34 @@ +{ + "tests": { + "main_cjs": { + "args": "run --allow-read=. main_cjs.js", + "output": "3\n" + }, + "main_esm": { + "args": "run --allow-read=. main_esm.js", + "output": "3\n" + }, + "main_mix": { + "args": "run --allow-read=. main_mix.js", + "output": "main_mix.out", + "exitCode": 1 + }, + "import_import_meta": { + "args": "run import_import_meta.js", + "output": "[WILDLINE]/import_meta.js\n" + }, + "main_import_meta": { + "args": "run main_esm_import_meta.js", + "output": "main_esm_import_meta.out", + "exitCode": 1 + }, + "not_import_meta": { + "args": "run --allow-read=. not_import_meta.js", + "output": "3\n" + }, + "tla": { + "args": "run --allow-read=. tla.js", + "output": "loaded\n" + } + } +} diff --git a/tests/specs/run/package_json_type/commonjs/add.js b/tests/specs/run/package_json_type/commonjs/add.js new file mode 100644 index 000000000..2a886fbc1 --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/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/deno.jsonc new file mode 100644 index 000000000..35f64c86f --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/deno.jsonc @@ -0,0 +1,5 @@ +{ + "unstable": [ + "detect-cjs" + ] +} diff --git a/tests/specs/run/package_json_type/commonjs/import_import_meta.js b/tests/specs/run/package_json_type/commonjs/import_import_meta.js new file mode 100644 index 000000000..f07518985 --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/import_import_meta.js @@ -0,0 +1,3 @@ +import { value } from "./import_meta.js"; + +console.log(value); diff --git a/tests/specs/run/package_json_type/commonjs/import_meta.js b/tests/specs/run/package_json_type/commonjs/import_meta.js new file mode 100644 index 000000000..2bdbc30fe --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/import_meta.js @@ -0,0 +1 @@ +export const value = import.meta.url; diff --git a/tests/specs/run/package_json_type/commonjs/main_cjs.js b/tests/specs/run/package_json_type/commonjs/main_cjs.js new file mode 100644 index 000000000..365e8e06f --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/main_cjs.js @@ -0,0 +1,2 @@ +const { add } = require("./add"); +console.log(add(1, 2)); diff --git a/tests/specs/run/package_json_type/commonjs/main_esm.js b/tests/specs/run/package_json_type/commonjs/main_esm.js new file mode 100644 index 000000000..8c55f673b --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/main_esm.js @@ -0,0 +1,3 @@ +import { add } from "./add.js"; + +console.log(add(1, 2)); diff --git a/tests/specs/run/package_json_type/commonjs/main_esm_import_meta.js b/tests/specs/run/package_json_type/commonjs/main_esm_import_meta.js new file mode 100644 index 000000000..f1dff20b5 --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/main_esm_import_meta.js @@ -0,0 +1,2 @@ +console.log(import.meta.url); +console.log(require("./add")); diff --git a/tests/specs/run/package_json_type/commonjs/main_esm_import_meta.out b/tests/specs/run/package_json_type/commonjs/main_esm_import_meta.out new file mode 100644 index 000000000..e177defff --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/main_esm_import_meta.out @@ -0,0 +1,2 @@ +[WILDLINE]main_esm_import_meta.js +error: Uncaught (in promise) ReferenceError: require is not defined[WILDCARD] diff --git a/tests/specs/run/package_json_type/commonjs/main_mix.js b/tests/specs/run/package_json_type/commonjs/main_mix.js new file mode 100644 index 000000000..2a2c2c62a --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/main_mix.js @@ -0,0 +1,6 @@ +import { add } from "./add.js"; + +console.log(add(1, 2)); + +// will error +console.log(require("./add").add(1, 2)); diff --git a/tests/specs/run/package_json_type/commonjs/main_mix.out b/tests/specs/run/package_json_type/commonjs/main_mix.out new file mode 100644 index 000000000..d6123d48b --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/main_mix.out @@ -0,0 +1,5 @@ +3 +error: Uncaught (in promise) ReferenceError: require is not defined +console.log(require("./add").add(1, 2)); + ^ + at file:///[WILDLINE]main_mix.js:[WILDLINE] diff --git a/tests/specs/run/package_json_type/commonjs/not_import_meta.js b/tests/specs/run/package_json_type/commonjs/not_import_meta.js new file mode 100644 index 000000000..216b900df --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/not_import_meta.js @@ -0,0 +1,8 @@ +try { + console.log(test.import.meta.url); +} catch { + // ignore +} + +// should work because this is not an ESM file +console.log(require("./add").add(1, 2)); diff --git a/tests/specs/run/package_json_type/commonjs/package.json b/tests/specs/run/package_json_type/commonjs/package.json new file mode 100644 index 000000000..5bbefffba --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/tests/specs/run/package_json_type/commonjs/tla.js b/tests/specs/run/package_json_type/commonjs/tla.js new file mode 100644 index 000000000..978578de4 --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/tla.js @@ -0,0 +1,2 @@ +await new Promise((r) => r()); +console.log("loaded"); diff --git a/tests/specs/run/package_json_type/none/__test__.jsonc b/tests/specs/run/package_json_type/none/__test__.jsonc new file mode 100644 index 000000000..fa1d22ca1 --- /dev/null +++ b/tests/specs/run/package_json_type/none/__test__.jsonc @@ -0,0 +1,18 @@ +{ + "tests": { + "main_cjs": { + "args": "run --allow-read=. main_cjs.js", + "output": "main_cjs.out", + "exitCode": 1 + }, + "main_esm": { + "args": "run --allow-read=. main_esm.js", + "output": "main_esm.out", + "exitCode": 1 + }, + "sub_folder_cjs": { + "args": "run --allow-read=. sub_folder_cjs.js", + "output": "3\n" + } + } +} diff --git a/tests/specs/run/package_json_type/none/add.js b/tests/specs/run/package_json_type/none/add.js new file mode 100644 index 000000000..2a886fbc1 --- /dev/null +++ b/tests/specs/run/package_json_type/none/add.js @@ -0,0 +1,3 @@ +module.exports.add = function (a, b) { + return a + b; +}; diff --git a/tests/specs/run/package_json_type/none/commonjs/add.js b/tests/specs/run/package_json_type/none/commonjs/add.js new file mode 100644 index 000000000..2a886fbc1 --- /dev/null +++ b/tests/specs/run/package_json_type/none/commonjs/add.js @@ -0,0 +1,3 @@ +module.exports.add = function (a, b) { + return a + b; +}; diff --git a/tests/specs/run/package_json_type/none/commonjs/package.json b/tests/specs/run/package_json_type/none/commonjs/package.json new file mode 100644 index 000000000..5bbefffba --- /dev/null +++ b/tests/specs/run/package_json_type/none/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/tests/specs/run/package_json_type/none/deno.jsonc b/tests/specs/run/package_json_type/none/deno.jsonc new file mode 100644 index 000000000..35f64c86f --- /dev/null +++ b/tests/specs/run/package_json_type/none/deno.jsonc @@ -0,0 +1,5 @@ +{ + "unstable": [ + "detect-cjs" + ] +} diff --git a/tests/specs/run/package_json_type/none/main_cjs.js b/tests/specs/run/package_json_type/none/main_cjs.js new file mode 100644 index 000000000..365e8e06f --- /dev/null +++ b/tests/specs/run/package_json_type/none/main_cjs.js @@ -0,0 +1,2 @@ +const { add } = require("./add"); +console.log(add(1, 2)); diff --git a/tests/specs/run/package_json_type/none/main_cjs.out b/tests/specs/run/package_json_type/none/main_cjs.out new file mode 100644 index 000000000..fe9acf009 --- /dev/null +++ b/tests/specs/run/package_json_type/none/main_cjs.out @@ -0,0 +1,4 @@ +error: Uncaught (in promise) ReferenceError: require is not defined +const { add } = require("./add"); + ^ + at file:///[WILDLINE] diff --git a/tests/specs/run/package_json_type/none/main_esm.js b/tests/specs/run/package_json_type/none/main_esm.js new file mode 100644 index 000000000..8c55f673b --- /dev/null +++ b/tests/specs/run/package_json_type/none/main_esm.js @@ -0,0 +1,3 @@ +import { add } from "./add.js"; + +console.log(add(1, 2)); diff --git a/tests/specs/run/package_json_type/none/main_esm.out b/tests/specs/run/package_json_type/none/main_esm.out new file mode 100644 index 000000000..5f16c5f35 --- /dev/null +++ b/tests/specs/run/package_json_type/none/main_esm.out @@ -0,0 +1,4 @@ +error: Uncaught SyntaxError: The requested module './add.js' does not provide an export named 'add' +import { add } from "./add.js"; + ^ + at (file:///[WILDLINE]) diff --git a/tests/specs/run/package_json_type/none/package.json b/tests/specs/run/package_json_type/none/package.json new file mode 100644 index 000000000..2c63c0851 --- /dev/null +++ b/tests/specs/run/package_json_type/none/package.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/specs/run/package_json_type/none/sub_folder_cjs.js b/tests/specs/run/package_json_type/none/sub_folder_cjs.js new file mode 100644 index 000000000..ad04e6730 --- /dev/null +++ b/tests/specs/run/package_json_type/none/sub_folder_cjs.js @@ -0,0 +1,3 @@ +import { add } from "./commonjs/add.js"; + +console.log(add(1, 2)); -- cgit v1.2.3 From ae6a2b23bae83795bd973414216a89c839dd8fda Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 14 Oct 2024 23:57:31 -0400 Subject: fix: do not panic running remote cjs module (#26259) Instead error. --- tests/specs/run/remote_cjs_main/__test__.jsonc | 5 +++++ tests/specs/run/remote_cjs_main/output.out | 3 +++ tests/testdata/run/add.cjs | 3 +++ 3 files changed, 11 insertions(+) create mode 100644 tests/specs/run/remote_cjs_main/__test__.jsonc create mode 100644 tests/specs/run/remote_cjs_main/output.out create mode 100644 tests/testdata/run/add.cjs (limited to 'tests') diff --git a/tests/specs/run/remote_cjs_main/__test__.jsonc b/tests/specs/run/remote_cjs_main/__test__.jsonc new file mode 100644 index 000000000..f45d09406 --- /dev/null +++ b/tests/specs/run/remote_cjs_main/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run http://localhost:4545/run/add.cjs", + "output": "output.out", + "exitCode": 1 +} diff --git a/tests/specs/run/remote_cjs_main/output.out b/tests/specs/run/remote_cjs_main/output.out new file mode 100644 index 000000000..f75c33907 --- /dev/null +++ b/tests/specs/run/remote_cjs_main/output.out @@ -0,0 +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. + Specifier: http://localhost:4545/run/add.cjs diff --git a/tests/testdata/run/add.cjs b/tests/testdata/run/add.cjs new file mode 100644 index 000000000..2a886fbc1 --- /dev/null +++ b/tests/testdata/run/add.cjs @@ -0,0 +1,3 @@ +module.exports.add = function (a, b) { + return a + b; +}; -- cgit v1.2.3 From c7153838ec332d474c32b464b94f99382028bbbc Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 15 Oct 2024 14:47:12 +0530 Subject: fix(ext/node): implement TCP.setNoDelay (#26263) Fixes https://github.com/denoland/deno/issues/26177 The significant delay was caused by Nagel's algorithm + delayed ACKs in Linux kernels. Here's the [kernel patch](https://lwn.net/Articles/502585/) which added 40ms `tcp_default_delack_min` ``` $ deno run -A pg-bench.mjs # main Tue Oct 15 2024 12:27:22 GMT+0530 (India Standard Time): 42ms $ target/release/deno run -A pg-bench.mjs # this patch Tue Oct 15 2024 12:28:02 GMT+0530 (India Standard Time): 1ms ``` ```js import { Buffer } from "node:buffer"; import pg from 'pg' const { Client } = pg const client = new Client({ connectionString: 'postgresql://postgres:postgres@127.0.0.1:5432/postgres' }) await client.connect() async function fetch() { const startPerf = performance.now(); const res = await client.query(`select $1::int as int, $2 as string, $3::timestamp with time zone as timestamp, $4 as null, $5::bool as boolean, $6::bytea as bytea, $7::jsonb as json `, [ 1337, 'wat', new Date().toISOString(), null, false, Buffer.from('awesome'), JSON.stringify([{ some: 'json' }, { array: 'object' }]) ]) console.log(`${new Date()}: ${Math.round(performance.now() - startPerf)}ms`) } for(;;) await fetch(); ``` --- tests/node_compat/config.jsonc | 1 + tests/node_compat/runner/TODO.md | 1 - .../test/parallel/test-net-socket-setnodelay.js | 63 ++++++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 tests/node_compat/test/parallel/test-net-socket-setnodelay.js (limited to 'tests') diff --git a/tests/node_compat/config.jsonc b/tests/node_compat/config.jsonc index bc9bf476b..75f463342 100644 --- a/tests/node_compat/config.jsonc +++ b/tests/node_compat/config.jsonc @@ -439,6 +439,7 @@ "test-net-server-unref.js", "test-net-socket-destroy-twice.js", "test-net-socket-no-halfopen-enforcer.js", + "test-net-socket-setnodelay.js", "test-net-timeout-no-handle.js", "test-net-write-arguments.js", "test-next-tick-doesnt-hang.js", diff --git a/tests/node_compat/runner/TODO.md b/tests/node_compat/runner/TODO.md index 99258f5a5..11b5d2805 100644 --- a/tests/node_compat/runner/TODO.md +++ b/tests/node_compat/runner/TODO.md @@ -1851,7 +1851,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [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-setnodelay.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-net-socket-setnodelay.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) diff --git a/tests/node_compat/test/parallel/test-net-socket-setnodelay.js b/tests/node_compat/test/parallel/test-net-socket-setnodelay.js new file mode 100644 index 000000000..3d11b8452 --- /dev/null +++ b/tests/node_compat/test/parallel/test-net-socket-setnodelay.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 18.12.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 truthyValues = [true, 1, 'true', {}, []]; +const falseyValues = [false, 0, '']; +const genSetNoDelay = (desiredArg) => (enable) => { + assert.strictEqual(enable, desiredArg); +}; + +// setNoDelay should default to true +let socket = new net.Socket({ + handle: { + setNoDelay: common.mustCall(genSetNoDelay(true)), + readStart() {} + } +}); +socket.setNoDelay(); + +socket = new net.Socket({ + handle: { + setNoDelay: common.mustCall(genSetNoDelay(true), 1), + readStart() {} + } +}); +truthyValues.forEach((testVal) => socket.setNoDelay(testVal)); + +socket = new net.Socket({ + handle: { + setNoDelay: common.mustNotCall(), + readStart() {} + } +}); +falseyValues.forEach((testVal) => socket.setNoDelay(testVal)); + +socket = new net.Socket({ + handle: { + setNoDelay: common.mustCall(3), + readStart() {} + } +}); +truthyValues.concat(falseyValues).concat(truthyValues) + .forEach((testVal) => socket.setNoDelay(testVal)); + +// If a handler doesn't have a setNoDelay function it shouldn't be called. +// In the case below, if it is called an exception will be thrown +socket = new net.Socket({ + handle: { + setNoDelay: null, + readStart() {} + } +}); +const returned = socket.setNoDelay(true); +assert.ok(returned instanceof net.Socket); -- cgit v1.2.3 From 533a9b108677f1560fe55882771a0be2bb0b0fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E7=82=B3=E6=9D=83?= <695601626@qq.com> Date: Wed, 16 Oct 2024 00:10:07 +0800 Subject: chore: upgrade to rust 1.81.0 (#26261) --- tests/integration/compile_tests.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/integration/compile_tests.rs b/tests/integration/compile_tests.rs index 0a5916f6f..a8ea5b038 100644 --- a/tests/integration/compile_tests.rs +++ b/tests/integration/compile_tests.rs @@ -241,7 +241,7 @@ fn compile_with_file_exists_error() { "./compile/args.ts", ]) .run() - .assert_matches_text(&format!( + .assert_matches_text(format!( concat!( "[WILDCARD]error: Could not compile to file '{}' because its parent directory ", "is an existing file. You can use the `--output ` flag to ", @@ -269,7 +269,7 @@ fn compile_with_directory_exists_error() { &exe.to_string_lossy(), "./compile/args.ts" ]).run() - .assert_matches_text(&format!( + .assert_matches_text(format!( concat!( "[WILDCARD]error: Could not compile to file '{}' because a directory exists with ", "the same name. You can use the `--output ` flag to ", @@ -297,7 +297,7 @@ fn compile_with_conflict_file_exists_error() { &exe.to_string_lossy(), "./compile/args.ts" ]).run() - .assert_matches_text(&format!( + .assert_matches_text(format!( concat!( "[WILDCARD]error: Could not compile to file '{}' because the file already exists ", "and cannot be overwritten. Please delete the existing file or ", -- cgit v1.2.3 From 797405fc61b2d155941506fb53d498076e121017 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:38:42 -0700 Subject: fix(add): create deno.json when running `deno add jsr:` (#26275) Fixes https://github.com/denoland/deno/issues/26119. Originally I wanted to put them in package.json if there's no deno.json, but on second thought it makes more sense to just create a deno.json --- tests/specs/add/jsr_prefers_deno_json/__test__.jsonc | 16 ++++++++++++++++ tests/specs/add/jsr_prefers_deno_json/add.out | 3 +++ tests/specs/add/jsr_prefers_deno_json/deno.json.out | 5 +++++ tests/specs/add/jsr_prefers_deno_json/package.json | 1 + 4 files changed, 25 insertions(+) create mode 100644 tests/specs/add/jsr_prefers_deno_json/__test__.jsonc create mode 100644 tests/specs/add/jsr_prefers_deno_json/add.out create mode 100644 tests/specs/add/jsr_prefers_deno_json/deno.json.out create mode 100644 tests/specs/add/jsr_prefers_deno_json/package.json (limited to 'tests') diff --git a/tests/specs/add/jsr_prefers_deno_json/__test__.jsonc b/tests/specs/add/jsr_prefers_deno_json/__test__.jsonc new file mode 100644 index 000000000..ca9c4b4d9 --- /dev/null +++ b/tests/specs/add/jsr_prefers_deno_json/__test__.jsonc @@ -0,0 +1,16 @@ +{ + "tempDir": true, + "steps": [ + { + "args": "add jsr:@denotest/add", + "output": "add.out" + }, + { + "args": [ + "eval", + "console.log(Deno.readTextFileSync('./deno.json').trim())" + ], + "output": "deno.json.out" + } + ] +} diff --git a/tests/specs/add/jsr_prefers_deno_json/add.out b/tests/specs/add/jsr_prefers_deno_json/add.out new file mode 100644 index 000000000..cb8140c6d --- /dev/null +++ b/tests/specs/add/jsr_prefers_deno_json/add.out @@ -0,0 +1,3 @@ +Created deno.json configuration file. +Add jsr:@denotest/add@1.0.0 +Download [WILDCARD] diff --git a/tests/specs/add/jsr_prefers_deno_json/deno.json.out b/tests/specs/add/jsr_prefers_deno_json/deno.json.out new file mode 100644 index 000000000..38ca2d4b8 --- /dev/null +++ b/tests/specs/add/jsr_prefers_deno_json/deno.json.out @@ -0,0 +1,5 @@ +{ + "imports": { + "@denotest/add": "jsr:@denotest/add@^1.0.0" + } +} diff --git a/tests/specs/add/jsr_prefers_deno_json/package.json b/tests/specs/add/jsr_prefers_deno_json/package.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/tests/specs/add/jsr_prefers_deno_json/package.json @@ -0,0 +1 @@ +{} -- cgit v1.2.3 From ee904ec06c1a3b3d4e4a87898e777e2f9b587b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 15 Oct 2024 22:51:39 +0100 Subject: fix: add hint for missing `document` global in terminal error (#26218) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This came up on Discord as a question so I thought it's worth adding a hint for this as it might be a common pitfall. --------- Signed-off-by: Bartek Iwańczuk Co-authored-by: David Sherret --- tests/specs/run/document/__test__.jsonc | 9 +++++++++ tests/specs/run/document/document.js | 1 + tests/specs/run/document/document.out | 8 ++++++++ tests/specs/test/document/__test__.jsonc | 9 +++++++++ tests/specs/test/document/document_test.js | 3 +++ tests/specs/test/document/document_test.out | 22 ++++++++++++++++++++++ 6 files changed, 52 insertions(+) create mode 100644 tests/specs/run/document/__test__.jsonc create mode 100644 tests/specs/run/document/document.js create mode 100644 tests/specs/run/document/document.out create mode 100644 tests/specs/test/document/__test__.jsonc create mode 100644 tests/specs/test/document/document_test.js create mode 100644 tests/specs/test/document/document_test.out (limited to 'tests') diff --git a/tests/specs/run/document/__test__.jsonc b/tests/specs/run/document/__test__.jsonc new file mode 100644 index 000000000..cf20f9e1b --- /dev/null +++ b/tests/specs/run/document/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "tests": { + "document": { + "args": "run document.js", + "exitCode": 1, + "output": "document.out" + } + } +} diff --git a/tests/specs/run/document/document.js b/tests/specs/run/document/document.js new file mode 100644 index 000000000..63e43b72f --- /dev/null +++ b/tests/specs/run/document/document.js @@ -0,0 +1 @@ +document.querySelector("div"); diff --git a/tests/specs/run/document/document.out b/tests/specs/run/document/document.out new file mode 100644 index 000000000..eefedb8f2 --- /dev/null +++ b/tests/specs/run/document/document.out @@ -0,0 +1,8 @@ +error: Uncaught (in promise) ReferenceError: document is not defined +document.querySelector("div"); +^ + at [WILDCARD]document.js:1:1 + + info: document global is not available in Deno. + hint: Use a library like happy-dom, deno_dom, linkedom or JSDom + and setup the document global according to the library documentation. diff --git a/tests/specs/test/document/__test__.jsonc b/tests/specs/test/document/__test__.jsonc new file mode 100644 index 000000000..cf73b4bab --- /dev/null +++ b/tests/specs/test/document/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "tests": { + "document": { + "args": "test document_test.js", + "exitCode": 1, + "output": "document_test.out" + } + } +} diff --git a/tests/specs/test/document/document_test.js b/tests/specs/test/document/document_test.js new file mode 100644 index 000000000..d60d6893c --- /dev/null +++ b/tests/specs/test/document/document_test.js @@ -0,0 +1,3 @@ +Deno.test("document query selector", () => { + document.querySelector("div"); +}); diff --git a/tests/specs/test/document/document_test.out b/tests/specs/test/document/document_test.out new file mode 100644 index 000000000..342cee0e4 --- /dev/null +++ b/tests/specs/test/document/document_test.out @@ -0,0 +1,22 @@ +running 1 test from ./document_test.js +document query selector ... FAILED [WILDCARD] + + ERRORS + +document query selector => ./document_test.js:1:6 +error: ReferenceError: document is not defined + document.querySelector("div"); + ^ + at [WILDCARD]document_test.js:2:3 + + info: document global is not available in Deno. + hint: Use a library like happy-dom, deno_dom, linkedom or JSDom + and setup the document global according to the library documentation. + + FAILURES + +document query selector => ./document_test.js:1:6 + +FAILED | 0 passed | 1 failed ([WILDCARD]) + +error: Test failed -- cgit v1.2.3 From 40b1c42138c47e89eefa859cd36a9e3d62541e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 16 Oct 2024 00:25:24 +0100 Subject: fix: improve suggestions and hints when using CommonJS modules (#26287) Ref https://github.com/denoland/deno/issues/26225 --- tests/specs/run/import_common_js/__test__.jsonc | 5 +++++ tests/specs/run/import_common_js/exports_error.out | 9 +++++++-- tests/specs/run/import_common_js/module_error.out | 9 +++++++-- tests/specs/run/import_common_js/require_error.js | 2 ++ tests/specs/run/import_common_js/require_error.out | 12 ++++++++++++ tests/specs/run/package_json_type/commonjs/main_mix.out | 8 ++++++++ tests/specs/run/package_json_type/none/main_cjs.out | 8 ++++++++ 7 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 tests/specs/run/import_common_js/require_error.js create mode 100644 tests/specs/run/import_common_js/require_error.out (limited to 'tests') diff --git a/tests/specs/run/import_common_js/__test__.jsonc b/tests/specs/run/import_common_js/__test__.jsonc index 950c7f68c..6510dbad7 100644 --- a/tests/specs/run/import_common_js/__test__.jsonc +++ b/tests/specs/run/import_common_js/__test__.jsonc @@ -11,6 +11,11 @@ "args": "run exports_error.js", "output": "exports_error.out", "exitCode": 1 + }, + { + "args": "run require_error.js", + "output": "require_error.out", + "exitCode": 1 } ] } diff --git a/tests/specs/run/import_common_js/exports_error.out b/tests/specs/run/import_common_js/exports_error.out index 41eda2457..299a46438 100644 --- a/tests/specs/run/import_common_js/exports_error.out +++ b/tests/specs/run/import_common_js/exports_error.out @@ -3,5 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true }); ^ at [WILDCARD]exports_error.js:1:23 - info: Deno does not support CommonJS modules without `.cjs` extension. - hint: Rewrite this module to ESM or change the file extension to `.cjs`. + info: Deno supports CommonJS modules in .cjs files, or when there's a package.json + with "type": "commonjs" option and --unstable-detect-cjs flag is used. + 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 + and pass --unstable-detect-cjs flag. + hint: See https://docs.deno.com/go/commonjs for details diff --git a/tests/specs/run/import_common_js/module_error.out b/tests/specs/run/import_common_js/module_error.out index 53a908d29..1c1140fe4 100644 --- a/tests/specs/run/import_common_js/module_error.out +++ b/tests/specs/run/import_common_js/module_error.out @@ -3,5 +3,10 @@ module.exports = { ^ at [WILDCARD]module_error.js:1:1 - info: Deno does not support CommonJS modules without `.cjs` extension. - hint: Rewrite this module to ESM or change the file extension to `.cjs`. + info: Deno supports CommonJS modules in .cjs files, or when there's a package.json + with "type": "commonjs" option and --unstable-detect-cjs flag is used. + 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 + and pass --unstable-detect-cjs flag. + hint: See https://docs.deno.com/go/commonjs for details diff --git a/tests/specs/run/import_common_js/require_error.js b/tests/specs/run/import_common_js/require_error.js new file mode 100644 index 000000000..956768933 --- /dev/null +++ b/tests/specs/run/import_common_js/require_error.js @@ -0,0 +1,2 @@ +const process = require("process"); +const a = require("./a"); diff --git a/tests/specs/run/import_common_js/require_error.out b/tests/specs/run/import_common_js/require_error.out new file mode 100644 index 000000000..ebc6b6fa4 --- /dev/null +++ b/tests/specs/run/import_common_js/require_error.out @@ -0,0 +1,12 @@ +error: Uncaught (in promise) ReferenceError: require is not defined +const process = require("process"); + ^ + at [WILDCARD]require_error.js:1:17 + + info: Deno supports CommonJS modules in .cjs files, or when there's a package.json + with "type": "commonjs" option and --unstable-detect-cjs flag is used. + 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 + and pass --unstable-detect-cjs flag. + hint: See https://docs.deno.com/go/commonjs for details diff --git a/tests/specs/run/package_json_type/commonjs/main_mix.out b/tests/specs/run/package_json_type/commonjs/main_mix.out index d6123d48b..67d316fcd 100644 --- a/tests/specs/run/package_json_type/commonjs/main_mix.out +++ b/tests/specs/run/package_json_type/commonjs/main_mix.out @@ -3,3 +3,11 @@ error: Uncaught (in promise) ReferenceError: require is not defined console.log(require("./add").add(1, 2)); ^ at file:///[WILDLINE]main_mix.js:[WILDLINE] + + info: Deno supports CommonJS modules in .cjs files, or when there's a package.json + with "type": "commonjs" option and --unstable-detect-cjs flag is used. + 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 + and pass --unstable-detect-cjs flag. + hint: See https://docs.deno.com/go/commonjs for details 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 fe9acf009..66213dbdb 100644 --- a/tests/specs/run/package_json_type/none/main_cjs.out +++ b/tests/specs/run/package_json_type/none/main_cjs.out @@ -2,3 +2,11 @@ error: Uncaught (in promise) ReferenceError: require is not defined const { add } = require("./add"); ^ at file:///[WILDLINE] + + info: Deno supports CommonJS modules in .cjs files, or when there's a package.json + with "type": "commonjs" option and --unstable-detect-cjs flag is used. + 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 + and pass --unstable-detect-cjs flag. + hint: See https://docs.deno.com/go/commonjs for details -- cgit v1.2.3 From 21fa953f320c66a897822c4c731b2fae5f07c78b Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Wed, 16 Oct 2024 14:27:28 +0530 Subject: fix(ext/node): timingSafeEqual account for AB byteOffset (#26292) Fixes https://github.com/denoland/deno/issues/26276 --- tests/unit_node/crypto/crypto_misc_test.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/unit_node/crypto/crypto_misc_test.ts b/tests/unit_node/crypto/crypto_misc_test.ts index 47a48b1bf..007009339 100644 --- a/tests/unit_node/crypto/crypto_misc_test.ts +++ b/tests/unit_node/crypto/crypto_misc_test.ts @@ -1,5 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { randomFillSync, randomUUID } from "node:crypto"; +import { randomFillSync, randomUUID, timingSafeEqual } from "node:crypto"; +import { Buffer } from "node:buffer"; import { assert, assertEquals } from "../../unit/test_util.ts"; import { assertNotEquals } from "@std/assert"; @@ -28,3 +29,10 @@ Deno.test("[node/crypto.randomFillSync] array buffer view", () => { assertEquals(buf.subarray(0, 8), new Uint8Array(8)); assertEquals(buf.subarray(24, 32), new Uint8Array(8)); }); + +Deno.test("[node/crypto.timingSafeEqual] compares equal Buffer with different byteOffset", () => { + const a = Buffer.from([212, 213]); + const b = Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 212, 213]).subarray(8); + + assert(timingSafeEqual(a, b)); +}); -- cgit v1.2.3 From 2929d583d2f690b5a3d600296363a8ecd90440eb Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Wed, 16 Oct 2024 14:50:41 +0530 Subject: fix(cli): consolidate pkg parser for install & remove (#26298) Closes https://github.com/denoland/deno/issues/26283 --- tests/specs/remove/alias/__test__.jsonc | 29 +++++++++++++++++++++++++++++ tests/specs/remove/alias/package.json | 5 +++++ tests/specs/remove/alias/package.json.out | 2 ++ tests/specs/remove/basic/__test__.jsonc | 2 +- 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 tests/specs/remove/alias/__test__.jsonc create mode 100644 tests/specs/remove/alias/package.json create mode 100644 tests/specs/remove/alias/package.json.out (limited to 'tests') diff --git a/tests/specs/remove/alias/__test__.jsonc b/tests/specs/remove/alias/__test__.jsonc new file mode 100644 index 000000000..a0c98edd9 --- /dev/null +++ b/tests/specs/remove/alias/__test__.jsonc @@ -0,0 +1,29 @@ +{ + "tempDir": true, + "tests": { + "alias_with_pkg": { + "steps": [{ + "args": "remove my-alias@npm:@denotest/add", + "output": "[WILDCARD]" + }, { + "args": [ + "eval", + "console.log(Deno.readTextFileSync('package.json').trim())" + ], + "output": "package.json.out" + }] + }, + "alias": { + "steps": [{ + "args": "remove my-alias", + "output": "[WILDCARD]" + }, { + "args": [ + "eval", + "console.log(Deno.readTextFileSync('package.json').trim())" + ], + "output": "package.json.out" + }] + } + } +} diff --git a/tests/specs/remove/alias/package.json b/tests/specs/remove/alias/package.json new file mode 100644 index 000000000..b6326e8bf --- /dev/null +++ b/tests/specs/remove/alias/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "my-alias": "npm:@denotest/add@^1.0.0" + } +} diff --git a/tests/specs/remove/alias/package.json.out b/tests/specs/remove/alias/package.json.out new file mode 100644 index 000000000..2c63c0851 --- /dev/null +++ b/tests/specs/remove/alias/package.json.out @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/specs/remove/basic/__test__.jsonc b/tests/specs/remove/basic/__test__.jsonc index fd74900b4..3ca396f8b 100644 --- a/tests/specs/remove/basic/__test__.jsonc +++ b/tests/specs/remove/basic/__test__.jsonc @@ -7,7 +7,7 @@ "args": ["eval", "console.log(Deno.readTextFileSync('deno.lock').trim())"], "output": "add_lock.out" }, { - "args": ["remove", "@std/assert", "@std/http"], + "args": ["remove", "jsr:@std/assert", "@std/http"], "output": "rm.out" }, { "args": ["eval", "console.log(Deno.readTextFileSync('deno.lock').trim())"], -- cgit v1.2.3 From ea9c3ffaa240fc968832871000832eda1b92934a Mon Sep 17 00:00:00 2001 From: snek Date: Wed, 16 Oct 2024 12:30:19 +0200 Subject: fix: node-api function call should use preamble (#26297) `napi_call_function` should use our equiv of NAPI_PREAMBLE (`&mut Env` instead of `*mut Env`) since it needs to set error codes based on whether the body of the function raised a JS exception. Fixes: https://github.com/denoland/deno/issues/26282 --- tests/napi/callback_test.js | 11 ++++++++++- tests/napi/src/callback.rs | 30 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/napi/callback_test.js b/tests/napi/callback_test.js index 98622d48d..c132fefa1 100644 --- a/tests/napi/callback_test.js +++ b/tests/napi/callback_test.js @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals, loadTestLibrary } from "./common.js"; +import { assertEquals, assertThrows, loadTestLibrary } from "./common.js"; const callback = loadTestLibrary(); @@ -36,3 +36,12 @@ Deno.test("napi callback run with args & recv", function () { ); assertEquals(result, 69); }); + +Deno.test("napi callback handles errors correctly", function () { + const e = new Error("hi!"); + assertThrows(() => { + callback.test_callback_throws(() => { + throw e; + }); + }, e); +}); diff --git a/tests/napi/src/callback.rs b/tests/napi/src/callback.rs index 8909f5176..2512f6a38 100644 --- a/tests/napi/src/callback.rs +++ b/tests/napi/src/callback.rs @@ -8,6 +8,7 @@ use napi_sys::ValueType::napi_object; use napi_sys::ValueType::napi_undefined; use napi_sys::*; use std::ptr; +use Status::napi_pending_exception; /// `test_callback_run((a, b) => a + b, [1, 2])` => 3 extern "C" fn test_callback_run( @@ -98,6 +99,34 @@ extern "C" fn test_callback_run_with_recv( result } +extern "C" fn test_callback_throws( + env: napi_env, + info: napi_callback_info, +) -> napi_value { + let (args, ..) = napi_get_callback_info!(env, info, 1); + + let mut global: napi_value = ptr::null_mut(); + assert_napi_ok!(napi_get_global(env, &mut global)); + + let mut argv = vec![]; + let mut result: napi_value = ptr::null_mut(); + assert_eq!( + unsafe { + napi_call_function( + env, + global, // recv + args[0], // cb + argv.len(), + argv.as_mut_ptr(), + &mut result, + ) + }, + napi_pending_exception + ); + + result +} + pub fn init(env: napi_env, exports: napi_value) { let properties = &[ napi_new_property!(env, "test_callback_run", test_callback_run), @@ -106,6 +135,7 @@ pub fn init(env: napi_env, exports: napi_value) { "test_callback_run_with_recv", test_callback_run_with_recv ), + napi_new_property!(env, "test_callback_throws", test_callback_throws), ]; assert_napi_ok!(napi_define_properties( -- cgit v1.2.3 From d59599fc187c559ee231882773e1c5a2b932fc3d Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Wed, 16 Oct 2024 20:58:44 +0900 Subject: fix(ext/node): fix dns.lookup result ordering (#26264) partially unblocks #25470 This PR aligns the resolution of `localhost` hostname to Node.js behavior. In Node.js `dns.lookup("localhost", (_, addr) => console.log(addr))` prints ipv6 address `::1`, but it prints ipv4 address `127.0.0.1` in Deno. That difference causes some errors in the work of enabling `createConnection` option in `http.request` (#25470). This PR fixes the issue by aligning `dns.lookup` behavior to Node.js. This PR also changes the following behaviors (resolving TODOs): - `http.createServer` now listens on ipv6 address `[::]` by default on linux/mac - `net.createServer` now listens on ipv6 address `[::]` by default on linux/mac These changes are also alignments to Node.js behaviors. --- tests/unit_node/http_test.ts | 8 ++++++-- tests/unit_node/tls_test.ts | 12 +++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/unit_node/http_test.ts b/tests/unit_node/http_test.ts index f85b1466b..f1ff77bb3 100644 --- a/tests/unit_node/http_test.ts +++ b/tests/unit_node/http_test.ts @@ -318,10 +318,14 @@ Deno.test("[node/http] IncomingRequest socket has remoteAddress + remotePort", a // deno-lint-ignore no-explicit-any const port = (server.address() as any).port; const res = await fetch( - `http://127.0.0.1:${port}/`, + `http://localhost:${port}/`, ); await res.arrayBuffer(); - assertEquals(remoteAddress, "127.0.0.1"); + if (Deno.build.os === "windows") { + assertEquals(remoteAddress, "127.0.0.1"); + } else { + assertEquals(remoteAddress, "::1"); + } assertEquals(typeof remotePort, "number"); server.close(() => resolve()); }); diff --git a/tests/unit_node/tls_test.ts b/tests/unit_node/tls_test.ts index 93eacd5ec..847ec2dde 100644 --- a/tests/unit_node/tls_test.ts +++ b/tests/unit_node/tls_test.ts @@ -32,13 +32,15 @@ for ( ) { Deno.test(`tls.connect sends correct ALPN: '${alpnServer}' + '${alpnClient}' = '${expected}'`, async () => { const listener = Deno.listenTls({ + hostname: "localhost", port: 0, key, cert, alpnProtocols: alpnServer, }); const outgoing = tls.connect({ - host: "localhost", + host: "::1", + servername: "localhost", port: listener.addr.port, ALPNProtocols: alpnClient, secureContext: { @@ -61,6 +63,7 @@ Deno.test("tls.connect makes tls connection", async () => { const ctl = new AbortController(); let port; const serve = Deno.serve({ + hostname: "localhost", port: 0, key, cert, @@ -71,7 +74,8 @@ Deno.test("tls.connect makes tls connection", async () => { await delay(200); const conn = tls.connect({ - host: "localhost", + host: "::1", + servername: "localhost", port, secureContext: { ca: rootCaCert, @@ -102,6 +106,7 @@ Deno.test("tls.connect mid-read tcp->tls upgrade", async () => { const { promise, resolve } = Promise.withResolvers(); const ctl = new AbortController(); const serve = Deno.serve({ + hostname: "localhost", port: 8443, key, cert, @@ -111,7 +116,8 @@ Deno.test("tls.connect mid-read tcp->tls upgrade", async () => { await delay(200); const conn = tls.connect({ - host: "localhost", + host: "::1", + servername: "localhost", port: 8443, secureContext: { ca: rootCaCert, -- cgit v1.2.3 From 06778e4e9b0a856ac39cc01f0813e6076eb150d6 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Wed, 16 Oct 2024 17:05:13 +0100 Subject: feat(lsp): "deno/didRefreshDenoConfigurationTree" notifications (#26215) --- tests/integration/lsp_tests.rs | 195 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 190 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 0f2d43755..85e02041e 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -1049,6 +1049,191 @@ fn lsp_workspace_enable_paths_no_workspace_configuration() { client.shutdown(); } +#[test] +fn lsp_did_refresh_deno_configuration_tree_notification() { + let context = TestContextBuilder::new().use_temp_cwd().build(); + let temp_dir = context.temp_dir(); + temp_dir.create_dir_all("workspace/member1"); + temp_dir.create_dir_all("workspace/member2"); + temp_dir.create_dir_all("non_workspace1"); + temp_dir.create_dir_all("non_workspace2"); + temp_dir.write( + "workspace/deno.json", + json!({ + "workspace": [ + "member1", + "member2", + ], + }) + .to_string(), + ); + temp_dir.write("workspace/member1/deno.json", json!({}).to_string()); + temp_dir.write("workspace/member1/package.json", json!({}).to_string()); + temp_dir.write("workspace/member2/package.json", json!({}).to_string()); + temp_dir.write("non_workspace1/deno.json", json!({}).to_string()); + let mut client = context.new_lsp_command().build(); + client.initialize_default(); + let res = client + .read_notification_with_method::( + "deno/didRefreshDenoConfigurationTree", + ) + .unwrap(); + assert_eq!( + res, + json!({ + "data": [ + { + "scopeUri": temp_dir.url().join("non_workspace1/").unwrap(), + "workspaceRootScopeUri": null, + "denoJson": { + "uri": temp_dir.url().join("non_workspace1/deno.json").unwrap(), + }, + "packageJson": null, + }, + { + "scopeUri": temp_dir.url().join("workspace/").unwrap(), + "workspaceRootScopeUri": null, + "denoJson": { + "uri": temp_dir.url().join("workspace/deno.json").unwrap(), + }, + "packageJson": null, + }, + { + "scopeUri": temp_dir.url().join("workspace/member1/").unwrap(), + "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), + "denoJson": { + "uri": temp_dir.url().join("workspace/member1/deno.json").unwrap(), + }, + "packageJson": { + "uri": temp_dir.url().join("workspace/member1/package.json").unwrap(), + }, + }, + { + "scopeUri": temp_dir.url().join("workspace/member2/").unwrap(), + "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), + "denoJson": null, + "packageJson": { + "uri": temp_dir.url().join("workspace/member2/package.json").unwrap(), + }, + }, + ], + }), + ); + temp_dir.write("non_workspace2/deno.json", json!({}).to_string()); + client.did_change_watched_files(json!({ + "changes": [{ + "uri": temp_dir.url().join("non_workspace2/deno.json").unwrap(), + "type": 1, + }], + })); + let res = client + .read_notification_with_method::( + "deno/didRefreshDenoConfigurationTree", + ) + .unwrap(); + assert_eq!( + res, + json!({ + "data": [ + { + "scopeUri": temp_dir.url().join("non_workspace1/").unwrap(), + "workspaceRootScopeUri": null, + "denoJson": { + "uri": temp_dir.url().join("non_workspace1/deno.json").unwrap(), + }, + "packageJson": null, + }, + { + "scopeUri": temp_dir.url().join("non_workspace2/").unwrap(), + "workspaceRootScopeUri": null, + "denoJson": { + "uri": temp_dir.url().join("non_workspace2/deno.json").unwrap(), + }, + "packageJson": null, + }, + { + "scopeUri": temp_dir.url().join("workspace/").unwrap(), + "workspaceRootScopeUri": null, + "denoJson": { + "uri": temp_dir.url().join("workspace/deno.json").unwrap(), + }, + "packageJson": null, + }, + { + "scopeUri": temp_dir.url().join("workspace/member1/").unwrap(), + "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), + "denoJson": { + "uri": temp_dir.url().join("workspace/member1/deno.json").unwrap(), + }, + "packageJson": { + "uri": temp_dir.url().join("workspace/member1/package.json").unwrap(), + }, + }, + { + "scopeUri": temp_dir.url().join("workspace/member2/").unwrap(), + "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), + "denoJson": null, + "packageJson": { + "uri": temp_dir.url().join("workspace/member2/package.json").unwrap(), + }, + }, + ], + }), + ); + client.change_configuration(json!({ + "deno": { + "disablePaths": ["non_workspace1"], + }, + })); + let res = client + .read_notification_with_method::( + "deno/didRefreshDenoConfigurationTree", + ) + .unwrap(); + assert_eq!( + res, + json!({ + "data": [ + { + "scopeUri": temp_dir.url().join("non_workspace2/").unwrap(), + "workspaceRootScopeUri": null, + "denoJson": { + "uri": temp_dir.url().join("non_workspace2/deno.json").unwrap(), + }, + "packageJson": null, + }, + { + "scopeUri": temp_dir.url().join("workspace/").unwrap(), + "workspaceRootScopeUri": null, + "denoJson": { + "uri": temp_dir.url().join("workspace/deno.json").unwrap(), + }, + "packageJson": null, + }, + { + "scopeUri": temp_dir.url().join("workspace/member1/").unwrap(), + "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), + "denoJson": { + "uri": temp_dir.url().join("workspace/member1/deno.json").unwrap(), + }, + "packageJson": { + "uri": temp_dir.url().join("workspace/member1/package.json").unwrap(), + }, + }, + { + "scopeUri": temp_dir.url().join("workspace/member2/").unwrap(), + "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), + "denoJson": null, + "packageJson": { + "uri": temp_dir.url().join("workspace/member2/package.json").unwrap(), + }, + }, + ], + }), + ); + client.shutdown(); +} + #[test] fn lsp_did_change_deno_configuration_notification() { let context = TestContextBuilder::new().use_temp_cwd().build(); @@ -9403,14 +9588,15 @@ fn lsp_auto_discover_registry() { "triggerCharacter": "@" }), ); - let (method, res) = client.read_notification(); - assert_eq!(method, "deno/registryState"); + let res = client + .read_notification_with_method::("deno/registryState") + .unwrap(); assert_eq!( res, - Some(json!({ + json!({ "origin": "http://localhost:4545", "suggestions": true, - })) + }), ); client.shutdown(); } @@ -10117,7 +10303,6 @@ fn lsp_diagnostics_refresh_dependents() { assert_eq!(json!(diagnostics.all()), json!([])); // no diagnostics now client.shutdown(); - assert_eq!(client.queue_len(), 0); } // Regression test for https://github.com/denoland/deno/issues/10897. -- cgit v1.2.3 From e515f3dd0ea61bb3001e98ad7733ccb67c341f1e Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Wed, 16 Oct 2024 18:34:33 +0200 Subject: fix(add): exact version should not have range `^` specifier (#26302) Fixes https://github.com/denoland/deno/issues/26299 --- tests/specs/add/exact_version/__test__.jsonc | 35 +++++++++++++++++++++++++ tests/specs/add/exact_version/deno.json | 1 + tests/specs/add/exact_version/jsr_add.out | 2 ++ tests/specs/add/exact_version/jsr_deno.json.out | 5 ++++ tests/specs/add/exact_version/npm_add.out | 3 +++ tests/specs/add/exact_version/npm_deno.json.out | 5 ++++ 6 files changed, 51 insertions(+) create mode 100644 tests/specs/add/exact_version/__test__.jsonc create mode 100644 tests/specs/add/exact_version/deno.json create mode 100644 tests/specs/add/exact_version/jsr_add.out create mode 100644 tests/specs/add/exact_version/jsr_deno.json.out create mode 100644 tests/specs/add/exact_version/npm_add.out create mode 100644 tests/specs/add/exact_version/npm_deno.json.out (limited to 'tests') diff --git a/tests/specs/add/exact_version/__test__.jsonc b/tests/specs/add/exact_version/__test__.jsonc new file mode 100644 index 000000000..feb6cc617 --- /dev/null +++ b/tests/specs/add/exact_version/__test__.jsonc @@ -0,0 +1,35 @@ +{ + "tempDir": true, + "tests": { + "npm": { + "steps": [ + { + "args": "add npm:@denotest/esm-basic@1.0.0", + "output": "npm_add.out" + }, + { + "args": [ + "eval", + "console.log(Deno.readTextFileSync('deno.json').trim())" + ], + "output": "npm_deno.json.out" + } + ] + }, + "jsr": { + "steps": [ + { + "args": "add jsr:@denotest/add@1.0.0", + "output": "jsr_add.out" + }, + { + "args": [ + "eval", + "console.log(Deno.readTextFileSync('deno.json').trim())" + ], + "output": "jsr_deno.json.out" + } + ] + } + } +} diff --git a/tests/specs/add/exact_version/deno.json b/tests/specs/add/exact_version/deno.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/tests/specs/add/exact_version/deno.json @@ -0,0 +1 @@ +{} diff --git a/tests/specs/add/exact_version/jsr_add.out b/tests/specs/add/exact_version/jsr_add.out new file mode 100644 index 000000000..f2684ef57 --- /dev/null +++ b/tests/specs/add/exact_version/jsr_add.out @@ -0,0 +1,2 @@ +Add jsr:@denotest/add@1.0.0 +Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts diff --git a/tests/specs/add/exact_version/jsr_deno.json.out b/tests/specs/add/exact_version/jsr_deno.json.out new file mode 100644 index 000000000..7f1715bd7 --- /dev/null +++ b/tests/specs/add/exact_version/jsr_deno.json.out @@ -0,0 +1,5 @@ +{ + "imports": { + "@denotest/add": "jsr:@denotest/add@1.0.0" + } +} diff --git a/tests/specs/add/exact_version/npm_add.out b/tests/specs/add/exact_version/npm_add.out new file mode 100644 index 000000000..93894a020 --- /dev/null +++ b/tests/specs/add/exact_version/npm_add.out @@ -0,0 +1,3 @@ +Add npm:@denotest/esm-basic@1.0.0 +Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz diff --git a/tests/specs/add/exact_version/npm_deno.json.out b/tests/specs/add/exact_version/npm_deno.json.out new file mode 100644 index 000000000..ff4afa772 --- /dev/null +++ b/tests/specs/add/exact_version/npm_deno.json.out @@ -0,0 +1,5 @@ +{ + "imports": { + "@denotest/esm-basic": "npm:@denotest/esm-basic@1.0.0" + } +} -- cgit v1.2.3 From f7dba52133904a9e4ca0468e2c98894992ea2e42 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Wed, 16 Oct 2024 11:25:25 -0700 Subject: fix(child_process): map node `--no-warnings` flag to `--quiet` (#26288) Closes https://github.com/denoland/deno/issues/25899 --- tests/unit_node/child_process_test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/unit_node/child_process_test.ts b/tests/unit_node/child_process_test.ts index f776fa4ac..0ea3c46cf 100644 --- a/tests/unit_node/child_process_test.ts +++ b/tests/unit_node/child_process_test.ts @@ -1045,3 +1045,19 @@ Deno.test(async function sendAfterClosedThrows() { await timeout.promise; }); + +Deno.test(async function noWarningsFlag() { + const code = ``; + const file = await Deno.makeTempFile(); + await Deno.writeTextFile(file, code); + const timeout = withTimeout(); + const child = CP.fork(file, [], { + execArgv: ["--no-warnings"], + stdio: ["inherit", "inherit", "inherit", "ipc"], + }); + child.on("close", () => { + timeout.resolve(); + }); + + await timeout.promise; +}); -- cgit v1.2.3 From 1fd8d092eafc168af779040e93129d14e5a7187d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 16 Oct 2024 20:05:47 +0100 Subject: =?UTF-8?q?Revert=20"feat(lsp):=20"deno/didRefreshDenoConfiguratio?= =?UTF-8?q?nTree"=20notificatio=E2=80=A6=20(#26320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …ns (#26215)" This reverts commit 06778e4e9b0a856ac39cc01f0813e6076eb150d6 because benchmarks are failing on `main`. --- tests/integration/lsp_tests.rs | 195 ++--------------------------------------- 1 file changed, 5 insertions(+), 190 deletions(-) (limited to 'tests') diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 85e02041e..0f2d43755 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -1049,191 +1049,6 @@ fn lsp_workspace_enable_paths_no_workspace_configuration() { client.shutdown(); } -#[test] -fn lsp_did_refresh_deno_configuration_tree_notification() { - let context = TestContextBuilder::new().use_temp_cwd().build(); - let temp_dir = context.temp_dir(); - temp_dir.create_dir_all("workspace/member1"); - temp_dir.create_dir_all("workspace/member2"); - temp_dir.create_dir_all("non_workspace1"); - temp_dir.create_dir_all("non_workspace2"); - temp_dir.write( - "workspace/deno.json", - json!({ - "workspace": [ - "member1", - "member2", - ], - }) - .to_string(), - ); - temp_dir.write("workspace/member1/deno.json", json!({}).to_string()); - temp_dir.write("workspace/member1/package.json", json!({}).to_string()); - temp_dir.write("workspace/member2/package.json", json!({}).to_string()); - temp_dir.write("non_workspace1/deno.json", json!({}).to_string()); - let mut client = context.new_lsp_command().build(); - client.initialize_default(); - let res = client - .read_notification_with_method::( - "deno/didRefreshDenoConfigurationTree", - ) - .unwrap(); - assert_eq!( - res, - json!({ - "data": [ - { - "scopeUri": temp_dir.url().join("non_workspace1/").unwrap(), - "workspaceRootScopeUri": null, - "denoJson": { - "uri": temp_dir.url().join("non_workspace1/deno.json").unwrap(), - }, - "packageJson": null, - }, - { - "scopeUri": temp_dir.url().join("workspace/").unwrap(), - "workspaceRootScopeUri": null, - "denoJson": { - "uri": temp_dir.url().join("workspace/deno.json").unwrap(), - }, - "packageJson": null, - }, - { - "scopeUri": temp_dir.url().join("workspace/member1/").unwrap(), - "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), - "denoJson": { - "uri": temp_dir.url().join("workspace/member1/deno.json").unwrap(), - }, - "packageJson": { - "uri": temp_dir.url().join("workspace/member1/package.json").unwrap(), - }, - }, - { - "scopeUri": temp_dir.url().join("workspace/member2/").unwrap(), - "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), - "denoJson": null, - "packageJson": { - "uri": temp_dir.url().join("workspace/member2/package.json").unwrap(), - }, - }, - ], - }), - ); - temp_dir.write("non_workspace2/deno.json", json!({}).to_string()); - client.did_change_watched_files(json!({ - "changes": [{ - "uri": temp_dir.url().join("non_workspace2/deno.json").unwrap(), - "type": 1, - }], - })); - let res = client - .read_notification_with_method::( - "deno/didRefreshDenoConfigurationTree", - ) - .unwrap(); - assert_eq!( - res, - json!({ - "data": [ - { - "scopeUri": temp_dir.url().join("non_workspace1/").unwrap(), - "workspaceRootScopeUri": null, - "denoJson": { - "uri": temp_dir.url().join("non_workspace1/deno.json").unwrap(), - }, - "packageJson": null, - }, - { - "scopeUri": temp_dir.url().join("non_workspace2/").unwrap(), - "workspaceRootScopeUri": null, - "denoJson": { - "uri": temp_dir.url().join("non_workspace2/deno.json").unwrap(), - }, - "packageJson": null, - }, - { - "scopeUri": temp_dir.url().join("workspace/").unwrap(), - "workspaceRootScopeUri": null, - "denoJson": { - "uri": temp_dir.url().join("workspace/deno.json").unwrap(), - }, - "packageJson": null, - }, - { - "scopeUri": temp_dir.url().join("workspace/member1/").unwrap(), - "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), - "denoJson": { - "uri": temp_dir.url().join("workspace/member1/deno.json").unwrap(), - }, - "packageJson": { - "uri": temp_dir.url().join("workspace/member1/package.json").unwrap(), - }, - }, - { - "scopeUri": temp_dir.url().join("workspace/member2/").unwrap(), - "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), - "denoJson": null, - "packageJson": { - "uri": temp_dir.url().join("workspace/member2/package.json").unwrap(), - }, - }, - ], - }), - ); - client.change_configuration(json!({ - "deno": { - "disablePaths": ["non_workspace1"], - }, - })); - let res = client - .read_notification_with_method::( - "deno/didRefreshDenoConfigurationTree", - ) - .unwrap(); - assert_eq!( - res, - json!({ - "data": [ - { - "scopeUri": temp_dir.url().join("non_workspace2/").unwrap(), - "workspaceRootScopeUri": null, - "denoJson": { - "uri": temp_dir.url().join("non_workspace2/deno.json").unwrap(), - }, - "packageJson": null, - }, - { - "scopeUri": temp_dir.url().join("workspace/").unwrap(), - "workspaceRootScopeUri": null, - "denoJson": { - "uri": temp_dir.url().join("workspace/deno.json").unwrap(), - }, - "packageJson": null, - }, - { - "scopeUri": temp_dir.url().join("workspace/member1/").unwrap(), - "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), - "denoJson": { - "uri": temp_dir.url().join("workspace/member1/deno.json").unwrap(), - }, - "packageJson": { - "uri": temp_dir.url().join("workspace/member1/package.json").unwrap(), - }, - }, - { - "scopeUri": temp_dir.url().join("workspace/member2/").unwrap(), - "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), - "denoJson": null, - "packageJson": { - "uri": temp_dir.url().join("workspace/member2/package.json").unwrap(), - }, - }, - ], - }), - ); - client.shutdown(); -} - #[test] fn lsp_did_change_deno_configuration_notification() { let context = TestContextBuilder::new().use_temp_cwd().build(); @@ -9588,15 +9403,14 @@ fn lsp_auto_discover_registry() { "triggerCharacter": "@" }), ); - let res = client - .read_notification_with_method::("deno/registryState") - .unwrap(); + let (method, res) = client.read_notification(); + assert_eq!(method, "deno/registryState"); assert_eq!( res, - json!({ + Some(json!({ "origin": "http://localhost:4545", "suggestions": true, - }), + })) ); client.shutdown(); } @@ -10303,6 +10117,7 @@ fn lsp_diagnostics_refresh_dependents() { assert_eq!(json!(diagnostics.all()), json!([])); // no diagnostics now client.shutdown(); + assert_eq!(client.queue_len(), 0); } // Regression test for https://github.com/denoland/deno/issues/10897. -- cgit v1.2.3 From 72dd74d83a89d3db17e6ed5d0b8c7f4ba3f3d233 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Wed, 16 Oct 2024 22:43:26 +0100 Subject: Reland feat(lsp): deno/didRefreshDenoConfigurationTree notifications (#26325) --- tests/integration/lsp_tests.rs | 195 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 190 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 0f2d43755..85e02041e 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -1049,6 +1049,191 @@ fn lsp_workspace_enable_paths_no_workspace_configuration() { client.shutdown(); } +#[test] +fn lsp_did_refresh_deno_configuration_tree_notification() { + let context = TestContextBuilder::new().use_temp_cwd().build(); + let temp_dir = context.temp_dir(); + temp_dir.create_dir_all("workspace/member1"); + temp_dir.create_dir_all("workspace/member2"); + temp_dir.create_dir_all("non_workspace1"); + temp_dir.create_dir_all("non_workspace2"); + temp_dir.write( + "workspace/deno.json", + json!({ + "workspace": [ + "member1", + "member2", + ], + }) + .to_string(), + ); + temp_dir.write("workspace/member1/deno.json", json!({}).to_string()); + temp_dir.write("workspace/member1/package.json", json!({}).to_string()); + temp_dir.write("workspace/member2/package.json", json!({}).to_string()); + temp_dir.write("non_workspace1/deno.json", json!({}).to_string()); + let mut client = context.new_lsp_command().build(); + client.initialize_default(); + let res = client + .read_notification_with_method::( + "deno/didRefreshDenoConfigurationTree", + ) + .unwrap(); + assert_eq!( + res, + json!({ + "data": [ + { + "scopeUri": temp_dir.url().join("non_workspace1/").unwrap(), + "workspaceRootScopeUri": null, + "denoJson": { + "uri": temp_dir.url().join("non_workspace1/deno.json").unwrap(), + }, + "packageJson": null, + }, + { + "scopeUri": temp_dir.url().join("workspace/").unwrap(), + "workspaceRootScopeUri": null, + "denoJson": { + "uri": temp_dir.url().join("workspace/deno.json").unwrap(), + }, + "packageJson": null, + }, + { + "scopeUri": temp_dir.url().join("workspace/member1/").unwrap(), + "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), + "denoJson": { + "uri": temp_dir.url().join("workspace/member1/deno.json").unwrap(), + }, + "packageJson": { + "uri": temp_dir.url().join("workspace/member1/package.json").unwrap(), + }, + }, + { + "scopeUri": temp_dir.url().join("workspace/member2/").unwrap(), + "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), + "denoJson": null, + "packageJson": { + "uri": temp_dir.url().join("workspace/member2/package.json").unwrap(), + }, + }, + ], + }), + ); + temp_dir.write("non_workspace2/deno.json", json!({}).to_string()); + client.did_change_watched_files(json!({ + "changes": [{ + "uri": temp_dir.url().join("non_workspace2/deno.json").unwrap(), + "type": 1, + }], + })); + let res = client + .read_notification_with_method::( + "deno/didRefreshDenoConfigurationTree", + ) + .unwrap(); + assert_eq!( + res, + json!({ + "data": [ + { + "scopeUri": temp_dir.url().join("non_workspace1/").unwrap(), + "workspaceRootScopeUri": null, + "denoJson": { + "uri": temp_dir.url().join("non_workspace1/deno.json").unwrap(), + }, + "packageJson": null, + }, + { + "scopeUri": temp_dir.url().join("non_workspace2/").unwrap(), + "workspaceRootScopeUri": null, + "denoJson": { + "uri": temp_dir.url().join("non_workspace2/deno.json").unwrap(), + }, + "packageJson": null, + }, + { + "scopeUri": temp_dir.url().join("workspace/").unwrap(), + "workspaceRootScopeUri": null, + "denoJson": { + "uri": temp_dir.url().join("workspace/deno.json").unwrap(), + }, + "packageJson": null, + }, + { + "scopeUri": temp_dir.url().join("workspace/member1/").unwrap(), + "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), + "denoJson": { + "uri": temp_dir.url().join("workspace/member1/deno.json").unwrap(), + }, + "packageJson": { + "uri": temp_dir.url().join("workspace/member1/package.json").unwrap(), + }, + }, + { + "scopeUri": temp_dir.url().join("workspace/member2/").unwrap(), + "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), + "denoJson": null, + "packageJson": { + "uri": temp_dir.url().join("workspace/member2/package.json").unwrap(), + }, + }, + ], + }), + ); + client.change_configuration(json!({ + "deno": { + "disablePaths": ["non_workspace1"], + }, + })); + let res = client + .read_notification_with_method::( + "deno/didRefreshDenoConfigurationTree", + ) + .unwrap(); + assert_eq!( + res, + json!({ + "data": [ + { + "scopeUri": temp_dir.url().join("non_workspace2/").unwrap(), + "workspaceRootScopeUri": null, + "denoJson": { + "uri": temp_dir.url().join("non_workspace2/deno.json").unwrap(), + }, + "packageJson": null, + }, + { + "scopeUri": temp_dir.url().join("workspace/").unwrap(), + "workspaceRootScopeUri": null, + "denoJson": { + "uri": temp_dir.url().join("workspace/deno.json").unwrap(), + }, + "packageJson": null, + }, + { + "scopeUri": temp_dir.url().join("workspace/member1/").unwrap(), + "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), + "denoJson": { + "uri": temp_dir.url().join("workspace/member1/deno.json").unwrap(), + }, + "packageJson": { + "uri": temp_dir.url().join("workspace/member1/package.json").unwrap(), + }, + }, + { + "scopeUri": temp_dir.url().join("workspace/member2/").unwrap(), + "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), + "denoJson": null, + "packageJson": { + "uri": temp_dir.url().join("workspace/member2/package.json").unwrap(), + }, + }, + ], + }), + ); + client.shutdown(); +} + #[test] fn lsp_did_change_deno_configuration_notification() { let context = TestContextBuilder::new().use_temp_cwd().build(); @@ -9403,14 +9588,15 @@ fn lsp_auto_discover_registry() { "triggerCharacter": "@" }), ); - let (method, res) = client.read_notification(); - assert_eq!(method, "deno/registryState"); + let res = client + .read_notification_with_method::("deno/registryState") + .unwrap(); assert_eq!( res, - Some(json!({ + json!({ "origin": "http://localhost:4545", "suggestions": true, - })) + }), ); client.shutdown(); } @@ -10117,7 +10303,6 @@ fn lsp_diagnostics_refresh_dependents() { assert_eq!(json!(diagnostics.all()), json!([])); // no diagnostics now client.shutdown(); - assert_eq!(client.queue_len(), 0); } // Regression test for https://github.com/denoland/deno/issues/10897. -- cgit v1.2.3 From 458d6278d2835896018086da773fd72b7af8ed66 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Wed, 16 Oct 2024 17:42:15 -0700 Subject: fix(node/http): normalize header names in `ServerResponse` (#26339) Fixes https://github.com/denoland/deno/issues/26115. We weren't normalizing the headers to lower case, so code that attempted to delete the `Content-Length` header (but used a different case) wasn't actually removing the header. --- tests/unit_node/http_test.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests') diff --git a/tests/unit_node/http_test.ts b/tests/unit_node/http_test.ts index f1ff77bb3..0faf7fb34 100644 --- a/tests/unit_node/http_test.ts +++ b/tests/unit_node/http_test.ts @@ -1147,6 +1147,34 @@ Deno.test("[node/http] ServerResponse appendHeader set-cookie", async () => { await promise; }); +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"); + res.removeHeader("content-length"); + assertEquals(res.getHeader("Content-Length"), undefined); + assert(!res.hasHeader("Content-Length")); + res.appendHeader("content-length", "12345"); + res.removeHeader("Content-Length"); + assertEquals(res.getHeader("content-length"), undefined); + assert(!res.hasHeader("content-length")); + res.end("Hello World"); + }); + + server.listen(async () => { + const { port } = server.address() as { port: number }; + const res = await fetch(`http://localhost:${port}`); + assertEquals(res.headers.get("Content-Length"), null); + assertEquals(res.headers.get("content-length"), null); + assertEquals(await res.text(), "Hello World"); + server.close(() => { + resolve(); + }); + }); + + await promise; +}); + Deno.test("[node/http] IncomingMessage override", () => { const req = new http.IncomingMessage(new net.Socket()); // https://github.com/dougmoscrop/serverless-http/blob/3aaa6d0fe241109a8752efb011c242d249f32368/lib/request.js#L20-L30 -- cgit v1.2.3 From 167f674c7cbb9632000c1feb0b747ba098b01c12 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Wed, 16 Oct 2024 19:58:11 -0700 Subject: fix: don't warn on ignored signals on windows (#26332) Closes #26183. The warnings are super noisy and not actionable for the user --- tests/unit_node/process_test.ts | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'tests') diff --git a/tests/unit_node/process_test.ts b/tests/unit_node/process_test.ts index 9506fb609..f9138c8f0 100644 --- a/tests/unit_node/process_test.ts +++ b/tests/unit_node/process_test.ts @@ -25,7 +25,6 @@ import { assertThrows, fail, } from "@std/assert"; -import { assertSpyCall, assertSpyCalls, spy } from "@std/testing/mock"; import { stripAnsiCode } from "@std/fmt/colors"; import * as path from "@std/path"; import { delay } from "@std/async/delay"; @@ -239,33 +238,6 @@ Deno.test({ }, }); -Deno.test({ - name: "process.on - ignored signals on windows", - ignore: Deno.build.os !== "windows", - fn() { - const ignoredSignals = ["SIGHUP", "SIGUSR1", "SIGUSR2"]; - - for (const signal of ignoredSignals) { - using consoleSpy = spy(console, "warn"); - const handler = () => {}; - process.on(signal, handler); - process.off(signal, handler); - assertSpyCall(consoleSpy, 0, { - args: [`Ignoring signal "${signal}" on Windows`], - }); - } - - { - using consoleSpy = spy(console, "warn"); - const handler = () => {}; - process.on("SIGTERM", handler); - process.off("SIGTERM", handler); - // No warning is made for SIGTERM - assertSpyCalls(consoleSpy, 0); - } - }, -}); - Deno.test( { permissions: { run: true, read: true } }, async function processKill() { -- cgit v1.2.3 From 56895858885297537204a16dd463f28b73d25551 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Thu, 17 Oct 2024 18:44:51 +0800 Subject: fix(cli): set napi object property properly (#26344) --- tests/napi/object_test.js | 25 ++++++++++++++++++++++++- tests/napi/src/object.rs | 29 +++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/napi/object_test.js b/tests/napi/object_test.js index 4bc5c3c9c..6226b0138 100644 --- a/tests/napi/object_test.js +++ b/tests/napi/object_test.js @@ -1,6 +1,11 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assert, assertEquals, loadTestLibrary } from "./common.js"; +import { + assert, + assertEquals, + assertThrows, + loadTestLibrary, +} from "./common.js"; const object = loadTestLibrary(); @@ -12,4 +17,22 @@ Deno.test("napi object", function () { const r1 = object.test_object_get(r); assert(r === r1); + + const r2 = object.test_object_attr_property(r); + assert(r === r2); + assertThrows( + () => { + r2.self = "2"; + }, + Error, + "Cannot assign to read only property 'self' of object '#'", + ); + + assertThrows( + () => { + r2.method = () => {}; + }, + Error, + "Cannot assign to read only property 'method' of object '#'", + ); }); diff --git a/tests/napi/src/object.rs b/tests/napi/src/object.rs index aa34133dc..9876f4dae 100644 --- a/tests/napi/src/object.rs +++ b/tests/napi/src/object.rs @@ -40,10 +40,39 @@ extern "C" fn test_object_get( obj } +extern "C" fn test_object_attr_property( + env: napi_env, + info: napi_callback_info, +) -> napi_value { + let (args, argc, _) = napi_get_callback_info!(env, info, 1); + assert_eq!(argc, 1); + + let obj = args[0]; + let mut property = napi_new_property!(env, "self", test_object_new); + property.attributes = PropertyAttributes::enumerable; + property.method = None; + property.value = obj; + let mut method_property = napi_new_property!(env, "method", test_object_new); + method_property.attributes = PropertyAttributes::enumerable; + let properties = &[property, method_property]; + assert_napi_ok!(napi_define_properties( + env, + obj, + properties.len(), + properties.as_ptr() + )); + obj +} + pub fn init(env: napi_env, exports: napi_value) { let properties = &[ napi_new_property!(env, "test_object_new", test_object_new), napi_new_property!(env, "test_object_get", test_object_get), + napi_new_property!( + env, + "test_object_attr_property", + test_object_attr_property + ), ]; assert_napi_ok!(napi_define_properties( -- cgit v1.2.3 From 9fde5cb5e045551fe344b3f60370744eea30ccb4 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Thu, 17 Oct 2024 12:51:15 -0700 Subject: fix(node/fs): copyFile with `COPYFILE_EXCL` should not throw if the destination doesn't exist (#26360) Fixes #26313. We were checking for the NotFound error, but still calling the callback with the error / throwing. --- tests/unit_node/fs_test.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/unit_node/fs_test.ts b/tests/unit_node/fs_test.ts index 2d1465aec..17da45dcf 100644 --- a/tests/unit_node/fs_test.ts +++ b/tests/unit_node/fs_test.ts @@ -1,11 +1,13 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assert, assertEquals, assertThrows } from "@std/assert"; +/// +import { assert, assertEquals, assertRejects, assertThrows } from "@std/assert"; import { join } from "node:path"; import { tmpdir } from "node:os"; import { closeSync, constants, + copyFileSync, createWriteStream, existsSync, lstatSync, @@ -20,6 +22,7 @@ import { } from "node:fs"; import { constants as fsPromiseConstants, + copyFile, cp, FileHandle, open, @@ -212,3 +215,19 @@ Deno.test("[node/fs] readSync works", () => { assertEquals(bytesRead, 12); closeSync(fd!); }); + +Deno.test("[node/fs] copyFile COPYFILE_EXCL works", async () => { + const dir = mkdtempSync(join(tmpdir(), "foo-")); + const src = join(dir, "src.txt"); + const dest = join(dir, "dest.txt"); + await writeFile(src, ""); + await copyFile(src, dest, fsPromiseConstants.COPYFILE_EXCL); + assert(existsSync(dest)); + assertRejects(() => copyFile(src, dest, fsPromiseConstants.COPYFILE_EXCL)); + const dest2 = join(dir, "dest2.txt"); + copyFileSync(src, dest2, fsPromiseConstants.COPYFILE_EXCL); + assert(existsSync(dest2)); + assertThrows(() => + copyFileSync(src, dest2, fsPromiseConstants.COPYFILE_EXCL) + ); +}); -- cgit v1.2.3 From 2435a361c64fc9bac4aee7b268b4c0a42eee4471 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:19:37 -0700 Subject: chore: fix flaky COPYFILE_EXCL test (#26370) It was missing an await --- tests/unit_node/fs_test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/unit_node/fs_test.ts b/tests/unit_node/fs_test.ts index 17da45dcf..ac9c4a53e 100644 --- a/tests/unit_node/fs_test.ts +++ b/tests/unit_node/fs_test.ts @@ -223,7 +223,9 @@ Deno.test("[node/fs] copyFile COPYFILE_EXCL works", async () => { await writeFile(src, ""); await copyFile(src, dest, fsPromiseConstants.COPYFILE_EXCL); assert(existsSync(dest)); - assertRejects(() => copyFile(src, dest, fsPromiseConstants.COPYFILE_EXCL)); + await assertRejects(() => + copyFile(src, dest, fsPromiseConstants.COPYFILE_EXCL) + ); const dest2 = join(dir, "dest2.txt"); copyFileSync(src, dest2, fsPromiseConstants.COPYFILE_EXCL); assert(existsSync(dest2)); -- cgit v1.2.3 From 50724d014ad6923e228e488648d40ce6f00297e9 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:25:22 -0700 Subject: fix(install): don't attempt to cache specifiers that point to directories (#26369) Fixes https://github.com/denoland/deno/issues/26162 --- tests/specs/install/import_map_with_dir/__test__.jsonc | 9 +++++++++ tests/specs/install/import_map_with_dir/deno.json | 5 +++++ 2 files changed, 14 insertions(+) create mode 100644 tests/specs/install/import_map_with_dir/__test__.jsonc create mode 100644 tests/specs/install/import_map_with_dir/deno.json (limited to 'tests') diff --git a/tests/specs/install/import_map_with_dir/__test__.jsonc b/tests/specs/install/import_map_with_dir/__test__.jsonc new file mode 100644 index 000000000..cbbc7cc2e --- /dev/null +++ b/tests/specs/install/import_map_with_dir/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "tempDir": true, + "steps": [ + { + "args": "install", + "output": "" + } + ] +} diff --git a/tests/specs/install/import_map_with_dir/deno.json b/tests/specs/install/import_map_with_dir/deno.json new file mode 100644 index 000000000..5c3224b07 --- /dev/null +++ b/tests/specs/install/import_map_with_dir/deno.json @@ -0,0 +1,5 @@ +{ + "imports": { + "@assets": "./src/assets/" + } +} -- cgit v1.2.3 From 4b99cde504854baabdcf912f2fce3a7448119653 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Fri, 18 Oct 2024 20:38:57 +0200 Subject: fix(npm): ensure scoped package name is encoded in URLs (#26390) Fixes https://github.com/denoland/deno/issues/26385 --- tests/integration/compile_tests.rs | 2 +- tests/integration/npm_tests.rs | 36 +++++++++++----------- tests/integration/run_tests.rs | 2 +- tests/specs/add/dev/add.out | 2 +- tests/specs/add/exact_version/npm_add.out | 2 +- tests/specs/add/only_unstable_versions/add.out | 2 +- tests/specs/add/package_json_and_deno_json/add.out | 4 +-- .../package_json_and_deno_json/add_esm_basic.out | 2 +- tests/specs/bench/package_json/install.out | 2 +- tests/specs/cache/package_json/main.cache.out | 2 +- tests/specs/check/cjs_default_export/main.out | 2 +- tests/specs/check/package_json/install.out | 2 +- .../check/package_json_auto_install/check.out | 2 +- .../check/package_json_fail_check/install.out | 2 +- .../check/package_json_with_deno_json/install.out | 2 +- tests/specs/compile/npmrc_byonm/install.out | 4 +-- tests/specs/info/package_json_basic/install.out | 2 +- .../install/future_install_global/install.out | 2 +- .../future_install_local_add_deno/install.out | 2 +- .../future_install_local_add_npm/install.out | 2 +- .../install/future_install_local_deno/install.out | 2 +- .../future_install_node_modules/install.out | 2 +- .../install/install_add_dep_existing/install.out | 2 +- tests/specs/install/install_add_dev/install.out | 2 +- .../install/install_add_dev_existing/install.out | 2 +- .../install/install_deprecated_package/install.out | 2 +- tests/specs/install/install_entrypoint/install.out | 2 +- .../specs/install/install_entrypoint/lifecycle.out | 4 +-- .../install/non_existent_optional_peer/install.out | 2 +- .../workspace_member_with_tag_dep/install.out | 2 +- .../frozen_lockfile/frozen_new_dep_dynamic_npm.out | 2 +- .../frozen_lockfile/frozen_new_dep_run.out | 2 +- .../frozen_package_json_changed.out | 2 +- .../lockfile/frozen_lockfile/no_lockfile_run.out | 2 +- tests/specs/lockfile/only_package_json/install.out | 2 +- .../main.out | 2 +- .../npm/adding_npm_dep_in_dynamic_import/main.out | 4 +-- .../npm/bin_entries_prefer_closer/install.out | 4 +-- .../specs/npm/check_all/check_errors/main_all.out | 2 +- .../npm/check_all/check_errors/main_local.out | 2 +- .../npm/check_local/check_errors/main_all.out | 2 +- .../npm/check_local/check_errors/main_local.out | 2 +- .../file_dts_dmts_dcts/main.out | 2 +- tests/specs/npm/check_pkg_json_import/main.out | 2 +- tests/specs/npm/cjs_import_dual/check.out | 4 +-- tests/specs/npm/cjs_import_dual/run.out | 4 +-- .../cjs_local_global_decls/main.out | 2 +- .../npm/cjs_pkg_imports/cjs_pkg_imports/main.out | 2 +- .../npm/compare_globals/compare_globals/main.out | 4 +-- tests/specs/npm/conditional_exports/main.out | 4 +-- .../conditional_exports_node_modules_dir/main.out | 4 +-- .../directory_import/folder_index_js.out | 2 +- .../directory_import/folder_no_index.out | 2 +- .../directory_import/folder_index_js.out | 2 +- .../directory_import/folder_no_index.out | 2 +- .../npm/dynamic_npm_resolution_failure/main.out | 2 +- tests/specs/npm/esm_import_cjs_default/main.out | 4 +-- tests/specs/npm/import_map/import_map/main.out | 2 +- .../imports_package_json/import_not_defined.out | 2 +- .../imports_package_json/main.out | 2 +- .../sub_path_import_not_defined.out | 2 +- .../imports_package_json/import_not_defined.out | 2 +- .../imports_package_json/main.out | 2 +- .../sub_path_import_not_defined.out | 2 +- .../imports_package_json/import_not_defined.out | 2 +- .../imports_package_json/main.out | 2 +- .../sub_path_import_not_defined.out | 2 +- .../peer_deps_with_copied_folders/main.out | 6 ++-- .../main_node_modules_reload.out | 6 ++-- .../peer_deps_with_copied_folders/main.out | 6 ++-- .../main_node_modules_reload.out | 6 ++-- .../lifecycle_scripts/all_lifecycles_not_run.out | 4 +-- .../all_lifecycles_not_run_global.out | 4 +-- .../npm/lifecycle_scripts/conflicting_bin.out | 6 ++-- .../future_install_all_lifecycles_not_run.out | 4 +-- tests/specs/npm/lifecycle_scripts/no_deno_json.out | 4 +-- .../npm/lifecycle_scripts/node_gyp_not_found.out | 2 +- .../npm/lifecycle_scripts/node_gyp_not_run.out | 2 +- .../npm/lifecycle_scripts/only_warns_first1.out | 4 +-- tests/specs/npm/lossy_utf8_module/main.out | 2 +- tests/specs/npm/lossy_utf8_package_json/main.out | 2 +- tests/specs/npm/lossy_utf8_script/main.out | 2 +- .../specs/npm/lossy_utf8_script_from_cjs/main.out | 2 +- .../mixed_case_package_name/global.out | 4 +-- .../mixed_case_package_name/local.out | 4 +-- .../mixed_case_package_name/global.out | 4 +-- .../mixed_case_package_name/local.out | 4 +-- tests/specs/npm/no_types_cjs/main.out | 2 +- .../npm/no_types_in_conditional_exports/main.out | 2 +- tests/specs/npm/node_modules_import/install.out | 2 +- tests/specs/npm/node_modules_import_auto/main.out | 2 +- .../npm/node_modules_import_auto/main_check.out | 2 +- tests/specs/npm/non_existent_dep/__test__.jsonc | 2 +- .../npm/non_existent_dep_version/__test__.jsonc | 2 +- tests/specs/npm/npmrc/info.out | 4 +-- tests/specs/npm/npmrc/install.out | 4 +-- tests/specs/npm/npmrc_bad_registry_config/main.out | 4 +-- tests/specs/npm/npmrc_bad_token/main.out | 4 +-- tests/specs/npm/npmrc_basic_auth/install.out | 4 +-- tests/specs/npm/npmrc_deno_json/main.out | 2 +- tests/specs/npm/npmrc_homedir/install.out | 4 +-- .../npm/npmrc_not_next_to_package_json/main.out | 2 +- .../npm/npmrc_password_no_username/install.out | 2 +- .../npm/npmrc_tarball_other_server/fail/main.out | 2 +- .../npmrc_tarball_other_server/success/main.out | 2 +- .../npm/npmrc_username_no_password/install.out | 2 +- .../specs/npm/npmrc_username_password/install.out | 4 +-- .../permissions_outside_package/main.out | 2 +- .../main.out | 4 +-- .../reserved_word_exports/main.out | 2 +- .../run_existing_npm_package_with_subpath/main.out | 2 +- tests/specs/npm/types_d_ext/d_ext/main.out | 2 +- .../types_entry_value_not_exists/main.out | 2 +- .../types_exports_import_types/main.out | 2 +- tests/specs/npm/types_general/main.out | 6 ++-- .../types_no_types_entry/main.out | 4 +-- .../typescript_file_in_package/main.out | 2 +- .../npm/workspace_basic/b/main_global_cache.out | 2 +- .../workspace_basic/b/main_node_modules_dir.out | 2 +- tests/specs/npm/workspace_basic/main.out | 2 +- .../bare_node_builtins/bare_node_builtins.out | 2 +- tests/specs/publish/missing_constraint/publish.out | 2 +- .../publish/node_specifier/node_specifier.out | 2 +- tests/specs/remove/package_json/rm_add.out | 2 +- tests/specs/run/no_deno_json/code/install.out | 4 +-- .../run/package_json/invalid_value/error_auto.out | 2 +- .../specs/run/package_json/invalid_value/task.out | 2 +- tests/specs/task/bin_package/task.out | 2 +- .../task/bin_pkg_with_scope_auto/bin_auto.out | 2 +- .../task/bin_pkg_with_scope_auto/bin_none.out | 2 +- .../task/bin_pkg_with_scope_none/bin_none.out | 2 +- .../task/both_package_json_selected/install.out | 2 +- .../package_json_node_modules_dir_none/bin.out | 2 +- tests/specs/test/package_json_basic/install.out | 2 +- .../test/package_json_basic_auto_install/test.out | 2 +- .../main_compile_folder.out | 2 +- .../npm/peer_deps_with_copied_folders/main.out | 6 ++-- .../main_node_modules_reload.out | 6 ++-- .../testdata/npm/run_existing_npm_package/main.out | 2 +- 139 files changed, 202 insertions(+), 202 deletions(-) (limited to 'tests') diff --git a/tests/integration/compile_tests.rs b/tests/integration/compile_tests.rs index a8ea5b038..fa6364a13 100644 --- a/tests/integration/compile_tests.rs +++ b/tests/integration/compile_tests.rs @@ -1111,7 +1111,7 @@ console.log(getValue());"#, .run(); output.assert_exit_code(0); output.assert_matches_text( - r#"Download http://localhost:4260/@denotest/esm-basic + r#"Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 Check file:///[WILDCARD]/main.ts diff --git a/tests/integration/npm_tests.rs b/tests/integration/npm_tests.rs index f47b1bdd4..f8c6eebf3 100644 --- a/tests/integration/npm_tests.rs +++ b/tests/integration/npm_tests.rs @@ -876,7 +876,7 @@ fn auto_discover_lock_file() { .run(); output .assert_matches_text( -r#"Download http://localhost:4260/@denotest/bin +r#"Download http://localhost:4260/@denotest%2fbin error: Integrity check failed for package: "npm:@denotest/bin@1.0.0". Unable to verify that the package is the same as when the lockfile was generated. @@ -1058,10 +1058,10 @@ fn reload_info_not_found_cache_but_exists_remote() { .run(); output.assert_matches_text(concat!( "[UNORDERED_START]\n", - "Download http://localhost:4260/@denotest/esm-basic\n", - "Download http://localhost:4260/@denotest/esm-import-cjs-default\n", - "Download http://localhost:4260/@denotest/cjs-default-export\n", - "Download http://localhost:4260/@denotest/cjs-default-export/1.0.0.tgz\n", + "Download http://localhost:4260/@denotest%2fesm-basic\n", + "Download http://localhost:4260/@denotest%2fesm-import-cjs-default\n", + "Download http://localhost:4260/@denotest%2fcjs-default-export\n", + "Download http://localhost:4260/@denotestcjs-default-export/1.0.0.tgz\n", "Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz\n", "Download http://localhost:4260/@denotest/esm-import-cjs-default/1.0.0.tgz\n", "[UNORDERED_END]\n", @@ -1088,8 +1088,8 @@ fn reload_info_not_found_cache_but_exists_remote() { let output = test_context.new_command().args("run main.ts").run(); output.assert_matches_text(concat!( "[UNORDERED_START]\n", - "Download http://localhost:4260/@denotest/esm-import-cjs-default\n", - "Download http://localhost:4260/@denotest/cjs-default-export\n", + "Download http://localhost:4260/@denotest%2fesm-import-cjs-default\n", + "Download http://localhost:4260/@denotest%2fcjs-default-export\n", "[UNORDERED_END]\n", "Node esm importing node cjs\n[WILDCARD]", )); @@ -1120,8 +1120,8 @@ fn reload_info_not_found_cache_but_exists_remote() { let output = test_context.new_command().args("run main.ts").run(); output.assert_matches_text(concat!( "[UNORDERED_START]\n", - "Download http://localhost:4260/@denotest/esm-import-cjs-default\n", - "Download http://localhost:4260/@denotest/cjs-default-export\n", + "Download http://localhost:4260/@denotest%2fesm-import-cjs-default\n", + "Download http://localhost:4260/@denotest%2fcjs-default-export\n", "[UNORDERED_END]\n", "Node esm importing node cjs\n[WILDCARD]", )); @@ -1159,8 +1159,8 @@ fn reload_info_not_found_cache_but_exists_remote() { let output = test_context.new_command().args("run main.ts").run(); output.assert_matches_text(concat!( "[UNORDERED_START]\n", - "Download http://localhost:4260/@denotest/esm-import-cjs-default\n", - "Download http://localhost:4260/@denotest/cjs-default-export\n", + "Download http://localhost:4260/@denotest%2fesm-import-cjs-default\n", + "Download http://localhost:4260/@denotest%2fcjs-default-export\n", "[UNORDERED_END]\n", "[UNORDERED_START]\n", "Initialize @denotest/cjs-default-export@1.0.0\n", @@ -1196,9 +1196,9 @@ fn reload_info_not_found_cache_but_exists_remote() { let output = test_context.new_command().args("run main.ts").run(); output.assert_matches_text(concat!( "[UNORDERED_START]\n", - "Download http://localhost:4260/@denotest/esm-basic\n", - "Download http://localhost:4260/@denotest/esm-import-cjs-default\n", - "Download http://localhost:4260/@denotest/cjs-default-export\n", + "Download http://localhost:4260/@denotest%2fesm-basic\n", + "Download http://localhost:4260/@denotest%2fesm-import-cjs-default\n", + "Download http://localhost:4260/@denotest%2fcjs-default-export\n", "[UNORDERED_END]\n", "Initialize @denotest/esm-basic@1.0.0\n", "Node esm importing node cjs\n[WILDCARD]", @@ -1237,9 +1237,9 @@ fn reload_info_not_found_cache_but_exists_remote() { let output = test_context.new_command().args("run main.ts").run(); output.assert_matches_text(concat!( "[UNORDERED_START]\n", - "Download http://localhost:4260/@denotest/cjs-default-export\n", - "Download http://localhost:4260/@denotest/esm-basic\n", - "Download http://localhost:4260/@denotest/esm-import-cjs-default\n", + "Download http://localhost:4260/@denotest%2fcjs-default-export\n", + "Download http://localhost:4260/@denotest%2fesm-basic\n", + "Download http://localhost:4260/@denotest%2fesm-import-cjs-default\n", "[UNORDERED_END]\n", "Node esm importing node cjs\n[WILDCARD]", )); @@ -1419,7 +1419,7 @@ fn top_level_install_package_json_explicit_opt_in() { temp_dir.write("main.ts", "console.log(5);"); let output = test_context.new_command().args("cache main.ts").run(); output.assert_matches_text(concat!( - "Download http://localhost:4260/@denotest/esm-basic\n", + "Download http://localhost:4260/@denotest%2fesm-basic\n", "Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz\n", "Initialize @denotest/esm-basic@1.0.0\n", )); diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs index ca24f18f4..db9f79556 100644 --- a/tests/integration/run_tests.rs +++ b/tests/integration/run_tests.rs @@ -898,7 +898,7 @@ fn lock_redirects() { .run() .assert_matches_text(concat!( "Download http://localhost:4545/echo.ts\n", - "Download http://localhost:4260/@denotest/esm-basic\n", + "Download http://localhost:4260/@denotest%2fesm-basic\n", "Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz\n", "Hi, there", )); diff --git a/tests/specs/add/dev/add.out b/tests/specs/add/dev/add.out index 42161f3ae..44bd9cac7 100644 --- a/tests/specs/add/dev/add.out +++ b/tests/specs/add/dev/add.out @@ -1,4 +1,4 @@ Add npm:@denotest/esm-basic@1.0.0 -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/add/exact_version/npm_add.out b/tests/specs/add/exact_version/npm_add.out index 93894a020..2f73e5afb 100644 --- a/tests/specs/add/exact_version/npm_add.out +++ b/tests/specs/add/exact_version/npm_add.out @@ -1,3 +1,3 @@ Add npm:@denotest/esm-basic@1.0.0 -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz diff --git a/tests/specs/add/only_unstable_versions/add.out b/tests/specs/add/only_unstable_versions/add.out index 48462b8be..8bd8d9303 100644 --- a/tests/specs/add/only_unstable_versions/add.out +++ b/tests/specs/add/only_unstable_versions/add.out @@ -1,3 +1,3 @@ Add npm:@denotest/unstable@1.0.0-beta.1 -Download http://localhost:4260/@denotest/unstable +Download http://localhost:4260/@denotest%2funstable Download http://localhost:4260/@denotest/unstable/1.0.0-beta.1.tgz diff --git a/tests/specs/add/package_json_and_deno_json/add.out b/tests/specs/add/package_json_and_deno_json/add.out index 5577a55ac..4ce7bb8ee 100644 --- a/tests/specs/add/package_json_and_deno_json/add.out +++ b/tests/specs/add/package_json_and_deno_json/add.out @@ -2,9 +2,9 @@ Add npm:@denotest/esm-basic@1.0.0 Add jsr:@denotest/add@1.0.0 Add npm:@denotest/say-hello@1.0.0 -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz -Download http://localhost:4260/@denotest/say-hello +Download http://localhost:4260/@denotest%2fsay-hello Download http://localhost:4260/@denotest/say-hello/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 Initialize @denotest/say-hello@1.0.0 diff --git a/tests/specs/add/package_json_and_deno_json/add_esm_basic.out b/tests/specs/add/package_json_and_deno_json/add_esm_basic.out index 42161f3ae..44bd9cac7 100644 --- a/tests/specs/add/package_json_and_deno_json/add_esm_basic.out +++ b/tests/specs/add/package_json_and_deno_json/add_esm_basic.out @@ -1,4 +1,4 @@ Add npm:@denotest/esm-basic@1.0.0 -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/bench/package_json/install.out b/tests/specs/bench/package_json/install.out index b8114c12a..8f03ba640 100644 --- a/tests/specs/bench/package_json/install.out +++ b/tests/specs/bench/package_json/install.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/cache/package_json/main.cache.out b/tests/specs/cache/package_json/main.cache.out index f5a1cd15e..af6bcb03b 100644 --- a/tests/specs/cache/package_json/main.cache.out +++ b/tests/specs/cache/package_json/main.cache.out @@ -1,2 +1,2 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz diff --git a/tests/specs/check/cjs_default_export/main.out b/tests/specs/check/cjs_default_export/main.out index f284593a1..6c5f18b63 100644 --- a/tests/specs/check/cjs_default_export/main.out +++ b/tests/specs/check/cjs_default_export/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/cjs-default-export +Download http://localhost:4260/@denotest%2fcjs-default-export Download http://localhost:4260/@denotest/cjs-default-export/1.0.0.tgz Check file:///[WILDCARD]/main.ts error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. diff --git a/tests/specs/check/package_json/install.out b/tests/specs/check/package_json/install.out index b8114c12a..8f03ba640 100644 --- a/tests/specs/check/package_json/install.out +++ b/tests/specs/check/package_json/install.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/check/package_json_auto_install/check.out b/tests/specs/check/package_json_auto_install/check.out index db9bd198c..6b75c8642 100644 --- a/tests/specs/check/package_json_auto_install/check.out +++ b/tests/specs/check/package_json_auto_install/check.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 Check file://[WILDCARD]/main.ts diff --git a/tests/specs/check/package_json_fail_check/install.out b/tests/specs/check/package_json_fail_check/install.out index b8114c12a..8f03ba640 100644 --- a/tests/specs/check/package_json_fail_check/install.out +++ b/tests/specs/check/package_json_fail_check/install.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/check/package_json_with_deno_json/install.out b/tests/specs/check/package_json_with_deno_json/install.out index b8114c12a..8f03ba640 100644 --- a/tests/specs/check/package_json_with_deno_json/install.out +++ b/tests/specs/check/package_json_with_deno_json/install.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/compile/npmrc_byonm/install.out b/tests/specs/compile/npmrc_byonm/install.out index 30643527e..f2ea78c3f 100644 --- a/tests/specs/compile/npmrc_byonm/install.out +++ b/tests/specs/compile/npmrc_byonm/install.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4261/@denotest/basic -Download http://localhost:4262/@denotest2/basic +Download http://localhost:4261/@denotest%2fbasic +Download http://localhost:4262/@denotest2%2fbasic Download http://localhost:4261/@denotest/basic/1.0.0.tgz Download http://localhost:4262/@denotest2/basic/1.0.0.tgz Initialize @denotest2/basic@1.0.0 diff --git a/tests/specs/info/package_json_basic/install.out b/tests/specs/info/package_json_basic/install.out index b8114c12a..8f03ba640 100644 --- a/tests/specs/info/package_json_basic/install.out +++ b/tests/specs/info/package_json_basic/install.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/install/future_install_global/install.out b/tests/specs/install/future_install_global/install.out index 58cd88ada..0fa1b9719 100644 --- a/tests/specs/install/future_install_global/install.out +++ b/tests/specs/install/future_install_global/install.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz ✅ Successfully installed deno-test-bin[WILDCARD] [WILDCARD] diff --git a/tests/specs/install/future_install_local_add_deno/install.out b/tests/specs/install/future_install_local_add_deno/install.out index 93894a020..2f73e5afb 100644 --- a/tests/specs/install/future_install_local_add_deno/install.out +++ b/tests/specs/install/future_install_local_add_deno/install.out @@ -1,3 +1,3 @@ Add npm:@denotest/esm-basic@1.0.0 -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz diff --git a/tests/specs/install/future_install_local_add_npm/install.out b/tests/specs/install/future_install_local_add_npm/install.out index 42161f3ae..44bd9cac7 100644 --- a/tests/specs/install/future_install_local_add_npm/install.out +++ b/tests/specs/install/future_install_local_add_npm/install.out @@ -1,4 +1,4 @@ Add npm:@denotest/esm-basic@1.0.0 -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/install/future_install_local_deno/install.out b/tests/specs/install/future_install_local_deno/install.out index 15263a37b..d0972f69e 100644 --- a/tests/specs/install/future_install_local_deno/install.out +++ b/tests/specs/install/future_install_local_deno/install.out @@ -8,7 +8,7 @@ Download http://localhost:4545/subdir/print_hello.ts Download http://127.0.0.1:4250/@denotest/add/meta.json Download http://127.0.0.1:4250/@denotest/add/1.0.0_meta.json Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Download http://127.0.0.1:4250/@std/testing/1.0.0/bdd.ts Download http://127.0.0.1:4250/@std/testing/1.0.0/types.ts diff --git a/tests/specs/install/future_install_node_modules/install.out b/tests/specs/install/future_install_node_modules/install.out index b8114c12a..8f03ba640 100644 --- a/tests/specs/install/future_install_node_modules/install.out +++ b/tests/specs/install/future_install_node_modules/install.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/install/install_add_dep_existing/install.out b/tests/specs/install/install_add_dep_existing/install.out index 42161f3ae..44bd9cac7 100644 --- a/tests/specs/install/install_add_dep_existing/install.out +++ b/tests/specs/install/install_add_dep_existing/install.out @@ -1,4 +1,4 @@ Add npm:@denotest/esm-basic@1.0.0 -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/install/install_add_dev/install.out b/tests/specs/install/install_add_dev/install.out index 42161f3ae..44bd9cac7 100644 --- a/tests/specs/install/install_add_dev/install.out +++ b/tests/specs/install/install_add_dev/install.out @@ -1,4 +1,4 @@ Add npm:@denotest/esm-basic@1.0.0 -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/install/install_add_dev_existing/install.out b/tests/specs/install/install_add_dev_existing/install.out index 42161f3ae..44bd9cac7 100644 --- a/tests/specs/install/install_add_dev_existing/install.out +++ b/tests/specs/install/install_add_dev_existing/install.out @@ -1,4 +1,4 @@ Add npm:@denotest/esm-basic@1.0.0 -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/install/install_deprecated_package/install.out b/tests/specs/install/install_deprecated_package/install.out index 95c075909..32661d971 100644 --- a/tests/specs/install/install_deprecated_package/install.out +++ b/tests/specs/install/install_deprecated_package/install.out @@ -1,5 +1,5 @@ Add npm:@denotest/deprecated-package@1.0.0 -Download http://localhost:4260/@denotest/deprecated-package +Download http://localhost:4260/@denotest%2fdeprecated-package Download http://localhost:4260/@denotest/deprecated-package/1.0.0.tgz Initialize @denotest/deprecated-package@1.0.0 Warning The following packages are deprecated: diff --git a/tests/specs/install/install_entrypoint/install.out b/tests/specs/install/install_entrypoint/install.out index d702cf45a..da10f3aa0 100644 --- a/tests/specs/install/install_entrypoint/install.out +++ b/tests/specs/install/install_entrypoint/install.out @@ -1,6 +1,6 @@ [UNORDERED_START] Download http://127.0.0.1:4250/@denotest/add/meta.json -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://127.0.0.1:4250/@denotest/add/1.0.0_meta.json Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz diff --git a/tests/specs/install/install_entrypoint/lifecycle.out b/tests/specs/install/install_entrypoint/lifecycle.out index 2fd279875..b302ea334 100644 --- a/tests/specs/install/install_entrypoint/lifecycle.out +++ b/tests/specs/install/install_entrypoint/lifecycle.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/node-lifecycle-scripts -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fnode-lifecycle-scripts +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/node-lifecycle-scripts/1.0.0.tgz Download http://localhost:4260/@denotest/bin/1.0.0.tgz Initialize @denotest/node-lifecycle-scripts@1.0.0 diff --git a/tests/specs/install/non_existent_optional_peer/install.out b/tests/specs/install/non_existent_optional_peer/install.out index 292c1a4e2..694d4b51b 100644 --- a/tests/specs/install/non_existent_optional_peer/install.out +++ b/tests/specs/install/non_existent_optional_peer/install.out @@ -1,5 +1,5 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/non-existent-optional-peer +Download http://localhost:4260/@denotest%2fnon-existent-optional-peer Download http://localhost:4260/uWebSockets.js Download http://localhost:4260/@denotest/non-existent-optional-peer/1.0.0.tgz [UNORDERED_END] diff --git a/tests/specs/install/workspace_member_with_tag_dep/install.out b/tests/specs/install/workspace_member_with_tag_dep/install.out index b8114c12a..8f03ba640 100644 --- a/tests/specs/install/workspace_member_with_tag_dep/install.out +++ b/tests/specs/install/workspace_member_with_tag_dep/install.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_dynamic_npm.out b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_dynamic_npm.out index 4ae4d059c..4fc016c57 100644 --- a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_dynamic_npm.out +++ b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_dynamic_npm.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/subtract +Download http://localhost:4260/@denotest%2fsubtract error: Uncaught (in promise) TypeError: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it. changes: 4 | - "npm:@denotest/add@1": "1.0.0" diff --git a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_run.out b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_run.out index 057b9632b..07b37b925 100644 --- a/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_run.out +++ b/tests/specs/lockfile/frozen_lockfile/frozen_new_dep_run.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/subtract +Download http://localhost:4260/@denotest%2fsubtract error: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it. changes: 4 | - "npm:@denotest/add@1": "1.0.0" diff --git a/tests/specs/lockfile/frozen_lockfile/frozen_package_json_changed.out b/tests/specs/lockfile/frozen_lockfile/frozen_package_json_changed.out index dc31a1a65..626007478 100644 --- a/tests/specs/lockfile/frozen_lockfile/frozen_package_json_changed.out +++ b/tests/specs/lockfile/frozen_lockfile/frozen_package_json_changed.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fbin error: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it. changes: 4 | - "npm:@denotest/add@1": "1.0.0" diff --git a/tests/specs/lockfile/frozen_lockfile/no_lockfile_run.out b/tests/specs/lockfile/frozen_lockfile/no_lockfile_run.out index 27dc66fd2..047bfdb4a 100644 --- a/tests/specs/lockfile/frozen_lockfile/no_lockfile_run.out +++ b/tests/specs/lockfile/frozen_lockfile/no_lockfile_run.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/add +Download http://localhost:4260/@denotest%2fadd error: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it. changes: 1 | - diff --git a/tests/specs/lockfile/only_package_json/install.out b/tests/specs/lockfile/only_package_json/install.out index b8114c12a..8f03ba640 100644 --- a/tests/specs/lockfile/only_package_json/install.out +++ b/tests/specs/lockfile/only_package_json/install.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/node/cjs_reexport_same_specifier_in_sub_folder/main.out b/tests/specs/node/cjs_reexport_same_specifier_in_sub_folder/main.out index 321d995b8..c50f064d7 100644 --- a/tests/specs/node/cjs_reexport_same_specifier_in_sub_folder/main.out +++ b/tests/specs/node/cjs_reexport_same_specifier_in_sub_folder/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/cjs-reexport-same-specifier-in-sub-folder +Download http://localhost:4260/@denotest%2fcjs-reexport-same-specifier-in-sub-folder Download http://localhost:4260/@denotest/cjs-reexport-same-specifier-in-sub-folder/1.0.0.tgz [Module: null prototype] { default: { main: [Getter], sub: [Getter] }, diff --git a/tests/specs/npm/adding_npm_dep_in_dynamic_import/main.out b/tests/specs/npm/adding_npm_dep_in_dynamic_import/main.out index fe612aa3c..44c76f28d 100644 --- a/tests/specs/npm/adding_npm_dep_in_dynamic_import/main.out +++ b/tests/specs/npm/adding_npm_dep_in_dynamic_import/main.out @@ -1,8 +1,8 @@ -Download http://localhost:4260/@denotest/add +Download http://localhost:4260/@denotest%2fadd Download http://localhost:4260/@denotest/add/1.0.0.tgz Initialize @denotest/add@1.0.0 3 -Download http://localhost:4260/@denotest/subtract +Download http://localhost:4260/@denotest%2fsubtract Download http://localhost:4260/@denotest/subtract/1.0.0.tgz Initialize @denotest/subtract@1.0.0 1 diff --git a/tests/specs/npm/bin_entries_prefer_closer/install.out b/tests/specs/npm/bin_entries_prefer_closer/install.out index 1d3a995b8..1c9472f46 100644 --- a/tests/specs/npm/bin_entries_prefer_closer/install.out +++ b/tests/specs/npm/bin_entries_prefer_closer/install.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/transitive-bin -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2ftransitive-bin +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/bin/1.0.0.tgz Download http://localhost:4260/@denotest/transitive-bin/1.0.0.tgz Download http://localhost:4260/@denotest/bin/0.7.0.tgz diff --git a/tests/specs/npm/check_all/check_errors/main_all.out b/tests/specs/npm/check_all/check_errors/main_all.out index 4c624c0ea..c7797e43d 100644 --- a/tests/specs/npm/check_all/check_errors/main_all.out +++ b/tests/specs/npm/check_all/check_errors/main_all.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/check-error +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. diff --git a/tests/specs/npm/check_all/check_errors/main_local.out b/tests/specs/npm/check_all/check_errors/main_local.out index 4d3a892e7..ac58a29c7 100644 --- a/tests/specs/npm/check_all/check_errors/main_local.out +++ b/tests/specs/npm/check_all/check_errors/main_local.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/check-error +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")'. diff --git a/tests/specs/npm/check_local/check_errors/main_all.out b/tests/specs/npm/check_local/check_errors/main_all.out index 4c624c0ea..c7797e43d 100644 --- a/tests/specs/npm/check_local/check_errors/main_all.out +++ b/tests/specs/npm/check_local/check_errors/main_all.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/check-error +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. diff --git a/tests/specs/npm/check_local/check_errors/main_local.out b/tests/specs/npm/check_local/check_errors/main_local.out index 1a150b5e6..1eb8eef9f 100644 --- a/tests/specs/npm/check_local/check_errors/main_local.out +++ b/tests/specs/npm/check_local/check_errors/main_local.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/check-error +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")'. diff --git a/tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out b/tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out index 507d2c2f7..6ab72f53b 100644 --- a/tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out +++ b/tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/file-dts-dmts-dcts +Download http://localhost:4260/@denotest%2ffile-dts-dmts-dcts Download http://localhost:4260/@denotest/file-dts-dmts-dcts/1.0.0.tgz Check file:///[WILDCARD]/main.ts error: TS2322 [ERROR]: Type '5' is not assignable to type '"dts"'. diff --git a/tests/specs/npm/check_pkg_json_import/main.out b/tests/specs/npm/check_pkg_json_import/main.out index b60509c9a..11f94272a 100644 --- a/tests/specs/npm/check_pkg_json_import/main.out +++ b/tests/specs/npm/check_pkg_json_import/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/types-pkg-json-import +Download http://localhost:4260/@denotest%2ftypes-pkg-json-import Download http://localhost:4260/@denotest/types-pkg-json-import/1.0.0.tgz Check file:///[WILDLINE]/main.ts diff --git a/tests/specs/npm/cjs_import_dual/check.out b/tests/specs/npm/cjs_import_dual/check.out index be1fe86a6..c2d1daa17 100644 --- a/tests/specs/npm/cjs_import_dual/check.out +++ b/tests/specs/npm/cjs_import_dual/check.out @@ -1,5 +1,5 @@ -Download http://localhost:4260/@denotest/cjs-import-dual -Download http://localhost:4260/@denotest/dual-cjs-esm +Download http://localhost:4260/@denotest%2fcjs-import-dual +Download http://localhost:4260/@denotest%2fdual-cjs-esm Download http://localhost:4260/@denotest/cjs-import-dual/1.0.0.tgz Download http://localhost:4260/@denotest/dual-cjs-esm/1.0.0.tgz Check file:///[WILDLINE]/cjs_import_dual/main.ts diff --git a/tests/specs/npm/cjs_import_dual/run.out b/tests/specs/npm/cjs_import_dual/run.out index 2c05e125e..0307bf250 100644 --- a/tests/specs/npm/cjs_import_dual/run.out +++ b/tests/specs/npm/cjs_import_dual/run.out @@ -1,5 +1,5 @@ -Download http://localhost:4260/@denotest/cjs-import-dual -Download http://localhost:4260/@denotest/dual-cjs-esm +Download http://localhost:4260/@denotest%2fcjs-import-dual +Download http://localhost:4260/@denotest%2fdual-cjs-esm Download http://localhost:4260/@denotest/cjs-import-dual/1.0.0.tgz Download http://localhost:4260/@denotest/dual-cjs-esm/1.0.0.tgz cjs diff --git a/tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.out b/tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.out index 5e7a36c8d..5c48b5b5c 100644 --- a/tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.out +++ b/tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/cjs-local-global-decls +Download http://localhost:4260/@denotest%2fcjs-local-global-decls Download http://localhost:4260/@denotest/cjs-local-global-decls/1.0.0.tgz Loaded. diff --git a/tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.out b/tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.out index 661146bd0..f9390fb1b 100644 --- a/tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.out +++ b/tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/cjs-pkg-imports +Download http://localhost:4260/@denotest%2fcjs-pkg-imports Download http://localhost:4260/@denotest/cjs-pkg-imports/1.0.0.tgz { crypto: Crypto { subtle: SubtleCrypto {} }, number: 5 } diff --git a/tests/specs/npm/compare_globals/compare_globals/main.out b/tests/specs/npm/compare_globals/compare_globals/main.out index a1b0a566d..5be6125b0 100644 --- a/tests/specs/npm/compare_globals/compare_globals/main.out +++ b/tests/specs/npm/compare_globals/compare_globals/main.out @@ -1,7 +1,7 @@ [UNORDERED_START] -Download http://localhost:4260/@types/node +Download http://localhost:4260/@types%2fnode Download http://localhost:4260/undici-types -Download http://localhost:4260/@denotest/globals +Download http://localhost:4260/@denotest%2fglobals [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/globals/1.0.0.tgz diff --git a/tests/specs/npm/conditional_exports/main.out b/tests/specs/npm/conditional_exports/main.out index 8bd31321b..8b5b2715b 100644 --- a/tests/specs/npm/conditional_exports/main.out +++ b/tests/specs/npm/conditional_exports/main.out @@ -1,8 +1,8 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/conditional-exports +Download http://localhost:4260/@denotest%2fconditional-exports Download http://localhost:4260/supports-esm Download http://localhost:4260/has-package-exports -Download http://localhost:4260/@ljharb/has-package-exports-patterns +Download http://localhost:4260/@ljharb%2fhas-package-exports-patterns [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/conditional-exports/1.0.0.tgz diff --git a/tests/specs/npm/conditional_exports_node_modules_dir/main.out b/tests/specs/npm/conditional_exports_node_modules_dir/main.out index 5fbba560d..ee4a64be6 100644 --- a/tests/specs/npm/conditional_exports_node_modules_dir/main.out +++ b/tests/specs/npm/conditional_exports_node_modules_dir/main.out @@ -1,8 +1,8 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/conditional-exports +Download http://localhost:4260/@denotest%2fconditional-exports Download http://localhost:4260/supports-esm Download http://localhost:4260/has-package-exports -Download http://localhost:4260/@ljharb/has-package-exports-patterns +Download http://localhost:4260/@ljharb%2fhas-package-exports-patterns [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/conditional-exports/1.0.0.tgz 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/directory_import/folder_index_js.out index a700b8fdb..c1eb2a480 100644 --- a/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.out +++ b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/sub-folders +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? diff --git a/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.out b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.out index 844419b4c..c19c4bcaa 100644 --- a/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.out +++ b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/sub-folders +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 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 index a700b8fdb..c1eb2a480 100644 --- 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 @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/sub-folders +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? 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 index 844419b4c..c19c4bcaa 100644 --- 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 @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/sub-folders +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 diff --git a/tests/specs/npm/dynamic_npm_resolution_failure/main.out b/tests/specs/npm/dynamic_npm_resolution_failure/main.out index d9eb7182f..8888c4f0a 100644 --- a/tests/specs/npm/dynamic_npm_resolution_failure/main.out +++ b/tests/specs/npm/dynamic_npm_resolution_failure/main.out @@ -1,6 +1,6 @@ [UNORDERED_START] Download http://localhost:4260/chalk -Download http://localhost:4260/@denotest/dep-cannot-parse +Download http://localhost:4260/@denotest%2fdep-cannot-parse [UNORDERED_END] Download http://localhost:4260/chalk/chalk-5.0.1.tgz Hi diff --git a/tests/specs/npm/esm_import_cjs_default/main.out b/tests/specs/npm/esm_import_cjs_default/main.out index ec7962e5a..6528a68d7 100644 --- a/tests/specs/npm/esm_import_cjs_default/main.out +++ b/tests/specs/npm/esm_import_cjs_default/main.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/esm-import-cjs-default -Download http://localhost:4260/@denotest/cjs-default-export +Download http://localhost:4260/@denotest%2fesm-import-cjs-default +Download http://localhost:4260/@denotest%2fcjs-default-export Download http://localhost:4260/@denotest/cjs-default-export/1.0.0.tgz Download http://localhost:4260/@denotest/esm-import-cjs-default/1.0.0.tgz [UNORDERED_END] diff --git a/tests/specs/npm/import_map/import_map/main.out b/tests/specs/npm/import_map/import_map/main.out index 05f313d4e..2698fb695 100644 --- a/tests/specs/npm/import_map/import_map/main.out +++ b/tests/specs/npm/import_map/import_map/main.out @@ -1,6 +1,6 @@ [UNORDERED_START] Download http://localhost:4260/chalk -Download http://localhost:4260/@denotest/dual-cjs-esm +Download http://localhost:4260/@denotest%2fdual-cjs-esm [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/dual-cjs-esm/1.0.0.tgz diff --git a/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.out b/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.out index 70d1145a3..abfa41403 100644 --- a/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.out +++ b/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/imports-package-json +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/imports_package_json/main.out b/tests/specs/npm/imports_package_json/imports_package_json/main.out index 979e35576..70d787b25 100644 --- a/tests/specs/npm/imports_package_json/imports_package_json/main.out +++ b/tests/specs/npm/imports_package_json/imports_package_json/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest%2fimports-package-json Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz hi bye 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/imports_package_json/sub_path_import_not_defined.out index 7c803f2bf..95524202a 100644 --- a/tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.out +++ b/tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/imports-package-json +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_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 index 70d1145a3..abfa41403 100644 --- 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 @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/imports-package-json +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.out b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.out index 979e35576..70d787b25 100644 --- 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 @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest%2fimports-package-json Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz hi bye 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 index 7c803f2bf..95524202a 100644 --- 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 @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/imports-package-json +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/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 index 70d1145a3..abfa41403 100644 --- 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 @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/imports-package-json +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.out b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out index 979e35576..70d787b25 100644 --- 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 @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest%2fimports-package-json Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz hi bye 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 index 7c803f2bf..95524202a 100644 --- 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 @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/imports-package-json +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_peer_deps/peer_deps_with_copied_folders/main.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.out index 3c133bcde..b7a583557 100644 --- 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 @@ -1,7 +1,7 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child -Download http://localhost:4260/@denotest/peer-dep-test-grandchild -Download http://localhost:4260/@denotest/peer-dep-test-peer +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 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 index 9c8145211..18d7f7865 100644 --- 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 @@ -1,7 +1,7 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child -Download http://localhost:4260/@denotest/peer-dep-test-grandchild -Download http://localhost:4260/@denotest/peer-dep-test-peer +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 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 index 3c133bcde..b7a583557 100644 --- 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 @@ -1,7 +1,7 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child -Download http://localhost:4260/@denotest/peer-dep-test-grandchild -Download http://localhost:4260/@denotest/peer-dep-test-peer +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 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 index 9c8145211..18d7f7865 100644 --- 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 @@ -1,7 +1,7 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child -Download http://localhost:4260/@denotest/peer-dep-test-grandchild -Download http://localhost:4260/@denotest/peer-dep-test-peer +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 diff --git a/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run.out b/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run.out index cdfdeabe2..645556b26 100644 --- a/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run.out +++ b/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/node-lifecycle-scripts -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fnode-lifecycle-scripts +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/node-lifecycle-scripts/1.0.0.tgz Download http://localhost:4260/@denotest/bin/1.0.0.tgz Initialize @denotest/node-lifecycle-scripts@1.0.0 diff --git a/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run_global.out b/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run_global.out index 93b5a14cc..1b06bccb8 100644 --- a/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run_global.out +++ b/tests/specs/npm/lifecycle_scripts/all_lifecycles_not_run_global.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/node-lifecycle-scripts -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fnode-lifecycle-scripts +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/node-lifecycle-scripts/1.0.0.tgz Download http://localhost:4260/@denotest/bin/1.0.0.tgz [UNORDERED_END] diff --git a/tests/specs/npm/lifecycle_scripts/conflicting_bin.out b/tests/specs/npm/lifecycle_scripts/conflicting_bin.out index bae5275dc..33282ee81 100644 --- a/tests/specs/npm/lifecycle_scripts/conflicting_bin.out +++ b/tests/specs/npm/lifecycle_scripts/conflicting_bin.out @@ -1,7 +1,7 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/better-say-hello -Download http://localhost:4260/@denotest/say-hello-on-install -Download http://localhost:4260/@denotest/say-hello +Download http://localhost:4260/@denotest%2fbetter-say-hello +Download http://localhost:4260/@denotest%2fsay-hello-on-install +Download http://localhost:4260/@denotest%2fsay-hello Download http://localhost:4260/@denotest/better-say-hello/1.0.0.tgz Download http://localhost:4260/@denotest/say-hello-on-install/1.0.0.tgz Download http://localhost:4260/@denotest/say-hello/1.0.0.tgz diff --git a/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles_not_run.out b/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles_not_run.out index 09324c845..d72f3c8b2 100644 --- a/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles_not_run.out +++ b/tests/specs/npm/lifecycle_scripts/future_install_all_lifecycles_not_run.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/node-lifecycle-scripts -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fnode-lifecycle-scripts +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/node-lifecycle-scripts/1.0.0.tgz Download http://localhost:4260/@denotest/bin/1.0.0.tgz Initialize @denotest/node-lifecycle-scripts@1.0.0 diff --git a/tests/specs/npm/lifecycle_scripts/no_deno_json.out b/tests/specs/npm/lifecycle_scripts/no_deno_json.out index 8509d8f9f..1966396a3 100644 --- a/tests/specs/npm/lifecycle_scripts/no_deno_json.out +++ b/tests/specs/npm/lifecycle_scripts/no_deno_json.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/lifecycle-scripts-cjs -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2flifecycle-scripts-cjs +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/lifecycle-scripts-cjs/1.0.0.tgz Download http://localhost:4260/@denotest/bin/1.0.0.tgz Initialize @denotest/lifecycle-scripts-cjs@1.0.0 diff --git a/tests/specs/npm/lifecycle_scripts/node_gyp_not_found.out b/tests/specs/npm/lifecycle_scripts/node_gyp_not_found.out index 81577e6ba..339384f73 100644 --- a/tests/specs/npm/lifecycle_scripts/node_gyp_not_found.out +++ b/tests/specs/npm/lifecycle_scripts/node_gyp_not_found.out @@ -1,5 +1,5 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/node-addon-implicit-node-gyp +Download http://localhost:4260/@denotest%2fnode-addon-implicit-node-gyp Download http://localhost:4260/@denotest/node-addon-implicit-node-gyp/1.0.0.tgz Initialize @denotest/node-addon-implicit-node-gyp@1.0.0 Initialize @denotest/node-addon-implicit-node-gyp@1.0.0: running 'install' script diff --git a/tests/specs/npm/lifecycle_scripts/node_gyp_not_run.out b/tests/specs/npm/lifecycle_scripts/node_gyp_not_run.out index e0e51b26c..da5bb4f7b 100644 --- a/tests/specs/npm/lifecycle_scripts/node_gyp_not_run.out +++ b/tests/specs/npm/lifecycle_scripts/node_gyp_not_run.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/node-addon +Download http://localhost:4260/@denotest%2fnode-addon Download http://localhost:4260/node-gyp [WILDCARD] Warning The following packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed: diff --git a/tests/specs/npm/lifecycle_scripts/only_warns_first1.out b/tests/specs/npm/lifecycle_scripts/only_warns_first1.out index cdfdeabe2..645556b26 100644 --- a/tests/specs/npm/lifecycle_scripts/only_warns_first1.out +++ b/tests/specs/npm/lifecycle_scripts/only_warns_first1.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/node-lifecycle-scripts -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fnode-lifecycle-scripts +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/node-lifecycle-scripts/1.0.0.tgz Download http://localhost:4260/@denotest/bin/1.0.0.tgz Initialize @denotest/node-lifecycle-scripts@1.0.0 diff --git a/tests/specs/npm/lossy_utf8_module/main.out b/tests/specs/npm/lossy_utf8_module/main.out index 0e96f9ebb..d046d2ec5 100644 --- a/tests/specs/npm/lossy_utf8_module/main.out +++ b/tests/specs/npm/lossy_utf8_module/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/lossy-utf8-module +Download http://localhost:4260/@denotest%2flossy-utf8-module Download http://localhost:4260/@denotest/lossy-utf8-module/1.0.0.tgz ���� diff --git a/tests/specs/npm/lossy_utf8_package_json/main.out b/tests/specs/npm/lossy_utf8_package_json/main.out index 99aa5ab61..69f687039 100644 --- a/tests/specs/npm/lossy_utf8_package_json/main.out +++ b/tests/specs/npm/lossy_utf8_package_json/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/lossy-utf8-package-json +Download http://localhost:4260/@denotest%2flossy-utf8-package-json Download http://localhost:4260/@denotest/lossy-utf8-package-json/1.0.0.tgz hello diff --git a/tests/specs/npm/lossy_utf8_script/main.out b/tests/specs/npm/lossy_utf8_script/main.out index 180ecdf1c..0883392fd 100644 --- a/tests/specs/npm/lossy_utf8_script/main.out +++ b/tests/specs/npm/lossy_utf8_script/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/lossy-utf8-script +Download http://localhost:4260/@denotest%2flossy-utf8-script Download http://localhost:4260/@denotest/lossy-utf8-script/1.0.0.tgz ���� diff --git a/tests/specs/npm/lossy_utf8_script_from_cjs/main.out b/tests/specs/npm/lossy_utf8_script_from_cjs/main.out index 4f062a2ae..635ea5b3a 100644 --- a/tests/specs/npm/lossy_utf8_script_from_cjs/main.out +++ b/tests/specs/npm/lossy_utf8_script_from_cjs/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/lossy-utf8-script +Download http://localhost:4260/@denotest%2flossy-utf8-script Download http://localhost:4260/@denotest/lossy-utf8-script/1.0.0.tgz Initialize @denotest/lossy-utf8-script@1.0.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_dir/mixed_case_package_name/global.out index fdacea385..a1d3a6e2c 100644 --- 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_dir/mixed_case_package_name/global.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/MixedCase -Download http://localhost:4260/@denotest/CAPITALS +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 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_global_dir/mixed_case_package_name/local.out index 6ab989d80..c8c9ed396 100644 --- a/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.out +++ b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/MixedCase -Download http://localhost:4260/@denotest/CAPITALS +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 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 index fdacea385..a1d3a6e2c 100644 --- 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 @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/MixedCase -Download http://localhost:4260/@denotest/CAPITALS +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 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 index 6ab989d80..c8c9ed396 100644 --- 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 @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/MixedCase -Download http://localhost:4260/@denotest/CAPITALS +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 diff --git a/tests/specs/npm/no_types_cjs/main.out b/tests/specs/npm/no_types_cjs/main.out index 4747a9a32..c993d5fbf 100644 --- a/tests/specs/npm/no_types_cjs/main.out +++ b/tests/specs/npm/no_types_cjs/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/no-types-cjs +Download http://localhost:4260/@denotest%2fno-types-cjs Download http://localhost:4260/@denotest/no-types-cjs/1.0.0.tgz Check file:///[WILDLINE]/no_types_cjs/main.ts diff --git a/tests/specs/npm/no_types_in_conditional_exports/main.out b/tests/specs/npm/no_types_in_conditional_exports/main.out index 46c583234..593cb2337 100644 --- a/tests/specs/npm/no_types_in_conditional_exports/main.out +++ b/tests/specs/npm/no_types_in_conditional_exports/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/no-types-in-conditional-exports +Download http://localhost:4260/@denotest%2fno-types-in-conditional-exports Download http://localhost:4260/@denotest/no-types-in-conditional-exports/1.0.0.tgz Check [WILDCARD]npm/no_types_in_conditional_exports/main.ts { foo: "bar" } diff --git a/tests/specs/npm/node_modules_import/install.out b/tests/specs/npm/node_modules_import/install.out index b8114c12a..8f03ba640 100644 --- a/tests/specs/npm/node_modules_import/install.out +++ b/tests/specs/npm/node_modules_import/install.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/npm/node_modules_import_auto/main.out b/tests/specs/npm/node_modules_import_auto/main.out index 8fda5cda1..18194e3a0 100644 --- a/tests/specs/npm/node_modules_import_auto/main.out +++ b/tests/specs/npm/node_modules_import_auto/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 2 diff --git a/tests/specs/npm/node_modules_import_auto/main_check.out b/tests/specs/npm/node_modules_import_auto/main_check.out index 24249f357..093b0c051 100644 --- a/tests/specs/npm/node_modules_import_auto/main_check.out +++ b/tests/specs/npm/node_modules_import_auto/main_check.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 Check file:///[WILDCARD]/main.ts diff --git a/tests/specs/npm/non_existent_dep/__test__.jsonc b/tests/specs/npm/non_existent_dep/__test__.jsonc index bc3841419..8608e00f3 100644 --- a/tests/specs/npm/non_existent_dep/__test__.jsonc +++ b/tests/specs/npm/non_existent_dep/__test__.jsonc @@ -1,5 +1,5 @@ { "args": "cache npm:@denotest/non-existent-dep", "exitCode": 1, - "output": "[UNORDERED_START]\nDownload http://localhost:4260/@denotest/non-existent-dep\nDownload http://localhost:4260/@denotest/non-existent\n[UNORDERED_END]\nerror: npm package '@denotest/non-existent' does not exist.\n" + "output": "[UNORDERED_START]\nDownload http://localhost:4260/@denotest%2fnon-existent-dep\nDownload http://localhost:4260/@denotest%2fnon-existent\n[UNORDERED_END]\nerror: npm package '@denotest/non-existent' does not exist.\n" } diff --git a/tests/specs/npm/non_existent_dep_version/__test__.jsonc b/tests/specs/npm/non_existent_dep_version/__test__.jsonc index 4bc084ce3..dd91c6624 100644 --- a/tests/specs/npm/non_existent_dep_version/__test__.jsonc +++ b/tests/specs/npm/non_existent_dep_version/__test__.jsonc @@ -1,5 +1,5 @@ { "args": "cache npm:@denotest/non-existent-dep-version", "exitCode": 1, - "output": "[UNORDERED_START]\nDownload http://localhost:4260/@denotest/non-existent-dep-version\nDownload http://localhost:4260/@denotest/esm-basic\n[UNORDERED_END]\nerror: Could not find npm package '@denotest/esm-basic' matching '=99.99.99'.\n" + "output": "[UNORDERED_START]\nDownload http://localhost:4260/@denotest%2fnon-existent-dep-version\nDownload http://localhost:4260/@denotest%2fesm-basic\n[UNORDERED_END]\nerror: Could not find npm package '@denotest/esm-basic' matching '=99.99.99'.\n" } diff --git a/tests/specs/npm/npmrc/info.out b/tests/specs/npm/npmrc/info.out index 8f82b10c9..ee9aa9ee9 100644 --- a/tests/specs/npm/npmrc/info.out +++ b/tests/specs/npm/npmrc/info.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4262/@denotest2/basic -Download http://localhost:4261/@denotest/basic +Download http://localhost:4262/@denotest2%2fbasic +Download http://localhost:4261/@denotest%2fbasic Download http://localhost:4261/@denotest/basic/1.0.0.tgz Download http://localhost:4262/@denotest2/basic/1.0.0.tgz [UNORDERED_END] diff --git a/tests/specs/npm/npmrc/install.out b/tests/specs/npm/npmrc/install.out index 30643527e..f2ea78c3f 100644 --- a/tests/specs/npm/npmrc/install.out +++ b/tests/specs/npm/npmrc/install.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4261/@denotest/basic -Download http://localhost:4262/@denotest2/basic +Download http://localhost:4261/@denotest%2fbasic +Download http://localhost:4262/@denotest2%2fbasic Download http://localhost:4261/@denotest/basic/1.0.0.tgz Download http://localhost:4262/@denotest2/basic/1.0.0.tgz Initialize @denotest2/basic@1.0.0 diff --git a/tests/specs/npm/npmrc_bad_registry_config/main.out b/tests/specs/npm/npmrc_bad_registry_config/main.out index 990d4a47f..5d778d32e 100644 --- a/tests/specs/npm/npmrc_bad_registry_config/main.out +++ b/tests/specs/npm/npmrc_bad_registry_config/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4261/@denotest/basic -error: Error getting response at http://localhost:4261/@denotest/basic for package "@denotest/basic": Bad response: 401 +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 diff --git a/tests/specs/npm/npmrc_bad_token/main.out b/tests/specs/npm/npmrc_bad_token/main.out index 990d4a47f..5d778d32e 100644 --- a/tests/specs/npm/npmrc_bad_token/main.out +++ b/tests/specs/npm/npmrc_bad_token/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4261/@denotest/basic -error: Error getting response at http://localhost:4261/@denotest/basic for package "@denotest/basic": Bad response: 401 +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 diff --git a/tests/specs/npm/npmrc_basic_auth/install.out b/tests/specs/npm/npmrc_basic_auth/install.out index 30643527e..f2ea78c3f 100644 --- a/tests/specs/npm/npmrc_basic_auth/install.out +++ b/tests/specs/npm/npmrc_basic_auth/install.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4261/@denotest/basic -Download http://localhost:4262/@denotest2/basic +Download http://localhost:4261/@denotest%2fbasic +Download http://localhost:4262/@denotest2%2fbasic Download http://localhost:4261/@denotest/basic/1.0.0.tgz Download http://localhost:4262/@denotest2/basic/1.0.0.tgz Initialize @denotest2/basic@1.0.0 diff --git a/tests/specs/npm/npmrc_deno_json/main.out b/tests/specs/npm/npmrc_deno_json/main.out index 62750088b..c3d6be8a1 100644 --- a/tests/specs/npm/npmrc_deno_json/main.out +++ b/tests/specs/npm/npmrc_deno_json/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4261/@denotest/basic +Download http://localhost:4261/@denotest%2fbasic Download http://localhost:4261/@denotest/basic/1.0.0.tgz 0 42 diff --git a/tests/specs/npm/npmrc_homedir/install.out b/tests/specs/npm/npmrc_homedir/install.out index 30643527e..f2ea78c3f 100644 --- a/tests/specs/npm/npmrc_homedir/install.out +++ b/tests/specs/npm/npmrc_homedir/install.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4261/@denotest/basic -Download http://localhost:4262/@denotest2/basic +Download http://localhost:4261/@denotest%2fbasic +Download http://localhost:4262/@denotest2%2fbasic Download http://localhost:4261/@denotest/basic/1.0.0.tgz Download http://localhost:4262/@denotest2/basic/1.0.0.tgz Initialize @denotest2/basic@1.0.0 diff --git a/tests/specs/npm/npmrc_not_next_to_package_json/main.out b/tests/specs/npm/npmrc_not_next_to_package_json/main.out index b583868ff..b128959a7 100644 --- a/tests/specs/npm/npmrc_not_next_to_package_json/main.out +++ b/tests/specs/npm/npmrc_not_next_to_package_json/main.out @@ -2,7 +2,7 @@ [# that serves the same packages. The important bit is the message below.] [WILDCARD] No .npmrc file found [WILDCARD] -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic [WILDCARD] Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz [WILDCARD] diff --git a/tests/specs/npm/npmrc_password_no_username/install.out b/tests/specs/npm/npmrc_password_no_username/install.out index d49a2ba0d..b198bcd27 100644 --- a/tests/specs/npm/npmrc_password_no_username/install.out +++ b/tests/specs/npm/npmrc_password_no_username/install.out @@ -1,3 +1,3 @@ [UNORDERED_START] -error: Error getting response at http://localhost:4261/@denotest/basic for package "@denotest/basic": Both the username and password must be provided for basic auth +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] diff --git a/tests/specs/npm/npmrc_tarball_other_server/fail/main.out b/tests/specs/npm/npmrc_tarball_other_server/fail/main.out index 08a84a477..2c68dba54 100644 --- a/tests/specs/npm/npmrc_tarball_other_server/fail/main.out +++ b/tests/specs/npm/npmrc_tarball_other_server/fail/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4261/@denotest/tarballs-privateserver2 +Download http://localhost:4261/@denotest%2ftarballs-privateserver2 Download http://localhost:4262/@denotest/tarballs-privateserver2/1.0.0.tgz error: Failed caching npm package '@denotest/tarballs-privateserver2@1.0.0'. diff --git a/tests/specs/npm/npmrc_tarball_other_server/success/main.out b/tests/specs/npm/npmrc_tarball_other_server/success/main.out index d75f26e33..5322a1a17 100644 --- a/tests/specs/npm/npmrc_tarball_other_server/success/main.out +++ b/tests/specs/npm/npmrc_tarball_other_server/success/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4261/@denotest/tarballs-privateserver2 +Download http://localhost:4261/@denotest%2ftarballs-privateserver2 Download http://localhost:4262/@denotest/tarballs-privateserver2/1.0.0.tgz [# This fails on a checksum issue, because the test server isn't smart enough] [# to serve proper checksums for a package at another registry. That's fine] diff --git a/tests/specs/npm/npmrc_username_no_password/install.out b/tests/specs/npm/npmrc_username_no_password/install.out index d49a2ba0d..b198bcd27 100644 --- a/tests/specs/npm/npmrc_username_no_password/install.out +++ b/tests/specs/npm/npmrc_username_no_password/install.out @@ -1,3 +1,3 @@ [UNORDERED_START] -error: Error getting response at http://localhost:4261/@denotest/basic for package "@denotest/basic": Both the username and password must be provided for basic auth +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] diff --git a/tests/specs/npm/npmrc_username_password/install.out b/tests/specs/npm/npmrc_username_password/install.out index 30643527e..f2ea78c3f 100644 --- a/tests/specs/npm/npmrc_username_password/install.out +++ b/tests/specs/npm/npmrc_username_password/install.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4261/@denotest/basic -Download http://localhost:4262/@denotest2/basic +Download http://localhost:4261/@denotest%2fbasic +Download http://localhost:4262/@denotest2%2fbasic Download http://localhost:4261/@denotest/basic/1.0.0.tgz Download http://localhost:4262/@denotest2/basic/1.0.0.tgz Initialize @denotest2/basic@1.0.0 diff --git a/tests/specs/npm/permissions_outside_package/permissions_outside_package/main.out b/tests/specs/npm/permissions_outside_package/permissions_outside_package/main.out index 089f329c4..0fde8cf87 100644 --- a/tests/specs/npm/permissions_outside_package/permissions_outside_package/main.out +++ b/tests/specs/npm/permissions_outside_package/permissions_outside_package/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/permissions-outside-package +Download http://localhost:4260/@denotest%2fpermissions-outside-package Download http://localhost:4260/@denotest/permissions-outside-package/1.0.0.tgz { name: "foobar", version: "0.0.1" } diff --git a/tests/specs/npm/require_resolve_bad_paths_global_cache/main.out b/tests/specs/npm/require_resolve_bad_paths_global_cache/main.out index 3cc8a8279..2e82e6802 100644 --- a/tests/specs/npm/require_resolve_bad_paths_global_cache/main.out +++ b/tests/specs/npm/require_resolve_bad_paths_global_cache/main.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/esm-basic -Download http://localhost:4260/@denotest/require-resolve +Download http://localhost:4260/@denotest%2fesm-basic +Download http://localhost:4260/@denotest%2frequire-resolve [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz diff --git a/tests/specs/npm/reserved_word_exports/reserved_word_exports/main.out b/tests/specs/npm/reserved_word_exports/reserved_word_exports/main.out index ccfd35bc8..2a82194e3 100644 --- a/tests/specs/npm/reserved_word_exports/reserved_word_exports/main.out +++ b/tests/specs/npm/reserved_word_exports/reserved_word_exports/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/reserved-word-exports +Download http://localhost:4260/@denotest%2freserved-word-exports Download http://localhost:4260/@denotest/reserved-word-exports/1.0.0.tgz [Module: null prototype] { abstract: "abstract", diff --git a/tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out b/tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out index f6ee03ef1..a473c32cc 100644 --- a/tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out +++ b/tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/bin/1.0.0.tgz Initialize @denotest/bin@1.0.0 dev diff --git a/tests/specs/npm/types_d_ext/d_ext/main.out b/tests/specs/npm/types_d_ext/d_ext/main.out index e99df6696..5a834fbeb 100644 --- a/tests/specs/npm/types_d_ext/d_ext/main.out +++ b/tests/specs/npm/types_d_ext/d_ext/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/d-ext +Download http://localhost:4260/@denotest%2fd-ext Download http://localhost:4260/@denotest/d-ext/1.0.0.tgz Check file:///[WILDCARD]/d_ext/main.ts diff --git a/tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.out b/tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.out index 017a17ea2..62ef51d9f 100644 --- a/tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.out +++ b/tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/types-entry-value-not-exists +Download http://localhost:4260/@denotest%2ftypes-entry-value-not-exists Download http://localhost:4260/@denotest/types-entry-value-not-exists/1.0.0.tgz Check file://[WILDCARD]/types_entry_value_not_exists/main.ts error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. diff --git a/tests/specs/npm/types_exports_import_types/types_exports_import_types/main.out b/tests/specs/npm/types_exports_import_types/types_exports_import_types/main.out index 10f9425ca..bb69bf86f 100644 --- a/tests/specs/npm/types_exports_import_types/types_exports_import_types/main.out +++ b/tests/specs/npm/types_exports_import_types/types_exports_import_types/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/types-exports-import-types +Download http://localhost:4260/@denotest%2ftypes-exports-import-types Download http://localhost:4260/@denotest/types-exports-import-types/1.0.0.tgz Check file://[WILDCARD]/types_exports_import_types/main.ts error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. diff --git a/tests/specs/npm/types_general/main.out b/tests/specs/npm/types_general/main.out index ffba4f84d..edc83f2a2 100644 --- a/tests/specs/npm/types_general/main.out +++ b/tests/specs/npm/types_general/main.out @@ -1,7 +1,7 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/types -Download http://localhost:4260/@denotest/types_imported -Download http://localhost:4260/@denotest/types-exports-subpaths +Download http://localhost:4260/@denotest%2ftypes +Download http://localhost:4260/@denotest%2ftypes_imported +Download http://localhost:4260/@denotest%2ftypes-exports-subpaths Download http://localhost:4260/@denotest/types_imported/1.0.0.tgz Download http://localhost:4260/@denotest/types-exports-subpaths/1.0.0.tgz Download http://localhost:4260/@denotest/types/1.0.0.tgz diff --git a/tests/specs/npm/types_no_types_entry/types_no_types_entry/main.out b/tests/specs/npm/types_no_types_entry/types_no_types_entry/main.out index 53e872eaf..c867253ad 100644 --- a/tests/specs/npm/types_no_types_entry/types_no_types_entry/main.out +++ b/tests/specs/npm/types_no_types_entry/types_no_types_entry/main.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/types-no-types-entry -Download http://localhost:4260/@denotest/types-entry-value-not-exists +Download http://localhost:4260/@denotest%2ftypes-no-types-entry +Download http://localhost:4260/@denotest%2ftypes-entry-value-not-exists [UNORDERED_END] [UNORDERED_START] Download http://localhost:4260/@denotest/types-entry-value-not-exists/1.0.0.tgz 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 index 3c3b97190..b3faa8790 100644 --- 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 @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/typescript-file +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'. diff --git a/tests/specs/npm/workspace_basic/b/main_global_cache.out b/tests/specs/npm/workspace_basic/b/main_global_cache.out index 203ac5a99..879f6ab05 100644 --- a/tests/specs/npm/workspace_basic/b/main_global_cache.out +++ b/tests/specs/npm/workspace_basic/b/main_global_cache.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Hello 5 Hello 5 diff --git a/tests/specs/npm/workspace_basic/b/main_node_modules_dir.out b/tests/specs/npm/workspace_basic/b/main_node_modules_dir.out index eeb455652..464c05c57 100644 --- a/tests/specs/npm/workspace_basic/b/main_node_modules_dir.out +++ b/tests/specs/npm/workspace_basic/b/main_node_modules_dir.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 Hello 5 diff --git a/tests/specs/npm/workspace_basic/main.out b/tests/specs/npm/workspace_basic/main.out index 92404af87..52d8267bb 100644 --- a/tests/specs/npm/workspace_basic/main.out +++ b/tests/specs/npm/workspace_basic/main.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Hello 5 C: Hi! diff --git a/tests/specs/publish/bare_node_builtins/bare_node_builtins.out b/tests/specs/publish/bare_node_builtins/bare_node_builtins.out index 36ba9c7ce..6baedd906 100644 --- a/tests/specs/publish/bare_node_builtins/bare_node_builtins.out +++ b/tests/specs/publish/bare_node_builtins/bare_node_builtins.out @@ -1,7 +1,7 @@ Warning Resolving "url" as "node:url" at file:///[WILDLINE]/mod.ts:1:22. If you want to use a built-in Node module, add a "node:" prefix. Warning Resolving "url" as "node:url" at file:///[WILDLINE]/mod.ts:1:22. If you want to use a built-in Node module, add a "node:" prefix. [UNORDERED_START] -Download http://localhost:4260/@types/node +Download http://localhost:4260/@types%2fnode Download http://localhost:4260/undici-types Download http://localhost:4260/@types/node/node-22.5.4.tgz Download http://localhost:4260/undici-types/undici-types-6.19.8.tgz diff --git a/tests/specs/publish/missing_constraint/publish.out b/tests/specs/publish/missing_constraint/publish.out index d9fb6408f..7d2c293c0 100644 --- a/tests/specs/publish/missing_constraint/publish.out +++ b/tests/specs/publish/missing_constraint/publish.out @@ -1,7 +1,7 @@ [UNORDERED_START] Download http://127.0.0.1:4250/@denotest/add/meta.json Download http://127.0.0.1:4250/@denotest/deps/meta.json -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://127.0.0.1:4250/@denotest/add/1.0.0_meta.json Download http://127.0.0.1:4250/@denotest/deps/1.0.0_meta.json Download http://127.0.0.1:4250/@denotest/module-graph/meta.json diff --git a/tests/specs/publish/node_specifier/node_specifier.out b/tests/specs/publish/node_specifier/node_specifier.out index 4c9d7cb3e..0ba14043d 100644 --- a/tests/specs/publish/node_specifier/node_specifier.out +++ b/tests/specs/publish/node_specifier/node_specifier.out @@ -1,5 +1,5 @@ [UNORDERED_START] -Download http://localhost:4260/@types/node +Download http://localhost:4260/@types%2fnode Download http://localhost:4260/undici-types Download http://localhost:4260/@types/node/node-22.5.4.tgz Download http://localhost:4260/undici-types/undici-types-6.19.8.tgz diff --git a/tests/specs/remove/package_json/rm_add.out b/tests/specs/remove/package_json/rm_add.out index b98c27bae..af72f5f99 100644 --- a/tests/specs/remove/package_json/rm_add.out +++ b/tests/specs/remove/package_json/rm_add.out @@ -1,4 +1,4 @@ Removed @denotest/add -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/run/no_deno_json/code/install.out b/tests/specs/run/no_deno_json/code/install.out index 321dc8ebc..ddaf104c3 100644 --- a/tests/specs/run/no_deno_json/code/install.out +++ b/tests/specs/run/no_deno_json/code/install.out @@ -1,6 +1,6 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/check-error -Download http://localhost:4260/@denotest/cjs-default-export +Download http://localhost:4260/@denotest%2fcheck-error +Download http://localhost:4260/@denotest%2fcjs-default-export Download http://localhost:4260/chalk Download http://localhost:4260/ansi-styles Download http://localhost:4260/supports-color diff --git a/tests/specs/run/package_json/invalid_value/error_auto.out b/tests/specs/run/package_json/invalid_value/error_auto.out index 7641a4d86..966375a3d 100644 --- a/tests/specs/run/package_json/invalid_value/error_auto.out +++ b/tests/specs/run/package_json/invalid_value/error_auto.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 error: Invalid version requirement diff --git a/tests/specs/run/package_json/invalid_value/task.out b/tests/specs/run/package_json/invalid_value/task.out index d0adb0525..2f9580fa6 100644 --- a/tests/specs/run/package_json/invalid_value/task.out +++ b/tests/specs/run/package_json/invalid_value/task.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 Task test echo 1 diff --git a/tests/specs/task/bin_package/task.out b/tests/specs/task/bin_package/task.out index 69b4f7508..d2c130905 100644 --- a/tests/specs/task/bin_package/task.out +++ b/tests/specs/task/bin_package/task.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/bin/1.0.0.tgz Initialize @denotest/bin@1.0.0 Task sayhi cli-esm hi hello diff --git a/tests/specs/task/bin_pkg_with_scope_auto/bin_auto.out b/tests/specs/task/bin_pkg_with_scope_auto/bin_auto.out index 20865898e..1eb196a7a 100644 --- a/tests/specs/task/bin_pkg_with_scope_auto/bin_auto.out +++ b/tests/specs/task/bin_pkg_with_scope_auto/bin_auto.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fbin [UNORDERED_START] Download http://localhost:4260/@denotest/bin/0.5.0.tgz Initialize @denotest/bin@0.5.0 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 index 066c67bd8..f44b234bf 100644 --- a/tests/specs/task/bin_pkg_with_scope_auto/bin_none.out +++ b/tests/specs/task/bin_pkg_with_scope_auto/bin_none.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/bin +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 diff --git a/tests/specs/task/bin_pkg_with_scope_none/bin_none.out b/tests/specs/task/bin_pkg_with_scope_none/bin_none.out index 066c67bd8..f44b234bf 100644 --- a/tests/specs/task/bin_pkg_with_scope_none/bin_none.out +++ b/tests/specs/task/bin_pkg_with_scope_none/bin_none.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/bin +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 diff --git a/tests/specs/task/both_package_json_selected/install.out b/tests/specs/task/both_package_json_selected/install.out index 645501a3d..08b70a0f2 100644 --- a/tests/specs/task/both_package_json_selected/install.out +++ b/tests/specs/task/both_package_json_selected/install.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/bin/1.0.0.tgz Initialize @denotest/bin@1.0.0 diff --git a/tests/specs/task/package_json_node_modules_dir_none/bin.out b/tests/specs/task/package_json_node_modules_dir_none/bin.out index c86261d9e..ff60cc3d0 100644 --- a/tests/specs/task/package_json_node_modules_dir_none/bin.out +++ b/tests/specs/task/package_json_node_modules_dir_none/bin.out @@ -1,5 +1,5 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/bin/1.0.0.tgz Download http://localhost:4260/@denotest/bin/0.5.0.tgz [UNORDERED_END] diff --git a/tests/specs/test/package_json_basic/install.out b/tests/specs/test/package_json_basic/install.out index b8114c12a..8f03ba640 100644 --- a/tests/specs/test/package_json_basic/install.out +++ b/tests/specs/test/package_json_basic/install.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 diff --git a/tests/specs/test/package_json_basic_auto_install/test.out b/tests/specs/test/package_json_basic_auto_install/test.out index 2f109ef38..749c39548 100644 --- a/tests/specs/test/package_json_basic_auto_install/test.out +++ b/tests/specs/test/package_json_basic_auto_install/test.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 Check file://[WILDCARD]/lib.test.ts diff --git a/tests/testdata/compile/node_modules_symlink_outside/main_compile_folder.out b/tests/testdata/compile/node_modules_symlink_outside/main_compile_folder.out index 2067bf1c6..1a7eb0a4f 100644 --- a/tests/testdata/compile/node_modules_symlink_outside/main_compile_folder.out +++ b/tests/testdata/compile/node_modules_symlink_outside/main_compile_folder.out @@ -1,4 +1,4 @@ -Download http://localhost:4260/@denotest/esm-basic +Download http://localhost:4260/@denotest%2fesm-basic Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz Initialize @denotest/esm-basic@1.0.0 Check file:///[WILDCARD]/node_modules_symlink_outside/main.ts diff --git a/tests/testdata/npm/peer_deps_with_copied_folders/main.out b/tests/testdata/npm/peer_deps_with_copied_folders/main.out index 3c133bcde..b7a583557 100644 --- a/tests/testdata/npm/peer_deps_with_copied_folders/main.out +++ b/tests/testdata/npm/peer_deps_with_copied_folders/main.out @@ -1,7 +1,7 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child -Download http://localhost:4260/@denotest/peer-dep-test-grandchild -Download http://localhost:4260/@denotest/peer-dep-test-peer +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 diff --git a/tests/testdata/npm/peer_deps_with_copied_folders/main_node_modules_reload.out b/tests/testdata/npm/peer_deps_with_copied_folders/main_node_modules_reload.out index 9c8145211..18d7f7865 100644 --- a/tests/testdata/npm/peer_deps_with_copied_folders/main_node_modules_reload.out +++ b/tests/testdata/npm/peer_deps_with_copied_folders/main_node_modules_reload.out @@ -1,7 +1,7 @@ [UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child -Download http://localhost:4260/@denotest/peer-dep-test-grandchild -Download http://localhost:4260/@denotest/peer-dep-test-peer +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 diff --git a/tests/testdata/npm/run_existing_npm_package/main.out b/tests/testdata/npm/run_existing_npm_package/main.out index 147ed6a99..373059db5 100644 --- a/tests/testdata/npm/run_existing_npm_package/main.out +++ b/tests/testdata/npm/run_existing_npm_package/main.out @@ -1,3 +1,3 @@ -Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest%2fbin Download http://localhost:4260/@denotest/bin/0.5.0.tgz Initialize @denotest/bin@0.5.0 -- cgit v1.2.3 From 0e60bb9cf701fea3864403e6851abad86bc0b65d Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Fri, 18 Oct 2024 21:45:05 +0200 Subject: fix(info): resolve workspace member mappings (#26350) This PR fixes the issue where mapped specifiers in a workspace member would never be found. Only mapped paths from the workspace root would resolve. This was caused by always passing the workspace root url to the import map resolver instead of the workspace member one. Fixes https://github.com/denoland/deno/issues/26138 Fixes https://github.com/denoland/fresh/issues/2615 --------- Signed-off-by: Marvin Hagemeister Co-authored-by: David Sherret --- tests/specs/info/import_map/__test__.jsonc | 10 +++++++--- tests/specs/info/workspace_member/__test__.jsonc | 16 ++++++++++++++++ tests/specs/info/workspace_member/deno.json | 3 +++ .../info/workspace_member/info_workspace_member.out | 6 ++++++ .../info/workspace_member/info_workspace_member_sub.out | 6 ++++++ tests/specs/info/workspace_member/member/deno.json | 5 +++++ tests/specs/info/workspace_member/member/sub/file.ts | 1 + 7 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 tests/specs/info/workspace_member/__test__.jsonc create mode 100644 tests/specs/info/workspace_member/deno.json create mode 100644 tests/specs/info/workspace_member/info_workspace_member.out create mode 100644 tests/specs/info/workspace_member/info_workspace_member_sub.out create mode 100644 tests/specs/info/workspace_member/member/deno.json create mode 100644 tests/specs/info/workspace_member/member/sub/file.ts (limited to 'tests') diff --git a/tests/specs/info/import_map/__test__.jsonc b/tests/specs/info/import_map/__test__.jsonc index 725276925..7aba603e0 100644 --- a/tests/specs/info/import_map/__test__.jsonc +++ b/tests/specs/info/import_map/__test__.jsonc @@ -1,5 +1,9 @@ { - "args": "info preact/debug", - "output": "with_import_map.out", - "exitCode": 0 + "steps": [ + { + "args": "info preact/debug", + "output": "with_import_map.out", + "exitCode": 0 + } + ] } diff --git a/tests/specs/info/workspace_member/__test__.jsonc b/tests/specs/info/workspace_member/__test__.jsonc new file mode 100644 index 000000000..d13d3b03e --- /dev/null +++ b/tests/specs/info/workspace_member/__test__.jsonc @@ -0,0 +1,16 @@ +{ + "tests": { + "member_folder": { + "args": "info --quiet foo", + "cwd": "member", + "output": "info_workspace_member.out", + "exitCode": 0 + }, + "member_folder_sub": { + "args": "info --quiet foo", + "cwd": "member/sub", + "output": "info_workspace_member_sub.out", + "exitCode": 0 + } + } +} diff --git a/tests/specs/info/workspace_member/deno.json b/tests/specs/info/workspace_member/deno.json new file mode 100644 index 000000000..f88028aea --- /dev/null +++ b/tests/specs/info/workspace_member/deno.json @@ -0,0 +1,3 @@ +{ + "workspace": ["./member"] +} diff --git a/tests/specs/info/workspace_member/info_workspace_member.out b/tests/specs/info/workspace_member/info_workspace_member.out new file mode 100644 index 000000000..e0dc0b675 --- /dev/null +++ b/tests/specs/info/workspace_member/info_workspace_member.out @@ -0,0 +1,6 @@ +local: [WILDCARD]file.ts +type: TypeScript +dependencies: 0 unique +size: [WILDCARD] + +file://[WILDCARD]/member/sub/file.ts ([WILDCARD]) diff --git a/tests/specs/info/workspace_member/info_workspace_member_sub.out b/tests/specs/info/workspace_member/info_workspace_member_sub.out new file mode 100644 index 000000000..e0dc0b675 --- /dev/null +++ b/tests/specs/info/workspace_member/info_workspace_member_sub.out @@ -0,0 +1,6 @@ +local: [WILDCARD]file.ts +type: TypeScript +dependencies: 0 unique +size: [WILDCARD] + +file://[WILDCARD]/member/sub/file.ts ([WILDCARD]) diff --git a/tests/specs/info/workspace_member/member/deno.json b/tests/specs/info/workspace_member/member/deno.json new file mode 100644 index 000000000..66aac2904 --- /dev/null +++ b/tests/specs/info/workspace_member/member/deno.json @@ -0,0 +1,5 @@ +{ + "imports": { + "foo": "./sub/file.ts" + } +} diff --git a/tests/specs/info/workspace_member/member/sub/file.ts b/tests/specs/info/workspace_member/member/sub/file.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/tests/specs/info/workspace_member/member/sub/file.ts @@ -0,0 +1 @@ +export {}; -- cgit v1.2.3 From 473e3069de4bf5877a6f1140aa0462e05f745536 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Sat, 19 Oct 2024 14:59:39 -0700 Subject: chore: update nix crate (#26422) Dedupes nix dependency, since `rustyline` depends on a newer version that what we currently use --- tests/util/server/Cargo.toml | 2 +- tests/util/server/src/pty.rs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/util/server/Cargo.toml b/tests/util/server/Cargo.toml index a321501b8..aee7ef0be 100644 --- a/tests/util/server/Cargo.toml +++ b/tests/util/server/Cargo.toml @@ -35,7 +35,7 @@ lazy-regex.workspace = true libc.workspace = true lsp-types.workspace = true monch.workspace = true -nix.workspace = true +nix = { workspace = true, features = ["fs", "term", "signal"] } once_cell.workspace = true os_pipe.workspace = true parking_lot.workspace = true diff --git a/tests/util/server/src/pty.rs b/tests/util/server/src/pty.rs index 5d8049fee..8d42fed78 100644 --- a/tests/util/server/src/pty.rs +++ b/tests/util/server/src/pty.rs @@ -297,10 +297,12 @@ fn setup_pty(fd: i32) { use nix::sys::termios::tcsetattr; use nix::sys::termios::SetArg; - let mut term = tcgetattr(fd).unwrap(); + // SAFETY: Nix crate requires value to implement the AsFd trait + let as_fd = unsafe { std::os::fd::BorrowedFd::borrow_raw(fd) }; + let mut term = tcgetattr(as_fd).unwrap(); // disable cooked mode term.local_flags.remove(termios::LocalFlags::ICANON); - tcsetattr(fd, SetArg::TCSANOW, &term).unwrap(); + tcsetattr(as_fd, SetArg::TCSANOW, &term).unwrap(); // turn on non-blocking mode so we get timeouts let flags = fcntl(fd, FcntlArg::F_GETFL).unwrap(); -- cgit v1.2.3 From 9fe2bf42dc584779cc43f0ec15a5a3d6dddca283 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Mon, 21 Oct 2024 17:15:52 +0100 Subject: feat(lsp): interactive inlay hints (#26382) --- tests/integration/lsp_tests.rs | 182 ++++++++++++++++++++++++++++++++--------- tests/util/server/src/lsp.rs | 28 ------- 2 files changed, 142 insertions(+), 68 deletions(-) (limited to 'tests') diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 85e02041e..0b7c5dd3f 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -1827,15 +1827,41 @@ fn lsp_hover_disabled() { fn lsp_inlay_hints() { let context = TestContextBuilder::new().use_temp_cwd().build(); let mut client = context.new_lsp_command().build(); - client.initialize(|builder| { - builder.enable_inlay_hints(); - }); + client.initialize_default(); + client.change_configuration(json!({ + "deno": { + "enable": true, + }, + "typescript": { + "inlayHints": { + "parameterNames": { + "enabled": "all", + }, + "parameterTypes": { + "enabled": true, + }, + "variableTypes": { + "enabled": true, + }, + "propertyDeclarationTypes": { + "enabled": true, + }, + "functionLikeReturnTypes": { + "enabled": true, + }, + "enumMemberValues": { + "enabled": true, + }, + }, + }, + })); client.did_open(json!({ "textDocument": { "uri": "file:///a/file.ts", "languageId": "typescript", "version": 1, - "text": r#"function a(b: string) { + "text": r#" + function a(b: string) { return b; } @@ -1854,8 +1880,19 @@ fn lsp_inlay_hints() { } ["a"].map((v) => v + v); - "# - } + + interface Bar { + someField: string; + } + function getBar(): Bar { + return { someField: "foo" }; + } + // This shouldn't have a type hint because the variable name makes it + // redundant. + const bar = getBar(); + const someValue = getBar(); + "#, + }, })); let res = client.write_request( "textDocument/inlayHint", @@ -1864,65 +1901,130 @@ fn lsp_inlay_hints() { "uri": "file:///a/file.ts", }, "range": { - "start": { "line": 0, "character": 0 }, - "end": { "line": 19, "character": 0, } - } + "start": { "line": 1, "character": 0 }, + "end": { "line": 31, "character": 0, }, + }, }), ); assert_eq!( res, json!([ { - "position": { "line": 0, "character": 21 }, - "label": ": string", + "position": { "line": 1, "character": 29 }, + "label": [{ "value": ": " }, { "value": "string" }], "kind": 1, - "paddingLeft": true + "paddingLeft": true, }, { - "position": { "line": 4, "character": 10 }, - "label": "b:", + "position": { "line": 5, "character": 10 }, + "label": [ + { + "value": "b", + "location": { + "uri": "file:///a/file.ts", + "range": { + "start": { "line": 1, "character": 19 }, + "end": { "line": 1, "character": 20 }, + }, + }, + }, + { "value": ":" }, + ], "kind": 2, - "paddingRight": true + "paddingRight": true, }, { - "position": { "line": 7, "character": 11 }, + "position": { "line": 8, "character": 11 }, "label": "= 0", - "paddingLeft": true + "paddingLeft": true, }, { - "position": { "line": 10, "character": 17 }, - "label": "string:", + "position": { "line": 11, "character": 17 }, + "label": [ + { + "value": "string", + "location": { + "uri": "deno:/asset/lib.es5.d.ts", + "range": { + "start": { "line": 41, "character": 26 }, + "end": { "line": 41, "character": 32 }, + }, + }, + }, + { "value": ":" }, + ], "kind": 2, - "paddingRight": true + "paddingRight": true, }, { - "position": { "line": 10, "character": 24 }, - "label": "radix:", + "position": { "line": 11, "character": 24 }, + "label": [ + { + "value": "radix", + "location": { + "uri": "deno:/asset/lib.es5.d.ts", + "range": { + "start": { "line": 41, "character": 42 }, + "end": { "line": 41, "character": 47 }, + }, + }, + }, + { "value": ":" }, + ], "kind": 2, - "paddingRight": true + "paddingRight": true, }, { - "position": { "line": 12, "character": 15 }, - "label": ": number", + "position": { "line": 13, "character": 15 }, + "label": [{ "value": ": " }, { "value": "number" }], "kind": 1, - "paddingLeft": true + "paddingLeft": true, }, { - "position": { "line": 15, "character": 11 }, - "label": ": number", + "position": { "line": 16, "character": 11 }, + "label": [{ "value": ": " }, { "value": "number" }], "kind": 1, - "paddingLeft": true + "paddingLeft": true, }, { - "position": { "line": 18, "character": 18 }, - "label": "callbackfn:", + "position": { "line": 19, "character": 18 }, + "label": [ + { + "value": "callbackfn", + "location": { + "uri": "deno:/asset/lib.es5.d.ts", + "range": { + "start": { "line": 1462, "character": 11 }, + "end": { "line": 1462, "character": 21 }, + }, + }, + }, + { "value": ":" }, + ], "kind": 2, - "paddingRight": true + "paddingRight": true, }, { - "position": { "line": 18, "character": 20 }, - "label": ": string", + "position": { "line": 19, "character": 20 }, + "label": [{ "value": ": " }, { "value": "string" }], "kind": 1, - "paddingLeft": true + "paddingLeft": true, }, { - "position": { "line": 18, "character": 21 }, - "label": ": string", + "position": { "line": 19, "character": 21 }, + "label": [{ "value": ": " }, { "value": "string" }], "kind": 1, - "paddingLeft": true - } - ]) + "paddingLeft": true, + }, { + "position": { "line": 30, "character": 23 }, + "label": [ + { "value": ": " }, + { + "value": "Bar", + "location": { + "uri": "file:///a/file.ts", + "range": { + "start": { "line": 21, "character": 18 }, + "end": { "line": 21, "character": 21 }, + }, + }, + }, + ], + "kind": 1, + "paddingLeft": true, + }, + ]), ); client.shutdown(); } diff --git a/tests/util/server/src/lsp.rs b/tests/util/server/src/lsp.rs index ffe72b88a..4e75cfadb 100644 --- a/tests/util/server/src/lsp.rs +++ b/tests/util/server/src/lsp.rs @@ -308,34 +308,6 @@ impl InitializeParamsBuilder { self } - pub fn enable_inlay_hints(&mut self) -> &mut Self { - let options = self.initialization_options_mut(); - options.insert( - "inlayHints".to_string(), - json!({ - "parameterNames": { - "enabled": "all" - }, - "parameterTypes": { - "enabled": true - }, - "variableTypes": { - "enabled": true - }, - "propertyDeclarationTypes": { - "enabled": true - }, - "functionLikeReturnTypes": { - "enabled": true - }, - "enumMemberValues": { - "enabled": true - } - }), - ); - self - } - pub fn disable_testing_api(&mut self) -> &mut Self { let obj = self .params -- cgit v1.2.3 From 39fb55096ec12c8c18d15dff63a750a22169e3e6 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 21 Oct 2024 14:17:08 -0400 Subject: fix(install): better json editing (#26450) 1. Respects the formatting of the file (ex. keeps four space indents or tabs). 2. Handles editing of comments. 3. Handles trailing commas. 4. Code is easier to maintain. --- tests/specs/add/comments_deno_json/__test__.jsonc | 16 ++++++++++++++++ tests/specs/add/comments_deno_json/deno.jsonc | 7 +++++++ tests/specs/add/comments_deno_json/deno.jsonc.out | 9 +++++++++ tests/specs/add/dev/package.json.out | 4 +--- tests/specs/add/existing_deps_singleline/__test__.jsonc | 16 ++++++++++++++++ tests/specs/add/existing_deps_singleline/package.json | 3 +++ .../specs/add/existing_deps_singleline/package.json.out | 6 ++++++ tests/specs/add/exiting_dev_deps/__test__.jsonc | 16 ++++++++++++++++ tests/specs/add/exiting_dev_deps/package.json | 5 +++++ tests/specs/add/exiting_dev_deps/package.json.out | 8 ++++++++ tests/specs/install/install_add_dev/package.json | 4 +--- tests/specs/remove/package_json/rm_add_package.json.out | 4 +--- 12 files changed, 89 insertions(+), 9 deletions(-) create mode 100644 tests/specs/add/comments_deno_json/__test__.jsonc create mode 100644 tests/specs/add/comments_deno_json/deno.jsonc create mode 100644 tests/specs/add/comments_deno_json/deno.jsonc.out create mode 100644 tests/specs/add/existing_deps_singleline/__test__.jsonc create mode 100644 tests/specs/add/existing_deps_singleline/package.json create mode 100644 tests/specs/add/existing_deps_singleline/package.json.out create mode 100644 tests/specs/add/exiting_dev_deps/__test__.jsonc create mode 100644 tests/specs/add/exiting_dev_deps/package.json create mode 100644 tests/specs/add/exiting_dev_deps/package.json.out (limited to 'tests') diff --git a/tests/specs/add/comments_deno_json/__test__.jsonc b/tests/specs/add/comments_deno_json/__test__.jsonc new file mode 100644 index 000000000..7197eb473 --- /dev/null +++ b/tests/specs/add/comments_deno_json/__test__.jsonc @@ -0,0 +1,16 @@ +{ + "tempDir": true, + "steps": [ + { + "args": "add npm:@denotest/esm-basic jsr:@denotest/add", + "output": "[WILDCARD]" + }, + { + "args": [ + "eval", + "console.log(Deno.readTextFileSync('deno.jsonc').trim())" + ], + "output": "deno.jsonc.out" + } + ] +} diff --git a/tests/specs/add/comments_deno_json/deno.jsonc b/tests/specs/add/comments_deno_json/deno.jsonc new file mode 100644 index 000000000..6a37b343d --- /dev/null +++ b/tests/specs/add/comments_deno_json/deno.jsonc @@ -0,0 +1,7 @@ +// Testing four space indents too +// deno-fmt-ignore +{ + "imports": { + "@denotest/add2": "npm:@denotest/add" // some comment + } +} diff --git a/tests/specs/add/comments_deno_json/deno.jsonc.out b/tests/specs/add/comments_deno_json/deno.jsonc.out new file mode 100644 index 000000000..0cca35c64 --- /dev/null +++ b/tests/specs/add/comments_deno_json/deno.jsonc.out @@ -0,0 +1,9 @@ +// Testing four space indents too +// deno-fmt-ignore +{ + "imports": { + "@denotest/add": "jsr:@denotest/add@^1.0.0", + "@denotest/add2": "npm:@denotest/add", // some comment + "@denotest/esm-basic": "npm:@denotest/esm-basic@^1.0.0" + } +} diff --git a/tests/specs/add/dev/package.json.out b/tests/specs/add/dev/package.json.out index 866724397..d5ca56e00 100644 --- a/tests/specs/add/dev/package.json.out +++ b/tests/specs/add/dev/package.json.out @@ -1,5 +1,3 @@ { - "devDependencies": { - "@denotest/esm-basic": "^1.0.0" - } + "devDependencies": { "@denotest/esm-basic": "^1.0.0" } } diff --git a/tests/specs/add/existing_deps_singleline/__test__.jsonc b/tests/specs/add/existing_deps_singleline/__test__.jsonc new file mode 100644 index 000000000..8a6ef1a5f --- /dev/null +++ b/tests/specs/add/existing_deps_singleline/__test__.jsonc @@ -0,0 +1,16 @@ +{ + "tempDir": true, + "steps": [ + { + "args": "add npm:@denotest/esm-basic", + "output": "[WILDCARD]" + }, + { + "args": [ + "eval", + "console.log(Deno.readTextFileSync('package.json').trim())" + ], + "output": "package.json.out" + } + ] +} diff --git a/tests/specs/add/existing_deps_singleline/package.json b/tests/specs/add/existing_deps_singleline/package.json new file mode 100644 index 000000000..3677a6e2e --- /dev/null +++ b/tests/specs/add/existing_deps_singleline/package.json @@ -0,0 +1,3 @@ +{ + "dependencies": { "cowsay": "*" } +} diff --git a/tests/specs/add/existing_deps_singleline/package.json.out b/tests/specs/add/existing_deps_singleline/package.json.out new file mode 100644 index 000000000..5a7fa3680 --- /dev/null +++ b/tests/specs/add/existing_deps_singleline/package.json.out @@ -0,0 +1,6 @@ +{ + "dependencies": { + "@denotest/esm-basic": "^1.0.0", + "cowsay": "*" + } +} diff --git a/tests/specs/add/exiting_dev_deps/__test__.jsonc b/tests/specs/add/exiting_dev_deps/__test__.jsonc new file mode 100644 index 000000000..8a6ef1a5f --- /dev/null +++ b/tests/specs/add/exiting_dev_deps/__test__.jsonc @@ -0,0 +1,16 @@ +{ + "tempDir": true, + "steps": [ + { + "args": "add npm:@denotest/esm-basic", + "output": "[WILDCARD]" + }, + { + "args": [ + "eval", + "console.log(Deno.readTextFileSync('package.json').trim())" + ], + "output": "package.json.out" + } + ] +} diff --git a/tests/specs/add/exiting_dev_deps/package.json b/tests/specs/add/exiting_dev_deps/package.json new file mode 100644 index 000000000..e7b8c5061 --- /dev/null +++ b/tests/specs/add/exiting_dev_deps/package.json @@ -0,0 +1,5 @@ +{ + "devDependencies": { + "cowsay": "*" + } +} diff --git a/tests/specs/add/exiting_dev_deps/package.json.out b/tests/specs/add/exiting_dev_deps/package.json.out new file mode 100644 index 000000000..9bff99bc2 --- /dev/null +++ b/tests/specs/add/exiting_dev_deps/package.json.out @@ -0,0 +1,8 @@ +{ + "dependencies": { + "@denotest/esm-basic": "^1.0.0" + }, + "devDependencies": { + "cowsay": "*" + } +} diff --git a/tests/specs/install/install_add_dev/package.json b/tests/specs/install/install_add_dev/package.json index d5ca56e00..0967ef424 100644 --- a/tests/specs/install/install_add_dev/package.json +++ b/tests/specs/install/install_add_dev/package.json @@ -1,3 +1 @@ -{ - "devDependencies": { "@denotest/esm-basic": "^1.0.0" } -} +{} diff --git a/tests/specs/remove/package_json/rm_add_package.json.out b/tests/specs/remove/package_json/rm_add_package.json.out index 866724397..d5ca56e00 100644 --- a/tests/specs/remove/package_json/rm_add_package.json.out +++ b/tests/specs/remove/package_json/rm_add_package.json.out @@ -1,5 +1,3 @@ { - "devDependencies": { - "@denotest/esm-basic": "^1.0.0" - } + "devDependencies": { "@denotest/esm-basic": "^1.0.0" } } -- cgit v1.2.3 From 9e25a4ebbfa848e58415f267d5991bead7de4808 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Mon, 21 Oct 2024 22:16:39 +0100 Subject: fix(lsp): import-map-remap quickfix for type imports (#26454) --- tests/integration/lsp_tests.rs | 111 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) (limited to 'tests') diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 0b7c5dd3f..35a412b28 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -6777,6 +6777,117 @@ fn lsp_code_actions_imports_dts() { client.shutdown(); } +#[test] +fn lsp_code_actions_import_map_remap() { + let context = TestContextBuilder::new().use_temp_cwd().build(); + let temp_dir = context.temp_dir(); + temp_dir.write( + "deno.json", + json!({ + "imports": { + "foo": "./foo.ts", + "bar": "./bar.ts", + }, + }) + .to_string(), + ); + temp_dir.write("foo.ts", ""); + temp_dir.write("bar.ts", ""); + 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": r#" + import "./foo.ts"; + import type {} from "./bar.ts"; + "#, + } + })); + let res = client.write_request( + "textDocument/codeAction", + json!({ + "textDocument": { "uri": temp_dir.url().join("file.ts").unwrap() }, + "range": { + "start": { "line": 0, "character": 0 }, + "end": { "line": 3, "character": 0 }, + }, + "context": { + "diagnostics": diagnostics.all(), + "only": ["quickfix"], + }, + }), + ); + assert_eq!( + res, + json!([ + { + "title": "Update \"./foo.ts\" to \"foo\" to use import map.", + "kind": "quickfix", + "diagnostics": [ + { + "range": { + "start": { "line": 1, "character": 15 }, + "end": { "line": 1, "character": 25 }, + }, + "severity": 4, + "code": "import-map-remap", + "source": "deno", + "message": "The import specifier can be remapped to \"foo\" which will resolve it via the active import map.", + "data": { "from": "./foo.ts", "to": "foo" }, + }, + ], + "edit": { + "changes": { + temp_dir.url().join("file.ts").unwrap(): [ + { + "range": { + "start": { "line": 1, "character": 15 }, + "end": { "line": 1, "character": 25 }, + }, + "newText": "\"foo\"", + }, + ], + }, + }, + }, + { + "title": "Update \"./bar.ts\" to \"bar\" to use import map.", + "kind": "quickfix", + "diagnostics": [ + { + "range": { + "start": { "line": 2, "character": 28 }, + "end": { "line": 2, "character": 38 }, + }, + "severity": 4, + "code": "import-map-remap", + "source": "deno", + "message": "The import specifier can be remapped to \"bar\" which will resolve it via the active import map.", + "data": { "from": "./bar.ts", "to": "bar" }, + }, + ], + "edit": { + "changes": { + temp_dir.url().join("file.ts").unwrap(): [ + { + "range": { + "start": { "line": 2, "character": 28 }, + "end": { "line": 2, "character": 38 }, + }, + "newText": "\"bar\"", + }, + ], + }, + }, + }, + ]), + ); + client.shutdown(); +} + #[test] fn lsp_code_actions_refactor() { let context = TestContextBuilder::new().use_temp_cwd().build(); -- cgit v1.2.3 From 67280f8b558902729c805fd3d8f26d4c434fc211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 22 Oct 2024 00:08:45 +0100 Subject: fix(install): update lockfile when using package.json (#26458) This commit makes sure that `deno add`, `deno install` and `deno remove` update the lockfile if only `package.json` file is present. Fixes https://github.com/denoland/deno/issues/26270 --- .../update_lockfile_if_package_json/__test__.jsonc | 31 ++++++++++++++++++++++ .../add/update_lockfile_if_package_json/add.out | 5 ++++ .../lockfile_add.out | 7 +++++ .../lockfile_remove.out | 4 +++ .../update_lockfile_if_package_json/package.json | 0 .../add/update_lockfile_if_package_json/remove.out | 4 +++ 6 files changed, 51 insertions(+) create mode 100644 tests/specs/add/update_lockfile_if_package_json/__test__.jsonc create mode 100644 tests/specs/add/update_lockfile_if_package_json/add.out create mode 100644 tests/specs/add/update_lockfile_if_package_json/lockfile_add.out create mode 100644 tests/specs/add/update_lockfile_if_package_json/lockfile_remove.out create mode 100644 tests/specs/add/update_lockfile_if_package_json/package.json create mode 100644 tests/specs/add/update_lockfile_if_package_json/remove.out (limited to 'tests') diff --git a/tests/specs/add/update_lockfile_if_package_json/__test__.jsonc b/tests/specs/add/update_lockfile_if_package_json/__test__.jsonc new file mode 100644 index 000000000..80b35dc3c --- /dev/null +++ b/tests/specs/add/update_lockfile_if_package_json/__test__.jsonc @@ -0,0 +1,31 @@ +{ + "tempDir": true, + "tests": { + "updates_lockfile": { + "steps": [ + { + "args": "add npm:@denotest/esm-basic npm:@denotest/say-hello", + "output": "add.out" + }, + { + "args": [ + "eval", + "console.log(Deno.readTextFileSync('deno.lock'))" + ], + "output": "lockfile_add.out" + }, + { + "args": "remove @denotest/esm-basic @denotest/say-hello", + "output": "remove.out" + }, + { + "args": [ + "eval", + "console.log(Deno.readTextFileSync('deno.lock'))" + ], + "output": "lockfile_remove.out" + } + ] + } + } +} diff --git a/tests/specs/add/update_lockfile_if_package_json/add.out b/tests/specs/add/update_lockfile_if_package_json/add.out new file mode 100644 index 000000000..97989b0c3 --- /dev/null +++ b/tests/specs/add/update_lockfile_if_package_json/add.out @@ -0,0 +1,5 @@ +[UNORDERED_START] +Add npm:@denotest/esm-basic@1.0.0 +Add npm:@denotest/say-hello@1.0.0 +[UNORDERED_END] +[WILDCARD] \ No newline at end of file diff --git a/tests/specs/add/update_lockfile_if_package_json/lockfile_add.out b/tests/specs/add/update_lockfile_if_package_json/lockfile_add.out new file mode 100644 index 000000000..d452c2de8 --- /dev/null +++ b/tests/specs/add/update_lockfile_if_package_json/lockfile_add.out @@ -0,0 +1,7 @@ +{ + "version": "4", + "specifiers": { + "npm:@denotest/esm-basic@1": "1.0.0", + "npm:@denotest/say-hello@1": "1.0.0" + }, +[WILDCARD] diff --git a/tests/specs/add/update_lockfile_if_package_json/lockfile_remove.out b/tests/specs/add/update_lockfile_if_package_json/lockfile_remove.out new file mode 100644 index 000000000..fdd4f1cc6 --- /dev/null +++ b/tests/specs/add/update_lockfile_if_package_json/lockfile_remove.out @@ -0,0 +1,4 @@ +{ + "version": "4" +} + diff --git a/tests/specs/add/update_lockfile_if_package_json/package.json b/tests/specs/add/update_lockfile_if_package_json/package.json new file mode 100644 index 000000000..e69de29bb diff --git a/tests/specs/add/update_lockfile_if_package_json/remove.out b/tests/specs/add/update_lockfile_if_package_json/remove.out new file mode 100644 index 000000000..8efb0810c --- /dev/null +++ b/tests/specs/add/update_lockfile_if_package_json/remove.out @@ -0,0 +1,4 @@ +[UNORDERED_START] +Removed @denotest/esm-basic +Removed @denotest/say-hello +[UNORDERED_END] -- cgit v1.2.3 From f26c8bcf3167069ccd8ac3beb9185d1bf480a83f Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Tue, 22 Oct 2024 01:41:08 -0700 Subject: refactor(runtime/ops): use concrete error types (#26409) --- tests/unit/signal_test.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'tests') diff --git a/tests/unit/signal_test.ts b/tests/unit/signal_test.ts index 65b5ba78e..8923aa75b 100644 --- a/tests/unit/signal_test.ts +++ b/tests/unit/signal_test.ts @@ -5,101 +5,101 @@ Deno.test( { ignore: Deno.build.os !== "windows" }, function signalsNotImplemented() { const msg = - "Windows only supports ctrl-c (SIGINT) and ctrl-break (SIGBREAK)."; + "Windows only supports ctrl-c (SIGINT) and ctrl-break (SIGBREAK), but got "; assertThrows( () => { Deno.addSignalListener("SIGALRM", () => {}); }, Error, - msg, + msg + "SIGALRM", ); assertThrows( () => { Deno.addSignalListener("SIGCHLD", () => {}); }, Error, - msg, + msg + "SIGCHLD", ); assertThrows( () => { Deno.addSignalListener("SIGHUP", () => {}); }, Error, - msg, + msg + "SIGHUP", ); assertThrows( () => { Deno.addSignalListener("SIGIO", () => {}); }, Error, - msg, + msg + "SIGIO", ); assertThrows( () => { Deno.addSignalListener("SIGPIPE", () => {}); }, Error, - msg, + msg + "SIGPIPE", ); assertThrows( () => { Deno.addSignalListener("SIGQUIT", () => {}); }, Error, - msg, + msg + "SIGQUIT", ); assertThrows( () => { Deno.addSignalListener("SIGTERM", () => {}); }, Error, - msg, + msg + "SIGTERM", ); assertThrows( () => { Deno.addSignalListener("SIGUSR1", () => {}); }, Error, - msg, + msg + "SIGUSR1", ); assertThrows( () => { Deno.addSignalListener("SIGUSR2", () => {}); }, Error, - msg, + msg + "SIGUSR2", ); assertThrows( () => { Deno.addSignalListener("SIGWINCH", () => {}); }, Error, - msg, + msg + "SIGWINCH", ); assertThrows( () => Deno.addSignalListener("SIGKILL", () => {}), Error, - msg, + msg + "SIGKILL", ); assertThrows( () => Deno.addSignalListener("SIGSTOP", () => {}), Error, - msg, + msg + "SIGSTOP", ); assertThrows( () => Deno.addSignalListener("SIGILL", () => {}), Error, - msg, + msg + "SIGILL", ); assertThrows( () => Deno.addSignalListener("SIGFPE", () => {}), Error, - msg, + msg + "SIGFPE", ); assertThrows( () => Deno.addSignalListener("SIGSEGV", () => {}), Error, - msg, + msg + "SIGSEGV", ); }, ); -- cgit v1.2.3 From 9696e0b3780ede9bb59ab3cf3bf4f2df179d0b32 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Tue, 22 Oct 2024 01:57:58 -0700 Subject: fix(ext/console): ignore casing for named colors in css parsing (#26466) --- tests/unit/console_test.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/unit/console_test.ts b/tests/unit/console_test.ts index 42cff7c70..06f5dd7e6 100644 --- a/tests/unit/console_test.ts +++ b/tests/unit/console_test.ts @@ -1227,6 +1227,7 @@ Deno.test(function consoleParseCssColor() { assertEquals(parseCssColor("inherit"), null); assertEquals(parseCssColor("black"), [0, 0, 0]); assertEquals(parseCssColor("darkmagenta"), [139, 0, 139]); + assertEquals(parseCssColor("darkMaGenta"), [139, 0, 139]); assertEquals(parseCssColor("slateblue"), [106, 90, 205]); assertEquals(parseCssColor("#ffaa00"), [255, 170, 0]); assertEquals(parseCssColor("#ffAA00"), [255, 170, 0]); -- cgit v1.2.3 From 28b5640657ce875a73eb3a1ffed287a61de164b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 22 Oct 2024 21:22:26 +0100 Subject: refactor: add 'docs' suggestion (#26463) Adds another kind to `FixSuggestionKind` specifically for links documentation pages. --- tests/specs/run/import_common_js/exports_error.out | 2 +- tests/specs/run/import_common_js/module_error.out | 2 +- tests/specs/run/import_common_js/require_error.out | 2 +- tests/specs/run/package_json_type/commonjs/main_mix.out | 2 +- tests/specs/run/package_json_type/none/main_cjs.out | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/specs/run/import_common_js/exports_error.out b/tests/specs/run/import_common_js/exports_error.out index 299a46438..b979cce5c 100644 --- a/tests/specs/run/import_common_js/exports_error.out +++ b/tests/specs/run/import_common_js/exports_error.out @@ -9,4 +9,4 @@ Object.defineProperty(exports, "__esModule", { value: true }); or change the file extension to .cjs, or add package.json next to the file with "type": "commonjs" option and pass --unstable-detect-cjs flag. - hint: See https://docs.deno.com/go/commonjs for details + 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 1c1140fe4..654ee838d 100644 --- a/tests/specs/run/import_common_js/module_error.out +++ b/tests/specs/run/import_common_js/module_error.out @@ -9,4 +9,4 @@ module.exports = { or change the file extension to .cjs, or add package.json next to the file with "type": "commonjs" option and pass --unstable-detect-cjs flag. - hint: See https://docs.deno.com/go/commonjs for details + 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 ebc6b6fa4..81ffd6591 100644 --- a/tests/specs/run/import_common_js/require_error.out +++ b/tests/specs/run/import_common_js/require_error.out @@ -9,4 +9,4 @@ const process = require("process"); or change the file extension to .cjs, or add package.json next to the file with "type": "commonjs" option and pass --unstable-detect-cjs flag. - hint: See https://docs.deno.com/go/commonjs for details + docs: https://docs.deno.com/go/commonjs diff --git a/tests/specs/run/package_json_type/commonjs/main_mix.out b/tests/specs/run/package_json_type/commonjs/main_mix.out index 67d316fcd..78f421644 100644 --- a/tests/specs/run/package_json_type/commonjs/main_mix.out +++ b/tests/specs/run/package_json_type/commonjs/main_mix.out @@ -10,4 +10,4 @@ console.log(require("./add").add(1, 2)); or change the file extension to .cjs, or add package.json next to the file with "type": "commonjs" option and pass --unstable-detect-cjs flag. - hint: See https://docs.deno.com/go/commonjs for details + 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 66213dbdb..8d34808fb 100644 --- a/tests/specs/run/package_json_type/none/main_cjs.out +++ b/tests/specs/run/package_json_type/none/main_cjs.out @@ -9,4 +9,4 @@ const { add } = require("./add"); or change the file extension to .cjs, or add package.json next to the file with "type": "commonjs" option and pass --unstable-detect-cjs flag. - hint: See https://docs.deno.com/go/commonjs for details + docs: https://docs.deno.com/go/commonjs -- cgit v1.2.3 From 5e020ebc3507947cd9e999a4f7213d2d0d5416cf Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Tue, 22 Oct 2024 14:15:00 -0700 Subject: fix(check): support `--frozen` on deno check (#26479) Fixes https://github.com/denoland/deno/issues/26391 --- tests/specs/lockfile/frozen_lockfile/__test__.jsonc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/specs/lockfile/frozen_lockfile/__test__.jsonc b/tests/specs/lockfile/frozen_lockfile/__test__.jsonc index 7a7b9c233..07ec2c4c1 100644 --- a/tests/specs/lockfile/frozen_lockfile/__test__.jsonc +++ b/tests/specs/lockfile/frozen_lockfile/__test__.jsonc @@ -183,6 +183,19 @@ "exitCode": 1 } ] + }, + "check_subcommand": { + "steps": [ + { + "args": "check --frozen=true add.ts", + "output": "[WILDCARD]The lockfile is out of date[WILDCARD]", + "exitCode": 1 + }, + { + "args": "check --frozen=false add.ts", + "output": "[WILDCARD]Check [WILDCARD]add.ts\n" + } + ] } } } -- cgit v1.2.3 From 285635daa67274f961d29c1e7795222709dc9618 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Wed, 23 Oct 2024 11:28:04 +0900 Subject: fix(ext/node): map `ERROR_INVALID_NAME` to `ENOENT` on windows (#26475) In libuv on windows, `ERROR_INVALID_NAME` is mapped to `ENOENT`, but it is mapped to `EINVAL` in our compat implementation, which causes the issue #24899. ref: https://github.com/libuv/libuv/blob/d4ab6fbba4669935a6bc23645372dfe4ac29ab39/src/win/error.c#L138 closes #24899 closes #26411 closes #23635 closes #21165 closes #19067 --- tests/unit_node/fs_test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/unit_node/fs_test.ts b/tests/unit_node/fs_test.ts index ac9c4a53e..ef8f829cd 100644 --- a/tests/unit_node/fs_test.ts +++ b/tests/unit_node/fs_test.ts @@ -233,3 +233,14 @@ Deno.test("[node/fs] copyFile COPYFILE_EXCL works", async () => { copyFileSync(src, dest2, fsPromiseConstants.COPYFILE_EXCL) ); }); + +Deno.test("[node/fs] statSync throws ENOENT for invalid path containing colon in it", () => { + // deno-lint-ignore no-explicit-any + const err: any = assertThrows(() => { + // Note: Deno.stat throws ERROR_INVALID_NAME (os error 123) instead of + // ERROR_FILE_NOT_FOUND (os error 2) on windows. This case checks that + // ERROR_INVALID_NAME is mapped to ENOENT correctly on node compat layer. + statSync("jsr:@std/assert"); + }); + assertEquals(err.code, "ENOENT"); +}); -- cgit v1.2.3 From 92ed4d38dbef98b9353d6dd6d96abb400be56f9f Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Wed, 23 Oct 2024 13:17:43 +0530 Subject: fix(node:tls): set TLSSocket.alpnProtocol for client connections (#26476) Towards https://github.com/denoland/deno/issues/26127 --- tests/unit_node/tls_test.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests') diff --git a/tests/unit_node/tls_test.ts b/tests/unit_node/tls_test.ts index 847ec2dde..236dab208 100644 --- a/tests/unit_node/tls_test.ts +++ b/tests/unit_node/tls_test.ts @@ -235,3 +235,31 @@ Deno.test("tls.rootCertificates is not empty", () => { (tls.rootCertificates as string[]).push("new cert"); }, TypeError); }); + +Deno.test("TLSSocket.alpnProtocol is set for client", async () => { + const listener = Deno.listenTls({ + hostname: "localhost", + port: 0, + key, + cert, + alpnProtocols: ["a"], + }); + const outgoing = tls.connect({ + host: "::1", + servername: "localhost", + port: listener.addr.port, + ALPNProtocols: ["a"], + secureContext: { + ca: rootCaCert, + // deno-lint-ignore no-explicit-any + } as any, + }); + + const conn = await listener.accept(); + const handshake = await conn.handshake(); + assertEquals(handshake.alpnProtocol, "a"); + conn.close(); + outgoing.destroy(); + listener.close(); + await new Promise((resolve) => outgoing.on("close", resolve)); +}); -- cgit v1.2.3 From 69e1d7a4edb45c8b4cb15f64ee89cec8a693be5e Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:01:45 -0700 Subject: fix(install): cache type only module deps in `deno install` (#26497) Fixes https://github.com/denoland/deno/issues/26180. --- tests/registry/jsr/@denotest/type-only-import/1.0.0/foo.ts | 3 +++ tests/registry/jsr/@denotest/type-only-import/1.0.0/mod.ts | 3 +++ tests/registry/jsr/@denotest/type-only-import/1.0.0_meta.json | 5 +++++ tests/registry/jsr/@denotest/type-only-import/meta.json | 5 +++++ tests/specs/install/type_only_import/__test__.jsonc | 10 ++++++++++ tests/specs/install/type_only_import/install.out | 6 ++++++ tests/specs/install/type_only_import/main.ts | 3 +++ tests/specs/install/type_only_import/run.out | 2 ++ 8 files changed, 37 insertions(+) create mode 100644 tests/registry/jsr/@denotest/type-only-import/1.0.0/foo.ts create mode 100644 tests/registry/jsr/@denotest/type-only-import/1.0.0/mod.ts create mode 100644 tests/registry/jsr/@denotest/type-only-import/1.0.0_meta.json create mode 100644 tests/registry/jsr/@denotest/type-only-import/meta.json create mode 100644 tests/specs/install/type_only_import/__test__.jsonc create mode 100644 tests/specs/install/type_only_import/install.out create mode 100644 tests/specs/install/type_only_import/main.ts create mode 100644 tests/specs/install/type_only_import/run.out (limited to 'tests') diff --git a/tests/registry/jsr/@denotest/type-only-import/1.0.0/foo.ts b/tests/registry/jsr/@denotest/type-only-import/1.0.0/foo.ts new file mode 100644 index 000000000..4e09512c0 --- /dev/null +++ b/tests/registry/jsr/@denotest/type-only-import/1.0.0/foo.ts @@ -0,0 +1,3 @@ +export interface Foo { + bar: string; +} \ No newline at end of file diff --git a/tests/registry/jsr/@denotest/type-only-import/1.0.0/mod.ts b/tests/registry/jsr/@denotest/type-only-import/1.0.0/mod.ts new file mode 100644 index 000000000..093a57d8a --- /dev/null +++ b/tests/registry/jsr/@denotest/type-only-import/1.0.0/mod.ts @@ -0,0 +1,3 @@ +import type { Foo } from "./foo.ts"; + +export const foo: Foo = { bar: "foo" }; \ No newline at end of file diff --git a/tests/registry/jsr/@denotest/type-only-import/1.0.0_meta.json b/tests/registry/jsr/@denotest/type-only-import/1.0.0_meta.json new file mode 100644 index 000000000..631a18d0e --- /dev/null +++ b/tests/registry/jsr/@denotest/type-only-import/1.0.0_meta.json @@ -0,0 +1,5 @@ +{ + "exports": { + ".": "./mod.ts" + } +} diff --git a/tests/registry/jsr/@denotest/type-only-import/meta.json b/tests/registry/jsr/@denotest/type-only-import/meta.json new file mode 100644 index 000000000..02601e4d0 --- /dev/null +++ b/tests/registry/jsr/@denotest/type-only-import/meta.json @@ -0,0 +1,5 @@ +{ + "versions": { + "1.0.0": {} + } +} diff --git a/tests/specs/install/type_only_import/__test__.jsonc b/tests/specs/install/type_only_import/__test__.jsonc new file mode 100644 index 000000000..22b8134ac --- /dev/null +++ b/tests/specs/install/type_only_import/__test__.jsonc @@ -0,0 +1,10 @@ +{ + "tempDir": true, + "steps": [ + { "args": "install -e main.ts", "output": "install.out" }, + { + "args": "run --check --cached-only main.ts", + "output": "run.out" + } + ] +} diff --git a/tests/specs/install/type_only_import/install.out b/tests/specs/install/type_only_import/install.out new file mode 100644 index 000000000..1bdbec4e5 --- /dev/null +++ b/tests/specs/install/type_only_import/install.out @@ -0,0 +1,6 @@ +Download http://127.0.0.1:4250/@denotest/type-only-import/meta.json +Download http://127.0.0.1:4250/@denotest/type-only-import/1.0.0_meta.json +[UNORDERED_START] +Download http://127.0.0.1:4250/@denotest/type-only-import/1.0.0/mod.ts +Download http://127.0.0.1:4250/@denotest/type-only-import/1.0.0/foo.ts +[UNORDERED_END] diff --git a/tests/specs/install/type_only_import/main.ts b/tests/specs/install/type_only_import/main.ts new file mode 100644 index 000000000..bf22935a2 --- /dev/null +++ b/tests/specs/install/type_only_import/main.ts @@ -0,0 +1,3 @@ +import { foo } from "jsr:@denotest/type-only-import"; + +console.log(foo.bar); diff --git a/tests/specs/install/type_only_import/run.out b/tests/specs/install/type_only_import/run.out new file mode 100644 index 000000000..d36ac8aa3 --- /dev/null +++ b/tests/specs/install/type_only_import/run.out @@ -0,0 +1,2 @@ +Check [WILDCARD]main.ts +foo -- cgit v1.2.3 From 6d587cbfc800a627efb32d377b260954ccd7a1ed Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Wed, 23 Oct 2024 20:12:52 -0700 Subject: fix(install): cache all exports of JSR packages listed in `deno.json` (#26501) Fixes #26498. This was a sort of intentional decision originally, as I wanted to avoid caching extra files that may not be needed. It seems like that behavior is unintuitive, so I propose we cache all of the exports of listed jsr packages when you run a bare `deno install`. --- tests/specs/install/jsr_exports/__test__.jsonc | 6 ++++++ tests/specs/install/jsr_exports/deno.json | 5 +++++ tests/specs/install/jsr_exports/install.out | 12 ++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 tests/specs/install/jsr_exports/__test__.jsonc create mode 100644 tests/specs/install/jsr_exports/deno.json create mode 100644 tests/specs/install/jsr_exports/install.out (limited to 'tests') diff --git a/tests/specs/install/jsr_exports/__test__.jsonc b/tests/specs/install/jsr_exports/__test__.jsonc new file mode 100644 index 000000000..934f3c588 --- /dev/null +++ b/tests/specs/install/jsr_exports/__test__.jsonc @@ -0,0 +1,6 @@ +{ + "tempDir": true, + "steps": [ + { "args": "install", "output": "install.out" } + ] +} diff --git a/tests/specs/install/jsr_exports/deno.json b/tests/specs/install/jsr_exports/deno.json new file mode 100644 index 000000000..21212f579 --- /dev/null +++ b/tests/specs/install/jsr_exports/deno.json @@ -0,0 +1,5 @@ +{ + "imports": { + "@denotest/different-deps-per-export": "jsr:@denotest/different-deps-per-export@^1.0.0" + } +} diff --git a/tests/specs/install/jsr_exports/install.out b/tests/specs/install/jsr_exports/install.out new file mode 100644 index 000000000..8f6400163 --- /dev/null +++ b/tests/specs/install/jsr_exports/install.out @@ -0,0 +1,12 @@ +[UNORDERED_START] +Download http://127.0.0.1:4250/@denotest/different-deps-per-export/meta.json +Download http://127.0.0.1:4250/@denotest/different-deps-per-export/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/different-deps-per-export/1.0.0/add.ts +Download http://127.0.0.1:4250/@denotest/different-deps-per-export/1.0.0/subtract.ts +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] -- cgit v1.2.3 From fa49fd404be82daf8ac7228bf54e780135f67b17 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Thu, 24 Oct 2024 09:41:38 +0530 Subject: fix(ext/ffi): return u64/i64 as bigints from nonblocking ffi calls (#26486) Fixes https://github.com/denoland/deno/issues/25194 --- tests/ffi/tests/integration_tests.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/ffi/tests/integration_tests.rs b/tests/ffi/tests/integration_tests.rs index c84a1b820..dbc0036bc 100644 --- a/tests/ffi/tests/integration_tests.rs +++ b/tests/ffi/tests/integration_tests.rs @@ -95,10 +95,10 @@ fn basic() { 579.912\n\ 579.912\n\ 579\n\ - 8589934590\n\ - -8589934590\n\ - 8589934590\n\ - -8589934590\n\ + 8589934590n\n\ + -8589934590n\n\ + 8589934590n\n\ + -8589934590n\n\ 9007199254740992n\n\ 9007199254740992n\n\ -9007199254740992n\n\ -- cgit v1.2.3 From 7c57105cc41cf16c5f48f85d85c7fd9bd3bb4d1f Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Wed, 23 Oct 2024 21:13:30 -0700 Subject: fix(ext/node): only set our end of child process pipe to nonblocking mode (#26495) Fixes playwright on linux, as reported in https://github.com/denoland/deno/issues/16899#issuecomment-2378268454. The issue was that we were opening the socket in nonblocking mode, which meant that subprocesses trying to use it would get a `EWOULDBLOCK` error (unexpectedly). The fix here is to only set nonblocking mode on our end (which we need to use asynchronously) --- .../specs/node/child_process_extra_pipes/main.out | 2 +- tests/specs/node/child_process_extra_pipes/main.ts | 20 +++++++++++++---- .../test-pipe/src/main.rs | 25 +++++++++++++++++++--- 3 files changed, 39 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/specs/node/child_process_extra_pipes/main.out b/tests/specs/node/child_process_extra_pipes/main.out index 694126b92..436afd2f7 100644 --- a/tests/specs/node/child_process_extra_pipes/main.out +++ b/tests/specs/node/child_process_extra_pipes/main.out @@ -1,5 +1,5 @@ -data: hello world [UNORDERED_START] child closed +got: hello world pipe closed [UNORDERED_END] diff --git a/tests/specs/node/child_process_extra_pipes/main.ts b/tests/specs/node/child_process_extra_pipes/main.ts index a3683fe9e..2837cdc53 100644 --- a/tests/specs/node/child_process_extra_pipes/main.ts +++ b/tests/specs/node/child_process_extra_pipes/main.ts @@ -1,5 +1,4 @@ import child_process from "node:child_process"; -import { Buffer } from "node:buffer"; import console from "node:console"; const child = child_process.spawn("./test-pipe/target/debug/test-pipe", [], { @@ -8,19 +7,32 @@ const child = child_process.spawn("./test-pipe/target/debug/test-pipe", [], { const extra = child.stdio[4]; -const p = Promise.withResolvers(); +if (!extra) { + throw new Error("no extra pipe"); +} + +const p = Promise.withResolvers(); + +let got = ""; child.on("close", () => { console.log("child closed"); - p.resolve(); + console.log("got:", got); + if (got === "hello world") { + p.resolve(); + } else { + p.reject(new Error(`wanted "hello world", got "${got}"`)); + } }); extra.on("data", (d) => { - console.log("data:", d.toString().trim()); + got += d.toString(); }); extra.on("close", () => { console.log("pipe closed"); }); +extra.write("start"); + await p.promise; diff --git a/tests/specs/node/child_process_extra_pipes/test-pipe/src/main.rs b/tests/specs/node/child_process_extra_pipes/test-pipe/src/main.rs index 192f82731..acc034830 100644 --- a/tests/specs/node/child_process_extra_pipes/test-pipe/src/main.rs +++ b/tests/specs/node/child_process_extra_pipes/test-pipe/src/main.rs @@ -1,12 +1,31 @@ +use std::fs::File; use std::io::prelude::*; use std::os::fd::FromRawFd; -use std::os::unix::net::UnixStream; fn main() { #[cfg(unix)] { - let mut stream = unsafe { UnixStream::from_raw_fd(4) }; + let mut pipe = unsafe { File::from_raw_fd(4) }; - stream.write_all(b"hello world\n").unwrap(); + let mut read = 0; + let mut buf = [0u8; 1024]; + loop { + if read > 4 { + assert_eq!(&buf[..5], b"start"); + break; + } + match pipe.read(&mut buf) { + Ok(n) => { + read += n; + } + Ok(0) => { + return; + } + Err(e) => { + eprintln!("GOT ERROR: {e:?}"); + } + } + } + pipe.write_all(b"hello world").unwrap(); } } -- cgit v1.2.3 From ef53ce3ac40e2c545397669e61e4e92423555d94 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Thu, 24 Oct 2024 11:46:51 +0200 Subject: fix(node/util): support array formats in `styleText` (#26507) We missed adding support for an array of formats being passed to `util.styleText`. Fixes https://github.com/denoland/deno/issues/26496 --- tests/unit_node/util_test.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/unit_node/util_test.ts b/tests/unit_node/util_test.ts index a47c231a1..6267018b1 100644 --- a/tests/unit_node/util_test.ts +++ b/tests/unit_node/util_test.ts @@ -353,3 +353,8 @@ Deno.test("[util] styleText()", () => { const redText = util.styleText("red", "error"); assertEquals(redText, "\x1B[31merror\x1B[39m"); }); + +Deno.test("[util] styleText() with array of formats", () => { + const colored = util.styleText(["red", "green"], "error"); + assertEquals(colored, "\x1b[32m\x1b[31merror\x1b[39m\x1b[39m"); +}); -- cgit v1.2.3 From 5f0bb3c6f4328003012e98ba70ce18e4e2e842de Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Thu, 24 Oct 2024 20:03:56 +0200 Subject: fix: `.npmrc` settings not being passed to install/add command (#26473) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We weren't passing the resolved npmrc settings to the install commands. This lead us to always fall back to the default registry url instead of using the one from npmrc. Fixes https://github.com/denoland/deno/issues/26139 Fixes https://github.com/denoland/deno/issues/26033 Fixes https://github.com/denoland/deno/issues/25924 Fixes https://github.com/denoland/deno/issues/25822 Fixes https://github.com/denoland/deno/issues/26152 --------- Co-authored-by: Bartek Iwańczuk --- .../npm-private3/@denotest3/basic/1.0.0/main.d.mts | 3 ++ .../npm-private3/@denotest3/basic/1.0.0/main.mjs | 11 ++++++++ .../npm-private3/@denotest3/basic/1.0.0/other.mjs | 3 ++ .../@denotest3/basic/1.0.0/package.json | 7 +++++ tests/specs/npm/npmrc_install_arg/.npmrc | 2 ++ tests/specs/npm/npmrc_install_arg/__test__.jsonc | 23 ++++++++++++++++ tests/specs/npm/npmrc_install_arg/add.out | 4 +++ tests/specs/npm/npmrc_install_arg/install.out | 4 +++ tests/specs/npm/npmrc_install_arg/main.js | 5 ++++ tests/specs/npm/npmrc_install_arg/main.out | 2 ++ tests/specs/npm/npmrc_install_arg/package.json | 5 ++++ tests/specs/npm/npmrc_no_auth/.npmrc | 1 + tests/specs/npm/npmrc_no_auth/__test__.jsonc | 23 ++++++++++++++++ tests/specs/npm/npmrc_no_auth/add.out | 4 +++ tests/specs/npm/npmrc_no_auth/install.out | 4 +++ tests/specs/npm/npmrc_no_auth/main.js | 5 ++++ tests/specs/npm/npmrc_no_auth/main.out | 2 ++ tests/specs/npm/npmrc_no_auth/package.json | 6 ++++ tests/specs/npm/npmrc_no_auth_install/.npmrc | 1 + .../specs/npm/npmrc_no_auth_install/__test__.jsonc | 14 ++++++++++ tests/specs/npm/npmrc_no_auth_install/install.out | 3 ++ tests/specs/npm/npmrc_no_auth_install/main.js | 5 ++++ tests/specs/npm/npmrc_no_auth_install/main.out | 2 ++ tests/specs/npm/npmrc_no_auth_install/package.json | 7 +++++ tests/util/server/src/lib.rs | 3 +- tests/util/server/src/npm.rs | 32 ++++++++++++++++++++++ tests/util/server/src/servers/mod.rs | 4 +++ tests/util/server/src/servers/npm_registry.rs | 15 ++++++++++ 28 files changed, 199 insertions(+), 1 deletion(-) create mode 100644 tests/registry/npm-private3/@denotest3/basic/1.0.0/main.d.mts create mode 100644 tests/registry/npm-private3/@denotest3/basic/1.0.0/main.mjs create mode 100644 tests/registry/npm-private3/@denotest3/basic/1.0.0/other.mjs create mode 100644 tests/registry/npm-private3/@denotest3/basic/1.0.0/package.json create mode 100644 tests/specs/npm/npmrc_install_arg/.npmrc create mode 100644 tests/specs/npm/npmrc_install_arg/__test__.jsonc create mode 100644 tests/specs/npm/npmrc_install_arg/add.out create mode 100644 tests/specs/npm/npmrc_install_arg/install.out create mode 100644 tests/specs/npm/npmrc_install_arg/main.js create mode 100644 tests/specs/npm/npmrc_install_arg/main.out create mode 100644 tests/specs/npm/npmrc_install_arg/package.json create mode 100644 tests/specs/npm/npmrc_no_auth/.npmrc create mode 100644 tests/specs/npm/npmrc_no_auth/__test__.jsonc create mode 100644 tests/specs/npm/npmrc_no_auth/add.out create mode 100644 tests/specs/npm/npmrc_no_auth/install.out create mode 100644 tests/specs/npm/npmrc_no_auth/main.js create mode 100644 tests/specs/npm/npmrc_no_auth/main.out create mode 100644 tests/specs/npm/npmrc_no_auth/package.json create mode 100644 tests/specs/npm/npmrc_no_auth_install/.npmrc create mode 100644 tests/specs/npm/npmrc_no_auth_install/__test__.jsonc create mode 100644 tests/specs/npm/npmrc_no_auth_install/install.out create mode 100644 tests/specs/npm/npmrc_no_auth_install/main.js create mode 100644 tests/specs/npm/npmrc_no_auth_install/main.out create mode 100644 tests/specs/npm/npmrc_no_auth_install/package.json (limited to 'tests') diff --git a/tests/registry/npm-private3/@denotest3/basic/1.0.0/main.d.mts b/tests/registry/npm-private3/@denotest3/basic/1.0.0/main.d.mts new file mode 100644 index 000000000..29da1e6d7 --- /dev/null +++ b/tests/registry/npm-private3/@denotest3/basic/1.0.0/main.d.mts @@ -0,0 +1,3 @@ +export declare function setValue(val: number): void; +export declare function getValue(): number; +export declare const url: string; diff --git a/tests/registry/npm-private3/@denotest3/basic/1.0.0/main.mjs b/tests/registry/npm-private3/@denotest3/basic/1.0.0/main.mjs new file mode 100644 index 000000000..0a44f7585 --- /dev/null +++ b/tests/registry/npm-private3/@denotest3/basic/1.0.0/main.mjs @@ -0,0 +1,11 @@ +let value = 0; + +export function setValue(newValue) { + value = newValue; +} + +export function getValue() { + return value; +} + +export const url = import.meta.url; diff --git a/tests/registry/npm-private3/@denotest3/basic/1.0.0/other.mjs b/tests/registry/npm-private3/@denotest3/basic/1.0.0/other.mjs new file mode 100644 index 000000000..00ed99da4 --- /dev/null +++ b/tests/registry/npm-private3/@denotest3/basic/1.0.0/other.mjs @@ -0,0 +1,3 @@ +export function hello() { + return "hello, world!"; +} \ No newline at end of file diff --git a/tests/registry/npm-private3/@denotest3/basic/1.0.0/package.json b/tests/registry/npm-private3/@denotest3/basic/1.0.0/package.json new file mode 100644 index 000000000..ce6ea3383 --- /dev/null +++ b/tests/registry/npm-private3/@denotest3/basic/1.0.0/package.json @@ -0,0 +1,7 @@ +{ + "name": "@denotest3/basic", + "version": "1.0.0", + "type": "module", + "main": "main.mjs", + "types": "main.d.mts" +} diff --git a/tests/specs/npm/npmrc_install_arg/.npmrc b/tests/specs/npm/npmrc_install_arg/.npmrc new file mode 100644 index 000000000..de3704b92 --- /dev/null +++ b/tests/specs/npm/npmrc_install_arg/.npmrc @@ -0,0 +1,2 @@ +@denotest:registry=http://localhost:4261/ +//localhost:4261/:_authToken=private-reg-token diff --git a/tests/specs/npm/npmrc_install_arg/__test__.jsonc b/tests/specs/npm/npmrc_install_arg/__test__.jsonc new file mode 100644 index 000000000..f34cfe116 --- /dev/null +++ b/tests/specs/npm/npmrc_install_arg/__test__.jsonc @@ -0,0 +1,23 @@ +{ + "tempDir": true, + "tests": { + "deno_install_add": { + "steps": [{ + "args": "install npm:@denotest/basic", + "output": "install.out" + }, { + "args": "run -A main.js", + "output": "main.out" + }] + }, + "deno_add": { + "steps": [{ + "args": "add npm:@denotest/basic", + "output": "add.out" + }, { + "args": "run -A main.js", + "output": "main.out" + }] + } + } +} diff --git a/tests/specs/npm/npmrc_install_arg/add.out b/tests/specs/npm/npmrc_install_arg/add.out new file mode 100644 index 000000000..11948e54d --- /dev/null +++ b/tests/specs/npm/npmrc_install_arg/add.out @@ -0,0 +1,4 @@ +Add npm:@denotest/basic@1.0.0 +Download http://localhost:4261/@denotest%2fbasic +Download http://localhost:4261/@denotest/basic/1.0.0.tgz +Initialize @denotest/basic@1.0.0 diff --git a/tests/specs/npm/npmrc_install_arg/install.out b/tests/specs/npm/npmrc_install_arg/install.out new file mode 100644 index 000000000..11948e54d --- /dev/null +++ b/tests/specs/npm/npmrc_install_arg/install.out @@ -0,0 +1,4 @@ +Add npm:@denotest/basic@1.0.0 +Download http://localhost:4261/@denotest%2fbasic +Download http://localhost:4261/@denotest/basic/1.0.0.tgz +Initialize @denotest/basic@1.0.0 diff --git a/tests/specs/npm/npmrc_install_arg/main.js b/tests/specs/npm/npmrc_install_arg/main.js new file mode 100644 index 000000000..e8ccf7611 --- /dev/null +++ b/tests/specs/npm/npmrc_install_arg/main.js @@ -0,0 +1,5 @@ +import { getValue, setValue } from "@denotest/basic"; + +console.log(getValue()); +setValue(42); +console.log(getValue()); diff --git a/tests/specs/npm/npmrc_install_arg/main.out b/tests/specs/npm/npmrc_install_arg/main.out new file mode 100644 index 000000000..dcd912c89 --- /dev/null +++ b/tests/specs/npm/npmrc_install_arg/main.out @@ -0,0 +1,2 @@ +0 +42 diff --git a/tests/specs/npm/npmrc_install_arg/package.json b/tests/specs/npm/npmrc_install_arg/package.json new file mode 100644 index 000000000..c1318b361 --- /dev/null +++ b/tests/specs/npm/npmrc_install_arg/package.json @@ -0,0 +1,5 @@ +{ + "name": "npmrc_test", + "version": "0.0.1", + "dependencies": {} +} diff --git a/tests/specs/npm/npmrc_no_auth/.npmrc b/tests/specs/npm/npmrc_no_auth/.npmrc new file mode 100644 index 000000000..860a7c3d9 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth/.npmrc @@ -0,0 +1 @@ +@denotest3:registry=http://localhost:4263/ diff --git a/tests/specs/npm/npmrc_no_auth/__test__.jsonc b/tests/specs/npm/npmrc_no_auth/__test__.jsonc new file mode 100644 index 000000000..efd04f0e4 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth/__test__.jsonc @@ -0,0 +1,23 @@ +{ + "tempDir": true, + "tests": { + "deno_install_arg": { + "steps": [{ + "args": "install npm:@denotest3/basic", + "output": "install.out" + }, { + "args": "run -A main.js", + "output": "main.out" + }] + }, + "deno_add_arg": { + "steps": [{ + "args": "add npm:@denotest3/basic", + "output": "add.out" + }, { + "args": "run -A main.js", + "output": "main.out" + }] + } + } +} diff --git a/tests/specs/npm/npmrc_no_auth/add.out b/tests/specs/npm/npmrc_no_auth/add.out new file mode 100644 index 000000000..31b34da13 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth/add.out @@ -0,0 +1,4 @@ +Add npm:@denotest3/basic@1.0.0 +Download http://localhost:4263/@denotest3%2fbasic +Download http://localhost:4263/@denotest3/basic/1.0.0.tgz +Initialize @denotest3/basic@1.0.0 diff --git a/tests/specs/npm/npmrc_no_auth/install.out b/tests/specs/npm/npmrc_no_auth/install.out new file mode 100644 index 000000000..31b34da13 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth/install.out @@ -0,0 +1,4 @@ +Add npm:@denotest3/basic@1.0.0 +Download http://localhost:4263/@denotest3%2fbasic +Download http://localhost:4263/@denotest3/basic/1.0.0.tgz +Initialize @denotest3/basic@1.0.0 diff --git a/tests/specs/npm/npmrc_no_auth/main.js b/tests/specs/npm/npmrc_no_auth/main.js new file mode 100644 index 000000000..22713bb0d --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth/main.js @@ -0,0 +1,5 @@ +import { getValue, setValue } from "@denotest3/basic"; + +console.log(getValue()); +setValue(42); +console.log(getValue()); diff --git a/tests/specs/npm/npmrc_no_auth/main.out b/tests/specs/npm/npmrc_no_auth/main.out new file mode 100644 index 000000000..dcd912c89 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth/main.out @@ -0,0 +1,2 @@ +0 +42 diff --git a/tests/specs/npm/npmrc_no_auth/package.json b/tests/specs/npm/npmrc_no_auth/package.json new file mode 100644 index 000000000..dddaaac46 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth/package.json @@ -0,0 +1,6 @@ +{ + "name": "npmrc_test", + "version": "0.0.1", + "dependencies": { + } +} diff --git a/tests/specs/npm/npmrc_no_auth_install/.npmrc b/tests/specs/npm/npmrc_no_auth_install/.npmrc new file mode 100644 index 000000000..860a7c3d9 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth_install/.npmrc @@ -0,0 +1 @@ +@denotest3:registry=http://localhost:4263/ diff --git a/tests/specs/npm/npmrc_no_auth_install/__test__.jsonc b/tests/specs/npm/npmrc_no_auth_install/__test__.jsonc new file mode 100644 index 000000000..56a598e3b --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth_install/__test__.jsonc @@ -0,0 +1,14 @@ +{ + "tempDir": true, + "tests": { + "deno_install_arg": { + "steps": [{ + "args": "install", + "output": "install.out" + }, { + "args": "run -A main.js", + "output": "main.out" + }] + } + } +} diff --git a/tests/specs/npm/npmrc_no_auth_install/install.out b/tests/specs/npm/npmrc_no_auth_install/install.out new file mode 100644 index 000000000..b82747af7 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth_install/install.out @@ -0,0 +1,3 @@ +Download http://localhost:4263/@denotest3%2fbasic +Download http://localhost:4263/@denotest3/basic/1.0.0.tgz +Initialize @denotest3/basic@1.0.0 diff --git a/tests/specs/npm/npmrc_no_auth_install/main.js b/tests/specs/npm/npmrc_no_auth_install/main.js new file mode 100644 index 000000000..22713bb0d --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth_install/main.js @@ -0,0 +1,5 @@ +import { getValue, setValue } from "@denotest3/basic"; + +console.log(getValue()); +setValue(42); +console.log(getValue()); diff --git a/tests/specs/npm/npmrc_no_auth_install/main.out b/tests/specs/npm/npmrc_no_auth_install/main.out new file mode 100644 index 000000000..dcd912c89 --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth_install/main.out @@ -0,0 +1,2 @@ +0 +42 diff --git a/tests/specs/npm/npmrc_no_auth_install/package.json b/tests/specs/npm/npmrc_no_auth_install/package.json new file mode 100644 index 000000000..2d4fb15ba --- /dev/null +++ b/tests/specs/npm/npmrc_no_auth_install/package.json @@ -0,0 +1,7 @@ +{ + "name": "npmrc_test", + "version": "0.0.1", + "dependencies": { + "@denotest3/basic": "1.0.0" + } +} diff --git a/tests/util/server/src/lib.rs b/tests/util/server/src/lib.rs index 88e8287e0..e4a2cc02e 100644 --- a/tests/util/server/src/lib.rs +++ b/tests/util/server/src/lib.rs @@ -307,7 +307,7 @@ async fn get_tcp_listener_stream( futures::stream::select_all(listeners) } -pub const TEST_SERVERS_COUNT: usize = 30; +pub const TEST_SERVERS_COUNT: usize = 32; #[derive(Default)] struct HttpServerCount { @@ -360,6 +360,7 @@ impl Default for HttpServerStarter { let mut ready_count = 0; for maybe_line in lines { if let Ok(line) = maybe_line { + eprintln!("LINE: {}", line); if line.starts_with("ready:") { ready_count += 1; } diff --git a/tests/util/server/src/npm.rs b/tests/util/server/src/npm.rs index f1c341738..4b17b95f7 100644 --- a/tests/util/server/src/npm.rs +++ b/tests/util/server/src/npm.rs @@ -18,6 +18,7 @@ use crate::PathRef; pub const DENOTEST_SCOPE_NAME: &str = "@denotest"; pub const DENOTEST2_SCOPE_NAME: &str = "@denotest2"; +pub const DENOTEST3_SCOPE_NAME: &str = "@denotest3"; pub static PUBLIC_TEST_NPM_REGISTRY: Lazy = Lazy::new(|| { TestNpmRegistry::new( @@ -54,6 +55,18 @@ pub static PRIVATE_TEST_NPM_REGISTRY_2: Lazy = ) }); +pub static PRIVATE_TEST_NPM_REGISTRY_3: Lazy = + Lazy::new(|| { + TestNpmRegistry::new( + NpmRegistryKind::Private, + &format!( + "http://localhost:{}", + crate::servers::PRIVATE_NPM_REGISTRY_3_PORT + ), + "npm-private3", + ) + }); + pub enum NpmRegistryKind { Public, Private, @@ -90,6 +103,7 @@ impl TestNpmRegistry { } pub fn root_dir(&self) -> PathRef { + eprintln!("root {}", self.local_path); tests_path().join("registry").join(&self.local_path) } @@ -106,6 +120,7 @@ impl TestNpmRegistry { } pub fn registry_file(&self, name: &str) -> Result>> { + eprintln!("registry file {}", name); self.get_package_property(name, |p| p.registry_file.as_bytes().to_vec()) } @@ -123,6 +138,7 @@ impl TestNpmRegistry { package_name: &str, func: impl FnOnce(&CustomNpmPackage) -> TResult, ) -> Result> { + eprintln!("get package property {}", package_name); // it's ok if multiple threads race here as they will do the same work twice if !self.cache.lock().contains_key(package_name) { match get_npm_package(&self.hostname, &self.local_path, package_name)? { @@ -139,6 +155,7 @@ impl TestNpmRegistry { &self, uri_path: &'s str, ) -> Option<(&'s str, &'s str)> { + eprintln!("GEETT {}", uri_path); let prefix1 = format!("/{}/", DENOTEST_SCOPE_NAME); let prefix2 = format!("/{}%2f", DENOTEST_SCOPE_NAME); @@ -161,6 +178,17 @@ impl TestNpmRegistry { return Some((DENOTEST2_SCOPE_NAME, package_name_with_path)); } + let prefix1 = format!("/{}/", DENOTEST3_SCOPE_NAME); + let prefix2 = format!("/{}%2f", DENOTEST3_SCOPE_NAME); + + let maybe_package_name_with_path = uri_path + .strip_prefix(&prefix1) + .or_else(|| uri_path.strip_prefix(&prefix2)); + + if let Some(package_name_with_path) = maybe_package_name_with_path { + return Some((DENOTEST3_SCOPE_NAME, package_name_with_path)); + } + None } } @@ -170,6 +198,10 @@ fn get_npm_package( local_path: &str, package_name: &str, ) -> Result> { + eprintln!( + "get npm package {} {} {}", + registry_hostname, local_path, package_name + ); let registry_hostname = if package_name == "@denotest/tarballs-privateserver2" { "http://localhost:4262" diff --git a/tests/util/server/src/servers/mod.rs b/tests/util/server/src/servers/mod.rs index 3e18aafce..3a9c44010 100644 --- a/tests/util/server/src/servers/mod.rs +++ b/tests/util/server/src/servers/mod.rs @@ -91,6 +91,7 @@ const PROVENANCE_MOCK_SERVER_PORT: u16 = 4251; pub(crate) const PUBLIC_NPM_REGISTRY_PORT: u16 = 4260; pub(crate) const PRIVATE_NPM_REGISTRY_1_PORT: u16 = 4261; pub(crate) const PRIVATE_NPM_REGISTRY_2_PORT: u16 = 4262; +pub(crate) const PRIVATE_NPM_REGISTRY_3_PORT: u16 = 4263; // Use the single-threaded scheduler. The hyper server is used as a point of // comparison for the (single-threaded!) benchmarks in cli/bench. We're not @@ -143,6 +144,8 @@ pub async fn run_all_servers() { npm_registry::private_npm_registry1(PRIVATE_NPM_REGISTRY_1_PORT); let private_npm_registry_2_server_futs = npm_registry::private_npm_registry2(PRIVATE_NPM_REGISTRY_2_PORT); + let private_npm_registry_3_server_futs = + npm_registry::private_npm_registry3(PRIVATE_NPM_REGISTRY_3_PORT); let mut futures = vec![ redirect_server_fut.boxed_local(), @@ -173,6 +176,7 @@ pub async fn run_all_servers() { futures.extend(npm_registry_server_futs); futures.extend(private_npm_registry_1_server_futs); futures.extend(private_npm_registry_2_server_futs); + futures.extend(private_npm_registry_3_server_futs); assert_eq!(futures.len(), TEST_SERVERS_COUNT); diff --git a/tests/util/server/src/servers/npm_registry.rs b/tests/util/server/src/servers/npm_registry.rs index acbd9cab4..4ada468fa 100644 --- a/tests/util/server/src/servers/npm_registry.rs +++ b/tests/util/server/src/servers/npm_registry.rs @@ -56,6 +56,14 @@ pub fn private_npm_registry2(port: u16) -> Vec> { ) } +pub fn private_npm_registry3(port: u16) -> Vec> { + run_npm_server( + port, + "npm private registry server error", + private_npm_registry3_handler, + ) +} + fn run_npm_server( port: u16, error_msg: &'static str, @@ -141,6 +149,13 @@ async fn private_npm_registry2_handler( handle_req_for_registry(req, &npm::PRIVATE_TEST_NPM_REGISTRY_2).await } +async fn private_npm_registry3_handler( + req: Request, +) -> Result>, anyhow::Error> { + // No auth for this registry + handle_req_for_registry(req, &npm::PRIVATE_TEST_NPM_REGISTRY_3).await +} + async fn handle_req_for_registry( req: Request, test_npm_registry: &npm::TestNpmRegistry, -- cgit v1.2.3 From eedf243b5ea98d22649bb0445444719a2fc12c59 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 24 Oct 2024 15:48:48 -0400 Subject: perf(compile): pass module source data from binary directly to v8 (#26494) This changes denort to pass a static reference of the moude source bytes found in the binary to v8 instead of copying it. --- tests/specs/compile/byonm_main_sub_dir/deno.json | 2 +- tests/specs/compile/detect_cjs/output.out | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/specs/compile/byonm_main_sub_dir/deno.json b/tests/specs/compile/byonm_main_sub_dir/deno.json index 6134d86d1..fde86a1ef 100644 --- a/tests/specs/compile/byonm_main_sub_dir/deno.json +++ b/tests/specs/compile/byonm_main_sub_dir/deno.json @@ -1,3 +1,3 @@ { - "unstable": ["byonm"] + "nodeModulesDir": "manual" } diff --git a/tests/specs/compile/detect_cjs/output.out b/tests/specs/compile/detect_cjs/output.out index b53c44369..e1c27b8dc 100644 --- a/tests/specs/compile/detect_cjs/output.out +++ b/tests/specs/compile/detect_cjs/output.out @@ -1 +1,2 @@ -error: Module not found: file:///[WILDLINE]/add.js +error: Uncaught SyntaxError: The requested module './add.js' does not provide an export named 'add' + at (file:///[WILDLINE]) -- cgit v1.2.3 From 8dd6177c624649d75ffcacca77e7c4f48cea07a2 Mon Sep 17 00:00:00 2001 From: Nicola Bovolato <61934734+nicolabovolato@users.noreply.github.com> Date: Fri, 25 Oct 2024 00:02:26 +0200 Subject: fix(ext/node): refactor http.ServerResponse into function class (#26210) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While testing, I found out that light-my-request relies on `ServerResponse.connection`, which is deprecated, so I added that and `socket`, the non deprecated property. It also relies on an undocumented `_header` property, apparently for [raw header processing](https://github.com/fastify/light-my-request/blob/v6.1.0/lib/response.js#L180-L186). I added it as an empty string, feel free to provide other approaches. Fixes #19901 Co-authored-by: Bartek Iwańczuk --- tests/unit_node/http_test.ts | 80 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 78 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/unit_node/http_test.ts b/tests/unit_node/http_test.ts index 0faf7fb34..84d6f5727 100644 --- a/tests/unit_node/http_test.ts +++ b/tests/unit_node/http_test.ts @@ -3,10 +3,14 @@ // deno-lint-ignore-file no-console import EventEmitter from "node:events"; -import http, { type RequestOptions, type ServerResponse } from "node:http"; +import http, { + IncomingMessage, + type RequestOptions, + ServerResponse, +} from "node:http"; import url from "node:url"; import https from "node:https"; -import net from "node:net"; +import net, { Socket } from "node:net"; import fs from "node:fs"; import { text } from "node:stream/consumers"; @@ -1704,3 +1708,75 @@ Deno.test("[node/http] upgraded socket closes when the server closed without clo await clientSocketClosed.promise; await serverProcessClosed.promise; }); + +// deno-lint-ignore require-await +Deno.test("[node/http] ServerResponse.call()", async () => { + function Wrapper(this: unknown, req: IncomingMessage) { + ServerResponse.call(this, req); + } + Object.setPrototypeOf(Wrapper.prototype, ServerResponse.prototype); + + // deno-lint-ignore no-explicit-any + const wrapper = new (Wrapper as any)(new IncomingMessage(new Socket())); + + assert(wrapper instanceof ServerResponse); +}); + +Deno.test("[node/http] ServerResponse _header", async () => { + const { promise, resolve } = Promise.withResolvers(); + const server = http.createServer((_req, res) => { + assert(Object.hasOwn(res, "_header")); + res.end(); + }); + + server.listen(async () => { + const { port } = server.address() as { port: number }; + const res = await fetch(`http://localhost:${port}`); + await res.body?.cancel(); + server.close(() => { + resolve(); + }); + }); + + await promise; +}); + +Deno.test("[node/http] ServerResponse connection", async () => { + const { promise, resolve } = Promise.withResolvers(); + const server = http.createServer((_req, res) => { + assert(Object.hasOwn(res, "connection")); + assert(res.connection instanceof Socket); + res.end(); + }); + + server.listen(async () => { + const { port } = server.address() as { port: number }; + const res = await fetch(`http://localhost:${port}`); + await res.body?.cancel(); + server.close(() => { + resolve(); + }); + }); + + await promise; +}); + +Deno.test("[node/http] ServerResponse socket", async () => { + const { promise, resolve } = Promise.withResolvers(); + const server = http.createServer((_req, res) => { + assert(Object.hasOwn(res, "socket")); + assert(res.socket instanceof Socket); + res.end(); + }); + + server.listen(async () => { + const { port } = server.address() as { port: number }; + const res = await fetch(`http://localhost:${port}`); + await res.body?.cancel(); + server.close(() => { + resolve(); + }); + }); + + await promise; +}); -- cgit v1.2.3 From e16230624747eccea7636b20b952df5899719336 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 24 Oct 2024 18:06:17 -0400 Subject: chore: remove print debugging from test server (#26529) Accidentally added in https://github.com/denoland/deno/pull/26473/files --- tests/util/server/src/builders.rs | 1 + tests/util/server/src/fs.rs | 5 ++++- tests/util/server/src/lib.rs | 18 ++++++++++++------ tests/util/server/src/lsp.rs | 18 +++++++++++++----- tests/util/server/src/npm.rs | 8 -------- tests/util/server/src/pty.rs | 18 ++++++++++++------ tests/util/server/src/servers/hyper_utils.rs | 8 +++++++- tests/util/server/src/servers/mod.rs | 14 +++++++++----- tests/util/server/src/servers/ws.rs | 7 +++++++ 9 files changed, 65 insertions(+), 32 deletions(-) (limited to 'tests') diff --git a/tests/util/server/src/builders.rs b/tests/util/server/src/builders.rs index 4a4b6a761..3bf5c704a 100644 --- a/tests/util/server/src/builders.rs +++ b/tests/util/server/src/builders.rs @@ -78,6 +78,7 @@ impl DiagnosticLogger { logger.write_all(text.as_ref().as_bytes()).unwrap(); logger.write_all(b"\n").unwrap(); } + #[allow(clippy::print_stderr)] None => eprintln!("{}", text.as_ref()), } } diff --git a/tests/util/server/src/fs.rs b/tests/util/server/src/fs.rs index 47d0d61fa..7feb0799a 100644 --- a/tests/util/server/src/fs.rs +++ b/tests/util/server/src/fs.rs @@ -285,7 +285,10 @@ impl PathRef { #[track_caller] pub fn assert_matches_file(&self, wildcard_file: impl AsRef) -> &Self { let wildcard_file = testdata_path().join(wildcard_file); - println!("output path {}", wildcard_file); + #[allow(clippy::print_stdout)] + { + println!("output path {}", wildcard_file); + } let expected_text = wildcard_file.read_to_string(); self.assert_matches_text(&expected_text) } diff --git a/tests/util/server/src/lib.rs b/tests/util/server/src/lib.rs index e4a2cc02e..67dbcd820 100644 --- a/tests/util/server/src/lib.rs +++ b/tests/util/server/src/lib.rs @@ -1,8 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -#![allow(clippy::print_stdout)] -#![allow(clippy::print_stderr)] - use std::collections::HashMap; use std::env; use std::io::Write; @@ -302,7 +299,10 @@ async fn get_tcp_listener_stream( .collect::>(); // Eye catcher for HttpServerCount - println!("ready: {name} on {:?}", addresses); + #[allow(clippy::print_stdout)] + { + println!("ready: {name} on {:?}", addresses); + } futures::stream::select_all(listeners) } @@ -345,7 +345,10 @@ struct HttpServerStarter { impl Default for HttpServerStarter { fn default() -> Self { - println!("test_server starting..."); + #[allow(clippy::print_stdout)] + { + println!("test_server starting..."); + } let mut test_server = Command::new(test_server_path()) .current_dir(testdata_path()) .stdout(Stdio::piped()) @@ -360,7 +363,6 @@ impl Default for HttpServerStarter { let mut ready_count = 0; for maybe_line in lines { if let Ok(line) = maybe_line { - eprintln!("LINE: {}", line); if line.starts_with("ready:") { ready_count += 1; } @@ -480,6 +482,7 @@ pub fn run_collect( } = prog.wait_with_output().expect("failed to wait on child"); let stdout = String::from_utf8(stdout).unwrap(); let stderr = String::from_utf8(stderr).unwrap(); + #[allow(clippy::print_stderr)] if expect_success != status.success() { eprintln!("stdout: <<<{stdout}>>>"); eprintln!("stderr: <<<{stderr}>>>"); @@ -540,6 +543,7 @@ pub fn run_and_collect_output_with_args( } = deno.wait_with_output().expect("failed to wait on child"); let stdout = String::from_utf8(stdout).unwrap(); let stderr = String::from_utf8(stderr).unwrap(); + #[allow(clippy::print_stderr)] if expect_success != status.success() { eprintln!("stdout: <<<{stdout}>>>"); eprintln!("stderr: <<<{stderr}>>>"); @@ -564,6 +568,7 @@ pub fn deno_cmd_with_deno_dir(deno_dir: &TempDir) -> TestCommandBuilder { .env("JSR_URL", jsr_registry_unset_url()) } +#[allow(clippy::print_stdout)] pub fn run_powershell_script_file( script_file_path: &str, args: Vec<&str>, @@ -655,6 +660,7 @@ impl<'a> CheckOutputIntegrationTest<'a> { } pub fn wildcard_match(pattern: &str, text: &str) -> bool { + #[allow(clippy::print_stderr)] match wildcard_match_detailed(pattern, text) { WildcardMatchResult::Success => true, WildcardMatchResult::Fail(debug_output) => { diff --git a/tests/util/server/src/lsp.rs b/tests/util/server/src/lsp.rs index 4e75cfadb..d34deb216 100644 --- a/tests/util/server/src/lsp.rs +++ b/tests/util/server/src/lsp.rs @@ -157,6 +157,7 @@ impl LspStdoutReader { self.pending_messages.0.lock().len() } + #[allow(clippy::print_stderr)] pub fn output_pending_messages(&self) { let messages = self.pending_messages.0.lock(); eprintln!("{:?}", messages); @@ -573,6 +574,7 @@ impl LspClientBuilder { for line in stderr.lines() { match line { Ok(line) => { + #[allow(clippy::print_stderr)] if print_stderr { eprintln!("{}", line); } @@ -587,7 +589,10 @@ impl LspClientBuilder { continue; } Err(err) => { - eprintln!("failed to parse perf record: {:#}", err); + #[allow(clippy::print_stderr)] + { + eprintln!("failed to parse perf record: {:#}", err); + } } } } @@ -782,11 +787,14 @@ impl LspClient { std::thread::sleep(Duration::from_millis(20)); } - eprintln!("==== STDERR OUTPUT ===="); - for line in found_lines { - eprintln!("{}", line) + #[allow(clippy::print_stderr)] + { + eprintln!("==== STDERR OUTPUT ===="); + for line in found_lines { + eprintln!("{}", line) + } + eprintln!("== END STDERR OUTPUT =="); } - eprintln!("== END STDERR OUTPUT =="); panic!("Timed out waiting on condition.") } diff --git a/tests/util/server/src/npm.rs b/tests/util/server/src/npm.rs index 4b17b95f7..31686fa85 100644 --- a/tests/util/server/src/npm.rs +++ b/tests/util/server/src/npm.rs @@ -103,7 +103,6 @@ impl TestNpmRegistry { } pub fn root_dir(&self) -> PathRef { - eprintln!("root {}", self.local_path); tests_path().join("registry").join(&self.local_path) } @@ -120,7 +119,6 @@ impl TestNpmRegistry { } pub fn registry_file(&self, name: &str) -> Result>> { - eprintln!("registry file {}", name); self.get_package_property(name, |p| p.registry_file.as_bytes().to_vec()) } @@ -138,7 +136,6 @@ impl TestNpmRegistry { package_name: &str, func: impl FnOnce(&CustomNpmPackage) -> TResult, ) -> Result> { - eprintln!("get package property {}", package_name); // it's ok if multiple threads race here as they will do the same work twice if !self.cache.lock().contains_key(package_name) { match get_npm_package(&self.hostname, &self.local_path, package_name)? { @@ -155,7 +152,6 @@ impl TestNpmRegistry { &self, uri_path: &'s str, ) -> Option<(&'s str, &'s str)> { - eprintln!("GEETT {}", uri_path); let prefix1 = format!("/{}/", DENOTEST_SCOPE_NAME); let prefix2 = format!("/{}%2f", DENOTEST_SCOPE_NAME); @@ -198,10 +194,6 @@ fn get_npm_package( local_path: &str, package_name: &str, ) -> Result> { - eprintln!( - "get npm package {} {} {}", - registry_hostname, local_path, package_name - ); let registry_hostname = if package_name == "@denotest/tarballs-privateserver2" { "http://localhost:4262" diff --git a/tests/util/server/src/pty.rs b/tests/util/server/src/pty.rs index 8d42fed78..07659262c 100644 --- a/tests/util/server/src/pty.rs +++ b/tests/util/server/src/pty.rs @@ -61,7 +61,10 @@ impl Pty { if is_windows && *IS_CI { // the pty tests don't really start up on the windows CI for some reason // so ignore them for now - eprintln!("Ignoring windows CI."); + #[allow(clippy::print_stderr)] + { + eprintln!("Ignoring windows CI."); + } false } else { true @@ -250,11 +253,14 @@ impl Pty { } let text = self.next_text(); - eprintln!( - "------ Start Full Text ------\n{:?}\n------- End Full Text -------", - String::from_utf8_lossy(&self.read_bytes) - ); - eprintln!("Next text: {:?}", text); + #[allow(clippy::print_stderr)] + { + eprintln!( + "------ Start Full Text ------\n{:?}\n------- End Full Text -------", + String::from_utf8_lossy(&self.read_bytes) + ); + eprintln!("Next text: {:?}", text); + } false } diff --git a/tests/util/server/src/servers/hyper_utils.rs b/tests/util/server/src/servers/hyper_utils.rs index c2db7ea66..8e01151ed 100644 --- a/tests/util/server/src/servers/hyper_utils.rs +++ b/tests/util/server/src/servers/hyper_utils.rs @@ -42,7 +42,10 @@ where let fut: Pin>>> = async move { let listener = TcpListener::bind(options.addr).await?; - println!("ready: {}", options.addr); + #[allow(clippy::print_stdout)] + { + println!("ready: {}", options.addr); + } loop { let (stream, _) = listener.accept().await?; let io = TokioIo::new(stream); @@ -58,6 +61,7 @@ where if let Err(e) = fut.await { let err_str = e.to_string(); + #[allow(clippy::print_stderr)] if !err_str.contains("early eof") { eprintln!("{}: {:?}", options.error_msg, e); } @@ -89,6 +93,7 @@ pub async fn run_server_with_acceptor<'a, A, F, S>( if let Err(e) = fut.await { let err_str = e.to_string(); + #[allow(clippy::print_stderr)] if !err_str.contains("early eof") { eprintln!("{}: {:?}", error_msg, e); } @@ -135,6 +140,7 @@ async fn hyper_serve_connection( if let Err(e) = result { let err_str = e.to_string(); + #[allow(clippy::print_stderr)] if !err_str.contains("early eof") { eprintln!("{}: {:?}", error_msg, e); } diff --git a/tests/util/server/src/servers/mod.rs b/tests/util/server/src/servers/mod.rs index 3a9c44010..6c960ce52 100644 --- a/tests/util/server/src/servers/mod.rs +++ b/tests/util/server/src/servers/mod.rs @@ -198,7 +198,6 @@ fn json_body(value: serde_json::Value) -> UnsyncBoxBody { /// Benchmark server that just serves "hello world" responses. async fn hyper_hello(port: u16) { - println!("hyper hello"); let addr = SocketAddr::from(([127, 0, 0, 1], port)); let handler = move |_: Request| async move { Ok::<_, anyhow::Error>(Response::new(UnsyncBoxBody::new( @@ -342,7 +341,10 @@ async fn get_tcp_listener_stream( .collect::>(); // Eye catcher for HttpServerCount - println!("ready: {name} on {:?}", addresses); + #[allow(clippy::print_stdout)] + { + println!("ready: {name} on {:?}", addresses); + } futures::stream::select_all(listeners) } @@ -358,7 +360,10 @@ async fn run_tls_client_auth_server(port: u16) { while let Some(Ok(mut tls_stream)) = tls.next().await { tokio::spawn(async move { let Ok(handshake) = tls_stream.handshake().await else { - eprintln!("Failed to handshake"); + #[allow(clippy::print_stderr)] + { + eprintln!("Failed to handshake"); + } return; }; // We only need to check for the presence of client certificates @@ -405,7 +410,6 @@ async fn absolute_redirect( .collect(); if let Some(url) = query_params.get("redirect_to") { - println!("URL: {url:?}"); let redirect = redirect_resp(url.to_owned()); return Ok(redirect); } @@ -413,7 +417,6 @@ async fn absolute_redirect( if path.starts_with("/REDIRECT") { let url = &req.uri().path()[9..]; - println!("URL: {url:?}"); let redirect = redirect_resp(url.to_string()); return Ok(redirect); } @@ -1357,6 +1360,7 @@ async fn wrap_client_auth_https_server(port: u16) { // here. Rusttls ensures that they are valid and signed by the CA. match handshake.has_peer_certificates { true => { yield Ok(tls); }, + #[allow(clippy::print_stderr)] false => { eprintln!("https_client_auth: no valid client certificate"); }, }; } diff --git a/tests/util/server/src/servers/ws.rs b/tests/util/server/src/servers/ws.rs index 815119b6a..dd4efbf65 100644 --- a/tests/util/server/src/servers/ws.rs +++ b/tests/util/server/src/servers/ws.rs @@ -76,6 +76,7 @@ pub async fn run_wss2_server(port: u16) { let server: Handshake<_, Bytes> = h2.handshake(tls); let mut server = match server.await { Ok(server) => server, + #[allow(clippy::print_stdout)] Err(e) => { println!("Failed to handshake h2: {e:?}"); return; @@ -87,6 +88,7 @@ pub async fn run_wss2_server(port: u16) { }; let (recv, send) = match conn { Ok(conn) => conn, + #[allow(clippy::print_stdout)] Err(e) => { println!("Failed to accept a connection: {e:?}"); break; @@ -137,6 +139,7 @@ where .map_err(|e| anyhow!("Error upgrading websocket connection: {}", e)) .unwrap(); + #[allow(clippy::print_stderr)] if let Err(e) = handler(ws).await { eprintln!("Error in websocket connection: {}", e); } @@ -152,6 +155,7 @@ where .serve_connection(io, service) .with_upgrades(); + #[allow(clippy::print_stderr)] if let Err(e) = conn.await { eprintln!("websocket server error: {e:?}"); } @@ -162,16 +166,19 @@ async fn handle_wss_stream( recv: Request, mut send: SendResponse, ) -> Result<(), h2::Error> { + #[allow(clippy::print_stderr)] if recv.method() != Method::CONNECT { eprintln!("wss2: refusing non-CONNECT stream"); send.send_reset(Reason::REFUSED_STREAM); return Ok(()); } + #[allow(clippy::print_stderr)] let Some(protocol) = recv.extensions().get::() else { eprintln!("wss2: refusing no-:protocol stream"); send.send_reset(Reason::REFUSED_STREAM); return Ok(()); }; + #[allow(clippy::print_stderr)] if protocol.as_str() != "websocket" && protocol.as_str() != "WebSocket" { eprintln!("wss2: refusing non-websocket stream"); send.send_reset(Reason::REFUSED_STREAM); -- cgit v1.2.3 From 38c7af456518ac4fdbd36e3bfa731c38195bb773 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Fri, 25 Oct 2024 18:35:09 +0100 Subject: feat(lsp): "typescript.preferences.preferTypeOnlyAutoImports" setting (#26546) --- tests/integration/lsp_tests.rs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 35a412b28..79e6dc5c4 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -5955,7 +5955,7 @@ fn lsp_jsr_code_action_missing_declaration() { "character": 6, }, }, - "newText": "import type { ReturnType } from \"jsr:@denotest/types-file/types\";\n", + "newText": "import { ReturnType } from \"jsr:@denotest/types-file/types\";\n", }, { "range": { @@ -6469,6 +6469,16 @@ fn lsp_code_actions_imports() { let context = TestContextBuilder::new().use_temp_cwd().build(); let mut client = context.new_lsp_command().build(); client.initialize_default(); + client.change_configuration(json!({ + "deno": { + "enable": true, + }, + "typescript": { + "preferences": { + "preferTypeOnlyAutoImports": true, + }, + }, + })); client.did_open(json!({ "textDocument": { "uri": "file:///a/file00.ts", @@ -6768,7 +6778,7 @@ fn lsp_code_actions_imports_dts() { "start": { "line": 0, "character": 0 }, "end": { "line": 0, "character": 0 }, }, - "newText": "import type { SomeType } from \"./decl.d.ts\";\n", + "newText": "import { SomeType } from \"./decl.d.ts\";\n", }], }], }, @@ -7199,7 +7209,7 @@ fn lsp_code_actions_imports_respects_fmt_config() { "start": { "line": 0, "character": 0 }, "end": { "line": 0, "character": 0 } }, - "newText": "import type { DuckConfigOptions } from './file01.ts'\n" + "newText": "import { DuckConfigOptions } from './file01.ts'\n" }] }] } @@ -7252,7 +7262,7 @@ fn lsp_code_actions_imports_respects_fmt_config() { "start": { "line": 0, "character": 0 }, "end": { "line": 0, "character": 0 } }, - "newText": "import type { DuckConfigOptions } from './file01.ts'\n" + "newText": "import { DuckConfigOptions } from './file01.ts'\n" }] }] }, @@ -7352,7 +7362,7 @@ fn lsp_quote_style_from_workspace_settings() { "start": { "line": 0, "character": 0 }, "end": { "line": 0, "character": 0 }, }, - "newText": "import type { DuckConfigOptions } from './file01.ts';\n", + "newText": "import { DuckConfigOptions } from './file01.ts';\n", }], }], }, @@ -7396,7 +7406,7 @@ fn lsp_quote_style_from_workspace_settings() { "start": { "line": 0, "character": 0 }, "end": { "line": 0, "character": 0 }, }, - "newText": "import type { DuckConfigOptions } from \"./file01.ts\";\n", + "newText": "import { DuckConfigOptions } from \"./file01.ts\";\n", }], }], }, -- cgit v1.2.3 From e70341e65e9f4e44811210c9b24e67a29b2c497a Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 25 Oct 2024 13:56:40 -0400 Subject: fix(check): ignore resolving `jsxImportSource` when jsx is not used in graph (#26548) --- tests/specs/check/jsx_import_source_not_in_graph/__test__.jsonc | 4 ++++ tests/specs/check/jsx_import_source_not_in_graph/deno.json | 6 ++++++ tests/specs/check/jsx_import_source_not_in_graph/main.out | 1 + tests/specs/check/jsx_import_source_not_in_graph/main.ts | 1 + 4 files changed, 12 insertions(+) create mode 100644 tests/specs/check/jsx_import_source_not_in_graph/__test__.jsonc create mode 100644 tests/specs/check/jsx_import_source_not_in_graph/deno.json create mode 100644 tests/specs/check/jsx_import_source_not_in_graph/main.out create mode 100644 tests/specs/check/jsx_import_source_not_in_graph/main.ts (limited to 'tests') diff --git a/tests/specs/check/jsx_import_source_not_in_graph/__test__.jsonc b/tests/specs/check/jsx_import_source_not_in_graph/__test__.jsonc new file mode 100644 index 000000000..de0339cfb --- /dev/null +++ b/tests/specs/check/jsx_import_source_not_in_graph/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "check main.ts", + "output": "main.out" +} diff --git a/tests/specs/check/jsx_import_source_not_in_graph/deno.json b/tests/specs/check/jsx_import_source_not_in_graph/deno.json new file mode 100644 index 000000000..219ef515f --- /dev/null +++ b/tests/specs/check/jsx_import_source_not_in_graph/deno.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "npm:preact" + } +} diff --git a/tests/specs/check/jsx_import_source_not_in_graph/main.out b/tests/specs/check/jsx_import_source_not_in_graph/main.out new file mode 100644 index 000000000..1830c3186 --- /dev/null +++ b/tests/specs/check/jsx_import_source_not_in_graph/main.out @@ -0,0 +1 @@ +Check file:///[WILDLINE]/main.ts diff --git a/tests/specs/check/jsx_import_source_not_in_graph/main.ts b/tests/specs/check/jsx_import_source_not_in_graph/main.ts new file mode 100644 index 000000000..bf6b81796 --- /dev/null +++ b/tests/specs/check/jsx_import_source_not_in_graph/main.ts @@ -0,0 +1 @@ +console.log("Hello"); -- cgit v1.2.3 From ec968aa5aec068e92fb554fc7192d912bcddb82c Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Fri, 25 Oct 2024 13:19:03 -0700 Subject: fix(install): cache json exports of JSR packages (#26552) Fixes https://github.com/denoland/deno/issues/26509. Ended up being a `deno_graph` bug causing the error to surface. This PR updates `deno_graph` to pick up the fix and reverts the temporary workaround that skipped JSON exports. --- tests/registry/jsr/@denotest/multiple-exports/1.0.0/add.ts | 1 + tests/registry/jsr/@denotest/multiple-exports/1.0.0/data.json | 3 +++ tests/registry/jsr/@denotest/multiple-exports/1.0.0/subtract.ts | 1 + tests/registry/jsr/@denotest/multiple-exports/1.0.0_meta.json | 7 +++++++ tests/registry/jsr/@denotest/multiple-exports/meta.json | 5 +++++ tests/specs/install/jsr_exports/__test__.jsonc | 3 ++- tests/specs/install/jsr_exports/deno.json | 2 +- tests/specs/install/jsr_exports/install.out | 9 +++++---- tests/specs/install/jsr_exports/main.out | 3 +++ tests/specs/install/jsr_exports/main.ts | 7 +++++++ 10 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 tests/registry/jsr/@denotest/multiple-exports/1.0.0/add.ts create mode 100644 tests/registry/jsr/@denotest/multiple-exports/1.0.0/data.json create mode 100644 tests/registry/jsr/@denotest/multiple-exports/1.0.0/subtract.ts create mode 100644 tests/registry/jsr/@denotest/multiple-exports/1.0.0_meta.json create mode 100644 tests/registry/jsr/@denotest/multiple-exports/meta.json create mode 100644 tests/specs/install/jsr_exports/main.out create mode 100644 tests/specs/install/jsr_exports/main.ts (limited to 'tests') diff --git a/tests/registry/jsr/@denotest/multiple-exports/1.0.0/add.ts b/tests/registry/jsr/@denotest/multiple-exports/1.0.0/add.ts new file mode 100644 index 000000000..de02f6902 --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/1.0.0/add.ts @@ -0,0 +1 @@ +export * from "jsr:@denotest/add@1"; diff --git a/tests/registry/jsr/@denotest/multiple-exports/1.0.0/data.json b/tests/registry/jsr/@denotest/multiple-exports/1.0.0/data.json new file mode 100644 index 000000000..885e71c6c --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/1.0.0/data.json @@ -0,0 +1,3 @@ +{ + "a": 1 +} \ No newline at end of file diff --git a/tests/registry/jsr/@denotest/multiple-exports/1.0.0/subtract.ts b/tests/registry/jsr/@denotest/multiple-exports/1.0.0/subtract.ts new file mode 100644 index 000000000..215c42310 --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/1.0.0/subtract.ts @@ -0,0 +1 @@ +export * from "jsr:@denotest/subtract@1"; diff --git a/tests/registry/jsr/@denotest/multiple-exports/1.0.0_meta.json b/tests/registry/jsr/@denotest/multiple-exports/1.0.0_meta.json new file mode 100644 index 000000000..d9f58b9a6 --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/1.0.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 new file mode 100644 index 000000000..02601e4d0 --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/meta.json @@ -0,0 +1,5 @@ +{ + "versions": { + "1.0.0": {} + } +} diff --git a/tests/specs/install/jsr_exports/__test__.jsonc b/tests/specs/install/jsr_exports/__test__.jsonc index 934f3c588..7ccc5da4d 100644 --- a/tests/specs/install/jsr_exports/__test__.jsonc +++ b/tests/specs/install/jsr_exports/__test__.jsonc @@ -1,6 +1,7 @@ { "tempDir": true, "steps": [ - { "args": "install", "output": "install.out" } + { "args": "install", "output": "install.out" }, + { "args": "run --cached-only main.ts", "output": "main.out" } ] } diff --git a/tests/specs/install/jsr_exports/deno.json b/tests/specs/install/jsr_exports/deno.json index 21212f579..4b281f80a 100644 --- a/tests/specs/install/jsr_exports/deno.json +++ b/tests/specs/install/jsr_exports/deno.json @@ -1,5 +1,5 @@ { "imports": { - "@denotest/different-deps-per-export": "jsr:@denotest/different-deps-per-export@^1.0.0" + "@denotest/multiple-exports": "jsr:@denotest/multiple-exports@^1.0.0" } } diff --git a/tests/specs/install/jsr_exports/install.out b/tests/specs/install/jsr_exports/install.out index 8f6400163..bce0d79bb 100644 --- a/tests/specs/install/jsr_exports/install.out +++ b/tests/specs/install/jsr_exports/install.out @@ -1,8 +1,9 @@ [UNORDERED_START] -Download http://127.0.0.1:4250/@denotest/different-deps-per-export/meta.json -Download http://127.0.0.1:4250/@denotest/different-deps-per-export/1.0.0_meta.json -Download http://127.0.0.1:4250/@denotest/different-deps-per-export/1.0.0/add.ts -Download http://127.0.0.1:4250/@denotest/different-deps-per-export/1.0.0/subtract.ts +Download http://127.0.0.1:4250/@denotest/multiple-exports/meta.json +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/add.ts +Download http://127.0.0.1:4250/@denotest/multiple-exports/1.0.0/subtract.ts +Download http://127.0.0.1:4250/@denotest/multiple-exports/1.0.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 diff --git a/tests/specs/install/jsr_exports/main.out b/tests/specs/install/jsr_exports/main.out new file mode 100644 index 000000000..6ce184bad --- /dev/null +++ b/tests/specs/install/jsr_exports/main.out @@ -0,0 +1,3 @@ +3 +-1 +{ a: 1 } diff --git a/tests/specs/install/jsr_exports/main.ts b/tests/specs/install/jsr_exports/main.ts new file mode 100644 index 000000000..f7efdb0e9 --- /dev/null +++ b/tests/specs/install/jsr_exports/main.ts @@ -0,0 +1,7 @@ +import { add } from "@denotest/multiple-exports/add"; +import { subtract } from "@denotest/multiple-exports/subtract"; +import data from "@denotest/multiple-exports/data-json" with { type: "json" }; + +console.log(add(1, 2)); +console.log(subtract(1, 2)); +console.log(data); -- cgit v1.2.3 From c314b2d8577289078d6b00a0dd58f8f36ff6920a Mon Sep 17 00:00:00 2001 From: familyboat <84062528+familyboat@users.noreply.github.com> Date: Sun, 27 Oct 2024 11:04:35 +0800 Subject: fix(ext/node): add path to `fs.stat` and `fs.statSync` error (#26037) --- tests/unit_node/fs_test.ts | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'tests') diff --git a/tests/unit_node/fs_test.ts b/tests/unit_node/fs_test.ts index ef8f829cd..631608d7c 100644 --- a/tests/unit_node/fs_test.ts +++ b/tests/unit_node/fs_test.ts @@ -26,6 +26,7 @@ import { cp, FileHandle, open, + stat, writeFile, } from "node:fs/promises"; import process from "node:process"; @@ -123,6 +124,48 @@ Deno.test( }, ); +Deno.test( + "[node/fs statSync] throw error with path information", + () => { + const file = "non-exist-file"; + const fileUrl = new URL(file, import.meta.url); + + assertThrows(() => { + statSync(file); + }, "Error: ENOENT: no such file or directory, stat 'non-exist-file'"); + + assertThrows(() => { + statSync(fileUrl); + }, `Error: ENOENT: no such file or directory, stat '${fileUrl.pathname}'`); + }, +); + +Deno.test( + "[node/fs/promises stat] throw error with path information", + async () => { + const file = "non-exist-file"; + const fileUrl = new URL(file, import.meta.url); + + try { + await stat(file); + } catch (error: unknown) { + assertEquals( + `${error}`, + "Error: ENOENT: no such file or directory, stat 'non-exist-file'", + ); + } + + try { + await stat(fileUrl); + } catch (error: unknown) { + assertEquals( + `${error}`, + `Error: ENOENT: no such file or directory, stat '${fileUrl.pathname}'`, + ); + } + }, +); + Deno.test( "[node/fs/promises cp] copy file", async () => { -- cgit v1.2.3 From 5389972ba5037b1ed48da11506f6798deec2b48e Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Mon, 28 Oct 2024 12:08:51 +0100 Subject: fix(npm): match npm bearer token generation (#26544) Spend some time stepping through the npm client code and noticed that the bearer token was different from ours. They do some double encoding and @dsherret helped me in matching the encoding behavior. Fixes https://github.com/denoland/deno/issues/26033 --- tests/specs/npm/npmrc_username_password/.npmrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/specs/npm/npmrc_username_password/.npmrc b/tests/specs/npm/npmrc_username_password/.npmrc index c318678ae..9e1ded96a 100644 --- a/tests/specs/npm/npmrc_username_password/.npmrc +++ b/tests/specs/npm/npmrc_username_password/.npmrc @@ -1,6 +1,8 @@ @denotest:registry=http://localhost:4261/ //localhost:4261/:username=deno -//localhost:4261/:_password=land +# base64 of land +//localhost:4261/:_password=bGFuZA== @denotest2:registry=http://localhost:4262/ //localhost:4262/:username=deno -//localhost:4262/:_password=land2 +# base64 of land2 +//localhost:4262/:_password=bGFuZDI= -- cgit v1.2.3 From f61af864df4d7a2513f738ddf2d5fddf79c878af Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 28 Oct 2024 09:31:58 -0400 Subject: fix(compile): regression handling redirects (#26586) Closes https://github.com/denoland/deno/issues/26583 --- tests/specs/compile/redirects/__test__.jsonc | 22 ++++++++++++++++++++++ tests/specs/compile/redirects/main.out | 1 + tests/specs/compile/redirects/main.ts | 1 + 3 files changed, 24 insertions(+) create mode 100644 tests/specs/compile/redirects/__test__.jsonc create mode 100644 tests/specs/compile/redirects/main.out create mode 100644 tests/specs/compile/redirects/main.ts (limited to 'tests') diff --git a/tests/specs/compile/redirects/__test__.jsonc b/tests/specs/compile/redirects/__test__.jsonc new file mode 100644 index 000000000..07ce69399 --- /dev/null +++ b/tests/specs/compile/redirects/__test__.jsonc @@ -0,0 +1,22 @@ +{ + "tempDir": true, + "steps": [{ + "if": "unix", + "args": "compile -A --output main main.ts", + "output": "[WILDCARD]" + }, { + "if": "unix", + "commandName": "./main", + "args": [], + "output": "main.out" + }, { + "if": "windows", + "args": "compile -A --output main.exe main.ts", + "output": "[WILDCARD]" + }, { + "if": "windows", + "commandName": "./main.exe", + "args": [], + "output": "main.out" + }] +} diff --git a/tests/specs/compile/redirects/main.out b/tests/specs/compile/redirects/main.out new file mode 100644 index 000000000..e965047ad --- /dev/null +++ b/tests/specs/compile/redirects/main.out @@ -0,0 +1 @@ +Hello diff --git a/tests/specs/compile/redirects/main.ts b/tests/specs/compile/redirects/main.ts new file mode 100644 index 000000000..439631901 --- /dev/null +++ b/tests/specs/compile/redirects/main.ts @@ -0,0 +1 @@ +import "http://localhost:4546/run/003_relative_import.ts"; -- cgit v1.2.3 From 4e38fbd0a3e0ca139314e503494a8d4795007d8a Mon Sep 17 00:00:00 2001 From: snek Date: Mon, 28 Oct 2024 18:16:43 +0100 Subject: fix: report exceptions from nextTick (#26579) Fixes: https://github.com/denoland/deno/issues/24713 Fixes: https://github.com/denoland/deno/issues/25855 --- tests/integration/node_unit_tests.rs | 4 ++ tests/node_compat/config.jsonc | 4 +- tests/node_compat/runner/TODO.md | 1 - .../parallel/test-child-process-ipc-next-tick.js | 46 ++++++++++++++++++++++ .../next_tick_uncaught_exception/__test__.jsonc | 4 ++ .../node/next_tick_uncaught_exception/main.out | 2 + .../node/next_tick_uncaught_exception/main.ts | 13 ++++++ 7 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 tests/node_compat/test/parallel/test-child-process-ipc-next-tick.js create mode 100644 tests/specs/node/next_tick_uncaught_exception/__test__.jsonc create mode 100644 tests/specs/node/next_tick_uncaught_exception/main.out create mode 100644 tests/specs/node/next_tick_uncaught_exception/main.ts (limited to 'tests') diff --git a/tests/integration/node_unit_tests.rs b/tests/integration/node_unit_tests.rs index d66db5a40..40bd7b2fb 100644 --- a/tests/integration/node_unit_tests.rs +++ b/tests/integration/node_unit_tests.rs @@ -212,3 +212,7 @@ itest!(unhandled_rejection_web_process { envs: env_vars_for_npm_tests(), http_server: true, }); + +// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +// The itest macro is deprecated. Please move your new test to ~/tests/specs. +// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/tests/node_compat/config.jsonc b/tests/node_compat/config.jsonc index 75f463342..a99a42790 100644 --- a/tests/node_compat/config.jsonc +++ b/tests/node_compat/config.jsonc @@ -43,9 +43,6 @@ // TODO(littledivy): windows ipc streams not yet implemented "test-child-process-fork-ref.js", "test-child-process-fork-ref2.js", - // TODO(bartlomieju): this test is very flaky on CI - // https://github.com/denoland/deno/issues/25855 - // "test-child-process-ipc-next-tick.js", "test-child-process-ipc.js", "test-child-process-spawnsync-env.js", "test-child-process-stdio-inherit.js", @@ -240,6 +237,7 @@ "test-child-process-execfilesync-maxbuf.js", "test-child-process-execsync-maxbuf.js", "test-child-process-flush-stdio.js", + "test-child-process-ipc-next-tick.js", "test-child-process-kill.js", "test-child-process-set-blocking.js", "test-child-process-spawn-args.js", diff --git a/tests/node_compat/runner/TODO.md b/tests/node_compat/runner/TODO.md index 11b5d2805..35a67e72d 100644 --- a/tests/node_compat/runner/TODO.md +++ b/tests/node_compat/runner/TODO.md @@ -280,7 +280,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [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-next-tick.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-child-process-ipc-next-tick.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) 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 new file mode 100644 index 000000000..f511d2500 --- /dev/null +++ b/tests/node_compat/test/parallel/test-child-process-ipc-next-tick.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 18.12.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 NUM_MESSAGES = 10; +const values = []; + +for (let i = 0; i < NUM_MESSAGES; ++i) { + values[i] = i; +} + +if (process.argv[2] === 'child') { + const received = values.map(() => { return false; }); + + process.on('uncaughtException', common.mustCall((err) => { + received[err] = true; + const done = received.every((element) => { return element === true; }); + + if (done) + process.disconnect(); + }, NUM_MESSAGES)); + + process.on('message', (msg) => { + // If messages are handled synchronously, throwing should break the IPC + // message processing. + throw msg; + }); + + process.send('ready'); +} else { + const child = cp.fork(__filename, ['child']); + + child.on('message', common.mustCall((msg) => { + assert.strictEqual(msg, 'ready'); + values.forEach((value) => { + child.send(value); + }); + })); +} diff --git a/tests/specs/node/next_tick_uncaught_exception/__test__.jsonc b/tests/specs/node/next_tick_uncaught_exception/__test__.jsonc new file mode 100644 index 000000000..5517e693d --- /dev/null +++ b/tests/specs/node/next_tick_uncaught_exception/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run main.ts", + "output": "main.out" +} diff --git a/tests/specs/node/next_tick_uncaught_exception/main.out b/tests/specs/node/next_tick_uncaught_exception/main.out new file mode 100644 index 000000000..45b756515 --- /dev/null +++ b/tests/specs/node/next_tick_uncaught_exception/main.out @@ -0,0 +1,2 @@ +caught Error: thrown from next tick + at file:///[WILDCARD]/specs/node/next_tick_uncaught_exception/main.ts:4:15 diff --git a/tests/specs/node/next_tick_uncaught_exception/main.ts b/tests/specs/node/next_tick_uncaught_exception/main.ts new file mode 100644 index 000000000..2679d3d54 --- /dev/null +++ b/tests/specs/node/next_tick_uncaught_exception/main.ts @@ -0,0 +1,13 @@ +import process from "node:process"; +import { strictEqual } from "node:assert"; + +const error = new Error("thrown from next tick"); + +process.on("uncaughtException", (caught) => { + strictEqual(caught, error); + console.log("caught", caught); +}); + +process.nextTick(() => { + throw error; +}); -- cgit v1.2.3 From 0e641632c38383a1d67aa610867496f64ae423ca Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 28 Oct 2024 17:43:41 -0400 Subject: fix(check): expose more globals from @types/node (#26603) Extracted out of https://github.com/denoland/deno/pull/26558 Closes https://github.com/denoland/deno/issues/26578 --- tests/specs/npm/compare_globals/__test__.jsonc | 4 +- .../npm/compare_globals/compare_globals/main.out | 30 ----------- .../npm/compare_globals/compare_globals/main.ts | 54 ------------------- tests/specs/npm/compare_globals/main.out | 31 +++++++++++ tests/specs/npm/compare_globals/main.ts | 61 ++++++++++++++++++++++ 5 files changed, 94 insertions(+), 86 deletions(-) delete mode 100644 tests/specs/npm/compare_globals/compare_globals/main.out delete mode 100644 tests/specs/npm/compare_globals/compare_globals/main.ts create mode 100644 tests/specs/npm/compare_globals/main.out create mode 100644 tests/specs/npm/compare_globals/main.ts (limited to 'tests') diff --git a/tests/specs/npm/compare_globals/__test__.jsonc b/tests/specs/npm/compare_globals/__test__.jsonc index e096ddeb2..96458306a 100644 --- a/tests/specs/npm/compare_globals/__test__.jsonc +++ b/tests/specs/npm/compare_globals/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "run --allow-read --check=all compare_globals/main.ts", - "output": "compare_globals/main.out" + "args": "run --allow-read --check=all main.ts", + "output": "main.out" } diff --git a/tests/specs/npm/compare_globals/compare_globals/main.out b/tests/specs/npm/compare_globals/compare_globals/main.out deleted file mode 100644 index 5be6125b0..000000000 --- a/tests/specs/npm/compare_globals/compare_globals/main.out +++ /dev/null @@ -1,30 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@types%2fnode -Download http://localhost:4260/undici-types -Download http://localhost:4260/@denotest%2fglobals -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/globals/1.0.0.tgz -Download http://localhost:4260/@types/node/node-22.5.4.tgz -Download http://localhost:4260/undici-types/undici-types-6.19.8.tgz -[UNORDERED_END] -Check file:///[WILDCARD]/compare_globals/main.ts -true -true -[] -setTimeout 1 false -setTimeout 2 function -setTimeout 3 function -setTimeout 4 function -setTimeout 5 undefined -window 1 false -window 2 false -false -false -self 1 true -self 2 true -false -false -bar -bar -true diff --git a/tests/specs/npm/compare_globals/compare_globals/main.ts b/tests/specs/npm/compare_globals/compare_globals/main.ts deleted file mode 100644 index 9482798d8..000000000 --- a/tests/specs/npm/compare_globals/compare_globals/main.ts +++ /dev/null @@ -1,54 +0,0 @@ -/// - -import * as globals from "npm:@denotest/globals"; -console.log(globals.global === globals.globalThis); -// @ts-expect-error even though these are the same object, they have different types -console.log(globals.globalThis === globalThis); -console.log(globals.process.execArgv); - -type AssertTrue = never; -type _TestNoProcessGlobal = AssertTrue< - typeof globalThis extends { process: any } ? false : true ->; -type _TestHasNodeJsGlobal = NodeJS.Architecture; - -const controller = new AbortController(); -controller.abort("reason"); // in the NodeJS declaration it doesn't have a reason - -// Some globals are not the same between Node and Deno. -// @ts-expect-error incompatible types between Node and Deno -console.log("setTimeout 1", globalThis.setTimeout === globals.getSetTimeout()); - -// Super edge case where some Node code deletes a global where the -// Node code has its own global and the Deno code has the same global, -// but it's different. Basically if some Node code deletes -// one of these globals then we don't want it to suddenly inherit -// the Deno global (or touch the Deno global at all). -console.log("setTimeout 2", typeof globalThis.setTimeout); -console.log("setTimeout 3", typeof globals.getSetTimeout()); -globals.deleteSetTimeout(); -console.log("setTimeout 4", typeof globalThis.setTimeout); -console.log("setTimeout 5", typeof globals.getSetTimeout()); - -// In Deno 2 and Node.js, the window global is not defined. -console.log("window 1", "window" in globalThis); -console.log( - "window 2", - Object.getOwnPropertyDescriptor(globalThis, "window") !== undefined, -); -globals.checkWindowGlobal(); - -// In Deno 2 self global is defined, but in Node it is not. -console.log("self 1", "self" in globalThis); -console.log( - "self 2", - Object.getOwnPropertyDescriptor(globalThis, "self") !== undefined, -); -globals.checkSelfGlobal(); - -// "Non-managed" globals are shared between Node and Deno. -(globalThis as any).foo = "bar"; -console.log((globalThis as any).foo); -console.log(globals.getFoo()); - -console.log(Reflect.ownKeys(globalThis).includes("console")); // non-enumerable keys are included diff --git a/tests/specs/npm/compare_globals/main.out b/tests/specs/npm/compare_globals/main.out new file mode 100644 index 000000000..290e9c3b2 --- /dev/null +++ b/tests/specs/npm/compare_globals/main.out @@ -0,0 +1,31 @@ +[UNORDERED_START] +Download http://localhost:4260/@types%2fnode +Download http://localhost:4260/undici-types +Download http://localhost:4260/@denotest%2fglobals +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/@denotest/globals/1.0.0.tgz +Download http://localhost:4260/@types/node/node-22.5.4.tgz +Download http://localhost:4260/undici-types/undici-types-6.19.8.tgz +[UNORDERED_END] +Check file:///[WILDCARD]/main.ts +true +true +[] +process equals process true +setTimeout 1 false +setTimeout 2 function +setTimeout 3 function +setTimeout 4 function +setTimeout 5 undefined +window 1 false +window 2 false +false +false +self 1 true +self 2 true +false +false +bar +bar +true diff --git a/tests/specs/npm/compare_globals/main.ts b/tests/specs/npm/compare_globals/main.ts new file mode 100644 index 000000000..308ce9b23 --- /dev/null +++ b/tests/specs/npm/compare_globals/main.ts @@ -0,0 +1,61 @@ +/// + +import * as globals from "npm:@denotest/globals"; +console.log(globals.global === globals.globalThis); +// @ts-expect-error even though these are the same object, they have different types +console.log(globals.globalThis === globalThis); +console.log(globals.process.execArgv); +console.log("process equals process", process === globals.process); + +type AssertTrue = never; +type _TestHasProcessGlobal = AssertTrue< + typeof globalThis extends { process: any } ? true : false +>; +type _TestProcessGlobalVersion = AssertTrue< + typeof process.versions.node extends string ? true : false +>; +type _TestNoBufferGlogal = AssertTrue< + typeof globalThis extends { Buffer: any } ? false : true +>; +type _TestHasNodeJsGlobal = NodeJS.Architecture; + +const controller = new AbortController(); +controller.abort("reason"); // in the NodeJS declaration it doesn't have a reason + +// Some globals are not the same between Node and Deno. +// @ts-expect-error incompatible types between Node and Deno +console.log("setTimeout 1", globalThis.setTimeout === globals.getSetTimeout()); + +// Super edge case where some Node code deletes a global where the +// Node code has its own global and the Deno code has the same global, +// but it's different. Basically if some Node code deletes +// one of these globals then we don't want it to suddenly inherit +// the Deno global (or touch the Deno global at all). +console.log("setTimeout 2", typeof globalThis.setTimeout); +console.log("setTimeout 3", typeof globals.getSetTimeout()); +globals.deleteSetTimeout(); +console.log("setTimeout 4", typeof globalThis.setTimeout); +console.log("setTimeout 5", typeof globals.getSetTimeout()); + +// In Deno 2 and Node.js, the window global is not defined. +console.log("window 1", "window" in globalThis); +console.log( + "window 2", + Object.getOwnPropertyDescriptor(globalThis, "window") !== undefined, +); +globals.checkWindowGlobal(); + +// In Deno 2 self global is defined, but in Node it is not. +console.log("self 1", "self" in globalThis); +console.log( + "self 2", + Object.getOwnPropertyDescriptor(globalThis, "self") !== undefined, +); +globals.checkSelfGlobal(); + +// "Non-managed" globals are shared between Node and Deno. +(globalThis as any).foo = "bar"; +console.log((globalThis as any).foo); +console.log(globals.getFoo()); + +console.log(Reflect.ownKeys(globalThis).includes("console")); // non-enumerable keys are included -- cgit v1.2.3 From 484f8ca9c30909914eb3348b2df10d44e2753248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 28 Oct 2024 23:55:51 +0000 Subject: fix: provide hints in terminal errors for Node.js globals (#26610) Add info/hint for terminal errors related to Node.js globals: - __filename - __dirname - Buffer - global - setImmediate - clearImmediate Closes https://github.com/denoland/deno/issues/17494 --- .../node_globals_no_duplicate_imports/main.out | 3 ++ tests/specs/run/node_globals_hints/__test__.jsonc | 34 ++++++++++++++++++++++ tests/specs/run/node_globals_hints/buffer.js | 1 + tests/specs/run/node_globals_hints/buffer.out | 7 +++++ .../run/node_globals_hints/clear_immediate.js | 1 + .../run/node_globals_hints/clear_immediate.out | 7 +++++ tests/specs/run/node_globals_hints/dirname.js | 1 + tests/specs/run/node_globals_hints/dirname.out | 7 +++++ tests/specs/run/node_globals_hints/filename.js | 1 + tests/specs/run/node_globals_hints/filename.out | 7 +++++ tests/specs/run/node_globals_hints/global.js | 1 + tests/specs/run/node_globals_hints/global.out | 7 +++++ .../specs/run/node_globals_hints/set_immediate.js | 1 + .../specs/run/node_globals_hints/set_immediate.out | 7 +++++ 14 files changed, 85 insertions(+) create mode 100644 tests/specs/run/node_globals_hints/__test__.jsonc create mode 100644 tests/specs/run/node_globals_hints/buffer.js create mode 100644 tests/specs/run/node_globals_hints/buffer.out create mode 100644 tests/specs/run/node_globals_hints/clear_immediate.js create mode 100644 tests/specs/run/node_globals_hints/clear_immediate.out create mode 100644 tests/specs/run/node_globals_hints/dirname.js create mode 100644 tests/specs/run/node_globals_hints/dirname.out create mode 100644 tests/specs/run/node_globals_hints/filename.js create mode 100644 tests/specs/run/node_globals_hints/filename.out create mode 100644 tests/specs/run/node_globals_hints/global.js create mode 100644 tests/specs/run/node_globals_hints/global.out create mode 100644 tests/specs/run/node_globals_hints/set_immediate.js create mode 100644 tests/specs/run/node_globals_hints/set_immediate.out (limited to 'tests') diff --git a/tests/specs/lint/node_globals_no_duplicate_imports/main.out b/tests/specs/lint/node_globals_no_duplicate_imports/main.out index 56df10eba..058b80795 100644 --- a/tests/specs/lint/node_globals_no_duplicate_imports/main.out +++ b/tests/specs/lint/node_globals_no_duplicate_imports/main.out @@ -2,3 +2,6 @@ error: Uncaught (in promise) ReferenceError: setImmediate is not defined const _foo = setImmediate; ^ at [WILDCARD]main.ts:3:14 + + info: setImmediate is not available in the global scope in Deno. + hint: Import it explicitly with import { setImmediate } from "node:timers";. diff --git a/tests/specs/run/node_globals_hints/__test__.jsonc b/tests/specs/run/node_globals_hints/__test__.jsonc new file mode 100644 index 000000000..c5c5d6e42 --- /dev/null +++ b/tests/specs/run/node_globals_hints/__test__.jsonc @@ -0,0 +1,34 @@ +{ + "tests": { + "__dirname": { + "args": "run dirname.js", + "output": "dirname.out", + "exitCode": 1 + }, + "__filename": { + "args": "run filename.js", + "output": "filename.out", + "exitCode": 1 + }, + "clearImmediate": { + "args": "run clear_immediate.js", + "output": "clear_immediate.out", + "exitCode": 1 + }, + "buffer": { + "args": "run buffer.js", + "output": "buffer.out", + "exitCode": 1 + }, + "global": { + "args": "run global.js", + "output": "global.out", + "exitCode": 1 + }, + "setImmediate": { + "args": "run set_immediate.js", + "output": "set_immediate.out", + "exitCode": 1 + } + } +} diff --git a/tests/specs/run/node_globals_hints/buffer.js b/tests/specs/run/node_globals_hints/buffer.js new file mode 100644 index 000000000..9809e1656 --- /dev/null +++ b/tests/specs/run/node_globals_hints/buffer.js @@ -0,0 +1 @@ +Buffer; diff --git a/tests/specs/run/node_globals_hints/buffer.out b/tests/specs/run/node_globals_hints/buffer.out new file mode 100644 index 000000000..4980e6d12 --- /dev/null +++ b/tests/specs/run/node_globals_hints/buffer.out @@ -0,0 +1,7 @@ +error: Uncaught (in promise) ReferenceError: Buffer is not defined +Buffer; +^ + at [WILDCARD]buffer.js:1:1 + + info: Buffer is not available in the global scope in Deno. + hint: Import it explicitly with import { Buffer } from "node:buffer";. diff --git a/tests/specs/run/node_globals_hints/clear_immediate.js b/tests/specs/run/node_globals_hints/clear_immediate.js new file mode 100644 index 000000000..94b26ae68 --- /dev/null +++ b/tests/specs/run/node_globals_hints/clear_immediate.js @@ -0,0 +1 @@ +clearImmediate; diff --git a/tests/specs/run/node_globals_hints/clear_immediate.out b/tests/specs/run/node_globals_hints/clear_immediate.out new file mode 100644 index 000000000..ecd34babe --- /dev/null +++ b/tests/specs/run/node_globals_hints/clear_immediate.out @@ -0,0 +1,7 @@ +error: Uncaught (in promise) ReferenceError: clearImmediate is not defined +clearImmediate; +^ + at [WILDCARD]clear_immediate.js:1:1 + + info: clearImmediate is not available in the global scope in Deno. + hint: Import it explicitly with import { clearImmediate } from "node:timers";. diff --git a/tests/specs/run/node_globals_hints/dirname.js b/tests/specs/run/node_globals_hints/dirname.js new file mode 100644 index 000000000..58d9e9379 --- /dev/null +++ b/tests/specs/run/node_globals_hints/dirname.js @@ -0,0 +1 @@ +__dirname; diff --git a/tests/specs/run/node_globals_hints/dirname.out b/tests/specs/run/node_globals_hints/dirname.out new file mode 100644 index 000000000..0aa3e4f51 --- /dev/null +++ b/tests/specs/run/node_globals_hints/dirname.out @@ -0,0 +1,7 @@ +error: Uncaught (in promise) ReferenceError: __dirname is not defined +__dirname; +^ + at [WILDCARD]dirname.js:1:1 + + info: __dirname global is not available in ES modules. + hint: Use import.meta.dirname instead. diff --git a/tests/specs/run/node_globals_hints/filename.js b/tests/specs/run/node_globals_hints/filename.js new file mode 100644 index 000000000..31770bb14 --- /dev/null +++ b/tests/specs/run/node_globals_hints/filename.js @@ -0,0 +1 @@ +__filename; diff --git a/tests/specs/run/node_globals_hints/filename.out b/tests/specs/run/node_globals_hints/filename.out new file mode 100644 index 000000000..47b4264fb --- /dev/null +++ b/tests/specs/run/node_globals_hints/filename.out @@ -0,0 +1,7 @@ +error: Uncaught (in promise) ReferenceError: __filename is not defined +__filename; +^ + at [WILDCARD]filename.js:1:1 + + info: __filename global is not available in ES modules. + hint: Use import.meta.filename instead. diff --git a/tests/specs/run/node_globals_hints/global.js b/tests/specs/run/node_globals_hints/global.js new file mode 100644 index 000000000..56676d726 --- /dev/null +++ b/tests/specs/run/node_globals_hints/global.js @@ -0,0 +1 @@ +global; diff --git a/tests/specs/run/node_globals_hints/global.out b/tests/specs/run/node_globals_hints/global.out new file mode 100644 index 000000000..e090d32e2 --- /dev/null +++ b/tests/specs/run/node_globals_hints/global.out @@ -0,0 +1,7 @@ +error: Uncaught (in promise) ReferenceError: global is not defined +global; +^ + at [WILDCARD]global.js:1:1 + + info: global is not available in the global scope in Deno. + hint: Use globalThis instead, or assign globalThis.global = globalThis. diff --git a/tests/specs/run/node_globals_hints/set_immediate.js b/tests/specs/run/node_globals_hints/set_immediate.js new file mode 100644 index 000000000..fa29d1e71 --- /dev/null +++ b/tests/specs/run/node_globals_hints/set_immediate.js @@ -0,0 +1 @@ +setImmediate; diff --git a/tests/specs/run/node_globals_hints/set_immediate.out b/tests/specs/run/node_globals_hints/set_immediate.out new file mode 100644 index 000000000..38859ff5d --- /dev/null +++ b/tests/specs/run/node_globals_hints/set_immediate.out @@ -0,0 +1,7 @@ +error: Uncaught (in promise) ReferenceError: setImmediate is not defined +setImmediate; +^ + at [WILDCARD]set_immediate.js:1:1 + + info: setImmediate is not available in the global scope in Deno. + hint: Import it explicitly with import { setImmediate } from "node:timers";. -- cgit v1.2.3 From a69224ea5bd02f08108aac867c492754095f2d34 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Wed, 30 Oct 2024 02:41:16 +0900 Subject: Revert "fix(ext/node): fix dns.lookup result ordering (#26264)" (#26621) This reverts commit d59599fc187c559ee231882773e1c5a2b932fc3d. Closes #26588 --- tests/unit_node/http_test.ts | 8 ++------ tests/unit_node/tls_test.ts | 12 +++--------- 2 files changed, 5 insertions(+), 15 deletions(-) (limited to 'tests') diff --git a/tests/unit_node/http_test.ts b/tests/unit_node/http_test.ts index 84d6f5727..2b3b8f509 100644 --- a/tests/unit_node/http_test.ts +++ b/tests/unit_node/http_test.ts @@ -322,14 +322,10 @@ Deno.test("[node/http] IncomingRequest socket has remoteAddress + remotePort", a // deno-lint-ignore no-explicit-any const port = (server.address() as any).port; const res = await fetch( - `http://localhost:${port}/`, + `http://127.0.0.1:${port}/`, ); await res.arrayBuffer(); - if (Deno.build.os === "windows") { - assertEquals(remoteAddress, "127.0.0.1"); - } else { - assertEquals(remoteAddress, "::1"); - } + assertEquals(remoteAddress, "127.0.0.1"); assertEquals(typeof remotePort, "number"); server.close(() => resolve()); }); diff --git a/tests/unit_node/tls_test.ts b/tests/unit_node/tls_test.ts index 236dab208..43d6205b0 100644 --- a/tests/unit_node/tls_test.ts +++ b/tests/unit_node/tls_test.ts @@ -32,15 +32,13 @@ for ( ) { Deno.test(`tls.connect sends correct ALPN: '${alpnServer}' + '${alpnClient}' = '${expected}'`, async () => { const listener = Deno.listenTls({ - hostname: "localhost", port: 0, key, cert, alpnProtocols: alpnServer, }); const outgoing = tls.connect({ - host: "::1", - servername: "localhost", + host: "localhost", port: listener.addr.port, ALPNProtocols: alpnClient, secureContext: { @@ -63,7 +61,6 @@ Deno.test("tls.connect makes tls connection", async () => { const ctl = new AbortController(); let port; const serve = Deno.serve({ - hostname: "localhost", port: 0, key, cert, @@ -74,8 +71,7 @@ Deno.test("tls.connect makes tls connection", async () => { await delay(200); const conn = tls.connect({ - host: "::1", - servername: "localhost", + host: "localhost", port, secureContext: { ca: rootCaCert, @@ -106,7 +102,6 @@ Deno.test("tls.connect mid-read tcp->tls upgrade", async () => { const { promise, resolve } = Promise.withResolvers(); const ctl = new AbortController(); const serve = Deno.serve({ - hostname: "localhost", port: 8443, key, cert, @@ -116,8 +111,7 @@ Deno.test("tls.connect mid-read tcp->tls upgrade", async () => { await delay(200); const conn = tls.connect({ - host: "::1", - servername: "localhost", + host: "localhost", port: 8443, secureContext: { ca: rootCaCert, -- cgit v1.2.3 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: fix: support watch flag to enable watching other files than the main module on serve subcommand (#26622) Closes #26618 --- tests/integration/watcher_tests.rs | 70 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) (limited to 'tests') diff --git a/tests/integration/watcher_tests.rs b/tests/integration/watcher_tests.rs index 122353bba..d4705b8d5 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(); -- cgit v1.2.3 From 1431ffa9f8142e4f76f565c51301f4fb174e449a Mon Sep 17 00:00:00 2001 From: McSneaky Date: Wed, 30 Oct 2024 17:32:04 +0200 Subject: docs(console): Update docstrings for install and uninstall (#26623) When running `deno -h` then `install` and `uninstall` scripts had description since deno 1 times :) --- tests/integration/flags_tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/integration/flags_tests.rs b/tests/integration/flags_tests.rs index 455507b9f..663da363d 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", -- cgit v1.2.3 From 2f0c25d33fc0c8bb8e6e92826b2549f429d68d42 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Thu, 31 Oct 2024 10:52:43 +0000 Subject: fix(lsp): include unstable features from editor settings (#26655) --- tests/integration/lsp_tests.rs | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'tests') diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 79e6dc5c4..2376aebd9 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!( -- cgit v1.2.3 From 50ea707b58dff85b479905ebbeef866c95bc3cad Mon Sep 17 00:00:00 2001 From: Taku Amano Date: Thu, 31 Oct 2024 23:20:26 +0900 Subject: fix(coverage): exclude comment lines from coverage reports (#25939) --- tests/testdata/coverage/complex.ts | 13 +++++ tests/testdata/coverage/complex_expected.lcov | 82 +++++++++++---------------- tests/testdata/coverage/complex_expected.out | 31 +++++----- 3 files changed, 62 insertions(+), 64 deletions(-) (limited to 'tests') diff --git a/tests/testdata/coverage/complex.ts b/tests/testdata/coverage/complex.ts index d128b5437..316986cd2 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 94b86465a..7e5c0f40f 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 3d5f6a0ab..f626024b9 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); -- cgit v1.2.3 From 90edca21a26fd2decd0603fea37af10d1e11e454 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 31 Oct 2024 11:35:17 -0400 Subject: fix: surface package.json location on dep parse failure (#26665) Related: https://github.com/denoland/deno/issues/26653 --- tests/specs/install/invalid_scheme/__test__.jsonc | 5 +++++ tests/specs/install/invalid_scheme/install.out | 5 +++++ tests/specs/install/invalid_scheme/package.json | 6 ++++++ tests/specs/run/package_json/invalid_value/add.out | 3 ++- tests/specs/run/package_json/invalid_value/install.out | 3 ++- 5 files changed, 20 insertions(+), 2 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 (limited to 'tests') diff --git a/tests/specs/install/invalid_scheme/__test__.jsonc b/tests/specs/install/invalid_scheme/__test__.jsonc new file mode 100644 index 000000000..c4d3ebbf0 --- /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 000000000..cf100216b --- /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 000000000..5e50ae591 --- /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 9b7493c1a..32d9acaed 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 cc82b345b..ca3492ab2 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 -- cgit v1.2.3 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: 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. --- .../@denotest/cjs-multiple-exports/1.0.0/package.json | 8 ++++++++ .../npm/@denotest/cjs-multiple-exports/1.0.0/src/add.js | 3 +++ .../@denotest/cjs-multiple-exports/1.0.0/src/index.js | 3 +++ .../__test__.jsonc | 13 +++++++++++++ .../require_export_from_parent_with_no_filename/main.cjs | 16 ++++++++++++++++ .../package.json | 5 +++++ 6 files changed, 48 insertions(+) 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 (limited to 'tests') 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 000000000..43f07a235 --- /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 000000000..42c8a7c60 --- /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 000000000..432ed652e --- /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 000000000..a3de08e46 --- /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 000000000..3335ae1bf --- /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 000000000..9cd643895 --- /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" + } +} -- cgit v1.2.3 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: 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. --- tests/node_compat/config.jsonc | 3 +- tests/node_compat/runner/TODO.md | 1 - tests/node_compat/test/parallel/test-os.js | 286 +++++++++++++++++++++++++++++ 3 files changed, 287 insertions(+), 3 deletions(-) create mode 100644 tests/node_compat/test/parallel/test-os.js (limited to 'tests') diff --git a/tests/node_compat/config.jsonc b/tests/node_compat/config.jsonc index a99a42790..16951d9ed 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 35a67e72d..231a4f62c 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 000000000..f7c24342a --- /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); -- cgit v1.2.3 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: 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 --- .../@denotest/print-npm-user-agent/1.0.0/index.js | 2 + .../print-npm-user-agent/1.0.0/package.json | 10 +++++ tests/specs/npm/user_agent_env_var/__test__.jsonc | 46 ++++++++++++++++++++++ tests/specs/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 + tests/specs/npm/user_agent_env_var/package.json | 8 ++++ tests/specs/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 + 10 files changed, 84 insertions(+) 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 (limited to 'tests') 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 000000000..b835b8e25 --- /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 000000000..907117346 --- /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 000000000..a2af970a0 --- /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 000000000..c8e941303 --- /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 000000000..fbd70ec48 --- /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 000000000..2c51107e3 --- /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 000000000..12cc0cc6f --- /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 000000000..19a08598f --- /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 000000000..a630ac412 --- /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 000000000..ae035d40e --- /dev/null +++ b/tests/specs/npm/user_agent_env_var/test.mjs @@ -0,0 +1 @@ +console.log(process.env.npm_config_user_agent); -- cgit v1.2.3 From 4774eab64d5176e997b6431f03f075782321b3d9 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Fri, 1 Nov 2024 16:13:02 +0530 Subject: 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 --- tests/napi/src/async.rs | 2 +- tests/specs/future/unstable_flags/main.js | 1 - tests/specs/future/unstable_flags/main.out | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/napi/src/async.rs b/tests/napi/src/async.rs index 3d3827b51..367d2e9ef 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 51af892f6..8cc8960d9 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 b979d62f4..bb101b641 100644 --- a/tests/specs/future/unstable_flags/main.out +++ b/tests/specs/future/unstable_flags/main.out @@ -1,3 +1,2 @@ true true -true -- cgit v1.2.3 From 826e42a5b5880c974ae019a7a21aade6a718062c Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 1 Nov 2024 12:27:00 -0400 Subject: 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 --- tests/integration/run_tests.rs | 3 +- .../npm/@denotest/type-commonjs/1.0.0/index.js | 6 +++- .../check/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 ++ .../specs/npm/require_type_commonjs/__test__.jsonc | 3 +- tests/specs/npm/require_type_commonjs/main.out | 5 +--- tests/specs/npm/require_type_commonjs/main.ts | 3 +- .../npm/typescript_file_in_package/__test__.jsonc | 4 +-- .../specs/npm/typescript_file_in_package/main.out | 3 ++ tests/specs/npm/typescript_file_in_package/main.ts | 5 ++++ .../typescript_file_in_package/main.out | 6 ---- .../typescript_file_in_package/main.ts | 5 ---- tests/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 ++++ .../run/cjs/reexport_non_analyzable/__test__.jsonc | 9 ++++++ .../run/cjs/reexport_non_analyzable/deno.json | 3 ++ .../specs/run/cjs/reexport_non_analyzable/main.ts | 3 ++ .../reexport_non_analyzable/node_modules/foo.cjs | 5 ++++ 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/cjs_reexport_non_analyzable/__test__.jsonc | 9 ------ .../run/cjs_reexport_non_analyzable/deno.json | 3 -- .../specs/run/cjs_reexport_non_analyzable/main.ts | 3 -- .../node_modules/foo.cjs | 5 ---- tests/specs/run/cts/cjs_import_cts/__test__.jsonc | 13 +++++++++ tests/specs/run/cts/cjs_import_cts/add.cts | 3 ++ 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 + tests/specs/run/cts/cjs_import_cts/subtract.cjs | 3 ++ .../run/cts/import_export_equals/__test__.jsonc | 17 +++++++++++ tests/specs/run/cts/import_export_equals/add.cts | 3 ++ tests/specs/run/cts/import_export_equals/main.cts | 3 ++ tests/specs/run/cts/import_export_equals/main.out | 2 ++ tests/specs/run/cts/import_export_equals/mod.mts | 3 ++ .../run/cts/import_export_equals/mod.mts.check.out | 5 ++++ .../specs/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 + .../run/package_json_type/commonjs/__test__.jsonc | 34 ---------------------- tests/specs/run/package_json_type/commonjs/add.js | 3 -- .../commonjs/basic/__test__.jsonc | 34 ++++++++++++++++++++++ .../run/package_json_type/commonjs/basic/add.js | 3 ++ .../package_json_type/commonjs/basic/deno.jsonc | 5 ++++ .../commonjs/basic/import_import_meta.js | 3 ++ .../commonjs/basic/import_meta.js | 1 + .../package_json_type/commonjs/basic/main_cjs.js | 2 ++ .../package_json_type/commonjs/basic/main_esm.js | 3 ++ .../commonjs/basic/main_esm_import_meta.js | 2 ++ .../commonjs/basic/main_esm_import_meta.out | 2 ++ .../package_json_type/commonjs/basic/main_mix.js | 6 ++++ .../package_json_type/commonjs/basic/main_mix.out | 13 +++++++++ .../commonjs/basic/not_import_meta.js | 8 +++++ .../package_json_type/commonjs/basic/package.json | 3 ++ .../run/package_json_type/commonjs/basic/tla.js | 2 ++ .../run/package_json_type/commonjs/deno.jsonc | 5 ---- .../commonjs/import_import_meta.js | 3 -- .../run/package_json_type/commonjs/import_meta.js | 1 - .../package_json_type/commonjs/jsx/__test__.jsonc | 5 ++++ .../run/package_json_type/commonjs/jsx/add.js | 3 ++ .../run/package_json_type/commonjs/jsx/deno.jsonc | 10 +++++++ .../run/package_json_type/commonjs/jsx/main.jsx | 7 +++++ .../run/package_json_type/commonjs/jsx/main.out | 4 +++ .../package_json_type/commonjs/jsx/package.json | 7 +++++ .../run/package_json_type/commonjs/jsx/tsx.tsx | 5 ++++ .../run/package_json_type/commonjs/main_cjs.js | 2 -- .../run/package_json_type/commonjs/main_esm.js | 3 -- .../commonjs/main_esm_import_meta.js | 2 -- .../commonjs/main_esm_import_meta.out | 2 -- .../run/package_json_type/commonjs/main_mix.js | 6 ---- .../run/package_json_type/commonjs/main_mix.out | 13 --------- .../package_json_type/commonjs/not_import_meta.js | 8 ----- .../run/package_json_type/commonjs/package.json | 3 -- tests/specs/run/package_json_type/commonjs/tla.js | 2 -- 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 +- 95 files changed, 343 insertions(+), 142 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 create mode 100644 tests/specs/npm/typescript_file_in_package/main.ts delete mode 100644 tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.out delete mode 100644 tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.ts 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 create mode 100644 tests/specs/run/cjs/reexport_non_analyzable/__test__.jsonc create mode 100644 tests/specs/run/cjs/reexport_non_analyzable/deno.json create mode 100644 tests/specs/run/cjs/reexport_non_analyzable/main.ts create mode 100644 tests/specs/run/cjs/reexport_non_analyzable/node_modules/foo.cjs 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 delete mode 100644 tests/specs/run/cjs_reexport_non_analyzable/__test__.jsonc delete mode 100644 tests/specs/run/cjs_reexport_non_analyzable/deno.json delete mode 100644 tests/specs/run/cjs_reexport_non_analyzable/main.ts delete mode 100644 tests/specs/run/cjs_reexport_non_analyzable/node_modules/foo.cjs create mode 100644 tests/specs/run/cts/cjs_import_cts/__test__.jsonc create mode 100644 tests/specs/run/cts/cjs_import_cts/add.cts 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 delete mode 100644 tests/specs/run/package_json_type/commonjs/__test__.jsonc delete mode 100644 tests/specs/run/package_json_type/commonjs/add.js create mode 100644 tests/specs/run/package_json_type/commonjs/basic/__test__.jsonc create mode 100644 tests/specs/run/package_json_type/commonjs/basic/add.js create mode 100644 tests/specs/run/package_json_type/commonjs/basic/deno.jsonc create mode 100644 tests/specs/run/package_json_type/commonjs/basic/import_import_meta.js create mode 100644 tests/specs/run/package_json_type/commonjs/basic/import_meta.js create mode 100644 tests/specs/run/package_json_type/commonjs/basic/main_cjs.js create mode 100644 tests/specs/run/package_json_type/commonjs/basic/main_esm.js create mode 100644 tests/specs/run/package_json_type/commonjs/basic/main_esm_import_meta.js create mode 100644 tests/specs/run/package_json_type/commonjs/basic/main_esm_import_meta.out create mode 100644 tests/specs/run/package_json_type/commonjs/basic/main_mix.js create mode 100644 tests/specs/run/package_json_type/commonjs/basic/main_mix.out create mode 100644 tests/specs/run/package_json_type/commonjs/basic/not_import_meta.js create mode 100644 tests/specs/run/package_json_type/commonjs/basic/package.json create mode 100644 tests/specs/run/package_json_type/commonjs/basic/tla.js delete mode 100644 tests/specs/run/package_json_type/commonjs/deno.jsonc delete mode 100644 tests/specs/run/package_json_type/commonjs/import_import_meta.js delete mode 100644 tests/specs/run/package_json_type/commonjs/import_meta.js 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 delete mode 100644 tests/specs/run/package_json_type/commonjs/main_cjs.js delete mode 100644 tests/specs/run/package_json_type/commonjs/main_esm.js delete mode 100644 tests/specs/run/package_json_type/commonjs/main_esm_import_meta.js delete mode 100644 tests/specs/run/package_json_type/commonjs/main_esm_import_meta.out delete mode 100644 tests/specs/run/package_json_type/commonjs/main_mix.js delete mode 100644 tests/specs/run/package_json_type/commonjs/main_mix.out delete mode 100644 tests/specs/run/package_json_type/commonjs/not_import_meta.js delete mode 100644 tests/specs/run/package_json_type/commonjs/package.json delete mode 100644 tests/specs/run/package_json_type/commonjs/tla.js (limited to 'tests') diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs index db9f79556..a07dd56c8 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 cb0ff5c3b..d3f80a049 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 1a1dafeb7..315769e40 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 000000000..9bdcf4724 --- /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 000000000..bf9060126 --- /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 000000000..d89a600a4 --- /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 000000000..c2a8c7be0 --- /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 000000000..3c0618cfc --- /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 000000000..2559e5c49 --- /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 000000000..af7cecfdf --- /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 32bebb7a5..0abf121f0 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 2a886fbc1..94b0263f0 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 6509b7f29..913e363c3 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 e1c27b8dc..00750edc0 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 5bbefffba..6e65b32ed 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 000000000..e4f6760b7 --- /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 c9ba97ff5..a71173ce3 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 d715db8a9..00750edc0 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 243eb216e..95ec6099e 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 08979ed25..7b5c5e1b6 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 000000000..58290a873 --- /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/main.ts b/tests/specs/npm/typescript_file_in_package/main.ts new file mode 100644 index 000000000..aefc38ebe --- /dev/null +++ b/tests/specs/npm/typescript_file_in_package/main.ts @@ -0,0 +1,5 @@ +// We don't support typescript files in npm packages because we don't +// want to encourage people distributing npm packages that aren't JavaScript. +import { getValue } from "npm:@denotest/typescript-file"; + +console.log(getValue()); 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 b3faa8790..000000000 --- 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/npm/typescript_file_in_package/typescript_file_in_package/main.ts b/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.ts deleted file mode 100644 index aefc38ebe..000000000 --- a/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -// We don't support typescript files in npm packages because we don't -// want to encourage people distributing npm packages that aren't JavaScript. -import { getValue } from "npm:@denotest/typescript-file"; - -console.log(getValue()); 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 000000000..e756a6362 --- /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 000000000..2a4c57ab1 --- /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 000000000..93b86d27e --- /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 new file mode 100644 index 000000000..81f29b685 --- /dev/null +++ b/tests/specs/run/cjs/reexport_non_analyzable/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "tempDir": true, + "steps": [ + { + "args": "run -A main.ts", + "output": "" + } + ] +} diff --git a/tests/specs/run/cjs/reexport_non_analyzable/deno.json b/tests/specs/run/cjs/reexport_non_analyzable/deno.json new file mode 100644 index 000000000..fde86a1ef --- /dev/null +++ b/tests/specs/run/cjs/reexport_non_analyzable/deno.json @@ -0,0 +1,3 @@ +{ + "nodeModulesDir": "manual" +} diff --git a/tests/specs/run/cjs/reexport_non_analyzable/main.ts b/tests/specs/run/cjs/reexport_non_analyzable/main.ts new file mode 100644 index 000000000..a9e32af4e --- /dev/null +++ b/tests/specs/run/cjs/reexport_non_analyzable/main.ts @@ -0,0 +1,3 @@ +import assert from "./node_modules/foo.cjs"; + +assert.equal(1 + 1, 2); 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 new file mode 100644 index 000000000..924d8a96a --- /dev/null +++ b/tests/specs/run/cjs/reexport_non_analyzable/node_modules/foo.cjs @@ -0,0 +1,5 @@ +try { + module.exports = require("nonexistent"); +} catch(_e) { + module.exports = require("assert"); +} diff --git a/tests/specs/run/cjs/unprepared/__test__.jsonc b/tests/specs/run/cjs/unprepared/__test__.jsonc new file mode 100644 index 000000000..f816bad86 --- /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 000000000..ba0c6fa6f --- /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 000000000..e965047ad --- /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 000000000..5630b4fbc --- /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 000000000..54ed3702f --- /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/cjs_reexport_non_analyzable/__test__.jsonc b/tests/specs/run/cjs_reexport_non_analyzable/__test__.jsonc deleted file mode 100644 index 81f29b685..000000000 --- a/tests/specs/run/cjs_reexport_non_analyzable/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "tempDir": true, - "steps": [ - { - "args": "run -A main.ts", - "output": "" - } - ] -} diff --git a/tests/specs/run/cjs_reexport_non_analyzable/deno.json b/tests/specs/run/cjs_reexport_non_analyzable/deno.json deleted file mode 100644 index fde86a1ef..000000000 --- a/tests/specs/run/cjs_reexport_non_analyzable/deno.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "nodeModulesDir": "manual" -} diff --git a/tests/specs/run/cjs_reexport_non_analyzable/main.ts b/tests/specs/run/cjs_reexport_non_analyzable/main.ts deleted file mode 100644 index a9e32af4e..000000000 --- a/tests/specs/run/cjs_reexport_non_analyzable/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import assert from "./node_modules/foo.cjs"; - -assert.equal(1 + 1, 2); 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 deleted file mode 100644 index 924d8a96a..000000000 --- a/tests/specs/run/cjs_reexport_non_analyzable/node_modules/foo.cjs +++ /dev/null @@ -1,5 +0,0 @@ -try { - module.exports = require("nonexistent"); -} catch(_e) { - module.exports = require("assert"); -} 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 000000000..2205183d0 --- /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/cts/cjs_import_cts/add.cts b/tests/specs/run/cts/cjs_import_cts/add.cts new file mode 100644 index 000000000..2a886fbc1 --- /dev/null +++ b/tests/specs/run/cts/cjs_import_cts/add.cts @@ -0,0 +1,3 @@ +module.exports.add = function (a, b) { + return a + b; +}; 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 000000000..a27e8d7af --- /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 000000000..9546a0fea --- /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 000000000..3a2e3f498 --- /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 000000000..7dee54346 --- /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 000000000..6a5c6db42 --- /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 000000000..adf3503ac --- /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 000000000..e5c45f92e --- /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 000000000..e7a973a7d --- /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 000000000..5fbbd6c6a --- /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 000000000..870353901 --- /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 000000000..208465a08 --- /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 000000000..0157b44e9 --- /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 000000000..f61e0da2a --- /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 000000000..0b0330686 --- /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 000000000..e965047ad --- /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/__test__.jsonc deleted file mode 100644 index 85b7219fa..000000000 --- a/tests/specs/run/package_json_type/commonjs/__test__.jsonc +++ /dev/null @@ -1,34 +0,0 @@ -{ - "tests": { - "main_cjs": { - "args": "run --allow-read=. main_cjs.js", - "output": "3\n" - }, - "main_esm": { - "args": "run --allow-read=. main_esm.js", - "output": "3\n" - }, - "main_mix": { - "args": "run --allow-read=. main_mix.js", - "output": "main_mix.out", - "exitCode": 1 - }, - "import_import_meta": { - "args": "run import_import_meta.js", - "output": "[WILDLINE]/import_meta.js\n" - }, - "main_import_meta": { - "args": "run main_esm_import_meta.js", - "output": "main_esm_import_meta.out", - "exitCode": 1 - }, - "not_import_meta": { - "args": "run --allow-read=. not_import_meta.js", - "output": "3\n" - }, - "tla": { - "args": "run --allow-read=. tla.js", - "output": "loaded\n" - } - } -} diff --git a/tests/specs/run/package_json_type/commonjs/add.js b/tests/specs/run/package_json_type/commonjs/add.js deleted file mode 100644 index 2a886fbc1..000000000 --- a/tests/specs/run/package_json_type/commonjs/add.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports.add = function (a, b) { - return a + b; -}; diff --git a/tests/specs/run/package_json_type/commonjs/basic/__test__.jsonc b/tests/specs/run/package_json_type/commonjs/basic/__test__.jsonc new file mode 100644 index 000000000..85b7219fa --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/basic/__test__.jsonc @@ -0,0 +1,34 @@ +{ + "tests": { + "main_cjs": { + "args": "run --allow-read=. main_cjs.js", + "output": "3\n" + }, + "main_esm": { + "args": "run --allow-read=. main_esm.js", + "output": "3\n" + }, + "main_mix": { + "args": "run --allow-read=. main_mix.js", + "output": "main_mix.out", + "exitCode": 1 + }, + "import_import_meta": { + "args": "run import_import_meta.js", + "output": "[WILDLINE]/import_meta.js\n" + }, + "main_import_meta": { + "args": "run main_esm_import_meta.js", + "output": "main_esm_import_meta.out", + "exitCode": 1 + }, + "not_import_meta": { + "args": "run --allow-read=. not_import_meta.js", + "output": "3\n" + }, + "tla": { + "args": "run --allow-read=. tla.js", + "output": "loaded\n" + } + } +} 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 000000000..2a886fbc1 --- /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/basic/deno.jsonc b/tests/specs/run/package_json_type/commonjs/basic/deno.jsonc new file mode 100644 index 000000000..35f64c86f --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/basic/deno.jsonc @@ -0,0 +1,5 @@ +{ + "unstable": [ + "detect-cjs" + ] +} diff --git a/tests/specs/run/package_json_type/commonjs/basic/import_import_meta.js b/tests/specs/run/package_json_type/commonjs/basic/import_import_meta.js new file mode 100644 index 000000000..f07518985 --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/basic/import_import_meta.js @@ -0,0 +1,3 @@ +import { value } from "./import_meta.js"; + +console.log(value); diff --git a/tests/specs/run/package_json_type/commonjs/basic/import_meta.js b/tests/specs/run/package_json_type/commonjs/basic/import_meta.js new file mode 100644 index 000000000..2bdbc30fe --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/basic/import_meta.js @@ -0,0 +1 @@ +export const value = import.meta.url; diff --git a/tests/specs/run/package_json_type/commonjs/basic/main_cjs.js b/tests/specs/run/package_json_type/commonjs/basic/main_cjs.js new file mode 100644 index 000000000..365e8e06f --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/basic/main_cjs.js @@ -0,0 +1,2 @@ +const { add } = require("./add"); +console.log(add(1, 2)); diff --git a/tests/specs/run/package_json_type/commonjs/basic/main_esm.js b/tests/specs/run/package_json_type/commonjs/basic/main_esm.js new file mode 100644 index 000000000..8c55f673b --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/basic/main_esm.js @@ -0,0 +1,3 @@ +import { add } from "./add.js"; + +console.log(add(1, 2)); diff --git a/tests/specs/run/package_json_type/commonjs/basic/main_esm_import_meta.js b/tests/specs/run/package_json_type/commonjs/basic/main_esm_import_meta.js new file mode 100644 index 000000000..f1dff20b5 --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/basic/main_esm_import_meta.js @@ -0,0 +1,2 @@ +console.log(import.meta.url); +console.log(require("./add")); diff --git a/tests/specs/run/package_json_type/commonjs/basic/main_esm_import_meta.out b/tests/specs/run/package_json_type/commonjs/basic/main_esm_import_meta.out new file mode 100644 index 000000000..e177defff --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/basic/main_esm_import_meta.out @@ -0,0 +1,2 @@ +[WILDLINE]main_esm_import_meta.js +error: Uncaught (in promise) ReferenceError: require is not defined[WILDCARD] diff --git a/tests/specs/run/package_json_type/commonjs/basic/main_mix.js b/tests/specs/run/package_json_type/commonjs/basic/main_mix.js new file mode 100644 index 000000000..2a2c2c62a --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/basic/main_mix.js @@ -0,0 +1,6 @@ +import { add } from "./add.js"; + +console.log(add(1, 2)); + +// will error +console.log(require("./add").add(1, 2)); 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 new file mode 100644 index 000000000..78f421644 --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/basic/main_mix.out @@ -0,0 +1,13 @@ +3 +error: Uncaught (in promise) ReferenceError: require is not defined +console.log(require("./add").add(1, 2)); + ^ + at file:///[WILDLINE]main_mix.js:[WILDLINE] + + info: Deno supports CommonJS modules in .cjs files, or when there's a package.json + with "type": "commonjs" option and --unstable-detect-cjs flag is used. + 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 + and pass --unstable-detect-cjs flag. + docs: https://docs.deno.com/go/commonjs diff --git a/tests/specs/run/package_json_type/commonjs/basic/not_import_meta.js b/tests/specs/run/package_json_type/commonjs/basic/not_import_meta.js new file mode 100644 index 000000000..216b900df --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/basic/not_import_meta.js @@ -0,0 +1,8 @@ +try { + console.log(test.import.meta.url); +} catch { + // ignore +} + +// should work because this is not an ESM file +console.log(require("./add").add(1, 2)); diff --git a/tests/specs/run/package_json_type/commonjs/basic/package.json b/tests/specs/run/package_json_type/commonjs/basic/package.json new file mode 100644 index 000000000..5bbefffba --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/basic/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/tests/specs/run/package_json_type/commonjs/basic/tla.js b/tests/specs/run/package_json_type/commonjs/basic/tla.js new file mode 100644 index 000000000..978578de4 --- /dev/null +++ b/tests/specs/run/package_json_type/commonjs/basic/tla.js @@ -0,0 +1,2 @@ +await new Promise((r) => r()); +console.log("loaded"); diff --git a/tests/specs/run/package_json_type/commonjs/deno.jsonc b/tests/specs/run/package_json_type/commonjs/deno.jsonc deleted file mode 100644 index 35f64c86f..000000000 --- a/tests/specs/run/package_json_type/commonjs/deno.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "unstable": [ - "detect-cjs" - ] -} diff --git a/tests/specs/run/package_json_type/commonjs/import_import_meta.js b/tests/specs/run/package_json_type/commonjs/import_import_meta.js deleted file mode 100644 index f07518985..000000000 --- a/tests/specs/run/package_json_type/commonjs/import_import_meta.js +++ /dev/null @@ -1,3 +0,0 @@ -import { value } from "./import_meta.js"; - -console.log(value); diff --git a/tests/specs/run/package_json_type/commonjs/import_meta.js b/tests/specs/run/package_json_type/commonjs/import_meta.js deleted file mode 100644 index 2bdbc30fe..000000000 --- a/tests/specs/run/package_json_type/commonjs/import_meta.js +++ /dev/null @@ -1 +0,0 @@ -export const value = import.meta.url; 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 000000000..f815fd72c --- /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 000000000..2a886fbc1 --- /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 000000000..192ddb98c --- /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 000000000..1922fce1b --- /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 000000000..cdcf04541 --- /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 000000000..88afcdcd9 --- /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 000000000..ad8f0c0a9 --- /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/package_json_type/commonjs/main_cjs.js b/tests/specs/run/package_json_type/commonjs/main_cjs.js deleted file mode 100644 index 365e8e06f..000000000 --- a/tests/specs/run/package_json_type/commonjs/main_cjs.js +++ /dev/null @@ -1,2 +0,0 @@ -const { add } = require("./add"); -console.log(add(1, 2)); diff --git a/tests/specs/run/package_json_type/commonjs/main_esm.js b/tests/specs/run/package_json_type/commonjs/main_esm.js deleted file mode 100644 index 8c55f673b..000000000 --- a/tests/specs/run/package_json_type/commonjs/main_esm.js +++ /dev/null @@ -1,3 +0,0 @@ -import { add } from "./add.js"; - -console.log(add(1, 2)); diff --git a/tests/specs/run/package_json_type/commonjs/main_esm_import_meta.js b/tests/specs/run/package_json_type/commonjs/main_esm_import_meta.js deleted file mode 100644 index f1dff20b5..000000000 --- a/tests/specs/run/package_json_type/commonjs/main_esm_import_meta.js +++ /dev/null @@ -1,2 +0,0 @@ -console.log(import.meta.url); -console.log(require("./add")); diff --git a/tests/specs/run/package_json_type/commonjs/main_esm_import_meta.out b/tests/specs/run/package_json_type/commonjs/main_esm_import_meta.out deleted file mode 100644 index e177defff..000000000 --- a/tests/specs/run/package_json_type/commonjs/main_esm_import_meta.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDLINE]main_esm_import_meta.js -error: Uncaught (in promise) ReferenceError: require is not defined[WILDCARD] diff --git a/tests/specs/run/package_json_type/commonjs/main_mix.js b/tests/specs/run/package_json_type/commonjs/main_mix.js deleted file mode 100644 index 2a2c2c62a..000000000 --- a/tests/specs/run/package_json_type/commonjs/main_mix.js +++ /dev/null @@ -1,6 +0,0 @@ -import { add } from "./add.js"; - -console.log(add(1, 2)); - -// will error -console.log(require("./add").add(1, 2)); diff --git a/tests/specs/run/package_json_type/commonjs/main_mix.out b/tests/specs/run/package_json_type/commonjs/main_mix.out deleted file mode 100644 index 78f421644..000000000 --- a/tests/specs/run/package_json_type/commonjs/main_mix.out +++ /dev/null @@ -1,13 +0,0 @@ -3 -error: Uncaught (in promise) ReferenceError: require is not defined -console.log(require("./add").add(1, 2)); - ^ - at file:///[WILDLINE]main_mix.js:[WILDLINE] - - info: Deno supports CommonJS modules in .cjs files, or when there's a package.json - with "type": "commonjs" option and --unstable-detect-cjs flag is used. - 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 - and pass --unstable-detect-cjs flag. - docs: https://docs.deno.com/go/commonjs diff --git a/tests/specs/run/package_json_type/commonjs/not_import_meta.js b/tests/specs/run/package_json_type/commonjs/not_import_meta.js deleted file mode 100644 index 216b900df..000000000 --- a/tests/specs/run/package_json_type/commonjs/not_import_meta.js +++ /dev/null @@ -1,8 +0,0 @@ -try { - console.log(test.import.meta.url); -} catch { - // ignore -} - -// should work because this is not an ESM file -console.log(require("./add").add(1, 2)); diff --git a/tests/specs/run/package_json_type/commonjs/package.json b/tests/specs/run/package_json_type/commonjs/package.json deleted file mode 100644 index 5bbefffba..000000000 --- a/tests/specs/run/package_json_type/commonjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/tests/specs/run/package_json_type/commonjs/tla.js b/tests/specs/run/package_json_type/commonjs/tla.js deleted file mode 100644 index 978578de4..000000000 --- a/tests/specs/run/package_json_type/commonjs/tla.js +++ /dev/null @@ -1,2 +0,0 @@ -await new Promise((r) => r()); -console.log("loaded"); diff --git a/tests/specs/run/remote_cjs_main/output.out b/tests/specs/run/remote_cjs_main/output.out index f75c33907..360934acb 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 d17b1ead5..57b842b34 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 6434620e2..25b79d9a7 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] -- cgit v1.2.3 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: 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 --- .../add/package_json_and_deno_json/__test__.jsonc | 23 ++++++++++++++++++++++ .../package_json_and_deno_json/subdir/deno.json | 4 ++++ .../add/package_json_and_deno_json/subdir/mod.ts | 0 .../subdir/prefer_if_closer_deno.json.out | 9 +++++++++ 4 files changed, 36 insertions(+) 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 (limited to 'tests') 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 0beee02d1..8d67a07c8 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 000000000..cc54bbd8a --- /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 000000000..e69de29bb 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 000000000..8a5819d50 --- /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" + } +} -- cgit v1.2.3 From fb1d33a7111e45e9b414cfe922a5db5ee4daf3ea Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Tue, 5 Nov 2024 02:17:11 +0900 Subject: chore: update dlint to v0.68.0 for internal (#26711) --- tests/node_compat/test/fixtures/child-process-spawn-node.js | 1 + tests/unit/globals_test.ts | 1 + 2 files changed, 2 insertions(+) (limited to 'tests') 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 d403aabf9..7112567e0 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 45a045835..6de228e1c 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, -- cgit v1.2.3 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: 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. --- 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 +++++ 8 files changed, 49 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 (limited to 'tests') diff --git a/tests/specs/fmt/yaml/__test__.jsonc b/tests/specs/fmt/yaml/__test__.jsonc index 499b4144b..71a2e0682 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 000000000..c724c7bde --- /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 000000000..a2053533e --- /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 000000000..a3927a7b1 --- /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 000000000..c32fe9f2b --- /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 000000000..490adcb5f --- /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 000000000..065dc98db --- /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 000000000..8019d989d --- /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 -- cgit v1.2.3 From d67765b0b48d711cd0878e168ccb1e28178c4006 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Mon, 4 Nov 2024 20:01:31 +0000 Subject: fix(lsp): scope attribution for lazily loaded assets (#26699) --- tests/integration/lsp_tests.rs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'tests') diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 2376aebd9..56221a026 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() { -- cgit v1.2.3 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: 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 --- tests/specs/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 +++++ .../run/workspaces/wildcard/packages/bar/deno.json | 8 ++++++++ .../workspaces/wildcard/packages/bar/fizz/buzz.ts | 1 + .../run/workspaces/wildcard/packages/bar/mod.ts | 5 +++++ .../wildcard/packages/bar/some_mod/hello.ts | 1 + .../workspaces/wildcard/packages/foo/bar/hello.ts | 1 + .../run/workspaces/wildcard/packages/foo/deno.json | 8 ++++++++ .../workspaces/wildcard/packages/foo/fizz/buzz.ts | 1 + .../run/workspaces/wildcard/packages/foo/mod.ts | 5 +++++ 12 files changed, 70 insertions(+) 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 (limited to 'tests') diff --git a/tests/specs/run/workspaces/wildcard/__test__.jsonc b/tests/specs/run/workspaces/wildcard/__test__.jsonc new file mode 100644 index 000000000..ea467e51b --- /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 000000000..8c39ec656 --- /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 000000000..72165dbde --- /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 000000000..e69143370 --- /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 000000000..ef3bfc37a --- /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 000000000..f88d62fcc --- /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 000000000..6f898e389 --- /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 000000000..1013de8d2 --- /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 000000000..c8a7e57c4 --- /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 000000000..46d84f06f --- /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 000000000..4e03777d1 --- /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 000000000..d7b16dcc0 --- /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); -- cgit v1.2.3 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: 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(-) (limited to 'tests') diff --git a/tests/integration/watcher_tests.rs b/tests/integration/watcher_tests.rs index d4705b8d5..e8f264632 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!\"); }, };", -- cgit v1.2.3 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: 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 --- .../jsr/@denotest/unstable/1.0.0-beta.1/mod.ts | 3 +++ .../jsr/@denotest/unstable/1.0.0-beta.1_meta.json | 5 +++++ .../jsr/@denotest/unstable/1.0.0-beta.2/mod.ts | 3 +++ .../jsr/@denotest/unstable/1.0.0-beta.2_meta.json | 5 +++++ tests/registry/jsr/@denotest/unstable/meta.json | 6 ++++++ .../add/only_unstable_versions/__test__.jsonc | 23 +++++++++++++++++----- tests/specs/add/only_unstable_versions/add_jsr.out | 1 + 7 files changed, 41 insertions(+), 5 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 (limited to 'tests') 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 000000000..de6368618 --- /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 000000000..631a18d0e --- /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 000000000..4e599641e --- /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 000000000..631a18d0e --- /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 000000000..7c5c9971e --- /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 d05628b6f..ea5a270b9 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 000000000..95f0630bf --- /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` -- cgit v1.2.3 From 89f0b796bd442ff352c3f93f69156ca6d85bfd5e Mon Sep 17 00:00:00 2001 From: Mohammad Sulaiman Date: Tue, 5 Nov 2024 08:39:05 +0200 Subject: chore: deprecate run itests (#26444) --- tests/integration/run_tests.rs | 1927 +------------------- tests/specs/run/_001_hello/001_hello.js | 1 + tests/specs/run/_001_hello/001_hello.js.out | 1 + tests/specs/run/_001_hello/__test__.jsonc | 4 + tests/specs/run/_002_hello/002_hello.ts | 1 + tests/specs/run/_002_hello/002_hello.ts.out | 1 + tests/specs/run/_002_hello/__test__.jsonc | 4 + .../_003_relative_import/003_relative_import.ts | 3 + .../003_relative_import.ts.out | 1 + .../specs/run/_003_relative_import/__test__.jsonc | 4 + .../specs/run/_003_relative_import/print_hello.ts | 3 + .../specs/run/_004_set_timeout/004_set_timeout.ts | 11 + .../run/_004_set_timeout/004_set_timeout.ts.out | 2 + tests/specs/run/_004_set_timeout/__test__.jsonc | 4 + .../run/_005_more_imports/005_more_imports.ts | 11 + .../run/_005_more_imports/005_more_imports.ts.out | 1 + tests/specs/run/_005_more_imports/__test__.jsonc | 4 + tests/specs/run/_005_more_imports/mod1.ts | 17 + tests/specs/run/_005_more_imports/print_hello.ts | 3 + tests/specs/run/_005_more_imports/subdir2/mod2.ts | 9 + .../specs/run/_006_url_imports/006_url_imports.ts | 3 + .../run/_006_url_imports/006_url_imports.ts.out | 2 + tests/specs/run/_006_url_imports/__test__.jsonc | 4 + tests/specs/run/_006_url_imports/print_hello.ts | 3 + tests/specs/run/_006_url_imports/subdir2/mod2.ts | 9 + tests/specs/run/_012_async/012_async.ts | 11 + tests/specs/run/_012_async/012_async.ts.out | 3 + tests/specs/run/_012_async/__test__.jsonc | 4 + .../run/_013_dynamic_import/013_dynamic_import.ts | 15 + .../_013_dynamic_import/013_dynamic_import.ts.out | 1 + tests/specs/run/_013_dynamic_import/__test__.jsonc | 4 + tests/specs/run/_013_dynamic_import/mod1.ts | 17 + tests/specs/run/_013_dynamic_import/print_hello.ts | 3 + .../specs/run/_013_dynamic_import/subdir2/mod2.ts | 9 + .../_014_duplicate_import/014_duplicate_import.ts | 9 + .../014_duplicate_import.ts.out | 1 + .../specs/run/_014_duplicate_import/__test__.jsonc | 4 + .../run/_014_duplicate_import/auto_print_hello.ts | 2 + .../015_duplicate_parallel_import.js | 20 + .../015_duplicate_parallel_import.js.out | 1 + .../_015_duplicate_parallel_import/__test__.jsonc | 4 + .../run/_015_duplicate_parallel_import/mod1.ts | 17 + .../_015_duplicate_parallel_import/print_hello.ts | 3 + .../_015_duplicate_parallel_import/subdir2/mod2.ts | 9 + .../run/_016_double_await/016_double_await.ts | 8 + .../run/_016_double_await/016_double_await.ts.out | 2 + tests/specs/run/_016_double_await/__test__.jsonc | 4 + .../_017_import_redirect/017_import_redirect.ts | 4 + .../017_import_redirect.ts.out | 1 + .../specs/run/_017_import_redirect/__test__.jsonc | 4 + .../017_import_redirect.ts | 4 + .../017_import_redirect.ts.out | 1 + .../run/_017_import_redirect_check/__test__.jsonc | 4 + .../017_import_redirect.ts | 4 + .../017_import_redirect_info.out | 7 + .../run/_017_import_redirect_info/__test__.jsonc | 4 + .../017_import_redirect.ts | 4 + .../017_import_redirect.ts.out | 1 + .../_017_import_redirect_vendor_dir/__test__.jsonc | 4 + .../specs/run/_018_async_catch/018_async_catch.ts | 14 + .../run/_018_async_catch/018_async_catch.ts.out | 3 + tests/specs/run/_018_async_catch/__test__.jsonc | 4 + .../specs/run/_019_media_types/019_media_types.ts | 24 + .../run/_019_media_types/019_media_types.ts.out | 1 + tests/specs/run/_019_media_types/__test__.jsonc | 4 + .../run/_020_json_modules/020_json_modules.ts | 2 + .../run/_020_json_modules/020_json_modules.ts.out | 3 + tests/specs/run/_020_json_modules/__test__.jsonc | 5 + tests/specs/run/_020_json_modules/config.json | 6 + .../specs/run/_021_mjs_modules/021_mjs_modules.ts | 2 + .../run/_021_mjs_modules/021_mjs_modules.ts.out | 1 + tests/specs/run/_021_mjs_modules/__test__.jsonc | 4 + tests/specs/run/_021_mjs_modules/mod5.mjs | 1 + .../025_reload_js_type_error.js | 6 + .../025_reload_js_type_error.js.out | 1 + .../run/_025_reload_js_type_error/__test__.jsonc | 4 + .../027_redirect_typescript.ts | 2 + .../027_redirect_typescript.ts.out | 1 + .../run/_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 + tests/specs/run/_028_args/028_args.ts | 3 + tests/specs/run/_028_args/028_args.ts.out | 6 + tests/specs/run/_028_args/__test__.jsonc | 4 + .../run/_033_import_map_data_uri/__test__.jsonc | 4 + .../run/_033_import_map_data_uri/lodash/lodash.ts | 1 + .../_033_import_map_data_uri/lodash/other_file.ts | 1 + .../run/_033_import_map_data_uri/test_data.ts | 1 + .../run/_033_import_map_data_uri/test_data.ts.out | 1 + .../033_import_map_remote.out | 5 + .../run/_033_import_map_remote/__test__.jsonc | 4 + .../_033_import_map_remote/import_map_remote.json | 10 + .../run/_033_import_map_remote/lodash/lodash.ts | 1 + .../_033_import_map_remote/lodash/other_file.ts | 1 + .../run/_033_import_map_remote/moment/moment.ts | 1 + .../_033_import_map_remote/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 + .../run/_033_import_map_vendor_dir_remote/vue.ts | 1 + .../run/_035_cached_only_flag/019_media_types.ts | 24 + .../_035_cached_only_flag/035_cached_only_flag.out | 1 + .../specs/run/_035_cached_only_flag/__test__.jsonc | 5 + tests/specs/run/_038_checkjs/038_checkjs.js | 5 + tests/specs/run/_038_checkjs/038_checkjs.js.out | 22 + tests/specs/run/_038_checkjs/__test__.jsonc | 6 + tests/specs/run/_038_checkjs/checkjs.tsconfig.json | 5 + .../042_dyn_import_evalcontext.ts | 5 + .../042_dyn_import_evalcontext.ts.out | 1 + .../run/_042_dyn_import_evalcontext/__test__.jsonc | 4 + .../specs/run/_042_dyn_import_evalcontext/mod4.js | 1 + .../run/_044_bad_resource/044_bad_resource.ts | 3 + .../run/_044_bad_resource/044_bad_resource.ts.out | 2 + tests/specs/run/_044_bad_resource/__test__.jsonc | 5 + tests/specs/run/_046_tsx/046_jsx_test.tsx | 14 + tests/specs/run/_046_tsx/046_jsx_test.tsx.out | 1 + tests/specs/run/_046_tsx/__test__.jsonc | 4 + tests/specs/run/_047_jsx/047_jsx_test.jsx | 7 + tests/specs/run/_047_jsx/047_jsx_test.jsx.out | 1 + tests/specs/run/_047_jsx/__test__.jsonc | 4 + .../_048_media_types_jsx/048_media_types_jsx.ts | 32 + .../048_media_types_jsx.ts.out | 2 + .../specs/run/_048_media_types_jsx/__test__.jsonc | 4 + .../run/_052_no_remote_flag/019_media_types.ts | 24 + .../run/_052_no_remote_flag/052_no_remote_flag.out | 1 + tests/specs/run/_052_no_remote_flag/__test__.jsonc | 5 + .../058_tasks_microtasks_close.ts | 19 + .../058_tasks_microtasks_close.ts.out | 6 + .../run/_058_tasks_microtasks_close/__test__.jsonc | 4 + .../059_fs_relative_path_perm.ts | 2 + .../059_fs_relative_path_perm.ts.out | 4 + .../run/_059_fs_relative_path_perm/__test__.jsonc | 5 + .../063_permissions_revoke.ts | 6 + .../063_permissions_revoke.ts.out | 3 + .../run/_063_permissions_revoke/__test__.jsonc | 4 + .../063_permissions_revoke.ts.out | 3 + .../063_permissions_revoke_sync.ts | 6 + .../_063_permissions_revoke_sync/__test__.jsonc | 4 + .../064_permissions_revoke_global.ts | 6 + .../064_permissions_revoke_global.ts.out | 3 + .../_064_permissions_revoke_global/__test__.jsonc | 4 + .../064_permissions_revoke_global.ts.out | 3 + .../064_permissions_revoke_global_sync.ts | 6 + .../__test__.jsonc | 4 + .../065_permissions_revoke_net.ts | 6 + .../065_permissions_revoke_net.ts.out | 3 + .../run/_065_permissions_revoke_net/__test__.jsonc | 4 + tests/specs/run/_070_location/070_location.ts | 18 + tests/specs/run/_070_location/070_location.ts.out | 15 + tests/specs/run/_070_location/__test__.jsonc | 4 + .../run/_071_location_unset/071_location_unset.ts | 16 + .../_071_location_unset/071_location_unset.ts.out | 4 + tests/specs/run/_071_location_unset/__test__.jsonc | 4 + .../072_location_relative_fetch.ts | 2 + .../072_location_relative_fetch.ts.out | 2 + .../_072_location_relative_fetch/__test__.jsonc | 4 + .../_072_location_relative_fetch/fetch/hello.txt | 1 + .../run/_075_import_local_query_hash/001_hello.js | 1 + .../run/_075_import_local_query_hash/002_hello.ts | 1 + .../075_import_local_query_hash.ts | 2 + .../075_import_local_query_hash.ts.out | 2 + .../_075_import_local_query_hash/__test__.jsonc | 4 + .../specs/run/_077_fetch_empty/077_fetch_empty.ts | 1 + .../run/_077_fetch_empty/077_fetch_empty.ts.out | 2 + tests/specs/run/_077_fetch_empty/__test__.jsonc | 5 + .../run/_078_unload_on_exit/078_unload_on_exit.ts | 9 + .../_078_unload_on_exit/078_unload_on_exit.ts.out | 1 + tests/specs/run/_078_unload_on_exit/__test__.jsonc | 5 + .../079_location_authentication.ts | 1 + .../079_location_authentication.ts.out | 1 + .../_079_location_authentication/__test__.jsonc | 4 + .../081_location_relative_fetch_redirect.ts | 2 + .../081_location_relative_fetch_redirect.ts.out | 1 + .../__test__.jsonc | 4 + .../082_prepare_stack_trace_throw.js | 6 + .../082_prepare_stack_trace_throw.js.out | 2 + .../_082_prepare_stack_trace_throw/__test__.jsonc | 5 + .../088_dynamic_import_already_evaluating.ts | 2 + .../088_dynamic_import_already_evaluating.ts.out | 4 + .../088_dynamic_import_target.ts | 3 + .../__test__.jsonc | 4 + .../091_use_define_for_class_fields.ts | 4 + .../091_use_define_for_class_fields.ts.out | 4 + .../__test__.jsonc | 5 + tests/specs/run/aggregate_error/__test__.jsonc | 5 + .../specs/run/aggregate_error/aggregate_error.out | 18 + tests/specs/run/aggregate_error/aggregate_error.ts | 9 + tests/specs/run/async_error/__test__.jsonc | 5 + tests/specs/run/async_error/async_error.ts | 9 + tests/specs/run/async_error/async_error.ts.out | 8 + tests/specs/run/beforeunload_event/__test__.jsonc | 4 + .../specs/run/beforeunload_event/before_unload.js | 21 + .../run/beforeunload_event/before_unload.js.out | 8 + .../specs/run/blob_gc_finalization/__test__.jsonc | 5 + .../blob_gc_finalization/blob_gc_finalization.js | 11 + .../blob_gc_finalization.js.out | 1 + tests/specs/run/byte_order_mark/001_hello.js | 1 + tests/specs/run/byte_order_mark/__test__.jsonc | 4 + .../specs/run/byte_order_mark/byte_order_mark.out | 1 + tests/specs/run/byte_order_mark/byte_order_mark.ts | 4 + .../specs/run/check_js_points_to_ts/__test__.jsonc | 5 + .../check_js_points_to_ts/bar.ts | 3 + .../check_js_points_to_ts/foo.d.ts | 0 .../check_js_points_to_ts/foo.js | 4 + .../check_js_points_to_ts/test.js | 3 + .../check_js_points_to_ts/test.js.out | 4 + .../check_js_points_to_ts/checkjs.tsconfig.json | 5 + tests/specs/run/check_remote/__test__.jsonc | 5 + tests/specs/run/check_remote/no_check_remote.ts | 3 + .../check_remote/no_check_remote.ts.disabled.out | 4 + tests/specs/run/check_remote/type_error.ts | 1 + .../run/classic_workers_event_loop/__test__.jsonc | 4 + .../classic_workers_event_loop.js | 4 + .../classic_workers_event_loop.js.out | 1 + .../run/colors_without_global_this/__test__.jsonc | 4 + .../colors_without_globalThis.js | 1 + tests/specs/run/complex_error/__test__.jsonc | 5 + tests/specs/run/complex_error/complex_error.ts | 18 + tests/specs/run/complex_error/complex_error.ts.out | 44 + tests/specs/run/config/__test__.jsonc | 4 + tests/specs/run/config/config/main.out | 4 + tests/specs/run/config/config/main.ts | 5 + tests/specs/run/config/config/tsconfig.json | 7 + .../__test__.jsonc | 4 + .../frontend_work.ts | 4 + .../__test__.jsonc | 4 + .../auto_discovery_log.out | 4 + .../deno.jsonc | 6 + .../frontend_work.ts | 4 + tests/specs/run/config_json_import/__test__.jsonc | 4 + .../run/config_json_import/config_json_import.ts | 2 + .../config_json_import/config_json_import.ts.out | 3 + tests/specs/run/config_json_import/deno-jsx.json | 6 + .../__test__.jsonc | 4 + .../server_side_work.ts | 2 + tests/specs/run/config_types/__test__.jsonc | 4 + .../specs/run/config_types/config_types/deno.lock | 6 + tests/specs/run/config_types/config_types/main.out | 1 + tests/specs/run/config_types/config_types/main.ts | 1 + .../config_types/config_types/remote.tsconfig.json | 7 + .../run/config_types/config_types/tsconfig.json | 7 + .../specs/run/config_types/config_types/types.d.ts | 2 + tests/specs/run/config_types_remote/__test__.jsonc | 4 + .../run/config_types_remote/config_types/deno.lock | 6 + .../run/config_types_remote/config_types/main.out | 1 + .../run/config_types_remote/config_types/main.ts | 1 + .../config_types/remote.tsconfig.json | 7 + .../config_types_remote/config_types/tsconfig.json | 7 + .../config_types_remote/config_types/types.d.ts | 2 + tests/specs/run/custom_inspect_url/__test__.jsonc | 4 + .../run/custom_inspect_url/custom_inspect_url.js | 3 + .../custom_inspect_url/custom_inspect_url.js.out | 47 + .../run/decorators_tc39_proposal/__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/deno_exit_tampering/__test__.jsonc | 5 + .../run/deno_exit_tampering/deno_exit_tampering.ts | 3 + .../run/deny_all_permission_args/__test__.jsonc | 4 + .../deny_all_permission_args.js | 7 + .../deny_all_permission_args.out | 7 + .../run/deny_some_permission_args/__test__.jsonc | 4 + .../deny_some_permission_args.js | 21 + .../deny_some_permission_args.out | 21 + .../run/dom_exception_formatting/__test__.jsonc | 5 + .../dom_exception_formatting.ts | 1 + .../dom_exception_formatting.ts.out | 3 + .../dynamic_import_already_rejected/__test__.jsonc | 4 + .../dynamic_import_already_rejected/error_001.ts | 9 + .../dynamic_import_already_rejected/main.out | 4 + .../dynamic_import_already_rejected/main.ts | 15 + .../run/dynamic_import_async_error/__test__.jsonc | 4 + .../dynamic_import_async_error/delayed_error.ts | 2 + .../dynamic_import_async_error/main.out | 2 + .../dynamic_import_async_error/main.ts | 7 + .../__test__.jsonc | 4 + .../main.out | 100 + .../main.ts | 16 + .../mod.ts | 7 + .../run/dynamic_import_conditional/__test__.jsonc | 4 + .../dynamic_import_conditional.js | 3 + .../dynamic_import_conditional.js.out | 1 + .../__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 + .../run/dynamic_import_syntax_error/__test__.jsonc | 5 + .../dynamic_import_syntax_error.js | 1 + .../dynamic_import_syntax_error.js.out | 4 + .../dynamic_import_syntax_error_import.js | 5 + tests/specs/run/empty_typescript/__test__.jsonc | 4 + tests/specs/run/empty_typescript/empty.ts | 0 tests/specs/run/error_001/__test__.jsonc | 5 + tests/specs/run/error_001/error_001.ts | 9 + tests/specs/run/error_001/error_001.ts.out | 6 + tests/specs/run/error_002/__test__.jsonc | 5 + tests/specs/run/error_002/error_002.ts | 7 + tests/specs/run/error_002/error_002.ts.out | 6 + 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 + .../specs/run/error_003_typescript/__test__.jsonc | 5 + .../error_003_typescript/error_003_typescript.ts | 20 + .../error_003_typescript.ts.out | 7 + .../specs/run/error_003_typescript2/__test__.jsonc | 5 + .../error_003_typescript2/error_003_typescript.ts | 20 + .../error_003_typescript.ts.out | 7 + .../run/error_004_missing_module/__test__.jsonc | 5 + .../error_004_missing_module.ts | 3 + .../error_004_missing_module.ts.out | 2 + .../__test__.jsonc | 5 + .../error_005_missing_dynamic_import.ts | 3 + .../error_005_missing_dynamic_import.ts.out | 4 + .../error_006_import_ext_failure/__test__.jsonc | 5 + .../error_006_import_ext_failure.ts | 1 + .../error_006_import_ext_failure.ts.out | 2 + tests/specs/run/error_007_any/__test__.jsonc | 5 + tests/specs/run/error_007_any/error_007_any.ts | 1 + tests/specs/run/error_007_any/error_007_any.ts.out | 1 + tests/specs/run/error_008_checkjs/__test__.jsonc | 5 + .../run/error_008_checkjs/error_008_checkjs.js | 5 + .../run/error_008_checkjs/error_008_checkjs.js.out | 4 + .../run/error_009_extensions_error/__test__.jsonc | 5 + .../error_009_extensions_error.js | 2 + .../error_009_extensions_error.js.out | 6 + .../error_011_bad_module_specifier/__test__.jsonc | 5 + .../error_011_bad_module_specifier.ts | 3 + .../error_011_bad_module_specifier.ts.out | 2 + .../__test__.jsonc | 5 + .../error_012_bad_dynamic_import_specifier.ts | 3 + .../error_012_bad_dynamic_import_specifier.ts.out | 7 + .../__test__.jsonc | 4 + .../error_014_catch_dynamic_import_error.js | 31 + .../error_014_catch_dynamic_import_error.js.out | 19 + .../indirect_import_error.js | 1 + .../indirect_throws.js | 1 + .../error_014_catch_dynamic_import_error/throws.js | 6 + .../__test__.jsonc | 5 + .../error_015_dynamic_import_permissions.js | 3 + .../error_015_dynamic_import_permissions.out | 4 + .../error_015_dynamic_import_permissions/mod4.js | 1 + .../error_017_hide_long_source_ts/__test__.jsonc | 5 + .../error_017_hide_long_source_ts.ts | 3 + .../error_017_hide_long_source_ts.ts.out | 3 + .../error_018_hide_long_source_js/__test__.jsonc | 5 + .../error_018_hide_long_source_js.js | 3 + .../error_018_hide_long_source_js.js.out | 2 + .../run/error_019_stack_function/__test__.jsonc | 5 + .../error_019_stack_function.ts | 12 + .../error_019_stack_function.ts.out | 8 + .../run/error_020_stack_constructor/__test__.jsonc | 5 + .../error_020_stack_constructor.ts | 14 + .../error_020_stack_constructor.ts.out | 8 + .../run/error_021_stack_method/__test__.jsonc | 5 + .../error_021_stack_method.ts | 14 + .../error_021_stack_method.ts.out | 8 + .../error_022_stack_custom_error/__test__.jsonc | 5 + .../error_022_stack_custom_error.ts | 14 + .../error_022_stack_custom_error.ts.out | 6 + .../specs/run/error_023_stack_async/__test__.jsonc | 5 + .../error_023_stack_async/error_023_stack_async.ts | 14 + .../error_023_stack_async.ts.out | 10 + .../run/error_024_stack_promise_all/__test__.jsonc | 5 + .../error_024_stack_promise_all.ts | 16 + .../error_024_stack_promise_all.ts.out | 10 + .../specs/run/error_025_tab_indent/__test__.jsonc | 5 + .../run/error_025_tab_indent/error_025_tab_indent | 9 + .../error_025_tab_indent/error_025_tab_indent.out | 6 + tests/specs/run/error_cause/__test__.jsonc | 5 + tests/specs/run/error_cause/error_cause.ts | 14 + tests/specs/run/error_cause/error_cause.ts.out | 13 + .../specs/run/error_cause_recursive/__test__.jsonc | 5 + .../error_cause_recursive/error_cause_recursive.ts | 4 + .../error_cause_recursive.ts.out | 7 + .../error_cause_recursive_aggregate/__test__.jsonc | 5 + .../error_cause_recursive_aggregate.ts | 9 + .../error_cause_recursive_aggregate.ts.out | 14 + .../run/error_cause_recursive_tail/__test__.jsonc | 5 + .../error_cause_recursive_tail.ts | 5 + .../error_cause_recursive_tail.ts.out | 9 + tests/specs/run/error_for_await/__test__.jsonc | 5 + tests/specs/run/error_for_await/error_for_await.ts | 12 + .../run/error_for_await/error_for_await.ts.out | 10 + .../error_import_map_unable_to_load/__test__.jsonc | 5 + .../error_import_map_unable_to_load.out | 4 + .../import_maps/test_data.ts | 1 + .../import_maps/test_data.ts.out | 1 + .../__test__.jsonc | 5 + .../error_missing_module_named_import.ts | 3 + .../error_missing_module_named_import.ts.out | 2 + .../specs/run/error_name_non_string/__test__.jsonc | 5 + .../error_name_non_string/error_name_non_string.js | 8 + .../error_name_non_string.js.out | 4 + tests/specs/run/error_no_check/__test__.jsonc | 5 + tests/specs/run/error_no_check/error_no_check.ts | 1 + .../specs/run/error_no_check/error_no_check.ts.out | 2 + tests/specs/run/error_no_check/type_and_code.ts | 7 + tests/specs/run/error_syntax/__test__.jsonc | 5 + tests/specs/run/error_syntax/error_syntax.js | 3 + tests/specs/run/error_syntax/error_syntax.js.out | 4 + .../__test__.jsonc | 5 + .../error_syntax_empty_trailing_line.mjs | 2 + .../error_syntax_empty_trailing_line.mjs.out | 6 + .../run/error_type_definitions/__test__.jsonc | 5 + .../error_type_definitions.ts | 5 + .../error_type_definitions.ts.out | 3 + .../type_definitions/bar.d.ts | 7 + .../error_type_definitions/type_definitions/bar.js | 5 + .../type_definitions/fizz.d.ts | 2 + .../type_definitions/fizz.js | 1 + .../type_definitions/foo.d.ts | 2 + .../error_type_definitions/type_definitions/foo.js | 1 + .../error_type_definitions/type_definitions/qat.ts | 1 + .../run/error_with_errors_prop/__test__.jsonc | 5 + .../error_with_errors_prop.js | 10 + .../error_with_errors_prop.js.out | 17 + tests/specs/run/es_private_fields/__test__.jsonc | 4 + .../run/es_private_fields/es_private_fields.js | 15 + .../run/es_private_fields/es_private_fields.js.out | 1 + .../__test__.jsonc | 4 + .../eval_context_throw_dom_exception.js | 5 + .../eval_context_throw_dom_exception.js.out | 8 + .../specs/run/event_listener_error/__test__.jsonc | 5 + .../event_listener_error/event_listener_error.ts | 6 + .../event_listener_error.ts.out | 7 + .../event_listener_error_handled/__test__.jsonc | 4 + .../event_listener_error_handled.ts | 23 + .../event_listener_error_handled.ts.out | 17 + .../__test__.jsonc | 5 + .../event_listener_error_immediate_exit.ts | 12 + .../event_listener_error_immediate_exit.ts.out | 6 + .../__test__.jsonc | 5 + .../event_listener_error_immediate_exit.ts | 12 + .../event_listener_error_immediate_exit_worker.ts | 4 + ...ent_listener_error_immediate_exit_worker.ts.out | 8 + tests/specs/run/exit_error42/__test__.jsonc | 5 + tests/specs/run/exit_error42/exit_error42.ts | 3 + tests/specs/run/exit_error42/exit_error42.ts.out | 1 + .../explicit_resource_management/__test__.jsonc | 4 + .../explicit_resource_management/main.out | 5 + .../explicit_resource_management/main.ts | 21 + .../__test__.jsonc | 5 + .../ts_with_js_extension.js | 5 + .../ts_with_js_extension.out | 2 + .../run/fetch_async_error_stack/__test__.jsonc | 5 + .../fetch_async_error_stack.ts | 1 + .../fetch_async_error_stack.ts.out | 5 + .../run/fetch_response_finalization/__test__.jsonc | 5 + .../fetch_response_finalization.js | 16 + .../fetch_response_finalization.js.out | 2 + .../specs/run/finalization_registry/__test__.jsonc | 4 + .../finalization_registry/finalization_registry.js | 20 + .../finalization_registry.js.out | 1 + .../run/fix_dynamic_import_errors/__test__.jsonc | 4 + tests/specs/run/fix_dynamic_import_errors/b.js | 2 + tests/specs/run/fix_dynamic_import_errors/c.js | 2 + .../fix_dynamic_import_errors.js | 7 + .../fix_dynamic_import_errors.js.out | 2 + .../specs/run/fix_emittable_skipped/__test__.jsonc | 4 + .../specs/run/fix_emittable_skipped/emittable.d.ts | 1 + .../fix_emittable_skipped/fix_emittable_skipped.js | 7 + .../fix_emittable_skipped.ts.out | 1 + tests/specs/run/fix_emittable_skipped/polyfill.ts | 8 + tests/specs/run/fix_js_import_js/__test__.jsonc | 4 + .../specs/run/fix_js_import_js/fix_js_import_js.ts | 3 + .../run/fix_js_import_js/fix_js_import_js.ts.out | 1 + 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 + tests/specs/run/fix_js_imports/fix_js_imports.ts | 3 + .../specs/run/fix_js_imports/fix_js_imports.ts.out | 1 + tests/specs/run/fix_tsc_file_exists/__test__.jsonc | 4 + .../fix_tsc_file_exists/fix_tsc_file_exists.out | 1 + tests/specs/run/fix_tsc_file_exists/tsc/a.js | 2 + tests/specs/run/fix_tsc_file_exists/tsc/d.ts | 3 + .../run/fix_tsc_file_exists/tsc/node_modules/b.js | 2 + .../run/fix_tsc_file_exists/tsc/node_modules/c.js | 1 + tests/specs/run/fix_tsc_file_exists/tsc/test.js | 4 + .../run/fix_worker_dispatchevent/__test__.jsonc | 4 + .../fix_worker_dispatchevent.ts | 43 + .../fix_worker_dispatchevent.ts.out | 1 + .../followup_dyn_import_resolved/__test__.jsonc | 4 + .../followup_dyn_import_resolves/main.ts | 14 + .../followup_dyn_import_resolves/main.ts.out | 3 + .../followup_dyn_import_resolves/sub1.ts | 2 + .../followup_dyn_import_resolves/sub2.ts | 1 + tests/specs/run/heapstats/__test__.jsonc | 4 + tests/specs/run/heapstats/heapstats.js | 37 + tests/specs/run/heapstats/heapstats.js.out | 2 + 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 + tests/specs/run/https_import/https_import.ts.out | 1 + tests/specs/run/https_import/print_hello.ts | 3 + tests/specs/run/if_main/__test__.jsonc | 4 + tests/specs/run/if_main/if_main.ts | 6 + tests/specs/run/if_main/if_main.ts.out | 1 + .../import_attributes_dynamic_error/__test__.jsonc | 5 + .../run/import_attributes_dynamic_error/data.json | 6 + .../dynamic_error.out | 4 + .../dynamic_error.ts | 3 + .../__test__.jsonc | 4 + .../run/import_attributes_dynamic_import/data.json | 6 + .../dynamic_import.out | 2 + .../dynamic_import.ts | 3 + .../import_attributes_static_error/__test__.jsonc | 5 + .../run/import_attributes_static_error/data.json | 6 + .../static_error.out | 3 + .../import_attributes_static_error/static_error.ts | 3 + .../import_attributes_static_export/__test__.jsonc | 4 + .../run/import_attributes_static_export/data.json | 6 + .../static_export.out | 1 + .../static_export.ts | 3 + .../static_reexport.ts | 1 + .../import_attributes_static_import/__test__.jsonc | 4 + .../run/import_attributes_static_import/data.json | 6 + .../static_import.out | 2 + .../static_import.ts | 5 + .../import_attributes_type_check/__test__.jsonc | 5 + .../run/import_attributes_type_check/data.json | 6 + .../import_attributes_type_check/type_check.out | 12 + .../run/import_attributes_type_check/type_check.ts | 6 + tests/specs/run/import_blob_url/__test__.jsonc | 4 + tests/specs/run/import_blob_url/import_blob_url.ts | 13 + .../run/import_blob_url/import_blob_url.ts.out | 3 + .../run/import_blob_url_error_stack/__test__.jsonc | 5 + .../import_blob_url_error_stack.ts | 13 + .../import_blob_url_error_stack.ts.out | 5 + .../import_blob_url_import_relative/__test__.jsonc | 5 + .../import_blob_url_import_relative.ts | 8 + .../import_blob_url_import_relative.ts.out | 5 + .../run/import_blob_url_imports/__test__.jsonc | 4 + .../import_blob_url_imports.ts | 11 + .../import_blob_url_imports.ts.out | 1 + tests/specs/run/import_blob_url_jsx/__test__.jsonc | 4 + .../run/import_blob_url_jsx/import_blob_url_jsx.ts | 16 + .../import_blob_url_jsx/import_blob_url_jsx.ts.out | 1 + tests/specs/run/import_compression/__test__.jsonc | 4 + .../import_compression/import_compression/brotli | 2 + .../import_compression/import_compression/gziped | Bin 0 -> 39 bytes .../import_compression/import_compression/main.out | 4 + .../import_compression/import_compression/main.ts | 13 + tests/specs/run/import_data_url/__test__.jsonc | 4 + tests/specs/run/import_data_url/import_data_url.ts | 12 + .../run/import_data_url/import_data_url.ts.out | 3 + .../run/import_data_url_error_stack/__test__.jsonc | 5 + .../import_data_url_error_stack.ts | 3 + .../import_data_url_error_stack.ts.out | 5 + .../import_data_url_import_relative/__test__.jsonc | 5 + .../import_data_url_import_relative.ts | 4 + .../import_data_url_import_relative.ts.out | 2 + .../run/import_data_url_imports/__test__.jsonc | 4 + .../import_data_url_imports.ts | 4 + .../import_data_url_imports.ts.out | 1 + tests/specs/run/import_data_url_jsx/__test__.jsonc | 4 + .../run/import_data_url_jsx/import_data_url_jsx.ts | 10 + .../import_data_url_jsx/import_data_url_jsx.ts.out | 1 + .../run/import_dynamic_data_url/__test__.jsonc | 4 + .../import_dynamic_data_url.ts | 14 + .../import_dynamic_data_url.ts.out | 3 + .../specs/run/import_extensionless/__test__.jsonc | 4 + .../import_extensionless/import_extensionless.ts | 3 + .../import_extensionless.ts.out | 1 + .../run/import_file_with_colon/__test__.jsonc | 4 + .../import_file_with_colon.ts | 1 + .../import_file_with_colon.ts.out | 1 + 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 + tests/specs/run/import_type/import_type.ts.out | 1 + .../specs/run/import_type_no_check/__test__.jsonc | 4 + .../specs/run/import_type_no_check/export_types.ts | 11 + .../specs/run/import_type_no_check/import_type.ts | 5 + .../run/import_type_no_check/import_type.ts.out | 1 + .../run/inline_js_source_map_2/__test__.jsonc | 5 + .../inline_js_source_map_2.js | 4 + .../inline_js_source_map_2.js.out | 2 + .../__test__.jsonc | 5 + .../inline_js_source_map_2_with_inline_contents.js | 4 + ...ine_js_source_map_2_with_inline_contents.js.out | 2 + .../__test__.jsonc | 5 + ...nline_js_source_map_with_contents_from_graph.js | 4 + ...e_js_source_map_with_contents_from_graph.js.out | 4 + 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 + tests/specs/run/js_import_detect/__test__.jsonc | 5 + .../specs/run/js_import_detect/js_import_detect.ts | 3 + .../run/js_import_detect/js_import_detect.ts.out | 1 + .../specs/run/js_root_with_ts_check/__test__.jsonc | 5 + .../js_root_with_ts_check/js_root_with_ts_check.js | 5 + .../js_root_with_ts_check.js.out | 4 + .../specs/run/js_without_extension/__test__.jsonc | 5 + .../run/js_without_extension/js_without_extension | 3 + .../js_without_extension/js_without_extension.out | 1 + tests/specs/run/jsx_import_from_ts/__test__.jsonc | 4 + .../jsx_import_from_ts/jsx_import_from_ts.App.jsx | 11 + .../run/jsx_import_from_ts/jsx_import_from_ts.ts | 3 + .../jsx_import_from_ts/jsx_import_from_ts.ts.out | 1 + .../run/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 + .../run/jsx_import_source_error/jsx/deno-jsx.json | 6 + .../run/jsx_import_source_error/jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx_import_source_error/jsx/deno-jsxdev.jsonc | 6 + .../run/jsx_import_source_error/jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx_import_source_error/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 | 2 + .../jsx_import_source_no_pragma.tsx | 7 + .../jsx_import_source_import_map/__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_import_source_import_map/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_import_map/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_import_map_dev/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 + .../run/jsx_import_source_no_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_import_source_no_pragma/jsx/deno-jsx.json | 6 + .../jsx_import_source_no_pragma/jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx/deno-jsxdev.jsonc | 6 + .../run/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 | 2 + .../jsx_import_source_no_pragma.tsx | 7 + .../jsx_import_source_no_pragma_dev/__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_dev/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_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 + .../run/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 + .../run/jsx_import_source_pragma/jsx/deno-jsx.json | 6 + .../jsx_import_source_pragma/jsx/deno-jsx.jsonc | 6 + .../jsx/deno-jsxdev-import-map.jsonc | 6 + .../jsx_import_source_pragma/jsx/deno-jsxdev.jsonc | 6 + .../run/jsx_import_source_pragma/jsx/deno.lock | 6 + .../jsx/import-map-scoped.json | 8 + .../jsx_import_source_pragma/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_pragma/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_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_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 + .../http_localhost_4545/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 | 3 + .../jsx_precompile/no_pragma.tsx | 3 + .../jsx_precompile/skip.out | 3 + .../jsx_precompile/skip.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 | 3 + .../jsx_precompile/no_pragma.tsx | 3 + .../jsx_precompile/skip.out | 3 + .../jsx_precompile/skip.tsx | 9 + .../specs/run/lock_check_ok/003_relative_import.ts | 3 + .../run/lock_check_ok/003_relative_import.ts.out | 1 + tests/specs/run/lock_check_ok/__test__.jsonc | 4 + tests/specs/run/lock_check_ok/lock_check_ok.json | 4 + tests/specs/run/lock_check_ok/print_hello.ts | 3 + tests/specs/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 + tests/specs/run/lock_check_ok2/lock_check_ok2.json | 13 + .../run/lock_v2_check_ok/003_relative_import.ts | 3 + .../lock_v2_check_ok/003_relative_import.ts.out | 1 + tests/specs/run/lock_v2_check_ok/__test__.jsonc | 4 + .../run/lock_v2_check_ok/lock_v2_check_ok.json | 7 + tests/specs/run/lock_v2_check_ok/print_hello.ts | 3 + .../specs/run/lock_v2_check_ok2/019_media_types.ts | 24 + .../run/lock_v2_check_ok2/019_media_types.ts.out | 1 + tests/specs/run/lock_v2_check_ok2/__test__.jsonc | 4 + .../run/lock_v2_check_ok2/lock_v2_check_ok2.json | 13 + .../run/long_data_url_formatting/__test__.jsonc | 5 + .../long_data_url_formatting.ts | 3 + .../long_data_url_formatting.ts.out | 8 + tests/specs/run/main_module/__test__.jsonc | 4 + tests/specs/run/main_module/main_module/main.out | 2 + tests/specs/run/main_module/main_module/main.ts | 3 + tests/specs/run/main_module/main_module/other.ts | 1 + 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 + tests/specs/run/mts_dmts_mjs/mts_dmts_mjs.out | 1 + tests/specs/run/mts_dmts_mjs/types.d.mts | 1 + .../specs/run/mts_dmts_mjs_no_check/__test__.jsonc | 4 + tests/specs/run/mts_dmts_mjs_no_check/import.mts | 4 + tests/specs/run/mts_dmts_mjs_no_check/mod.mjs | 1 + .../run/mts_dmts_mjs_no_check/mts_dmts_mjs.out | 1 + tests/specs/run/mts_dmts_mjs_no_check/types.d.mts | 1 + tests/specs/run/nested_error/__test__.jsonc | 5 + tests/specs/run/nested_error/nested_error/main.ts | 3 + .../run/nested_error/nested_error/main.ts.out | 4 + tests/specs/run/no_check/006_url_imports.ts | 3 + tests/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 + tests/specs/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 | 4 + tests/specs/run/no_lock_flag/__test__.jsonc | 5 + .../specs/run/no_lock_flag/no_lock_flag/deno.json | 3 + .../specs/run/no_lock_flag/no_lock_flag/deno.lock | 7 + tests/specs/run/no_lock_flag/no_lock_flag/main.out | 2 + tests/specs/run/no_lock_flag/no_lock_flag/main.ts | 1 + 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 | 2 + .../node_env_var_allowlist.ts.out | 5 + tests/specs/run/onload/__test__.jsonc | 4 + tests/specs/run/onload/deno.json | 4 + tests/specs/run/onload/onload/imported.ts | 12 + tests/specs/run/onload/onload/main.out | 15 + tests/specs/run/onload/onload/main.ts | 34 + tests/specs/run/onload/onload/nest_imported.ts | 11 + .../__test__.jsonc | 5 + .../op_exit_op_set_exit_code_in_worker.ts | 13 + .../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 + tests/specs/run/permission_args/__test__.jsonc | 4 + .../specs/run/permission_args/permission_args.out | 4 + tests/specs/run/permission_args_quiet/001_hello.js | 1 + .../run/permission_args_quiet/001_hello.js.out | 1 + .../specs/run/permission_args_quiet/__test__.jsonc | 4 + .../run/private_field_presence/__test__.jsonc | 4 + .../private_field_presence.ts | 20 + .../private_field_presence.ts.out | 2 + .../private_field_presence_no_check/__test__.jsonc | 4 + .../private_field_presence.ts | 20 + .../private_field_presence.ts.out | 2 + tests/specs/run/proto_exploit/__test__.jsonc | 4 + tests/specs/run/proto_exploit/proto_exploit.js | 5 + tests/specs/run/proto_exploit/proto_exploit.js.out | 2 + .../specs/run/queue_microtask_error/__test__.jsonc | 5 + .../queue_microtask_error/queue_microtask_error.ts | 5 + .../queue_microtask_error.ts.out | 6 + .../queue_microtask_error_handled/__test__.jsonc | 4 + .../queue_microtask_error_handled.ts | 21 + .../queue_microtask_error_handled.ts.out | 15 + tests/specs/run/reference_types/__test__.jsonc | 4 + tests/specs/run/reference_types/reference_types.ts | 3 + .../run/reference_types/reference_types.ts.out | 1 + .../specs/run/reference_types_error/__test__.jsonc | 5 + .../reference_types_error/checkjs.tsconfig.json | 5 + .../reference_types_error/reference_types_error.js | 2 + .../reference_types_error.js.out | 2 + .../reference_types_error_no_check/__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 + .../run/references_types_remote/__test__.jsonc | 4 + .../reference_types_remote.ts | 3 + .../reference_types_remote.ts.out | 1 + tests/specs/run/rejection_handled/__test__.jsonc | 4 + .../run/rejection_handled/rejection_handled.out | 5 + .../run/rejection_handled/rejection_handled.ts | 17 + tests/specs/run/replace_self/__test__.jsonc | 4 + tests/specs/run/replace_self/replace_self.js | 21 + tests/specs/run/replace_self/replace_self.js.out | 4 + tests/specs/run/report_error/__test__.jsonc | 5 + tests/specs/run/report_error/report_error.ts | 3 + tests/specs/run/report_error/report_error.ts.out | 5 + .../run/report_error_end_of_program/__test__.jsonc | 5 + .../report_error_end_of_program.ts | 1 + .../report_error_end_of_program.ts.out | 4 + .../specs/run/report_error_handled/__test__.jsonc | 4 + .../report_error_handled/report_error_handled.ts | 19 + .../report_error_handled.ts.out | 13 + tests/specs/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 + tests/specs/run/seed_random/seed_random.js | 11 + tests/specs/run/seed_random/seed_random.js.out | 22 + tests/specs/run/set_exit_code_0/__test__.jsonc | 5 + tests/specs/run/set_exit_code_0/set_exit_code_0.ts | 2 + tests/specs/run/set_exit_code_1/__test__.jsonc | 5 + tests/specs/run/set_exit_code_1/set_exit_code_1.ts | 2 + tests/specs/run/set_exit_code_2/__test__.jsonc | 5 + tests/specs/run/set_exit_code_2/set_exit_code_2.ts | 2 + tests/specs/run/set_timeout_error/__test__.jsonc | 5 + .../run/set_timeout_error/set_timeout_error.ts | 3 + .../run/set_timeout_error/set_timeout_error.ts.out | 5 + .../run/set_timeout_error_handled/__test__.jsonc | 4 + .../set_timeout_error_handled.ts | 19 + .../set_timeout_error_handled.ts.out | 13 + tests/specs/run/shebang_swc/__test__.jsonc | 4 + tests/specs/run/shebang_swc/shebang.ts | 5 + tests/specs/run/shebang_swc/shebang.ts.out | 1 + tests/specs/run/shebang_swc/shebang2.ts | 3 + tests/specs/run/shebang_tsc/__test__.jsonc | 4 + tests/specs/run/shebang_tsc/shebang.ts | 5 + tests/specs/run/shebang_tsc/shebang.ts.out | 1 + tests/specs/run/shebang_tsc/shebang2.ts | 3 + .../shebang_with_json_imports_swc/__test__.jsonc | 5 + .../json_with_shebang.json | 4 + .../json_with_shebang.ts | 3 + .../json_with_shebang.ts.out | 1 + .../shebang_with_json_imports_tsc/__test__.jsonc | 5 + .../json_with_shebang.json | 4 + .../json_with_shebang.ts | 3 + .../json_with_shebang.ts.out | 1 + .../run/single_compile_with_reload/__test__.jsonc | 4 + tests/specs/run/single_compile_with_reload/mod1.ts | 17 + .../run/single_compile_with_reload/print_hello.ts | 3 + .../single_compile_with_reload.ts | 18 + .../single_compile_with_reload.ts.out | 7 + .../single_compile_with_reload_dyn.ts | 11 + .../single_compile_with_reload_worker.ts | 3 + .../subdir2/dynamic_import.ts | 4 + .../run/single_compile_with_reload/subdir2/mod2.ts | 9 + .../specs/run/spawn_stdout_inherit/__test__.jsonc | 4 + .../spawn_stdout_inherit/spawn_stdout_inherit.ts | 8 + .../spawn_stdout_inherit.ts.out | 2 + tests/specs/run/stdin_read_all/__test__.jsonc | 5 + tests/specs/run/stdin_read_all/stdin_read_all.out | 1 + tests/specs/run/stdin_read_all/stdin_read_all.ts | 17 + tests/specs/run/stdout_write_all/__test__.jsonc | 4 + .../run/stdout_write_all/stdout_write_all.out | 100 + .../specs/run/stdout_write_all/stdout_write_all.ts | 13 + .../run/stdout_write_sync_async/__test__.jsonc | 4 + .../stdout_write_sync_async.out | 200 ++ .../stdout_write_sync_async.ts | 14 + tests/specs/run/swc_syntax_error/__test__.jsonc | 5 + .../specs/run/swc_syntax_error/swc_syntax_error.ts | 4 + .../run/swc_syntax_error/swc_syntax_error.ts.out | 4 + .../test_and_bench_are_noops_in_run/__test__.jsonc | 4 + .../test_and_bench_in_run.js | 5 + 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 ++ tests/specs/run/tls_connecttls/tls.out | 1 + tests/specs/run/tls_connecttls/tls_connecttls.js | 65 + 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 + tests/specs/run/tls_starttls/tls_starttls.js | 64 + tests/specs/run/top_level_await/__test__.jsonc | 4 + tests/specs/run/top_level_await/hello.txt | 1 + .../top_level_await/top_level_await/circular.js | 8 + .../top_level_await/top_level_await/circular.out | 10 + .../run/top_level_await/top_level_await/loop.js | 20 + .../run/top_level_await/top_level_await/loop.out | 5 + .../run/top_level_await/top_level_await/nested.out | 5 + .../top_level_await/top_level_await/nested/a.js | 3 + .../top_level_await/top_level_await/nested/b.js | 1 + .../top_level_await/top_level_await/nested/main.js | 3 + .../run/top_level_await/top_level_await/order.js | 21 + .../run/top_level_await/top_level_await/order.out | 2 + .../run/top_level_await/top_level_await/tla/a.js | 3 + .../run/top_level_await/top_level_await/tla/b.js | 7 + .../run/top_level_await/top_level_await/tla/c.js | 3 + .../run/top_level_await/top_level_await/tla/d.js | 8 + .../top_level_await/top_level_await/tla/order.js | 1 + .../top_level_await/top_level_await/tla/parent.js | 9 + .../run/top_level_await/top_level_await/tla2/a.js | 5 + .../run/top_level_await/top_level_await/tla2/b.js | 5 + .../run/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 | 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/top_level_await/unresolved.js | 1 + .../top_level_await/top_level_await/unresolved.out | 4 + .../run/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 | 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 + .../specs/run/top_level_await_loop/__test__.jsonc | 4 + .../top_level_await/circular.js | 8 + .../top_level_await/circular.out | 10 + .../top_level_await_loop/top_level_await/loop.js | 20 + .../top_level_await_loop/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_loop/top_level_await/order.js | 21 + .../top_level_await_loop/top_level_await/order.out | 2 + .../top_level_await_loop/top_level_await/tla/a.js | 3 + .../top_level_await_loop/top_level_await/tla/b.js | 7 + .../top_level_await_loop/top_level_await/tla/c.js | 3 + .../top_level_await_loop/top_level_await/tla/d.js | 8 + .../top_level_await/tla/order.js | 1 + .../top_level_await/tla/parent.js | 9 + .../top_level_await_loop/top_level_await/tla2/a.js | 5 + .../top_level_await_loop/top_level_await/tla2/b.js | 5 + .../top_level_await_loop/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_nested/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 + .../specs/run/top_level_await_order/__test__.jsonc | 4 + .../top_level_await/circular.js | 8 + .../top_level_await/circular.out | 10 + .../top_level_await_order/top_level_await/loop.js | 20 + .../top_level_await_order/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/top_level_await/order.js | 21 + .../top_level_await/order.out | 2 + .../top_level_await_order/top_level_await/tla/a.js | 3 + .../top_level_await_order/top_level_await/tla/b.js | 7 + .../top_level_await_order/top_level_await/tla/c.js | 3 + .../top_level_await_order/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/top_level_await_ts/__test__.jsonc | 4 + tests/specs/run/top_level_await_ts/hello.txt | 1 + .../top_level_await_ts/top_level_await/circular.js | 8 + .../top_level_await/circular.out | 10 + .../run/top_level_await_ts/top_level_await/loop.js | 20 + .../top_level_await_ts/top_level_await/loop.out | 5 + .../top_level_await_ts/top_level_await/nested.out | 5 + .../top_level_await_ts/top_level_await/nested/a.js | 3 + .../top_level_await_ts/top_level_await/nested/b.js | 1 + .../top_level_await/nested/main.js | 3 + .../top_level_await_ts/top_level_await/order.js | 21 + .../top_level_await_ts/top_level_await/order.out | 2 + .../top_level_await_ts/top_level_await/tla/a.js | 3 + .../top_level_await_ts/top_level_await/tla/b.js | 7 + .../top_level_await_ts/top_level_await/tla/c.js | 3 + .../top_level_await_ts/top_level_await/tla/d.js | 8 + .../top_level_await/tla/order.js | 1 + .../top_level_await/tla/parent.js | 9 + .../top_level_await_ts/top_level_await/tla2/a.js | 5 + .../top_level_await_ts/top_level_await/tla2/b.js | 5 + .../top_level_await_ts/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_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 + tests/specs/run/top_level_for_await/__test__.jsonc | 4 + .../top_level_await/circular.js | 8 + .../top_level_await/circular.out | 10 + .../top_level_for_await/top_level_await/loop.js | 20 + .../top_level_for_await/top_level_await/loop.out | 5 + .../top_level_for_await/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_for_await/top_level_await/order.js | 21 + .../top_level_for_await/top_level_await/order.out | 2 + .../top_level_for_await/top_level_await/tla/a.js | 3 + .../top_level_for_await/top_level_await/tla/b.js | 7 + .../top_level_for_await/top_level_await/tla/c.js | 3 + .../top_level_for_await/top_level_await/tla/d.js | 8 + .../top_level_await/tla/order.js | 1 + .../top_level_await/tla/parent.js | 9 + .../top_level_for_await/top_level_await/tla2/a.js | 5 + .../top_level_for_await/top_level_await/tla2/b.js | 5 + .../top_level_for_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 | 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_for_await_ts/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 + .../ts_decorators/decorators/tc39_proposal/main.ts | 21 + .../run/ts_import_from_js/005_more_imports.ts | 11 + tests/specs/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 + tests/specs/run/ts_import_from_js/print_hello.ts | 3 + .../ts_import_from_js/subdir2/dynamic_import.ts | 4 + tests/specs/run/ts_import_from_js/subdir2/mod2.ts | 9 + .../ts_import_from_js/ts_import_from_js/deps.js | 2 + .../ts_import_from_js/ts_import_from_js/main.js | 3 + .../ts_import_from_js/ts_import_from_js/main.out | 3 + tests/specs/run/ts_type_imports/__test__.jsonc | 5 + tests/specs/run/ts_type_imports/ts_type_imports.ts | 5 + .../run/ts_type_imports/ts_type_imports.ts.out | 6 + .../run/ts_type_imports/ts_type_imports_foo.ts | 1 + tests/specs/run/ts_type_only_import/__test__.jsonc | 4 + .../ts_type_only_import/ts_type_only_import.d.ts | 3 + .../run/ts_type_only_import/ts_type_only_import.ts | 1 + .../ts_type_only_import/ts_type_only_import.ts.out | 1 + .../specs/run/ts_without_extension/__test__.jsonc | 5 + .../run/ts_without_extension/ts_without_extension | 3 + .../ts_without_extension/ts_without_extension.out | 2 + tests/specs/run/tsx_imports/046_jsx_test.tsx | 14 + tests/specs/run/tsx_imports/__test__.jsonc | 4 + .../run/tsx_imports/tsx_imports/Component.tsx | 1 + .../run/tsx_imports/tsx_imports/tsx_imports.ts | 1 + .../run/tsx_imports/tsx_imports/tsx_imports.ts.out | 2 + tests/specs/run/type_definitions/__test__.jsonc | 4 + .../specs/run/type_definitions/type_definitions.ts | 12 + .../run/type_definitions/type_definitions.ts.out | 3 + .../run/type_definitions/type_definitions/bar.d.ts | 7 + .../run/type_definitions/type_definitions/bar.js | 5 + .../type_definitions/type_definitions/fizz.d.ts | 2 + .../run/type_definitions/type_definitions/fizz.js | 1 + .../run/type_definitions/type_definitions/foo.d.ts | 2 + .../run/type_definitions/type_definitions/foo.js | 1 + .../run/type_definitions/type_definitions/qat.ts | 1 + .../run/type_definitions_for_export/__test__.jsonc | 5 + .../type_definitions_for_export/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 | 7 + .../type_definitions_for_export.ts.out | 5 + tests/specs/run/type_directives_01/__test__.jsonc | 4 + .../run/type_directives_01/type_directives_01.ts | 3 + .../type_directives_01/type_directives_01.ts.out | 3 + tests/specs/run/type_directives_02/__test__.jsonc | 4 + .../run/type_directives_02/type_directives_02.ts | 3 + .../type_directives_02/type_directives_02.ts.out | 3 + .../run/type_directives_02/type_reference.d.ts | 1 + .../specs/run/type_directives_02/type_reference.js | 3 + .../run/type_headers_deno_types/__test__.jsonc | 4 + .../type_headers_deno_types.ts | 18 + .../type_headers_deno_types.ts.out | 5 + tests/specs/run/unbuffered_stderr/__test__.jsonc | 4 + .../run/unbuffered_stderr/unbuffered_stderr.ts | 1 + .../run/unbuffered_stderr/unbuffered_stderr.ts.out | 1 + tests/specs/run/unbuffered_stdout/__test__.jsonc | 4 + .../run/unbuffered_stdout/unbuffered_stdout.ts | 1 + .../run/unbuffered_stdout/unbuffered_stdout.ts.out | 1 + tests/specs/run/unhandled_rejection/__test__.jsonc | 4 + .../run/unhandled_rejection/unhandled_rejection.ts | 13 + .../unhandled_rejection/unhandled_rejection.ts.out | 9 + .../__test__.jsonc | 5 + .../unhandled_rejection_dynamic_import/import.ts | 5 + .../unhandled_rejection_dynamic_import/main.ts | 1 + .../unhandled_rejection_dynamic_import/main.ts.out | 3 + .../__test__.jsonc | 4 + .../unhandled_rejection_dynamic_import2/import.ts | 3 + .../unhandled_rejection_dynamic_import2/main.ts | 21 + .../main.ts.out | 5 + .../unhandled_rejection_sync_error/__test__.jsonc | 4 + .../unhandled_rejection_sync_error.ts | 6 + .../unhandled_rejection_sync_error.ts.out | 6 + tests/specs/run/unsafe_proto/__test__.jsonc | 5 + tests/specs/run/unsafe_proto/unsafe_proto/main.js | 5 + tests/specs/run/unsafe_proto/unsafe_proto/main.out | 2 + .../unsafe_proto/main_with_unsafe_proto_flag.out | 2 + .../specs/run/unsafe_proto/unsafe_proto/worker.js | 2 + tests/specs/run/unsafe_proto_flag/__test__.jsonc | 5 + .../run/unsafe_proto_flag/unsafe_proto/main.js | 5 + .../run/unsafe_proto_flag/unsafe_proto/main.out | 2 + .../unsafe_proto/main_with_unsafe_proto_flag.out | 2 + .../run/unsafe_proto_flag/unsafe_proto/worker.js | 2 + .../__test__.jsonc | 4 + .../unstable_broadcast_channel.disabled.out | 2 + .../unstable_broadcast_channel.js | 10 + .../__test__.jsonc | 4 + .../unstable_broadcast_channel.enabled.out | 2 + .../unstable_broadcast_channel.js | 10 + .../run/unstable_cron_disabled/__test__.jsonc | 4 + .../unstable_cron.disabled.out | 2 + .../run/unstable_cron_disabled/unstable_cron.js | 10 + .../specs/run/unstable_cron_enabled/__test__.jsonc | 4 + .../unstable_cron.enabled.out | 2 + .../run/unstable_cron_enabled/unstable_cron.js | 10 + .../specs/run/unstable_kv_disabled/__test__.jsonc | 4 + .../unstable_kv_disabled/unstable_kv.disabled.out | 10 + .../specs/run/unstable_kv_disabled/unstable_kv.js | 14 + tests/specs/run/unstable_kv_enabled/__test__.jsonc | 4 + .../unstable_kv_enabled/unstable_kv.enabled.out | 10 + tests/specs/run/unstable_kv_enabled/unstable_kv.js | 14 + .../specs/run/unstable_net_disabled/__test__.jsonc | 4 + .../unstable_net.disabled.out | 4 + .../run/unstable_net_disabled/unstable_net.js | 11 + .../specs/run/unstable_net_enabled/__test__.jsonc | 4 + .../unstable_net_enabled/unstable_net.enabled.out | 4 + .../specs/run/unstable_net_enabled/unstable_net.js | 11 + tests/specs/run/unstable_worker/__test__.jsonc | 4 + tests/specs/run/unstable_worker/unstable_worker.ts | 6 + .../run/unstable_worker/unstable_worker.ts.out | 2 + tests/specs/run/unstable_worker/worker_unstable.ts | 5 + .../__test__.jsonc | 5 + .../unstable_worker_options.disabled.out | 1 + .../unstable_worker_options.js | 19 + .../unstable_worker_options_enabled/__test__.jsonc | 4 + .../unstable_worker_options.enabled.out | 2 + .../unstable_worker_options.js | 19 + .../__test__.jsonc | 5 + .../unsupported_dynamic_import_scheme.out | 7 + tests/specs/run/v8_flags_env_run/__test__.jsonc | 7 + tests/specs/run/v8_flags_env_run/v8_flags.js | 1 + tests/specs/run/v8_flags_env_run/v8_flags.js.out | 1 + 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 + .../specs/run/v8_flags_unrecognized/__test__.jsonc | 5 + .../v8_flags_unrecognized.out | 5 + tests/specs/run/v8_help/__test__.jsonc | 4 + tests/specs/run/v8_help/v8_help.out | 4 + tests/specs/run/wasm/__test__.jsonc | 4 + tests/specs/run/wasm/wasm.ts | 16 + tests/specs/run/wasm/wasm.ts.out | 1 + tests/specs/run/wasm_async/__test__.jsonc | 4 + tests/specs/run/wasm_async/wasm_async.js | 27 + tests/specs/run/wasm_async/wasm_async.out | 1 + tests/specs/run/wasm_shared/__test__.jsonc | 4 + tests/specs/run/wasm_shared/wasm_shared.out | 0 tests/specs/run/wasm_shared/wasm_shared.ts | 6 + .../run/wasm_streaming_panic_test/__test__.jsonc | 5 + .../wasm_streaming_panic_test.js | 3 + .../wasm_streaming_panic_test.js.out | 2 + tests/specs/run/wasm_unreachable/__test__.jsonc | 5 + tests/specs/run/wasm_unreachable/unreachable.wasm | Bin 0 -> 42 bytes .../specs/run/wasm_unreachable/wasm_unreachable.js | 9 + .../run/wasm_unreachable/wasm_unreachable.out | 3 + tests/specs/run/wasm_url/__test__.jsonc | 5 + tests/specs/run/wasm_url/wasm_url.js | 8 + tests/specs/run/wasm_url/wasm_url.out | 3 + tests/specs/run/weakref/__test__.jsonc | 4 + tests/specs/run/weakref/weakref.ts | 1 + tests/specs/run/weakref/weakref.ts.out | 1 + .../run/webstorage_serialization/__test__.jsonc | 4 + .../webstorage/config_a.jsonc | 3 + .../webstorage/config_b.jsonc | 3 + .../webstorage_serialization/webstorage/fixture.ts | 2 + .../webstorage_serialization/webstorage/logger.ts | 1 + .../webstorage/serialization.ts | 4 + .../webstorage/serialization.ts.out | 2 + .../webstorage_serialization/webstorage/setter.ts | 1 + .../worker_close_in_wasm_reactions/__test__.jsonc | 4 + .../close_in_wasm_reactions.js | 21 + .../worker_close_in_wasm_reactions.js | 10 + .../worker_close_in_wasm_reactions.js.out | 2 + tests/specs/run/worker_close_nested/__test__.jsonc | 4 + .../run/worker_close_nested/close_nested_child.js | 8 + .../run/worker_close_nested/close_nested_parent.js | 13 + .../run/worker_close_nested/worker_close_nested.js | 20 + .../worker_close_nested/worker_close_nested.js.out | 5 + tests/specs/run/worker_close_race/__test__.jsonc | 4 + .../run/worker_close_race/close_race_worker.js | 6 + .../run/worker_close_race/worker_close_race.js | 14 + .../run/worker_close_race/worker_close_race.js.out | 0 .../run/worker_drop_handle_race/__test__.jsonc | 5 + .../worker_drop_handle_race/drop_handle_race.js | 3 + .../worker_drop_handle_race.js | 12 + .../worker_drop_handle_race.js.out | 7 + .../__test__.jsonc | 4 + .../worker_drop_handle_race_terminate.js | 37 + .../worker_drop_handle_race_terminate.js.out | 4 + .../run/worker_event_handler_test/__test__.jsonc | 4 + .../worker_event_handler_test.js | 5 + .../worker_event_handler_test.js.out | 11 + .../worker_event_handlers.js | 26 + .../run/worker_message_before_close/__test__.jsonc | 4 + .../message_before_close.js | 4 + .../worker_message_before_close.js | 26 + .../worker_message_before_close.js.out | 1 + tests/testdata/error_cause_recursive_aggregate.ts | 9 - .../error_cause_recursive_aggregate.ts.out | 14 - tests/testdata/error_cause_recursive_tail.ts | 5 - tests/testdata/error_cause_recursive_tail.ts.out | 9 - tests/testdata/run/001_hello.js.out | 1 - tests/testdata/run/002_hello.ts.out | 1 - tests/testdata/run/003_relative_import.ts.out | 1 - tests/testdata/run/004_set_timeout.ts | 11 - tests/testdata/run/004_set_timeout.ts.out | 2 - tests/testdata/run/005_more_imports.ts | 11 - tests/testdata/run/005_more_imports.ts.out | 1 - tests/testdata/run/012_async.ts | 11 - tests/testdata/run/012_async.ts.out | 3 - tests/testdata/run/013_dynamic_import.ts.out | 1 - tests/testdata/run/014_duplicate_import.ts | 9 - tests/testdata/run/014_duplicate_import.ts.out | 1 - .../testdata/run/015_duplicate_parallel_import.js | 20 - .../run/015_duplicate_parallel_import.js.out | 1 - tests/testdata/run/016_double_await.ts | 8 - tests/testdata/run/016_double_await.ts.out | 2 - tests/testdata/run/017_import_redirect.ts.out | 1 - tests/testdata/run/017_import_redirect_info.out | 7 - tests/testdata/run/018_async_catch.ts | 14 - tests/testdata/run/018_async_catch.ts.out | 3 - tests/testdata/run/019_media_types.ts.out | 1 - tests/testdata/run/020_json_modules.ts | 2 - tests/testdata/run/020_json_modules.ts.out | 3 - tests/testdata/run/021_mjs_modules.ts | 2 - tests/testdata/run/021_mjs_modules.ts.out | 1 - tests/testdata/run/025_reload_js_type_error.js | 6 - tests/testdata/run/025_reload_js_type_error.js.out | 1 - tests/testdata/run/027_redirect_typescript.ts | 2 - tests/testdata/run/027_redirect_typescript.ts.out | 1 - tests/testdata/run/028_args.ts | 3 - tests/testdata/run/028_args.ts.out | 6 - tests/testdata/run/033_import_map_remote.out | 5 - tests/testdata/run/035_cached_only_flag.out | 1 - tests/testdata/run/038_checkjs.js | 5 - tests/testdata/run/038_checkjs.js.out | 22 - tests/testdata/run/042_dyn_import_evalcontext.ts | 5 - .../testdata/run/042_dyn_import_evalcontext.ts.out | 1 - tests/testdata/run/044_bad_resource.ts | 3 - tests/testdata/run/044_bad_resource.ts.out | 2 - tests/testdata/run/046_jsx_test.tsx | 14 - tests/testdata/run/046_jsx_test.tsx.out | 1 - tests/testdata/run/047_jsx_test.jsx | 7 - tests/testdata/run/047_jsx_test.jsx.out | 1 - tests/testdata/run/048_media_types_jsx.ts.out | 2 - tests/testdata/run/052_no_remote_flag.out | 1 - tests/testdata/run/058_tasks_microtasks_close.ts | 19 - .../testdata/run/058_tasks_microtasks_close.ts.out | 6 - tests/testdata/run/059_fs_relative_path_perm.ts | 2 - .../testdata/run/059_fs_relative_path_perm.ts.out | 4 - tests/testdata/run/063_permissions_revoke.ts | 6 - tests/testdata/run/063_permissions_revoke.ts.out | 3 - tests/testdata/run/063_permissions_revoke_sync.ts | 6 - .../testdata/run/064_permissions_revoke_global.ts | 6 - .../run/064_permissions_revoke_global.ts.out | 3 - .../run/064_permissions_revoke_global_sync.ts | 6 - tests/testdata/run/065_permissions_revoke_net.ts | 6 - .../testdata/run/065_permissions_revoke_net.ts.out | 3 - tests/testdata/run/070_location.ts | 18 - tests/testdata/run/070_location.ts.out | 15 - tests/testdata/run/071_location_unset.ts | 16 - tests/testdata/run/071_location_unset.ts.out | 4 - tests/testdata/run/072_location_relative_fetch.ts | 2 - .../run/072_location_relative_fetch.ts.out | 2 - tests/testdata/run/075_import_local_query_hash.ts | 2 - .../run/075_import_local_query_hash.ts.out | 2 - tests/testdata/run/077_fetch_empty.ts | 1 - tests/testdata/run/077_fetch_empty.ts.out | 2 - tests/testdata/run/078_unload_on_exit.ts | 9 - tests/testdata/run/078_unload_on_exit.ts.out | 1 - tests/testdata/run/079_location_authentication.ts | 1 - .../run/079_location_authentication.ts.out | 1 - .../run/081_location_relative_fetch_redirect.ts | 2 - .../081_location_relative_fetch_redirect.ts.out | 1 - .../testdata/run/082_prepare_stack_trace_throw.js | 6 - .../run/082_prepare_stack_trace_throw.js.out | 2 - .../run/088_dynamic_import_already_evaluating.ts | 2 - .../088_dynamic_import_already_evaluating.ts.out | 4 - .../run/091_use_define_for_class_fields.ts | 4 - .../run/091_use_define_for_class_fields.ts.out | 4 - tests/testdata/run/aggregate_error.out | 18 - tests/testdata/run/aggregate_error.ts | 9 - tests/testdata/run/async_error.ts | 9 - tests/testdata/run/async_error.ts.out | 8 - tests/testdata/run/before_unload.js | 21 - tests/testdata/run/before_unload.js.out | 8 - tests/testdata/run/blob_gc_finalization.js | 11 - tests/testdata/run/blob_gc_finalization.js.out | 1 - tests/testdata/run/byte_order_mark.out | 1 - tests/testdata/run/byte_order_mark.ts | 4 - tests/testdata/run/check_js_points_to_ts/bar.ts | 3 - tests/testdata/run/check_js_points_to_ts/foo.d.ts | 0 tests/testdata/run/check_js_points_to_ts/foo.js | 4 - tests/testdata/run/check_js_points_to_ts/test.js | 3 - .../testdata/run/check_js_points_to_ts/test.js.out | 4 - tests/testdata/run/classic_workers_event_loop.js | 4 - .../testdata/run/classic_workers_event_loop.js.out | 1 - tests/testdata/run/colors_without_globalThis.js | 1 - tests/testdata/run/complex_error.ts | 18 - tests/testdata/run/complex_error.ts.out | 44 - tests/testdata/run/config/main.out | 4 - tests/testdata/run/config/main.ts | 5 - tests/testdata/run/config/tsconfig.json | 7 - tests/testdata/run/config_json_import.ts | 2 - tests/testdata/run/config_json_import.ts.out | 3 - tests/testdata/run/config_types/main.out | 1 - tests/testdata/run/config_types/main.ts | 1 - .../testdata/run/config_types/remote.tsconfig.json | 7 - tests/testdata/run/config_types/tsconfig.json | 7 - tests/testdata/run/custom_inspect_url.js | 3 - tests/testdata/run/custom_inspect_url.js.out | 47 - .../testdata/run/decorators/experimental/deno.json | 5 - .../run/decorators/experimental/no_check/main.out | 3 - .../run/decorators/experimental/no_check/main.ts | 21 - .../run/decorators/experimental/runtime/main.out | 7 - .../run/decorators/experimental/runtime/main.ts | 42 - .../run/decorators/experimental/ts/main.out | 3 - .../run/decorators/experimental/ts/main.ts | 14 - .../testdata/run/decorators/tc39_proposal/main.out | 3 - .../testdata/run/decorators/tc39_proposal/main.ts | 21 - tests/testdata/run/deno_exit_tampering.ts | 3 - tests/testdata/run/deny_all_permission_args.js | 7 - tests/testdata/run/deny_all_permission_args.out | 7 - tests/testdata/run/deny_some_permission_args.js | 21 - tests/testdata/run/deny_some_permission_args.out | 21 - tests/testdata/run/dom_exception_formatting.ts | 1 - tests/testdata/run/dom_exception_formatting.ts.out | 3 - .../dynamic_import_already_rejected/error_001.ts | 9 - .../run/dynamic_import_already_rejected/main.out | 4 - .../run/dynamic_import_already_rejected/main.ts | 15 - .../dynamic_import_async_error/delayed_error.ts | 2 - .../run/dynamic_import_async_error/main.out | 2 - .../run/dynamic_import_async_error/main.ts | 7 - .../main.out | 100 - .../main.ts | 16 - .../mod.ts | 7 - tests/testdata/run/dynamic_import_conditional.js | 3 - .../testdata/run/dynamic_import_conditional.js.out | 1 - tests/testdata/run/dynamic_import_syntax_error.js | 1 - .../run/dynamic_import_syntax_error.js.out | 4 - tests/testdata/run/empty.ts | 0 tests/testdata/run/error_001.ts.out | 6 - tests/testdata/run/error_002.ts | 7 - tests/testdata/run/error_002.ts.out | 6 - tests/testdata/run/error_003_typescript.ts | 20 - tests/testdata/run/error_003_typescript.ts.out | 7 - tests/testdata/run/error_004_missing_module.ts | 3 - tests/testdata/run/error_004_missing_module.ts.out | 2 - .../run/error_005_missing_dynamic_import.ts | 3 - .../run/error_005_missing_dynamic_import.ts.out | 4 - tests/testdata/run/error_006_import_ext_failure.ts | 1 - .../run/error_006_import_ext_failure.ts.out | 2 - tests/testdata/run/error_007_any.ts | 1 - tests/testdata/run/error_007_any.ts.out | 1 - tests/testdata/run/error_008_checkjs.js | 5 - tests/testdata/run/error_008_checkjs.js.out | 4 - tests/testdata/run/error_009_extensions_error.js | 2 - .../testdata/run/error_009_extensions_error.js.out | 6 - .../testdata/run/error_011_bad_module_specifier.ts | 3 - .../run/error_011_bad_module_specifier.ts.out | 2 - .../run/error_012_bad_dynamic_import_specifier.ts | 3 - .../error_012_bad_dynamic_import_specifier.ts.out | 7 - .../run/error_014_catch_dynamic_import_error.js | 31 - .../error_014_catch_dynamic_import_error.js.out | 19 - .../run/error_015_dynamic_import_permissions.js | 3 - .../run/error_015_dynamic_import_permissions.out | 4 - .../testdata/run/error_017_hide_long_source_ts.ts | 3 - .../run/error_017_hide_long_source_ts.ts.out | 3 - .../testdata/run/error_018_hide_long_source_js.js | 3 - .../run/error_018_hide_long_source_js.js.out | 2 - tests/testdata/run/error_019_stack_function.ts | 12 - tests/testdata/run/error_019_stack_function.ts.out | 8 - tests/testdata/run/error_020_stack_constructor.ts | 14 - .../run/error_020_stack_constructor.ts.out | 8 - tests/testdata/run/error_021_stack_method.ts | 14 - tests/testdata/run/error_021_stack_method.ts.out | 8 - tests/testdata/run/error_022_stack_custom_error.ts | 14 - .../run/error_022_stack_custom_error.ts.out | 6 - tests/testdata/run/error_023_stack_async.ts | 14 - tests/testdata/run/error_023_stack_async.ts.out | 10 - tests/testdata/run/error_024_stack_promise_all.ts | 16 - .../run/error_024_stack_promise_all.ts.out | 10 - tests/testdata/run/error_025_tab_indent | 9 - tests/testdata/run/error_025_tab_indent.out | 6 - tests/testdata/run/error_cause.ts | 14 - tests/testdata/run/error_cause.ts.out | 13 - tests/testdata/run/error_cause_recursive.ts | 4 - tests/testdata/run/error_cause_recursive.ts.out | 7 - tests/testdata/run/error_for_await.ts | 12 - tests/testdata/run/error_for_await.ts.out | 10 - .../run/error_import_map_unable_to_load.out | 4 - .../run/error_missing_module_named_import.ts | 3 - .../run/error_missing_module_named_import.ts.out | 2 - tests/testdata/run/error_name_non_string.js | 8 - tests/testdata/run/error_name_non_string.js.out | 4 - tests/testdata/run/error_no_check.ts | 1 - tests/testdata/run/error_no_check.ts.out | 2 - tests/testdata/run/error_syntax.js | 3 - tests/testdata/run/error_syntax.js.out | 4 - .../run/error_syntax_empty_trailing_line.mjs | 2 - .../run/error_syntax_empty_trailing_line.mjs.out | 6 - tests/testdata/run/error_type_definitions.ts | 5 - tests/testdata/run/error_type_definitions.ts.out | 3 - tests/testdata/run/error_with_errors_prop.js | 10 - tests/testdata/run/error_with_errors_prop.js.out | 17 - tests/testdata/run/es_private_fields.js | 15 - tests/testdata/run/es_private_fields.js.out | 1 - .../run/eval_context_throw_dom_exception.js | 5 - .../run/eval_context_throw_dom_exception.js.out | 8 - tests/testdata/run/event_listener_error.ts | 6 - tests/testdata/run/event_listener_error.ts.out | 7 - tests/testdata/run/event_listener_error_handled.ts | 23 - .../run/event_listener_error_handled.ts.out | 17 - .../run/event_listener_error_immediate_exit.ts | 12 - .../run/event_listener_error_immediate_exit.ts.out | 6 - .../event_listener_error_immediate_exit_worker.ts | 4 - ...ent_listener_error_immediate_exit_worker.ts.out | 8 - tests/testdata/run/exit_error42.ts | 3 - tests/testdata/run/exit_error42.ts.out | 1 - .../run/explicit_resource_management/main.out | 5 - .../run/explicit_resource_management/main.ts | 21 - tests/testdata/run/fetch_async_error_stack.ts | 1 - tests/testdata/run/fetch_async_error_stack.ts.out | 5 - tests/testdata/run/fetch_response_finalization.js | 16 - .../run/fetch_response_finalization.js.out | 2 - tests/testdata/run/finalization_registry.js | 20 - tests/testdata/run/finalization_registry.js.out | 1 - tests/testdata/run/fix_dynamic_import_errors.js | 7 - .../testdata/run/fix_dynamic_import_errors.js.out | 2 - tests/testdata/run/fix_emittable_skipped.js | 7 - tests/testdata/run/fix_emittable_skipped.ts.out | 1 - tests/testdata/run/fix_js_import_js.ts | 3 - tests/testdata/run/fix_js_import_js.ts.out | 1 - tests/testdata/run/fix_js_imports.ts | 3 - tests/testdata/run/fix_js_imports.ts.out | 1 - tests/testdata/run/fix_tsc_file_exists.out | 1 - tests/testdata/run/fix_worker_dispatchevent.ts | 43 - tests/testdata/run/fix_worker_dispatchevent.ts.out | 1 - .../run/followup_dyn_import_resolves/main.ts | 14 - .../run/followup_dyn_import_resolves/main.ts.out | 3 - tests/testdata/run/heapstats.js | 37 - tests/testdata/run/heapstats.js.out | 2 - tests/testdata/run/https_import.ts.out | 1 - tests/testdata/run/if_main.ts | 6 - tests/testdata/run/import_blob_url.ts | 13 - tests/testdata/run/import_blob_url.ts.out | 3 - tests/testdata/run/import_blob_url_error_stack.ts | 13 - .../run/import_blob_url_error_stack.ts.out | 5 - .../run/import_blob_url_import_relative.ts | 8 - .../run/import_blob_url_import_relative.ts.out | 5 - tests/testdata/run/import_blob_url_imports.ts | 11 - tests/testdata/run/import_blob_url_imports.ts.out | 1 - tests/testdata/run/import_blob_url_jsx.ts | 16 - tests/testdata/run/import_blob_url_jsx.ts.out | 1 - tests/testdata/run/import_compression/main.out | 4 - tests/testdata/run/import_compression/main.ts | 13 - tests/testdata/run/import_data_url.ts | 12 - tests/testdata/run/import_data_url.ts.out | 3 - tests/testdata/run/import_data_url_error_stack.ts | 3 - .../run/import_data_url_error_stack.ts.out | 5 - .../run/import_data_url_import_relative.ts | 4 - .../run/import_data_url_import_relative.ts.out | 2 - tests/testdata/run/import_data_url_imports.ts | 4 - tests/testdata/run/import_data_url_imports.ts.out | 1 - tests/testdata/run/import_data_url_jsx.ts | 10 - tests/testdata/run/import_data_url_jsx.ts.out | 1 - tests/testdata/run/import_dynamic_data_url.ts | 14 - tests/testdata/run/import_dynamic_data_url.ts.out | 3 - tests/testdata/run/import_extensionless.ts | 3 - tests/testdata/run/import_extensionless.ts.out | 1 - tests/testdata/run/import_file_with_colon.ts | 1 - tests/testdata/run/import_file_with_colon.ts.out | 1 - tests/testdata/run/import_maps/test_data.ts | 1 - tests/testdata/run/import_maps/test_data.ts.out | 1 - tests/testdata/run/import_type.ts | 5 - tests/testdata/run/import_type.ts.out | 1 - tests/testdata/run/inline_js_source_map_2.js | 4 - tests/testdata/run/inline_js_source_map_2.js.out | 2 - .../inline_js_source_map_2_with_inline_contents.js | 4 - ...ine_js_source_map_2_with_inline_contents.js.out | 2 - ...nline_js_source_map_with_contents_from_graph.js | 4 - ...e_js_source_map_with_contents_from_graph.js.out | 4 - tests/testdata/run/issue13562.ts | 3 - tests/testdata/run/issue13562.ts.out | 1 - tests/testdata/run/js_import_detect.ts | 3 - tests/testdata/run/js_import_detect.ts.out | 1 - tests/testdata/run/js_root_with_ts_check.js | 5 - tests/testdata/run/js_root_with_ts_check.js.out | 4 - tests/testdata/run/jsx_import_from_ts.ts | 3 - tests/testdata/run/jsx_import_from_ts.ts.out | 1 - tests/testdata/run/jsx_import_source.out | 2 - tests/testdata/run/jsx_import_source_dev.out | 2 - tests/testdata/run/jsx_import_source_error.out | 2 - tests/testdata/run/jsx_import_source_pragma.tsx | 9 - .../run/jsx_import_source_pragma_import_map.tsx | 9 - tests/testdata/run/jsx_precompile/no_pragma.out | 3 - tests/testdata/run/jsx_precompile/no_pragma.tsx | 3 - tests/testdata/run/jsx_precompile/skip.out | 3 - tests/testdata/run/jsx_precompile/skip.tsx | 9 - tests/testdata/run/lock_check_ok.json | 4 - tests/testdata/run/lock_check_ok2.json | 13 - tests/testdata/run/lock_v2_check_ok.json | 7 - tests/testdata/run/lock_v2_check_ok2.json | 13 - tests/testdata/run/long_data_url_formatting.ts | 3 - tests/testdata/run/long_data_url_formatting.ts.out | 8 - tests/testdata/run/main_module/main.out | 2 - tests/testdata/run/main_module/main.ts | 3 - tests/testdata/run/main_module/other.ts | 1 - tests/testdata/run/mts_dmts_mjs.out | 1 - tests/testdata/run/nested_error/main.ts | 3 - tests/testdata/run/nested_error/main.ts.out | 4 - tests/testdata/run/no_check_remote.ts.disabled.out | 4 - tests/testdata/run/no_lock_flag/deno.json | 3 - tests/testdata/run/no_lock_flag/deno.lock | 7 - tests/testdata/run/no_lock_flag/main.out | 2 - tests/testdata/run/no_lock_flag/main.ts | 1 - tests/testdata/run/node_env_var_allowlist.ts | 2 - tests/testdata/run/node_env_var_allowlist.ts.out | 5 - tests/testdata/run/onload/imported.ts | 12 - tests/testdata/run/onload/main.out | 15 - tests/testdata/run/onload/main.ts | 34 - tests/testdata/run/onload/nest_imported.ts | 11 - .../run/op_exit_op_set_exit_code_in_worker.ts | 13 - tests/testdata/run/permission_args.out | 4 - tests/testdata/run/private_field_presence.ts | 20 - tests/testdata/run/private_field_presence.ts.out | 2 - tests/testdata/run/proto_exploit.js | 5 - tests/testdata/run/proto_exploit.js.out | 2 - tests/testdata/run/queue_microtask_error.ts | 5 - tests/testdata/run/queue_microtask_error.ts.out | 6 - .../testdata/run/queue_microtask_error_handled.ts | 21 - .../run/queue_microtask_error_handled.ts.out | 15 - tests/testdata/run/reference_types.ts | 3 - tests/testdata/run/reference_types.ts.out | 1 - tests/testdata/run/reference_types_error.js | 2 - tests/testdata/run/reference_types_error.js.out | 2 - tests/testdata/run/reference_types_remote.ts | 3 - tests/testdata/run/reference_types_remote.ts.out | 1 - tests/testdata/run/rejection_handled.out | 5 - tests/testdata/run/rejection_handled.ts | 17 - tests/testdata/run/replace_self.js | 21 - tests/testdata/run/replace_self.js.out | 4 - tests/testdata/run/report_error.ts | 3 - tests/testdata/run/report_error.ts.out | 5 - tests/testdata/run/report_error_end_of_program.ts | 1 - .../run/report_error_end_of_program.ts.out | 4 - tests/testdata/run/report_error_handled.ts | 19 - tests/testdata/run/report_error_handled.ts.out | 13 - tests/testdata/run/seed_random.js | 11 - tests/testdata/run/seed_random.js.out | 22 - tests/testdata/run/set_exit_code_0.ts | 2 - tests/testdata/run/set_exit_code_1.ts | 2 - tests/testdata/run/set_exit_code_2.ts | 2 - tests/testdata/run/set_timeout_error.ts | 3 - tests/testdata/run/set_timeout_error.ts.out | 5 - tests/testdata/run/set_timeout_error_handled.ts | 19 - .../testdata/run/set_timeout_error_handled.ts.out | 13 - tests/testdata/run/shebang.ts | 5 - tests/testdata/run/shebang.ts.out | 1 - tests/testdata/run/single_compile_with_reload.ts | 18 - .../testdata/run/single_compile_with_reload.ts.out | 7 - tests/testdata/run/spawn_stdout_inherit.ts | 8 - tests/testdata/run/spawn_stdout_inherit.ts.out | 2 - tests/testdata/run/stdin_read_all.out | 1 - tests/testdata/run/stdin_read_all.ts | 17 - tests/testdata/run/stdout_write_all.out | 100 - tests/testdata/run/stdout_write_all.ts | 13 - tests/testdata/run/stdout_write_sync_async.out | 200 -- tests/testdata/run/stdout_write_sync_async.ts | 14 - tests/testdata/run/swc_syntax_error.ts | 4 - tests/testdata/run/swc_syntax_error.ts.out | 4 - tests/testdata/run/test_and_bench_in_run.js | 5 - tests/testdata/run/tls.out | 1 - tests/testdata/run/tls_connecttls.js | 65 - tests/testdata/run/tls_starttls.js | 64 - tests/testdata/run/top_level_await/circular.js | 8 - tests/testdata/run/top_level_await/circular.out | 10 - tests/testdata/run/top_level_await/loop.js | 20 - tests/testdata/run/top_level_await/loop.out | 5 - tests/testdata/run/top_level_await/nested.out | 5 - tests/testdata/run/top_level_await/nested/a.js | 3 - tests/testdata/run/top_level_await/nested/b.js | 1 - tests/testdata/run/top_level_await/nested/main.js | 3 - tests/testdata/run/top_level_await/order.js | 21 - tests/testdata/run/top_level_await/order.out | 2 - .../run/top_level_await/top_level_await.js | 3 - .../run/top_level_await/top_level_await.out | 3 - .../run/top_level_await/top_level_await.ts | 3 - .../run/top_level_await/top_level_for_await.js | 10 - .../run/top_level_await/top_level_for_await.out | 3 - .../run/top_level_await/top_level_for_await.ts | 10 - tests/testdata/run/top_level_await/unresolved.js | 1 - tests/testdata/run/top_level_await/unresolved.out | 4 - tests/testdata/run/ts_import_from_js/deps.js | 2 - tests/testdata/run/ts_import_from_js/main.js | 3 - tests/testdata/run/ts_import_from_js/main.out | 3 - tests/testdata/run/ts_type_imports.ts | 5 - tests/testdata/run/ts_type_imports.ts.out | 6 - tests/testdata/run/ts_type_only_import.ts | 1 - tests/testdata/run/ts_type_only_import.ts.out | 1 - tests/testdata/run/tsx_imports/Component.tsx | 1 - tests/testdata/run/tsx_imports/tsx_imports.ts | 1 - tests/testdata/run/tsx_imports/tsx_imports.ts.out | 2 - tests/testdata/run/type_definitions.ts | 12 - tests/testdata/run/type_definitions.ts.out | 3 - tests/testdata/run/type_definitions_for_export.ts | 7 - .../run/type_definitions_for_export.ts.out | 5 - tests/testdata/run/type_directives_01.ts | 3 - tests/testdata/run/type_directives_01.ts.out | 3 - tests/testdata/run/type_directives_02.ts | 3 - tests/testdata/run/type_directives_02.ts.out | 3 - tests/testdata/run/type_headers_deno_types.ts | 18 - tests/testdata/run/type_headers_deno_types.ts.out | 5 - tests/testdata/run/unbuffered_stderr.ts | 1 - tests/testdata/run/unbuffered_stderr.ts.out | 1 - tests/testdata/run/unbuffered_stdout.ts | 1 - tests/testdata/run/unbuffered_stdout.ts.out | 1 - tests/testdata/run/unhandled_rejection.ts | 13 - tests/testdata/run/unhandled_rejection.ts.out | 9 - .../unhandled_rejection_dynamic_import/import.ts | 5 - .../run/unhandled_rejection_dynamic_import/main.ts | 1 - .../unhandled_rejection_dynamic_import/main.ts.out | 3 - .../unhandled_rejection_dynamic_import2/import.ts | 3 - .../unhandled_rejection_dynamic_import2/main.ts | 21 - .../main.ts.out | 5 - .../testdata/run/unhandled_rejection_sync_error.ts | 6 - .../run/unhandled_rejection_sync_error.ts.out | 6 - tests/testdata/run/unsafe_proto/main.js | 5 - tests/testdata/run/unsafe_proto/main.out | 2 - .../unsafe_proto/main_with_unsafe_proto_flag.out | 2 - tests/testdata/run/unsafe_proto/worker.js | 2 - .../run/unstable_broadcast_channel.disabled.out | 2 - .../run/unstable_broadcast_channel.enabled.out | 2 - tests/testdata/run/unstable_broadcast_channel.js | 10 - tests/testdata/run/unstable_cron.disabled.out | 2 - tests/testdata/run/unstable_cron.enabled.out | 2 - tests/testdata/run/unstable_cron.js | 10 - tests/testdata/run/unstable_kv.disabled.out | 10 - tests/testdata/run/unstable_kv.enabled.out | 10 - tests/testdata/run/unstable_kv.js | 14 - tests/testdata/run/unstable_net.disabled.out | 4 - tests/testdata/run/unstable_net.enabled.out | 4 - tests/testdata/run/unstable_net.js | 11 - tests/testdata/run/unstable_worker.ts | 6 - tests/testdata/run/unstable_worker.ts.out | 2 - .../run/unstable_worker_options.disabled.out | 1 - .../run/unstable_worker_options.enabled.out | 2 - tests/testdata/run/unstable_worker_options.js | 19 - .../run/unsupported_dynamic_import_scheme.out | 7 - tests/testdata/run/v8_flags.js | 1 - tests/testdata/run/v8_flags.js.out | 1 - tests/testdata/run/v8_flags_unrecognized.out | 5 - tests/testdata/run/v8_help.out | 4 - tests/testdata/run/wasm.ts | 16 - tests/testdata/run/wasm.ts.out | 1 - tests/testdata/run/wasm_async.js | 27 - tests/testdata/run/wasm_async.out | 1 - tests/testdata/run/wasm_shared.out | 0 tests/testdata/run/wasm_shared.ts | 6 - tests/testdata/run/wasm_streaming_panic_test.js | 3 - .../testdata/run/wasm_streaming_panic_test.js.out | 2 - tests/testdata/run/wasm_unreachable.js | 9 - tests/testdata/run/wasm_unreachable.out | 3 - tests/testdata/run/wasm_url.js | 8 - tests/testdata/run/wasm_url.out | 3 - tests/testdata/run/weakref.ts | 1 - tests/testdata/run/weakref.ts.out | 1 - tests/testdata/run/webstorage/serialization.ts | 4 - tests/testdata/run/webstorage/serialization.ts.out | 2 - .../run/with_config/auto_discovery_log.out | 4 - tests/testdata/run/with_config/deno.jsonc | 6 - tests/testdata/run/with_config/frontend_work.ts | 4 - .../testdata/run/with_config/no_auto_discovery.out | 4 - tests/testdata/run/with_config/server_side_work.ts | 2 - .../run/with_package_json/with_stop/main.out | 5 - .../testdata/run/worker_close_in_wasm_reactions.js | 10 - .../run/worker_close_in_wasm_reactions.js.out | 2 - tests/testdata/run/worker_close_nested.js | 20 - tests/testdata/run/worker_close_nested.js.out | 5 - tests/testdata/run/worker_close_race.js | 14 - tests/testdata/run/worker_close_race.js.out | 0 tests/testdata/run/worker_drop_handle_race.js | 12 - tests/testdata/run/worker_drop_handle_race.js.out | 7 - .../run/worker_drop_handle_race_terminate.js | 37 - .../run/worker_drop_handle_race_terminate.js.out | 4 - tests/testdata/run/worker_event_handler_test.js | 5 - .../testdata/run/worker_event_handler_test.js.out | 11 - tests/testdata/run/worker_message_before_close.js | 26 - .../run/worker_message_before_close.js.out | 1 - 2123 files changed, 11112 insertions(+), 5556 deletions(-) create mode 100644 tests/specs/run/_001_hello/001_hello.js create mode 100644 tests/specs/run/_001_hello/001_hello.js.out create mode 100644 tests/specs/run/_001_hello/__test__.jsonc create mode 100644 tests/specs/run/_002_hello/002_hello.ts create mode 100644 tests/specs/run/_002_hello/002_hello.ts.out create mode 100644 tests/specs/run/_002_hello/__test__.jsonc create mode 100644 tests/specs/run/_003_relative_import/003_relative_import.ts create mode 100644 tests/specs/run/_003_relative_import/003_relative_import.ts.out create mode 100644 tests/specs/run/_003_relative_import/__test__.jsonc create mode 100644 tests/specs/run/_003_relative_import/print_hello.ts create mode 100644 tests/specs/run/_004_set_timeout/004_set_timeout.ts create mode 100644 tests/specs/run/_004_set_timeout/004_set_timeout.ts.out create mode 100644 tests/specs/run/_004_set_timeout/__test__.jsonc create mode 100644 tests/specs/run/_005_more_imports/005_more_imports.ts create mode 100644 tests/specs/run/_005_more_imports/005_more_imports.ts.out 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 create mode 100644 tests/specs/run/_012_async/012_async.ts create mode 100644 tests/specs/run/_012_async/012_async.ts.out create mode 100644 tests/specs/run/_012_async/__test__.jsonc create mode 100644 tests/specs/run/_013_dynamic_import/013_dynamic_import.ts create mode 100644 tests/specs/run/_013_dynamic_import/013_dynamic_import.ts.out 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 create mode 100644 tests/specs/run/_014_duplicate_import/014_duplicate_import.ts.out create mode 100644 tests/specs/run/_014_duplicate_import/__test__.jsonc create mode 100644 tests/specs/run/_014_duplicate_import/auto_print_hello.ts create mode 100644 tests/specs/run/_015_duplicate_parallel_import/015_duplicate_parallel_import.js create mode 100644 tests/specs/run/_015_duplicate_parallel_import/015_duplicate_parallel_import.js.out 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 create mode 100644 tests/specs/run/_016_double_await/016_double_await.ts create mode 100644 tests/specs/run/_016_double_await/016_double_await.ts.out create mode 100644 tests/specs/run/_016_double_await/__test__.jsonc create mode 100644 tests/specs/run/_017_import_redirect/017_import_redirect.ts create mode 100644 tests/specs/run/_017_import_redirect/017_import_redirect.ts.out 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 create mode 100644 tests/specs/run/_017_import_redirect_check/017_import_redirect.ts.out 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 create mode 100644 tests/specs/run/_017_import_redirect_info/017_import_redirect_info.out 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 create mode 100644 tests/specs/run/_017_import_redirect_vendor_dir/017_import_redirect.ts.out create mode 100644 tests/specs/run/_017_import_redirect_vendor_dir/__test__.jsonc create mode 100644 tests/specs/run/_018_async_catch/018_async_catch.ts create mode 100644 tests/specs/run/_018_async_catch/018_async_catch.ts.out create mode 100644 tests/specs/run/_018_async_catch/__test__.jsonc create mode 100644 tests/specs/run/_019_media_types/019_media_types.ts create mode 100644 tests/specs/run/_019_media_types/019_media_types.ts.out create mode 100644 tests/specs/run/_019_media_types/__test__.jsonc create mode 100644 tests/specs/run/_020_json_modules/020_json_modules.ts create mode 100644 tests/specs/run/_020_json_modules/020_json_modules.ts.out 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 create mode 100644 tests/specs/run/_021_mjs_modules/021_mjs_modules.ts.out create mode 100644 tests/specs/run/_021_mjs_modules/__test__.jsonc create mode 100644 tests/specs/run/_021_mjs_modules/mod5.mjs create mode 100644 tests/specs/run/_025_reload_js_type_error/025_reload_js_type_error.js create mode 100644 tests/specs/run/_025_reload_js_type_error/025_reload_js_type_error.js.out create mode 100644 tests/specs/run/_025_reload_js_type_error/__test__.jsonc create mode 100644 tests/specs/run/_027_redirect_typescript/027_redirect_typescript.ts create mode 100644 tests/specs/run/_027_redirect_typescript/027_redirect_typescript.ts.out 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 create mode 100644 tests/specs/run/_028_args/028_args.ts create mode 100644 tests/specs/run/_028_args/028_args.ts.out 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 create mode 100644 tests/specs/run/_033_import_map_data_uri/test_data.ts create mode 100644 tests/specs/run/_033_import_map_data_uri/test_data.ts.out create mode 100644 tests/specs/run/_033_import_map_remote/033_import_map_remote.out 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 create mode 100644 tests/specs/run/_038_checkjs/038_checkjs.js create mode 100644 tests/specs/run/_038_checkjs/038_checkjs.js.out create mode 100644 tests/specs/run/_038_checkjs/__test__.jsonc create mode 100644 tests/specs/run/_038_checkjs/checkjs.tsconfig.json create mode 100644 tests/specs/run/_042_dyn_import_evalcontext/042_dyn_import_evalcontext.ts create mode 100644 tests/specs/run/_042_dyn_import_evalcontext/042_dyn_import_evalcontext.ts.out 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 create mode 100644 tests/specs/run/_044_bad_resource/044_bad_resource.ts.out create mode 100644 tests/specs/run/_044_bad_resource/__test__.jsonc create mode 100644 tests/specs/run/_046_tsx/046_jsx_test.tsx create mode 100644 tests/specs/run/_046_tsx/046_jsx_test.tsx.out create mode 100644 tests/specs/run/_046_tsx/__test__.jsonc create mode 100644 tests/specs/run/_047_jsx/047_jsx_test.jsx create mode 100644 tests/specs/run/_047_jsx/047_jsx_test.jsx.out 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 create mode 100644 tests/specs/run/_048_media_types_jsx/048_media_types_jsx.ts.out 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 create mode 100644 tests/specs/run/_052_no_remote_flag/052_no_remote_flag.out create mode 100644 tests/specs/run/_052_no_remote_flag/__test__.jsonc create mode 100644 tests/specs/run/_058_tasks_microtasks_close/058_tasks_microtasks_close.ts create mode 100644 tests/specs/run/_058_tasks_microtasks_close/058_tasks_microtasks_close.ts.out create mode 100644 tests/specs/run/_058_tasks_microtasks_close/__test__.jsonc create mode 100644 tests/specs/run/_059_fs_relative_path_perm/059_fs_relative_path_perm.ts create mode 100644 tests/specs/run/_059_fs_relative_path_perm/059_fs_relative_path_perm.ts.out create mode 100644 tests/specs/run/_059_fs_relative_path_perm/__test__.jsonc create mode 100644 tests/specs/run/_063_permissions_revoke/063_permissions_revoke.ts create mode 100644 tests/specs/run/_063_permissions_revoke/063_permissions_revoke.ts.out 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 create mode 100644 tests/specs/run/_063_permissions_revoke_sync/063_permissions_revoke_sync.ts create mode 100644 tests/specs/run/_063_permissions_revoke_sync/__test__.jsonc create mode 100644 tests/specs/run/_064_permissions_revoke_global/064_permissions_revoke_global.ts create mode 100644 tests/specs/run/_064_permissions_revoke_global/064_permissions_revoke_global.ts.out 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 create mode 100644 tests/specs/run/_064_permissions_revoke_global_sync/064_permissions_revoke_global_sync.ts create mode 100644 tests/specs/run/_064_permissions_revoke_global_sync/__test__.jsonc create mode 100644 tests/specs/run/_065_permissions_revoke_net/065_permissions_revoke_net.ts create mode 100644 tests/specs/run/_065_permissions_revoke_net/065_permissions_revoke_net.ts.out create mode 100644 tests/specs/run/_065_permissions_revoke_net/__test__.jsonc create mode 100644 tests/specs/run/_070_location/070_location.ts create mode 100644 tests/specs/run/_070_location/070_location.ts.out create mode 100644 tests/specs/run/_070_location/__test__.jsonc create mode 100644 tests/specs/run/_071_location_unset/071_location_unset.ts create mode 100644 tests/specs/run/_071_location_unset/071_location_unset.ts.out create mode 100644 tests/specs/run/_071_location_unset/__test__.jsonc create mode 100644 tests/specs/run/_072_location_relative_fetch/072_location_relative_fetch.ts create mode 100644 tests/specs/run/_072_location_relative_fetch/072_location_relative_fetch.ts.out 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 create mode 100644 tests/specs/run/_075_import_local_query_hash/075_import_local_query_hash.ts create mode 100644 tests/specs/run/_075_import_local_query_hash/075_import_local_query_hash.ts.out create mode 100644 tests/specs/run/_075_import_local_query_hash/__test__.jsonc create mode 100644 tests/specs/run/_077_fetch_empty/077_fetch_empty.ts create mode 100644 tests/specs/run/_077_fetch_empty/077_fetch_empty.ts.out create mode 100644 tests/specs/run/_077_fetch_empty/__test__.jsonc create mode 100644 tests/specs/run/_078_unload_on_exit/078_unload_on_exit.ts create mode 100644 tests/specs/run/_078_unload_on_exit/078_unload_on_exit.ts.out create mode 100644 tests/specs/run/_078_unload_on_exit/__test__.jsonc create mode 100644 tests/specs/run/_079_location_authentication/079_location_authentication.ts create mode 100644 tests/specs/run/_079_location_authentication/079_location_authentication.ts.out create mode 100644 tests/specs/run/_079_location_authentication/__test__.jsonc create mode 100644 tests/specs/run/_081_location_relative_fetch_redirect/081_location_relative_fetch_redirect.ts create mode 100644 tests/specs/run/_081_location_relative_fetch_redirect/081_location_relative_fetch_redirect.ts.out create mode 100644 tests/specs/run/_081_location_relative_fetch_redirect/__test__.jsonc create mode 100644 tests/specs/run/_082_prepare_stack_trace_throw/082_prepare_stack_trace_throw.js create mode 100644 tests/specs/run/_082_prepare_stack_trace_throw/082_prepare_stack_trace_throw.js.out create mode 100644 tests/specs/run/_082_prepare_stack_trace_throw/__test__.jsonc create mode 100644 tests/specs/run/_088_dynamic_import_already_evaluating/088_dynamic_import_already_evaluating.ts create mode 100644 tests/specs/run/_088_dynamic_import_already_evaluating/088_dynamic_import_already_evaluating.ts.out 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 create mode 100644 tests/specs/run/_091_use_define_for_class_fields/091_use_define_for_class_fields.ts create mode 100644 tests/specs/run/_091_use_define_for_class_fields/091_use_define_for_class_fields.ts.out create mode 100644 tests/specs/run/_091_use_define_for_class_fields/__test__.jsonc create mode 100644 tests/specs/run/aggregate_error/__test__.jsonc create mode 100644 tests/specs/run/aggregate_error/aggregate_error.out create mode 100644 tests/specs/run/aggregate_error/aggregate_error.ts create mode 100644 tests/specs/run/async_error/__test__.jsonc create mode 100644 tests/specs/run/async_error/async_error.ts create mode 100644 tests/specs/run/async_error/async_error.ts.out create mode 100644 tests/specs/run/beforeunload_event/__test__.jsonc create mode 100644 tests/specs/run/beforeunload_event/before_unload.js create mode 100644 tests/specs/run/beforeunload_event/before_unload.js.out create mode 100644 tests/specs/run/blob_gc_finalization/__test__.jsonc create mode 100644 tests/specs/run/blob_gc_finalization/blob_gc_finalization.js create mode 100644 tests/specs/run/blob_gc_finalization/blob_gc_finalization.js.out create mode 100644 tests/specs/run/byte_order_mark/001_hello.js create mode 100644 tests/specs/run/byte_order_mark/__test__.jsonc create mode 100644 tests/specs/run/byte_order_mark/byte_order_mark.out create mode 100644 tests/specs/run/byte_order_mark/byte_order_mark.ts create mode 100644 tests/specs/run/check_js_points_to_ts/__test__.jsonc create mode 100644 tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/bar.ts create mode 100644 tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/foo.d.ts create mode 100644 tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/foo.js create mode 100644 tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/test.js create mode 100644 tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/test.js.out 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 create mode 100644 tests/specs/run/check_remote/no_check_remote.ts.disabled.out create mode 100644 tests/specs/run/check_remote/type_error.ts create mode 100644 tests/specs/run/classic_workers_event_loop/__test__.jsonc create mode 100644 tests/specs/run/classic_workers_event_loop/classic_workers_event_loop.js create mode 100644 tests/specs/run/classic_workers_event_loop/classic_workers_event_loop.js.out create mode 100644 tests/specs/run/colors_without_global_this/__test__.jsonc create mode 100644 tests/specs/run/colors_without_global_this/colors_without_globalThis.js create mode 100644 tests/specs/run/complex_error/__test__.jsonc create mode 100644 tests/specs/run/complex_error/complex_error.ts create mode 100644 tests/specs/run/complex_error/complex_error.ts.out create mode 100644 tests/specs/run/config/__test__.jsonc create mode 100644 tests/specs/run/config/config/main.out create mode 100644 tests/specs/run/config/config/main.ts create mode 100644 tests/specs/run/config/config/tsconfig.json create mode 100644 tests/specs/run/config_auto_discovered_for_local_script/__test__.jsonc create mode 100644 tests/specs/run/config_auto_discovered_for_local_script/frontend_work.ts create mode 100644 tests/specs/run/config_auto_discovered_for_local_script_log/__test__.jsonc create mode 100644 tests/specs/run/config_auto_discovered_for_local_script_log/auto_discovery_log.out create mode 100644 tests/specs/run/config_auto_discovered_for_local_script_log/deno.jsonc 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 create mode 100644 tests/specs/run/config_json_import/config_json_import.ts.out 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 create mode 100644 tests/specs/run/config_not_auto_discovered_for_remote_script/server_side_work.ts create mode 100644 tests/specs/run/config_types/__test__.jsonc create mode 100644 tests/specs/run/config_types/config_types/deno.lock create mode 100644 tests/specs/run/config_types/config_types/main.out create mode 100644 tests/specs/run/config_types/config_types/main.ts create mode 100644 tests/specs/run/config_types/config_types/remote.tsconfig.json create mode 100644 tests/specs/run/config_types/config_types/tsconfig.json 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 create mode 100644 tests/specs/run/config_types_remote/config_types/main.out 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 create mode 100644 tests/specs/run/custom_inspect_url/custom_inspect_url.js create mode 100644 tests/specs/run/custom_inspect_url/custom_inspect_url.js.out create mode 100644 tests/specs/run/decorators_tc39_proposal/__test__.jsonc create mode 100644 tests/specs/run/decorators_tc39_proposal/decorators/experimental/deno.json create mode 100644 tests/specs/run/decorators_tc39_proposal/decorators/experimental/no_check/main.out create mode 100644 tests/specs/run/decorators_tc39_proposal/decorators/experimental/no_check/main.ts create mode 100644 tests/specs/run/decorators_tc39_proposal/decorators/experimental/runtime/main.out create mode 100644 tests/specs/run/decorators_tc39_proposal/decorators/experimental/runtime/main.ts create mode 100644 tests/specs/run/decorators_tc39_proposal/decorators/experimental/ts/main.out create mode 100644 tests/specs/run/decorators_tc39_proposal/decorators/experimental/ts/main.ts create mode 100644 tests/specs/run/decorators_tc39_proposal/decorators/tc39_proposal/main.out create mode 100644 tests/specs/run/decorators_tc39_proposal/decorators/tc39_proposal/main.ts create mode 100644 tests/specs/run/deno_exit_tampering/__test__.jsonc create mode 100644 tests/specs/run/deno_exit_tampering/deno_exit_tampering.ts create mode 100644 tests/specs/run/deny_all_permission_args/__test__.jsonc create mode 100644 tests/specs/run/deny_all_permission_args/deny_all_permission_args.js create mode 100644 tests/specs/run/deny_all_permission_args/deny_all_permission_args.out create mode 100644 tests/specs/run/deny_some_permission_args/__test__.jsonc create mode 100644 tests/specs/run/deny_some_permission_args/deny_some_permission_args.js create mode 100644 tests/specs/run/deny_some_permission_args/deny_some_permission_args.out create mode 100644 tests/specs/run/dom_exception_formatting/__test__.jsonc create mode 100644 tests/specs/run/dom_exception_formatting/dom_exception_formatting.ts create mode 100644 tests/specs/run/dom_exception_formatting/dom_exception_formatting.ts.out create mode 100644 tests/specs/run/dynamic_import_already_rejected/__test__.jsonc create mode 100644 tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/error_001.ts create mode 100644 tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/main.out create mode 100644 tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/main.ts create mode 100644 tests/specs/run/dynamic_import_async_error/__test__.jsonc create mode 100644 tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/delayed_error.ts create mode 100644 tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/main.out create mode 100644 tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/main.ts create mode 100644 tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/__test__.jsonc create mode 100644 tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/dynamic_import_concurrent_non_statically_analyzable/main.out create mode 100644 tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/dynamic_import_concurrent_non_statically_analyzable/main.ts create mode 100644 tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/dynamic_import_concurrent_non_statically_analyzable/mod.ts create mode 100644 tests/specs/run/dynamic_import_conditional/__test__.jsonc create mode 100644 tests/specs/run/dynamic_import_conditional/dynamic_import_conditional.js create mode 100644 tests/specs/run/dynamic_import_conditional/dynamic_import_conditional.js.out 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 create mode 100644 tests/specs/run/dynamic_import_static_analysis_no_permissions/empty_1.ts create mode 100644 tests/specs/run/dynamic_import_static_analysis_no_permissions/empty_2.ts 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 create mode 100644 tests/specs/run/dynamic_import_syntax_error/dynamic_import_syntax_error.js create mode 100644 tests/specs/run/dynamic_import_syntax_error/dynamic_import_syntax_error.js.out 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 create mode 100644 tests/specs/run/empty_typescript/empty.ts create mode 100644 tests/specs/run/error_001/__test__.jsonc create mode 100644 tests/specs/run/error_001/error_001.ts create mode 100644 tests/specs/run/error_001/error_001.ts.out create mode 100644 tests/specs/run/error_002/__test__.jsonc create mode 100644 tests/specs/run/error_002/error_002.ts create mode 100644 tests/specs/run/error_002/error_002.ts.out 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 create mode 100644 tests/specs/run/error_003_typescript/error_003_typescript.ts create mode 100644 tests/specs/run/error_003_typescript/error_003_typescript.ts.out 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 create mode 100644 tests/specs/run/error_004_missing_module/error_004_missing_module.ts create mode 100644 tests/specs/run/error_004_missing_module/error_004_missing_module.ts.out create mode 100644 tests/specs/run/error_005_missing_dynamic_import/__test__.jsonc create mode 100644 tests/specs/run/error_005_missing_dynamic_import/error_005_missing_dynamic_import.ts create mode 100644 tests/specs/run/error_005_missing_dynamic_import/error_005_missing_dynamic_import.ts.out create mode 100644 tests/specs/run/error_006_import_ext_failure/__test__.jsonc create mode 100644 tests/specs/run/error_006_import_ext_failure/error_006_import_ext_failure.ts create mode 100644 tests/specs/run/error_006_import_ext_failure/error_006_import_ext_failure.ts.out create mode 100644 tests/specs/run/error_007_any/__test__.jsonc create mode 100644 tests/specs/run/error_007_any/error_007_any.ts create mode 100644 tests/specs/run/error_007_any/error_007_any.ts.out create mode 100644 tests/specs/run/error_008_checkjs/__test__.jsonc create mode 100644 tests/specs/run/error_008_checkjs/error_008_checkjs.js create mode 100644 tests/specs/run/error_008_checkjs/error_008_checkjs.js.out create mode 100644 tests/specs/run/error_009_extensions_error/__test__.jsonc create mode 100644 tests/specs/run/error_009_extensions_error/error_009_extensions_error.js create mode 100644 tests/specs/run/error_009_extensions_error/error_009_extensions_error.js.out create mode 100644 tests/specs/run/error_011_bad_module_specifier/__test__.jsonc create mode 100644 tests/specs/run/error_011_bad_module_specifier/error_011_bad_module_specifier.ts create mode 100644 tests/specs/run/error_011_bad_module_specifier/error_011_bad_module_specifier.ts.out create mode 100644 tests/specs/run/error_012_bad_dynamic_import_specifier/__test__.jsonc create mode 100644 tests/specs/run/error_012_bad_dynamic_import_specifier/error_012_bad_dynamic_import_specifier.ts create mode 100644 tests/specs/run/error_012_bad_dynamic_import_specifier/error_012_bad_dynamic_import_specifier.ts.out create mode 100644 tests/specs/run/error_014_catch_dynamic_import_error/__test__.jsonc create mode 100644 tests/specs/run/error_014_catch_dynamic_import_error/error_014_catch_dynamic_import_error.js create mode 100644 tests/specs/run/error_014_catch_dynamic_import_error/error_014_catch_dynamic_import_error.js.out 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 create mode 100644 tests/specs/run/error_015_dynamic_import_permissions/error_015_dynamic_import_permissions.out 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 create mode 100644 tests/specs/run/error_017_hide_long_source_ts/error_017_hide_long_source_ts.ts create mode 100644 tests/specs/run/error_017_hide_long_source_ts/error_017_hide_long_source_ts.ts.out create mode 100644 tests/specs/run/error_018_hide_long_source_js/__test__.jsonc create mode 100644 tests/specs/run/error_018_hide_long_source_js/error_018_hide_long_source_js.js create mode 100644 tests/specs/run/error_018_hide_long_source_js/error_018_hide_long_source_js.js.out create mode 100644 tests/specs/run/error_019_stack_function/__test__.jsonc create mode 100644 tests/specs/run/error_019_stack_function/error_019_stack_function.ts create mode 100644 tests/specs/run/error_019_stack_function/error_019_stack_function.ts.out create mode 100644 tests/specs/run/error_020_stack_constructor/__test__.jsonc create mode 100644 tests/specs/run/error_020_stack_constructor/error_020_stack_constructor.ts create mode 100644 tests/specs/run/error_020_stack_constructor/error_020_stack_constructor.ts.out create mode 100644 tests/specs/run/error_021_stack_method/__test__.jsonc create mode 100644 tests/specs/run/error_021_stack_method/error_021_stack_method.ts create mode 100644 tests/specs/run/error_021_stack_method/error_021_stack_method.ts.out create mode 100644 tests/specs/run/error_022_stack_custom_error/__test__.jsonc create mode 100644 tests/specs/run/error_022_stack_custom_error/error_022_stack_custom_error.ts create mode 100644 tests/specs/run/error_022_stack_custom_error/error_022_stack_custom_error.ts.out create mode 100644 tests/specs/run/error_023_stack_async/__test__.jsonc create mode 100644 tests/specs/run/error_023_stack_async/error_023_stack_async.ts create mode 100644 tests/specs/run/error_023_stack_async/error_023_stack_async.ts.out create mode 100644 tests/specs/run/error_024_stack_promise_all/__test__.jsonc create mode 100644 tests/specs/run/error_024_stack_promise_all/error_024_stack_promise_all.ts create mode 100644 tests/specs/run/error_024_stack_promise_all/error_024_stack_promise_all.ts.out create mode 100644 tests/specs/run/error_025_tab_indent/__test__.jsonc create mode 100644 tests/specs/run/error_025_tab_indent/error_025_tab_indent create mode 100644 tests/specs/run/error_025_tab_indent/error_025_tab_indent.out create mode 100644 tests/specs/run/error_cause/__test__.jsonc create mode 100644 tests/specs/run/error_cause/error_cause.ts create mode 100644 tests/specs/run/error_cause/error_cause.ts.out create mode 100644 tests/specs/run/error_cause_recursive/__test__.jsonc create mode 100644 tests/specs/run/error_cause_recursive/error_cause_recursive.ts create mode 100644 tests/specs/run/error_cause_recursive/error_cause_recursive.ts.out create mode 100644 tests/specs/run/error_cause_recursive_aggregate/__test__.jsonc create mode 100644 tests/specs/run/error_cause_recursive_aggregate/error_cause_recursive_aggregate.ts create mode 100644 tests/specs/run/error_cause_recursive_aggregate/error_cause_recursive_aggregate.ts.out create mode 100644 tests/specs/run/error_cause_recursive_tail/__test__.jsonc create mode 100644 tests/specs/run/error_cause_recursive_tail/error_cause_recursive_tail.ts create mode 100644 tests/specs/run/error_cause_recursive_tail/error_cause_recursive_tail.ts.out create mode 100644 tests/specs/run/error_for_await/__test__.jsonc create mode 100644 tests/specs/run/error_for_await/error_for_await.ts create mode 100644 tests/specs/run/error_for_await/error_for_await.ts.out create mode 100644 tests/specs/run/error_import_map_unable_to_load/__test__.jsonc create mode 100644 tests/specs/run/error_import_map_unable_to_load/error_import_map_unable_to_load.out 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 create mode 100644 tests/specs/run/error_missing_module_named_import/error_missing_module_named_import.ts create mode 100644 tests/specs/run/error_missing_module_named_import/error_missing_module_named_import.ts.out create mode 100644 tests/specs/run/error_name_non_string/__test__.jsonc create mode 100644 tests/specs/run/error_name_non_string/error_name_non_string.js create mode 100644 tests/specs/run/error_name_non_string/error_name_non_string.js.out 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 create mode 100644 tests/specs/run/error_syntax/error_syntax.js create mode 100644 tests/specs/run/error_syntax/error_syntax.js.out create mode 100644 tests/specs/run/error_syntax_empty_trailing_line/__test__.jsonc create mode 100644 tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs create mode 100644 tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs.out create mode 100644 tests/specs/run/error_type_definitions/__test__.jsonc create mode 100644 tests/specs/run/error_type_definitions/error_type_definitions.ts create mode 100644 tests/specs/run/error_type_definitions/error_type_definitions.ts.out 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 create mode 100644 tests/specs/run/error_with_errors_prop/error_with_errors_prop.js create mode 100644 tests/specs/run/error_with_errors_prop/error_with_errors_prop.js.out create mode 100644 tests/specs/run/es_private_fields/__test__.jsonc create mode 100644 tests/specs/run/es_private_fields/es_private_fields.js create mode 100644 tests/specs/run/es_private_fields/es_private_fields.js.out create mode 100644 tests/specs/run/eval_context_throw_dom_exception/__test__.jsonc create mode 100644 tests/specs/run/eval_context_throw_dom_exception/eval_context_throw_dom_exception.js create mode 100644 tests/specs/run/eval_context_throw_dom_exception/eval_context_throw_dom_exception.js.out create mode 100644 tests/specs/run/event_listener_error/__test__.jsonc create mode 100644 tests/specs/run/event_listener_error/event_listener_error.ts create mode 100644 tests/specs/run/event_listener_error/event_listener_error.ts.out create mode 100644 tests/specs/run/event_listener_error_handled/__test__.jsonc create mode 100644 tests/specs/run/event_listener_error_handled/event_listener_error_handled.ts create mode 100644 tests/specs/run/event_listener_error_handled/event_listener_error_handled.ts.out create mode 100644 tests/specs/run/event_listener_error_immediate_exit/__test__.jsonc create mode 100644 tests/specs/run/event_listener_error_immediate_exit/event_listener_error_immediate_exit.ts create mode 100644 tests/specs/run/event_listener_error_immediate_exit/event_listener_error_immediate_exit.ts.out 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 create mode 100644 tests/specs/run/event_listener_error_immediate_exit_worker/event_listener_error_immediate_exit_worker.ts create mode 100644 tests/specs/run/event_listener_error_immediate_exit_worker/event_listener_error_immediate_exit_worker.ts.out create mode 100644 tests/specs/run/exit_error42/__test__.jsonc create mode 100644 tests/specs/run/exit_error42/exit_error42.ts create mode 100644 tests/specs/run/exit_error42/exit_error42.ts.out create mode 100644 tests/specs/run/explicit_resource_management/__test__.jsonc create mode 100644 tests/specs/run/explicit_resource_management/explicit_resource_management/main.out create mode 100644 tests/specs/run/explicit_resource_management/explicit_resource_management/main.ts 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 create mode 100644 tests/specs/run/fetch_async_error_stack/fetch_async_error_stack.ts create mode 100644 tests/specs/run/fetch_async_error_stack/fetch_async_error_stack.ts.out create mode 100644 tests/specs/run/fetch_response_finalization/__test__.jsonc create mode 100644 tests/specs/run/fetch_response_finalization/fetch_response_finalization.js create mode 100644 tests/specs/run/fetch_response_finalization/fetch_response_finalization.js.out create mode 100644 tests/specs/run/finalization_registry/__test__.jsonc create mode 100644 tests/specs/run/finalization_registry/finalization_registry.js create mode 100644 tests/specs/run/finalization_registry/finalization_registry.js.out 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 create mode 100644 tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js create mode 100644 tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js.out 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 create mode 100644 tests/specs/run/fix_emittable_skipped/fix_emittable_skipped.ts.out 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 create mode 100644 tests/specs/run/fix_js_import_js/fix_js_import_js.ts.out 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 create mode 100644 tests/specs/run/fix_js_imports/fix_js_imports.ts.out create mode 100644 tests/specs/run/fix_tsc_file_exists/__test__.jsonc create mode 100644 tests/specs/run/fix_tsc_file_exists/fix_tsc_file_exists.out 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 create mode 100644 tests/specs/run/fix_worker_dispatchevent/fix_worker_dispatchevent.ts create mode 100644 tests/specs/run/fix_worker_dispatchevent/fix_worker_dispatchevent.ts.out create mode 100644 tests/specs/run/followup_dyn_import_resolved/__test__.jsonc create mode 100644 tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/main.ts create mode 100644 tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/main.ts.out 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 create mode 100644 tests/specs/run/heapstats/heapstats.js create mode 100644 tests/specs/run/heapstats/heapstats.js.out 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 create mode 100644 tests/specs/run/https_import/https_import.ts.out create mode 100644 tests/specs/run/https_import/print_hello.ts create mode 100644 tests/specs/run/if_main/__test__.jsonc create mode 100644 tests/specs/run/if_main/if_main.ts 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 create mode 100644 tests/specs/run/import_blob_url/import_blob_url.ts create mode 100644 tests/specs/run/import_blob_url/import_blob_url.ts.out create mode 100644 tests/specs/run/import_blob_url_error_stack/__test__.jsonc create mode 100644 tests/specs/run/import_blob_url_error_stack/import_blob_url_error_stack.ts create mode 100644 tests/specs/run/import_blob_url_error_stack/import_blob_url_error_stack.ts.out create mode 100644 tests/specs/run/import_blob_url_import_relative/__test__.jsonc create mode 100644 tests/specs/run/import_blob_url_import_relative/import_blob_url_import_relative.ts create mode 100644 tests/specs/run/import_blob_url_import_relative/import_blob_url_import_relative.ts.out create mode 100644 tests/specs/run/import_blob_url_imports/__test__.jsonc create mode 100644 tests/specs/run/import_blob_url_imports/import_blob_url_imports.ts create mode 100644 tests/specs/run/import_blob_url_imports/import_blob_url_imports.ts.out create mode 100644 tests/specs/run/import_blob_url_jsx/__test__.jsonc create mode 100644 tests/specs/run/import_blob_url_jsx/import_blob_url_jsx.ts create mode 100644 tests/specs/run/import_blob_url_jsx/import_blob_url_jsx.ts.out 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 create mode 100644 tests/specs/run/import_compression/import_compression/main.out create mode 100644 tests/specs/run/import_compression/import_compression/main.ts create mode 100644 tests/specs/run/import_data_url/__test__.jsonc create mode 100644 tests/specs/run/import_data_url/import_data_url.ts create mode 100644 tests/specs/run/import_data_url/import_data_url.ts.out create mode 100644 tests/specs/run/import_data_url_error_stack/__test__.jsonc create mode 100644 tests/specs/run/import_data_url_error_stack/import_data_url_error_stack.ts create mode 100644 tests/specs/run/import_data_url_error_stack/import_data_url_error_stack.ts.out create mode 100644 tests/specs/run/import_data_url_import_relative/__test__.jsonc create mode 100644 tests/specs/run/import_data_url_import_relative/import_data_url_import_relative.ts create mode 100644 tests/specs/run/import_data_url_import_relative/import_data_url_import_relative.ts.out create mode 100644 tests/specs/run/import_data_url_imports/__test__.jsonc create mode 100644 tests/specs/run/import_data_url_imports/import_data_url_imports.ts create mode 100644 tests/specs/run/import_data_url_imports/import_data_url_imports.ts.out create mode 100644 tests/specs/run/import_data_url_jsx/__test__.jsonc create mode 100644 tests/specs/run/import_data_url_jsx/import_data_url_jsx.ts create mode 100644 tests/specs/run/import_data_url_jsx/import_data_url_jsx.ts.out create mode 100644 tests/specs/run/import_dynamic_data_url/__test__.jsonc create mode 100644 tests/specs/run/import_dynamic_data_url/import_dynamic_data_url.ts create mode 100644 tests/specs/run/import_dynamic_data_url/import_dynamic_data_url.ts.out create mode 100644 tests/specs/run/import_extensionless/__test__.jsonc create mode 100644 tests/specs/run/import_extensionless/import_extensionless.ts create mode 100644 tests/specs/run/import_extensionless/import_extensionless.ts.out create mode 100644 tests/specs/run/import_file_with_colon/__test__.jsonc create mode 100644 tests/specs/run/import_file_with_colon/import_file_with_colon.ts create mode 100644 tests/specs/run/import_file_with_colon/import_file_with_colon.ts.out 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 create mode 100644 tests/specs/run/import_type/import_type.ts.out 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 create mode 100644 tests/specs/run/inline_js_source_map_2/inline_js_source_map_2.js create mode 100644 tests/specs/run/inline_js_source_map_2/inline_js_source_map_2.js.out create mode 100644 tests/specs/run/inline_js_source_map_2_with_inline_contents/__test__.jsonc create mode 100644 tests/specs/run/inline_js_source_map_2_with_inline_contents/inline_js_source_map_2_with_inline_contents.js create mode 100644 tests/specs/run/inline_js_source_map_2_with_inline_contents/inline_js_source_map_2_with_inline_contents.js.out create mode 100644 tests/specs/run/inline_js_source_map_with_contents_from_graph/__test__.jsonc create mode 100644 tests/specs/run/inline_js_source_map_with_contents_from_graph/inline_js_source_map_with_contents_from_graph.js create mode 100644 tests/specs/run/inline_js_source_map_with_contents_from_graph/inline_js_source_map_with_contents_from_graph.js.out 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 create mode 100644 tests/specs/run/js_import_detect/js_import_detect.ts create mode 100644 tests/specs/run/js_import_detect/js_import_detect.ts.out create mode 100644 tests/specs/run/js_root_with_ts_check/__test__.jsonc create mode 100644 tests/specs/run/js_root_with_ts_check/js_root_with_ts_check.js create mode 100644 tests/specs/run/js_root_with_ts_check/js_root_with_ts_check.js.out 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 create mode 100644 tests/specs/run/jsx_import_from_ts/jsx_import_from_ts.ts create mode 100644 tests/specs/run/jsx_import_from_ts/jsx_import_from_ts.ts.out 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 create mode 100644 tests/specs/run/jsx_import_source_error/jsx_import_source_error.out 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 create mode 100644 tests/specs/run/jsx_import_source_no_pragma/jsx_import_source.out 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 create mode 100644 tests/specs/run/jsx_import_source_no_pragma_dev/jsx_import_source_dev.out 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 create mode 100644 tests/specs/run/jsx_import_source_pragma/jsx_import_source_pragma.tsx 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 create mode 100644 tests/specs/run/jsx_import_source_pragma_import_map/jsx_import_source_pragma_import_map.tsx 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 create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/no_pragma.out create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/no_pragma.tsx create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/skip.out create mode 100644 tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/skip.tsx 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 create mode 100644 tests/specs/run/lock_check_ok2/lock_check_ok2.json 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 create mode 100644 tests/specs/run/lock_v2_check_ok2/lock_v2_check_ok2.json create mode 100644 tests/specs/run/long_data_url_formatting/__test__.jsonc create mode 100644 tests/specs/run/long_data_url_formatting/long_data_url_formatting.ts create mode 100644 tests/specs/run/long_data_url_formatting/long_data_url_formatting.ts.out create mode 100644 tests/specs/run/main_module/__test__.jsonc create mode 100644 tests/specs/run/main_module/main_module/main.out create mode 100644 tests/specs/run/main_module/main_module/main.ts create mode 100644 tests/specs/run/main_module/main_module/other.ts 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 create mode 100644 tests/specs/run/mts_dmts_mjs/mts_dmts_mjs.out 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 create mode 100644 tests/specs/run/nested_error/nested_error/main.ts create mode 100644 tests/specs/run/nested_error/nested_error/main.ts.out 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 create mode 100644 tests/specs/run/no_config_auto_discovery_for_local_script/no_auto_discovery.out create mode 100644 tests/specs/run/no_lock_flag/__test__.jsonc create mode 100644 tests/specs/run/no_lock_flag/no_lock_flag/deno.json create mode 100644 tests/specs/run/no_lock_flag/no_lock_flag/deno.lock create mode 100644 tests/specs/run/no_lock_flag/no_lock_flag/main.out create mode 100644 tests/specs/run/no_lock_flag/no_lock_flag/main.ts 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 create mode 100644 tests/specs/run/node_env_var_allowlist/node_env_var_allowlist.ts create mode 100644 tests/specs/run/node_env_var_allowlist/node_env_var_allowlist.ts.out create mode 100644 tests/specs/run/onload/__test__.jsonc create mode 100644 tests/specs/run/onload/deno.json create mode 100644 tests/specs/run/onload/onload/imported.ts create mode 100644 tests/specs/run/onload/onload/main.out create mode 100644 tests/specs/run/onload/onload/main.ts create mode 100644 tests/specs/run/onload/onload/nest_imported.ts create mode 100644 tests/specs/run/op_exit_op_set_exit_code_in_worker/__test__.jsonc create mode 100644 tests/specs/run/op_exit_op_set_exit_code_in_worker/op_exit_op_set_exit_code_in_worker.ts 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 create mode 100644 tests/specs/run/permission_args/permission_args.out 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 create mode 100644 tests/specs/run/private_field_presence/private_field_presence.ts create mode 100644 tests/specs/run/private_field_presence/private_field_presence.ts.out 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 create mode 100644 tests/specs/run/proto_exploit/proto_exploit.js create mode 100644 tests/specs/run/proto_exploit/proto_exploit.js.out create mode 100644 tests/specs/run/queue_microtask_error/__test__.jsonc create mode 100644 tests/specs/run/queue_microtask_error/queue_microtask_error.ts create mode 100644 tests/specs/run/queue_microtask_error/queue_microtask_error.ts.out create mode 100644 tests/specs/run/queue_microtask_error_handled/__test__.jsonc create mode 100644 tests/specs/run/queue_microtask_error_handled/queue_microtask_error_handled.ts create mode 100644 tests/specs/run/queue_microtask_error_handled/queue_microtask_error_handled.ts.out create mode 100644 tests/specs/run/reference_types/__test__.jsonc create mode 100644 tests/specs/run/reference_types/reference_types.ts create mode 100644 tests/specs/run/reference_types/reference_types.ts.out create mode 100644 tests/specs/run/reference_types_error/__test__.jsonc create mode 100644 tests/specs/run/reference_types_error/checkjs.tsconfig.json create mode 100644 tests/specs/run/reference_types_error/reference_types_error.js create mode 100644 tests/specs/run/reference_types_error/reference_types_error.js.out 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 create mode 100644 tests/specs/run/references_types_remote/reference_types_remote.ts create mode 100644 tests/specs/run/references_types_remote/reference_types_remote.ts.out create mode 100644 tests/specs/run/rejection_handled/__test__.jsonc create mode 100644 tests/specs/run/rejection_handled/rejection_handled.out create mode 100644 tests/specs/run/rejection_handled/rejection_handled.ts create mode 100644 tests/specs/run/replace_self/__test__.jsonc create mode 100644 tests/specs/run/replace_self/replace_self.js create mode 100644 tests/specs/run/replace_self/replace_self.js.out create mode 100644 tests/specs/run/report_error/__test__.jsonc create mode 100644 tests/specs/run/report_error/report_error.ts create mode 100644 tests/specs/run/report_error/report_error.ts.out create mode 100644 tests/specs/run/report_error_end_of_program/__test__.jsonc create mode 100644 tests/specs/run/report_error_end_of_program/report_error_end_of_program.ts create mode 100644 tests/specs/run/report_error_end_of_program/report_error_end_of_program.ts.out create mode 100644 tests/specs/run/report_error_handled/__test__.jsonc create mode 100644 tests/specs/run/report_error_handled/report_error_handled.ts create mode 100644 tests/specs/run/report_error_handled/report_error_handled.ts.out 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 create mode 100644 tests/specs/run/seed_random/seed_random.js create mode 100644 tests/specs/run/seed_random/seed_random.js.out create mode 100644 tests/specs/run/set_exit_code_0/__test__.jsonc create mode 100644 tests/specs/run/set_exit_code_0/set_exit_code_0.ts create mode 100644 tests/specs/run/set_exit_code_1/__test__.jsonc create mode 100644 tests/specs/run/set_exit_code_1/set_exit_code_1.ts create mode 100644 tests/specs/run/set_exit_code_2/__test__.jsonc create mode 100644 tests/specs/run/set_exit_code_2/set_exit_code_2.ts create mode 100644 tests/specs/run/set_timeout_error/__test__.jsonc create mode 100644 tests/specs/run/set_timeout_error/set_timeout_error.ts create mode 100644 tests/specs/run/set_timeout_error/set_timeout_error.ts.out create mode 100644 tests/specs/run/set_timeout_error_handled/__test__.jsonc create mode 100644 tests/specs/run/set_timeout_error_handled/set_timeout_error_handled.ts create mode 100644 tests/specs/run/set_timeout_error_handled/set_timeout_error_handled.ts.out create mode 100644 tests/specs/run/shebang_swc/__test__.jsonc create mode 100644 tests/specs/run/shebang_swc/shebang.ts create mode 100644 tests/specs/run/shebang_swc/shebang.ts.out 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 create mode 100644 tests/specs/run/shebang_tsc/shebang.ts.out 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 create mode 100644 tests/specs/run/single_compile_with_reload/single_compile_with_reload.ts create mode 100644 tests/specs/run/single_compile_with_reload/single_compile_with_reload.ts.out 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 create mode 100644 tests/specs/run/spawn_stdout_inherit/spawn_stdout_inherit.ts create mode 100644 tests/specs/run/spawn_stdout_inherit/spawn_stdout_inherit.ts.out create mode 100644 tests/specs/run/stdin_read_all/__test__.jsonc create mode 100644 tests/specs/run/stdin_read_all/stdin_read_all.out create mode 100644 tests/specs/run/stdin_read_all/stdin_read_all.ts create mode 100644 tests/specs/run/stdout_write_all/__test__.jsonc create mode 100644 tests/specs/run/stdout_write_all/stdout_write_all.out create mode 100644 tests/specs/run/stdout_write_all/stdout_write_all.ts create mode 100644 tests/specs/run/stdout_write_sync_async/__test__.jsonc create mode 100644 tests/specs/run/stdout_write_sync_async/stdout_write_sync_async.out create mode 100644 tests/specs/run/stdout_write_sync_async/stdout_write_sync_async.ts create mode 100644 tests/specs/run/swc_syntax_error/__test__.jsonc create mode 100644 tests/specs/run/swc_syntax_error/swc_syntax_error.ts create mode 100644 tests/specs/run/swc_syntax_error/swc_syntax_error.ts.out create mode 100644 tests/specs/run/test_and_bench_are_noops_in_run/__test__.jsonc create mode 100644 tests/specs/run/test_and_bench_are_noops_in_run/test_and_bench_in_run.js 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 create mode 100644 tests/specs/run/tls_connecttls/tls.out create mode 100644 tests/specs/run/tls_connecttls/tls_connecttls.js 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 create mode 100644 tests/specs/run/tls_starttls/tls_starttls.js create mode 100644 tests/specs/run/top_level_await/__test__.jsonc create mode 100644 tests/specs/run/top_level_await/hello.txt create mode 100644 tests/specs/run/top_level_await/top_level_await/circular.js create mode 100644 tests/specs/run/top_level_await/top_level_await/circular.out create mode 100644 tests/specs/run/top_level_await/top_level_await/loop.js create mode 100644 tests/specs/run/top_level_await/top_level_await/loop.out create mode 100644 tests/specs/run/top_level_await/top_level_await/nested.out create mode 100644 tests/specs/run/top_level_await/top_level_await/nested/a.js create mode 100644 tests/specs/run/top_level_await/top_level_await/nested/b.js create mode 100644 tests/specs/run/top_level_await/top_level_await/nested/main.js create mode 100644 tests/specs/run/top_level_await/top_level_await/order.js create mode 100644 tests/specs/run/top_level_await/top_level_await/order.out 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 create mode 100644 tests/specs/run/top_level_await/top_level_await/top_level_await.out create mode 100644 tests/specs/run/top_level_await/top_level_await/top_level_await.ts create mode 100644 tests/specs/run/top_level_await/top_level_await/top_level_for_await.js create mode 100644 tests/specs/run/top_level_await/top_level_await/top_level_for_await.out create mode 100644 tests/specs/run/top_level_await/top_level_await/top_level_for_await.ts create mode 100644 tests/specs/run/top_level_await/top_level_await/unresolved.js create mode 100644 tests/specs/run/top_level_await/top_level_await/unresolved.out 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 create mode 100644 tests/specs/run/top_level_await_circular/top_level_await/top_level_await.js 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 create mode 100644 tests/specs/run/top_level_await_nested/top_level_await/loop.js 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 create mode 100644 tests/specs/run/ts_import_from_js/ts_import_from_js/deps.js create mode 100644 tests/specs/run/ts_import_from_js/ts_import_from_js/main.js create mode 100644 tests/specs/run/ts_import_from_js/ts_import_from_js/main.out create mode 100644 tests/specs/run/ts_type_imports/__test__.jsonc create mode 100644 tests/specs/run/ts_type_imports/ts_type_imports.ts create mode 100644 tests/specs/run/ts_type_imports/ts_type_imports.ts.out 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 create mode 100644 tests/specs/run/ts_type_only_import/ts_type_only_import.ts create mode 100644 tests/specs/run/ts_type_only_import/ts_type_only_import.ts.out 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 create mode 100644 tests/specs/run/tsx_imports/tsx_imports/Component.tsx create mode 100644 tests/specs/run/tsx_imports/tsx_imports/tsx_imports.ts create mode 100644 tests/specs/run/tsx_imports/tsx_imports/tsx_imports.ts.out create mode 100644 tests/specs/run/type_definitions/__test__.jsonc create mode 100644 tests/specs/run/type_definitions/type_definitions.ts create mode 100644 tests/specs/run/type_definitions/type_definitions.ts.out 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 create mode 100644 tests/specs/run/type_definitions_for_export/type_definitions_for_export.ts create mode 100644 tests/specs/run/type_definitions_for_export/type_definitions_for_export.ts.out create mode 100644 tests/specs/run/type_directives_01/__test__.jsonc create mode 100644 tests/specs/run/type_directives_01/type_directives_01.ts create mode 100644 tests/specs/run/type_directives_01/type_directives_01.ts.out 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 create mode 100644 tests/specs/run/type_headers_deno_types/type_headers_deno_types.ts create mode 100644 tests/specs/run/type_headers_deno_types/type_headers_deno_types.ts.out create mode 100644 tests/specs/run/unbuffered_stderr/__test__.jsonc create mode 100644 tests/specs/run/unbuffered_stderr/unbuffered_stderr.ts create mode 100644 tests/specs/run/unbuffered_stderr/unbuffered_stderr.ts.out create mode 100644 tests/specs/run/unbuffered_stdout/__test__.jsonc create mode 100644 tests/specs/run/unbuffered_stdout/unbuffered_stdout.ts create mode 100644 tests/specs/run/unbuffered_stdout/unbuffered_stdout.ts.out create mode 100644 tests/specs/run/unhandled_rejection/__test__.jsonc create mode 100644 tests/specs/run/unhandled_rejection/unhandled_rejection.ts create mode 100644 tests/specs/run/unhandled_rejection/unhandled_rejection.ts.out create mode 100644 tests/specs/run/unhandled_rejection_dynamic_import/__test__.jsonc create mode 100644 tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/import.ts create mode 100644 tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/main.ts create mode 100644 tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/main.ts.out create mode 100644 tests/specs/run/unhandled_rejection_dynamic_import2/__test__.jsonc create mode 100644 tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/import.ts create mode 100644 tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/main.ts create mode 100644 tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/main.ts.out create mode 100644 tests/specs/run/unhandled_rejection_sync_error/__test__.jsonc create mode 100644 tests/specs/run/unhandled_rejection_sync_error/unhandled_rejection_sync_error.ts 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 create mode 100644 tests/specs/run/unsafe_proto/unsafe_proto/main.js create mode 100644 tests/specs/run/unsafe_proto/unsafe_proto/main.out create mode 100644 tests/specs/run/unsafe_proto/unsafe_proto/main_with_unsafe_proto_flag.out create mode 100644 tests/specs/run/unsafe_proto/unsafe_proto/worker.js 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 create mode 100644 tests/specs/run/unstable_broadcast_channel_disabled/unstable_broadcast_channel.disabled.out create mode 100644 tests/specs/run/unstable_broadcast_channel_disabled/unstable_broadcast_channel.js create mode 100644 tests/specs/run/unstable_broadcast_channel_enabled/__test__.jsonc create mode 100644 tests/specs/run/unstable_broadcast_channel_enabled/unstable_broadcast_channel.enabled.out 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 create mode 100644 tests/specs/run/unstable_cron_disabled/unstable_cron.disabled.out create mode 100644 tests/specs/run/unstable_cron_disabled/unstable_cron.js create mode 100644 tests/specs/run/unstable_cron_enabled/__test__.jsonc create mode 100644 tests/specs/run/unstable_cron_enabled/unstable_cron.enabled.out create mode 100644 tests/specs/run/unstable_cron_enabled/unstable_cron.js create mode 100644 tests/specs/run/unstable_kv_disabled/__test__.jsonc create mode 100644 tests/specs/run/unstable_kv_disabled/unstable_kv.disabled.out create mode 100644 tests/specs/run/unstable_kv_disabled/unstable_kv.js create mode 100644 tests/specs/run/unstable_kv_enabled/__test__.jsonc create mode 100644 tests/specs/run/unstable_kv_enabled/unstable_kv.enabled.out create mode 100644 tests/specs/run/unstable_kv_enabled/unstable_kv.js create mode 100644 tests/specs/run/unstable_net_disabled/__test__.jsonc create mode 100644 tests/specs/run/unstable_net_disabled/unstable_net.disabled.out create mode 100644 tests/specs/run/unstable_net_disabled/unstable_net.js create mode 100644 tests/specs/run/unstable_net_enabled/__test__.jsonc create mode 100644 tests/specs/run/unstable_net_enabled/unstable_net.enabled.out create mode 100644 tests/specs/run/unstable_net_enabled/unstable_net.js create mode 100644 tests/specs/run/unstable_worker/__test__.jsonc create mode 100644 tests/specs/run/unstable_worker/unstable_worker.ts create mode 100644 tests/specs/run/unstable_worker/unstable_worker.ts.out create mode 100644 tests/specs/run/unstable_worker/worker_unstable.ts create mode 100644 tests/specs/run/unstable_worker_options_disabled/__test__.jsonc create mode 100644 tests/specs/run/unstable_worker_options_disabled/unstable_worker_options.disabled.out create mode 100644 tests/specs/run/unstable_worker_options_disabled/unstable_worker_options.js create mode 100644 tests/specs/run/unstable_worker_options_enabled/__test__.jsonc create mode 100644 tests/specs/run/unstable_worker_options_enabled/unstable_worker_options.enabled.out 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 create mode 100644 tests/specs/run/unsupported_dynamic_import_scheme/unsupported_dynamic_import_scheme.out create mode 100644 tests/specs/run/v8_flags_env_run/__test__.jsonc create mode 100644 tests/specs/run/v8_flags_env_run/v8_flags.js create mode 100644 tests/specs/run/v8_flags_env_run/v8_flags.js.out 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 create mode 100644 tests/specs/run/v8_flags_unrecognized/v8_flags_unrecognized.out create mode 100644 tests/specs/run/v8_help/__test__.jsonc create mode 100644 tests/specs/run/v8_help/v8_help.out create mode 100644 tests/specs/run/wasm/__test__.jsonc create mode 100644 tests/specs/run/wasm/wasm.ts create mode 100644 tests/specs/run/wasm/wasm.ts.out create mode 100644 tests/specs/run/wasm_async/__test__.jsonc create mode 100644 tests/specs/run/wasm_async/wasm_async.js create mode 100644 tests/specs/run/wasm_async/wasm_async.out create mode 100644 tests/specs/run/wasm_shared/__test__.jsonc create mode 100644 tests/specs/run/wasm_shared/wasm_shared.out create mode 100644 tests/specs/run/wasm_shared/wasm_shared.ts create mode 100644 tests/specs/run/wasm_streaming_panic_test/__test__.jsonc create mode 100644 tests/specs/run/wasm_streaming_panic_test/wasm_streaming_panic_test.js create mode 100644 tests/specs/run/wasm_streaming_panic_test/wasm_streaming_panic_test.js.out create mode 100644 tests/specs/run/wasm_unreachable/__test__.jsonc create mode 100644 tests/specs/run/wasm_unreachable/unreachable.wasm create mode 100644 tests/specs/run/wasm_unreachable/wasm_unreachable.js create mode 100644 tests/specs/run/wasm_unreachable/wasm_unreachable.out create mode 100644 tests/specs/run/wasm_url/__test__.jsonc create mode 100644 tests/specs/run/wasm_url/wasm_url.js create mode 100644 tests/specs/run/wasm_url/wasm_url.out create mode 100644 tests/specs/run/weakref/__test__.jsonc create mode 100644 tests/specs/run/weakref/weakref.ts create mode 100644 tests/specs/run/weakref/weakref.ts.out 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 create mode 100644 tests/specs/run/webstorage_serialization/webstorage/serialization.ts create mode 100644 tests/specs/run/webstorage_serialization/webstorage/serialization.ts.out 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 create mode 100644 tests/specs/run/worker_close_in_wasm_reactions/worker_close_in_wasm_reactions.js create mode 100644 tests/specs/run/worker_close_in_wasm_reactions/worker_close_in_wasm_reactions.js.out 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 create mode 100644 tests/specs/run/worker_close_nested/worker_close_nested.js create mode 100644 tests/specs/run/worker_close_nested/worker_close_nested.js.out create mode 100644 tests/specs/run/worker_close_race/__test__.jsonc create mode 100644 tests/specs/run/worker_close_race/close_race_worker.js create mode 100644 tests/specs/run/worker_close_race/worker_close_race.js 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 create mode 100644 tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js create mode 100644 tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js.out create mode 100644 tests/specs/run/worker_drop_handle_race_terminate/__test__.jsonc create mode 100644 tests/specs/run/worker_drop_handle_race_terminate/worker_drop_handle_race_terminate.js create mode 100644 tests/specs/run/worker_drop_handle_race_terminate/worker_drop_handle_race_terminate.js.out create mode 100644 tests/specs/run/worker_event_handler_test/__test__.jsonc create mode 100644 tests/specs/run/worker_event_handler_test/worker_event_handler_test.js create mode 100644 tests/specs/run/worker_event_handler_test/worker_event_handler_test.js.out 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 create mode 100644 tests/specs/run/worker_message_before_close/worker_message_before_close.js create mode 100644 tests/specs/run/worker_message_before_close/worker_message_before_close.js.out delete mode 100644 tests/testdata/error_cause_recursive_aggregate.ts delete mode 100644 tests/testdata/error_cause_recursive_aggregate.ts.out delete mode 100644 tests/testdata/error_cause_recursive_tail.ts delete mode 100644 tests/testdata/error_cause_recursive_tail.ts.out delete mode 100644 tests/testdata/run/001_hello.js.out delete mode 100644 tests/testdata/run/002_hello.ts.out delete mode 100644 tests/testdata/run/003_relative_import.ts.out delete mode 100644 tests/testdata/run/004_set_timeout.ts delete mode 100644 tests/testdata/run/004_set_timeout.ts.out delete mode 100644 tests/testdata/run/005_more_imports.ts delete mode 100644 tests/testdata/run/005_more_imports.ts.out delete mode 100644 tests/testdata/run/012_async.ts delete mode 100644 tests/testdata/run/012_async.ts.out delete mode 100644 tests/testdata/run/013_dynamic_import.ts.out delete mode 100644 tests/testdata/run/014_duplicate_import.ts delete mode 100644 tests/testdata/run/014_duplicate_import.ts.out delete mode 100644 tests/testdata/run/015_duplicate_parallel_import.js delete mode 100644 tests/testdata/run/015_duplicate_parallel_import.js.out delete mode 100644 tests/testdata/run/016_double_await.ts delete mode 100644 tests/testdata/run/016_double_await.ts.out delete mode 100644 tests/testdata/run/017_import_redirect.ts.out delete mode 100644 tests/testdata/run/017_import_redirect_info.out delete mode 100644 tests/testdata/run/018_async_catch.ts delete mode 100644 tests/testdata/run/018_async_catch.ts.out delete mode 100644 tests/testdata/run/019_media_types.ts.out delete mode 100644 tests/testdata/run/020_json_modules.ts delete mode 100644 tests/testdata/run/020_json_modules.ts.out delete mode 100644 tests/testdata/run/021_mjs_modules.ts delete mode 100644 tests/testdata/run/021_mjs_modules.ts.out delete mode 100644 tests/testdata/run/025_reload_js_type_error.js delete mode 100644 tests/testdata/run/025_reload_js_type_error.js.out delete mode 100644 tests/testdata/run/027_redirect_typescript.ts delete mode 100644 tests/testdata/run/027_redirect_typescript.ts.out delete mode 100644 tests/testdata/run/028_args.ts delete mode 100644 tests/testdata/run/028_args.ts.out delete mode 100644 tests/testdata/run/033_import_map_remote.out delete mode 100644 tests/testdata/run/035_cached_only_flag.out delete mode 100644 tests/testdata/run/038_checkjs.js delete mode 100644 tests/testdata/run/038_checkjs.js.out delete mode 100644 tests/testdata/run/042_dyn_import_evalcontext.ts delete mode 100644 tests/testdata/run/042_dyn_import_evalcontext.ts.out delete mode 100644 tests/testdata/run/044_bad_resource.ts delete mode 100644 tests/testdata/run/044_bad_resource.ts.out delete mode 100644 tests/testdata/run/046_jsx_test.tsx delete mode 100644 tests/testdata/run/046_jsx_test.tsx.out delete mode 100644 tests/testdata/run/047_jsx_test.jsx delete mode 100644 tests/testdata/run/047_jsx_test.jsx.out delete mode 100644 tests/testdata/run/048_media_types_jsx.ts.out delete mode 100644 tests/testdata/run/052_no_remote_flag.out delete mode 100644 tests/testdata/run/058_tasks_microtasks_close.ts delete mode 100644 tests/testdata/run/058_tasks_microtasks_close.ts.out delete mode 100644 tests/testdata/run/059_fs_relative_path_perm.ts delete mode 100644 tests/testdata/run/059_fs_relative_path_perm.ts.out delete mode 100644 tests/testdata/run/063_permissions_revoke.ts delete mode 100644 tests/testdata/run/063_permissions_revoke.ts.out delete mode 100644 tests/testdata/run/063_permissions_revoke_sync.ts delete mode 100644 tests/testdata/run/064_permissions_revoke_global.ts delete mode 100644 tests/testdata/run/064_permissions_revoke_global.ts.out delete mode 100644 tests/testdata/run/064_permissions_revoke_global_sync.ts delete mode 100644 tests/testdata/run/065_permissions_revoke_net.ts delete mode 100644 tests/testdata/run/065_permissions_revoke_net.ts.out delete mode 100644 tests/testdata/run/070_location.ts delete mode 100644 tests/testdata/run/070_location.ts.out delete mode 100644 tests/testdata/run/071_location_unset.ts delete mode 100644 tests/testdata/run/071_location_unset.ts.out delete mode 100644 tests/testdata/run/072_location_relative_fetch.ts delete mode 100644 tests/testdata/run/072_location_relative_fetch.ts.out delete mode 100644 tests/testdata/run/075_import_local_query_hash.ts delete mode 100644 tests/testdata/run/075_import_local_query_hash.ts.out delete mode 100644 tests/testdata/run/077_fetch_empty.ts delete mode 100644 tests/testdata/run/077_fetch_empty.ts.out delete mode 100644 tests/testdata/run/078_unload_on_exit.ts delete mode 100644 tests/testdata/run/078_unload_on_exit.ts.out delete mode 100644 tests/testdata/run/079_location_authentication.ts delete mode 100644 tests/testdata/run/079_location_authentication.ts.out delete mode 100644 tests/testdata/run/081_location_relative_fetch_redirect.ts delete mode 100644 tests/testdata/run/081_location_relative_fetch_redirect.ts.out delete mode 100644 tests/testdata/run/082_prepare_stack_trace_throw.js delete mode 100644 tests/testdata/run/082_prepare_stack_trace_throw.js.out delete mode 100644 tests/testdata/run/088_dynamic_import_already_evaluating.ts delete mode 100644 tests/testdata/run/088_dynamic_import_already_evaluating.ts.out delete mode 100644 tests/testdata/run/091_use_define_for_class_fields.ts delete mode 100644 tests/testdata/run/091_use_define_for_class_fields.ts.out delete mode 100644 tests/testdata/run/aggregate_error.out delete mode 100644 tests/testdata/run/aggregate_error.ts delete mode 100644 tests/testdata/run/async_error.ts delete mode 100644 tests/testdata/run/async_error.ts.out delete mode 100644 tests/testdata/run/before_unload.js delete mode 100644 tests/testdata/run/before_unload.js.out delete mode 100644 tests/testdata/run/blob_gc_finalization.js delete mode 100644 tests/testdata/run/blob_gc_finalization.js.out delete mode 100644 tests/testdata/run/byte_order_mark.out delete mode 100644 tests/testdata/run/byte_order_mark.ts delete mode 100644 tests/testdata/run/check_js_points_to_ts/bar.ts delete mode 100644 tests/testdata/run/check_js_points_to_ts/foo.d.ts delete mode 100644 tests/testdata/run/check_js_points_to_ts/foo.js delete mode 100644 tests/testdata/run/check_js_points_to_ts/test.js delete mode 100644 tests/testdata/run/check_js_points_to_ts/test.js.out delete mode 100644 tests/testdata/run/classic_workers_event_loop.js delete mode 100644 tests/testdata/run/classic_workers_event_loop.js.out delete mode 100644 tests/testdata/run/colors_without_globalThis.js delete mode 100644 tests/testdata/run/complex_error.ts delete mode 100644 tests/testdata/run/complex_error.ts.out delete mode 100644 tests/testdata/run/config/main.out delete mode 100644 tests/testdata/run/config/main.ts delete mode 100644 tests/testdata/run/config/tsconfig.json delete mode 100644 tests/testdata/run/config_json_import.ts delete mode 100644 tests/testdata/run/config_json_import.ts.out delete mode 100644 tests/testdata/run/config_types/main.out delete mode 100644 tests/testdata/run/config_types/main.ts delete mode 100644 tests/testdata/run/config_types/remote.tsconfig.json delete mode 100644 tests/testdata/run/config_types/tsconfig.json delete mode 100644 tests/testdata/run/custom_inspect_url.js delete mode 100644 tests/testdata/run/custom_inspect_url.js.out delete mode 100644 tests/testdata/run/decorators/experimental/deno.json delete mode 100644 tests/testdata/run/decorators/experimental/no_check/main.out delete mode 100644 tests/testdata/run/decorators/experimental/no_check/main.ts delete mode 100644 tests/testdata/run/decorators/experimental/runtime/main.out delete mode 100644 tests/testdata/run/decorators/experimental/runtime/main.ts delete mode 100644 tests/testdata/run/decorators/experimental/ts/main.out delete mode 100644 tests/testdata/run/decorators/experimental/ts/main.ts delete mode 100644 tests/testdata/run/decorators/tc39_proposal/main.out delete mode 100644 tests/testdata/run/decorators/tc39_proposal/main.ts delete mode 100644 tests/testdata/run/deno_exit_tampering.ts delete mode 100644 tests/testdata/run/deny_all_permission_args.js delete mode 100644 tests/testdata/run/deny_all_permission_args.out delete mode 100644 tests/testdata/run/deny_some_permission_args.js delete mode 100644 tests/testdata/run/deny_some_permission_args.out delete mode 100644 tests/testdata/run/dom_exception_formatting.ts delete mode 100644 tests/testdata/run/dom_exception_formatting.ts.out delete mode 100644 tests/testdata/run/dynamic_import_already_rejected/error_001.ts delete mode 100644 tests/testdata/run/dynamic_import_already_rejected/main.out delete mode 100644 tests/testdata/run/dynamic_import_already_rejected/main.ts delete mode 100644 tests/testdata/run/dynamic_import_async_error/delayed_error.ts delete mode 100644 tests/testdata/run/dynamic_import_async_error/main.out delete mode 100644 tests/testdata/run/dynamic_import_async_error/main.ts delete mode 100644 tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/main.out delete mode 100644 tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/main.ts delete mode 100644 tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/mod.ts delete mode 100644 tests/testdata/run/dynamic_import_conditional.js delete mode 100644 tests/testdata/run/dynamic_import_conditional.js.out delete mode 100644 tests/testdata/run/dynamic_import_syntax_error.js delete mode 100644 tests/testdata/run/dynamic_import_syntax_error.js.out delete mode 100644 tests/testdata/run/empty.ts delete mode 100644 tests/testdata/run/error_001.ts.out delete mode 100644 tests/testdata/run/error_002.ts delete mode 100644 tests/testdata/run/error_002.ts.out delete mode 100644 tests/testdata/run/error_003_typescript.ts delete mode 100644 tests/testdata/run/error_003_typescript.ts.out delete mode 100644 tests/testdata/run/error_004_missing_module.ts delete mode 100644 tests/testdata/run/error_004_missing_module.ts.out delete mode 100644 tests/testdata/run/error_005_missing_dynamic_import.ts delete mode 100644 tests/testdata/run/error_005_missing_dynamic_import.ts.out delete mode 100644 tests/testdata/run/error_006_import_ext_failure.ts delete mode 100644 tests/testdata/run/error_006_import_ext_failure.ts.out delete mode 100644 tests/testdata/run/error_007_any.ts delete mode 100644 tests/testdata/run/error_007_any.ts.out delete mode 100644 tests/testdata/run/error_008_checkjs.js delete mode 100644 tests/testdata/run/error_008_checkjs.js.out delete mode 100644 tests/testdata/run/error_009_extensions_error.js delete mode 100644 tests/testdata/run/error_009_extensions_error.js.out delete mode 100644 tests/testdata/run/error_011_bad_module_specifier.ts delete mode 100644 tests/testdata/run/error_011_bad_module_specifier.ts.out delete mode 100644 tests/testdata/run/error_012_bad_dynamic_import_specifier.ts delete mode 100644 tests/testdata/run/error_012_bad_dynamic_import_specifier.ts.out delete mode 100644 tests/testdata/run/error_014_catch_dynamic_import_error.js delete mode 100644 tests/testdata/run/error_014_catch_dynamic_import_error.js.out delete mode 100644 tests/testdata/run/error_015_dynamic_import_permissions.js delete mode 100644 tests/testdata/run/error_015_dynamic_import_permissions.out delete mode 100644 tests/testdata/run/error_017_hide_long_source_ts.ts delete mode 100644 tests/testdata/run/error_017_hide_long_source_ts.ts.out delete mode 100644 tests/testdata/run/error_018_hide_long_source_js.js delete mode 100644 tests/testdata/run/error_018_hide_long_source_js.js.out delete mode 100644 tests/testdata/run/error_019_stack_function.ts delete mode 100644 tests/testdata/run/error_019_stack_function.ts.out delete mode 100644 tests/testdata/run/error_020_stack_constructor.ts delete mode 100644 tests/testdata/run/error_020_stack_constructor.ts.out delete mode 100644 tests/testdata/run/error_021_stack_method.ts delete mode 100644 tests/testdata/run/error_021_stack_method.ts.out delete mode 100644 tests/testdata/run/error_022_stack_custom_error.ts delete mode 100644 tests/testdata/run/error_022_stack_custom_error.ts.out delete mode 100644 tests/testdata/run/error_023_stack_async.ts delete mode 100644 tests/testdata/run/error_023_stack_async.ts.out delete mode 100644 tests/testdata/run/error_024_stack_promise_all.ts delete mode 100644 tests/testdata/run/error_024_stack_promise_all.ts.out delete mode 100644 tests/testdata/run/error_025_tab_indent delete mode 100644 tests/testdata/run/error_025_tab_indent.out delete mode 100644 tests/testdata/run/error_cause.ts delete mode 100644 tests/testdata/run/error_cause.ts.out delete mode 100644 tests/testdata/run/error_cause_recursive.ts delete mode 100644 tests/testdata/run/error_cause_recursive.ts.out delete mode 100644 tests/testdata/run/error_for_await.ts delete mode 100644 tests/testdata/run/error_for_await.ts.out delete mode 100644 tests/testdata/run/error_import_map_unable_to_load.out delete mode 100644 tests/testdata/run/error_missing_module_named_import.ts delete mode 100644 tests/testdata/run/error_missing_module_named_import.ts.out delete mode 100644 tests/testdata/run/error_name_non_string.js delete mode 100644 tests/testdata/run/error_name_non_string.js.out 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_syntax.js delete mode 100644 tests/testdata/run/error_syntax.js.out delete mode 100644 tests/testdata/run/error_syntax_empty_trailing_line.mjs delete mode 100644 tests/testdata/run/error_syntax_empty_trailing_line.mjs.out delete mode 100644 tests/testdata/run/error_type_definitions.ts delete mode 100644 tests/testdata/run/error_type_definitions.ts.out delete mode 100644 tests/testdata/run/error_with_errors_prop.js delete mode 100644 tests/testdata/run/error_with_errors_prop.js.out delete mode 100644 tests/testdata/run/es_private_fields.js delete mode 100644 tests/testdata/run/es_private_fields.js.out delete mode 100644 tests/testdata/run/eval_context_throw_dom_exception.js delete mode 100644 tests/testdata/run/eval_context_throw_dom_exception.js.out delete mode 100644 tests/testdata/run/event_listener_error.ts delete mode 100644 tests/testdata/run/event_listener_error.ts.out delete mode 100644 tests/testdata/run/event_listener_error_handled.ts delete mode 100644 tests/testdata/run/event_listener_error_handled.ts.out delete mode 100644 tests/testdata/run/event_listener_error_immediate_exit.ts delete mode 100644 tests/testdata/run/event_listener_error_immediate_exit.ts.out delete mode 100644 tests/testdata/run/event_listener_error_immediate_exit_worker.ts delete mode 100644 tests/testdata/run/event_listener_error_immediate_exit_worker.ts.out delete mode 100644 tests/testdata/run/exit_error42.ts delete mode 100644 tests/testdata/run/exit_error42.ts.out delete mode 100644 tests/testdata/run/explicit_resource_management/main.out delete mode 100644 tests/testdata/run/explicit_resource_management/main.ts delete mode 100644 tests/testdata/run/fetch_async_error_stack.ts delete mode 100644 tests/testdata/run/fetch_async_error_stack.ts.out delete mode 100644 tests/testdata/run/fetch_response_finalization.js delete mode 100644 tests/testdata/run/fetch_response_finalization.js.out delete mode 100644 tests/testdata/run/finalization_registry.js delete mode 100644 tests/testdata/run/finalization_registry.js.out delete mode 100644 tests/testdata/run/fix_dynamic_import_errors.js delete mode 100644 tests/testdata/run/fix_dynamic_import_errors.js.out delete mode 100644 tests/testdata/run/fix_emittable_skipped.js delete mode 100644 tests/testdata/run/fix_emittable_skipped.ts.out delete mode 100644 tests/testdata/run/fix_js_import_js.ts delete mode 100644 tests/testdata/run/fix_js_import_js.ts.out delete mode 100644 tests/testdata/run/fix_js_imports.ts delete mode 100644 tests/testdata/run/fix_js_imports.ts.out delete mode 100644 tests/testdata/run/fix_tsc_file_exists.out delete mode 100644 tests/testdata/run/fix_worker_dispatchevent.ts delete mode 100644 tests/testdata/run/fix_worker_dispatchevent.ts.out delete mode 100644 tests/testdata/run/followup_dyn_import_resolves/main.ts delete mode 100644 tests/testdata/run/followup_dyn_import_resolves/main.ts.out delete mode 100644 tests/testdata/run/heapstats.js delete mode 100644 tests/testdata/run/heapstats.js.out delete mode 100644 tests/testdata/run/https_import.ts.out delete mode 100644 tests/testdata/run/if_main.ts delete mode 100644 tests/testdata/run/import_blob_url.ts delete mode 100644 tests/testdata/run/import_blob_url.ts.out delete mode 100644 tests/testdata/run/import_blob_url_error_stack.ts delete mode 100644 tests/testdata/run/import_blob_url_error_stack.ts.out delete mode 100644 tests/testdata/run/import_blob_url_import_relative.ts delete mode 100644 tests/testdata/run/import_blob_url_import_relative.ts.out delete mode 100644 tests/testdata/run/import_blob_url_imports.ts delete mode 100644 tests/testdata/run/import_blob_url_imports.ts.out delete mode 100644 tests/testdata/run/import_blob_url_jsx.ts delete mode 100644 tests/testdata/run/import_blob_url_jsx.ts.out delete mode 100644 tests/testdata/run/import_compression/main.out delete mode 100644 tests/testdata/run/import_compression/main.ts delete mode 100644 tests/testdata/run/import_data_url.ts delete mode 100644 tests/testdata/run/import_data_url.ts.out delete mode 100644 tests/testdata/run/import_data_url_error_stack.ts delete mode 100644 tests/testdata/run/import_data_url_error_stack.ts.out delete mode 100644 tests/testdata/run/import_data_url_import_relative.ts delete mode 100644 tests/testdata/run/import_data_url_import_relative.ts.out delete mode 100644 tests/testdata/run/import_data_url_imports.ts delete mode 100644 tests/testdata/run/import_data_url_imports.ts.out delete mode 100644 tests/testdata/run/import_data_url_jsx.ts delete mode 100644 tests/testdata/run/import_data_url_jsx.ts.out delete mode 100644 tests/testdata/run/import_dynamic_data_url.ts delete mode 100644 tests/testdata/run/import_dynamic_data_url.ts.out delete mode 100644 tests/testdata/run/import_extensionless.ts delete mode 100644 tests/testdata/run/import_extensionless.ts.out delete mode 100644 tests/testdata/run/import_file_with_colon.ts delete mode 100644 tests/testdata/run/import_file_with_colon.ts.out delete mode 100644 tests/testdata/run/import_maps/test_data.ts delete mode 100644 tests/testdata/run/import_maps/test_data.ts.out delete mode 100644 tests/testdata/run/import_type.ts delete mode 100644 tests/testdata/run/import_type.ts.out delete mode 100644 tests/testdata/run/inline_js_source_map_2.js delete mode 100644 tests/testdata/run/inline_js_source_map_2.js.out delete mode 100644 tests/testdata/run/inline_js_source_map_2_with_inline_contents.js delete mode 100644 tests/testdata/run/inline_js_source_map_2_with_inline_contents.js.out delete mode 100644 tests/testdata/run/inline_js_source_map_with_contents_from_graph.js delete mode 100644 tests/testdata/run/inline_js_source_map_with_contents_from_graph.js.out delete mode 100644 tests/testdata/run/issue13562.ts delete mode 100644 tests/testdata/run/issue13562.ts.out delete mode 100644 tests/testdata/run/js_import_detect.ts delete mode 100644 tests/testdata/run/js_import_detect.ts.out delete mode 100644 tests/testdata/run/js_root_with_ts_check.js delete mode 100644 tests/testdata/run/js_root_with_ts_check.js.out delete mode 100644 tests/testdata/run/jsx_import_from_ts.ts delete mode 100644 tests/testdata/run/jsx_import_from_ts.ts.out delete mode 100644 tests/testdata/run/jsx_import_source.out delete mode 100644 tests/testdata/run/jsx_import_source_dev.out delete mode 100644 tests/testdata/run/jsx_import_source_error.out delete mode 100644 tests/testdata/run/jsx_import_source_pragma.tsx delete mode 100644 tests/testdata/run/jsx_import_source_pragma_import_map.tsx delete mode 100644 tests/testdata/run/jsx_precompile/no_pragma.out delete mode 100644 tests/testdata/run/jsx_precompile/no_pragma.tsx delete mode 100644 tests/testdata/run/jsx_precompile/skip.out delete mode 100644 tests/testdata/run/jsx_precompile/skip.tsx delete mode 100644 tests/testdata/run/lock_check_ok.json delete mode 100644 tests/testdata/run/lock_check_ok2.json delete mode 100644 tests/testdata/run/lock_v2_check_ok.json delete mode 100644 tests/testdata/run/lock_v2_check_ok2.json delete mode 100644 tests/testdata/run/long_data_url_formatting.ts delete mode 100644 tests/testdata/run/long_data_url_formatting.ts.out delete mode 100644 tests/testdata/run/main_module/main.out delete mode 100644 tests/testdata/run/main_module/main.ts delete mode 100644 tests/testdata/run/main_module/other.ts delete mode 100644 tests/testdata/run/mts_dmts_mjs.out delete mode 100644 tests/testdata/run/nested_error/main.ts delete mode 100644 tests/testdata/run/nested_error/main.ts.out delete mode 100644 tests/testdata/run/no_check_remote.ts.disabled.out delete mode 100644 tests/testdata/run/no_lock_flag/deno.json delete mode 100644 tests/testdata/run/no_lock_flag/deno.lock delete mode 100644 tests/testdata/run/no_lock_flag/main.out delete mode 100644 tests/testdata/run/no_lock_flag/main.ts delete mode 100644 tests/testdata/run/node_env_var_allowlist.ts delete mode 100644 tests/testdata/run/node_env_var_allowlist.ts.out delete mode 100644 tests/testdata/run/onload/imported.ts delete mode 100644 tests/testdata/run/onload/main.out delete mode 100644 tests/testdata/run/onload/main.ts delete mode 100644 tests/testdata/run/onload/nest_imported.ts delete mode 100644 tests/testdata/run/op_exit_op_set_exit_code_in_worker.ts delete mode 100644 tests/testdata/run/permission_args.out delete mode 100644 tests/testdata/run/private_field_presence.ts delete mode 100644 tests/testdata/run/private_field_presence.ts.out delete mode 100644 tests/testdata/run/proto_exploit.js delete mode 100644 tests/testdata/run/proto_exploit.js.out delete mode 100644 tests/testdata/run/queue_microtask_error.ts delete mode 100644 tests/testdata/run/queue_microtask_error.ts.out delete mode 100644 tests/testdata/run/queue_microtask_error_handled.ts delete mode 100644 tests/testdata/run/queue_microtask_error_handled.ts.out delete mode 100644 tests/testdata/run/reference_types.ts delete mode 100644 tests/testdata/run/reference_types.ts.out delete mode 100644 tests/testdata/run/reference_types_error.js delete mode 100644 tests/testdata/run/reference_types_error.js.out delete mode 100644 tests/testdata/run/reference_types_remote.ts delete mode 100644 tests/testdata/run/reference_types_remote.ts.out delete mode 100644 tests/testdata/run/rejection_handled.out delete mode 100644 tests/testdata/run/rejection_handled.ts delete mode 100644 tests/testdata/run/replace_self.js delete mode 100644 tests/testdata/run/replace_self.js.out delete mode 100644 tests/testdata/run/report_error.ts delete mode 100644 tests/testdata/run/report_error.ts.out delete mode 100644 tests/testdata/run/report_error_end_of_program.ts delete mode 100644 tests/testdata/run/report_error_end_of_program.ts.out delete mode 100644 tests/testdata/run/report_error_handled.ts delete mode 100644 tests/testdata/run/report_error_handled.ts.out delete mode 100644 tests/testdata/run/seed_random.js delete mode 100644 tests/testdata/run/seed_random.js.out delete mode 100644 tests/testdata/run/set_exit_code_0.ts delete mode 100644 tests/testdata/run/set_exit_code_1.ts delete mode 100644 tests/testdata/run/set_exit_code_2.ts delete mode 100644 tests/testdata/run/set_timeout_error.ts delete mode 100644 tests/testdata/run/set_timeout_error.ts.out delete mode 100644 tests/testdata/run/set_timeout_error_handled.ts delete mode 100644 tests/testdata/run/set_timeout_error_handled.ts.out delete mode 100644 tests/testdata/run/shebang.ts delete mode 100644 tests/testdata/run/shebang.ts.out delete mode 100644 tests/testdata/run/single_compile_with_reload.ts delete mode 100644 tests/testdata/run/single_compile_with_reload.ts.out delete mode 100644 tests/testdata/run/spawn_stdout_inherit.ts delete mode 100644 tests/testdata/run/spawn_stdout_inherit.ts.out delete mode 100644 tests/testdata/run/stdin_read_all.out delete mode 100644 tests/testdata/run/stdin_read_all.ts delete mode 100644 tests/testdata/run/stdout_write_all.out delete mode 100644 tests/testdata/run/stdout_write_all.ts delete mode 100644 tests/testdata/run/stdout_write_sync_async.out delete mode 100644 tests/testdata/run/stdout_write_sync_async.ts delete mode 100644 tests/testdata/run/swc_syntax_error.ts delete mode 100644 tests/testdata/run/swc_syntax_error.ts.out delete mode 100644 tests/testdata/run/test_and_bench_in_run.js delete mode 100644 tests/testdata/run/tls.out delete mode 100644 tests/testdata/run/tls_connecttls.js delete mode 100644 tests/testdata/run/tls_starttls.js delete mode 100644 tests/testdata/run/top_level_await/circular.js delete mode 100644 tests/testdata/run/top_level_await/circular.out delete mode 100644 tests/testdata/run/top_level_await/loop.js delete mode 100644 tests/testdata/run/top_level_await/loop.out delete mode 100644 tests/testdata/run/top_level_await/nested.out delete mode 100644 tests/testdata/run/top_level_await/nested/a.js delete mode 100644 tests/testdata/run/top_level_await/nested/b.js delete mode 100644 tests/testdata/run/top_level_await/nested/main.js delete mode 100644 tests/testdata/run/top_level_await/order.js delete mode 100644 tests/testdata/run/top_level_await/order.out delete mode 100644 tests/testdata/run/top_level_await/top_level_await.js delete mode 100644 tests/testdata/run/top_level_await/top_level_await.out delete mode 100644 tests/testdata/run/top_level_await/top_level_await.ts delete mode 100644 tests/testdata/run/top_level_await/top_level_for_await.js delete mode 100644 tests/testdata/run/top_level_await/top_level_for_await.out delete mode 100644 tests/testdata/run/top_level_await/top_level_for_await.ts delete mode 100644 tests/testdata/run/top_level_await/unresolved.js delete mode 100644 tests/testdata/run/top_level_await/unresolved.out delete mode 100644 tests/testdata/run/ts_import_from_js/deps.js delete mode 100644 tests/testdata/run/ts_import_from_js/main.js delete mode 100644 tests/testdata/run/ts_import_from_js/main.out delete mode 100644 tests/testdata/run/ts_type_imports.ts delete mode 100644 tests/testdata/run/ts_type_imports.ts.out delete mode 100644 tests/testdata/run/ts_type_only_import.ts delete mode 100644 tests/testdata/run/ts_type_only_import.ts.out delete mode 100644 tests/testdata/run/tsx_imports/Component.tsx delete mode 100644 tests/testdata/run/tsx_imports/tsx_imports.ts delete mode 100644 tests/testdata/run/tsx_imports/tsx_imports.ts.out delete mode 100644 tests/testdata/run/type_definitions.ts delete mode 100644 tests/testdata/run/type_definitions.ts.out delete mode 100644 tests/testdata/run/type_definitions_for_export.ts delete mode 100644 tests/testdata/run/type_definitions_for_export.ts.out delete mode 100644 tests/testdata/run/type_directives_01.ts delete mode 100644 tests/testdata/run/type_directives_01.ts.out 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/type_headers_deno_types.ts delete mode 100644 tests/testdata/run/type_headers_deno_types.ts.out delete mode 100644 tests/testdata/run/unbuffered_stderr.ts delete mode 100644 tests/testdata/run/unbuffered_stderr.ts.out delete mode 100644 tests/testdata/run/unbuffered_stdout.ts delete mode 100644 tests/testdata/run/unbuffered_stdout.ts.out delete mode 100644 tests/testdata/run/unhandled_rejection.ts delete mode 100644 tests/testdata/run/unhandled_rejection.ts.out delete mode 100644 tests/testdata/run/unhandled_rejection_dynamic_import/import.ts delete mode 100644 tests/testdata/run/unhandled_rejection_dynamic_import/main.ts delete mode 100644 tests/testdata/run/unhandled_rejection_dynamic_import/main.ts.out delete mode 100644 tests/testdata/run/unhandled_rejection_dynamic_import2/import.ts delete mode 100644 tests/testdata/run/unhandled_rejection_dynamic_import2/main.ts delete mode 100644 tests/testdata/run/unhandled_rejection_dynamic_import2/main.ts.out delete mode 100644 tests/testdata/run/unhandled_rejection_sync_error.ts delete mode 100644 tests/testdata/run/unhandled_rejection_sync_error.ts.out delete mode 100644 tests/testdata/run/unsafe_proto/main.js delete mode 100644 tests/testdata/run/unsafe_proto/main.out delete mode 100644 tests/testdata/run/unsafe_proto/main_with_unsafe_proto_flag.out delete mode 100644 tests/testdata/run/unsafe_proto/worker.js delete mode 100644 tests/testdata/run/unstable_broadcast_channel.disabled.out delete mode 100644 tests/testdata/run/unstable_broadcast_channel.enabled.out delete mode 100644 tests/testdata/run/unstable_broadcast_channel.js delete mode 100644 tests/testdata/run/unstable_cron.disabled.out delete mode 100644 tests/testdata/run/unstable_cron.enabled.out delete mode 100644 tests/testdata/run/unstable_cron.js delete mode 100644 tests/testdata/run/unstable_kv.disabled.out delete mode 100644 tests/testdata/run/unstable_kv.enabled.out delete mode 100644 tests/testdata/run/unstable_kv.js delete mode 100644 tests/testdata/run/unstable_net.disabled.out delete mode 100644 tests/testdata/run/unstable_net.enabled.out delete mode 100644 tests/testdata/run/unstable_net.js delete mode 100644 tests/testdata/run/unstable_worker.ts delete mode 100644 tests/testdata/run/unstable_worker.ts.out delete mode 100644 tests/testdata/run/unstable_worker_options.disabled.out delete mode 100644 tests/testdata/run/unstable_worker_options.enabled.out delete mode 100644 tests/testdata/run/unstable_worker_options.js delete mode 100644 tests/testdata/run/unsupported_dynamic_import_scheme.out delete mode 100644 tests/testdata/run/v8_flags.js delete mode 100644 tests/testdata/run/v8_flags.js.out delete mode 100644 tests/testdata/run/v8_flags_unrecognized.out delete mode 100644 tests/testdata/run/v8_help.out delete mode 100644 tests/testdata/run/wasm.ts delete mode 100644 tests/testdata/run/wasm.ts.out delete mode 100644 tests/testdata/run/wasm_async.js delete mode 100644 tests/testdata/run/wasm_async.out delete mode 100644 tests/testdata/run/wasm_shared.out delete mode 100644 tests/testdata/run/wasm_shared.ts delete mode 100644 tests/testdata/run/wasm_streaming_panic_test.js delete mode 100644 tests/testdata/run/wasm_streaming_panic_test.js.out delete mode 100644 tests/testdata/run/wasm_unreachable.js delete mode 100644 tests/testdata/run/wasm_unreachable.out delete mode 100644 tests/testdata/run/wasm_url.js delete mode 100644 tests/testdata/run/wasm_url.out delete mode 100644 tests/testdata/run/weakref.ts delete mode 100644 tests/testdata/run/weakref.ts.out delete mode 100644 tests/testdata/run/webstorage/serialization.ts delete mode 100644 tests/testdata/run/webstorage/serialization.ts.out delete mode 100644 tests/testdata/run/with_config/auto_discovery_log.out delete mode 100644 tests/testdata/run/with_config/deno.jsonc delete mode 100644 tests/testdata/run/with_config/frontend_work.ts delete mode 100644 tests/testdata/run/with_config/no_auto_discovery.out delete mode 100644 tests/testdata/run/with_config/server_side_work.ts delete mode 100644 tests/testdata/run/with_package_json/with_stop/main.out delete mode 100644 tests/testdata/run/worker_close_in_wasm_reactions.js delete mode 100644 tests/testdata/run/worker_close_in_wasm_reactions.js.out delete mode 100644 tests/testdata/run/worker_close_nested.js delete mode 100644 tests/testdata/run/worker_close_nested.js.out delete mode 100644 tests/testdata/run/worker_close_race.js delete mode 100644 tests/testdata/run/worker_close_race.js.out delete mode 100644 tests/testdata/run/worker_drop_handle_race.js delete mode 100644 tests/testdata/run/worker_drop_handle_race.js.out delete mode 100644 tests/testdata/run/worker_drop_handle_race_terminate.js delete mode 100644 tests/testdata/run/worker_drop_handle_race_terminate.js.out delete mode 100644 tests/testdata/run/worker_event_handler_test.js delete mode 100644 tests/testdata/run/worker_event_handler_test.js.out delete mode 100644 tests/testdata/run/worker_message_before_close.js delete mode 100644 tests/testdata/run/worker_message_before_close.js.out (limited to 'tests') diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs index a07dd56c8..686fbabcf 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,914 +850,92 @@ 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", +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", exit_code: 1, + http_server: true, }); -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", - exit_code: 1, - 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, - http_server: true, - output: "run/error_local_static_import_from_remote.ts.out", -}); - -itest!(error_local_static_import_from_remote_js { - args: "run --allow-import --reload http://localhost:4545/run/error_local_static_import_from_remote.js", - exit_code: 1, - http_server: true, - 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(); - let output = context - .new_command() - .args("run --reload -L debug --check run/type_directives_js_main.js") - .run(); - output.assert_matches_text("[WILDCARD] - FileFetcher::fetch_no_follow_with_options - specifier: file:///[WILDCARD]/subdir/type_reference.d.ts[WILDCARD]"); - let output = context - .new_command() - .args("run --reload -L debug run/type_directives_js_main.js") - .run(); - assert_not_contains!(output.combined_output(), "type_reference.d.ts"); -} - -itest!(type_directives_redirect { - args: "run --allow-import --reload --check run/type_directives_redirect.ts", - output: "run/type_directives_redirect.ts.out", - 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", - http_server: true, - exit_code: 1, -}); - -itest!(disallow_http_from_https_ts { - args: "run --allow-import --quiet --reload --cert tls/RootCA.pem https://localhost:5545/run/disallow_http_from_https.ts", - output: "run/disallow_http_from_https_ts.out", - http_server: true, - 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", - http_server: true, -}); - -itest!(jsx_import_source_import_map_scoped_dev { - args: "run --allow-import --reload --import-map jsx/import-map-scoped.json --no-lock --config jsx/deno-jsxdev-import-map.jsonc subdir/jsx_import_source_no_pragma.tsx", - output: "run/jsx_import_source_import_map_dev.out", - 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!(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, + http_server: true, + output: "run/error_local_static_import_from_remote.ts.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", +itest!(error_local_static_import_from_remote_js { + args: "run --allow-import --reload http://localhost:4545/run/error_local_static_import_from_remote.js", exit_code: 1, + http_server: true, + output: "run/error_local_static_import_from_remote.js.out", }); -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!(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!(worker_close_nested { - args: "run --quiet --reload --allow-read run/worker_close_nested.js", - output: "run/worker_close_nested.js.out", +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!(worker_message_before_close { - args: "run --quiet --reload --allow-read run/worker_message_before_close.js", - output: "run/worker_message_before_close.js.out", -}); +#[test] +fn type_directives_js_main() { + let context = TestContext::default(); + let output = context + .new_command() + .args("run --reload -L debug --check run/type_directives_js_main.js") + .run(); + output.assert_matches_text("[WILDCARD] - FileFetcher::fetch_no_follow_with_options - specifier: file:///[WILDCARD]/subdir/type_reference.d.ts[WILDCARD]"); + let output = context + .new_command() + .args("run --reload -L debug run/type_directives_js_main.js") + .run(); + assert_not_contains!(output.combined_output(), "type_reference.d.ts"); +} -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!(type_directives_redirect { + args: "run --allow-import --reload --check run/type_directives_redirect.ts", + output: "run/type_directives_redirect.ts.out", + http_server: true, }); -itest!(shebang_tsc { - args: "run --quiet --check run/shebang.ts", - output: "run/shebang.ts.out", +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", + http_server: true, + exit_code: 1, }); -itest!(shebang_swc { - args: "run --quiet run/shebang.ts", - output: "run/shebang.ts.out", +itest!(disallow_http_from_https_ts { + args: "run --allow-import --quiet --reload --cert tls/RootCA.pem https://localhost:5545/run/disallow_http_from_https.ts", + output: "run/disallow_http_from_https_ts.out", + http_server: true, + exit_code: 1, }); -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!(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", + http_server: true, }); -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, +itest!(jsx_import_source_import_map_scoped_dev { + args: "run --allow-import --reload --import-map jsx/import-map-scoped.json --no-lock --config jsx/deno-jsxdev-import-map.jsonc subdir/jsx_import_source_no_pragma.tsx", + output: "run/jsx_import_source_import_map_dev.out", + http_server: true, }); +// 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", +// }); + #[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 000000000..accefceba --- /dev/null +++ b/tests/specs/run/_001_hello/001_hello.js @@ -0,0 +1 @@ +console.log("Hello World"); diff --git a/tests/specs/run/_001_hello/001_hello.js.out b/tests/specs/run/_001_hello/001_hello.js.out new file mode 100644 index 000000000..557db03de --- /dev/null +++ b/tests/specs/run/_001_hello/001_hello.js.out @@ -0,0 +1 @@ +Hello World diff --git a/tests/specs/run/_001_hello/__test__.jsonc b/tests/specs/run/_001_hello/__test__.jsonc new file mode 100644 index 000000000..4fd8126f0 --- /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 000000000..accefceba --- /dev/null +++ b/tests/specs/run/_002_hello/002_hello.ts @@ -0,0 +1 @@ +console.log("Hello World"); diff --git a/tests/specs/run/_002_hello/002_hello.ts.out b/tests/specs/run/_002_hello/002_hello.ts.out new file mode 100644 index 000000000..557db03de --- /dev/null +++ b/tests/specs/run/_002_hello/002_hello.ts.out @@ -0,0 +1 @@ +Hello World diff --git a/tests/specs/run/_002_hello/__test__.jsonc b/tests/specs/run/_002_hello/__test__.jsonc new file mode 100644 index 000000000..dde74d27c --- /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 000000000..d392f4a5d --- /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/specs/run/_003_relative_import/003_relative_import.ts.out b/tests/specs/run/_003_relative_import/003_relative_import.ts.out new file mode 100644 index 000000000..e965047ad --- /dev/null +++ b/tests/specs/run/_003_relative_import/003_relative_import.ts.out @@ -0,0 +1 @@ +Hello 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 000000000..7bed2c00a --- /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 000000000..b9c0ad527 --- /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/specs/run/_004_set_timeout/004_set_timeout.ts b/tests/specs/run/_004_set_timeout/004_set_timeout.ts new file mode 100644 index 000000000..214b25086 --- /dev/null +++ b/tests/specs/run/_004_set_timeout/004_set_timeout.ts @@ -0,0 +1,11 @@ +setTimeout(() => { + console.log("World"); +}, 10); + +console.log("Hello"); + +const id = setTimeout(() => { + console.log("Not printed"); +}, 10000); + +clearTimeout(id); diff --git a/tests/specs/run/_004_set_timeout/004_set_timeout.ts.out b/tests/specs/run/_004_set_timeout/004_set_timeout.ts.out new file mode 100644 index 000000000..f9264f7fb --- /dev/null +++ b/tests/specs/run/_004_set_timeout/004_set_timeout.ts.out @@ -0,0 +1,2 @@ +Hello +World 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 000000000..6904dc093 --- /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/specs/run/_005_more_imports/005_more_imports.ts b/tests/specs/run/_005_more_imports/005_more_imports.ts new file mode 100644 index 000000000..c69556be1 --- /dev/null +++ b/tests/specs/run/_005_more_imports/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/_005_more_imports/005_more_imports.ts.out b/tests/specs/run/_005_more_imports/005_more_imports.ts.out new file mode 100644 index 000000000..e965047ad --- /dev/null +++ b/tests/specs/run/_005_more_imports/005_more_imports.ts.out @@ -0,0 +1 @@ +Hello 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 000000000..159a0265a --- /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 000000000..5e58f432e --- /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 000000000..b9c0ad527 --- /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 000000000..9071d0aeb --- /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 000000000..4036f27ed --- /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 000000000..989ce33e9 --- /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 000000000..50c0379ab --- /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 000000000..b9c0ad527 --- /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 000000000..9071d0aeb --- /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/specs/run/_012_async/012_async.ts b/tests/specs/run/_012_async/012_async.ts new file mode 100644 index 000000000..536197b68 --- /dev/null +++ b/tests/specs/run/_012_async/012_async.ts @@ -0,0 +1,11 @@ +// Check that we can use the async keyword. +async function main() { + await new Promise((resolve) => { + console.log("2"); + setTimeout(resolve, 100); + }); + console.log("3"); +} + +console.log("1"); +main(); diff --git a/tests/specs/run/_012_async/012_async.ts.out b/tests/specs/run/_012_async/012_async.ts.out new file mode 100644 index 000000000..01e79c32a --- /dev/null +++ b/tests/specs/run/_012_async/012_async.ts.out @@ -0,0 +1,3 @@ +1 +2 +3 diff --git a/tests/specs/run/_012_async/__test__.jsonc b/tests/specs/run/_012_async/__test__.jsonc new file mode 100644 index 000000000..2778f0484 --- /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 000000000..5e73b6eb7 --- /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/specs/run/_013_dynamic_import/013_dynamic_import.ts.out b/tests/specs/run/_013_dynamic_import/013_dynamic_import.ts.out new file mode 100644 index 000000000..e965047ad --- /dev/null +++ b/tests/specs/run/_013_dynamic_import/013_dynamic_import.ts.out @@ -0,0 +1 @@ +Hello 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 000000000..8be2c975b --- /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 000000000..5e58f432e --- /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 000000000..b9c0ad527 --- /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 000000000..9071d0aeb --- /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 000000000..b996ca8ae --- /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/specs/run/_014_duplicate_import/014_duplicate_import.ts.out b/tests/specs/run/_014_duplicate_import/014_duplicate_import.ts.out new file mode 100644 index 000000000..4effa19f4 --- /dev/null +++ b/tests/specs/run/_014_duplicate_import/014_duplicate_import.ts.out @@ -0,0 +1 @@ +hello! 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 000000000..7172fc183 --- /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 000000000..5efa72e03 --- /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/specs/run/_015_duplicate_parallel_import/015_duplicate_parallel_import.js b/tests/specs/run/_015_duplicate_parallel_import/015_duplicate_parallel_import.js new file mode 100644 index 000000000..136d80f46 --- /dev/null +++ b/tests/specs/run/_015_duplicate_parallel_import/015_duplicate_parallel_import.js @@ -0,0 +1,20 @@ +// Importing the same module in parallel, the module should only be +// instantiated once. + +const promises = new Array(100) + .fill(null) + .map(() => import("./mod1.ts")); + +Promise.all(promises).then((imports) => { + const mod = imports.reduce((first, cur) => { + if (typeof first !== "object") { + throw new Error("Expected an object."); + } + if (first !== cur) { + throw new Error("More than one instance of the same module."); + } + return first; + }); + + mod.printHello3(); +}); diff --git a/tests/specs/run/_015_duplicate_parallel_import/015_duplicate_parallel_import.js.out b/tests/specs/run/_015_duplicate_parallel_import/015_duplicate_parallel_import.js.out new file mode 100644 index 000000000..e965047ad --- /dev/null +++ b/tests/specs/run/_015_duplicate_parallel_import/015_duplicate_parallel_import.js.out @@ -0,0 +1 @@ +Hello 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 000000000..44fe479e2 --- /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 000000000..5e58f432e --- /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 000000000..b9c0ad527 --- /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 000000000..9071d0aeb --- /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/specs/run/_016_double_await/016_double_await.ts b/tests/specs/run/_016_double_await/016_double_await.ts new file mode 100644 index 000000000..457a53ff3 --- /dev/null +++ b/tests/specs/run/_016_double_await/016_double_await.ts @@ -0,0 +1,8 @@ +// This is to test if Deno would die at 2nd await +// See https://github.com/denoland/deno/issues/919 +(async () => { + const currDirInfo = await Deno.stat("."); + const parentDirInfo = await Deno.stat(".."); + console.log(currDirInfo.isDirectory); + console.log(parentDirInfo.isFile); +})(); diff --git a/tests/specs/run/_016_double_await/016_double_await.ts.out b/tests/specs/run/_016_double_await/016_double_await.ts.out new file mode 100644 index 000000000..da29283aa --- /dev/null +++ b/tests/specs/run/_016_double_await/016_double_await.ts.out @@ -0,0 +1,2 @@ +true +false 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 000000000..9ff202716 --- /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 000000000..1265dd4ed --- /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/specs/run/_017_import_redirect/017_import_redirect.ts.out b/tests/specs/run/_017_import_redirect/017_import_redirect.ts.out new file mode 100644 index 000000000..e965047ad --- /dev/null +++ b/tests/specs/run/_017_import_redirect/017_import_redirect.ts.out @@ -0,0 +1 @@ +Hello 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 000000000..dd5442dcd --- /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 000000000..1265dd4ed --- /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/specs/run/_017_import_redirect_check/017_import_redirect.ts.out b/tests/specs/run/_017_import_redirect_check/017_import_redirect.ts.out new file mode 100644 index 000000000..e965047ad --- /dev/null +++ b/tests/specs/run/_017_import_redirect_check/017_import_redirect.ts.out @@ -0,0 +1 @@ +Hello 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 000000000..dd5442dcd --- /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 000000000..1265dd4ed --- /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/specs/run/_017_import_redirect_info/017_import_redirect_info.out b/tests/specs/run/_017_import_redirect_info/017_import_redirect_info.out new file mode 100644 index 000000000..d1850ccb5 --- /dev/null +++ b/tests/specs/run/_017_import_redirect_info/017_import_redirect_info.out @@ -0,0 +1,7 @@ +local: [WILDCARD]017_import_redirect.ts +type: TypeScript +dependencies: 1 unique +size: 278B + +file:///[WILDCARD]/017_import_redirect.ts ([WILDCARD]) +└── https://gist.githubusercontent.com/ry/f12b2aa3409e6b52645bc346a9e22929/raw/79318f239f51d764384a8bded8d7c6a833610dde/print_hello.ts ([WILDCARD]) 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 000000000..d23e8dd99 --- /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 000000000..1265dd4ed --- /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/specs/run/_017_import_redirect_vendor_dir/017_import_redirect.ts.out b/tests/specs/run/_017_import_redirect_vendor_dir/017_import_redirect.ts.out new file mode 100644 index 000000000..e965047ad --- /dev/null +++ b/tests/specs/run/_017_import_redirect_vendor_dir/017_import_redirect.ts.out @@ -0,0 +1 @@ +Hello 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 000000000..dd5442dcd --- /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/specs/run/_018_async_catch/018_async_catch.ts b/tests/specs/run/_018_async_catch/018_async_catch.ts new file mode 100644 index 000000000..ac43a52e8 --- /dev/null +++ b/tests/specs/run/_018_async_catch/018_async_catch.ts @@ -0,0 +1,14 @@ +function fn(): Promise { + throw new Error("message"); +} +async function call() { + try { + console.log("before await fn()"); + await fn(); + console.log("after await fn()"); + } catch (_error) { + console.log("catch"); + } + console.log("after try-catch"); +} +call().catch(() => console.log("outer catch")); diff --git a/tests/specs/run/_018_async_catch/018_async_catch.ts.out b/tests/specs/run/_018_async_catch/018_async_catch.ts.out new file mode 100644 index 000000000..4fc219973 --- /dev/null +++ b/tests/specs/run/_018_async_catch/018_async_catch.ts.out @@ -0,0 +1,3 @@ +before await fn() +catch +after try-catch 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 000000000..7995c79fd --- /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 000000000..d985bd249 --- /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/specs/run/_019_media_types/019_media_types.ts.out b/tests/specs/run/_019_media_types/019_media_types.ts.out new file mode 100644 index 000000000..b3e94678c --- /dev/null +++ b/tests/specs/run/_019_media_types/019_media_types.ts.out @@ -0,0 +1 @@ +[WILDCARD]success true true true true true true true true 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 000000000..b741a0bf2 --- /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 000000000..bde024cf8 --- /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/specs/run/_020_json_modules/020_json_modules.ts.out b/tests/specs/run/_020_json_modules/020_json_modules.ts.out new file mode 100644 index 000000000..8bf0b4146 --- /dev/null +++ b/tests/specs/run/_020_json_modules/020_json_modules.ts.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]/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 000000000..618616438 --- /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 000000000..01c3b5e79 --- /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 000000000..326fce3e5 --- /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/specs/run/_021_mjs_modules/021_mjs_modules.ts.out b/tests/specs/run/_021_mjs_modules/021_mjs_modules.ts.out new file mode 100644 index 000000000..27ba77dda --- /dev/null +++ b/tests/specs/run/_021_mjs_modules/021_mjs_modules.ts.out @@ -0,0 +1 @@ +true 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 000000000..f02965886 --- /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 000000000..f21d8862b --- /dev/null +++ b/tests/specs/run/_021_mjs_modules/mod5.mjs @@ -0,0 +1 @@ +export const isMod5 = true; diff --git a/tests/specs/run/_025_reload_js_type_error/025_reload_js_type_error.js b/tests/specs/run/_025_reload_js_type_error/025_reload_js_type_error.js new file mode 100644 index 000000000..660626a68 --- /dev/null +++ b/tests/specs/run/_025_reload_js_type_error/025_reload_js_type_error.js @@ -0,0 +1,6 @@ +// deno-lint-ignore-file +// There was a bug where if this was executed with --reload it would throw a +// type error. +globalThis.test = null; +test = console; +test.log("hello"); diff --git a/tests/specs/run/_025_reload_js_type_error/025_reload_js_type_error.js.out b/tests/specs/run/_025_reload_js_type_error/025_reload_js_type_error.js.out new file mode 100644 index 000000000..ce0136250 --- /dev/null +++ b/tests/specs/run/_025_reload_js_type_error/025_reload_js_type_error.js.out @@ -0,0 +1 @@ +hello 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 000000000..ce098f909 --- /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/specs/run/_027_redirect_typescript/027_redirect_typescript.ts b/tests/specs/run/_027_redirect_typescript/027_redirect_typescript.ts new file mode 100644 index 000000000..584341975 --- /dev/null +++ b/tests/specs/run/_027_redirect_typescript/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/027_redirect_typescript.ts.out b/tests/specs/run/_027_redirect_typescript/027_redirect_typescript.ts.out new file mode 100644 index 000000000..480d4e8ca --- /dev/null +++ b/tests/specs/run/_027_redirect_typescript/027_redirect_typescript.ts.out @@ -0,0 +1 @@ +4 imports 1 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 000000000..fca55c9f8 --- /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 000000000..584341975 --- /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 000000000..480d4e8ca --- /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 000000000..f35557907 --- /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 000000000..d674be88c --- /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 000000000..45c65c5eb --- /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 000000000..49cc42e8c --- /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/specs/run/_028_args/028_args.ts b/tests/specs/run/_028_args/028_args.ts new file mode 100644 index 000000000..ec41d52f9 --- /dev/null +++ b/tests/specs/run/_028_args/028_args.ts @@ -0,0 +1,3 @@ +Deno.args.forEach((arg) => { + console.log(arg); +}); diff --git a/tests/specs/run/_028_args/028_args.ts.out b/tests/specs/run/_028_args/028_args.ts.out new file mode 100644 index 000000000..0f1b5c59e --- /dev/null +++ b/tests/specs/run/_028_args/028_args.ts.out @@ -0,0 +1,6 @@ +--arg1 +val1 +--arg2=val2 +-- +arg3 +arg4 diff --git a/tests/specs/run/_028_args/__test__.jsonc b/tests/specs/run/_028_args/__test__.jsonc new file mode 100644 index 000000000..6ab81bf21 --- /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 000000000..400269c75 --- /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 000000000..2ec04ed3c --- /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 000000000..714adae3f --- /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/specs/run/_033_import_map_data_uri/test_data.ts b/tests/specs/run/_033_import_map_data_uri/test_data.ts new file mode 100644 index 000000000..5e8efea69 --- /dev/null +++ b/tests/specs/run/_033_import_map_data_uri/test_data.ts @@ -0,0 +1 @@ +import "test_server/import_maps/lodash/lodash.ts"; diff --git a/tests/specs/run/_033_import_map_data_uri/test_data.ts.out b/tests/specs/run/_033_import_map_data_uri/test_data.ts.out new file mode 100644 index 000000000..da996dc0d --- /dev/null +++ b/tests/specs/run/_033_import_map_data_uri/test_data.ts.out @@ -0,0 +1 @@ +Hello from remapped lodash! diff --git a/tests/specs/run/_033_import_map_remote/033_import_map_remote.out b/tests/specs/run/_033_import_map_remote/033_import_map_remote.out new file mode 100644 index 000000000..804fa0d57 --- /dev/null +++ b/tests/specs/run/_033_import_map_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_remote/__test__.jsonc b/tests/specs/run/_033_import_map_remote/__test__.jsonc new file mode 100644 index 000000000..20c848d49 --- /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 000000000..190fc4f55 --- /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 000000000..2ec04ed3c --- /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 000000000..714adae3f --- /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 000000000..2b54a431e --- /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 000000000..24f3a0226 --- /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 000000000..794257390 --- /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 000000000..206bdbd5f --- /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 000000000..76dbe1917 --- /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 000000000..804fa0d57 --- /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 000000000..4eb3a22c5 --- /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 000000000..190fc4f55 --- /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 000000000..2ec04ed3c --- /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 000000000..714adae3f --- /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 000000000..2b54a431e --- /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 000000000..24f3a0226 --- /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 000000000..794257390 --- /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 000000000..206bdbd5f --- /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 000000000..76dbe1917 --- /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 000000000..d985bd249 --- /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 000000000..aad3f2fbc --- /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 000000000..ac9d01cdd --- /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/specs/run/_038_checkjs/038_checkjs.js b/tests/specs/run/_038_checkjs/038_checkjs.js new file mode 100644 index 000000000..f0856d94c --- /dev/null +++ b/tests/specs/run/_038_checkjs/038_checkjs.js @@ -0,0 +1,5 @@ +// console.log intentionally misspelled to trigger a type error +consol.log("hello world!"); + +// the following error should be ignored and not output to the console +const foo = new Foo(); diff --git a/tests/specs/run/_038_checkjs/038_checkjs.js.out b/tests/specs/run/_038_checkjs/038_checkjs.js.out new file mode 100644 index 000000000..4ea473e4f --- /dev/null +++ b/tests/specs/run/_038_checkjs/038_checkjs.js.out @@ -0,0 +1,22 @@ +[WILDCARD] +error: TS2552 [ERROR]: Cannot find name 'consol'. Did you mean 'console'? +consol.log("hello world!"); +~~~~~~ + at [WILDCARD]/038_checkjs.js:2:1 + + 'console' is declared here. + declare var console: Console; + ~~~~~~~ + at [WILDCARD] + +TS2552 [ERROR]: Cannot find name 'Foo'. Did you mean 'foo'? +const foo = new Foo(); + ~~~ + at [WILDCARD]/038_checkjs.js:5:17 + + 'foo' is declared here. + const foo = new Foo(); + ~~~ + at [WILDCARD]/038_checkjs.js:5:7 + +Found 2 errors. diff --git a/tests/specs/run/_038_checkjs/__test__.jsonc b/tests/specs/run/_038_checkjs/__test__.jsonc new file mode 100644 index 000000000..6915787d2 --- /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 000000000..08ac60b6c --- /dev/null +++ b/tests/specs/run/_038_checkjs/checkjs.tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "checkJs": true + } +} diff --git a/tests/specs/run/_042_dyn_import_evalcontext/042_dyn_import_evalcontext.ts b/tests/specs/run/_042_dyn_import_evalcontext/042_dyn_import_evalcontext.ts new file mode 100644 index 000000000..f39ae2468 --- /dev/null +++ b/tests/specs/run/_042_dyn_import_evalcontext/042_dyn_import_evalcontext.ts @@ -0,0 +1,5 @@ +// @ts-expect-error "Deno[Deno.internal].core" is not a public interface +Deno[Deno.internal].core.evalContext( + "(async () => console.log(await import('./_042_dyn_import_evalcontext/mod4.js')))()", + new URL("..", import.meta.url).href, +); diff --git a/tests/specs/run/_042_dyn_import_evalcontext/042_dyn_import_evalcontext.ts.out b/tests/specs/run/_042_dyn_import_evalcontext/042_dyn_import_evalcontext.ts.out new file mode 100644 index 000000000..89e16b478 --- /dev/null +++ b/tests/specs/run/_042_dyn_import_evalcontext/042_dyn_import_evalcontext.ts.out @@ -0,0 +1 @@ +[Module: null prototype] { isMod4: true } 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 000000000..e3cb0d184 --- /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 000000000..71332dbc4 --- /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 000000000..c76a11eff --- /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/specs/run/_044_bad_resource/044_bad_resource.ts.out b/tests/specs/run/_044_bad_resource/044_bad_resource.ts.out new file mode 100644 index 000000000..c9912711d --- /dev/null +++ b/tests/specs/run/_044_bad_resource/044_bad_resource.ts.out @@ -0,0 +1,2 @@ +[WILDCARD]error: Uncaught[WILDCARD] BadResource: Bad resource ID +[WILDCARD] 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 000000000..cb7832e74 --- /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/specs/run/_046_tsx/046_jsx_test.tsx b/tests/specs/run/_046_tsx/046_jsx_test.tsx new file mode 100644 index 000000000..5ed3ff2fa --- /dev/null +++ b/tests/specs/run/_046_tsx/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/_046_tsx/046_jsx_test.tsx.out b/tests/specs/run/_046_tsx/046_jsx_test.tsx.out new file mode 100644 index 000000000..85cfe824b --- /dev/null +++ b/tests/specs/run/_046_tsx/046_jsx_test.tsx.out @@ -0,0 +1 @@ +{ factory: [Function: View], props: null, children: [] } diff --git a/tests/specs/run/_046_tsx/__test__.jsonc b/tests/specs/run/_046_tsx/__test__.jsonc new file mode 100644 index 000000000..28a48ecec --- /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/specs/run/_047_jsx/047_jsx_test.jsx b/tests/specs/run/_047_jsx/047_jsx_test.jsx new file mode 100644 index 000000000..4c2314072 --- /dev/null +++ b/tests/specs/run/_047_jsx/047_jsx_test.jsx @@ -0,0 +1,7 @@ +const React = { + createElement(factory, props, ...children) { + return { factory, props, children }; + }, +}; +const View = () =>
land
; +console.log(); diff --git a/tests/specs/run/_047_jsx/047_jsx_test.jsx.out b/tests/specs/run/_047_jsx/047_jsx_test.jsx.out new file mode 100644 index 000000000..85cfe824b --- /dev/null +++ b/tests/specs/run/_047_jsx/047_jsx_test.jsx.out @@ -0,0 +1 @@ +{ factory: [Function: View], props: null, children: [] } diff --git a/tests/specs/run/_047_jsx/__test__.jsonc b/tests/specs/run/_047_jsx/__test__.jsonc new file mode 100644 index 000000000..bb89db017 --- /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 000000000..8dcd0ad68 --- /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/specs/run/_048_media_types_jsx/048_media_types_jsx.ts.out b/tests/specs/run/_048_media_types_jsx/048_media_types_jsx.ts.out new file mode 100644 index 000000000..266cc5741 --- /dev/null +++ b/tests/specs/run/_048_media_types_jsx/048_media_types_jsx.ts.out @@ -0,0 +1,2 @@ +[WILDCARD] +success true true true true true true true true 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 000000000..0dec930b0 --- /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 000000000..d985bd249 --- /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/specs/run/_052_no_remote_flag/052_no_remote_flag.out b/tests/specs/run/_052_no_remote_flag/052_no_remote_flag.out new file mode 100644 index 000000000..c1f9f4e13 --- /dev/null +++ b/tests/specs/run/_052_no_remote_flag/052_no_remote_flag.out @@ -0,0 +1 @@ +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 000000000..c8ac477c6 --- /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/specs/run/_058_tasks_microtasks_close/058_tasks_microtasks_close.ts b/tests/specs/run/_058_tasks_microtasks_close/058_tasks_microtasks_close.ts new file mode 100644 index 000000000..df6f85ea0 --- /dev/null +++ b/tests/specs/run/_058_tasks_microtasks_close/058_tasks_microtasks_close.ts @@ -0,0 +1,19 @@ +// deno-lint-ignore-file no-window-prefix +console.log("sync 1"); +setTimeout(() => { + console.log("setTimeout 1"); + Promise.resolve().then(() => { + console.log("Promise resolve in setTimeout 1"); + }); +}); +Promise.resolve().then(() => { + console.log("promise 1"); +}); +globalThis.close(); +console.log("sync 2"); +setTimeout(() => { + console.log("setTimeout 2"); +}); +setTimeout(() => { + console.log("setTimeout 3"); +}, 100); diff --git a/tests/specs/run/_058_tasks_microtasks_close/058_tasks_microtasks_close.ts.out b/tests/specs/run/_058_tasks_microtasks_close/058_tasks_microtasks_close.ts.out new file mode 100644 index 000000000..218273cab --- /dev/null +++ b/tests/specs/run/_058_tasks_microtasks_close/058_tasks_microtasks_close.ts.out @@ -0,0 +1,6 @@ +sync 1 +sync 2 +promise 1 +setTimeout 1 +Promise resolve in setTimeout 1 +setTimeout 2 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 000000000..9eec8f53c --- /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/specs/run/_059_fs_relative_path_perm/059_fs_relative_path_perm.ts b/tests/specs/run/_059_fs_relative_path_perm/059_fs_relative_path_perm.ts new file mode 100644 index 000000000..26630fe1c --- /dev/null +++ b/tests/specs/run/_059_fs_relative_path_perm/059_fs_relative_path_perm.ts @@ -0,0 +1,2 @@ +// The permission error message shouldn't include the CWD. +Deno.readFileSync("non-existent"); diff --git a/tests/specs/run/_059_fs_relative_path_perm/059_fs_relative_path_perm.ts.out b/tests/specs/run/_059_fs_relative_path_perm/059_fs_relative_path_perm.ts.out new file mode 100644 index 000000000..0d0412208 --- /dev/null +++ b/tests/specs/run/_059_fs_relative_path_perm/059_fs_relative_path_perm.ts.out @@ -0,0 +1,4 @@ +[WILDCARD]error: Uncaught (in promise) NotCapable: Requires read access to "non-existent", run again with the --allow-read flag +Deno.readFileSync("non-existent"); + ^ + at [WILDCARD] 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 000000000..04a7b8aa4 --- /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/specs/run/_063_permissions_revoke/063_permissions_revoke.ts b/tests/specs/run/_063_permissions_revoke/063_permissions_revoke.ts new file mode 100644 index 000000000..a81eee7cb --- /dev/null +++ b/tests/specs/run/_063_permissions_revoke/063_permissions_revoke.ts @@ -0,0 +1,6 @@ +const status1 = await Deno.permissions.revoke({ name: "read", path: "foo" }); +console.log(status1); +const status2 = await Deno.permissions.query({ name: "read", path: "bar" }); +console.log(status2); +const status3 = await Deno.permissions.revoke({ name: "read", path: "bar" }); +console.log(status3); diff --git a/tests/specs/run/_063_permissions_revoke/063_permissions_revoke.ts.out b/tests/specs/run/_063_permissions_revoke/063_permissions_revoke.ts.out new file mode 100644 index 000000000..bbd64c557 --- /dev/null +++ b/tests/specs/run/_063_permissions_revoke/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/specs/run/_063_permissions_revoke/__test__.jsonc b/tests/specs/run/_063_permissions_revoke/__test__.jsonc new file mode 100644 index 000000000..1dd5ed747 --- /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 000000000..bbd64c557 --- /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/specs/run/_063_permissions_revoke_sync/063_permissions_revoke_sync.ts b/tests/specs/run/_063_permissions_revoke_sync/063_permissions_revoke_sync.ts new file mode 100644 index 000000000..267ef3785 --- /dev/null +++ b/tests/specs/run/_063_permissions_revoke_sync/063_permissions_revoke_sync.ts @@ -0,0 +1,6 @@ +const status1 = Deno.permissions.revokeSync({ name: "read", path: "foo" }); +console.log(status1); +const status2 = Deno.permissions.querySync({ name: "read", path: "bar" }); +console.log(status2); +const status3 = Deno.permissions.revokeSync({ name: "read", path: "bar" }); +console.log(status3); 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 000000000..8dd9384e3 --- /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/specs/run/_064_permissions_revoke_global/064_permissions_revoke_global.ts b/tests/specs/run/_064_permissions_revoke_global/064_permissions_revoke_global.ts new file mode 100644 index 000000000..a9b1fcd40 --- /dev/null +++ b/tests/specs/run/_064_permissions_revoke_global/064_permissions_revoke_global.ts @@ -0,0 +1,6 @@ +const status1 = await Deno.permissions.revoke({ name: "read" }); +console.log(status1); +const status2 = await Deno.permissions.query({ name: "read", path: "foo" }); +console.log(status2); +const status3 = await Deno.permissions.query({ name: "read", path: "bar" }); +console.log(status3); diff --git a/tests/specs/run/_064_permissions_revoke_global/064_permissions_revoke_global.ts.out b/tests/specs/run/_064_permissions_revoke_global/064_permissions_revoke_global.ts.out new file mode 100644 index 000000000..f7e389a76 --- /dev/null +++ b/tests/specs/run/_064_permissions_revoke_global/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/specs/run/_064_permissions_revoke_global/__test__.jsonc b/tests/specs/run/_064_permissions_revoke_global/__test__.jsonc new file mode 100644 index 000000000..929e48ee8 --- /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 000000000..f7e389a76 --- /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/specs/run/_064_permissions_revoke_global_sync/064_permissions_revoke_global_sync.ts b/tests/specs/run/_064_permissions_revoke_global_sync/064_permissions_revoke_global_sync.ts new file mode 100644 index 000000000..597b1481d --- /dev/null +++ b/tests/specs/run/_064_permissions_revoke_global_sync/064_permissions_revoke_global_sync.ts @@ -0,0 +1,6 @@ +const status1 = Deno.permissions.revokeSync({ name: "read" }); +console.log(status1); +const status2 = Deno.permissions.querySync({ name: "read", path: "foo" }); +console.log(status2); +const status3 = Deno.permissions.querySync({ name: "read", path: "bar" }); +console.log(status3); 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 000000000..8d6f8079d --- /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/specs/run/_065_permissions_revoke_net/065_permissions_revoke_net.ts b/tests/specs/run/_065_permissions_revoke_net/065_permissions_revoke_net.ts new file mode 100644 index 000000000..40c9d413a --- /dev/null +++ b/tests/specs/run/_065_permissions_revoke_net/065_permissions_revoke_net.ts @@ -0,0 +1,6 @@ +const status1 = await Deno.permissions.query({ name: "net" }); +console.log(status1); +const status2 = await Deno.permissions.revoke({ name: "net" }); +console.log(status2); +const status3 = await Deno.permissions.query({ name: "net" }); +console.log(status3); diff --git a/tests/specs/run/_065_permissions_revoke_net/065_permissions_revoke_net.ts.out b/tests/specs/run/_065_permissions_revoke_net/065_permissions_revoke_net.ts.out new file mode 100644 index 000000000..a9c941ecd --- /dev/null +++ b/tests/specs/run/_065_permissions_revoke_net/065_permissions_revoke_net.ts.out @@ -0,0 +1,3 @@ +PermissionStatus { state: "granted", onchange: null } +PermissionStatus { state: "prompt", onchange: null } +PermissionStatus { state: "prompt", onchange: null } 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 000000000..ab66835fd --- /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/specs/run/_070_location/070_location.ts b/tests/specs/run/_070_location/070_location.ts new file mode 100644 index 000000000..05e5abdf1 --- /dev/null +++ b/tests/specs/run/_070_location/070_location.ts @@ -0,0 +1,18 @@ +// deno-lint-ignore-file no-global-assign +console.log(Location); +console.log(Location.prototype); +console.log(location); +try { + location = {}; +} catch (error) { + if (error instanceof Error) { + console.log(error.toString()); + } +} +try { + location.hostname = "bar"; +} catch (error) { + if (error instanceof Error) { + console.log(error.toString()); + } +} diff --git a/tests/specs/run/_070_location/070_location.ts.out b/tests/specs/run/_070_location/070_location.ts.out new file mode 100644 index 000000000..a03cf6477 --- /dev/null +++ b/tests/specs/run/_070_location/070_location.ts.out @@ -0,0 +1,15 @@ +[class Location] +Object [Location] {} +Location { + hash: "#bat", + host: "foo", + hostname: "foo", + href: "https://foo/bar?baz#bat", + origin: "https://foo", + pathname: "/bar", + port: "", + protocol: "https:", + search: "?baz" +} +NotSupportedError: Cannot set "location". +NotSupportedError: Cannot set "location.hostname". diff --git a/tests/specs/run/_070_location/__test__.jsonc b/tests/specs/run/_070_location/__test__.jsonc new file mode 100644 index 000000000..ad92752ea --- /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/specs/run/_071_location_unset/071_location_unset.ts b/tests/specs/run/_071_location_unset/071_location_unset.ts new file mode 100644 index 000000000..f560d2716 --- /dev/null +++ b/tests/specs/run/_071_location_unset/071_location_unset.ts @@ -0,0 +1,16 @@ +console.log(Location); +console.log(Location.prototype); +console.log(location); + +globalThis.location = { + hash: "#bat", + host: "foo", + hostname: "foo", + href: "https://foo/bar?baz#bat", + origin: "https://foo", + pathname: "/bar", + port: "", + protocol: "https:", + search: "?baz", +}; +console.log(location.pathname); diff --git a/tests/specs/run/_071_location_unset/071_location_unset.ts.out b/tests/specs/run/_071_location_unset/071_location_unset.ts.out new file mode 100644 index 000000000..c9482011f --- /dev/null +++ b/tests/specs/run/_071_location_unset/071_location_unset.ts.out @@ -0,0 +1,4 @@ +[class Location] +Object [Location] {} +undefined +/bar 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 000000000..946755cf5 --- /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/specs/run/_072_location_relative_fetch/072_location_relative_fetch.ts b/tests/specs/run/_072_location_relative_fetch/072_location_relative_fetch.ts new file mode 100644 index 000000000..b2a291693 --- /dev/null +++ b/tests/specs/run/_072_location_relative_fetch/072_location_relative_fetch.ts @@ -0,0 +1,2 @@ +const response = await fetch("run/fetch/hello.txt"); +console.log(await response.text()); diff --git a/tests/specs/run/_072_location_relative_fetch/072_location_relative_fetch.ts.out b/tests/specs/run/_072_location_relative_fetch/072_location_relative_fetch.ts.out new file mode 100644 index 000000000..8151f6f88 --- /dev/null +++ b/tests/specs/run/_072_location_relative_fetch/072_location_relative_fetch.ts.out @@ -0,0 +1,2 @@ +[WILDCARD]Hello, world! + 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 000000000..e6e9e4899 --- /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 000000000..af5626b4a --- /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 000000000..accefceba --- /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 000000000..accefceba --- /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/specs/run/_075_import_local_query_hash/075_import_local_query_hash.ts b/tests/specs/run/_075_import_local_query_hash/075_import_local_query_hash.ts new file mode 100644 index 000000000..99c7ceab4 --- /dev/null +++ b/tests/specs/run/_075_import_local_query_hash/075_import_local_query_hash.ts @@ -0,0 +1,2 @@ +import "./001_hello.js?a=b#c"; +import "./002_hello.ts?a=b#c"; diff --git a/tests/specs/run/_075_import_local_query_hash/075_import_local_query_hash.ts.out b/tests/specs/run/_075_import_local_query_hash/075_import_local_query_hash.ts.out new file mode 100644 index 000000000..340777742 --- /dev/null +++ b/tests/specs/run/_075_import_local_query_hash/075_import_local_query_hash.ts.out @@ -0,0 +1,2 @@ +[WILDCARD]Hello World +Hello World 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 000000000..521cd3ea8 --- /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/specs/run/_077_fetch_empty/077_fetch_empty.ts b/tests/specs/run/_077_fetch_empty/077_fetch_empty.ts new file mode 100644 index 000000000..b10a9094e --- /dev/null +++ b/tests/specs/run/_077_fetch_empty/077_fetch_empty.ts @@ -0,0 +1 @@ +await fetch(""); diff --git a/tests/specs/run/_077_fetch_empty/077_fetch_empty.ts.out b/tests/specs/run/_077_fetch_empty/077_fetch_empty.ts.out new file mode 100644 index 000000000..f11e0f563 --- /dev/null +++ b/tests/specs/run/_077_fetch_empty/077_fetch_empty.ts.out @@ -0,0 +1,2 @@ +[WILDCARD]error: Uncaught (in promise) TypeError: Invalid URL: '' +[WILDCARD] 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 000000000..654b10938 --- /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/specs/run/_078_unload_on_exit/078_unload_on_exit.ts b/tests/specs/run/_078_unload_on_exit/078_unload_on_exit.ts new file mode 100644 index 000000000..aaa80c578 --- /dev/null +++ b/tests/specs/run/_078_unload_on_exit/078_unload_on_exit.ts @@ -0,0 +1,9 @@ +globalThis.onunload = () => { + console.log("onunload is called"); + // This second exit call doesn't trigger unload event, + // and therefore actually stops the process. + Deno.exit(1); + console.log("This doesn't show up in console"); +}; +// This exit call triggers the above unload event handler. +Deno.exit(0); diff --git a/tests/specs/run/_078_unload_on_exit/078_unload_on_exit.ts.out b/tests/specs/run/_078_unload_on_exit/078_unload_on_exit.ts.out new file mode 100644 index 000000000..e213f9632 --- /dev/null +++ b/tests/specs/run/_078_unload_on_exit/078_unload_on_exit.ts.out @@ -0,0 +1 @@ +[WILDCARD]onunload is called 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 000000000..4091b7dc9 --- /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/specs/run/_079_location_authentication/079_location_authentication.ts b/tests/specs/run/_079_location_authentication/079_location_authentication.ts new file mode 100644 index 000000000..4989312ac --- /dev/null +++ b/tests/specs/run/_079_location_authentication/079_location_authentication.ts @@ -0,0 +1 @@ +console.log(location.href); diff --git a/tests/specs/run/_079_location_authentication/079_location_authentication.ts.out b/tests/specs/run/_079_location_authentication/079_location_authentication.ts.out new file mode 100644 index 000000000..0dd73f999 --- /dev/null +++ b/tests/specs/run/_079_location_authentication/079_location_authentication.ts.out @@ -0,0 +1 @@ +https://baz/qux 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 000000000..30ba27949 --- /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/specs/run/_081_location_relative_fetch_redirect/081_location_relative_fetch_redirect.ts b/tests/specs/run/_081_location_relative_fetch_redirect/081_location_relative_fetch_redirect.ts new file mode 100644 index 000000000..742ef0afb --- /dev/null +++ b/tests/specs/run/_081_location_relative_fetch_redirect/081_location_relative_fetch_redirect.ts @@ -0,0 +1,2 @@ +const response = await fetch("/"); +console.log(response.url); diff --git a/tests/specs/run/_081_location_relative_fetch_redirect/081_location_relative_fetch_redirect.ts.out b/tests/specs/run/_081_location_relative_fetch_redirect/081_location_relative_fetch_redirect.ts.out new file mode 100644 index 000000000..f62b93195 --- /dev/null +++ b/tests/specs/run/_081_location_relative_fetch_redirect/081_location_relative_fetch_redirect.ts.out @@ -0,0 +1 @@ +[WILDCARD]http://localhost:4545/ 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 000000000..6756bf6d1 --- /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/specs/run/_082_prepare_stack_trace_throw/082_prepare_stack_trace_throw.js b/tests/specs/run/_082_prepare_stack_trace_throw/082_prepare_stack_trace_throw.js new file mode 100644 index 000000000..8137bfdc8 --- /dev/null +++ b/tests/specs/run/_082_prepare_stack_trace_throw/082_prepare_stack_trace_throw.js @@ -0,0 +1,6 @@ +Error.prepareStackTrace = () => { + console.trace(); + throw new Error("foo"); +}; + +new Error("bar").stack; diff --git a/tests/specs/run/_082_prepare_stack_trace_throw/082_prepare_stack_trace_throw.js.out b/tests/specs/run/_082_prepare_stack_trace_throw/082_prepare_stack_trace_throw.js.out new file mode 100644 index 000000000..b6715c749 --- /dev/null +++ b/tests/specs/run/_082_prepare_stack_trace_throw/082_prepare_stack_trace_throw.js.out @@ -0,0 +1,2 @@ +[WILDCARD]error: Uncaught (in promise) Error: foo +[WILDCARD] 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 000000000..41b27e3bd --- /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/specs/run/_088_dynamic_import_already_evaluating/088_dynamic_import_already_evaluating.ts b/tests/specs/run/_088_dynamic_import_already_evaluating/088_dynamic_import_already_evaluating.ts new file mode 100644 index 000000000..272163a5d --- /dev/null +++ b/tests/specs/run/_088_dynamic_import_already_evaluating/088_dynamic_import_already_evaluating.ts @@ -0,0 +1,2 @@ +import("./088_dynamic_import_target.ts").then(() => console.log(3)); +import("./088_dynamic_import_target.ts").then(() => console.log(3)); diff --git a/tests/specs/run/_088_dynamic_import_already_evaluating/088_dynamic_import_already_evaluating.ts.out b/tests/specs/run/_088_dynamic_import_already_evaluating/088_dynamic_import_already_evaluating.ts.out new file mode 100644 index 000000000..a36dd11e7 --- /dev/null +++ b/tests/specs/run/_088_dynamic_import_already_evaluating/088_dynamic_import_already_evaluating.ts.out @@ -0,0 +1,4 @@ +[WILDCARD]1 +2 +3 +3 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 000000000..226f1851a --- /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 000000000..4ce912bf8 --- /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/specs/run/_091_use_define_for_class_fields/091_use_define_for_class_fields.ts b/tests/specs/run/_091_use_define_for_class_fields/091_use_define_for_class_fields.ts new file mode 100644 index 000000000..46be3ac0b --- /dev/null +++ b/tests/specs/run/_091_use_define_for_class_fields/091_use_define_for_class_fields.ts @@ -0,0 +1,4 @@ +class _A { + b = this.a; + constructor(public a: unknown) {} +} diff --git a/tests/specs/run/_091_use_define_for_class_fields/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 new file mode 100644 index 000000000..08f94a967 --- /dev/null +++ b/tests/specs/run/_091_use_define_for_class_fields/091_use_define_for_class_fields.ts.out @@ -0,0 +1,4 @@ +[WILDCARD]error: TS2729 [ERROR]: Property 'a' is used before its initialization. + b = this.a; + ^ +[WILDCARD] 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 000000000..100db44aa --- /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 000000000..e9bd82481 --- /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/specs/run/aggregate_error/aggregate_error.out b/tests/specs/run/aggregate_error/aggregate_error.out new file mode 100644 index 000000000..59c0fb2a5 --- /dev/null +++ b/tests/specs/run/aggregate_error/aggregate_error.out @@ -0,0 +1,18 @@ +AggregateError: Multiple errors. + at [WILDCARD]/aggregate_error.ts:1:24 + +AggregateError: Multiple errors. + Error: Error message 1. + at [WILDCARD]/aggregate_error.ts:2:3 + Error: Error message 2. + at [WILDCARD]/aggregate_error.ts:3:3 + at [WILDCARD]/aggregate_error.ts:1:24 + +error: Uncaught (in promise) AggregateError: Multiple errors. + Error: Error message 1. + at [WILDCARD]/aggregate_error.ts:2:3 + Error: Error message 2. + at [WILDCARD]/aggregate_error.ts:3:3 +const aggregateError = new AggregateError([ + ^ + at [WILDCARD]/aggregate_error.ts:1:24 diff --git a/tests/specs/run/aggregate_error/aggregate_error.ts b/tests/specs/run/aggregate_error/aggregate_error.ts new file mode 100644 index 000000000..ce4b54376 --- /dev/null +++ b/tests/specs/run/aggregate_error/aggregate_error.ts @@ -0,0 +1,9 @@ +const aggregateError = new AggregateError([ + new Error("Error message 1."), + new Error("Error message 2."), +], "Multiple errors."); +console.log(aggregateError.stack); +console.log(); +console.log(aggregateError); +console.log(); +throw aggregateError; diff --git a/tests/specs/run/async_error/__test__.jsonc b/tests/specs/run/async_error/__test__.jsonc new file mode 100644 index 000000000..86c31adac --- /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/specs/run/async_error/async_error.ts b/tests/specs/run/async_error/async_error.ts new file mode 100644 index 000000000..b55c73aeb --- /dev/null +++ b/tests/specs/run/async_error/async_error.ts @@ -0,0 +1,9 @@ +console.log("hello"); +// deno-lint-ignore require-await +const foo = async (): Promise => { + console.log("before error"); + throw Error("error"); +}; + +foo(); +console.log("world"); diff --git a/tests/specs/run/async_error/async_error.ts.out b/tests/specs/run/async_error/async_error.ts.out new file mode 100644 index 000000000..b424f9072 --- /dev/null +++ b/tests/specs/run/async_error/async_error.ts.out @@ -0,0 +1,8 @@ +[WILDCARD]hello +before error +world +error: Uncaught (in promise) Error: error + throw Error("error"); + ^ + at foo ([WILDCARD]/async_error.ts:5:9) + at [WILDCARD]/async_error.ts:8:1 diff --git a/tests/specs/run/beforeunload_event/__test__.jsonc b/tests/specs/run/beforeunload_event/__test__.jsonc new file mode 100644 index 000000000..01c7e7007 --- /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/specs/run/beforeunload_event/before_unload.js b/tests/specs/run/beforeunload_event/before_unload.js new file mode 100644 index 000000000..2572e512b --- /dev/null +++ b/tests/specs/run/beforeunload_event/before_unload.js @@ -0,0 +1,21 @@ +let count = 0; + +console.log("0"); + +globalThis.addEventListener("beforeunload", (e) => { + console.log("GOT EVENT"); + if (count === 0 || count === 1) { + e.preventDefault(); + setTimeout(() => { + console.log("3"); + }, 100); + } + + count++; +}); + +console.log("1"); + +setTimeout(() => { + console.log("2"); +}, 100); diff --git a/tests/specs/run/beforeunload_event/before_unload.js.out b/tests/specs/run/beforeunload_event/before_unload.js.out new file mode 100644 index 000000000..f1f2ab49a --- /dev/null +++ b/tests/specs/run/beforeunload_event/before_unload.js.out @@ -0,0 +1,8 @@ +0 +1 +2 +GOT EVENT +3 +GOT EVENT +3 +GOT EVENT 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 000000000..20a8128fc --- /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/specs/run/blob_gc_finalization/blob_gc_finalization.js b/tests/specs/run/blob_gc_finalization/blob_gc_finalization.js new file mode 100644 index 000000000..c721e6b45 --- /dev/null +++ b/tests/specs/run/blob_gc_finalization/blob_gc_finalization.js @@ -0,0 +1,11 @@ +// This test creates 128 blobs of 128 MB each. This will only work if the blobs +// and their backing data is GCed as expected. +for (let i = 0; i < 128; i++) { + // Create a 128MB byte array, and then a blob from it. + const buf = new Uint8Array(128 * 1024 * 1024); + new Blob([buf]); + // It is very important that there is a yield here, otherwise the finalizer + // for the blob is not called and the memory is not freed. + await new Promise((resolve) => setTimeout(resolve, 0)); +} +console.log("GCed all blobs"); diff --git a/tests/specs/run/blob_gc_finalization/blob_gc_finalization.js.out b/tests/specs/run/blob_gc_finalization/blob_gc_finalization.js.out new file mode 100644 index 000000000..dcc4500f8 --- /dev/null +++ b/tests/specs/run/blob_gc_finalization/blob_gc_finalization.js.out @@ -0,0 +1 @@ +GCed all blobs 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 000000000..accefceba --- /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 000000000..f47cb7d02 --- /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/specs/run/byte_order_mark/byte_order_mark.out b/tests/specs/run/byte_order_mark/byte_order_mark.out new file mode 100644 index 000000000..557db03de --- /dev/null +++ b/tests/specs/run/byte_order_mark/byte_order_mark.out @@ -0,0 +1 @@ +Hello World diff --git a/tests/specs/run/byte_order_mark/byte_order_mark.ts b/tests/specs/run/byte_order_mark/byte_order_mark.ts new file mode 100644 index 000000000..71da3e1e9 --- /dev/null +++ b/tests/specs/run/byte_order_mark/byte_order_mark.ts @@ -0,0 +1,4 @@ +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 000000000..a63b9e5a4 --- /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/specs/run/check_js_points_to_ts/check_js_points_to_ts/bar.ts b/tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/bar.ts new file mode 100644 index 000000000..026cd2f1e --- /dev/null +++ b/tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/bar.ts @@ -0,0 +1,3 @@ +export function bar(): string { + return 42; +} diff --git a/tests/specs/run/check_js_points_to_ts/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 new file mode 100644 index 000000000..e69de29bb diff --git a/tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/foo.js b/tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/foo.js new file mode 100644 index 000000000..9ac1a14ff --- /dev/null +++ b/tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/foo.js @@ -0,0 +1,4 @@ +import { bar } from "./bar.ts"; +export function foo() { + bar(); +} diff --git a/tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/test.js b/tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/test.js new file mode 100644 index 000000000..00d894451 --- /dev/null +++ b/tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/test.js @@ -0,0 +1,3 @@ +// @deno-types="./foo.d.ts" +import { foo } from "./foo.js"; +foo(); diff --git a/tests/specs/run/check_js_points_to_ts/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 new file mode 100644 index 000000000..67cda9a65 --- /dev/null +++ b/tests/specs/run/check_js_points_to_ts/check_js_points_to_ts/test.js.out @@ -0,0 +1,4 @@ +error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. + return 42; + ~~~~~~ + at [WILDCARD] 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 000000000..08ac60b6c --- /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 000000000..6543e61b3 --- /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 000000000..f42dadf8a --- /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/specs/run/check_remote/no_check_remote.ts.disabled.out b/tests/specs/run/check_remote/no_check_remote.ts.disabled.out new file mode 100644 index 000000000..06c046072 --- /dev/null +++ b/tests/specs/run/check_remote/no_check_remote.ts.disabled.out @@ -0,0 +1,4 @@ +error: TS2322 [ERROR]: Type '12' is not assignable to type '"a"'. +export const a: "a" = 12; + ^ + 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 000000000..cc3c1d29d --- /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 000000000..44ea36bdc --- /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/specs/run/classic_workers_event_loop/classic_workers_event_loop.js b/tests/specs/run/classic_workers_event_loop/classic_workers_event_loop.js new file mode 100644 index 000000000..810a6df7f --- /dev/null +++ b/tests/specs/run/classic_workers_event_loop/classic_workers_event_loop.js @@ -0,0 +1,4 @@ +new Worker( + "data:application/javascript,setTimeout(() => {console.log('done'); self.close()}, 1000)", + { type: "classic" }, +); diff --git a/tests/specs/run/classic_workers_event_loop/classic_workers_event_loop.js.out b/tests/specs/run/classic_workers_event_loop/classic_workers_event_loop.js.out new file mode 100644 index 000000000..19f86f493 --- /dev/null +++ b/tests/specs/run/classic_workers_event_loop/classic_workers_event_loop.js.out @@ -0,0 +1 @@ +done 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 000000000..1d2f1c1cf --- /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/specs/run/colors_without_global_this/colors_without_globalThis.js b/tests/specs/run/colors_without_global_this/colors_without_globalThis.js new file mode 100644 index 000000000..f9d4b68fc --- /dev/null +++ b/tests/specs/run/colors_without_global_this/colors_without_globalThis.js @@ -0,0 +1 @@ +console.log(delete globalThis.globalThis); diff --git a/tests/specs/run/complex_error/__test__.jsonc b/tests/specs/run/complex_error/__test__.jsonc new file mode 100644 index 000000000..2f7274be4 --- /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/specs/run/complex_error/complex_error.ts b/tests/specs/run/complex_error/complex_error.ts new file mode 100644 index 000000000..b462992ac --- /dev/null +++ b/tests/specs/run/complex_error/complex_error.ts @@ -0,0 +1,18 @@ +const error = new AggregateError( + [ + new AggregateError([new Error("qux1"), new Error("quux1")]), + new Error("bar1", { cause: new Error("baz1") }), + ], + "foo1", + { + cause: new AggregateError([ + new AggregateError([new Error("qux2"), new Error("quux2")]), + new Error("bar2", { cause: new Error("baz2") }), + ], "foo2"), + }, +); +console.log(error.stack); +console.log(); +console.log(error); +console.log(); +throw error; diff --git a/tests/specs/run/complex_error/complex_error.ts.out b/tests/specs/run/complex_error/complex_error.ts.out new file mode 100644 index 000000000..3c3c26eaf --- /dev/null +++ b/tests/specs/run/complex_error/complex_error.ts.out @@ -0,0 +1,44 @@ +AggregateError: foo1 + at [WILDCARD]/complex_error.ts:1:15 + +AggregateError: foo1 + AggregateError + Error: qux1 + at [WILDCARD]/complex_error.ts:3:25 + Error: quux1 + at [WILDCARD]/complex_error.ts:3:44 + at [WILDCARD]/complex_error.ts:3:5 + Error: bar1 + at [WILDCARD]/complex_error.ts:4:5 + Caused by Error: baz1 + at [WILDCARD]/complex_error.ts:4:32 + at [WILDCARD]/complex_error.ts:1:15 +Caused by AggregateError: foo2 + at [WILDCARD]/complex_error.ts:8:12 + +error: Uncaught (in promise) AggregateError: foo1 + AggregateError + Error: qux1 + at [WILDCARD]/complex_error.ts:3:25 + Error: quux1 + at [WILDCARD]/complex_error.ts:3:44 + at [WILDCARD]/complex_error.ts:3:5 + Error: bar1 + at [WILDCARD]/complex_error.ts:4:5 + Caused by: Error: baz1 + at [WILDCARD]/complex_error.ts:4:32 +const error = new AggregateError( + ^ + at [WILDCARD]/complex_error.ts:1:15 +Caused by: AggregateError: foo2 + AggregateError + Error: qux2 + at [WILDCARD]/complex_error.ts:9:27 + Error: quux2 + at [WILDCARD]/complex_error.ts:9:46 + at [WILDCARD]/complex_error.ts:9:7 + Error: bar2 + at [WILDCARD]/complex_error.ts:10:7 + Caused by: Error: baz2 + at [WILDCARD]/complex_error.ts:10:34 + at [WILDCARD]/complex_error.ts:8:12 diff --git a/tests/specs/run/config/__test__.jsonc b/tests/specs/run/config/__test__.jsonc new file mode 100644 index 000000000..59d3ae5fc --- /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/specs/run/config/config/main.out b/tests/specs/run/config/config/main.out new file mode 100644 index 000000000..277314807 --- /dev/null +++ b/tests/specs/run/config/config/main.out @@ -0,0 +1,4 @@ +[WILDCARD]Unsupported compiler options in "[WILDCARD]tsconfig.json". + The following options were ignored: + module, target +Check [WILDCARD]/main.ts diff --git a/tests/specs/run/config/config/main.ts b/tests/specs/run/config/config/main.ts new file mode 100644 index 000000000..51a61e447 --- /dev/null +++ b/tests/specs/run/config/config/main.ts @@ -0,0 +1,5 @@ +function foo(bar) { + return bar; +} + +foo(1); diff --git a/tests/specs/run/config/config/tsconfig.json b/tests/specs/run/config/config/tsconfig.json new file mode 100644 index 000000000..0f0881920 --- /dev/null +++ b/tests/specs/run/config/config/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "module": "amd", + "strict": false, + "target": "es5" + } +} 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 000000000..bd2a77ab1 --- /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/specs/run/config_auto_discovered_for_local_script/frontend_work.ts b/tests/specs/run/config_auto_discovered_for_local_script/frontend_work.ts new file mode 100644 index 000000000..783af44e4 --- /dev/null +++ b/tests/specs/run/config_auto_discovered_for_local_script/frontend_work.ts @@ -0,0 +1,4 @@ +function _main() { + console.log(document); +} +console.log("ok"); 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 000000000..5182cc958 --- /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/specs/run/config_auto_discovered_for_local_script_log/auto_discovery_log.out b/tests/specs/run/config_auto_discovered_for_local_script_log/auto_discovery_log.out new file mode 100644 index 000000000..1a25eb9a7 --- /dev/null +++ b/tests/specs/run/config_auto_discovered_for_local_script_log/auto_discovery_log.out @@ -0,0 +1,4 @@ +DEBUG RS - [WILDCARD] - Config file found at '[WILDCARD]deno.jsonc' +[WILDCARD] +ok +[WILDCARD] diff --git a/tests/specs/run/config_auto_discovered_for_local_script_log/deno.jsonc b/tests/specs/run/config_auto_discovered_for_local_script_log/deno.jsonc new file mode 100644 index 000000000..9017fac30 --- /dev/null +++ b/tests/specs/run/config_auto_discovered_for_local_script_log/deno.jsonc @@ -0,0 +1,6 @@ +{ + // type settings for frontend dev + "compilerOptions": { + "lib": ["esnext", "dom"] + } +} 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 000000000..783af44e4 --- /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 000000000..6ef632ff8 --- /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 000000000..4a772fac3 --- /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/specs/run/config_json_import/config_json_import.ts.out b/tests/specs/run/config_json_import/config_json_import.ts.out new file mode 100644 index 000000000..aa55be7d5 --- /dev/null +++ b/tests/specs/run/config_json_import/config_json_import.ts.out @@ -0,0 +1,3 @@ +{ + compilerOptions: { jsx: "react-jsx", jsxImportSource: "http://localhost:4545/jsx" } +} 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 000000000..311409ea3 --- /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 000000000..e6ccc02ac --- /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/specs/run/config_not_auto_discovered_for_remote_script/server_side_work.ts b/tests/specs/run/config_not_auto_discovered_for_remote_script/server_side_work.ts new file mode 100644 index 000000000..12db2ab05 --- /dev/null +++ b/tests/specs/run/config_not_auto_discovered_for_remote_script/server_side_work.ts @@ -0,0 +1,2 @@ +const _ = Deno.build.os; +console.log("ok"); diff --git a/tests/specs/run/config_types/__test__.jsonc b/tests/specs/run/config_types/__test__.jsonc new file mode 100644 index 000000000..d803915c7 --- /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 000000000..157bd98a2 --- /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/specs/run/config_types/config_types/main.out b/tests/specs/run/config_types/config_types/main.out new file mode 100644 index 000000000..417b7b537 --- /dev/null +++ b/tests/specs/run/config_types/config_types/main.out @@ -0,0 +1 @@ +undefined diff --git a/tests/specs/run/config_types/config_types/main.ts b/tests/specs/run/config_types/config_types/main.ts new file mode 100644 index 000000000..f1a8d6583 --- /dev/null +++ b/tests/specs/run/config_types/config_types/main.ts @@ -0,0 +1 @@ +console.log(globalThis.a); diff --git a/tests/specs/run/config_types/config_types/remote.tsconfig.json b/tests/specs/run/config_types/config_types/remote.tsconfig.json new file mode 100644 index 000000000..255ff5def --- /dev/null +++ b/tests/specs/run/config_types/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/config_types/tsconfig.json b/tests/specs/run/config_types/config_types/tsconfig.json new file mode 100644 index 000000000..85f1549e0 --- /dev/null +++ b/tests/specs/run/config_types/config_types/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "types": [ + "./types.d.ts" + ] + } +} 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 000000000..536a6d0a6 --- /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 000000000..87457ace2 --- /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 000000000..157bd98a2 --- /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/specs/run/config_types_remote/config_types/main.out b/tests/specs/run/config_types_remote/config_types/main.out new file mode 100644 index 000000000..417b7b537 --- /dev/null +++ b/tests/specs/run/config_types_remote/config_types/main.out @@ -0,0 +1 @@ +undefined 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 000000000..f1a8d6583 --- /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 000000000..255ff5def --- /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 000000000..85f1549e0 --- /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 000000000..536a6d0a6 --- /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 000000000..1c1c2b9c4 --- /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/specs/run/custom_inspect_url/custom_inspect_url.js b/tests/specs/run/custom_inspect_url/custom_inspect_url.js new file mode 100644 index 000000000..69aa2dc49 --- /dev/null +++ b/tests/specs/run/custom_inspect_url/custom_inspect_url.js @@ -0,0 +1,3 @@ +console.log([new URL("https://example.com/path")]); +console.log({ url: new URL("https://example.com/path") }); +console.log({ url: [new URL("https://example.com/path")] }); diff --git a/tests/specs/run/custom_inspect_url/custom_inspect_url.js.out b/tests/specs/run/custom_inspect_url/custom_inspect_url.js.out new file mode 100644 index 000000000..1c714e34e --- /dev/null +++ b/tests/specs/run/custom_inspect_url/custom_inspect_url.js.out @@ -0,0 +1,47 @@ +[ + URL { + href: "https://example.com/path", + origin: "https://example.com", + protocol: "https:", + username: "", + password: "", + host: "example.com", + hostname: "example.com", + port: "", + pathname: "/path", + hash: "", + search: "" + } +] +{ + url: URL { + href: "https://example.com/path", + origin: "https://example.com", + protocol: "https:", + username: "", + password: "", + host: "example.com", + hostname: "example.com", + port: "", + pathname: "/path", + hash: "", + search: "" + } +} +{ + url: [ + URL { + href: "https://example.com/path", + origin: "https://example.com", + protocol: "https:", + username: "", + password: "", + host: "example.com", + hostname: "example.com", + port: "", + pathname: "/path", + hash: "", + search: "" + } + ] +} 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 000000000..8e529695d --- /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/specs/run/decorators_tc39_proposal/decorators/experimental/deno.json b/tests/specs/run/decorators_tc39_proposal/decorators/experimental/deno.json new file mode 100644 index 000000000..504cd646e --- /dev/null +++ b/tests/specs/run/decorators_tc39_proposal/decorators/experimental/deno.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "experimentalDecorators": true + } +} diff --git a/tests/specs/run/decorators_tc39_proposal/decorators/experimental/no_check/main.out b/tests/specs/run/decorators_tc39_proposal/decorators/experimental/no_check/main.out new file mode 100644 index 000000000..015f7076e --- /dev/null +++ b/tests/specs/run/decorators_tc39_proposal/decorators/experimental/no_check/main.out @@ -0,0 +1,3 @@ +a(): evaluated +a(): called +method diff --git a/tests/specs/run/decorators_tc39_proposal/decorators/experimental/no_check/main.ts b/tests/specs/run/decorators_tc39_proposal/decorators/experimental/no_check/main.ts new file mode 100644 index 000000000..9f7ec550d --- /dev/null +++ b/tests/specs/run/decorators_tc39_proposal/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/decorators_tc39_proposal/decorators/experimental/runtime/main.out b/tests/specs/run/decorators_tc39_proposal/decorators/experimental/runtime/main.out new file mode 100644 index 000000000..0fc1d4590 --- /dev/null +++ b/tests/specs/run/decorators_tc39_proposal/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/decorators_tc39_proposal/decorators/experimental/runtime/main.ts b/tests/specs/run/decorators_tc39_proposal/decorators/experimental/runtime/main.ts new file mode 100644 index 000000000..40a26bbd4 --- /dev/null +++ b/tests/specs/run/decorators_tc39_proposal/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/decorators_tc39_proposal/decorators/experimental/ts/main.out b/tests/specs/run/decorators_tc39_proposal/decorators/experimental/ts/main.out new file mode 100644 index 000000000..ea64fbaa6 --- /dev/null +++ b/tests/specs/run/decorators_tc39_proposal/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/decorators_tc39_proposal/decorators/experimental/ts/main.ts b/tests/specs/run/decorators_tc39_proposal/decorators/experimental/ts/main.ts new file mode 100644 index 000000000..95fba6cd4 --- /dev/null +++ b/tests/specs/run/decorators_tc39_proposal/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/decorators_tc39_proposal/decorators/tc39_proposal/main.out b/tests/specs/run/decorators_tc39_proposal/decorators/tc39_proposal/main.out new file mode 100644 index 000000000..39394952e --- /dev/null +++ b/tests/specs/run/decorators_tc39_proposal/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/decorators_tc39_proposal/decorators/tc39_proposal/main.ts b/tests/specs/run/decorators_tc39_proposal/decorators/tc39_proposal/main.ts new file mode 100644 index 000000000..00c8a8502 --- /dev/null +++ b/tests/specs/run/decorators_tc39_proposal/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/deno_exit_tampering/__test__.jsonc b/tests/specs/run/deno_exit_tampering/__test__.jsonc new file mode 100644 index 000000000..1666fbacb --- /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/specs/run/deno_exit_tampering/deno_exit_tampering.ts b/tests/specs/run/deno_exit_tampering/deno_exit_tampering.ts new file mode 100644 index 000000000..3b24261e2 --- /dev/null +++ b/tests/specs/run/deno_exit_tampering/deno_exit_tampering.ts @@ -0,0 +1,3 @@ +delete globalThis.dispatchEvent; +delete EventTarget.prototype.dispatchEvent; +Deno.exit(42); 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 000000000..1d6b28682 --- /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/specs/run/deny_all_permission_args/deny_all_permission_args.js b/tests/specs/run/deny_all_permission_args/deny_all_permission_args.js new file mode 100644 index 000000000..c63d2c362 --- /dev/null +++ b/tests/specs/run/deny_all_permission_args/deny_all_permission_args.js @@ -0,0 +1,7 @@ +console.log(Deno.permissions.querySync({ name: "env" })); +console.log(Deno.permissions.querySync({ name: "read" })); +console.log(Deno.permissions.querySync({ name: "write" })); +console.log(Deno.permissions.querySync({ name: "ffi" })); +console.log(Deno.permissions.querySync({ name: "run" })); +console.log(Deno.permissions.querySync({ name: "sys" })); +console.log(Deno.permissions.querySync({ name: "net" })); diff --git a/tests/specs/run/deny_all_permission_args/deny_all_permission_args.out b/tests/specs/run/deny_all_permission_args/deny_all_permission_args.out new file mode 100644 index 000000000..de6f687f4 --- /dev/null +++ b/tests/specs/run/deny_all_permission_args/deny_all_permission_args.out @@ -0,0 +1,7 @@ +PermissionStatus { state: "denied", onchange: null } +PermissionStatus { state: "denied", onchange: null } +PermissionStatus { state: "denied", onchange: null } +PermissionStatus { state: "denied", onchange: null } +PermissionStatus { state: "denied", onchange: null } +PermissionStatus { state: "denied", onchange: null } +PermissionStatus { state: "denied", onchange: null } 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 000000000..a55ee57e4 --- /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/specs/run/deny_some_permission_args/deny_some_permission_args.js b/tests/specs/run/deny_some_permission_args/deny_some_permission_args.js new file mode 100644 index 000000000..357dda238 --- /dev/null +++ b/tests/specs/run/deny_some_permission_args/deny_some_permission_args.js @@ -0,0 +1,21 @@ +console.log(Deno.permissions.querySync({ name: "env" })); +console.log(Deno.permissions.querySync({ name: "env", variable: "FOO" })); +console.log(Deno.permissions.querySync({ name: "env", variable: "BAR" })); +console.log(Deno.permissions.querySync({ name: "read" })); +console.log(Deno.permissions.querySync({ name: "read", path: "/foo" })); +console.log(Deno.permissions.querySync({ name: "read", path: "/bar" })); +console.log(Deno.permissions.querySync({ name: "write" })); +console.log(Deno.permissions.querySync({ name: "write", path: "/foo" })); +console.log(Deno.permissions.querySync({ name: "write", path: "/bar" })); +console.log(Deno.permissions.querySync({ name: "ffi" })); +console.log(Deno.permissions.querySync({ name: "ffi", path: "/foo" })); +console.log(Deno.permissions.querySync({ name: "ffi", path: "/bar" })); +console.log(Deno.permissions.querySync({ name: "run" })); +console.log(Deno.permissions.querySync({ name: "run", command: "foo" })); +console.log(Deno.permissions.querySync({ name: "run", command: "bar" })); +console.log(Deno.permissions.querySync({ name: "sys" })); +console.log(Deno.permissions.querySync({ name: "sys", kind: "hostname" })); +console.log(Deno.permissions.querySync({ name: "sys", kind: "loadavg" })); +console.log(Deno.permissions.querySync({ name: "net" })); +console.log(Deno.permissions.querySync({ name: "net", host: "127.0.0.1" })); +console.log(Deno.permissions.querySync({ name: "net", host: "192.168.0.1" })); diff --git a/tests/specs/run/deny_some_permission_args/deny_some_permission_args.out b/tests/specs/run/deny_some_permission_args/deny_some_permission_args.out new file mode 100644 index 000000000..abb5274ee --- /dev/null +++ b/tests/specs/run/deny_some_permission_args/deny_some_permission_args.out @@ -0,0 +1,21 @@ +PermissionStatus { state: "granted", onchange: null, partial: true } +PermissionStatus { state: "denied", onchange: null } +PermissionStatus { state: "granted", onchange: null } +PermissionStatus { state: "granted", onchange: null, partial: true } +PermissionStatus { state: "denied", onchange: null } +PermissionStatus { state: "granted", onchange: null } +PermissionStatus { state: "granted", onchange: null, partial: true } +PermissionStatus { state: "denied", onchange: null } +PermissionStatus { state: "granted", onchange: null } +PermissionStatus { state: "granted", onchange: null, partial: true } +PermissionStatus { state: "denied", onchange: null } +PermissionStatus { state: "granted", onchange: null } +PermissionStatus { state: "granted", onchange: null, partial: true } +PermissionStatus { state: "denied", onchange: null } +PermissionStatus { state: "granted", onchange: null } +PermissionStatus { state: "granted", onchange: null, partial: true } +PermissionStatus { state: "denied", onchange: null } +PermissionStatus { state: "granted", onchange: null } +PermissionStatus { state: "granted", onchange: null, partial: true } +PermissionStatus { state: "denied", onchange: null } +PermissionStatus { state: "granted", onchange: null } 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 000000000..5b1505b57 --- /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/specs/run/dom_exception_formatting/dom_exception_formatting.ts b/tests/specs/run/dom_exception_formatting/dom_exception_formatting.ts new file mode 100644 index 000000000..0209ec81e --- /dev/null +++ b/tests/specs/run/dom_exception_formatting/dom_exception_formatting.ts @@ -0,0 +1 @@ +throw new DOMException("foo", "SyntaxError"); diff --git a/tests/specs/run/dom_exception_formatting/dom_exception_formatting.ts.out b/tests/specs/run/dom_exception_formatting/dom_exception_formatting.ts.out new file mode 100644 index 000000000..75615d0a8 --- /dev/null +++ b/tests/specs/run/dom_exception_formatting/dom_exception_formatting.ts.out @@ -0,0 +1,3 @@ +[WILDCARD]error: Uncaught (in promise) SyntaxError: foo +[WILDCARD] + at file:///[WILDCARD]/dom_exception_formatting.ts:[WILDCARD] 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 000000000..0cd120130 --- /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/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/error_001.ts b/tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/error_001.ts new file mode 100644 index 000000000..b01068bc0 --- /dev/null +++ b/tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/error_001.ts @@ -0,0 +1,9 @@ +function foo(): never { + throw Error("bad"); +} + +function bar() { + foo(); +} + +bar(); diff --git a/tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/main.out b/tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/main.out new file mode 100644 index 000000000..c3eb66f9e --- /dev/null +++ b/tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/main.out @@ -0,0 +1,4 @@ +[WILDCARD]Caught: Error: bad + at [WILDCARD]/error_001.ts:[WILDCARD] +Caught: Error: bad + at [WILDCARD]/error_001.ts:[WILDCARD] diff --git a/tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/main.ts b/tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/main.ts new file mode 100644 index 000000000..249de8d8b --- /dev/null +++ b/tests/specs/run/dynamic_import_already_rejected/dynamic_import_already_rejected/main.ts @@ -0,0 +1,15 @@ +try { + await import("./error_001.ts"); +} catch (error) { + if (error instanceof Error) { + console.log(`Caught: ${error.stack}`); + } +} + +try { + await import("./error_001.ts"); +} catch (error) { + if (error instanceof Error) { + console.log(`Caught: ${error.stack}`); + } +} 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 000000000..9824c3450 --- /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/specs/run/dynamic_import_async_error/dynamic_import_async_error/delayed_error.ts b/tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/delayed_error.ts new file mode 100644 index 000000000..76057e627 --- /dev/null +++ b/tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/delayed_error.ts @@ -0,0 +1,2 @@ +await new Promise((r) => setTimeout(r, 100)); +throw new Error("foo"); diff --git a/tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/main.out b/tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/main.out new file mode 100644 index 000000000..974c2e426 --- /dev/null +++ b/tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/main.out @@ -0,0 +1,2 @@ +[WILDCARD]Caught: Error: foo + at [WILDCARD]/delayed_error.ts:[WILDCARD] diff --git a/tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/main.ts b/tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/main.ts new file mode 100644 index 000000000..998e7ed3e --- /dev/null +++ b/tests/specs/run/dynamic_import_async_error/dynamic_import_async_error/main.ts @@ -0,0 +1,7 @@ +try { + await import("./delayed_error.ts"); +} catch (error) { + if (error instanceof Error) { + console.log(`Caught: ${error.stack}`); + } +} 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 000000000..c4c30ca5d --- /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/specs/run/dynamic_import_concurrent_non_statically_analyzable/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 new file mode 100644 index 000000000..c344d0aae --- /dev/null +++ b/tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/dynamic_import_concurrent_non_statically_analyzable/main.out @@ -0,0 +1,100 @@ +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 diff --git a/tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/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 new file mode 100644 index 000000000..0832e40be --- /dev/null +++ b/tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/dynamic_import_concurrent_non_statically_analyzable/main.ts @@ -0,0 +1,16 @@ +import * as path from "http://localhost:4545/deno_std/path/mod.ts"; + +const currentDir = path.dirname(path.fromFileUrl(import.meta.url)); +const url = path.toFileUrl(path.join(currentDir, "./mod.ts")); +const urls = []; + +// this is hard to reproduce, but doing this will help +for (let i = 0; i < 100; i++) { + urls.push(url.toString() + "#" + i); +} + +const results = await Promise.all(urls.map((url) => import(url))); + +for (const result of results) { + result.outputValue(); +} diff --git a/tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/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 new file mode 100644 index 000000000..56f2002ed --- /dev/null +++ b/tests/specs/run/dynamic_import_concurrent_non_statically_analyzable/dynamic_import_concurrent_non_statically_analyzable/mod.ts @@ -0,0 +1,7 @@ +// sleep a bit so many concurrent tasks end up +// attempting to build the graph at the same time +import "http://localhost:4545/sleep/10"; + +export function outputValue() { + console.log(parseInt(new URL(import.meta.url).hash.slice(1), 10)); +} 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 000000000..8adff3a16 --- /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/specs/run/dynamic_import_conditional/dynamic_import_conditional.js b/tests/specs/run/dynamic_import_conditional/dynamic_import_conditional.js new file mode 100644 index 000000000..1b4193e3e --- /dev/null +++ b/tests/specs/run/dynamic_import_conditional/dynamic_import_conditional.js @@ -0,0 +1,3 @@ +const Worker = globalThis.Worker ?? (await import("worker_threads")).Worker; + +console.log(!!Worker); diff --git a/tests/specs/run/dynamic_import_conditional/dynamic_import_conditional.js.out b/tests/specs/run/dynamic_import_conditional/dynamic_import_conditional.js.out new file mode 100644 index 000000000..27ba77dda --- /dev/null +++ b/tests/specs/run/dynamic_import_conditional/dynamic_import_conditional.js.out @@ -0,0 +1 @@ +true 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 000000000..27a747b3a --- /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 000000000..865c1777a --- /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 000000000..b7b246ba2 --- /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 000000000..f9d66b6b3 --- /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 000000000..569b1f84c --- /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 000000000..287cf9998 --- /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 000000000..8f118d8be --- /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 000000000..01bff7d7a --- /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 000000000..bf8c1948e --- /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 000000000..5b2c0c568 --- /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 000000000..b0a9540c3 --- /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 000000000..c8de9382a --- /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 000000000..00fd2a6e4 --- /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 000000000..65a254191 --- /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 000000000..16fe3bbdd --- /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 000000000..2d6e820fd --- /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 000000000..937974869 --- /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/specs/run/dynamic_import_static_analysis_no_permissions/empty_1.ts b/tests/specs/run/dynamic_import_static_analysis_no_permissions/empty_1.ts new file mode 100644 index 000000000..e69de29bb diff --git a/tests/specs/run/dynamic_import_static_analysis_no_permissions/empty_2.ts b/tests/specs/run/dynamic_import_static_analysis_no_permissions/empty_2.ts new file mode 100644 index 000000000..e69de29bb 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 000000000..de75ba87b --- /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 000000000..ba9249ab0 --- /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 000000000..1971d3184 --- /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/specs/run/dynamic_import_syntax_error/dynamic_import_syntax_error.js b/tests/specs/run/dynamic_import_syntax_error/dynamic_import_syntax_error.js new file mode 100644 index 000000000..be8ec132f --- /dev/null +++ b/tests/specs/run/dynamic_import_syntax_error/dynamic_import_syntax_error.js @@ -0,0 +1 @@ +await import("./dynamic_import_syntax_error_import.js"); diff --git a/tests/specs/run/dynamic_import_syntax_error/dynamic_import_syntax_error.js.out b/tests/specs/run/dynamic_import_syntax_error/dynamic_import_syntax_error.js.out new file mode 100644 index 000000000..91e69eac7 --- /dev/null +++ b/tests/specs/run/dynamic_import_syntax_error/dynamic_import_syntax_error.js.out @@ -0,0 +1,4 @@ +error: Uncaught (in promise) SyntaxError: Unexpected reserved word at [WILDCARD]/dynamic_import_syntax_error_import.js:3:3 +await import("./dynamic_import_syntax_error_import.js"); +^ + at async [WILDCARD]/dynamic_import_syntax_error.js:1:1 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 000000000..bcf075638 --- /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 000000000..8090c50f6 --- /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/specs/run/empty_typescript/empty.ts b/tests/specs/run/empty_typescript/empty.ts new file mode 100644 index 000000000..e69de29bb diff --git a/tests/specs/run/error_001/__test__.jsonc b/tests/specs/run/error_001/__test__.jsonc new file mode 100644 index 000000000..7b9158e4f --- /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 000000000..b01068bc0 --- /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/specs/run/error_001/error_001.ts.out b/tests/specs/run/error_001/error_001.ts.out new file mode 100644 index 000000000..9d8559917 --- /dev/null +++ b/tests/specs/run/error_001/error_001.ts.out @@ -0,0 +1,6 @@ +[WILDCARD]error: Uncaught (in promise) Error: bad + throw Error("bad"); + ^ + at foo ([WILDCARD]/error_001.ts:2:9) + at bar ([WILDCARD]/error_001.ts:6:3) + at [WILDCARD]/error_001.ts:9:1 diff --git a/tests/specs/run/error_002/__test__.jsonc b/tests/specs/run/error_002/__test__.jsonc new file mode 100644 index 000000000..3a68a8675 --- /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 000000000..ac712fbf7 --- /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/specs/run/error_002/error_002.ts.out b/tests/specs/run/error_002/error_002.ts.out new file mode 100644 index 000000000..1051e7360 --- /dev/null +++ b/tests/specs/run/error_002/error_002.ts.out @@ -0,0 +1,6 @@ +[WILDCARD]error: Uncaught (in promise) Error: exception from mod1 + throw Error("exception from mod1"); + ^ + 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 000000000..5e58f432e --- /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 000000000..b9c0ad527 --- /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 000000000..9071d0aeb --- /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 000000000..f7ef69b26 --- /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/specs/run/error_003_typescript/error_003_typescript.ts b/tests/specs/run/error_003_typescript/error_003_typescript.ts new file mode 100644 index 000000000..e1f882123 --- /dev/null +++ b/tests/specs/run/error_003_typescript/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_typescript/error_003_typescript.ts.out b/tests/specs/run/error_003_typescript/error_003_typescript.ts.out new file mode 100644 index 000000000..bbb2ec470 --- /dev/null +++ b/tests/specs/run/error_003_typescript/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_003_typescript2/__test__.jsonc b/tests/specs/run/error_003_typescript2/__test__.jsonc new file mode 100644 index 000000000..ceeb6e7d9 --- /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 000000000..e1f882123 --- /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 000000000..bbb2ec470 --- /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 000000000..824b9d8c9 --- /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/specs/run/error_004_missing_module/error_004_missing_module.ts b/tests/specs/run/error_004_missing_module/error_004_missing_module.ts new file mode 100644 index 000000000..82b281181 --- /dev/null +++ b/tests/specs/run/error_004_missing_module/error_004_missing_module.ts @@ -0,0 +1,3 @@ +import * as badModule from "./bad-module.ts"; + +console.log(badModule); diff --git a/tests/specs/run/error_004_missing_module/error_004_missing_module.ts.out b/tests/specs/run/error_004_missing_module/error_004_missing_module.ts.out new file mode 100644 index 000000000..9a2cfb8a8 --- /dev/null +++ b/tests/specs/run/error_004_missing_module/error_004_missing_module.ts.out @@ -0,0 +1,2 @@ +[WILDCARD]error: Module not found "file:///[WILDCARD]/bad-module.ts". + at file:///[WILDCARD]/error_004_missing_module.ts:1:28 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 000000000..b9f6a1b74 --- /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/specs/run/error_005_missing_dynamic_import/error_005_missing_dynamic_import.ts b/tests/specs/run/error_005_missing_dynamic_import/error_005_missing_dynamic_import.ts new file mode 100644 index 000000000..8ea8ff94e --- /dev/null +++ b/tests/specs/run/error_005_missing_dynamic_import/error_005_missing_dynamic_import.ts @@ -0,0 +1,3 @@ +(async () => { + const _badModule = await import("./bad-module.ts"); +})(); diff --git a/tests/specs/run/error_005_missing_dynamic_import/error_005_missing_dynamic_import.ts.out b/tests/specs/run/error_005_missing_dynamic_import/error_005_missing_dynamic_import.ts.out new file mode 100644 index 000000000..55e4a8524 --- /dev/null +++ b/tests/specs/run/error_005_missing_dynamic_import/error_005_missing_dynamic_import.ts.out @@ -0,0 +1,4 @@ +error: Uncaught (in promise) TypeError: Module not found "[WILDCARD]/bad-module.ts". + const _badModule = await import("./bad-module.ts"); + ^ + at async file://[WILDCARD]/error_005_missing_dynamic_import.ts:2:22 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 000000000..0e70bdcaf --- /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/specs/run/error_006_import_ext_failure/error_006_import_ext_failure.ts b/tests/specs/run/error_006_import_ext_failure/error_006_import_ext_failure.ts new file mode 100644 index 000000000..3c32303a3 --- /dev/null +++ b/tests/specs/run/error_006_import_ext_failure/error_006_import_ext_failure.ts @@ -0,0 +1 @@ +import "./non-existent"; diff --git a/tests/specs/run/error_006_import_ext_failure/error_006_import_ext_failure.ts.out b/tests/specs/run/error_006_import_ext_failure/error_006_import_ext_failure.ts.out new file mode 100644 index 000000000..667579bd8 --- /dev/null +++ b/tests/specs/run/error_006_import_ext_failure/error_006_import_ext_failure.ts.out @@ -0,0 +1,2 @@ +[WILDCARD]error: Module not found "[WILDCARD]/non-existent". + at file:///[WILDCARD]/error_006_import_ext_failure.ts:1:8 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 000000000..8a1c0d27e --- /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/specs/run/error_007_any/error_007_any.ts b/tests/specs/run/error_007_any/error_007_any.ts new file mode 100644 index 000000000..bfef1289b --- /dev/null +++ b/tests/specs/run/error_007_any/error_007_any.ts @@ -0,0 +1 @@ +throw { foo: "bar" }; diff --git a/tests/specs/run/error_007_any/error_007_any.ts.out b/tests/specs/run/error_007_any/error_007_any.ts.out new file mode 100644 index 000000000..8d13dadb9 --- /dev/null +++ b/tests/specs/run/error_007_any/error_007_any.ts.out @@ -0,0 +1 @@ +[WILDCARD]error: Uncaught (in promise) { foo: "bar" } 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 000000000..f735be953 --- /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/specs/run/error_008_checkjs/error_008_checkjs.js b/tests/specs/run/error_008_checkjs/error_008_checkjs.js new file mode 100644 index 000000000..f0856d94c --- /dev/null +++ b/tests/specs/run/error_008_checkjs/error_008_checkjs.js @@ -0,0 +1,5 @@ +// console.log intentionally misspelled to trigger a type error +consol.log("hello world!"); + +// the following error should be ignored and not output to the console +const foo = new Foo(); diff --git a/tests/specs/run/error_008_checkjs/error_008_checkjs.js.out b/tests/specs/run/error_008_checkjs/error_008_checkjs.js.out new file mode 100644 index 000000000..bab481422 --- /dev/null +++ b/tests/specs/run/error_008_checkjs/error_008_checkjs.js.out @@ -0,0 +1,4 @@ +[WILDCARD]error: Uncaught (in promise) ReferenceError: consol is not defined +consol.log("hello world!"); +^ + at [WILDCARD]/error_008_checkjs.js:2:1 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 000000000..740d5119f --- /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/specs/run/error_009_extensions_error/error_009_extensions_error.js b/tests/specs/run/error_009_extensions_error/error_009_extensions_error.js new file mode 100644 index 000000000..01b97ea38 --- /dev/null +++ b/tests/specs/run/error_009_extensions_error/error_009_extensions_error.js @@ -0,0 +1,2 @@ +// Missing arg. +new Event(); diff --git a/tests/specs/run/error_009_extensions_error/error_009_extensions_error.js.out b/tests/specs/run/error_009_extensions_error/error_009_extensions_error.js.out new file mode 100644 index 000000000..2ed936643 --- /dev/null +++ b/tests/specs/run/error_009_extensions_error/error_009_extensions_error.js.out @@ -0,0 +1,6 @@ +[WILDCARD]error: Uncaught (in promise) TypeError: Failed to construct 'Event': 1 argument required, but only 0 present +new Event(); +^ + at [WILDCARD] + at new Event (ext:deno_web/[WILDCARD]) + at [WILDCARD] 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 000000000..5ca5146be --- /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/specs/run/error_011_bad_module_specifier/error_011_bad_module_specifier.ts b/tests/specs/run/error_011_bad_module_specifier/error_011_bad_module_specifier.ts new file mode 100644 index 000000000..1c57e37a5 --- /dev/null +++ b/tests/specs/run/error_011_bad_module_specifier/error_011_bad_module_specifier.ts @@ -0,0 +1,3 @@ +import * as badModule from "bad-module.ts"; + +console.log(badModule); diff --git a/tests/specs/run/error_011_bad_module_specifier/error_011_bad_module_specifier.ts.out b/tests/specs/run/error_011_bad_module_specifier/error_011_bad_module_specifier.ts.out new file mode 100644 index 000000000..81be915d1 --- /dev/null +++ b/tests/specs/run/error_011_bad_module_specifier/error_011_bad_module_specifier.ts.out @@ -0,0 +1,2 @@ +[WILDCARD]error: Relative import path "bad-module.ts" not prefixed with / or ./ or ../ + at [WILDCARD]/error_011_bad_module_specifier.ts:1:28 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 000000000..9344f730d --- /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/specs/run/error_012_bad_dynamic_import_specifier/error_012_bad_dynamic_import_specifier.ts b/tests/specs/run/error_012_bad_dynamic_import_specifier/error_012_bad_dynamic_import_specifier.ts new file mode 100644 index 000000000..5f39f407c --- /dev/null +++ b/tests/specs/run/error_012_bad_dynamic_import_specifier/error_012_bad_dynamic_import_specifier.ts @@ -0,0 +1,3 @@ +(async () => { + const _badModule = await import("bad-module.ts"); +})(); diff --git a/tests/specs/run/error_012_bad_dynamic_import_specifier/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 new file mode 100644 index 000000000..7acd66713 --- /dev/null +++ b/tests/specs/run/error_012_bad_dynamic_import_specifier/error_012_bad_dynamic_import_specifier.ts.out @@ -0,0 +1,7 @@ +Check [WILDCARD]error_012_bad_dynamic_import_specifier.ts +error: Uncaught (in promise) TypeError: Relative import path "bad-module.ts" not prefixed with / or ./ or ../ + at [WILDCARD]/error_012_bad_dynamic_import_specifier.ts:2:35 + + const _badModule = await import("bad-module.ts"); + ^ + at async [WILDCARD]/error_012_bad_dynamic_import_specifier.ts:2:22 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 000000000..94957dc65 --- /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/specs/run/error_014_catch_dynamic_import_error/error_014_catch_dynamic_import_error.js b/tests/specs/run/error_014_catch_dynamic_import_error/error_014_catch_dynamic_import_error.js new file mode 100644 index 000000000..05b021d15 --- /dev/null +++ b/tests/specs/run/error_014_catch_dynamic_import_error/error_014_catch_dynamic_import_error.js @@ -0,0 +1,31 @@ +(async () => { + try { + await import("does not exist"); + } catch (err) { + console.log("Caught direct dynamic import error."); + console.log(err); + } + + try { + await import("./indirect_import_error.js"); + } catch (err) { + console.log("Caught indirect direct dynamic import error."); + console.log(err); + } + + try { + await import("./throws.js"); + } catch (err) { + console.log("Caught error thrown by dynamically imported module."); + console.log(err); + } + + try { + await import("./indirect_throws.js"); + } catch (err) { + console.log( + "Caught error thrown indirectly by dynamically imported module.", + ); + console.log(err); + } +})(); diff --git a/tests/specs/run/error_014_catch_dynamic_import_error/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 new file mode 100644 index 000000000..71feaa55b --- /dev/null +++ b/tests/specs/run/error_014_catch_dynamic_import_error/error_014_catch_dynamic_import_error.js.out @@ -0,0 +1,19 @@ +Caught direct dynamic import error. +TypeError: Relative import path "does not exist" not prefixed with / or ./ or ../ + at [WILDCARD]/error_014_catch_dynamic_import_error.js:3:18 + + at [WILDCARD]/error_014_catch_dynamic_import_error.js:3:5 { + code: "ERR_MODULE_NOT_FOUND" +} +Caught indirect direct dynamic import error. +TypeError: Relative import path "does not exist either" not prefixed with / or ./ or ../ + 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]/throws.js:6:7 +Caught error thrown indirectly by dynamically imported module. +Error: An error + 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 000000000..84011d291 --- /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 000000000..e1810a66c --- /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 000000000..abdf29156 --- /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 000000000..3ab25f1a5 --- /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 000000000..6e7daf5d0 --- /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/specs/run/error_015_dynamic_import_permissions/error_015_dynamic_import_permissions.out b/tests/specs/run/error_015_dynamic_import_permissions/error_015_dynamic_import_permissions.out new file mode 100644 index 000000000..8ef2f6f1e --- /dev/null +++ b/tests/specs/run/error_015_dynamic_import_permissions/error_015_dynamic_import_permissions.out @@ -0,0 +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/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 000000000..71332dbc4 --- /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 000000000..382d56039 --- /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/specs/run/error_017_hide_long_source_ts/error_017_hide_long_source_ts.ts b/tests/specs/run/error_017_hide_long_source_ts/error_017_hide_long_source_ts.ts new file mode 100644 index 000000000..d61cb1277 --- /dev/null +++ b/tests/specs/run/error_017_hide_long_source_ts/error_017_hide_long_source_ts.ts @@ -0,0 +1,3 @@ +// deno-fmt-ignore-file +const LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG = undefined; +LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG.a; diff --git a/tests/specs/run/error_017_hide_long_source_ts/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 new file mode 100644 index 000000000..917061ab9 --- /dev/null +++ b/tests/specs/run/error_017_hide_long_source_ts/error_017_hide_long_source_ts.ts.out @@ -0,0 +1,3 @@ +[WILDCARD] +error: TS2532 [ERROR]: Object is possibly 'undefined'. + at [WILDCARD]/error_017_hide_long_source_ts.ts:3:1 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 000000000..4e91a820d --- /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/specs/run/error_018_hide_long_source_js/error_018_hide_long_source_js.js b/tests/specs/run/error_018_hide_long_source_js/error_018_hide_long_source_js.js new file mode 100644 index 000000000..d61cb1277 --- /dev/null +++ b/tests/specs/run/error_018_hide_long_source_js/error_018_hide_long_source_js.js @@ -0,0 +1,3 @@ +// deno-fmt-ignore-file +const LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG = undefined; +LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG.a; diff --git a/tests/specs/run/error_018_hide_long_source_js/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 new file mode 100644 index 000000000..0897a100c --- /dev/null +++ b/tests/specs/run/error_018_hide_long_source_js/error_018_hide_long_source_js.js.out @@ -0,0 +1,2 @@ +error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'a') + at file:///[WILDCARD]/error_018_hide_long_source_js.js:3:206 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 000000000..5e272ee49 --- /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/specs/run/error_019_stack_function/error_019_stack_function.ts b/tests/specs/run/error_019_stack_function/error_019_stack_function.ts new file mode 100644 index 000000000..a6a69d146 --- /dev/null +++ b/tests/specs/run/error_019_stack_function/error_019_stack_function.ts @@ -0,0 +1,12 @@ +function foo(): never { + throw new Error("function"); +} + +try { + foo(); +} catch (error) { + if (error instanceof Error) { + console.log(error.stack); + } + throw error; +} diff --git a/tests/specs/run/error_019_stack_function/error_019_stack_function.ts.out b/tests/specs/run/error_019_stack_function/error_019_stack_function.ts.out new file mode 100644 index 000000000..edaff27c0 --- /dev/null +++ b/tests/specs/run/error_019_stack_function/error_019_stack_function.ts.out @@ -0,0 +1,8 @@ +[WILDCARD]Error: function + at foo ([WILDCARD]/error_019_stack_function.ts:[WILDCARD]) + at [WILDCARD]/error_019_stack_function.ts:[WILDCARD] +error: Uncaught (in promise) Error: function + throw new Error("function"); + ^ + at foo ([WILDCARD]/error_019_stack_function.ts:[WILDCARD]) + at [WILDCARD]/error_019_stack_function.ts:[WILDCARD] 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 000000000..2dd574565 --- /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/specs/run/error_020_stack_constructor/error_020_stack_constructor.ts b/tests/specs/run/error_020_stack_constructor/error_020_stack_constructor.ts new file mode 100644 index 000000000..526d1a661 --- /dev/null +++ b/tests/specs/run/error_020_stack_constructor/error_020_stack_constructor.ts @@ -0,0 +1,14 @@ +class A { + constructor() { + throw new Error("constructor"); + } +} + +try { + new A(); +} catch (error) { + if (error instanceof Error) { + console.log(error.stack); + } + throw error; +} diff --git a/tests/specs/run/error_020_stack_constructor/error_020_stack_constructor.ts.out b/tests/specs/run/error_020_stack_constructor/error_020_stack_constructor.ts.out new file mode 100644 index 000000000..9e48b8f98 --- /dev/null +++ b/tests/specs/run/error_020_stack_constructor/error_020_stack_constructor.ts.out @@ -0,0 +1,8 @@ +[WILDCARD]Error: constructor + at new A ([WILDCARD]/error_020_stack_constructor.ts:[WILDCARD]) + at [WILDCARD]/error_020_stack_constructor.ts:[WILDCARD] +error: Uncaught (in promise) Error: constructor + throw new Error("constructor"); + ^ + at new A ([WILDCARD]/error_020_stack_constructor.ts:[WILDCARD]) + at [WILDCARD]/error_020_stack_constructor.ts:[WILDCARD] 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 000000000..db78cac09 --- /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/specs/run/error_021_stack_method/error_021_stack_method.ts b/tests/specs/run/error_021_stack_method/error_021_stack_method.ts new file mode 100644 index 000000000..b6ebe1f5e --- /dev/null +++ b/tests/specs/run/error_021_stack_method/error_021_stack_method.ts @@ -0,0 +1,14 @@ +class A { + m(): never { + throw new Error("method"); + } +} + +try { + new A().m(); +} catch (error) { + if (error instanceof Error) { + console.log(error.stack); + } + throw error; +} diff --git a/tests/specs/run/error_021_stack_method/error_021_stack_method.ts.out b/tests/specs/run/error_021_stack_method/error_021_stack_method.ts.out new file mode 100644 index 000000000..9df9b1b7c --- /dev/null +++ b/tests/specs/run/error_021_stack_method/error_021_stack_method.ts.out @@ -0,0 +1,8 @@ +[WILDCARD]Error: method + at A.m ([WILDCARD]/error_021_stack_method.ts:[WILDCARD]) + at [WILDCARD]/error_021_stack_method.ts:[WILDCARD] +error: Uncaught (in promise) Error: method + throw new Error("method"); + ^ + at A.m ([WILDCARD]/error_021_stack_method.ts:[WILDCARD]) + at [WILDCARD]/error_021_stack_method.ts:[WILDCARD] 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 000000000..f31505833 --- /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/specs/run/error_022_stack_custom_error/error_022_stack_custom_error.ts b/tests/specs/run/error_022_stack_custom_error/error_022_stack_custom_error.ts new file mode 100644 index 000000000..b95743503 --- /dev/null +++ b/tests/specs/run/error_022_stack_custom_error/error_022_stack_custom_error.ts @@ -0,0 +1,14 @@ +class CustomError extends Error { + constructor() { + super(); + this.name = "CustomError"; + } + + get message(): string { + return "custom error"; + } +} + +const error = new CustomError(); +console.log(error.stack); +throw error; diff --git a/tests/specs/run/error_022_stack_custom_error/error_022_stack_custom_error.ts.out b/tests/specs/run/error_022_stack_custom_error/error_022_stack_custom_error.ts.out new file mode 100644 index 000000000..73e033e52 --- /dev/null +++ b/tests/specs/run/error_022_stack_custom_error/error_022_stack_custom_error.ts.out @@ -0,0 +1,6 @@ +[WILDCARD]CustomError: custom error + at [WILDCARD]/error_022_stack_custom_error.ts:[WILDCARD] +error: Uncaught (in promise) CustomError: custom error +const error = new CustomError(); + ^ + at [WILDCARD]/error_022_stack_custom_error.ts:[WILDCARD] 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 000000000..76cdff013 --- /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/specs/run/error_023_stack_async/error_023_stack_async.ts b/tests/specs/run/error_023_stack_async/error_023_stack_async.ts new file mode 100644 index 000000000..fdabaa5df --- /dev/null +++ b/tests/specs/run/error_023_stack_async/error_023_stack_async.ts @@ -0,0 +1,14 @@ +const p = (async () => { + await Promise.resolve().then((): never => { + throw new Error("async"); + }); +})(); + +try { + await p; +} catch (error) { + if (error instanceof Error) { + console.log(error.stack); + } + throw error; +} diff --git a/tests/specs/run/error_023_stack_async/error_023_stack_async.ts.out b/tests/specs/run/error_023_stack_async/error_023_stack_async.ts.out new file mode 100644 index 000000000..2d122d986 --- /dev/null +++ b/tests/specs/run/error_023_stack_async/error_023_stack_async.ts.out @@ -0,0 +1,10 @@ +[WILDCARD]Error: async + at [WILDCARD]/error_023_stack_async.ts:[WILDCARD] + at async [WILDCARD]/error_023_stack_async.ts:[WILDCARD] + at async [WILDCARD]/error_023_stack_async.ts:[WILDCARD] +error: Uncaught (in promise) Error: async + throw new Error("async"); + ^ + at [WILDCARD]/error_023_stack_async.ts:[WILDCARD] + at async [WILDCARD]/error_023_stack_async.ts:[WILDCARD] + at async [WILDCARD]/error_023_stack_async.ts:[WILDCARD] 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 000000000..7c733f971 --- /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/specs/run/error_024_stack_promise_all/error_024_stack_promise_all.ts b/tests/specs/run/error_024_stack_promise_all/error_024_stack_promise_all.ts new file mode 100644 index 000000000..8ca7b203c --- /dev/null +++ b/tests/specs/run/error_024_stack_promise_all/error_024_stack_promise_all.ts @@ -0,0 +1,16 @@ +const p = Promise.all([ + Promise.resolve(), + (async (): Promise => { + await Promise.resolve(); + throw new Error("Promise.all()"); + })(), +]); + +try { + await p; +} catch (error) { + if (error instanceof Error) { + console.log(error.stack); + } + throw error; +} diff --git a/tests/specs/run/error_024_stack_promise_all/error_024_stack_promise_all.ts.out b/tests/specs/run/error_024_stack_promise_all/error_024_stack_promise_all.ts.out new file mode 100644 index 000000000..c7d10a649 --- /dev/null +++ b/tests/specs/run/error_024_stack_promise_all/error_024_stack_promise_all.ts.out @@ -0,0 +1,10 @@ +[WILDCARD]Error: Promise.all() + at [WILDCARD]/error_024_stack_promise_all.ts:[WILDCARD] + at async Promise.all (index 1) + at async [WILDCARD]/error_024_stack_promise_all.ts:[WILDCARD] +error: Uncaught (in promise) Error: Promise.all() + throw new Error("Promise.all()"); + ^ + at [WILDCARD]/error_024_stack_promise_all.ts:[WILDCARD] + at async Promise.all (index 1) + at async [WILDCARD]/error_024_stack_promise_all.ts:[WILDCARD] 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 000000000..23c49458e --- /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/specs/run/error_025_tab_indent/error_025_tab_indent b/tests/specs/run/error_025_tab_indent/error_025_tab_indent new file mode 100644 index 000000000..35a25bcea --- /dev/null +++ b/tests/specs/run/error_025_tab_indent/error_025_tab_indent @@ -0,0 +1,9 @@ +function foo() { + throw Error("bad"); +} + +function bar() { + foo(); +} + +bar(); diff --git a/tests/specs/run/error_025_tab_indent/error_025_tab_indent.out b/tests/specs/run/error_025_tab_indent/error_025_tab_indent.out new file mode 100644 index 000000000..edf525c90 --- /dev/null +++ b/tests/specs/run/error_025_tab_indent/error_025_tab_indent.out @@ -0,0 +1,6 @@ +[WILDCARD]error: Uncaught (in promise) Error: bad + throw Error("bad"); + ^ + at foo ([WILDCARD]/error_025_tab_indent:2:8) + at bar ([WILDCARD]/error_025_tab_indent:6:2) + at [WILDCARD]/error_025_tab_indent:9:1 diff --git a/tests/specs/run/error_cause/__test__.jsonc b/tests/specs/run/error_cause/__test__.jsonc new file mode 100644 index 000000000..ccbf71dea --- /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/specs/run/error_cause/error_cause.ts b/tests/specs/run/error_cause/error_cause.ts new file mode 100644 index 000000000..385ce2a03 --- /dev/null +++ b/tests/specs/run/error_cause/error_cause.ts @@ -0,0 +1,14 @@ +function a() { + // deno-lint-ignore no-explicit-any + throw new Error("foo", { cause: new Error("bar", { cause: "deno" as any }) }); +} + +function b() { + a(); +} + +function c() { + b(); +} + +c(); diff --git a/tests/specs/run/error_cause/error_cause.ts.out b/tests/specs/run/error_cause/error_cause.ts.out new file mode 100644 index 000000000..4dc439ac9 --- /dev/null +++ b/tests/specs/run/error_cause/error_cause.ts.out @@ -0,0 +1,13 @@ +error: Uncaught (in promise) Error: foo + throw new Error("foo", { cause: new Error("bar", { cause: "deno" as any }) }); + ^ + at a (file:///[WILDCARD]/error_cause.ts:3:9) + at b (file:///[WILDCARD]/error_cause.ts:7:3) + at c (file:///[WILDCARD]/error_cause.ts:11:3) + at file:///[WILDCARD]/error_cause.ts:14:1 +Caused by: Error: bar + at a (file:///[WILDCARD]/error_cause.ts:3:35) + at b (file:///[WILDCARD]/error_cause.ts:7:3) + at c (file:///[WILDCARD]/error_cause.ts:11:3) + at file:///[WILDCARD]/error_cause.ts:14:1 +Caused by: "deno" 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 000000000..71c4cf3cc --- /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/specs/run/error_cause_recursive/error_cause_recursive.ts b/tests/specs/run/error_cause_recursive/error_cause_recursive.ts new file mode 100644 index 000000000..a6999b1ff --- /dev/null +++ b/tests/specs/run/error_cause_recursive/error_cause_recursive.ts @@ -0,0 +1,4 @@ +const x = new Error("foo"); +const y = new Error("bar", { cause: x }); +x.cause = y; +throw y; diff --git a/tests/specs/run/error_cause_recursive/error_cause_recursive.ts.out b/tests/specs/run/error_cause_recursive/error_cause_recursive.ts.out new file mode 100644 index 000000000..52d5a03a1 --- /dev/null +++ b/tests/specs/run/error_cause_recursive/error_cause_recursive.ts.out @@ -0,0 +1,7 @@ +error: Uncaught (in promise) Error: bar +const y = new Error("bar", { cause: x }); + ^ + at file:///[WILDCARD]/error_cause_recursive.ts:2:11 +Caused by: Error: foo + at file:///[WILDCARD]/error_cause_recursive.ts:1:11 +Caused by: [Circular *1] 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 000000000..2aabee0ec --- /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/specs/run/error_cause_recursive_aggregate/error_cause_recursive_aggregate.ts b/tests/specs/run/error_cause_recursive_aggregate/error_cause_recursive_aggregate.ts new file mode 100644 index 000000000..4bb2ae064 --- /dev/null +++ b/tests/specs/run/error_cause_recursive_aggregate/error_cause_recursive_aggregate.ts @@ -0,0 +1,9 @@ +const foo = new Error("foo"); +const bar = new Error("bar", { cause: foo }); +foo.cause = bar; + +const qux = new Error("qux"); +const quux = new Error("quux", { cause: qux }); +qux.cause = quux; + +throw new AggregateError([bar, quux]); diff --git a/tests/specs/run/error_cause_recursive_aggregate/error_cause_recursive_aggregate.ts.out b/tests/specs/run/error_cause_recursive_aggregate/error_cause_recursive_aggregate.ts.out new file mode 100644 index 000000000..4ae20055a --- /dev/null +++ b/tests/specs/run/error_cause_recursive_aggregate/error_cause_recursive_aggregate.ts.out @@ -0,0 +1,14 @@ +error: Uncaught (in promise) AggregateError + Error: bar + at file:///[WILDCARD]/error_cause_recursive_aggregate.ts:2:13 + Caused by: Error: foo + at file:///[WILDCARD]/error_cause_recursive_aggregate.ts:1:13 + Caused by: [Circular *1] + Error: quux + at file:///[WILDCARD]/error_cause_recursive_aggregate.ts:6:14 + Caused by: Error: qux + at file:///[WILDCARD]/error_cause_recursive_aggregate.ts:5:13 + Caused by: [Circular *2] +throw new AggregateError([bar, quux]); + ^ + at file:///[WILDCARD]/error_cause_recursive_aggregate.ts:9:7 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 000000000..249ccac48 --- /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/specs/run/error_cause_recursive_tail/error_cause_recursive_tail.ts b/tests/specs/run/error_cause_recursive_tail/error_cause_recursive_tail.ts new file mode 100644 index 000000000..51e7fa6d9 --- /dev/null +++ b/tests/specs/run/error_cause_recursive_tail/error_cause_recursive_tail.ts @@ -0,0 +1,5 @@ +const foo = new Error("foo"); +const bar = new Error("bar", { cause: foo }); +const baz = new Error("baz", { cause: bar }); +foo.cause = bar; +throw baz; diff --git a/tests/specs/run/error_cause_recursive_tail/error_cause_recursive_tail.ts.out b/tests/specs/run/error_cause_recursive_tail/error_cause_recursive_tail.ts.out new file mode 100644 index 000000000..04b15e91a --- /dev/null +++ b/tests/specs/run/error_cause_recursive_tail/error_cause_recursive_tail.ts.out @@ -0,0 +1,9 @@ +error: Uncaught (in promise) Error: baz +const baz = new Error("baz", { cause: bar }); + ^ + at file:///[WILDCARD]/error_cause_recursive_tail.ts:3:13 +Caused by: Error: bar + at file:///[WILDCARD]/error_cause_recursive_tail.ts:2:13 +Caused by: Error: foo + at file:///[WILDCARD]/error_cause_recursive_tail.ts:1:13 +Caused by: [Circular *1] 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 000000000..b67f67ece --- /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/specs/run/error_for_await/error_for_await.ts b/tests/specs/run/error_for_await/error_for_await.ts new file mode 100644 index 000000000..ce8571df1 --- /dev/null +++ b/tests/specs/run/error_for_await/error_for_await.ts @@ -0,0 +1,12 @@ +const listener = Deno.listen({ port: 8080 }); + +for await (const conn of listener) { + handleConn(conn); +} + +function handleConn(conn: Deno.Conn) { + const httpConn = (Deno as any).serveHttp(conn); + for await (const event of httpConn) { + event.respondWith(new Response("html", { status: 200 })); + } +} diff --git a/tests/specs/run/error_for_await/error_for_await.ts.out b/tests/specs/run/error_for_await/error_for_await.ts.out new file mode 100644 index 000000000..db3cdecb4 --- /dev/null +++ b/tests/specs/run/error_for_await/error_for_await.ts.out @@ -0,0 +1,10 @@ +[WILDCARD] +error: TS1103 [ERROR]: 'for await' loops are only allowed within async functions and at the top levels of modules. + for await (const event of httpConn) { + ~~~~~ + at [WILDCARD]error_for_await.ts:9:7 + +TS1356 [ERROR]: Did you mean to mark this function as 'async'? + function handleConn(conn: Deno.Conn) { + ~~~~~~~~~~ + at [WILDCARD]error_for_await.ts:7:10 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 000000000..c7dd939a4 --- /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/specs/run/error_import_map_unable_to_load/error_import_map_unable_to_load.out b/tests/specs/run/error_import_map_unable_to_load/error_import_map_unable_to_load.out new file mode 100644 index 000000000..50760e438 --- /dev/null +++ b/tests/specs/run/error_import_map_unable_to_load/error_import_map_unable_to_load.out @@ -0,0 +1,4 @@ +error: Unable to load '[WILDCARD]' import map + +Caused by: + [WILDCARD] \ No newline at end of file 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 000000000..5e8efea69 --- /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 000000000..da996dc0d --- /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 000000000..9f5780d2a --- /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/specs/run/error_missing_module_named_import/error_missing_module_named_import.ts b/tests/specs/run/error_missing_module_named_import/error_missing_module_named_import.ts new file mode 100644 index 000000000..9eb5239ff --- /dev/null +++ b/tests/specs/run/error_missing_module_named_import/error_missing_module_named_import.ts @@ -0,0 +1,3 @@ +import { a } from "./does_not_exist.js"; + +console.log(a); diff --git a/tests/specs/run/error_missing_module_named_import/error_missing_module_named_import.ts.out b/tests/specs/run/error_missing_module_named_import/error_missing_module_named_import.ts.out new file mode 100644 index 000000000..700377d65 --- /dev/null +++ b/tests/specs/run/error_missing_module_named_import/error_missing_module_named_import.ts.out @@ -0,0 +1,2 @@ +error: Module not found "file://[WILDCARD]/does_not_exist.js". + at file:///[WILDCARD]/error_missing_module_named_import.ts:[WILDCARD] 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 000000000..a6748b56a --- /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/specs/run/error_name_non_string/error_name_non_string.js b/tests/specs/run/error_name_non_string/error_name_non_string.js new file mode 100644 index 000000000..ae9609927 --- /dev/null +++ b/tests/specs/run/error_name_non_string/error_name_non_string.js @@ -0,0 +1,8 @@ +class ErrorNameNonString extends Error { + constructor() { + super(); + this.name = 42; + } +} + +throw new ErrorNameNonString(); diff --git a/tests/specs/run/error_name_non_string/error_name_non_string.js.out b/tests/specs/run/error_name_non_string/error_name_non_string.js.out new file mode 100644 index 000000000..14fa56c62 --- /dev/null +++ b/tests/specs/run/error_name_non_string/error_name_non_string.js.out @@ -0,0 +1,4 @@ +error: Uncaught (in promise) Error +throw new ErrorNameNonString(); + ^ + at file:///[WILDCARD]/error_name_non_string.js:[WILDCARD] 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 000000000..439dc5615 --- /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 000000000..95ebff028 --- /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 000000000..c4e85332d --- /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 000000000..b14713419 --- /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 000000000..7a60f2c73 --- /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/specs/run/error_syntax/error_syntax.js b/tests/specs/run/error_syntax/error_syntax.js new file mode 100644 index 000000000..c0414c356 --- /dev/null +++ b/tests/specs/run/error_syntax/error_syntax.js @@ -0,0 +1,3 @@ + +// deno-fmt-ignore-file +(the following is a syntax error ^^ ! ) diff --git a/tests/specs/run/error_syntax/error_syntax.js.out b/tests/specs/run/error_syntax/error_syntax.js.out new file mode 100644 index 000000000..fa4d51686 --- /dev/null +++ b/tests/specs/run/error_syntax/error_syntax.js.out @@ -0,0 +1,4 @@ +error: The module's source code could not be parsed: Expected ',', got 'following' at [WILDCARD]/error_syntax.js:3:6 + + (the following is a syntax error ^^ ! ) + ~~~~~~~~~ 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 000000000..72f1de1f7 --- /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/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs b/tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs new file mode 100644 index 000000000..864dfb0c7 --- /dev/null +++ b/tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs @@ -0,0 +1,2 @@ +// Deliberately using .mjs to avoid triggering dprint +setTimeout(() => {}), diff --git a/tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs.out b/tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs.out new file mode 100644 index 000000000..2c9b97aa4 --- /dev/null +++ b/tests/specs/run/error_syntax_empty_trailing_line/error_syntax_empty_trailing_line.mjs.out @@ -0,0 +1,6 @@ +error: The module's source code could not be parsed: Unexpected eof at [WILDCARD]/error_syntax_empty_trailing_line.mjs:3:1 + + setTimeout(() => {}), + ~~~~~~~~~~~~~~~~~~~~~ + + ~ 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 000000000..0ea9bc016 --- /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 000000000..ceb11787e --- /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/specs/run/error_type_definitions/error_type_definitions.ts.out b/tests/specs/run/error_type_definitions/error_type_definitions.ts.out new file mode 100644 index 000000000..057c21df5 --- /dev/null +++ b/tests/specs/run/error_type_definitions/error_type_definitions.ts.out @@ -0,0 +1,3 @@ +[WILDCARD]error: Failed resolving types. Relative import path "baz" not prefixed with / or ./ or ../ + hint: If you want to use a JSR or npm package, try running `deno add jsr:baz` or `deno add npm:baz` + at [WILDCARD]/type_definitions/bar.d.ts:[WILDCARD] 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 000000000..d43335dbb --- /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 000000000..e9c2e5193 --- /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 000000000..34eb41b96 --- /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 000000000..852162c94 --- /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 000000000..ce39201e1 --- /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 000000000..61d366eb2 --- /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 000000000..6196c9d38 --- /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 000000000..afbfd24cf --- /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/specs/run/error_with_errors_prop/error_with_errors_prop.js b/tests/specs/run/error_with_errors_prop/error_with_errors_prop.js new file mode 100644 index 000000000..d1c6bbfaa --- /dev/null +++ b/tests/specs/run/error_with_errors_prop/error_with_errors_prop.js @@ -0,0 +1,10 @@ +const error = new Error("Error with errors prop."); +error.errors = [ + new Error("Error message 1."), + new Error("Error message 2."), +]; +console.log(error.stack); +console.log(); +console.log(error); +console.log(); +throw error; diff --git a/tests/specs/run/error_with_errors_prop/error_with_errors_prop.js.out b/tests/specs/run/error_with_errors_prop/error_with_errors_prop.js.out new file mode 100644 index 000000000..d958996af --- /dev/null +++ b/tests/specs/run/error_with_errors_prop/error_with_errors_prop.js.out @@ -0,0 +1,17 @@ +Error: Error with errors prop. + at [WILDCARD]/error_with_errors_prop.js:1:15 + +Error: Error with errors prop. + at [WILDCARD]/error_with_errors_prop.js:1:15 { + errors: [ + Error: Error message 1. + at [WILDCARD]/error_with_errors_prop.js:3:3, + Error: Error message 2. + at [WILDCARD]/error_with_errors_prop.js:4:3 + ] +} + +error: Uncaught (in promise) Error: Error with errors prop. +const error = new Error("Error with errors prop."); + ^ + at [WILDCARD]/error_with_errors_prop.js:1:15 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 000000000..817efd67e --- /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/specs/run/es_private_fields/es_private_fields.js b/tests/specs/run/es_private_fields/es_private_fields.js new file mode 100644 index 000000000..b5f83e39c --- /dev/null +++ b/tests/specs/run/es_private_fields/es_private_fields.js @@ -0,0 +1,15 @@ +class Foo { + #field = "field"; + + setValue(val) { + this.#field = val; + } + + getValue() { + return this.#field; + } +} + +const bar = new Foo(); +bar.setValue("PRIVATE"); +console.log(bar.getValue()); diff --git a/tests/specs/run/es_private_fields/es_private_fields.js.out b/tests/specs/run/es_private_fields/es_private_fields.js.out new file mode 100644 index 000000000..be1970b05 --- /dev/null +++ b/tests/specs/run/es_private_fields/es_private_fields.js.out @@ -0,0 +1 @@ +PRIVATE 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 000000000..6ad302b03 --- /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/specs/run/eval_context_throw_dom_exception/eval_context_throw_dom_exception.js b/tests/specs/run/eval_context_throw_dom_exception/eval_context_throw_dom_exception.js new file mode 100644 index 000000000..99eaa0f4a --- /dev/null +++ b/tests/specs/run/eval_context_throw_dom_exception/eval_context_throw_dom_exception.js @@ -0,0 +1,5 @@ +const [, errorInfo] = Deno[Deno.internal].core.evalContext( + 'throw new DOMException("foo")', + new URL("..", import.meta.url).href, +); +console.log(errorInfo); diff --git a/tests/specs/run/eval_context_throw_dom_exception/eval_context_throw_dom_exception.js.out b/tests/specs/run/eval_context_throw_dom_exception/eval_context_throw_dom_exception.js.out new file mode 100644 index 000000000..24ea0cffc --- /dev/null +++ b/tests/specs/run/eval_context_throw_dom_exception/eval_context_throw_dom_exception.js.out @@ -0,0 +1,8 @@ +{ + thrown: Error: foo + at [WILDCARD] + at Object.evalContext (ext:core/01_core.js:[WILDCARD]) + at file:///[WILDCARD]/eval_context_throw_dom_exception.js:1:48, + isNativeError: true, + isCompileError: false +} 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 000000000..b2540e03d --- /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/specs/run/event_listener_error/event_listener_error.ts b/tests/specs/run/event_listener_error/event_listener_error.ts new file mode 100644 index 000000000..1cbdf7bc2 --- /dev/null +++ b/tests/specs/run/event_listener_error/event_listener_error.ts @@ -0,0 +1,6 @@ +addEventListener("foo", () => { + throw new Error("bar"); +}); +console.log(1); +dispatchEvent(new CustomEvent("foo")); +console.log(2); diff --git a/tests/specs/run/event_listener_error/event_listener_error.ts.out b/tests/specs/run/event_listener_error/event_listener_error.ts.out new file mode 100644 index 000000000..a20a91dfd --- /dev/null +++ b/tests/specs/run/event_listener_error/event_listener_error.ts.out @@ -0,0 +1,7 @@ +1 +error: Uncaught Error: bar + throw new Error("bar"); + ^ + at [WILDCARD]/event_listener_error.ts:2:9 + at [WILDCARD] + at [WILDCARD]/event_listener_error.ts:5:1 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 000000000..f1fdcd5db --- /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/specs/run/event_listener_error_handled/event_listener_error_handled.ts b/tests/specs/run/event_listener_error_handled/event_listener_error_handled.ts new file mode 100644 index 000000000..c4c8fd1cd --- /dev/null +++ b/tests/specs/run/event_listener_error_handled/event_listener_error_handled.ts @@ -0,0 +1,23 @@ +addEventListener("error", (event) => { + console.log({ + cancelable: event.cancelable, + message: event.message, + filename: event.filename?.slice?.(-100), + lineno: event.lineno, + colno: event.colno, + error: event.error, + }); + event.preventDefault(); +}); + +onerror = (event) => { + console.log("onerror() called", event.error); +}; + +addEventListener("foo", () => { + throw new Error("bar"); +}); + +console.log(1); +dispatchEvent(new CustomEvent("foo")); +console.log(2); diff --git a/tests/specs/run/event_listener_error_handled/event_listener_error_handled.ts.out b/tests/specs/run/event_listener_error_handled/event_listener_error_handled.ts.out new file mode 100644 index 000000000..d3cf525c3 --- /dev/null +++ b/tests/specs/run/event_listener_error_handled/event_listener_error_handled.ts.out @@ -0,0 +1,17 @@ +1 +{ + cancelable: true, + message: "Uncaught Error: bar", + filename: "[WILDCARD]/event_listener_error_handled.ts", + lineno: 18, + colno: 9, + error: Error: bar + at [WILDCARD]/event_listener_error_handled.ts:18:9 + at [WILDCARD] + at [WILDCARD]/event_listener_error_handled.ts:22:1 +} +onerror() called Error: bar + at [WILDCARD]/event_listener_error_handled.ts:18:9 + at [WILDCARD] + at [WILDCARD]/event_listener_error_handled.ts:22:1 +2 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 000000000..2974c0e42 --- /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/specs/run/event_listener_error_immediate_exit/event_listener_error_immediate_exit.ts b/tests/specs/run/event_listener_error_immediate_exit/event_listener_error_immediate_exit.ts new file mode 100644 index 000000000..292a0df00 --- /dev/null +++ b/tests/specs/run/event_listener_error_immediate_exit/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/specs/run/event_listener_error_immediate_exit/event_listener_error_immediate_exit.ts.out b/tests/specs/run/event_listener_error_immediate_exit/event_listener_error_immediate_exit.ts.out new file mode 100644 index 000000000..8f03f71b8 --- /dev/null +++ b/tests/specs/run/event_listener_error_immediate_exit/event_listener_error_immediate_exit.ts.out @@ -0,0 +1,6 @@ +1 +error: Uncaught Error: bar + throw new Error("bar"); + ^ + at [WILDCARD]/event_listener_error_immediate_exit.ts:4:9[WILDCARD] + at [WILDCARD]/event_listener_error_immediate_exit.ts:11:1 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 000000000..6ef3ef2ed --- /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 000000000..292a0df00 --- /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/specs/run/event_listener_error_immediate_exit_worker/event_listener_error_immediate_exit_worker.ts b/tests/specs/run/event_listener_error_immediate_exit_worker/event_listener_error_immediate_exit_worker.ts new file mode 100644 index 000000000..58c45d1bb --- /dev/null +++ b/tests/specs/run/event_listener_error_immediate_exit_worker/event_listener_error_immediate_exit_worker.ts @@ -0,0 +1,4 @@ +new Worker( + import.meta.resolve("./event_listener_error_immediate_exit.ts"), + { type: "module" }, +); diff --git a/tests/specs/run/event_listener_error_immediate_exit_worker/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 new file mode 100644 index 000000000..85b52190b --- /dev/null +++ b/tests/specs/run/event_listener_error_immediate_exit_worker/event_listener_error_immediate_exit_worker.ts.out @@ -0,0 +1,8 @@ +1 +error: Uncaught (in worker "") Error: bar + throw new Error("bar"); + ^ + at [WILDCARD]/event_listener_error_immediate_exit.ts:4:9[WILDCARD] + at [WILDCARD]/event_listener_error_immediate_exit.ts:11:1 +error: Uncaught (in promise) Error: Unhandled error in child worker. + at [WILDCARD] diff --git a/tests/specs/run/exit_error42/__test__.jsonc b/tests/specs/run/exit_error42/__test__.jsonc new file mode 100644 index 000000000..43d308956 --- /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/specs/run/exit_error42/exit_error42.ts b/tests/specs/run/exit_error42/exit_error42.ts new file mode 100644 index 000000000..e4db41f3a --- /dev/null +++ b/tests/specs/run/exit_error42/exit_error42.ts @@ -0,0 +1,3 @@ +console.log("before"); +Deno.exit(42); +console.log("after"); diff --git a/tests/specs/run/exit_error42/exit_error42.ts.out b/tests/specs/run/exit_error42/exit_error42.ts.out new file mode 100644 index 000000000..90be1f305 --- /dev/null +++ b/tests/specs/run/exit_error42/exit_error42.ts.out @@ -0,0 +1 @@ +before 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 000000000..7062e6f36 --- /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/specs/run/explicit_resource_management/explicit_resource_management/main.out b/tests/specs/run/explicit_resource_management/explicit_resource_management/main.out new file mode 100644 index 000000000..ff5ac4b59 --- /dev/null +++ b/tests/specs/run/explicit_resource_management/explicit_resource_management/main.out @@ -0,0 +1,5 @@ +A +Disposed +B +Async disposed +C diff --git a/tests/specs/run/explicit_resource_management/explicit_resource_management/main.ts b/tests/specs/run/explicit_resource_management/explicit_resource_management/main.ts new file mode 100644 index 000000000..0201a51f9 --- /dev/null +++ b/tests/specs/run/explicit_resource_management/explicit_resource_management/main.ts @@ -0,0 +1,21 @@ +class Resource { + [Symbol.dispose]() { + console.log("Disposed"); + } +} +class AsyncResource { + async [Symbol.asyncDispose]() { + await new Promise((resolve) => setTimeout(resolve, 10)); + console.log("Async disposed"); + } +} + +{ + using resource = new Resource(); + console.log("A"); +} +{ + await using resource = new AsyncResource(); + console.log("B"); +} +console.log("C"); 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 000000000..0806088b4 --- /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 000000000..3c49f7484 --- /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 000000000..7ae7b9168 --- /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 000000000..152f57807 --- /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/specs/run/fetch_async_error_stack/fetch_async_error_stack.ts b/tests/specs/run/fetch_async_error_stack/fetch_async_error_stack.ts new file mode 100644 index 000000000..f583192c2 --- /dev/null +++ b/tests/specs/run/fetch_async_error_stack/fetch_async_error_stack.ts @@ -0,0 +1 @@ +await fetch("https://nonexistent.deno.land/"); diff --git a/tests/specs/run/fetch_async_error_stack/fetch_async_error_stack.ts.out b/tests/specs/run/fetch_async_error_stack/fetch_async_error_stack.ts.out new file mode 100644 index 000000000..2722cc8a7 --- /dev/null +++ b/tests/specs/run/fetch_async_error_stack/fetch_async_error_stack.ts.out @@ -0,0 +1,5 @@ +error: Uncaught (in promise) TypeError: error sending request for url (https://nonexistent.deno.land/): client error[WILDCARD] +await fetch("https://nonexistent.deno.land/"); +^[WILDCARD] + at async fetch (ext:[WILDCARD]) + at async file:///[WILDCARD]/fetch_async_error_stack.ts:1:1 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 000000000..51a7e2b04 --- /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/specs/run/fetch_response_finalization/fetch_response_finalization.js b/tests/specs/run/fetch_response_finalization/fetch_response_finalization.js new file mode 100644 index 000000000..85fc6afa3 --- /dev/null +++ b/tests/specs/run/fetch_response_finalization/fetch_response_finalization.js @@ -0,0 +1,16 @@ +async function doAFetch() { + const resp = await fetch("http://localhost:4545/README.md"); + console.log(Deno[Deno.internal].core.resources()); // print the current resources + const _resp = resp; + // at this point resp can be GC'ed +} + +await doAFetch(); // create a resource + +globalThis.gc(); // force GC + +// It is very important that there is a yield here, otherwise the finalizer for +// the response body is not called and the resource is not closed. +await new Promise((resolve) => setTimeout(resolve, 0)); + +console.log(Deno[Deno.internal].core.resources()); // print the current resources diff --git a/tests/specs/run/fetch_response_finalization/fetch_response_finalization.js.out b/tests/specs/run/fetch_response_finalization/fetch_response_finalization.js.out new file mode 100644 index 000000000..645842a5b --- /dev/null +++ b/tests/specs/run/fetch_response_finalization/fetch_response_finalization.js.out @@ -0,0 +1,2 @@ +{ "0": "stdin", "1": "stdout", "2": "stderr", "5": "fetchResponse" } +{ "0": "stdin", "1": "stdout", "2": "stderr" } diff --git a/tests/specs/run/finalization_registry/__test__.jsonc b/tests/specs/run/finalization_registry/__test__.jsonc new file mode 100644 index 000000000..f7526506c --- /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/specs/run/finalization_registry/finalization_registry.js b/tests/specs/run/finalization_registry/finalization_registry.js new file mode 100644 index 000000000..ee9dc384f --- /dev/null +++ b/tests/specs/run/finalization_registry/finalization_registry.js @@ -0,0 +1,20 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +"use strict"; + +function assertEquals(a, b) { + if (a === b) return; + throw a + " does not equal " + b; +} + +const registry = new FinalizationRegistry((value) => { + assertEquals(value, "called!"); + Deno[Deno.internal].core.print("FinalizationRegistry called!\n"); +}); + +(function () { + let x = {}; + registry.register(x, "called!"); + x = null; +})(); + +gc(); diff --git a/tests/specs/run/finalization_registry/finalization_registry.js.out b/tests/specs/run/finalization_registry/finalization_registry.js.out new file mode 100644 index 000000000..fee61413a --- /dev/null +++ b/tests/specs/run/finalization_registry/finalization_registry.js.out @@ -0,0 +1 @@ +FinalizationRegistry called! 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 000000000..d9302d2ca --- /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 000000000..6ea50d360 --- /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 000000000..20546455e --- /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/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js b/tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js new file mode 100644 index 000000000..e105cbada --- /dev/null +++ b/tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js @@ -0,0 +1,7 @@ +import("./b.js").catch(() => { + console.log("caught import error from b.js"); +}); + +import("./c.js").catch(() => { + console.log("caught import error from c.js"); +}); diff --git a/tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js.out b/tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js.out new file mode 100644 index 000000000..e7856fb9c --- /dev/null +++ b/tests/specs/run/fix_dynamic_import_errors/fix_dynamic_import_errors.js.out @@ -0,0 +1,2 @@ +caught import error from [WILDCARD].js +caught import error from [WILDCARD].js 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 000000000..ef1445e0e --- /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 000000000..425b80f24 --- /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 000000000..b94af2730 --- /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/specs/run/fix_emittable_skipped/fix_emittable_skipped.ts.out b/tests/specs/run/fix_emittable_skipped/fix_emittable_skipped.ts.out new file mode 100644 index 000000000..865759299 --- /dev/null +++ b/tests/specs/run/fix_emittable_skipped/fix_emittable_skipped.ts.out @@ -0,0 +1 @@ +[Function (anonymous)] 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 000000000..7af67c4c0 --- /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 000000000..94b1df540 --- /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 000000000..4862f03e1 --- /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/specs/run/fix_js_import_js/fix_js_import_js.ts.out b/tests/specs/run/fix_js_import_js/fix_js_import_js.ts.out new file mode 100644 index 000000000..27ba77dda --- /dev/null +++ b/tests/specs/run/fix_js_import_js/fix_js_import_js.ts.out @@ -0,0 +1 @@ +true 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 000000000..71332dbc4 --- /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 000000000..5e17c9ee0 --- /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 000000000..a3635d18c --- /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 000000000..f27e505e4 --- /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 000000000..07e68a135 --- /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/specs/run/fix_js_imports/fix_js_imports.ts.out b/tests/specs/run/fix_js_imports/fix_js_imports.ts.out new file mode 100644 index 000000000..c427932a4 --- /dev/null +++ b/tests/specs/run/fix_js_imports/fix_js_imports.ts.out @@ -0,0 +1 @@ +[Module: null prototype] { } 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 000000000..d2b0bda29 --- /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/specs/run/fix_tsc_file_exists/fix_tsc_file_exists.out b/tests/specs/run/fix_tsc_file_exists/fix_tsc_file_exists.out new file mode 100644 index 000000000..ce0136250 --- /dev/null +++ b/tests/specs/run/fix_tsc_file_exists/fix_tsc_file_exists.out @@ -0,0 +1 @@ +hello 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 000000000..5a7b3ff93 --- /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 000000000..3c74b8c83 --- /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 000000000..191660935 --- /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 000000000..cff71c44a --- /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 000000000..b7f46b351 --- /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 000000000..45e49b87f --- /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/specs/run/fix_worker_dispatchevent/fix_worker_dispatchevent.ts b/tests/specs/run/fix_worker_dispatchevent/fix_worker_dispatchevent.ts new file mode 100644 index 000000000..1b73b52dc --- /dev/null +++ b/tests/specs/run/fix_worker_dispatchevent/fix_worker_dispatchevent.ts @@ -0,0 +1,43 @@ +const code = ` +addEventListener("message", () => { + postMessage("pong"); +}); + +const context = new EventTarget(); + +Object.defineProperty(globalThis, "dispatchEvent", { + value: context.dispatchEvent.bind(context), + writable: true, + enumerable: true, + configurable: true, +}); + +postMessage("start"); +`; + +const blob = new Blob([code], { type: "application/javascript" }); + +const url = URL.createObjectURL(blob); + +const worker = new Worker(url, { type: "module" }); + +let terminated = false; + +worker.addEventListener("message", (evt) => { + if (evt.data === "start") { + worker.postMessage("ping"); + } else if (evt.data === "pong") { + worker.terminate(); + terminated = true; + console.log("success"); + } else { + throw new Error("unexpected message from worker"); + } +}); + +setTimeout(() => { + if (!terminated) { + worker.terminate(); + throw new Error("did not receive message from worker in time"); + } +}, 2000); diff --git a/tests/specs/run/fix_worker_dispatchevent/fix_worker_dispatchevent.ts.out b/tests/specs/run/fix_worker_dispatchevent/fix_worker_dispatchevent.ts.out new file mode 100644 index 000000000..2e9ba477f --- /dev/null +++ b/tests/specs/run/fix_worker_dispatchevent/fix_worker_dispatchevent.ts.out @@ -0,0 +1 @@ +success 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 000000000..b94e3d8c9 --- /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/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/main.ts b/tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/main.ts new file mode 100644 index 000000000..a8508f942 --- /dev/null +++ b/tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/main.ts @@ -0,0 +1,14 @@ +// https://github.com/denoland/deno/issues/14726 + +// Any dynamic modules that are only pending on a TLA import should be resolved +// in the same event loop iteration as the imported module. + +// Long-running timer so the event loop doesn't have a next iteration for a +// while. +setTimeout(() => {}, 24 * 60 * 60 * 1000); + +await import("./sub1.ts"); + +// If we reach here, the test is passed. +console.log("Done."); +Deno.exit(); diff --git a/tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/main.ts.out b/tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/main.ts.out new file mode 100644 index 000000000..a19976d4a --- /dev/null +++ b/tests/specs/run/followup_dyn_import_resolved/followup_dyn_import_resolves/main.ts.out @@ -0,0 +1,3 @@ +sub2 +sub1 +Done. 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 000000000..d06c30221 --- /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 000000000..cce2b524c --- /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 000000000..6429d7cf5 --- /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/specs/run/heapstats/heapstats.js b/tests/specs/run/heapstats/heapstats.js new file mode 100644 index 000000000..b93c9c120 --- /dev/null +++ b/tests/specs/run/heapstats/heapstats.js @@ -0,0 +1,37 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +"use strict"; + +function allocTest(alloc, allocAssert, deallocAssert) { + // Helper func that GCs then returns memory usage + const sample = () => { + // deno-lint-ignore no-undef + gc(); + return Deno.memoryUsage(); + }; + const delta = (t1, t2) => t2.heapUsed - t1.heapUsed; + + // Sample "clean" heap usage + const t1 = sample(); + + // Alloc + // deno-lint-ignore no-unused-vars + let x = alloc(); + const t2 = sample(); + allocAssert(delta(t1, t2)); + + // Free + x = null; + const t3 = sample(); + deallocAssert(delta(t2, t3)); +} + +function main() { + // Large-array test, 1M slot array consumes ~4MB (4B per slot) + allocTest( + () => new Array(1e6), + (delta) => console.log("Allocated:", Math.round(delta / 1e6) + "MB"), + (delta) => console.log("Freed:", Math.round(delta / 1e6) + "MB"), + ); +} + +main(); diff --git a/tests/specs/run/heapstats/heapstats.js.out b/tests/specs/run/heapstats/heapstats.js.out new file mode 100644 index 000000000..954266333 --- /dev/null +++ b/tests/specs/run/heapstats/heapstats.js.out @@ -0,0 +1,2 @@ +Allocated: 8MB +Freed: -8MB diff --git a/tests/specs/run/https_import/RootCA.pem b/tests/specs/run/https_import/RootCA.pem new file mode 100644 index 000000000..c2f84ceeb --- /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 000000000..9a37230f2 --- /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 000000000..d392f4a5d --- /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/specs/run/https_import/https_import.ts.out b/tests/specs/run/https_import/https_import.ts.out new file mode 100644 index 000000000..e965047ad --- /dev/null +++ b/tests/specs/run/https_import/https_import.ts.out @@ -0,0 +1 @@ +Hello 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 000000000..b9c0ad527 --- /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 000000000..f6e2dbf27 --- /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/specs/run/if_main/if_main.ts b/tests/specs/run/if_main/if_main.ts new file mode 100644 index 000000000..4dcfecea0 --- /dev/null +++ b/tests/specs/run/if_main/if_main.ts @@ -0,0 +1,6 @@ +if (import.meta.main) { + console.log("main"); +} else { + console.log("import.meta.url", import.meta.url); + throw Error("not main"); +} 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 000000000..ba2906d06 --- /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 000000000..0a6137a2b --- /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 000000000..37b3ee1e0 --- /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 000000000..24f29de72 --- /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 000000000..2d9c6757f --- /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 000000000..75962e88d --- /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 000000000..37b3ee1e0 --- /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 000000000..7a7b4c91f --- /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 000000000..093136fb0 --- /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 000000000..2d08c66d3 --- /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 000000000..37b3ee1e0 --- /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 000000000..29b24b965 --- /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 000000000..0bc3a93f8 --- /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 000000000..05a64aab5 --- /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 000000000..37b3ee1e0 --- /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 000000000..41af79d7c --- /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 000000000..ac3ee694f --- /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 000000000..e6175691c --- /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 000000000..4ea39e6d3 --- /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 000000000..37b3ee1e0 --- /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 000000000..e57dffa99 --- /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 000000000..f585b893f --- /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 000000000..89f6e0a79 --- /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 000000000..37b3ee1e0 --- /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 000000000..2fc26dae3 --- /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 000000000..36e47bd5b --- /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 000000000..9ae6b5a42 --- /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/specs/run/import_blob_url/import_blob_url.ts b/tests/specs/run/import_blob_url/import_blob_url.ts new file mode 100644 index 000000000..86bb634e1 --- /dev/null +++ b/tests/specs/run/import_blob_url/import_blob_url.ts @@ -0,0 +1,13 @@ +const blob = new Blob( + ['export const a = "a";\n\nexport enum A {\n A,\n B,\n C,\n}\n'], + { + type: "application/typescript", + }, +); +const url = URL.createObjectURL(blob); + +const a = await import(url); + +console.log(a.a); +console.log(a.A); +console.log(a.A.A); diff --git a/tests/specs/run/import_blob_url/import_blob_url.ts.out b/tests/specs/run/import_blob_url/import_blob_url.ts.out new file mode 100644 index 000000000..bfa0b9d94 --- /dev/null +++ b/tests/specs/run/import_blob_url/import_blob_url.ts.out @@ -0,0 +1,3 @@ +a +{ "0": "A", "1": "B", "2": "C", A: 0, B: 1, C: 2 } +0 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 000000000..56a1489cd --- /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/specs/run/import_blob_url_error_stack/import_blob_url_error_stack.ts b/tests/specs/run/import_blob_url_error_stack/import_blob_url_error_stack.ts new file mode 100644 index 000000000..f9c4f2e9d --- /dev/null +++ b/tests/specs/run/import_blob_url_error_stack/import_blob_url_error_stack.ts @@ -0,0 +1,13 @@ +const blob = new Blob( + [ + "enum A {\n A,\n B,\n C,\n }\n \n export function a() {\n throw new Error(`Hello ${A.C}`);\n }\n ", + ], + { + type: "application/typescript", + }, +); +const url = URL.createObjectURL(blob); + +const { a } = await import(url); + +a(); diff --git a/tests/specs/run/import_blob_url_error_stack/import_blob_url_error_stack.ts.out b/tests/specs/run/import_blob_url_error_stack/import_blob_url_error_stack.ts.out new file mode 100644 index 000000000..201556b8a --- /dev/null +++ b/tests/specs/run/import_blob_url_error_stack/import_blob_url_error_stack.ts.out @@ -0,0 +1,5 @@ +error: Uncaught (in promise) Error: Hello 2 + throw new Error(`Hello ${A.C}`); + ^ + at a (blob:null/[WILDCARD]:8:10) + at file:///[WILDCARD]/import_blob_url_error_stack.ts:13:1 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 000000000..4fda81b31 --- /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/specs/run/import_blob_url_import_relative/import_blob_url_import_relative.ts b/tests/specs/run/import_blob_url_import_relative/import_blob_url_import_relative.ts new file mode 100644 index 000000000..ad130bdac --- /dev/null +++ b/tests/specs/run/import_blob_url_import_relative/import_blob_url_import_relative.ts @@ -0,0 +1,8 @@ +const blob = new Blob(['export { a } from "./a.ts";'], { + type: "application/javascript", +}); +const url = URL.createObjectURL(blob); + +const a = await import(url); + +console.log(a); diff --git a/tests/specs/run/import_blob_url_import_relative/import_blob_url_import_relative.ts.out b/tests/specs/run/import_blob_url_import_relative/import_blob_url_import_relative.ts.out new file mode 100644 index 000000000..59a6f07fb --- /dev/null +++ b/tests/specs/run/import_blob_url_import_relative/import_blob_url_import_relative.ts.out @@ -0,0 +1,5 @@ +error: Uncaught (in promise) TypeError: invalid URL: relative URL with a cannot-be-a-base base + at blob:null/[WILDCARD]:1:19 +const a = await import(url); + ^ + at async file://[WILDCARD]/import_blob_url_import_relative.ts:6:11 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 000000000..511d22a59 --- /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/specs/run/import_blob_url_imports/import_blob_url_imports.ts b/tests/specs/run/import_blob_url_imports/import_blob_url_imports.ts new file mode 100644 index 000000000..a7c639152 --- /dev/null +++ b/tests/specs/run/import_blob_url_imports/import_blob_url_imports.ts @@ -0,0 +1,11 @@ +const blob = new Blob( + [ + 'export { printHello } from "http://localhost:4545/subdir/mod2.ts"', + ], + { type: "application/javascript" }, +); +const url = URL.createObjectURL(blob); + +const { printHello } = await import(url); + +printHello(); diff --git a/tests/specs/run/import_blob_url_imports/import_blob_url_imports.ts.out b/tests/specs/run/import_blob_url_imports/import_blob_url_imports.ts.out new file mode 100644 index 000000000..e965047ad --- /dev/null +++ b/tests/specs/run/import_blob_url_imports/import_blob_url_imports.ts.out @@ -0,0 +1 @@ +Hello 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 000000000..985c6f842 --- /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/specs/run/import_blob_url_jsx/import_blob_url_jsx.ts b/tests/specs/run/import_blob_url_jsx/import_blob_url_jsx.ts new file mode 100644 index 000000000..8d645796a --- /dev/null +++ b/tests/specs/run/import_blob_url_jsx/import_blob_url_jsx.ts @@ -0,0 +1,16 @@ +const blob = new Blob( + ["export default function() {\n return
Hello Deno!
\n}\n"], + { type: "text/jsx" }, +); +const url = URL.createObjectURL(blob); + +const { default: render } = await import(url); + +// deno-lint-ignore no-explicit-any +(globalThis as any).React = { + createElement(...args: unknown[]) { + console.log(...args); + }, +}; + +render(); diff --git a/tests/specs/run/import_blob_url_jsx/import_blob_url_jsx.ts.out b/tests/specs/run/import_blob_url_jsx/import_blob_url_jsx.ts.out new file mode 100644 index 000000000..c1c85f250 --- /dev/null +++ b/tests/specs/run/import_blob_url_jsx/import_blob_url_jsx.ts.out @@ -0,0 +1 @@ +div null Hello Deno! diff --git a/tests/specs/run/import_compression/__test__.jsonc b/tests/specs/run/import_compression/__test__.jsonc new file mode 100644 index 000000000..c8f7af9e1 --- /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 000000000..65f679d57 --- /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 000000000..9f9a7bc69 Binary files /dev/null and b/tests/specs/run/import_compression/import_compression/gziped differ diff --git a/tests/specs/run/import_compression/import_compression/main.out b/tests/specs/run/import_compression/import_compression/main.out new file mode 100644 index 000000000..371994979 --- /dev/null +++ b/tests/specs/run/import_compression/import_compression/main.out @@ -0,0 +1,4 @@ +gzip +brotli +console.log('gzip') +console.log('brotli'); diff --git a/tests/specs/run/import_compression/import_compression/main.ts b/tests/specs/run/import_compression/import_compression/main.ts new file mode 100644 index 000000000..3dcd6fa24 --- /dev/null +++ b/tests/specs/run/import_compression/import_compression/main.ts @@ -0,0 +1,13 @@ +import "http://127.0.0.1:4545/run/import_compression/gziped"; +import "http://127.0.0.1:4545/run/import_compression/brotli"; + +console.log( + await fetch( + "http://127.0.0.1:4545/run/import_compression/gziped", + ).then((res) => res.text()), +); +console.log( + await fetch( + "http://127.0.0.1:4545/run/import_compression/brotli", + ).then((res) => res.text()), +); 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 000000000..95d1c94a3 --- /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/specs/run/import_data_url/import_data_url.ts b/tests/specs/run/import_data_url/import_data_url.ts new file mode 100644 index 000000000..258514a5e --- /dev/null +++ b/tests/specs/run/import_data_url/import_data_url.ts @@ -0,0 +1,12 @@ +// export const a = "a"; + +// export enum A { +// A, +// B, +// C, +// } +import * as a from "data:application/typescript;base64,ZXhwb3J0IGNvbnN0IGEgPSAiYSI7CgpleHBvcnQgZW51bSBBIHsKICBBLAogIEIsCiAgQywKfQo="; + +console.log(a.a); +console.log(a.A); +console.log(a.A.A); diff --git a/tests/specs/run/import_data_url/import_data_url.ts.out b/tests/specs/run/import_data_url/import_data_url.ts.out new file mode 100644 index 000000000..bfa0b9d94 --- /dev/null +++ b/tests/specs/run/import_data_url/import_data_url.ts.out @@ -0,0 +1,3 @@ +a +{ "0": "A", "1": "B", "2": "C", A: 0, B: 1, C: 2 } +0 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 000000000..851aae191 --- /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/specs/run/import_data_url_error_stack/import_data_url_error_stack.ts b/tests/specs/run/import_data_url_error_stack/import_data_url_error_stack.ts new file mode 100644 index 000000000..022e49fe1 --- /dev/null +++ b/tests/specs/run/import_data_url_error_stack/import_data_url_error_stack.ts @@ -0,0 +1,3 @@ +import { a } from "data:application/typescript;base64,ZW51bSBBIHsKICBBLAogIEIsCiAgQywKIH0KIAogZXhwb3J0IGZ1bmN0aW9uIGEoKSB7CiAgIHRocm93IG5ldyBFcnJvcihgSGVsbG8gJHtBLkN9YCk7CiB9CiA="; + +a(); diff --git a/tests/specs/run/import_data_url_error_stack/import_data_url_error_stack.ts.out b/tests/specs/run/import_data_url_error_stack/import_data_url_error_stack.ts.out new file mode 100644 index 000000000..83eed611d --- /dev/null +++ b/tests/specs/run/import_data_url_error_stack/import_data_url_error_stack.ts.out @@ -0,0 +1,5 @@ +error: Uncaught (in promise) Error: Hello 2 + throw new Error(`Hello ${A.C}`); + ^ + at a (data:application/typescript;base64,ZW51bSBBIHsKICBBLAog......JHtBLkN9YCk7CiB9CiA=:8:10) + at file:///[WILDCARD]/import_data_url_error_stack.ts:3:1 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 000000000..b241bc917 --- /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/specs/run/import_data_url_import_relative/import_data_url_import_relative.ts b/tests/specs/run/import_data_url_import_relative/import_data_url_import_relative.ts new file mode 100644 index 000000000..23947fe60 --- /dev/null +++ b/tests/specs/run/import_data_url_import_relative/import_data_url_import_relative.ts @@ -0,0 +1,4 @@ +// export { a } from "./a.ts"; +import * as a from "data:application/javascript;base64,ZXhwb3J0IHsgYSB9IGZyb20gIi4vYS50cyI7Cg=="; + +console.log(a); diff --git a/tests/specs/run/import_data_url_import_relative/import_data_url_import_relative.ts.out b/tests/specs/run/import_data_url_import_relative/import_data_url_import_relative.ts.out new file mode 100644 index 000000000..821c3e4df --- /dev/null +++ b/tests/specs/run/import_data_url_import_relative/import_data_url_import_relative.ts.out @@ -0,0 +1,2 @@ +error: invalid URL: relative URL with a cannot-be-a-base base + at data:application/javascript;base64,ZXhwb3J0IHsgYSB9IGZyb20gIi4vYS50cyI7Cg==:1:19 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 000000000..7fc8df315 --- /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/specs/run/import_data_url_imports/import_data_url_imports.ts b/tests/specs/run/import_data_url_imports/import_data_url_imports.ts new file mode 100644 index 000000000..df7dae727 --- /dev/null +++ b/tests/specs/run/import_data_url_imports/import_data_url_imports.ts @@ -0,0 +1,4 @@ +// export { printHello } from "http://localhost:4545/subdir/mod2.ts"; +import { printHello } from "data:application/typescript;base64,ZXhwb3J0IHsgcHJpbnRIZWxsbyB9IGZyb20gImh0dHA6Ly9sb2NhbGhvc3Q6NDU0NS9zdWJkaXIvbW9kMi50cyI7"; + +printHello(); diff --git a/tests/specs/run/import_data_url_imports/import_data_url_imports.ts.out b/tests/specs/run/import_data_url_imports/import_data_url_imports.ts.out new file mode 100644 index 000000000..e965047ad --- /dev/null +++ b/tests/specs/run/import_data_url_imports/import_data_url_imports.ts.out @@ -0,0 +1 @@ +Hello 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 000000000..8fb1f9a1d --- /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/specs/run/import_data_url_jsx/import_data_url_jsx.ts b/tests/specs/run/import_data_url_jsx/import_data_url_jsx.ts new file mode 100644 index 000000000..1881211f9 --- /dev/null +++ b/tests/specs/run/import_data_url_jsx/import_data_url_jsx.ts @@ -0,0 +1,10 @@ +import render from "data:text/jsx;base64,ZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oKSB7CiAgcmV0dXJuIDxkaXY+SGVsbG8gRGVubyE8L2Rpdj4KfQo="; + +// deno-lint-ignore no-explicit-any +(globalThis as any).React = { + createElement(...args: unknown[]) { + console.log(...args); + }, +}; + +render(); diff --git a/tests/specs/run/import_data_url_jsx/import_data_url_jsx.ts.out b/tests/specs/run/import_data_url_jsx/import_data_url_jsx.ts.out new file mode 100644 index 000000000..c1c85f250 --- /dev/null +++ b/tests/specs/run/import_data_url_jsx/import_data_url_jsx.ts.out @@ -0,0 +1 @@ +div null Hello Deno! 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 000000000..09ff77f41 --- /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/specs/run/import_dynamic_data_url/import_dynamic_data_url.ts b/tests/specs/run/import_dynamic_data_url/import_dynamic_data_url.ts new file mode 100644 index 000000000..53a0fbcd3 --- /dev/null +++ b/tests/specs/run/import_dynamic_data_url/import_dynamic_data_url.ts @@ -0,0 +1,14 @@ +// export const a = "a"; + +// export enum A { +// A, +// B, +// C, +// } +const a = await import( + "data:application/typescript;base64,ZXhwb3J0IGNvbnN0IGEgPSAiYSI7CgpleHBvcnQgZW51bSBBIHsKICBBLAogIEIsCiAgQywKfQo=" +); + +console.log(a.a); +console.log(a.A); +console.log(a.A.A); diff --git a/tests/specs/run/import_dynamic_data_url/import_dynamic_data_url.ts.out b/tests/specs/run/import_dynamic_data_url/import_dynamic_data_url.ts.out new file mode 100644 index 000000000..bfa0b9d94 --- /dev/null +++ b/tests/specs/run/import_dynamic_data_url/import_dynamic_data_url.ts.out @@ -0,0 +1,3 @@ +a +{ "0": "A", "1": "B", "2": "C", A: 0, B: 1, C: 2 } +0 diff --git a/tests/specs/run/import_extensionless/__test__.jsonc b/tests/specs/run/import_extensionless/__test__.jsonc new file mode 100644 index 000000000..cde59b5e2 --- /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/specs/run/import_extensionless/import_extensionless.ts b/tests/specs/run/import_extensionless/import_extensionless.ts new file mode 100644 index 000000000..689d553ff --- /dev/null +++ b/tests/specs/run/import_extensionless/import_extensionless.ts @@ -0,0 +1,3 @@ +import { printHello3 } from "http://localhost:4545/v1/extensionless"; + +printHello3(); 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 000000000..e965047ad --- /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 000000000..5e6602ab3 --- /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/specs/run/import_file_with_colon/import_file_with_colon.ts b/tests/specs/run/import_file_with_colon/import_file_with_colon.ts new file mode 100644 index 000000000..619bdd66d --- /dev/null +++ b/tests/specs/run/import_file_with_colon/import_file_with_colon.ts @@ -0,0 +1 @@ +import "http://localhost:4545/subdir/file_with_:_in_name.ts"; diff --git a/tests/specs/run/import_file_with_colon/import_file_with_colon.ts.out b/tests/specs/run/import_file_with_colon/import_file_with_colon.ts.out new file mode 100644 index 000000000..f60bbf4b1 --- /dev/null +++ b/tests/specs/run/import_file_with_colon/import_file_with_colon.ts.out @@ -0,0 +1 @@ +Hello from file_with_:_in_name.ts diff --git a/tests/specs/run/import_type/__test__.jsonc b/tests/specs/run/import_type/__test__.jsonc new file mode 100644 index 000000000..2958483d0 --- /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 000000000..18c8ed881 --- /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 000000000..91baba19a --- /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/specs/run/import_type/import_type.ts.out b/tests/specs/run/import_type/import_type.ts.out new file mode 100644 index 000000000..e35539e35 --- /dev/null +++ b/tests/specs/run/import_type/import_type.ts.out @@ -0,0 +1 @@ +B { a: "a" } 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 000000000..d858f5fa1 --- /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 000000000..18c8ed881 --- /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 000000000..91baba19a --- /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 000000000..e35539e35 --- /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 000000000..99ca6c1ae --- /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/specs/run/inline_js_source_map_2/inline_js_source_map_2.js b/tests/specs/run/inline_js_source_map_2/inline_js_source_map_2.js new file mode 100644 index 000000000..87132ee6a --- /dev/null +++ b/tests/specs/run/inline_js_source_map_2/inline_js_source_map_2.js @@ -0,0 +1,4 @@ +"use strict"; +1 + 1; +throw new Error("Hello world!"); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L3J1bi9pbmxpbmVfanNfc291cmNlX21hcF8yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxDQUFDLEdBQUMsQ0FBQyxDQUFDO0FBS0osTUFBTSxJQUFJLEtBQUssQ0FBQyxjQUErQixDQUFDLENBQUMifQ== diff --git a/tests/specs/run/inline_js_source_map_2/inline_js_source_map_2.js.out b/tests/specs/run/inline_js_source_map_2/inline_js_source_map_2.js.out new file mode 100644 index 000000000..ba3053eba --- /dev/null +++ b/tests/specs/run/inline_js_source_map_2/inline_js_source_map_2.js.out @@ -0,0 +1,2 @@ +error: Uncaught (in promise) Error: Hello world! + at http://localhost:4545/run/inline_js_source_map_2.ts:6:7 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 000000000..45fe6eba6 --- /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/specs/run/inline_js_source_map_2_with_inline_contents/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 new file mode 100644 index 000000000..41bee7fe4 --- /dev/null +++ b/tests/specs/run/inline_js_source_map_2_with_inline_contents/inline_js_source_map_2_with_inline_contents.js @@ -0,0 +1,4 @@ +"use strict"; + +throw new Error("Hello world!"); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L3J1bi9pbmxpbmVfanNfc291cmNlX21hcF8yLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIjErMTtcbmludGVyZmFjZSBUZXN0IHtcbiAgaGVsbG86IHN0cmluZztcbn1cblxudGhyb3cgbmV3IEVycm9yKFwiSGVsbG8gd29ybGQhXCIgYXMgdW5rbm93biBhcyBzdHJpbmcpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxDQUFDLEdBQUMsQ0FBQyxDQUFDO0FBS0osTUFBTSxJQUFJLEtBQUssQ0FBQyxjQUErQixDQUFDLENBQUMifQ== diff --git a/tests/specs/run/inline_js_source_map_2_with_inline_contents/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 new file mode 100644 index 000000000..ba3053eba --- /dev/null +++ b/tests/specs/run/inline_js_source_map_2_with_inline_contents/inline_js_source_map_2_with_inline_contents.js.out @@ -0,0 +1,2 @@ +error: Uncaught (in promise) Error: Hello world! + at http://localhost:4545/run/inline_js_source_map_2.ts:6:7 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 000000000..71dc4d509 --- /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/specs/run/inline_js_source_map_with_contents_from_graph/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 new file mode 100644 index 000000000..12fa1644d --- /dev/null +++ b/tests/specs/run/inline_js_source_map_with_contents_from_graph/inline_js_source_map_with_contents_from_graph.js @@ -0,0 +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= diff --git a/tests/specs/run/inline_js_source_map_with_contents_from_graph/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 new file mode 100644 index 000000000..d80a1c7bb --- /dev/null +++ b/tests/specs/run/inline_js_source_map_with_contents_from_graph/inline_js_source_map_with_contents_from_graph.js.out @@ -0,0 +1,4 @@ +error: Uncaught (in promise) Error: Hello world! +// throw new Error("Hello world!" as string); + ^ + at http://localhost:4545/run/inline_js_source_map.ts:6:7 diff --git a/tests/specs/run/issue_13562/__test__.jsonc b/tests/specs/run/issue_13562/__test__.jsonc new file mode 100644 index 000000000..1971d552b --- /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 000000000..51e97629b --- /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 000000000..e965047ad --- /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 000000000..5e58f432e --- /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 000000000..b9c0ad527 --- /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 000000000..59beb64c3 --- /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 000000000..9071d0aeb --- /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 000000000..6a648f476 --- /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/specs/run/js_import_detect/js_import_detect.ts b/tests/specs/run/js_import_detect/js_import_detect.ts new file mode 100644 index 000000000..751741996 --- /dev/null +++ b/tests/specs/run/js_import_detect/js_import_detect.ts @@ -0,0 +1,3 @@ +function define(_foo: string[]) {} +define(["long"]); +console.log("ok"); diff --git a/tests/specs/run/js_import_detect/js_import_detect.ts.out b/tests/specs/run/js_import_detect/js_import_detect.ts.out new file mode 100644 index 000000000..9766475a4 --- /dev/null +++ b/tests/specs/run/js_import_detect/js_import_detect.ts.out @@ -0,0 +1 @@ +ok 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 000000000..ebc4d7598 --- /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/specs/run/js_root_with_ts_check/js_root_with_ts_check.js b/tests/specs/run/js_root_with_ts_check/js_root_with_ts_check.js new file mode 100644 index 000000000..adca847ee --- /dev/null +++ b/tests/specs/run/js_root_with_ts_check/js_root_with_ts_check.js @@ -0,0 +1,5 @@ +// @ts-check + +/** @type {number} */ +const a = ""; +console.log(a); diff --git a/tests/specs/run/js_root_with_ts_check/js_root_with_ts_check.js.out b/tests/specs/run/js_root_with_ts_check/js_root_with_ts_check.js.out new file mode 100644 index 000000000..34e2fa61e --- /dev/null +++ b/tests/specs/run/js_root_with_ts_check/js_root_with_ts_check.js.out @@ -0,0 +1,4 @@ +error: TS2322 [ERROR]: Type 'string' is not assignable to type 'number'. +const a = ""; + ^ + at [WILDCARD] 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 000000000..0d2aac73b --- /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 000000000..4774be326 --- /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 000000000..1236c1e53 --- /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 000000000..0f89205dc --- /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 000000000..649230613 --- /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/specs/run/jsx_import_from_ts/jsx_import_from_ts.ts b/tests/specs/run/jsx_import_from_ts/jsx_import_from_ts.ts new file mode 100644 index 000000000..3cc916698 --- /dev/null +++ b/tests/specs/run/jsx_import_from_ts/jsx_import_from_ts.ts @@ -0,0 +1,3 @@ +import app from "./jsx_import_from_ts.App.jsx"; + +console.log(app); diff --git a/tests/specs/run/jsx_import_from_ts/jsx_import_from_ts.ts.out b/tests/specs/run/jsx_import_from_ts/jsx_import_from_ts.ts.out new file mode 100644 index 000000000..d449b8c9a --- /dev/null +++ b/tests/specs/run/jsx_import_from_ts/jsx_import_from_ts.ts.out @@ -0,0 +1 @@ +[Function: app] 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 000000000..22b1d29ca --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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/specs/run/jsx_import_source_error/jsx_import_source_error.out b/tests/specs/run/jsx_import_source_error/jsx_import_source_error.out new file mode 100644 index 000000000..634a5b09b --- /dev/null +++ b/tests/specs/run/jsx_import_source_error/jsx_import_source_error.out @@ -0,0 +1,2 @@ +error: Module not found "file:///[WILDCARD]/nonexistent/jsx-runtime". + at file:///[WILDCARD]/jsx_import_source_no_pragma.tsx:1:1 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 000000000..2c756054f --- /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 000000000..8a62c5243 --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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 000000000..0d3238967 --- /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 000000000..2c756054f --- /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 000000000..b62e7cb6f --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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 000000000..56f514d90 --- /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 000000000..2c756054f --- /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 000000000..ea4265484 --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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 000000000..0d3238967 --- /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 000000000..2c756054f --- /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 000000000..7678e18f4 --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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/specs/run/jsx_import_source_no_pragma/jsx_import_source.out b/tests/specs/run/jsx_import_source_no_pragma/jsx_import_source.out new file mode 100644 index 000000000..b9555987a --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma/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/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 000000000..2c756054f --- /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 000000000..8f9ee81f6 --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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/specs/run/jsx_import_source_no_pragma_dev/jsx_import_source_dev.out b/tests/specs/run/jsx_import_source_no_pragma_dev/jsx_import_source_dev.out new file mode 100644 index 000000000..38d7a12f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_no_pragma_dev/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_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 000000000..2c756054f --- /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 000000000..12cc9b076 --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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 000000000..b9555987a --- /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 000000000..2c756054f --- /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 000000000..9d704c065 --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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 000000000..b9555987a --- /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/specs/run/jsx_import_source_pragma/jsx_import_source_pragma.tsx b/tests/specs/run/jsx_import_source_pragma/jsx_import_source_pragma.tsx new file mode 100644 index 000000000..c19e53d4f --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma/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_import_map/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map/__test__.jsonc new file mode 100644 index 000000000..9eafe5196 --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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 000000000..0d3238967 --- /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/specs/run/jsx_import_source_pragma_import_map/jsx_import_source_pragma_import_map.tsx b/tests/specs/run/jsx_import_source_pragma_import_map/jsx_import_source_pragma_import_map.tsx new file mode 100644 index 000000000..548365f18 --- /dev/null +++ b/tests/specs/run/jsx_import_source_pragma_import_map/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_dev/__test__.jsonc b/tests/specs/run/jsx_import_source_pragma_import_map_dev/__test__.jsonc new file mode 100644 index 000000000..bb271c0ee --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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 000000000..56f514d90 --- /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 000000000..548365f18 --- /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 000000000..dd42b71fd --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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 000000000..0d3238967 --- /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 000000000..548365f18 --- /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 000000000..0956b94a7 --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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 000000000..b9555987a --- /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 000000000..c19e53d4f --- /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 000000000..aeaf209c3 --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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 000000000..b9555987a --- /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 000000000..c19e53d4f --- /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 000000000..3e8089fd2 --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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 000000000..b9555987a --- /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 000000000..c19e53d4f --- /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 000000000..03ed1af1b --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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 000000000..c8f0a908d --- /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 000000000..a770c3366 --- /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 000000000..b9555987a --- /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 000000000..c19e53d4f --- /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 000000000..56734e467 --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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 000000000..38d7a12f0 --- /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 000000000..c19e53d4f --- /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 000000000..c795a9d8e --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/no_pragma.out b/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/no_pragma.out new file mode 100644 index 000000000..f26984258 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/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/jsx_precompile/no_pragma.tsx b/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/no_pragma.tsx new file mode 100644 index 000000000..7ba21d80d --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/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/jsx_precompile/skip.out b/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/skip.out new file mode 100644 index 000000000..a32b616f0 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/skip.out @@ -0,0 +1,3 @@ +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/jsx_precompile/skip.tsx b/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/skip.tsx new file mode 100644 index 000000000..49bc4e2b7 --- /dev/null +++ b/tests/specs/run/jsx_import_source_precompile_import_map/jsx_precompile/skip.tsx @@ -0,0 +1,9 @@ +export function A() { + return ( +
+ foo +

hello

+ +
+ ); +} 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 000000000..7163c83d0 --- /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 000000000..37cb4dd91 --- /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 000000000..5adbfa8b5 --- /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 000000000..3c9e4fa1f --- /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 000000000..95ae1b9f3 --- /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 000000000..311409ea3 --- /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 000000000..311409ea3 --- /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 000000000..7481d5a2d --- /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 000000000..ae5bdf9f1 --- /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 000000000..011e8fe10 --- /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 000000000..9b2005128 --- /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 000000000..1bfa04e2f --- /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 000000000..15e2029c8 --- /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 000000000..0d56095e0 --- /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 000000000..15e2029c8 --- /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 000000000..f26984258 --- /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 000000000..7ba21d80d --- /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 000000000..6696c550c --- /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 000000000..49bc4e2b7 --- /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 000000000..d392f4a5d --- /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 000000000..e965047ad --- /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 000000000..e8ce4572e --- /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 000000000..20f7e2000 --- /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 000000000..b9c0ad527 --- /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 000000000..d985bd249 --- /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 000000000..b3e94678c --- /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 000000000..dc790528a --- /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/specs/run/lock_check_ok2/lock_check_ok2.json b/tests/specs/run/lock_check_ok2/lock_check_ok2.json new file mode 100644 index 000000000..55a6f9892 --- /dev/null +++ b/tests/specs/run/lock_check_ok2/lock_check_ok2.json @@ -0,0 +1,13 @@ +{ + "version": "4", + "remote": { + "http://localhost:4545/subdir/mt_application_ecmascript.j2.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_javascript.j4.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_ecmascript.j3.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_javascript.j1.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_typescript.t1.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_mp2t.t3.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_vdn.t2.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18" + } +} 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 000000000..d392f4a5d --- /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 000000000..e965047ad --- /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 000000000..d7b819d56 --- /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 000000000..47a761fbd --- /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 000000000..b9c0ad527 --- /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 000000000..d985bd249 --- /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 000000000..b3e94678c --- /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 000000000..a9430b4bc --- /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/specs/run/lock_v2_check_ok2/lock_v2_check_ok2.json b/tests/specs/run/lock_v2_check_ok2/lock_v2_check_ok2.json new file mode 100644 index 000000000..4356c9421 --- /dev/null +++ b/tests/specs/run/lock_v2_check_ok2/lock_v2_check_ok2.json @@ -0,0 +1,13 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/subdir/mt_application_ecmascript.j2.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_javascript.j4.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_ecmascript.j3.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_javascript.j1.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_typescript.t1.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_mp2t.t3.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_vdn.t2.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18" + } +} 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 000000000..f7ae56c63 --- /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/specs/run/long_data_url_formatting/long_data_url_formatting.ts b/tests/specs/run/long_data_url_formatting/long_data_url_formatting.ts new file mode 100644 index 000000000..2ed2d5a03 --- /dev/null +++ b/tests/specs/run/long_data_url_formatting/long_data_url_formatting.ts @@ -0,0 +1,3 @@ +await import( + 'data:application/typescript,console.trace("foo"); const error = new Error("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); console.log(error.stack); throw error;' +); diff --git a/tests/specs/run/long_data_url_formatting/long_data_url_formatting.ts.out b/tests/specs/run/long_data_url_formatting/long_data_url_formatting.ts.out new file mode 100644 index 000000000..ea78c2591 --- /dev/null +++ b/tests/specs/run/long_data_url_formatting/long_data_url_formatting.ts.out @@ -0,0 +1,8 @@ +[WILDCARD]Trace: foo + at data:application/typescript,console.trace("foo")......stack); throw error;:1:9 +Error: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + at data:application/typescript,console.trace("foo")......stack); throw error;:1:37 +error: Uncaught (in promise) Error: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +console.trace("foo"); const error = new Error("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); console.log(error.stack); throw error; + ^ + at data:application/typescript,console.trace("foo")......stack); throw error;:1:37 diff --git a/tests/specs/run/main_module/__test__.jsonc b/tests/specs/run/main_module/__test__.jsonc new file mode 100644 index 000000000..0d70eddbd --- /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/specs/run/main_module/main_module/main.out b/tests/specs/run/main_module/main_module/main.out new file mode 100644 index 000000000..29f592c2a --- /dev/null +++ b/tests/specs/run/main_module/main_module/main.out @@ -0,0 +1,2 @@ +other [WILDCARD]/main.ts +main [WILDCARD]/main.ts diff --git a/tests/specs/run/main_module/main_module/main.ts b/tests/specs/run/main_module/main_module/main.ts new file mode 100644 index 000000000..d2f2c66ee --- /dev/null +++ b/tests/specs/run/main_module/main_module/main.ts @@ -0,0 +1,3 @@ +console.log("main", Deno.mainModule); + +import "./other.ts"; diff --git a/tests/specs/run/main_module/main_module/other.ts b/tests/specs/run/main_module/main_module/other.ts new file mode 100644 index 000000000..b3e524b0a --- /dev/null +++ b/tests/specs/run/main_module/main_module/other.ts @@ -0,0 +1 @@ +console.log("other", Deno.mainModule); 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 000000000..b50bb4b19 --- /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 000000000..eeb200f59 --- /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 000000000..9233cce2f --- /dev/null +++ b/tests/specs/run/mts_dmts_mjs/mod.mjs @@ -0,0 +1 @@ +export const a = "a"; diff --git a/tests/specs/run/mts_dmts_mjs/mts_dmts_mjs.out b/tests/specs/run/mts_dmts_mjs/mts_dmts_mjs.out new file mode 100644 index 000000000..789819226 --- /dev/null +++ b/tests/specs/run/mts_dmts_mjs/mts_dmts_mjs.out @@ -0,0 +1 @@ +a 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 000000000..28c282146 --- /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 000000000..0d36517bc --- /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 000000000..eeb200f59 --- /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 000000000..9233cce2f --- /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 000000000..789819226 --- /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 000000000..28c282146 --- /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 000000000..d167832ba --- /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/specs/run/nested_error/nested_error/main.ts b/tests/specs/run/nested_error/nested_error/main.ts new file mode 100644 index 000000000..69828e1ca --- /dev/null +++ b/tests/specs/run/nested_error/nested_error/main.ts @@ -0,0 +1,3 @@ +throw { + foo: new Error(), +}; diff --git a/tests/specs/run/nested_error/nested_error/main.ts.out b/tests/specs/run/nested_error/nested_error/main.ts.out new file mode 100644 index 000000000..05780bc6a --- /dev/null +++ b/tests/specs/run/nested_error/nested_error/main.ts.out @@ -0,0 +1,4 @@ +error: Uncaught (in promise) { + foo: Error + at file:///[WILDCARD]/main.ts:2:8 +} 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 000000000..ad2d25915 --- /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 000000000..989ce33e9 --- /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 000000000..696e08e2a --- /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 000000000..ce1adc0e8 --- /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 000000000..b9c0ad527 --- /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 000000000..da50d30a0 --- /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 000000000..504cd646e --- /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 000000000..015f7076e --- /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 000000000..9f7ec550d --- /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 000000000..0fc1d4590 --- /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 000000000..40a26bbd4 --- /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 000000000..ea64fbaa6 --- /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 000000000..95fba6cd4 --- /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 000000000..39394952e --- /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 000000000..00c8a8502 --- /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 000000000..0a03dbc22 --- /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 000000000..783af44e4 --- /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/specs/run/no_config_auto_discovery_for_local_script/no_auto_discovery.out b/tests/specs/run/no_config_auto_discovery_for_local_script/no_auto_discovery.out new file mode 100644 index 000000000..f45a1097c --- /dev/null +++ b/tests/specs/run/no_config_auto_discovery_for_local_script/no_auto_discovery.out @@ -0,0 +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]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 000000000..b8485c845 --- /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/specs/run/no_lock_flag/no_lock_flag/deno.json b/tests/specs/run/no_lock_flag/no_lock_flag/deno.json new file mode 100644 index 000000000..90faa728a --- /dev/null +++ b/tests/specs/run/no_lock_flag/no_lock_flag/deno.json @@ -0,0 +1,3 @@ +{ + "tasks": {} +} diff --git a/tests/specs/run/no_lock_flag/no_lock_flag/deno.lock b/tests/specs/run/no_lock_flag/no_lock_flag/deno.lock new file mode 100644 index 000000000..059f66789 --- /dev/null +++ b/tests/specs/run/no_lock_flag/no_lock_flag/deno.lock @@ -0,0 +1,7 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/subdir/mod2.ts": "cae1d3e9f3c38cd415ff52dff854be8f3d17d35f8d7b3d285e813fb0f6393a2f", + "http://localhost:4545/subdir/print_hello.ts": "foobar" + } +} diff --git a/tests/specs/run/no_lock_flag/no_lock_flag/main.out b/tests/specs/run/no_lock_flag/no_lock_flag/main.out new file mode 100644 index 000000000..0d8f0a237 --- /dev/null +++ b/tests/specs/run/no_lock_flag/no_lock_flag/main.out @@ -0,0 +1,2 @@ +Download http://localhost:4545/subdir/mod2.ts +Download http://localhost:4545/subdir/print_hello.ts diff --git a/tests/specs/run/no_lock_flag/no_lock_flag/main.ts b/tests/specs/run/no_lock_flag/no_lock_flag/main.ts new file mode 100644 index 000000000..baa52775d --- /dev/null +++ b/tests/specs/run/no_lock_flag/no_lock_flag/main.ts @@ -0,0 +1 @@ +import "http://localhost:4545/subdir/mod2.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 000000000..2342a63e8 --- /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 000000000..17d54b92c --- /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 000000000..055ac62e8 --- /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/specs/run/node_env_var_allowlist/node_env_var_allowlist.ts b/tests/specs/run/node_env_var_allowlist/node_env_var_allowlist.ts new file mode 100644 index 000000000..95da38c24 --- /dev/null +++ b/tests/specs/run/node_env_var_allowlist/node_env_var_allowlist.ts @@ -0,0 +1,2 @@ +console.log(Deno.env.get("NODE_DEBUG") ?? "ok"); +Deno.env.get("NOT_NODE_DEBUG"); diff --git a/tests/specs/run/node_env_var_allowlist/node_env_var_allowlist.ts.out b/tests/specs/run/node_env_var_allowlist/node_env_var_allowlist.ts.out new file mode 100644 index 000000000..2dcffd67b --- /dev/null +++ b/tests/specs/run/node_env_var_allowlist/node_env_var_allowlist.ts.out @@ -0,0 +1,5 @@ +ok +[WILDCARD]error: Uncaught (in promise) NotCapable: Requires env access to "NOT_NODE_DEBUG", run again with the --allow-env flag +Deno.env.get("NOT_NODE_DEBUG"); + ^ + at [WILDCARD] diff --git a/tests/specs/run/onload/__test__.jsonc b/tests/specs/run/onload/__test__.jsonc new file mode 100644 index 000000000..b17dc665d --- /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 000000000..105514e13 --- /dev/null +++ b/tests/specs/run/onload/deno.json @@ -0,0 +1,4 @@ +{ + "lock": false, + "importMap": "../../../../import_map.json" +} diff --git a/tests/specs/run/onload/onload/imported.ts b/tests/specs/run/onload/onload/imported.ts new file mode 100644 index 000000000..643e2fc78 --- /dev/null +++ b/tests/specs/run/onload/onload/imported.ts @@ -0,0 +1,12 @@ +import { assert } from "@std/assert"; +import "./nest_imported.ts"; + +const handler = (e: Event) => { + assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable); + console.log(`got ${e.type} event in event handler (imported)`); +}; + +globalThis.addEventListener("load", handler); +globalThis.addEventListener("beforeunload", handler); +globalThis.addEventListener("unload", handler); +console.log("log from imported script"); diff --git a/tests/specs/run/onload/onload/main.out b/tests/specs/run/onload/onload/main.out new file mode 100644 index 000000000..b25d33fa8 --- /dev/null +++ b/tests/specs/run/onload/onload/main.out @@ -0,0 +1,15 @@ +log from nest_imported script +log from imported script +log from main +got load event in event handler (nest_imported) +got load event in event handler (imported) +got load event in event handler (main) +got load event in onload function +got beforeunload event in event handler (nest_imported) +got beforeunload event in event handler (imported) +got beforeunload event in event handler (main) +got beforeunload event in onbeforeunload function +got unload event in event handler (nest_imported) +got unload event in event handler (imported) +got unload event in event handler (main) +got unload event in onunload function diff --git a/tests/specs/run/onload/onload/main.ts b/tests/specs/run/onload/onload/main.ts new file mode 100644 index 000000000..c4b8424fb --- /dev/null +++ b/tests/specs/run/onload/onload/main.ts @@ -0,0 +1,34 @@ +// deno-lint-ignore-file no-prototype-builtins +import { assert } from "@std/assert"; +import "./imported.ts"; + +assert(globalThis.hasOwnProperty("onload")); +assert(globalThis.onload === null); + +const eventHandler = (e: Event) => { + assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable); + console.log(`got ${e.type} event in event handler (main)`); +}; + +globalThis.addEventListener("load", eventHandler); + +globalThis.addEventListener("beforeunload", eventHandler); + +globalThis.addEventListener("unload", eventHandler); + +globalThis.onload = (e: Event) => { + assert(!e.cancelable); + console.log(`got ${e.type} event in onload function`); +}; + +globalThis.onbeforeunload = (e: BeforeUnloadEvent) => { + assert(e.cancelable); + console.log(`got ${e.type} event in onbeforeunload function`); +}; + +globalThis.onunload = (e: Event) => { + assert(!e.cancelable); + console.log(`got ${e.type} event in onunload function`); +}; + +console.log("log from main"); diff --git a/tests/specs/run/onload/onload/nest_imported.ts b/tests/specs/run/onload/onload/nest_imported.ts new file mode 100644 index 000000000..f1d28e8dc --- /dev/null +++ b/tests/specs/run/onload/onload/nest_imported.ts @@ -0,0 +1,11 @@ +import { assert } from "@std/assert"; + +const handler = (e: Event) => { + assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable); + console.log(`got ${e.type} event in event handler (nest_imported)`); +}; + +globalThis.addEventListener("load", handler); +globalThis.addEventListener("beforeunload", handler); +globalThis.addEventListener("unload", handler); +console.log("log from nest_imported script"); 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 000000000..664fcb5c1 --- /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/specs/run/op_exit_op_set_exit_code_in_worker/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 new file mode 100644 index 000000000..b6a776439 --- /dev/null +++ b/tests/specs/run/op_exit_op_set_exit_code_in_worker/op_exit_op_set_exit_code_in_worker.ts @@ -0,0 +1,13 @@ +// Set exit code to some value, we'll ensure that `Deno.exit()` and +// setting exit code in worker context is a no-op and is an alias for +// `self.close()`. + +// @ts-ignore Deno[Deno.internal].core doesn't have type-defs +Deno[Deno.internal].core.ops.op_set_exit_code(21); + +const worker = new Worker( + import.meta.resolve("./op_exit_op_set_exit_code_worker.js"), + { type: "module" }, +); + +worker.postMessage("go"); 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 000000000..9b284c37d --- /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 000000000..ac66ccdf1 --- /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 000000000..36e1765d1 --- /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 000000000..5ab43ac47 --- /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 000000000..6016470a1 --- /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 000000000..accefceba --- /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 000000000..2843ee395 --- /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/specs/run/permission_args/permission_args.out b/tests/specs/run/permission_args/permission_args.out new file mode 100644 index 000000000..6a1e1787c --- /dev/null +++ b/tests/specs/run/permission_args/permission_args.out @@ -0,0 +1,4 @@ +Permission flags have likely been incorrectly set after the script argument. +To grant permissions, set them before the script argument. For example: + deno run --allow-read=. main.js +Hello World 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 000000000..accefceba --- /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 000000000..557db03de --- /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 000000000..2b98b963e --- /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 000000000..982b88289 --- /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/specs/run/private_field_presence/private_field_presence.ts b/tests/specs/run/private_field_presence/private_field_presence.ts new file mode 100644 index 000000000..7ce2840d8 --- /dev/null +++ b/tests/specs/run/private_field_presence/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/private_field_presence.ts.out b/tests/specs/run/private_field_presence/private_field_presence.ts.out new file mode 100644 index 000000000..1d474d525 --- /dev/null +++ b/tests/specs/run/private_field_presence/private_field_presence.ts.out @@ -0,0 +1,2 @@ +false +true 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 000000000..b7a26db25 --- /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 000000000..7ce2840d8 --- /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 000000000..1d474d525 --- /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 000000000..218f38654 --- /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/specs/run/proto_exploit/proto_exploit.js b/tests/specs/run/proto_exploit/proto_exploit.js new file mode 100644 index 000000000..8bd22cfe5 --- /dev/null +++ b/tests/specs/run/proto_exploit/proto_exploit.js @@ -0,0 +1,5 @@ +const payload = `{ "__proto__": null }`; +const obj = {}; +console.log("Before: " + obj); +Object.assign(obj, JSON.parse(payload)); +console.log("After: " + obj); diff --git a/tests/specs/run/proto_exploit/proto_exploit.js.out b/tests/specs/run/proto_exploit/proto_exploit.js.out new file mode 100644 index 000000000..fde881dc5 --- /dev/null +++ b/tests/specs/run/proto_exploit/proto_exploit.js.out @@ -0,0 +1,2 @@ +Before: [object Object] +After: [object Object] 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 000000000..30821d67f --- /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/specs/run/queue_microtask_error/queue_microtask_error.ts b/tests/specs/run/queue_microtask_error/queue_microtask_error.ts new file mode 100644 index 000000000..b2e9642c5 --- /dev/null +++ b/tests/specs/run/queue_microtask_error/queue_microtask_error.ts @@ -0,0 +1,5 @@ +queueMicrotask(() => { + throw new Error("foo"); +}); +console.log(1); +Promise.resolve().then(() => console.log(2)); diff --git a/tests/specs/run/queue_microtask_error/queue_microtask_error.ts.out b/tests/specs/run/queue_microtask_error/queue_microtask_error.ts.out new file mode 100644 index 000000000..a8ce13170 --- /dev/null +++ b/tests/specs/run/queue_microtask_error/queue_microtask_error.ts.out @@ -0,0 +1,6 @@ +1 +error: Uncaught Error: foo + throw new Error("foo"); + ^ + at [WILDCARD]/queue_microtask_error.ts:2:9 + at ext:core/[WILDCARD] 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 000000000..c343acfb4 --- /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/specs/run/queue_microtask_error_handled/queue_microtask_error_handled.ts b/tests/specs/run/queue_microtask_error_handled/queue_microtask_error_handled.ts new file mode 100644 index 000000000..47ea2d32e --- /dev/null +++ b/tests/specs/run/queue_microtask_error_handled/queue_microtask_error_handled.ts @@ -0,0 +1,21 @@ +addEventListener("error", (event) => { + console.log({ + cancelable: event.cancelable, + message: event.message, + filename: event.filename?.slice?.(-100), + lineno: event.lineno, + colno: event.colno, + error: event.error, + }); + event.preventDefault(); +}); + +onerror = (event) => { + console.log("onerror() called", event.error); +}; + +queueMicrotask(() => { + throw new Error("foo"); +}); +console.log(1); +Promise.resolve().then(() => console.log(2)); diff --git a/tests/specs/run/queue_microtask_error_handled/queue_microtask_error_handled.ts.out b/tests/specs/run/queue_microtask_error_handled/queue_microtask_error_handled.ts.out new file mode 100644 index 000000000..bdc8eafa1 --- /dev/null +++ b/tests/specs/run/queue_microtask_error_handled/queue_microtask_error_handled.ts.out @@ -0,0 +1,15 @@ +1 +{ + cancelable: true, + message: "Uncaught Error: foo", + filename: "[WILDCARD]/queue_microtask_error_handled.ts", + lineno: 18, + colno: 9, + error: Error: foo + at [WILDCARD]/queue_microtask_error_handled.ts:18:9 + at ext:core/[WILDCARD] +} +onerror() called Error: foo + at [WILDCARD]/queue_microtask_error_handled.ts:18:9 + at ext:core/[WILDCARD] +2 diff --git a/tests/specs/run/reference_types/__test__.jsonc b/tests/specs/run/reference_types/__test__.jsonc new file mode 100644 index 000000000..4e4bd08b8 --- /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/specs/run/reference_types/reference_types.ts b/tests/specs/run/reference_types/reference_types.ts new file mode 100644 index 000000000..105e23b37 --- /dev/null +++ b/tests/specs/run/reference_types/reference_types.ts @@ -0,0 +1,3 @@ +/// + +console.log(globalThis.a); diff --git a/tests/specs/run/reference_types/reference_types.ts.out b/tests/specs/run/reference_types/reference_types.ts.out new file mode 100644 index 000000000..417b7b537 --- /dev/null +++ b/tests/specs/run/reference_types/reference_types.ts.out @@ -0,0 +1 @@ +undefined 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 000000000..08450acc1 --- /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 000000000..08ac60b6c --- /dev/null +++ b/tests/specs/run/reference_types_error/checkjs.tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "checkJs": true + } +} diff --git a/tests/specs/run/reference_types_error/reference_types_error.js b/tests/specs/run/reference_types_error/reference_types_error.js new file mode 100644 index 000000000..68b6c2136 --- /dev/null +++ b/tests/specs/run/reference_types_error/reference_types_error.js @@ -0,0 +1,2 @@ +/// +export const a = 1; diff --git a/tests/specs/run/reference_types_error/reference_types_error.js.out b/tests/specs/run/reference_types_error/reference_types_error.js.out new file mode 100644 index 000000000..86055f3ac --- /dev/null +++ b/tests/specs/run/reference_types_error/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/reference_types_error_no_check/__test__.jsonc b/tests/specs/run/reference_types_error_no_check/__test__.jsonc new file mode 100644 index 000000000..78744759d --- /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 000000000..68b6c2136 --- /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 000000000..c48dd1d5e --- /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 000000000..08ac60b6c --- /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 000000000..68b6c2136 --- /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 000000000..86055f3ac --- /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 000000000..3f7f27c26 --- /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/specs/run/references_types_remote/reference_types_remote.ts b/tests/specs/run/references_types_remote/reference_types_remote.ts new file mode 100644 index 000000000..e7fa81b2c --- /dev/null +++ b/tests/specs/run/references_types_remote/reference_types_remote.ts @@ -0,0 +1,3 @@ +/// + +console.log(globalThis.a); 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 000000000..417b7b537 --- /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 000000000..7565a7dd1 --- /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/specs/run/rejection_handled/rejection_handled.out b/tests/specs/run/rejection_handled/rejection_handled.out new file mode 100644 index 000000000..5c06fcd2b --- /dev/null +++ b/tests/specs/run/rejection_handled/rejection_handled.out @@ -0,0 +1,5 @@ +[WILDCARD] +unhandledrejection 1 Promise { 1 } +Added catch handler to the promise +rejectionhandled 1 Promise { 1 } +Success diff --git a/tests/specs/run/rejection_handled/rejection_handled.ts b/tests/specs/run/rejection_handled/rejection_handled.ts new file mode 100644 index 000000000..8822203f1 --- /dev/null +++ b/tests/specs/run/rejection_handled/rejection_handled.ts @@ -0,0 +1,17 @@ +globalThis.addEventListener("unhandledrejection", (event) => { + console.log("unhandledrejection", event.reason, event.promise); + event.preventDefault(); +}); + +globalThis.addEventListener("rejectionhandled", (event) => { + console.log("rejectionhandled", event.reason, event.promise); +}); + +const a = Promise.reject(1); +setTimeout(async () => { + a.catch(() => console.log("Added catch handler to the promise")); +}, 10); + +setTimeout(() => { + console.log("Success"); +}, 1000); diff --git a/tests/specs/run/replace_self/__test__.jsonc b/tests/specs/run/replace_self/__test__.jsonc new file mode 100644 index 000000000..cfadbf791 --- /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/specs/run/replace_self/replace_self.js b/tests/specs/run/replace_self/replace_self.js new file mode 100644 index 000000000..cfd473cd3 --- /dev/null +++ b/tests/specs/run/replace_self/replace_self.js @@ -0,0 +1,21 @@ +// Test that setting `self` in the main thread to some other value doesn't break +// the world, in particular for events fired on the global scope. + +// deno-lint-ignore no-global-assign +self = null; + +addEventListener("load", () => { + console.log("load event (event listener)"); +}); + +addEventListener("unload", () => { + console.log("unload event (event listener)"); +}); + +globalThis.onload = () => { + console.log("load event (event handler)"); +}; + +globalThis.onunload = () => { + console.log("unload event (event handler)"); +}; diff --git a/tests/specs/run/replace_self/replace_self.js.out b/tests/specs/run/replace_self/replace_self.js.out new file mode 100644 index 000000000..aaffb5a62 --- /dev/null +++ b/tests/specs/run/replace_self/replace_self.js.out @@ -0,0 +1,4 @@ +load event (event listener) +load event (event handler) +unload event (event listener) +unload event (event handler) diff --git a/tests/specs/run/report_error/__test__.jsonc b/tests/specs/run/report_error/__test__.jsonc new file mode 100644 index 000000000..0577ad245 --- /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/specs/run/report_error/report_error.ts b/tests/specs/run/report_error/report_error.ts new file mode 100644 index 000000000..a6d4af1fd --- /dev/null +++ b/tests/specs/run/report_error/report_error.ts @@ -0,0 +1,3 @@ +console.log(1); +reportError(new Error("foo")); +console.log(2); diff --git a/tests/specs/run/report_error/report_error.ts.out b/tests/specs/run/report_error/report_error.ts.out new file mode 100644 index 000000000..185db62a5 --- /dev/null +++ b/tests/specs/run/report_error/report_error.ts.out @@ -0,0 +1,5 @@ +1 +error: Uncaught Error: foo +reportError(new Error("foo")); + ^ + at [WILDCARD]/report_error.ts:2:13 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 000000000..c34956b74 --- /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/specs/run/report_error_end_of_program/report_error_end_of_program.ts b/tests/specs/run/report_error_end_of_program/report_error_end_of_program.ts new file mode 100644 index 000000000..cd7ce7f9c --- /dev/null +++ b/tests/specs/run/report_error_end_of_program/report_error_end_of_program.ts @@ -0,0 +1 @@ +reportError(new Error("foo")); diff --git a/tests/specs/run/report_error_end_of_program/report_error_end_of_program.ts.out b/tests/specs/run/report_error_end_of_program/report_error_end_of_program.ts.out new file mode 100644 index 000000000..ecca63389 --- /dev/null +++ b/tests/specs/run/report_error_end_of_program/report_error_end_of_program.ts.out @@ -0,0 +1,4 @@ +error: Uncaught Error: foo +reportError(new Error("foo")); + ^ + at [WILDCARD]/report_error_end_of_program.ts:1:13 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 000000000..126687b95 --- /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/specs/run/report_error_handled/report_error_handled.ts b/tests/specs/run/report_error_handled/report_error_handled.ts new file mode 100644 index 000000000..d18996c13 --- /dev/null +++ b/tests/specs/run/report_error_handled/report_error_handled.ts @@ -0,0 +1,19 @@ +addEventListener("error", (event) => { + console.log({ + cancelable: event.cancelable, + message: event.message, + filename: event.filename?.slice?.(-100), + lineno: event.lineno, + colno: event.colno, + error: event.error, + }); + event.preventDefault(); +}); + +onerror = (event) => { + console.log("onerror() called", event.error); +}; + +console.log(1); +reportError(new Error("foo")); +console.log(2); diff --git a/tests/specs/run/report_error_handled/report_error_handled.ts.out b/tests/specs/run/report_error_handled/report_error_handled.ts.out new file mode 100644 index 000000000..89fa30314 --- /dev/null +++ b/tests/specs/run/report_error_handled/report_error_handled.ts.out @@ -0,0 +1,13 @@ +1 +{ + cancelable: true, + message: "Uncaught Error: foo", + filename: "[WILDCARD]/report_error_handled.ts", + lineno: 18, + colno: 13, + error: Error: foo + at [WILDCARD]/report_error_handled.ts:18:13 +} +onerror() called Error: foo + at [WILDCARD]/report_error_handled.ts:18:13 +2 diff --git a/tests/specs/run/runtime_decorators/__test__.jsonc b/tests/specs/run/runtime_decorators/__test__.jsonc new file mode 100644 index 000000000..286fd377d --- /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 000000000..504cd646e --- /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 000000000..015f7076e --- /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 000000000..9f7ec550d --- /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 000000000..0fc1d4590 --- /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 000000000..40a26bbd4 --- /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 000000000..ea64fbaa6 --- /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 000000000..95fba6cd4 --- /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 000000000..39394952e --- /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 000000000..00c8a8502 --- /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 000000000..5a1876d6c --- /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/specs/run/seed_random/seed_random.js b/tests/specs/run/seed_random/seed_random.js new file mode 100644 index 000000000..7f6e336df --- /dev/null +++ b/tests/specs/run/seed_random/seed_random.js @@ -0,0 +1,11 @@ +for (let i = 0; i < 10; ++i) { + console.log(Math.random()); +} + +const arr = new Uint8Array(32); + +crypto.getRandomValues(arr); +console.log(arr); + +crypto.getRandomValues(arr); +console.log(arr); diff --git a/tests/specs/run/seed_random/seed_random.js.out b/tests/specs/run/seed_random/seed_random.js.out new file mode 100644 index 000000000..4d1ebd081 --- /dev/null +++ b/tests/specs/run/seed_random/seed_random.js.out @@ -0,0 +1,22 @@ +0.858562739044346 +0.8973397944553141 +0.15335012655691727 +0.36867387434349963 +0.3591039342838782 +0.7044499748617652 +0.7461423057751548 +0.3824611207183364 +0.5950178237266042 +0.22440633214343908 +Uint8Array(32) [ + 153, 221, 127, 193, 173, 88, 77, 155, + 23, 66, 117, 239, 157, 231, 189, 160, + 79, 198, 30, 56, 137, 159, 220, 226, + 47, 211, 26, 73, 243, 252, 71, 214 +] +Uint8Array(32) [ + 18, 98, 66, 131, 76, 87, 93, 76, + 205, 81, 250, 112, 129, 119, 92, 9, + 116, 99, 5, 171, 8, 137, 132, 79, + 255, 9, 194, 1, 138, 85, 72, 189 +] 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 000000000..a5866e8c6 --- /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/specs/run/set_exit_code_0/set_exit_code_0.ts b/tests/specs/run/set_exit_code_0/set_exit_code_0.ts new file mode 100644 index 000000000..8a0103c8f --- /dev/null +++ b/tests/specs/run/set_exit_code_0/set_exit_code_0.ts @@ -0,0 +1,2 @@ +Deno[Deno.internal].core.ops.op_set_exit_code(42); +Deno.exit(0); // Takes precedence. 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 000000000..1ca50c982 --- /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/specs/run/set_exit_code_1/set_exit_code_1.ts b/tests/specs/run/set_exit_code_1/set_exit_code_1.ts new file mode 100644 index 000000000..45027ccf7 --- /dev/null +++ b/tests/specs/run/set_exit_code_1/set_exit_code_1.ts @@ -0,0 +1,2 @@ +Deno[Deno.internal].core.ops.op_set_exit_code(42); +Deno.exit(); 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 000000000..af7411f7c --- /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/specs/run/set_exit_code_2/set_exit_code_2.ts b/tests/specs/run/set_exit_code_2/set_exit_code_2.ts new file mode 100644 index 000000000..48469c17d --- /dev/null +++ b/tests/specs/run/set_exit_code_2/set_exit_code_2.ts @@ -0,0 +1,2 @@ +Deno[Deno.internal].core.ops.op_set_exit_code(42); +// Exits naturally. 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 000000000..eea730fd8 --- /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/specs/run/set_timeout_error/set_timeout_error.ts b/tests/specs/run/set_timeout_error/set_timeout_error.ts new file mode 100644 index 000000000..2864574e7 --- /dev/null +++ b/tests/specs/run/set_timeout_error/set_timeout_error.ts @@ -0,0 +1,3 @@ +setTimeout(() => { + throw new Error("foo"); +}, 0); diff --git a/tests/specs/run/set_timeout_error/set_timeout_error.ts.out b/tests/specs/run/set_timeout_error/set_timeout_error.ts.out new file mode 100644 index 000000000..9db053f6c --- /dev/null +++ b/tests/specs/run/set_timeout_error/set_timeout_error.ts.out @@ -0,0 +1,5 @@ +error: Uncaught Error: foo + throw new Error("foo"); + ^ + at [WILDCARD]/set_timeout_error.ts:2:9 + at [WILDCARD] 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 000000000..39a9424bb --- /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/specs/run/set_timeout_error_handled/set_timeout_error_handled.ts b/tests/specs/run/set_timeout_error_handled/set_timeout_error_handled.ts new file mode 100644 index 000000000..aee2d97d2 --- /dev/null +++ b/tests/specs/run/set_timeout_error_handled/set_timeout_error_handled.ts @@ -0,0 +1,19 @@ +addEventListener("error", (event) => { + console.log({ + cancelable: event.cancelable, + message: event.message, + filename: event.filename?.slice?.(-100), + lineno: event.lineno, + colno: event.colno, + error: event.error, + }); + event.preventDefault(); +}); + +onerror = (event) => { + console.log("onerror() called", event.error); +}; + +setTimeout(() => { + throw new Error("foo"); +}, 0); diff --git a/tests/specs/run/set_timeout_error_handled/set_timeout_error_handled.ts.out b/tests/specs/run/set_timeout_error_handled/set_timeout_error_handled.ts.out new file mode 100644 index 000000000..054dd9b6b --- /dev/null +++ b/tests/specs/run/set_timeout_error_handled/set_timeout_error_handled.ts.out @@ -0,0 +1,13 @@ +{ + cancelable: true, + message: "Uncaught Error: foo", + filename: "[WILDCARD]/set_timeout_error_handled.ts", + lineno: 18, + colno: 9, + error: Error: foo + at [WILDCARD]/set_timeout_error_handled.ts:18:9 + at [WILDCARD] +} +onerror() called Error: foo + at [WILDCARD]/set_timeout_error_handled.ts:18:9 + at [WILDCARD] diff --git a/tests/specs/run/shebang_swc/__test__.jsonc b/tests/specs/run/shebang_swc/__test__.jsonc new file mode 100644 index 000000000..65e0b5c9b --- /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/specs/run/shebang_swc/shebang.ts b/tests/specs/run/shebang_swc/shebang.ts new file mode 100644 index 000000000..00feb2da0 --- /dev/null +++ b/tests/specs/run/shebang_swc/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/specs/run/shebang_swc/shebang.ts.out b/tests/specs/run/shebang_swc/shebang.ts.out new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/tests/specs/run/shebang_swc/shebang.ts.out @@ -0,0 +1 @@ +42 diff --git a/tests/specs/run/shebang_swc/shebang2.ts b/tests/specs/run/shebang_swc/shebang2.ts new file mode 100644 index 000000000..da0d7bf0c --- /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 000000000..f78971d57 --- /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 000000000..00feb2da0 --- /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/specs/run/shebang_tsc/shebang.ts.out b/tests/specs/run/shebang_tsc/shebang.ts.out new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/tests/specs/run/shebang_tsc/shebang.ts.out @@ -0,0 +1 @@ +42 diff --git a/tests/specs/run/shebang_tsc/shebang2.ts b/tests/specs/run/shebang_tsc/shebang2.ts new file mode 100644 index 000000000..da0d7bf0c --- /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 000000000..90592757f --- /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 000000000..b695e4457 --- /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 000000000..9524026bc --- /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 000000000..23eb03720 --- /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 000000000..7fbb8a5d3 --- /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 000000000..b695e4457 --- /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 000000000..9524026bc --- /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 000000000..23eb03720 --- /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 000000000..3e2e04379 --- /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 000000000..5e58f432e --- /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 000000000..b9c0ad527 --- /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/specs/run/single_compile_with_reload/single_compile_with_reload.ts b/tests/specs/run/single_compile_with_reload/single_compile_with_reload.ts new file mode 100644 index 000000000..9478ad523 --- /dev/null +++ b/tests/specs/run/single_compile_with_reload/single_compile_with_reload.ts @@ -0,0 +1,18 @@ +await import("./single_compile_with_reload_dyn.ts"); +console.log("1"); +await import("./single_compile_with_reload_dyn.ts"); +console.log("2"); +await new Promise((r) => + new Worker( + import.meta.resolve("./single_compile_with_reload_worker.ts"), + { type: "module" }, + ).onmessage = r +); +console.log("3"); +await new Promise((r) => + new Worker( + import.meta.resolve("./single_compile_with_reload_worker.ts"), + { type: "module" }, + ).onmessage = r +); +console.log("4"); diff --git a/tests/specs/run/single_compile_with_reload/single_compile_with_reload.ts.out b/tests/specs/run/single_compile_with_reload/single_compile_with_reload.ts.out new file mode 100644 index 000000000..a3986e3af --- /dev/null +++ b/tests/specs/run/single_compile_with_reload/single_compile_with_reload.ts.out @@ -0,0 +1,7 @@ +Hello +1 +2 +Hello from worker +3 +Hello from worker +4 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 000000000..c69556be1 --- /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 000000000..103cafe20 --- /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 000000000..59beb64c3 --- /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 000000000..9071d0aeb --- /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 000000000..4dd5fe54c --- /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/specs/run/spawn_stdout_inherit/spawn_stdout_inherit.ts b/tests/specs/run/spawn_stdout_inherit/spawn_stdout_inherit.ts new file mode 100644 index 000000000..04f635cea --- /dev/null +++ b/tests/specs/run/spawn_stdout_inherit/spawn_stdout_inherit.ts @@ -0,0 +1,8 @@ +await new Deno.Command(Deno.execPath(), { + args: ["eval", "--quiet", "console.log('Hello, world! 1')"], + stdout: "inherit", +}).output(); +new Deno.Command(Deno.execPath(), { + args: ["eval", "--quiet", "console.log('Hello, world! 2')"], + stdout: "inherit", +}).outputSync(); diff --git a/tests/specs/run/spawn_stdout_inherit/spawn_stdout_inherit.ts.out b/tests/specs/run/spawn_stdout_inherit/spawn_stdout_inherit.ts.out new file mode 100644 index 000000000..474891cf2 --- /dev/null +++ b/tests/specs/run/spawn_stdout_inherit/spawn_stdout_inherit.ts.out @@ -0,0 +1,2 @@ +Hello, world! 1 +Hello, world! 2 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 000000000..6fc035aab --- /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/specs/run/stdin_read_all/stdin_read_all.out b/tests/specs/run/stdin_read_all/stdin_read_all.out new file mode 100644 index 000000000..2f0dfb71a --- /dev/null +++ b/tests/specs/run/stdin_read_all/stdin_read_all.out @@ -0,0 +1 @@ +01234567890123456789012345678901234567890123456789 diff --git a/tests/specs/run/stdin_read_all/stdin_read_all.ts b/tests/specs/run/stdin_read_all/stdin_read_all.ts new file mode 100644 index 000000000..d683a2bf6 --- /dev/null +++ b/tests/specs/run/stdin_read_all/stdin_read_all.ts @@ -0,0 +1,17 @@ +const encoder = new TextEncoder(); + +const pending = []; + +// do this a bunch of times to ensure it doesn't race +// and everything happens in order +for (let i = 0; i < 50; i++) { + const buf = new Uint8Array(1); + pending.push( + Deno.stdin.read(buf).then(() => { + return Deno.stdout.write(buf); + }), + ); +} + +await Promise.all(pending); +await Deno.stdout.write(encoder.encode("\n")); 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 000000000..2057f4a11 --- /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/specs/run/stdout_write_all/stdout_write_all.out b/tests/specs/run/stdout_write_all/stdout_write_all.out new file mode 100644 index 000000000..d0e667fd4 --- /dev/null +++ b/tests/specs/run/stdout_write_all/stdout_write_all.out @@ -0,0 +1,100 @@ +Hello, world! 0 +Hello, world! 1 +Hello, world! 2 +Hello, world! 3 +Hello, world! 4 +Hello, world! 5 +Hello, world! 6 +Hello, world! 7 +Hello, world! 8 +Hello, world! 9 +Hello, world! 10 +Hello, world! 11 +Hello, world! 12 +Hello, world! 13 +Hello, world! 14 +Hello, world! 15 +Hello, world! 16 +Hello, world! 17 +Hello, world! 18 +Hello, world! 19 +Hello, world! 20 +Hello, world! 21 +Hello, world! 22 +Hello, world! 23 +Hello, world! 24 +Hello, world! 25 +Hello, world! 26 +Hello, world! 27 +Hello, world! 28 +Hello, world! 29 +Hello, world! 30 +Hello, world! 31 +Hello, world! 32 +Hello, world! 33 +Hello, world! 34 +Hello, world! 35 +Hello, world! 36 +Hello, world! 37 +Hello, world! 38 +Hello, world! 39 +Hello, world! 40 +Hello, world! 41 +Hello, world! 42 +Hello, world! 43 +Hello, world! 44 +Hello, world! 45 +Hello, world! 46 +Hello, world! 47 +Hello, world! 48 +Hello, world! 49 +Hello, world! 50 +Hello, world! 51 +Hello, world! 52 +Hello, world! 53 +Hello, world! 54 +Hello, world! 55 +Hello, world! 56 +Hello, world! 57 +Hello, world! 58 +Hello, world! 59 +Hello, world! 60 +Hello, world! 61 +Hello, world! 62 +Hello, world! 63 +Hello, world! 64 +Hello, world! 65 +Hello, world! 66 +Hello, world! 67 +Hello, world! 68 +Hello, world! 69 +Hello, world! 70 +Hello, world! 71 +Hello, world! 72 +Hello, world! 73 +Hello, world! 74 +Hello, world! 75 +Hello, world! 76 +Hello, world! 77 +Hello, world! 78 +Hello, world! 79 +Hello, world! 80 +Hello, world! 81 +Hello, world! 82 +Hello, world! 83 +Hello, world! 84 +Hello, world! 85 +Hello, world! 86 +Hello, world! 87 +Hello, world! 88 +Hello, world! 89 +Hello, world! 90 +Hello, world! 91 +Hello, world! 92 +Hello, world! 93 +Hello, world! 94 +Hello, world! 95 +Hello, world! 96 +Hello, world! 97 +Hello, world! 98 +Hello, world! 99 diff --git a/tests/specs/run/stdout_write_all/stdout_write_all.ts b/tests/specs/run/stdout_write_all/stdout_write_all.ts new file mode 100644 index 000000000..cfb2981e4 --- /dev/null +++ b/tests/specs/run/stdout_write_all/stdout_write_all.ts @@ -0,0 +1,13 @@ +const encoder = new TextEncoder(); + +const pending = []; + +// do this a bunch of times to ensure it doesn't race +// and everything happens in order +for (let i = 0; i < 100; i++) { + pending.push(Deno.stdout.write(encoder.encode("Hello, "))); + pending.push(Deno.stdout.write(encoder.encode(`world! ${i}`))); + pending.push(Deno.stdout.write(encoder.encode("\n"))); +} + +await Promise.all(pending); 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 000000000..5032ca015 --- /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/specs/run/stdout_write_sync_async/stdout_write_sync_async.out b/tests/specs/run/stdout_write_sync_async/stdout_write_sync_async.out new file mode 100644 index 000000000..91ebda1ca --- /dev/null +++ b/tests/specs/run/stdout_write_sync_async/stdout_write_sync_async.out @@ -0,0 +1,200 @@ +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello +Hello diff --git a/tests/specs/run/stdout_write_sync_async/stdout_write_sync_async.ts b/tests/specs/run/stdout_write_sync_async/stdout_write_sync_async.ts new file mode 100644 index 000000000..648999d8a --- /dev/null +++ b/tests/specs/run/stdout_write_sync_async/stdout_write_sync_async.ts @@ -0,0 +1,14 @@ +const encoder = new TextEncoder(); +const pending = []; + +for (let i = 0; i < 100; i++) { + // some code that will cause stdout to be written + // synchronously while the async write might be occurring + console.log("Hello"); + pending.push(Deno.stdout.write(encoder.encode("Hello\n"))); + if (i % 10) { + await new Promise((resolve) => setTimeout(resolve, 0)); + } +} + +await Promise.all(pending); 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 000000000..842a4fcf8 --- /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/specs/run/swc_syntax_error/swc_syntax_error.ts b/tests/specs/run/swc_syntax_error/swc_syntax_error.ts new file mode 100644 index 000000000..991ca9214 --- /dev/null +++ b/tests/specs/run/swc_syntax_error/swc_syntax_error.ts @@ -0,0 +1,4 @@ +// deno-fmt-ignore-file +for await (const req of s) { + let something: +} diff --git a/tests/specs/run/swc_syntax_error/swc_syntax_error.ts.out b/tests/specs/run/swc_syntax_error/swc_syntax_error.ts.out new file mode 100644 index 000000000..81b0c1949 --- /dev/null +++ b/tests/specs/run/swc_syntax_error/swc_syntax_error.ts.out @@ -0,0 +1,4 @@ +error: The module's source code could not be parsed: Unexpected token `}`. Expected an identifier, void, yield, null, await, break, a string literal, a numeric literal, true, false, `, -, import, this, typeof, {, [, ( at [WILDCARD]syntax_error.ts:4:1 + + } + ~ 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 000000000..3d8d2ba56 --- /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/specs/run/test_and_bench_are_noops_in_run/test_and_bench_in_run.js b/tests/specs/run/test_and_bench_are_noops_in_run/test_and_bench_in_run.js new file mode 100644 index 000000000..108ae937a --- /dev/null +++ b/tests/specs/run/test_and_bench_are_noops_in_run/test_and_bench_in_run.js @@ -0,0 +1,5 @@ +Deno.test(function foo() { +}); + +Deno.bench(function bar() { +}); diff --git a/tests/specs/run/tls_connecttls/RootCA.pem b/tests/specs/run/tls_connecttls/RootCA.pem new file mode 100644 index 000000000..c2f84ceeb --- /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 000000000..2e8f88339 --- /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 000000000..105514e13 --- /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 000000000..a71ae9050 --- /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 000000000..42774c977 --- /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 000000000..9e0f5f5f0 --- /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/specs/run/tls_connecttls/tls.out b/tests/specs/run/tls_connecttls/tls.out new file mode 100644 index 000000000..c8e8a135c --- /dev/null +++ b/tests/specs/run/tls_connecttls/tls.out @@ -0,0 +1 @@ +DONE diff --git a/tests/specs/run/tls_connecttls/tls_connecttls.js b/tests/specs/run/tls_connecttls/tls_connecttls.js new file mode 100644 index 000000000..686b13aea --- /dev/null +++ b/tests/specs/run/tls_connecttls/tls_connecttls.js @@ -0,0 +1,65 @@ +import { assert, assertEquals } from "@std/assert"; +import { BufReader, BufWriter } from "@std/io"; +import { TextProtoReader } from "./textproto.ts"; + +const encoder = new TextEncoder(); +const decoder = new TextDecoder(); + +const { promise, resolve } = Promise.withResolvers(); +const hostname = "localhost"; +const port = 3505; + +const listener = Deno.listenTls({ + hostname, + port, + cert: Deno.readTextFileSync("./localhost.crt"), + key: Deno.readTextFileSync("./localhost.key"), +}); + +const response = encoder.encode( + "HTTP/1.1 200 OK\r\nContent-Length: 12\r\n\r\nHello World\n", +); + +listener.accept().then( + async (conn) => { + assert(conn.remoteAddr != null); + assert(conn.localAddr != null); + await conn.write(response); + // TODO(bartlomieju): this might be a bug + setTimeout(() => { + conn.close(); + resolve(); + }, 0); + }, +); + +const conn = await Deno.connectTls({ + hostname, + port, +}); +const w = new BufWriter(conn); +const r = new BufReader(conn); +const body = `GET / HTTP/1.1\r\nHost: ${hostname}:${port}\r\n\r\n`; +const writeResult = await w.write(encoder.encode(body)); +assertEquals(body.length, writeResult); +await w.flush(); +const tpr = new TextProtoReader(r); +const statusLine = await tpr.readLine(); +assert(statusLine !== null, `line must be read: ${String(statusLine)}`); +const m = statusLine.match(/^(.+?) (.+?) (.+?)$/); +assert(m !== null, "must be matched"); +const [_, proto, status, ok] = m; +assertEquals(proto, "HTTP/1.1"); +assertEquals(status, "200"); +assertEquals(ok, "OK"); +const headers = await tpr.readMimeHeader(); +assert(headers !== null); +const contentLength = parseInt(headers.get("content-length")); +const bodyBuf = new Uint8Array(contentLength); +await r.readFull(bodyBuf); +assertEquals(decoder.decode(bodyBuf), "Hello World\n"); +conn.close(); +listener.close(); +await promise; + +console.log("DONE"); diff --git a/tests/specs/run/tls_starttls/RootCA.pem b/tests/specs/run/tls_starttls/RootCA.pem new file mode 100644 index 000000000..c2f84ceeb --- /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 000000000..4c1fe6324 --- /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 000000000..105514e13 --- /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 000000000..a71ae9050 --- /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 000000000..42774c977 --- /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 000000000..9e0f5f5f0 --- /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 000000000..c8e8a135c --- /dev/null +++ b/tests/specs/run/tls_starttls/tls.out @@ -0,0 +1 @@ +DONE diff --git a/tests/specs/run/tls_starttls/tls_starttls.js b/tests/specs/run/tls_starttls/tls_starttls.js new file mode 100644 index 000000000..cd5718ff5 --- /dev/null +++ b/tests/specs/run/tls_starttls/tls_starttls.js @@ -0,0 +1,64 @@ +import { assert, assertEquals } from "@std/assert"; +import { BufReader } from "@std/io/buf-reader"; +import { BufWriter } from "@std/io/buf-writer"; +import { TextProtoReader } from "./textproto.ts"; + +const encoder = new TextEncoder(); +const decoder = new TextDecoder(); + +const { promise, resolve } = Promise.withResolvers(); +const hostname = "localhost"; +const port = 3504; + +const listener = Deno.listenTls({ + hostname, + port, + cert: Deno.readTextFileSync("./localhost.crt"), + key: Deno.readTextFileSync("./localhost.key"), +}); + +const response = encoder.encode( + "HTTP/1.1 200 OK\r\nContent-Length: 12\r\n\r\nHello World\n", +); + +listener.accept().then( + async (conn) => { + assert(conn.remoteAddr != null); + assert(conn.localAddr != null); + await conn.write(response); + // TODO(bartlomieju): this might be a bug + setTimeout(() => { + conn.close(); + resolve(); + }, 0); + }, +); + +let conn = await Deno.connect({ hostname, port }); +conn = await Deno.startTls(conn, { hostname }); +const w = new BufWriter(conn); +const r = new BufReader(conn); +const body = `GET / HTTP/1.1\r\nHost: ${hostname}:${port}\r\n\r\n`; +const writeResult = await w.write(encoder.encode(body)); +assertEquals(body.length, writeResult); +await w.flush(); +const tpr = new TextProtoReader(r); +const statusLine = await tpr.readLine(); +assert(statusLine !== null, `line must be read: ${String(statusLine)}`); +const m = statusLine.match(/^(.+?) (.+?) (.+?)$/); +assert(m !== null, "must be matched"); +const [_, proto, status, ok] = m; +assertEquals(proto, "HTTP/1.1"); +assertEquals(status, "200"); +assertEquals(ok, "OK"); +const headers = await tpr.readMimeHeader(); +assert(headers !== null); +const contentLength = parseInt(headers.get("content-length")); +const bodyBuf = new Uint8Array(contentLength); +await r.readFull(bodyBuf); +assertEquals(decoder.decode(bodyBuf), "Hello World\n"); +conn.close(); +listener.close(); +await promise; + +console.log("DONE"); 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 000000000..25537db5f --- /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 000000000..6769dd60b --- /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/specs/run/top_level_await/top_level_await/circular.js b/tests/specs/run/top_level_await/top_level_await/circular.js new file mode 100644 index 000000000..ff2964b6a --- /dev/null +++ b/tests/specs/run/top_level_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_await/top_level_await/circular.out b/tests/specs/run/top_level_await/top_level_await/circular.out new file mode 100644 index 000000000..c88978961 --- /dev/null +++ b/tests/specs/run/top_level_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_await/top_level_await/loop.js b/tests/specs/run/top_level_await/top_level_await/loop.js new file mode 100644 index 000000000..f229e03f6 --- /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/specs/run/top_level_await/top_level_await/loop.out b/tests/specs/run/top_level_await/top_level_await/loop.out new file mode 100644 index 000000000..1bdffbf66 --- /dev/null +++ b/tests/specs/run/top_level_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_await/top_level_await/nested.out b/tests/specs/run/top_level_await/top_level_await/nested.out new file mode 100644 index 000000000..8a1218a10 --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/nested.out @@ -0,0 +1,5 @@ +1 +2 +3 +4 +5 diff --git a/tests/specs/run/top_level_await/top_level_await/nested/a.js b/tests/specs/run/top_level_await/top_level_await/nested/a.js new file mode 100644 index 000000000..74837d4ba --- /dev/null +++ b/tests/specs/run/top_level_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_await/top_level_await/nested/b.js b/tests/specs/run/top_level_await/top_level_await/nested/b.js new file mode 100644 index 000000000..3bd241b50 --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/nested/b.js @@ -0,0 +1 @@ +console.log(3); diff --git a/tests/specs/run/top_level_await/top_level_await/nested/main.js b/tests/specs/run/top_level_await/top_level_await/nested/main.js new file mode 100644 index 000000000..ed46a4717 --- /dev/null +++ b/tests/specs/run/top_level_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_await/top_level_await/order.js b/tests/specs/run/top_level_await/top_level_await/order.js new file mode 100644 index 000000000..30659cdfb --- /dev/null +++ b/tests/specs/run/top_level_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_await/top_level_await/order.out b/tests/specs/run/top_level_await/top_level_await/order.out new file mode 100644 index 000000000..4cc27858c --- /dev/null +++ b/tests/specs/run/top_level_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_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 000000000..c3ef3f7db --- /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 000000000..3271c92d8 --- /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 000000000..806eb0a8b --- /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 000000000..283ebf817 --- /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 000000000..f213a562c --- /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 000000000..1ecc15463 --- /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 000000000..d07bcb94d --- /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 000000000..68e357c1e --- /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 000000000..d0349545e --- /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 000000000..860e6cd2a --- /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 000000000..31c83caed --- /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/specs/run/top_level_await/top_level_await/top_level_await.out b/tests/specs/run/top_level_await/top_level_await/top_level_await.out new file mode 100644 index 000000000..4b65d15fe --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/top_level_await.out @@ -0,0 +1,3 @@ +Hello world! + +write 12 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 new file mode 100644 index 000000000..8d47ceb21 --- /dev/null +++ b/tests/specs/run/top_level_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_await/top_level_await/top_level_for_await.js b/tests/specs/run/top_level_await/top_level_await/top_level_for_await.js new file mode 100644 index 000000000..a330f6c71 --- /dev/null +++ b/tests/specs/run/top_level_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_await/top_level_await/top_level_for_await.out b/tests/specs/run/top_level_await/top_level_await/top_level_for_await.out new file mode 100644 index 000000000..4539bbf2d --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/top_level_for_await.out @@ -0,0 +1,3 @@ +0 +1 +2 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_await/top_level_for_await.ts new file mode 100644 index 000000000..9179322d7 --- /dev/null +++ b/tests/specs/run/top_level_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_await/top_level_await/unresolved.js b/tests/specs/run/top_level_await/top_level_await/unresolved.js new file mode 100644 index 000000000..231a8cd63 --- /dev/null +++ b/tests/specs/run/top_level_await/top_level_await/unresolved.js @@ -0,0 +1 @@ +await new Promise(() => {}); diff --git a/tests/specs/run/top_level_await/top_level_await/unresolved.out b/tests/specs/run/top_level_await/top_level_await/unresolved.out new file mode 100644 index 000000000..1f4ea5d38 --- /dev/null +++ b/tests/specs/run/top_level_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_await_circular/__test__.jsonc b/tests/specs/run/top_level_await_circular/__test__.jsonc new file mode 100644 index 000000000..3e236b210 --- /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 000000000..ff2964b6a --- /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 000000000..c88978961 --- /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 000000000..f229e03f6 --- /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 000000000..1bdffbf66 --- /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 000000000..8a1218a10 --- /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 000000000..74837d4ba --- /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 000000000..3bd241b50 --- /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 000000000..ed46a4717 --- /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 000000000..30659cdfb --- /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 000000000..4cc27858c --- /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 000000000..c3ef3f7db --- /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 000000000..3271c92d8 --- /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 000000000..806eb0a8b --- /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 000000000..283ebf817 --- /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 000000000..f213a562c --- /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 000000000..1ecc15463 --- /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 000000000..d07bcb94d --- /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 000000000..68e357c1e --- /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 000000000..d0349545e --- /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 000000000..860e6cd2a --- /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/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 new file mode 100644 index 000000000..ea319ea12 --- /dev/null +++ b/tests/specs/run/top_level_await_circular/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_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 000000000..4b65d15fe --- /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 000000000..8d47ceb21 --- /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 000000000..a330f6c71 --- /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 000000000..4539bbf2d --- /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 000000000..9179322d7 --- /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 000000000..231a8cd63 --- /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 000000000..1f4ea5d38 --- /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 000000000..b2f5c84c0 --- /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 000000000..ff2964b6a --- /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 000000000..c88978961 --- /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 000000000..f229e03f6 --- /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 000000000..1bdffbf66 --- /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 000000000..8a1218a10 --- /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 000000000..74837d4ba --- /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 000000000..3bd241b50 --- /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 000000000..ed46a4717 --- /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 000000000..30659cdfb --- /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 000000000..4cc27858c --- /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 000000000..c3ef3f7db --- /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 000000000..3271c92d8 --- /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 000000000..806eb0a8b --- /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 000000000..283ebf817 --- /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 000000000..f213a562c --- /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 000000000..1ecc15463 --- /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 000000000..d07bcb94d --- /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 000000000..68e357c1e --- /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 000000000..d0349545e --- /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 000000000..860e6cd2a --- /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 000000000..ea319ea12 --- /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 000000000..4b65d15fe --- /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 000000000..8d47ceb21 --- /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 000000000..a330f6c71 --- /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 000000000..4539bbf2d --- /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 000000000..9179322d7 --- /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 000000000..231a8cd63 --- /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 000000000..1f4ea5d38 --- /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 000000000..376180ecd --- /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 000000000..ff2964b6a --- /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 000000000..c88978961 --- /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/specs/run/top_level_await_nested/top_level_await/loop.js b/tests/specs/run/top_level_await_nested/top_level_await/loop.js new file mode 100644 index 000000000..415db5ec7 --- /dev/null +++ b/tests/specs/run/top_level_await_nested/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_nested/top_level_await/loop.out b/tests/specs/run/top_level_await_nested/top_level_await/loop.out new file mode 100644 index 000000000..1bdffbf66 --- /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 000000000..8a1218a10 --- /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 000000000..74837d4ba --- /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 000000000..3bd241b50 --- /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 000000000..ed46a4717 --- /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 000000000..30659cdfb --- /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 000000000..4cc27858c --- /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 000000000..c3ef3f7db --- /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 000000000..3271c92d8 --- /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 000000000..806eb0a8b --- /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 000000000..283ebf817 --- /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 000000000..f213a562c --- /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 000000000..1ecc15463 --- /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 000000000..d07bcb94d --- /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 000000000..68e357c1e --- /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 000000000..d0349545e --- /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 000000000..860e6cd2a --- /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 000000000..ea319ea12 --- /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 000000000..4b65d15fe --- /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 000000000..8d47ceb21 --- /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 000000000..a330f6c71 --- /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 000000000..4539bbf2d --- /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 000000000..9179322d7 --- /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 000000000..231a8cd63 --- /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 000000000..1f4ea5d38 --- /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 000000000..65d00d607 --- /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 000000000..ff2964b6a --- /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 000000000..c88978961 --- /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 000000000..415db5ec7 --- /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 000000000..1bdffbf66 --- /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 000000000..8a1218a10 --- /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 000000000..74837d4ba --- /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 000000000..3bd241b50 --- /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 000000000..ed46a4717 --- /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 000000000..30659cdfb --- /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 000000000..4cc27858c --- /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 000000000..c3ef3f7db --- /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 000000000..3271c92d8 --- /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 000000000..806eb0a8b --- /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 000000000..283ebf817 --- /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 000000000..f213a562c --- /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 000000000..1ecc15463 --- /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 000000000..d07bcb94d --- /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 000000000..68e357c1e --- /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 000000000..d0349545e --- /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 000000000..860e6cd2a --- /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 000000000..ea319ea12 --- /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 000000000..4b65d15fe --- /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 000000000..8d47ceb21 --- /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 000000000..a330f6c71 --- /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 000000000..4539bbf2d --- /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 000000000..9179322d7 --- /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 000000000..231a8cd63 --- /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 000000000..1f4ea5d38 --- /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 000000000..15f937df1 --- /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 000000000..6769dd60b --- /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 000000000..ff2964b6a --- /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 000000000..c88978961 --- /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 000000000..415db5ec7 --- /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 000000000..1bdffbf66 --- /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 000000000..8a1218a10 --- /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 000000000..74837d4ba --- /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 000000000..3bd241b50 --- /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 000000000..ed46a4717 --- /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 000000000..30659cdfb --- /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 000000000..4cc27858c --- /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 000000000..c3ef3f7db --- /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 000000000..3271c92d8 --- /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 000000000..806eb0a8b --- /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 000000000..283ebf817 --- /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 000000000..f213a562c --- /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 000000000..1ecc15463 --- /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 000000000..d07bcb94d --- /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 000000000..68e357c1e --- /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 000000000..d0349545e --- /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 000000000..860e6cd2a --- /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 000000000..ea319ea12 --- /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 000000000..4b65d15fe --- /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 000000000..48f66545a --- /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 000000000..a330f6c71 --- /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 000000000..4539bbf2d --- /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 000000000..9179322d7 --- /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 000000000..231a8cd63 --- /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 000000000..1f4ea5d38 --- /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 000000000..a92774c1b --- /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 000000000..ff2964b6a --- /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 000000000..c88978961 --- /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 000000000..415db5ec7 --- /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 000000000..1bdffbf66 --- /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 000000000..8a1218a10 --- /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 000000000..74837d4ba --- /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 000000000..3bd241b50 --- /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 000000000..ed46a4717 --- /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 000000000..30659cdfb --- /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 000000000..4cc27858c --- /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 000000000..c3ef3f7db --- /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 000000000..3271c92d8 --- /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 000000000..806eb0a8b --- /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 000000000..283ebf817 --- /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 000000000..f213a562c --- /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 000000000..1ecc15463 --- /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 000000000..d07bcb94d --- /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 000000000..68e357c1e --- /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 000000000..d0349545e --- /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 000000000..860e6cd2a --- /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 000000000..ea319ea12 --- /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 000000000..4b65d15fe --- /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 000000000..8d47ceb21 --- /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 000000000..a330f6c71 --- /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 000000000..4539bbf2d --- /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 000000000..9179322d7 --- /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 000000000..231a8cd63 --- /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 000000000..1f4ea5d38 --- /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 000000000..198008560 --- /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 000000000..ff2964b6a --- /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 000000000..c88978961 --- /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 000000000..415db5ec7 --- /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 000000000..1bdffbf66 --- /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 000000000..8a1218a10 --- /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 000000000..74837d4ba --- /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 000000000..3bd241b50 --- /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 000000000..ed46a4717 --- /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 000000000..30659cdfb --- /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 000000000..4cc27858c --- /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 000000000..c3ef3f7db --- /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 000000000..3271c92d8 --- /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 000000000..806eb0a8b --- /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 000000000..283ebf817 --- /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 000000000..f213a562c --- /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 000000000..1ecc15463 --- /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 000000000..d07bcb94d --- /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 000000000..68e357c1e --- /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 000000000..d0349545e --- /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 000000000..860e6cd2a --- /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 000000000..ea319ea12 --- /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 000000000..4b65d15fe --- /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 000000000..8d47ceb21 --- /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 000000000..a330f6c71 --- /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 000000000..4539bbf2d --- /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 000000000..9179322d7 --- /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 000000000..231a8cd63 --- /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 000000000..1f4ea5d38 --- /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 000000000..22314e8e0 --- /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 000000000..ff2964b6a --- /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 000000000..c88978961 --- /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 000000000..415db5ec7 --- /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 000000000..1bdffbf66 --- /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 000000000..8a1218a10 --- /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 000000000..74837d4ba --- /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 000000000..3bd241b50 --- /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 000000000..ed46a4717 --- /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 000000000..30659cdfb --- /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 000000000..4cc27858c --- /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 000000000..c3ef3f7db --- /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 000000000..3271c92d8 --- /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 000000000..806eb0a8b --- /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 000000000..283ebf817 --- /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 000000000..f213a562c --- /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 000000000..1ecc15463 --- /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 000000000..d07bcb94d --- /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 000000000..68e357c1e --- /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 000000000..d0349545e --- /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 000000000..860e6cd2a --- /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 000000000..ea319ea12 --- /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 000000000..4b65d15fe --- /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 000000000..8d47ceb21 --- /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 000000000..a330f6c71 --- /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 000000000..4539bbf2d --- /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 000000000..9179322d7 --- /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 000000000..231a8cd63 --- /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 000000000..1f4ea5d38 --- /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 000000000..96e7cdf30 --- /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 000000000..504cd646e --- /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 000000000..015f7076e --- /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 000000000..9f7ec550d --- /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 000000000..0fc1d4590 --- /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 000000000..40a26bbd4 --- /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 000000000..ea64fbaa6 --- /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 000000000..95fba6cd4 --- /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 000000000..39394952e --- /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 000000000..00c8a8502 --- /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 000000000..c69556be1 --- /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 000000000..de11873cb --- /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 000000000..5e58f432e --- /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 000000000..ce1adc0e8 --- /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 000000000..b9c0ad527 --- /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 000000000..59beb64c3 --- /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 000000000..9071d0aeb --- /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/specs/run/ts_import_from_js/ts_import_from_js/deps.js b/tests/specs/run/ts_import_from_js/ts_import_from_js/deps.js new file mode 100644 index 000000000..746b5cf6b --- /dev/null +++ b/tests/specs/run/ts_import_from_js/ts_import_from_js/deps.js @@ -0,0 +1,2 @@ +import "../005_more_imports.ts"; +export { printHello } from "http://localhost:4545/subdir/mod2.ts"; diff --git a/tests/specs/run/ts_import_from_js/ts_import_from_js/main.js b/tests/specs/run/ts_import_from_js/ts_import_from_js/main.js new file mode 100644 index 000000000..32d6c29a1 --- /dev/null +++ b/tests/specs/run/ts_import_from_js/ts_import_from_js/main.js @@ -0,0 +1,3 @@ +import { printHello } from "./deps.js"; +printHello(); +console.log("success"); diff --git a/tests/specs/run/ts_import_from_js/ts_import_from_js/main.out b/tests/specs/run/ts_import_from_js/ts_import_from_js/main.out new file mode 100644 index 000000000..e1d7a869f --- /dev/null +++ b/tests/specs/run/ts_import_from_js/ts_import_from_js/main.out @@ -0,0 +1,3 @@ +Hello +Hello +success 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 000000000..e9a925d1a --- /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/specs/run/ts_type_imports/ts_type_imports.ts b/tests/specs/run/ts_type_imports/ts_type_imports.ts new file mode 100644 index 000000000..73c779156 --- /dev/null +++ b/tests/specs/run/ts_type_imports/ts_type_imports.ts @@ -0,0 +1,5 @@ +// deno-lint-ignore-file + +type Foo = import("./ts_type_imports_foo.ts").Foo; + +const foo: Foo = new Map(); diff --git a/tests/specs/run/ts_type_imports/ts_type_imports.ts.out b/tests/specs/run/ts_type_imports/ts_type_imports.ts.out new file mode 100644 index 000000000..3972d6a97 --- /dev/null +++ b/tests/specs/run/ts_type_imports/ts_type_imports.ts.out @@ -0,0 +1,6 @@ +Check [WILDCARD]ts_type_imports.ts +error: TS2322 [ERROR]: Type 'Map' is not assignable to type 'Foo'. + Type 'string' is not assignable to type 'number'. +const foo: Foo = new Map(); + ~~~ + at [WILDCARD]ts_type_imports.ts:5:7 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 000000000..db20773f6 --- /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 000000000..977a6aba7 --- /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 000000000..d48e4b48a --- /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/specs/run/ts_type_only_import/ts_type_only_import.ts b/tests/specs/run/ts_type_only_import/ts_type_only_import.ts new file mode 100644 index 000000000..53e114373 --- /dev/null +++ b/tests/specs/run/ts_type_only_import/ts_type_only_import.ts @@ -0,0 +1 @@ +export * from "./ts_type_only_import.d.ts"; diff --git a/tests/specs/run/ts_type_only_import/ts_type_only_import.ts.out b/tests/specs/run/ts_type_only_import/ts_type_only_import.ts.out new file mode 100644 index 000000000..42852cd26 --- /dev/null +++ b/tests/specs/run/ts_type_only_import/ts_type_only_import.ts.out @@ -0,0 +1 @@ +Check file://[WILDCARD]/ts_type_only_import.ts 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 000000000..a6c713bf5 --- /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 000000000..f10891d7a --- /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 000000000..4f02dd4c3 --- /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 000000000..5ed3ff2fa --- /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 000000000..2026804ad --- /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/specs/run/tsx_imports/tsx_imports/Component.tsx b/tests/specs/run/tsx_imports/tsx_imports/Component.tsx new file mode 100644 index 000000000..c466a28ca --- /dev/null +++ b/tests/specs/run/tsx_imports/tsx_imports/Component.tsx @@ -0,0 +1 @@ +import "../046_jsx_test.tsx"; diff --git a/tests/specs/run/tsx_imports/tsx_imports/tsx_imports.ts b/tests/specs/run/tsx_imports/tsx_imports/tsx_imports.ts new file mode 100644 index 000000000..44ba10b7a --- /dev/null +++ b/tests/specs/run/tsx_imports/tsx_imports/tsx_imports.ts @@ -0,0 +1 @@ +import "./Component.tsx"; diff --git a/tests/specs/run/tsx_imports/tsx_imports/tsx_imports.ts.out b/tests/specs/run/tsx_imports/tsx_imports/tsx_imports.ts.out new file mode 100644 index 000000000..1f8b10d32 --- /dev/null +++ b/tests/specs/run/tsx_imports/tsx_imports/tsx_imports.ts.out @@ -0,0 +1,2 @@ +Check [WILDCARD]tsx_imports.ts +{ factory: [Function: View], props: null, children: [] } diff --git a/tests/specs/run/type_definitions/__test__.jsonc b/tests/specs/run/type_definitions/__test__.jsonc new file mode 100644 index 000000000..5030612a5 --- /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/specs/run/type_definitions/type_definitions.ts b/tests/specs/run/type_definitions/type_definitions.ts new file mode 100644 index 000000000..0297c7e3d --- /dev/null +++ b/tests/specs/run/type_definitions/type_definitions.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file + +// @deno-types="../type_definitions/foo.d.ts" +import { foo } from "./type_definitions/foo.js"; +// @deno-types="../type_definitions/fizz.d.ts" +import "./type_definitions/fizz.js"; + +import * as qat from "./type_definitions/qat.ts"; + +console.log(foo); +console.log(fizz); +console.log(qat.qat); diff --git a/tests/specs/run/type_definitions/type_definitions.ts.out b/tests/specs/run/type_definitions/type_definitions.ts.out new file mode 100644 index 000000000..b4fa88c50 --- /dev/null +++ b/tests/specs/run/type_definitions/type_definitions.ts.out @@ -0,0 +1,3 @@ +[WILDCARD]foo +fizz +qat 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 000000000..d43335dbb --- /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 000000000..e9c2e5193 --- /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 000000000..34eb41b96 --- /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 000000000..852162c94 --- /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 000000000..ce39201e1 --- /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 000000000..61d366eb2 --- /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 000000000..6196c9d38 --- /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 000000000..cf32bc960 --- /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 000000000..e33b70a64 --- /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 000000000..d43335dbb --- /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 000000000..e9c2e5193 --- /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 000000000..34eb41b96 --- /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 000000000..852162c94 --- /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 000000000..ce39201e1 --- /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 000000000..61d366eb2 --- /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 000000000..6196c9d38 --- /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/specs/run/type_definitions_for_export/type_definitions_for_export.ts b/tests/specs/run/type_definitions_for_export/type_definitions_for_export.ts new file mode 100644 index 000000000..1f17b4962 --- /dev/null +++ b/tests/specs/run/type_definitions_for_export/type_definitions_for_export.ts @@ -0,0 +1,7 @@ +import { foo } from "./export_type_def.ts"; + +function bar(a: number) { + console.log(a); +} + +bar(foo); diff --git a/tests/specs/run/type_definitions_for_export/type_definitions_for_export.ts.out b/tests/specs/run/type_definitions_for_export/type_definitions_for_export.ts.out new file mode 100644 index 000000000..8f1240bc7 --- /dev/null +++ b/tests/specs/run/type_definitions_for_export/type_definitions_for_export.ts.out @@ -0,0 +1,5 @@ +Check [WILDCARD]type_definitions_for_export.ts +error: TS2345 [ERROR]: Argument of type 'string' is not assignable to parameter of type 'number'. +bar(foo); + ~~~ + at [WILDCARD]type_definitions_for_export.ts:7:5 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 000000000..08826b776 --- /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/specs/run/type_directives_01/type_directives_01.ts b/tests/specs/run/type_directives_01/type_directives_01.ts new file mode 100644 index 000000000..2129d90b4 --- /dev/null +++ b/tests/specs/run/type_directives_01/type_directives_01.ts @@ -0,0 +1,3 @@ +import * as foo from "http://localhost:4545/xTypeScriptTypes.js"; + +console.log(foo.foo); diff --git a/tests/specs/run/type_directives_01/type_directives_01.ts.out b/tests/specs/run/type_directives_01/type_directives_01.ts.out new file mode 100644 index 000000000..466218a96 --- /dev/null +++ b/tests/specs/run/type_directives_01/type_directives_01.ts.out @@ -0,0 +1,3 @@ +[WILDCARD] +DEBUG TS - host.getSourceFile("http://localhost:4545/xTypeScriptTypes.d.ts", Latest) +[WILDCARD] \ No newline at end of file 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 000000000..e731e393e --- /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 000000000..f829c0cec --- /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 000000000..d9bd38150 --- /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 000000000..f9b8de5ed --- /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 000000000..917d89198 --- /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 000000000..1a95fa2d4 --- /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/specs/run/type_headers_deno_types/type_headers_deno_types.ts b/tests/specs/run/type_headers_deno_types/type_headers_deno_types.ts new file mode 100644 index 000000000..197ac1801 --- /dev/null +++ b/tests/specs/run/type_headers_deno_types/type_headers_deno_types.ts @@ -0,0 +1,18 @@ +/** + * Following import uses two distinct ways to provide types: + * - X-TypeScript-Types headers + * - @deno-types directive + * + * Because "@deno-types" directive must be placed by user explicitly it + * should have higher precedence than type header. + * + * This is verified by providing conflicting type declaration + * depending on a way. There should be no TS error, otherwise + * it means that wrong type declarations are used (from X-TypeScript-Types) + * header. + */ + +// @deno-types="http://localhost:4545/run/type_headers_deno_types.foo.d.ts" +import { foo } from "http://localhost:4545/run/type_headers_deno_types.foo.js"; + +foo("hello"); diff --git a/tests/specs/run/type_headers_deno_types/type_headers_deno_types.ts.out b/tests/specs/run/type_headers_deno_types/type_headers_deno_types.ts.out new file mode 100644 index 000000000..798f98311 --- /dev/null +++ b/tests/specs/run/type_headers_deno_types/type_headers_deno_types.ts.out @@ -0,0 +1,5 @@ +Download http://[WILDCARD]:4545/run/type_headers_deno_types.foo.js +Download http://[WILDCARD]:4545/run/type_headers_deno_types.foo.d.ts +Download http://[WILDCARD]:4545/run/type_headers_deno_types.d.ts +Check [WILDCARD]/type_headers_deno_types.ts +hello diff --git a/tests/specs/run/unbuffered_stderr/__test__.jsonc b/tests/specs/run/unbuffered_stderr/__test__.jsonc new file mode 100644 index 000000000..4b8a091f2 --- /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/specs/run/unbuffered_stderr/unbuffered_stderr.ts b/tests/specs/run/unbuffered_stderr/unbuffered_stderr.ts new file mode 100644 index 000000000..0f1d2a999 --- /dev/null +++ b/tests/specs/run/unbuffered_stderr/unbuffered_stderr.ts @@ -0,0 +1 @@ +Deno.stderr.write(new TextEncoder().encode("x")); diff --git a/tests/specs/run/unbuffered_stderr/unbuffered_stderr.ts.out b/tests/specs/run/unbuffered_stderr/unbuffered_stderr.ts.out new file mode 100644 index 000000000..c1b0730e0 --- /dev/null +++ b/tests/specs/run/unbuffered_stderr/unbuffered_stderr.ts.out @@ -0,0 +1 @@ +x \ No newline at end of file diff --git a/tests/specs/run/unbuffered_stdout/__test__.jsonc b/tests/specs/run/unbuffered_stdout/__test__.jsonc new file mode 100644 index 000000000..4225e9d0a --- /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/specs/run/unbuffered_stdout/unbuffered_stdout.ts b/tests/specs/run/unbuffered_stdout/unbuffered_stdout.ts new file mode 100644 index 000000000..9f1e07a97 --- /dev/null +++ b/tests/specs/run/unbuffered_stdout/unbuffered_stdout.ts @@ -0,0 +1 @@ +Deno.stdout.write(new TextEncoder().encode("a")); diff --git a/tests/specs/run/unbuffered_stdout/unbuffered_stdout.ts.out b/tests/specs/run/unbuffered_stdout/unbuffered_stdout.ts.out new file mode 100644 index 000000000..2e65efe2a --- /dev/null +++ b/tests/specs/run/unbuffered_stdout/unbuffered_stdout.ts.out @@ -0,0 +1 @@ +a \ No newline at end of file diff --git a/tests/specs/run/unhandled_rejection/__test__.jsonc b/tests/specs/run/unhandled_rejection/__test__.jsonc new file mode 100644 index 000000000..3a2229206 --- /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/specs/run/unhandled_rejection/unhandled_rejection.ts b/tests/specs/run/unhandled_rejection/unhandled_rejection.ts new file mode 100644 index 000000000..388583434 --- /dev/null +++ b/tests/specs/run/unhandled_rejection/unhandled_rejection.ts @@ -0,0 +1,13 @@ +globalThis.addEventListener("unhandledrejection", (e) => { + console.log("unhandled rejection at:", e.promise, "reason:", e.reason); + e.preventDefault(); +}); + +class Foo { + constructor() { + Promise.reject(new Error("bar not available")); + } +} + +new Foo(); +Promise.reject(); 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 000000000..fc5a3915f --- /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 000000000..6ca0d093b --- /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/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/import.ts b/tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/import.ts new file mode 100644 index 000000000..b490f2c20 --- /dev/null +++ b/tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/import.ts @@ -0,0 +1,5 @@ +globalThis.addEventListener("unhandledrejection", () => { + console.log("hey"); +}); +console.log("---"); +Promise.reject(); diff --git a/tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/main.ts b/tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/main.ts new file mode 100644 index 000000000..244d84467 --- /dev/null +++ b/tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/main.ts @@ -0,0 +1 @@ +await import("./import.ts"); diff --git a/tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/main.ts.out b/tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/main.ts.out new file mode 100644 index 000000000..f44c6d2ff --- /dev/null +++ b/tests/specs/run/unhandled_rejection_dynamic_import/unhandled_rejection_dynamic_import/main.ts.out @@ -0,0 +1,3 @@ +--- +hey +error: Uncaught (in promise) undefined 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 000000000..a4e588f46 --- /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/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/import.ts b/tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/import.ts new file mode 100644 index 000000000..f84297afd --- /dev/null +++ b/tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/import.ts @@ -0,0 +1,3 @@ +export default { + a: "a", +}; diff --git a/tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/main.ts b/tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/main.ts new file mode 100644 index 000000000..3da2e1d19 --- /dev/null +++ b/tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/main.ts @@ -0,0 +1,21 @@ +globalThis.addEventListener("unhandledrejection", (e) => { + console.log("unhandled rejection", e.reason); + e.preventDefault(); +}); + +const dummyImport = (await import("./import.ts")).default; + +let a = new Promise((resolve, reject) => { + throw "errA"; +}); + +let i = 0; +while (true) { + await new Promise((resolve) => setTimeout(resolve, 100)); + i++; + console.log("running..."); + + if (i > 3) { + break; + } +} diff --git a/tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/main.ts.out b/tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/main.ts.out new file mode 100644 index 000000000..0a913a4b5 --- /dev/null +++ b/tests/specs/run/unhandled_rejection_dynamic_import2/unhandled_rejection_dynamic_import2/main.ts.out @@ -0,0 +1,5 @@ +unhandled rejection errA +running... +running... +running... +running... 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 000000000..3f09f9c36 --- /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/specs/run/unhandled_rejection_sync_error/unhandled_rejection_sync_error.ts b/tests/specs/run/unhandled_rejection_sync_error/unhandled_rejection_sync_error.ts new file mode 100644 index 000000000..0dabb1cb7 --- /dev/null +++ b/tests/specs/run/unhandled_rejection_sync_error/unhandled_rejection_sync_error.ts @@ -0,0 +1,6 @@ +globalThis.addEventListener("unhandledrejection", (e) => { + console.log("unhandled rejection at:", e.promise, "reason:", e.reason); + e.preventDefault(); +}); + +throw new Error("boom!"); 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 000000000..0c1115ef2 --- /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 000000000..d1c608b51 --- /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/specs/run/unsafe_proto/unsafe_proto/main.js b/tests/specs/run/unsafe_proto/unsafe_proto/main.js new file mode 100644 index 000000000..eb95c55a0 --- /dev/null +++ b/tests/specs/run/unsafe_proto/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/unsafe_proto/main.out b/tests/specs/run/unsafe_proto/unsafe_proto/main.out new file mode 100644 index 000000000..4b095fd0f --- /dev/null +++ b/tests/specs/run/unsafe_proto/unsafe_proto/main.out @@ -0,0 +1,2 @@ +false +false diff --git a/tests/specs/run/unsafe_proto/unsafe_proto/main_with_unsafe_proto_flag.out b/tests/specs/run/unsafe_proto/unsafe_proto/main_with_unsafe_proto_flag.out new file mode 100644 index 000000000..bb101b641 --- /dev/null +++ b/tests/specs/run/unsafe_proto/unsafe_proto/main_with_unsafe_proto_flag.out @@ -0,0 +1,2 @@ +true +true diff --git a/tests/specs/run/unsafe_proto/unsafe_proto/worker.js b/tests/specs/run/unsafe_proto/unsafe_proto/worker.js new file mode 100644 index 000000000..b22bc8713 --- /dev/null +++ b/tests/specs/run/unsafe_proto/unsafe_proto/worker.js @@ -0,0 +1,2 @@ +console.log(Object.hasOwn(Object.prototype, "__proto__")); +close(); 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 000000000..8bd2b56ff --- /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 000000000..eb95c55a0 --- /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 000000000..4b095fd0f --- /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 000000000..bb101b641 --- /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 000000000..b22bc8713 --- /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 000000000..fa12c9f91 --- /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/specs/run/unstable_broadcast_channel_disabled/unstable_broadcast_channel.disabled.out b/tests/specs/run/unstable_broadcast_channel_disabled/unstable_broadcast_channel.disabled.out new file mode 100644 index 000000000..775866352 --- /dev/null +++ b/tests/specs/run/unstable_broadcast_channel_disabled/unstable_broadcast_channel.disabled.out @@ -0,0 +1,2 @@ +main undefined +worker undefined diff --git a/tests/specs/run/unstable_broadcast_channel_disabled/unstable_broadcast_channel.js b/tests/specs/run/unstable_broadcast_channel_disabled/unstable_broadcast_channel.js new file mode 100644 index 000000000..b8576aa22 --- /dev/null +++ b/tests/specs/run/unstable_broadcast_channel_disabled/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_broadcast_channel_enabled/__test__.jsonc b/tests/specs/run/unstable_broadcast_channel_enabled/__test__.jsonc new file mode 100644 index 000000000..f93c7785a --- /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/specs/run/unstable_broadcast_channel_enabled/unstable_broadcast_channel.enabled.out b/tests/specs/run/unstable_broadcast_channel_enabled/unstable_broadcast_channel.enabled.out new file mode 100644 index 000000000..b3701ce44 --- /dev/null +++ b/tests/specs/run/unstable_broadcast_channel_enabled/unstable_broadcast_channel.enabled.out @@ -0,0 +1,2 @@ +main [class BroadcastChannel extends EventTarget] +worker [class BroadcastChannel extends EventTarget] 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 000000000..b8576aa22 --- /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 000000000..be89db40b --- /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/specs/run/unstable_cron_disabled/unstable_cron.disabled.out b/tests/specs/run/unstable_cron_disabled/unstable_cron.disabled.out new file mode 100644 index 000000000..775866352 --- /dev/null +++ b/tests/specs/run/unstable_cron_disabled/unstable_cron.disabled.out @@ -0,0 +1,2 @@ +main undefined +worker undefined diff --git a/tests/specs/run/unstable_cron_disabled/unstable_cron.js b/tests/specs/run/unstable_cron_disabled/unstable_cron.js new file mode 100644 index 000000000..3114f6e55 --- /dev/null +++ b/tests/specs/run/unstable_cron_disabled/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_cron_enabled/__test__.jsonc b/tests/specs/run/unstable_cron_enabled/__test__.jsonc new file mode 100644 index 000000000..07a37e3fe --- /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/specs/run/unstable_cron_enabled/unstable_cron.enabled.out b/tests/specs/run/unstable_cron_enabled/unstable_cron.enabled.out new file mode 100644 index 000000000..d18304f1f --- /dev/null +++ b/tests/specs/run/unstable_cron_enabled/unstable_cron.enabled.out @@ -0,0 +1,2 @@ +main [Function: cron] +worker [Function: cron] 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 000000000..3114f6e55 --- /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 000000000..6521c180d --- /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/specs/run/unstable_kv_disabled/unstable_kv.disabled.out b/tests/specs/run/unstable_kv_disabled/unstable_kv.disabled.out new file mode 100644 index 000000000..0d8ac4410 --- /dev/null +++ b/tests/specs/run/unstable_kv_disabled/unstable_kv.disabled.out @@ -0,0 +1,10 @@ +main undefined +main undefined +main undefined +main undefined +main undefined +worker undefined +worker undefined +worker undefined +worker undefined +worker undefined diff --git a/tests/specs/run/unstable_kv_disabled/unstable_kv.js b/tests/specs/run/unstable_kv_disabled/unstable_kv.js new file mode 100644 index 000000000..17c0e05aa --- /dev/null +++ b/tests/specs/run/unstable_kv_disabled/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_kv_enabled/__test__.jsonc b/tests/specs/run/unstable_kv_enabled/__test__.jsonc new file mode 100644 index 000000000..6e9fea100 --- /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/specs/run/unstable_kv_enabled/unstable_kv.enabled.out b/tests/specs/run/unstable_kv_enabled/unstable_kv.enabled.out new file mode 100644 index 000000000..a1356cefc --- /dev/null +++ b/tests/specs/run/unstable_kv_enabled/unstable_kv.enabled.out @@ -0,0 +1,10 @@ +main [class AtomicOperation] +main [class Kv] +main [class KvListIterator extends Object] +main [class KvU64] +main [AsyncFunction: openKv] +worker [class AtomicOperation] +worker [class Kv] +worker [class KvListIterator extends Object] +worker [class KvU64] +worker [AsyncFunction: openKv] 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 000000000..17c0e05aa --- /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 000000000..6bccb2ef6 --- /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/specs/run/unstable_net_disabled/unstable_net.disabled.out b/tests/specs/run/unstable_net_disabled/unstable_net.disabled.out new file mode 100644 index 000000000..3562f72fd --- /dev/null +++ b/tests/specs/run/unstable_net_disabled/unstable_net.disabled.out @@ -0,0 +1,4 @@ +main undefined +main undefined +worker undefined +worker undefined diff --git a/tests/specs/run/unstable_net_disabled/unstable_net.js b/tests/specs/run/unstable_net_disabled/unstable_net.js new file mode 100644 index 000000000..4492b202b --- /dev/null +++ b/tests/specs/run/unstable_net_disabled/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_net_enabled/__test__.jsonc b/tests/specs/run/unstable_net_enabled/__test__.jsonc new file mode 100644 index 000000000..8e9696f44 --- /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/specs/run/unstable_net_enabled/unstable_net.enabled.out b/tests/specs/run/unstable_net_enabled/unstable_net.enabled.out new file mode 100644 index 000000000..8b86637f3 --- /dev/null +++ b/tests/specs/run/unstable_net_enabled/unstable_net.enabled.out @@ -0,0 +1,4 @@ +main [Function: listenDatagram] +main [class WebSocketStream] +worker [Function: listenDatagram] +worker [class WebSocketStream] 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 000000000..4492b202b --- /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 000000000..7a6e9bfbe --- /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/specs/run/unstable_worker/unstable_worker.ts b/tests/specs/run/unstable_worker/unstable_worker.ts new file mode 100644 index 000000000..b0554c5b2 --- /dev/null +++ b/tests/specs/run/unstable_worker/unstable_worker.ts @@ -0,0 +1,6 @@ +const w = new Worker( + import.meta.resolve("./worker_unstable.ts"), + { type: "module", name: "Unstable Worker" }, +); + +w.postMessage({}); diff --git a/tests/specs/run/unstable_worker/unstable_worker.ts.out b/tests/specs/run/unstable_worker/unstable_worker.ts.out new file mode 100644 index 000000000..182dc58a4 --- /dev/null +++ b/tests/specs/run/unstable_worker/unstable_worker.ts.out @@ -0,0 +1,2 @@ +[Function: query] +[Function: consoleSize] 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 000000000..219f34e7b --- /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 000000000..30087244e --- /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/specs/run/unstable_worker_options_disabled/unstable_worker_options.disabled.out b/tests/specs/run/unstable_worker_options_disabled/unstable_worker_options.disabled.out new file mode 100644 index 000000000..ba50ca539 --- /dev/null +++ b/tests/specs/run/unstable_worker_options_disabled/unstable_worker_options.disabled.out @@ -0,0 +1 @@ +Unstable API 'Worker.deno.permissions'. The `--unstable-worker-options` flag must be provided. diff --git a/tests/specs/run/unstable_worker_options_disabled/unstable_worker_options.js b/tests/specs/run/unstable_worker_options_disabled/unstable_worker_options.js new file mode 100644 index 000000000..213eb3ee6 --- /dev/null +++ b/tests/specs/run/unstable_worker_options_disabled/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/unstable_worker_options_enabled/__test__.jsonc b/tests/specs/run/unstable_worker_options_enabled/__test__.jsonc new file mode 100644 index 000000000..1d397c5f2 --- /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/specs/run/unstable_worker_options_enabled/unstable_worker_options.enabled.out b/tests/specs/run/unstable_worker_options_enabled/unstable_worker_options.enabled.out new file mode 100644 index 000000000..57a52b019 --- /dev/null +++ b/tests/specs/run/unstable_worker_options_enabled/unstable_worker_options.enabled.out @@ -0,0 +1,2 @@ +main ok +worker ok 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 000000000..213eb3ee6 --- /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 000000000..7f71dceba --- /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/specs/run/unsupported_dynamic_import_scheme/unsupported_dynamic_import_scheme.out b/tests/specs/run/unsupported_dynamic_import_scheme/unsupported_dynamic_import_scheme.out new file mode 100644 index 000000000..c708fced4 --- /dev/null +++ b/tests/specs/run/unsupported_dynamic_import_scheme/unsupported_dynamic_import_scheme.out @@ -0,0 +1,7 @@ +error: Uncaught (in promise) TypeError: Unsupported scheme "xxx" for module "xxx:". Supported schemes: [ + "data", + "blob", + "file", + "http", + "https", +] 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 000000000..39ea666b8 --- /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/specs/run/v8_flags_env_run/v8_flags.js b/tests/specs/run/v8_flags_env_run/v8_flags.js new file mode 100644 index 000000000..f7999c4af --- /dev/null +++ b/tests/specs/run/v8_flags_env_run/v8_flags.js @@ -0,0 +1 @@ +console.log(typeof gc); diff --git a/tests/specs/run/v8_flags_env_run/v8_flags.js.out b/tests/specs/run/v8_flags_env_run/v8_flags.js.out new file mode 100644 index 000000000..e2dbde096 --- /dev/null +++ b/tests/specs/run/v8_flags_env_run/v8_flags.js.out @@ -0,0 +1 @@ +function 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 000000000..ff21fb8c5 --- /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 000000000..f7999c4af --- /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 000000000..e2dbde096 --- /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 000000000..93472d0d7 --- /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/specs/run/v8_flags_unrecognized/v8_flags_unrecognized.out b/tests/specs/run/v8_flags_unrecognized/v8_flags_unrecognized.out new file mode 100644 index 000000000..56e70f830 --- /dev/null +++ b/tests/specs/run/v8_flags_unrecognized/v8_flags_unrecognized.out @@ -0,0 +1,5 @@ +error: V8 did not recognize flag '--foo' +error: V8 did not recognize flag 'bar' +error: V8 did not recognize flag '-baz' + +For a list of V8 flags, use '--v8-flags=--help' diff --git a/tests/specs/run/v8_help/__test__.jsonc b/tests/specs/run/v8_help/__test__.jsonc new file mode 100644 index 000000000..90cbeb274 --- /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/specs/run/v8_help/v8_help.out b/tests/specs/run/v8_help/v8_help.out new file mode 100644 index 000000000..006d73557 --- /dev/null +++ b/tests/specs/run/v8_help/v8_help.out @@ -0,0 +1,4 @@ +[WILDCARD] +Options: +[WILDCARD] + --trace-gc [WILDCARD] diff --git a/tests/specs/run/wasm/__test__.jsonc b/tests/specs/run/wasm/__test__.jsonc new file mode 100644 index 000000000..a3c6f58b2 --- /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/specs/run/wasm/wasm.ts b/tests/specs/run/wasm/wasm.ts new file mode 100644 index 000000000..96b5fdffc --- /dev/null +++ b/tests/specs/run/wasm/wasm.ts @@ -0,0 +1,16 @@ +// deno-fmt-ignore +const wasmCode = new Uint8Array([ + 0, 97, 115, 109, 1, 0, 0, 0, 1, 133, 128, 128, 128, 0, 1, 96, 0, 1, 127, + 3, 130, 128, 128, 128, 0, 1, 0, 4, 132, 128, 128, 128, 0, 1, 112, 0, 0, + 5, 131, 128, 128, 128, 0, 1, 0, 1, 6, 129, 128, 128, 128, 0, 0, 7, 145, + 128, 128, 128, 0, 2, 6, 109, 101, 109, 111, 114, 121, 2, 0, 4, 109, 97, + 105, 110, 0, 0, 10, 138, 128, 128, 128, 0, 1, 132, 128, 128, 128, 0, 0, + 65, 42, 11 + ]); + +const wasmModule = new WebAssembly.Module(wasmCode); + +const wasmInstance = new WebAssembly.Instance(wasmModule); + +const main = wasmInstance.exports.main as CallableFunction; +console.log(main().toString()); diff --git a/tests/specs/run/wasm/wasm.ts.out b/tests/specs/run/wasm/wasm.ts.out new file mode 100644 index 000000000..d81cc0710 --- /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 000000000..583da86e0 --- /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/specs/run/wasm_async/wasm_async.js b/tests/specs/run/wasm_async/wasm_async.js new file mode 100644 index 000000000..837460ae9 --- /dev/null +++ b/tests/specs/run/wasm_async/wasm_async.js @@ -0,0 +1,27 @@ +// The following blob can be created by taking the following s-expr and pass +// it through wat2wasm. +// (module +// (func $add (param $a i32) (param $b i32) (result i32) +// local.get $a +// local.get $b +// i32.add) +// (export "add" (func $add)) +// ) +// deno-fmt-ignore +const bytes = new Uint8Array([ + 0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x07, 0x01, 0x60, + 0x02, 0x7f, 0x7f, 0x01, 0x7f, 0x03, 0x02, 0x01, 0x00, 0x07, 0x07, 0x01, + 0x03, 0x61, 0x64, 0x64, 0x00, 0x00, 0x0a, 0x09, 0x01, 0x07, 0x00, 0x20, + 0x00, 0x20, 0x01, 0x6a, 0x0b +]); + +async function main() { + const wasm = await WebAssembly.instantiate(bytes); + const result = wasm.instance.exports.add(1, 3); + console.log("1 + 3 =", result); + if (result != 4) { + throw Error("bad"); + } +} + +main(); diff --git a/tests/specs/run/wasm_async/wasm_async.out b/tests/specs/run/wasm_async/wasm_async.out new file mode 100644 index 000000000..5cdf17de7 --- /dev/null +++ b/tests/specs/run/wasm_async/wasm_async.out @@ -0,0 +1 @@ +1 + 3 = 4 diff --git a/tests/specs/run/wasm_shared/__test__.jsonc b/tests/specs/run/wasm_shared/__test__.jsonc new file mode 100644 index 000000000..1b6ececa7 --- /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 000000000..e69de29bb diff --git a/tests/specs/run/wasm_shared/wasm_shared.ts b/tests/specs/run/wasm_shared/wasm_shared.ts new file mode 100644 index 000000000..b713385d5 --- /dev/null +++ b/tests/specs/run/wasm_shared/wasm_shared.ts @@ -0,0 +1,6 @@ +const memory = new WebAssembly.Memory({ + initial: 1, + maximum: 10, + shared: true, +}); +console.assert(memory.buffer instanceof SharedArrayBuffer); 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 000000000..e22e1f98a --- /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/specs/run/wasm_streaming_panic_test/wasm_streaming_panic_test.js b/tests/specs/run/wasm_streaming_panic_test/wasm_streaming_panic_test.js new file mode 100644 index 000000000..ec017592f --- /dev/null +++ b/tests/specs/run/wasm_streaming_panic_test/wasm_streaming_panic_test.js @@ -0,0 +1,3 @@ +// https://github.com/denoland/deno/issues/13917 + +WebAssembly.instantiateStreaming(Response.error()); diff --git a/tests/specs/run/wasm_streaming_panic_test/wasm_streaming_panic_test.js.out b/tests/specs/run/wasm_streaming_panic_test/wasm_streaming_panic_test.js.out new file mode 100644 index 000000000..4ec523f1d --- /dev/null +++ b/tests/specs/run/wasm_streaming_panic_test/wasm_streaming_panic_test.js.out @@ -0,0 +1,2 @@ +error: Uncaught (in promise) TypeError: Invalid WebAssembly content type + at handleWasmStreaming (ext:deno_fetch/26_fetch.js:[WILDCARD]) diff --git a/tests/specs/run/wasm_unreachable/__test__.jsonc b/tests/specs/run/wasm_unreachable/__test__.jsonc new file mode 100644 index 000000000..cd6165629 --- /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 000000000..a4110ee39 Binary files /dev/null and b/tests/specs/run/wasm_unreachable/unreachable.wasm differ diff --git a/tests/specs/run/wasm_unreachable/wasm_unreachable.js b/tests/specs/run/wasm_unreachable/wasm_unreachable.js new file mode 100644 index 000000000..36aab0d84 --- /dev/null +++ b/tests/specs/run/wasm_unreachable/wasm_unreachable.js @@ -0,0 +1,9 @@ +// WebAssembly module containing a single function with an unreachable instruction +const binary = await Deno.readFile("./unreachable.wasm"); + +const module = new WebAssembly.Module(binary); +const instance = new WebAssembly.Instance(module); + +// Compare the stack trace with wasm_url.js, which compiles the WASM module with +// streaming APIs. +instance.exports.unreachable(); diff --git a/tests/specs/run/wasm_unreachable/wasm_unreachable.out b/tests/specs/run/wasm_unreachable/wasm_unreachable.out new file mode 100644 index 000000000..c213097ab --- /dev/null +++ b/tests/specs/run/wasm_unreachable/wasm_unreachable.out @@ -0,0 +1,3 @@ +error: Uncaught[WILDCARD] RuntimeError: unreachable + at (wasm://wasm/d1c677ea:1:41) + at [WILDCARD]/wasm_unreachable.js:[WILDCARD] diff --git a/tests/specs/run/wasm_url/__test__.jsonc b/tests/specs/run/wasm_url/__test__.jsonc new file mode 100644 index 000000000..a776527b1 --- /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/specs/run/wasm_url/wasm_url.js b/tests/specs/run/wasm_url/wasm_url.js new file mode 100644 index 000000000..71686ef7e --- /dev/null +++ b/tests/specs/run/wasm_url/wasm_url.js @@ -0,0 +1,8 @@ +const module = await WebAssembly.compileStreaming( + fetch("http://localhost:4545/assets/unreachable.wasm"), +); +const instance = new WebAssembly.Instance(module); + +// Compare the stack trace with wasm_unreachable.js, which compiles the WASM +// module with synchronous APIs. +instance.exports.unreachable(); diff --git a/tests/specs/run/wasm_url/wasm_url.out b/tests/specs/run/wasm_url/wasm_url.out new file mode 100644 index 000000000..ae3bf491a --- /dev/null +++ b/tests/specs/run/wasm_url/wasm_url.out @@ -0,0 +1,3 @@ +error: Uncaught (in promise) RuntimeError: unreachable + at (http://localhost:4545/assets/unreachable.wasm:1:41) + at [WILDCARD]/wasm_url.js:[WILDCARD] diff --git a/tests/specs/run/weakref/__test__.jsonc b/tests/specs/run/weakref/__test__.jsonc new file mode 100644 index 000000000..1a5808ec7 --- /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/specs/run/weakref/weakref.ts b/tests/specs/run/weakref/weakref.ts new file mode 100644 index 000000000..47c3985fe --- /dev/null +++ b/tests/specs/run/weakref/weakref.ts @@ -0,0 +1 @@ +console.log(WeakRef, FinalizationRegistry); diff --git a/tests/specs/run/weakref/weakref.ts.out b/tests/specs/run/weakref/weakref.ts.out new file mode 100644 index 000000000..32bafcf2d --- /dev/null +++ b/tests/specs/run/weakref/weakref.ts.out @@ -0,0 +1 @@ +[Function: WeakRef] [Function: FinalizationRegistry] diff --git a/tests/specs/run/webstorage_serialization/__test__.jsonc b/tests/specs/run/webstorage_serialization/__test__.jsonc new file mode 100644 index 000000000..4362a84b2 --- /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 000000000..875cb6001 --- /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 000000000..875cb6001 --- /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 000000000..cf4bd9f1f --- /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 000000000..feadd39eb --- /dev/null +++ b/tests/specs/run/webstorage_serialization/webstorage/logger.ts @@ -0,0 +1 @@ +console.log(globalThis.localStorage); diff --git a/tests/specs/run/webstorage_serialization/webstorage/serialization.ts b/tests/specs/run/webstorage_serialization/webstorage/serialization.ts new file mode 100644 index 000000000..f125331bb --- /dev/null +++ b/tests/specs/run/webstorage_serialization/webstorage/serialization.ts @@ -0,0 +1,4 @@ +globalThis.sessionStorage.setItem("hello", "deno"); + +console.log(globalThis.localStorage); +console.log(globalThis.sessionStorage); diff --git a/tests/specs/run/webstorage_serialization/webstorage/serialization.ts.out b/tests/specs/run/webstorage_serialization/webstorage/serialization.ts.out new file mode 100644 index 000000000..4d80032f0 --- /dev/null +++ b/tests/specs/run/webstorage_serialization/webstorage/serialization.ts.out @@ -0,0 +1,2 @@ +Storage {[WILDCARD] +Storage { hello: "deno", length: 1 } 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 000000000..cf5a7bfaf --- /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 000000000..104b54756 --- /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 000000000..abe573108 --- /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/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 new file mode 100644 index 000000000..828320a24 --- /dev/null +++ b/tests/specs/run/worker_close_in_wasm_reactions/worker_close_in_wasm_reactions.js @@ -0,0 +1,10 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +// 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. + +new Worker( + import.meta.resolve("./close_in_wasm_reactions.js"), + { type: "module" }, +); diff --git a/tests/specs/run/worker_close_in_wasm_reactions/worker_close_in_wasm_reactions.js.out b/tests/specs/run/worker_close_in_wasm_reactions/worker_close_in_wasm_reactions.js.out new file mode 100644 index 000000000..904613dae --- /dev/null +++ b/tests/specs/run/worker_close_in_wasm_reactions/worker_close_in_wasm_reactions.js.out @@ -0,0 +1,2 @@ +Error: CompileError: WebAssembly.compile(): reached end while decoding length @+10 + at file:///[WILDCARD]/close_in_wasm_reactions.js:18:13 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 000000000..5cce107c7 --- /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 000000000..97980c689 --- /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 000000000..d1fe47553 --- /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/specs/run/worker_close_nested/worker_close_nested.js b/tests/specs/run/worker_close_nested/worker_close_nested.js new file mode 100644 index 000000000..8d9c88d1c --- /dev/null +++ b/tests/specs/run/worker_close_nested/worker_close_nested.js @@ -0,0 +1,20 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +// Test that closing a worker which has living child workers will automatically +// close the children. + +console.log("Starting the main thread"); + +const worker = new Worker( + import.meta.resolve("./close_nested_parent.js"), + { type: "module" }, +); + +setTimeout(() => { + console.log("About to close"); + worker.postMessage({}); + + // Keep the process running for another two seconds, to make sure there's no + // output from the child worker. + setTimeout(() => {}, 2000); +}, 1000); diff --git a/tests/specs/run/worker_close_nested/worker_close_nested.js.out b/tests/specs/run/worker_close_nested/worker_close_nested.js.out new file mode 100644 index 000000000..496bc6251 --- /dev/null +++ b/tests/specs/run/worker_close_nested/worker_close_nested.js.out @@ -0,0 +1,5 @@ +Starting the main thread +Starting the parent worker +Starting the child worker +About to close +Closing 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 000000000..bdb9665f7 --- /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 000000000..6964be34a --- /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/specs/run/worker_close_race/worker_close_race.js b/tests/specs/run/worker_close_race/worker_close_race.js new file mode 100644 index 000000000..188cd9ed8 --- /dev/null +++ b/tests/specs/run/worker_close_race/worker_close_race.js @@ -0,0 +1,14 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +// https://github.com/denoland/deno/issues/11416 +// Test for a race condition between a worker's `close()` and the main thread's +// `Worker.prototype.terminate()`. + +const worker = new Worker( + import.meta.resolve("./close_race_worker.js"), + { type: "module" }, +); + +worker.onmessage = () => { + worker.terminate(); +}; 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 000000000..e69de29bb 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 000000000..cc600d5ef --- /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 000000000..30676a600 --- /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/specs/run/worker_drop_handle_race/worker_drop_handle_race.js b/tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js new file mode 100644 index 000000000..ef9bcbe07 --- /dev/null +++ b/tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js @@ -0,0 +1,12 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +// https://github.com/denoland/deno/issues/11342 +// Test for a panic that happens when the main thread's event loop finishes +// running while the worker's event loop is still spinning. + +// 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("./drop_handle_race.js"), + { type: "module" }, +); diff --git a/tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js.out b/tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js.out new file mode 100644 index 000000000..a1c2e30ad --- /dev/null +++ b/tests/specs/run/worker_drop_handle_race/worker_drop_handle_race.js.out @@ -0,0 +1,7 @@ +error: Uncaught (in worker "") Error + throw new Error(); + ^ + 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 000000000..e752074eb --- /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/specs/run/worker_drop_handle_race_terminate/worker_drop_handle_race_terminate.js b/tests/specs/run/worker_drop_handle_race_terminate/worker_drop_handle_race_terminate.js new file mode 100644 index 000000000..7c4e0b109 --- /dev/null +++ b/tests/specs/run/worker_drop_handle_race_terminate/worker_drop_handle_race_terminate.js @@ -0,0 +1,37 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +// Test that the panic in https://github.com/denoland/deno/issues/11342 does not +// happen when calling worker.terminate() after fixing +// https://github.com/denoland/deno/issues/13705 + +function getCodeBlobUrl(code) { + const blob = new Blob([code], { type: "text/javascript" }); + return URL.createObjectURL(blob); +} + +const WORKER2 = getCodeBlobUrl(` + console.log("Worker 2"); + self.postMessage(undefined); + + // We sleep synchronously for slightly under 2 seconds in order to make sure + // that worker 1 has closed, and that this worker's thread finishes normally + // rather than being killed (which happens 2 seconds after calling terminate). + Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 1800); + console.log("Finished sleeping in worker 2"); +`); + +const WORKER1 = getCodeBlobUrl(` + console.log("Worker 1"); + const worker = new Worker(${JSON.stringify(WORKER2)}, { type: "module" }); + + worker.addEventListener("message", () => { + console.log("Terminating"); + worker.terminate(); + self.close(); + }); +`); + +new Worker(WORKER1, { type: "module" }); + +// Don't kill the process before worker 2 is finished. +setTimeout(() => {}, 3000); diff --git a/tests/specs/run/worker_drop_handle_race_terminate/worker_drop_handle_race_terminate.js.out b/tests/specs/run/worker_drop_handle_race_terminate/worker_drop_handle_race_terminate.js.out new file mode 100644 index 000000000..5ec1e7ff8 --- /dev/null +++ b/tests/specs/run/worker_drop_handle_race_terminate/worker_drop_handle_race_terminate.js.out @@ -0,0 +1,4 @@ +Worker 1 +Worker 2 +Terminating +Finished sleeping in worker 2 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 000000000..c07fca97c --- /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/specs/run/worker_event_handler_test/worker_event_handler_test.js b/tests/specs/run/worker_event_handler_test/worker_event_handler_test.js new file mode 100644 index 000000000..91c5ba946 --- /dev/null +++ b/tests/specs/run/worker_event_handler_test/worker_event_handler_test.js @@ -0,0 +1,5 @@ +const w = new Worker( + import.meta.resolve("./worker_event_handlers.js"), + { type: "module" }, +); +w.postMessage({}); diff --git a/tests/specs/run/worker_event_handler_test/worker_event_handler_test.js.out b/tests/specs/run/worker_event_handler_test/worker_event_handler_test.js.out new file mode 100644 index 000000000..b3eed7f6c --- /dev/null +++ b/tests/specs/run/worker_event_handler_test/worker_event_handler_test.js.out @@ -0,0 +1,11 @@ +Target from self.onmessage: [object DedicatedWorkerGlobalScope] +Target from message event listener: [object DedicatedWorkerGlobalScope] +Arguments from self.onerror: [ + "Uncaught Error: Some error message", + "[WILDCARD]/worker_event_handlers.js", + 9, + 9, + Error: Some error message + at [WILDCARD] +] +Is event canceled?: true 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 000000000..5e457cd2e --- /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 000000000..ae2d65b91 --- /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 000000000..9364b6d82 --- /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/specs/run/worker_message_before_close/worker_message_before_close.js b/tests/specs/run/worker_message_before_close/worker_message_before_close.js new file mode 100644 index 000000000..d613bd1ca --- /dev/null +++ b/tests/specs/run/worker_message_before_close/worker_message_before_close.js @@ -0,0 +1,26 @@ +const messagesReceived = new Set(); + +for (let i = 0; i < 4; i++) { + const worker = new Worker( + import.meta.resolve("./message_before_close.js"), + { type: "module", name: String(i) }, + ); + + worker.addEventListener("message", () => { + messagesReceived.add(i); + if (messagesReceived.size == 4) { + console.log("received all 4 responses from the workers"); + } + }); + + worker.postMessage({}); +} + +globalThis.addEventListener("unload", () => { + if (messagesReceived.size !== 4) { + console.log( + "received only %d responses from the workers", + messagesReceived.size, + ); + } +}); diff --git a/tests/specs/run/worker_message_before_close/worker_message_before_close.js.out b/tests/specs/run/worker_message_before_close/worker_message_before_close.js.out new file mode 100644 index 000000000..f91b7b4cb --- /dev/null +++ b/tests/specs/run/worker_message_before_close/worker_message_before_close.js.out @@ -0,0 +1 @@ +received all 4 responses from the workers diff --git a/tests/testdata/error_cause_recursive_aggregate.ts b/tests/testdata/error_cause_recursive_aggregate.ts deleted file mode 100644 index 4bb2ae064..000000000 --- a/tests/testdata/error_cause_recursive_aggregate.ts +++ /dev/null @@ -1,9 +0,0 @@ -const foo = new Error("foo"); -const bar = new Error("bar", { cause: foo }); -foo.cause = bar; - -const qux = new Error("qux"); -const quux = new Error("quux", { cause: qux }); -qux.cause = quux; - -throw new AggregateError([bar, quux]); diff --git a/tests/testdata/error_cause_recursive_aggregate.ts.out b/tests/testdata/error_cause_recursive_aggregate.ts.out deleted file mode 100644 index 4ae20055a..000000000 --- a/tests/testdata/error_cause_recursive_aggregate.ts.out +++ /dev/null @@ -1,14 +0,0 @@ -error: Uncaught (in promise) AggregateError - Error: bar - at file:///[WILDCARD]/error_cause_recursive_aggregate.ts:2:13 - Caused by: Error: foo - at file:///[WILDCARD]/error_cause_recursive_aggregate.ts:1:13 - Caused by: [Circular *1] - Error: quux - at file:///[WILDCARD]/error_cause_recursive_aggregate.ts:6:14 - Caused by: Error: qux - at file:///[WILDCARD]/error_cause_recursive_aggregate.ts:5:13 - Caused by: [Circular *2] -throw new AggregateError([bar, quux]); - ^ - at file:///[WILDCARD]/error_cause_recursive_aggregate.ts:9:7 diff --git a/tests/testdata/error_cause_recursive_tail.ts b/tests/testdata/error_cause_recursive_tail.ts deleted file mode 100644 index 51e7fa6d9..000000000 --- a/tests/testdata/error_cause_recursive_tail.ts +++ /dev/null @@ -1,5 +0,0 @@ -const foo = new Error("foo"); -const bar = new Error("bar", { cause: foo }); -const baz = new Error("baz", { cause: bar }); -foo.cause = bar; -throw baz; diff --git a/tests/testdata/error_cause_recursive_tail.ts.out b/tests/testdata/error_cause_recursive_tail.ts.out deleted file mode 100644 index 04b15e91a..000000000 --- a/tests/testdata/error_cause_recursive_tail.ts.out +++ /dev/null @@ -1,9 +0,0 @@ -error: Uncaught (in promise) Error: baz -const baz = new Error("baz", { cause: bar }); - ^ - at file:///[WILDCARD]/error_cause_recursive_tail.ts:3:13 -Caused by: Error: bar - at file:///[WILDCARD]/error_cause_recursive_tail.ts:2:13 -Caused by: Error: foo - at file:///[WILDCARD]/error_cause_recursive_tail.ts:1:13 -Caused by: [Circular *1] diff --git a/tests/testdata/run/001_hello.js.out b/tests/testdata/run/001_hello.js.out deleted file mode 100644 index 557db03de..000000000 --- a/tests/testdata/run/001_hello.js.out +++ /dev/null @@ -1 +0,0 @@ -Hello World diff --git a/tests/testdata/run/002_hello.ts.out b/tests/testdata/run/002_hello.ts.out deleted file mode 100644 index 557db03de..000000000 --- a/tests/testdata/run/002_hello.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello World diff --git a/tests/testdata/run/003_relative_import.ts.out b/tests/testdata/run/003_relative_import.ts.out deleted file mode 100644 index e965047ad..000000000 --- a/tests/testdata/run/003_relative_import.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/tests/testdata/run/004_set_timeout.ts b/tests/testdata/run/004_set_timeout.ts deleted file mode 100644 index 214b25086..000000000 --- a/tests/testdata/run/004_set_timeout.ts +++ /dev/null @@ -1,11 +0,0 @@ -setTimeout(() => { - console.log("World"); -}, 10); - -console.log("Hello"); - -const id = setTimeout(() => { - console.log("Not printed"); -}, 10000); - -clearTimeout(id); diff --git a/tests/testdata/run/004_set_timeout.ts.out b/tests/testdata/run/004_set_timeout.ts.out deleted file mode 100644 index f9264f7fb..000000000 --- a/tests/testdata/run/004_set_timeout.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -Hello -World diff --git a/tests/testdata/run/005_more_imports.ts b/tests/testdata/run/005_more_imports.ts deleted file mode 100644 index 6c96fac64..000000000 --- a/tests/testdata/run/005_more_imports.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { printHello3, returnsFoo2, returnsHi } from "../subdir/mod1.ts"; - -printHello3(); - -if (returnsHi() !== "Hi") { - throw Error("Unexpected"); -} - -if (returnsFoo2() !== "Foo") { - throw Error("Unexpected"); -} diff --git a/tests/testdata/run/005_more_imports.ts.out b/tests/testdata/run/005_more_imports.ts.out deleted file mode 100644 index e965047ad..000000000 --- a/tests/testdata/run/005_more_imports.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/tests/testdata/run/012_async.ts b/tests/testdata/run/012_async.ts deleted file mode 100644 index 536197b68..000000000 --- a/tests/testdata/run/012_async.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Check that we can use the async keyword. -async function main() { - await new Promise((resolve) => { - console.log("2"); - setTimeout(resolve, 100); - }); - console.log("3"); -} - -console.log("1"); -main(); diff --git a/tests/testdata/run/012_async.ts.out b/tests/testdata/run/012_async.ts.out deleted file mode 100644 index 01e79c32a..000000000 --- a/tests/testdata/run/012_async.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -1 -2 -3 diff --git a/tests/testdata/run/013_dynamic_import.ts.out b/tests/testdata/run/013_dynamic_import.ts.out deleted file mode 100644 index e965047ad..000000000 --- a/tests/testdata/run/013_dynamic_import.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/tests/testdata/run/014_duplicate_import.ts b/tests/testdata/run/014_duplicate_import.ts deleted file mode 100644 index c7dd881cf..000000000 --- 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/014_duplicate_import.ts.out b/tests/testdata/run/014_duplicate_import.ts.out deleted file mode 100644 index 4effa19f4..000000000 --- a/tests/testdata/run/014_duplicate_import.ts.out +++ /dev/null @@ -1 +0,0 @@ -hello! diff --git a/tests/testdata/run/015_duplicate_parallel_import.js b/tests/testdata/run/015_duplicate_parallel_import.js deleted file mode 100644 index 2fbe2c732..000000000 --- a/tests/testdata/run/015_duplicate_parallel_import.js +++ /dev/null @@ -1,20 +0,0 @@ -// Importing the same module in parallel, the module should only be -// instantiated once. - -const promises = new Array(100) - .fill(null) - .map(() => import("../subdir/mod1.ts")); - -Promise.all(promises).then((imports) => { - const mod = imports.reduce((first, cur) => { - if (typeof first !== "object") { - throw new Error("Expected an object."); - } - if (first !== cur) { - throw new Error("More than one instance of the same module."); - } - return first; - }); - - mod.printHello3(); -}); diff --git a/tests/testdata/run/015_duplicate_parallel_import.js.out b/tests/testdata/run/015_duplicate_parallel_import.js.out deleted file mode 100644 index e965047ad..000000000 --- a/tests/testdata/run/015_duplicate_parallel_import.js.out +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/tests/testdata/run/016_double_await.ts b/tests/testdata/run/016_double_await.ts deleted file mode 100644 index 457a53ff3..000000000 --- a/tests/testdata/run/016_double_await.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This is to test if Deno would die at 2nd await -// See https://github.com/denoland/deno/issues/919 -(async () => { - const currDirInfo = await Deno.stat("."); - const parentDirInfo = await Deno.stat(".."); - console.log(currDirInfo.isDirectory); - console.log(parentDirInfo.isFile); -})(); diff --git a/tests/testdata/run/016_double_await.ts.out b/tests/testdata/run/016_double_await.ts.out deleted file mode 100644 index da29283aa..000000000 --- a/tests/testdata/run/016_double_await.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -true -false diff --git a/tests/testdata/run/017_import_redirect.ts.out b/tests/testdata/run/017_import_redirect.ts.out deleted file mode 100644 index e965047ad..000000000 --- a/tests/testdata/run/017_import_redirect.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/tests/testdata/run/017_import_redirect_info.out b/tests/testdata/run/017_import_redirect_info.out deleted file mode 100644 index d1850ccb5..000000000 --- a/tests/testdata/run/017_import_redirect_info.out +++ /dev/null @@ -1,7 +0,0 @@ -local: [WILDCARD]017_import_redirect.ts -type: TypeScript -dependencies: 1 unique -size: 278B - -file:///[WILDCARD]/017_import_redirect.ts ([WILDCARD]) -└── https://gist.githubusercontent.com/ry/f12b2aa3409e6b52645bc346a9e22929/raw/79318f239f51d764384a8bded8d7c6a833610dde/print_hello.ts ([WILDCARD]) diff --git a/tests/testdata/run/018_async_catch.ts b/tests/testdata/run/018_async_catch.ts deleted file mode 100644 index ac43a52e8..000000000 --- a/tests/testdata/run/018_async_catch.ts +++ /dev/null @@ -1,14 +0,0 @@ -function fn(): Promise { - throw new Error("message"); -} -async function call() { - try { - console.log("before await fn()"); - await fn(); - console.log("after await fn()"); - } catch (_error) { - console.log("catch"); - } - console.log("after try-catch"); -} -call().catch(() => console.log("outer catch")); diff --git a/tests/testdata/run/018_async_catch.ts.out b/tests/testdata/run/018_async_catch.ts.out deleted file mode 100644 index 4fc219973..000000000 --- a/tests/testdata/run/018_async_catch.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -before await fn() -catch -after try-catch diff --git a/tests/testdata/run/019_media_types.ts.out b/tests/testdata/run/019_media_types.ts.out deleted file mode 100644 index b3e94678c..000000000 --- a/tests/testdata/run/019_media_types.ts.out +++ /dev/null @@ -1 +0,0 @@ -[WILDCARD]success true true true true true true true true diff --git a/tests/testdata/run/020_json_modules.ts b/tests/testdata/run/020_json_modules.ts deleted file mode 100644 index b4ae60665..000000000 --- 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/020_json_modules.ts.out b/tests/testdata/run/020_json_modules.ts.out deleted file mode 100644 index 948901724..000000000 --- a/tests/testdata/run/020_json_modules.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -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 -[WILDCARD] \ No newline at end of file diff --git a/tests/testdata/run/021_mjs_modules.ts b/tests/testdata/run/021_mjs_modules.ts deleted file mode 100644 index 838cd2c38..000000000 --- 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/021_mjs_modules.ts.out b/tests/testdata/run/021_mjs_modules.ts.out deleted file mode 100644 index 27ba77dda..000000000 --- a/tests/testdata/run/021_mjs_modules.ts.out +++ /dev/null @@ -1 +0,0 @@ -true diff --git a/tests/testdata/run/025_reload_js_type_error.js b/tests/testdata/run/025_reload_js_type_error.js deleted file mode 100644 index 660626a68..000000000 --- a/tests/testdata/run/025_reload_js_type_error.js +++ /dev/null @@ -1,6 +0,0 @@ -// deno-lint-ignore-file -// There was a bug where if this was executed with --reload it would throw a -// type error. -globalThis.test = null; -test = console; -test.log("hello"); diff --git a/tests/testdata/run/025_reload_js_type_error.js.out b/tests/testdata/run/025_reload_js_type_error.js.out deleted file mode 100644 index ce0136250..000000000 --- a/tests/testdata/run/025_reload_js_type_error.js.out +++ /dev/null @@ -1 +0,0 @@ -hello diff --git a/tests/testdata/run/027_redirect_typescript.ts b/tests/testdata/run/027_redirect_typescript.ts deleted file mode 100644 index 584341975..000000000 --- a/tests/testdata/run/027_redirect_typescript.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { value } from "http://localhost:4547/redirects/redirect4.ts"; -console.log(value); diff --git a/tests/testdata/run/027_redirect_typescript.ts.out b/tests/testdata/run/027_redirect_typescript.ts.out deleted file mode 100644 index 480d4e8ca..000000000 --- a/tests/testdata/run/027_redirect_typescript.ts.out +++ /dev/null @@ -1 +0,0 @@ -4 imports 1 diff --git a/tests/testdata/run/028_args.ts b/tests/testdata/run/028_args.ts deleted file mode 100644 index ec41d52f9..000000000 --- a/tests/testdata/run/028_args.ts +++ /dev/null @@ -1,3 +0,0 @@ -Deno.args.forEach((arg) => { - console.log(arg); -}); diff --git a/tests/testdata/run/028_args.ts.out b/tests/testdata/run/028_args.ts.out deleted file mode 100644 index 0f1b5c59e..000000000 --- a/tests/testdata/run/028_args.ts.out +++ /dev/null @@ -1,6 +0,0 @@ ---arg1 -val1 ---arg2=val2 --- -arg3 -arg4 diff --git a/tests/testdata/run/033_import_map_remote.out b/tests/testdata/run/033_import_map_remote.out deleted file mode 100644 index 804fa0d57..000000000 --- a/tests/testdata/run/033_import_map_remote.out +++ /dev/null @@ -1,5 +0,0 @@ -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/testdata/run/035_cached_only_flag.out b/tests/testdata/run/035_cached_only_flag.out deleted file mode 100644 index f677ec915..000000000 --- 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/038_checkjs.js b/tests/testdata/run/038_checkjs.js deleted file mode 100644 index f0856d94c..000000000 --- a/tests/testdata/run/038_checkjs.js +++ /dev/null @@ -1,5 +0,0 @@ -// console.log intentionally misspelled to trigger a type error -consol.log("hello world!"); - -// the following error should be ignored and not output to the console -const foo = new Foo(); diff --git a/tests/testdata/run/038_checkjs.js.out b/tests/testdata/run/038_checkjs.js.out deleted file mode 100644 index 4ea473e4f..000000000 --- a/tests/testdata/run/038_checkjs.js.out +++ /dev/null @@ -1,22 +0,0 @@ -[WILDCARD] -error: TS2552 [ERROR]: Cannot find name 'consol'. Did you mean 'console'? -consol.log("hello world!"); -~~~~~~ - at [WILDCARD]/038_checkjs.js:2:1 - - 'console' is declared here. - declare var console: Console; - ~~~~~~~ - at [WILDCARD] - -TS2552 [ERROR]: Cannot find name 'Foo'. Did you mean 'foo'? -const foo = new Foo(); - ~~~ - at [WILDCARD]/038_checkjs.js:5:17 - - 'foo' is declared here. - const foo = new Foo(); - ~~~ - at [WILDCARD]/038_checkjs.js:5:7 - -Found 2 errors. diff --git a/tests/testdata/run/042_dyn_import_evalcontext.ts b/tests/testdata/run/042_dyn_import_evalcontext.ts deleted file mode 100644 index 386ae48ec..000000000 --- a/tests/testdata/run/042_dyn_import_evalcontext.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @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')))()", - new URL("..", import.meta.url).href, -); diff --git a/tests/testdata/run/042_dyn_import_evalcontext.ts.out b/tests/testdata/run/042_dyn_import_evalcontext.ts.out deleted file mode 100644 index 89e16b478..000000000 --- a/tests/testdata/run/042_dyn_import_evalcontext.ts.out +++ /dev/null @@ -1 +0,0 @@ -[Module: null prototype] { isMod4: true } diff --git a/tests/testdata/run/044_bad_resource.ts b/tests/testdata/run/044_bad_resource.ts deleted file mode 100644 index b956a3e3f..000000000 --- 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/044_bad_resource.ts.out b/tests/testdata/run/044_bad_resource.ts.out deleted file mode 100644 index c9912711d..000000000 --- a/tests/testdata/run/044_bad_resource.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD]error: Uncaught[WILDCARD] BadResource: Bad resource ID -[WILDCARD] diff --git a/tests/testdata/run/046_jsx_test.tsx b/tests/testdata/run/046_jsx_test.tsx deleted file mode 100644 index 5ed3ff2fa..000000000 --- a/tests/testdata/run/046_jsx_test.tsx +++ /dev/null @@ -1,14 +0,0 @@ -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/testdata/run/046_jsx_test.tsx.out b/tests/testdata/run/046_jsx_test.tsx.out deleted file mode 100644 index 85cfe824b..000000000 --- a/tests/testdata/run/046_jsx_test.tsx.out +++ /dev/null @@ -1 +0,0 @@ -{ factory: [Function: View], props: null, children: [] } diff --git a/tests/testdata/run/047_jsx_test.jsx b/tests/testdata/run/047_jsx_test.jsx deleted file mode 100644 index 4c2314072..000000000 --- a/tests/testdata/run/047_jsx_test.jsx +++ /dev/null @@ -1,7 +0,0 @@ -const React = { - createElement(factory, props, ...children) { - return { factory, props, children }; - }, -}; -const View = () =>
land
; -console.log(); diff --git a/tests/testdata/run/047_jsx_test.jsx.out b/tests/testdata/run/047_jsx_test.jsx.out deleted file mode 100644 index 85cfe824b..000000000 --- a/tests/testdata/run/047_jsx_test.jsx.out +++ /dev/null @@ -1 +0,0 @@ -{ factory: [Function: View], props: null, children: [] } diff --git a/tests/testdata/run/048_media_types_jsx.ts.out b/tests/testdata/run/048_media_types_jsx.ts.out deleted file mode 100644 index 266cc5741..000000000 --- a/tests/testdata/run/048_media_types_jsx.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -success true true true true true true true true diff --git a/tests/testdata/run/052_no_remote_flag.out b/tests/testdata/run/052_no_remote_flag.out deleted file mode 100644 index 2f5950ee8..000000000 --- a/tests/testdata/run/052_no_remote_flag.out +++ /dev/null @@ -1 +0,0 @@ -error: A remote specifier was requested: "http://127.0.0.1:4545/run/019_media_types.ts", but --no-remote is specified. diff --git a/tests/testdata/run/058_tasks_microtasks_close.ts b/tests/testdata/run/058_tasks_microtasks_close.ts deleted file mode 100644 index df6f85ea0..000000000 --- a/tests/testdata/run/058_tasks_microtasks_close.ts +++ /dev/null @@ -1,19 +0,0 @@ -// deno-lint-ignore-file no-window-prefix -console.log("sync 1"); -setTimeout(() => { - console.log("setTimeout 1"); - Promise.resolve().then(() => { - console.log("Promise resolve in setTimeout 1"); - }); -}); -Promise.resolve().then(() => { - console.log("promise 1"); -}); -globalThis.close(); -console.log("sync 2"); -setTimeout(() => { - console.log("setTimeout 2"); -}); -setTimeout(() => { - console.log("setTimeout 3"); -}, 100); diff --git a/tests/testdata/run/058_tasks_microtasks_close.ts.out b/tests/testdata/run/058_tasks_microtasks_close.ts.out deleted file mode 100644 index 218273cab..000000000 --- a/tests/testdata/run/058_tasks_microtasks_close.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -sync 1 -sync 2 -promise 1 -setTimeout 1 -Promise resolve in setTimeout 1 -setTimeout 2 diff --git a/tests/testdata/run/059_fs_relative_path_perm.ts b/tests/testdata/run/059_fs_relative_path_perm.ts deleted file mode 100644 index 26630fe1c..000000000 --- a/tests/testdata/run/059_fs_relative_path_perm.ts +++ /dev/null @@ -1,2 +0,0 @@ -// The permission error message shouldn't include the CWD. -Deno.readFileSync("non-existent"); diff --git a/tests/testdata/run/059_fs_relative_path_perm.ts.out b/tests/testdata/run/059_fs_relative_path_perm.ts.out deleted file mode 100644 index 0d0412208..000000000 --- a/tests/testdata/run/059_fs_relative_path_perm.ts.out +++ /dev/null @@ -1,4 +0,0 @@ -[WILDCARD]error: Uncaught (in promise) NotCapable: Requires read access to "non-existent", run again with the --allow-read flag -Deno.readFileSync("non-existent"); - ^ - at [WILDCARD] diff --git a/tests/testdata/run/063_permissions_revoke.ts b/tests/testdata/run/063_permissions_revoke.ts deleted file mode 100644 index a81eee7cb..000000000 --- a/tests/testdata/run/063_permissions_revoke.ts +++ /dev/null @@ -1,6 +0,0 @@ -const status1 = await Deno.permissions.revoke({ name: "read", path: "foo" }); -console.log(status1); -const status2 = await Deno.permissions.query({ name: "read", path: "bar" }); -console.log(status2); -const status3 = await Deno.permissions.revoke({ name: "read", path: "bar" }); -console.log(status3); diff --git a/tests/testdata/run/063_permissions_revoke.ts.out b/tests/testdata/run/063_permissions_revoke.ts.out deleted file mode 100644 index bbd64c557..000000000 --- a/tests/testdata/run/063_permissions_revoke.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -[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/testdata/run/063_permissions_revoke_sync.ts deleted file mode 100644 index 267ef3785..000000000 --- a/tests/testdata/run/063_permissions_revoke_sync.ts +++ /dev/null @@ -1,6 +0,0 @@ -const status1 = Deno.permissions.revokeSync({ name: "read", path: "foo" }); -console.log(status1); -const status2 = Deno.permissions.querySync({ name: "read", path: "bar" }); -console.log(status2); -const status3 = Deno.permissions.revokeSync({ name: "read", path: "bar" }); -console.log(status3); diff --git a/tests/testdata/run/064_permissions_revoke_global.ts b/tests/testdata/run/064_permissions_revoke_global.ts deleted file mode 100644 index a9b1fcd40..000000000 --- a/tests/testdata/run/064_permissions_revoke_global.ts +++ /dev/null @@ -1,6 +0,0 @@ -const status1 = await Deno.permissions.revoke({ name: "read" }); -console.log(status1); -const status2 = await Deno.permissions.query({ name: "read", path: "foo" }); -console.log(status2); -const status3 = await Deno.permissions.query({ name: "read", path: "bar" }); -console.log(status3); diff --git a/tests/testdata/run/064_permissions_revoke_global.ts.out b/tests/testdata/run/064_permissions_revoke_global.ts.out deleted file mode 100644 index f7e389a76..000000000 --- a/tests/testdata/run/064_permissions_revoke_global.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -[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/testdata/run/064_permissions_revoke_global_sync.ts deleted file mode 100644 index 597b1481d..000000000 --- a/tests/testdata/run/064_permissions_revoke_global_sync.ts +++ /dev/null @@ -1,6 +0,0 @@ -const status1 = Deno.permissions.revokeSync({ name: "read" }); -console.log(status1); -const status2 = Deno.permissions.querySync({ name: "read", path: "foo" }); -console.log(status2); -const status3 = Deno.permissions.querySync({ name: "read", path: "bar" }); -console.log(status3); diff --git a/tests/testdata/run/065_permissions_revoke_net.ts b/tests/testdata/run/065_permissions_revoke_net.ts deleted file mode 100644 index 40c9d413a..000000000 --- a/tests/testdata/run/065_permissions_revoke_net.ts +++ /dev/null @@ -1,6 +0,0 @@ -const status1 = await Deno.permissions.query({ name: "net" }); -console.log(status1); -const status2 = await Deno.permissions.revoke({ name: "net" }); -console.log(status2); -const status3 = await Deno.permissions.query({ name: "net" }); -console.log(status3); diff --git a/tests/testdata/run/065_permissions_revoke_net.ts.out b/tests/testdata/run/065_permissions_revoke_net.ts.out deleted file mode 100644 index a9c941ecd..000000000 --- a/tests/testdata/run/065_permissions_revoke_net.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -PermissionStatus { state: "granted", onchange: null } -PermissionStatus { state: "prompt", onchange: null } -PermissionStatus { state: "prompt", onchange: null } diff --git a/tests/testdata/run/070_location.ts b/tests/testdata/run/070_location.ts deleted file mode 100644 index 05e5abdf1..000000000 --- a/tests/testdata/run/070_location.ts +++ /dev/null @@ -1,18 +0,0 @@ -// deno-lint-ignore-file no-global-assign -console.log(Location); -console.log(Location.prototype); -console.log(location); -try { - location = {}; -} catch (error) { - if (error instanceof Error) { - console.log(error.toString()); - } -} -try { - location.hostname = "bar"; -} catch (error) { - if (error instanceof Error) { - console.log(error.toString()); - } -} diff --git a/tests/testdata/run/070_location.ts.out b/tests/testdata/run/070_location.ts.out deleted file mode 100644 index a03cf6477..000000000 --- a/tests/testdata/run/070_location.ts.out +++ /dev/null @@ -1,15 +0,0 @@ -[class Location] -Object [Location] {} -Location { - hash: "#bat", - host: "foo", - hostname: "foo", - href: "https://foo/bar?baz#bat", - origin: "https://foo", - pathname: "/bar", - port: "", - protocol: "https:", - search: "?baz" -} -NotSupportedError: Cannot set "location". -NotSupportedError: Cannot set "location.hostname". diff --git a/tests/testdata/run/071_location_unset.ts b/tests/testdata/run/071_location_unset.ts deleted file mode 100644 index f560d2716..000000000 --- a/tests/testdata/run/071_location_unset.ts +++ /dev/null @@ -1,16 +0,0 @@ -console.log(Location); -console.log(Location.prototype); -console.log(location); - -globalThis.location = { - hash: "#bat", - host: "foo", - hostname: "foo", - href: "https://foo/bar?baz#bat", - origin: "https://foo", - pathname: "/bar", - port: "", - protocol: "https:", - search: "?baz", -}; -console.log(location.pathname); diff --git a/tests/testdata/run/071_location_unset.ts.out b/tests/testdata/run/071_location_unset.ts.out deleted file mode 100644 index c9482011f..000000000 --- a/tests/testdata/run/071_location_unset.ts.out +++ /dev/null @@ -1,4 +0,0 @@ -[class Location] -Object [Location] {} -undefined -/bar diff --git a/tests/testdata/run/072_location_relative_fetch.ts b/tests/testdata/run/072_location_relative_fetch.ts deleted file mode 100644 index b2a291693..000000000 --- a/tests/testdata/run/072_location_relative_fetch.ts +++ /dev/null @@ -1,2 +0,0 @@ -const response = await fetch("run/fetch/hello.txt"); -console.log(await response.text()); diff --git a/tests/testdata/run/072_location_relative_fetch.ts.out b/tests/testdata/run/072_location_relative_fetch.ts.out deleted file mode 100644 index 8151f6f88..000000000 --- a/tests/testdata/run/072_location_relative_fetch.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD]Hello, world! - diff --git a/tests/testdata/run/075_import_local_query_hash.ts b/tests/testdata/run/075_import_local_query_hash.ts deleted file mode 100644 index 99c7ceab4..000000000 --- a/tests/testdata/run/075_import_local_query_hash.ts +++ /dev/null @@ -1,2 +0,0 @@ -import "./001_hello.js?a=b#c"; -import "./002_hello.ts?a=b#c"; diff --git a/tests/testdata/run/075_import_local_query_hash.ts.out b/tests/testdata/run/075_import_local_query_hash.ts.out deleted file mode 100644 index 340777742..000000000 --- a/tests/testdata/run/075_import_local_query_hash.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD]Hello World -Hello World diff --git a/tests/testdata/run/077_fetch_empty.ts b/tests/testdata/run/077_fetch_empty.ts deleted file mode 100644 index b10a9094e..000000000 --- a/tests/testdata/run/077_fetch_empty.ts +++ /dev/null @@ -1 +0,0 @@ -await fetch(""); diff --git a/tests/testdata/run/077_fetch_empty.ts.out b/tests/testdata/run/077_fetch_empty.ts.out deleted file mode 100644 index f11e0f563..000000000 --- a/tests/testdata/run/077_fetch_empty.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD]error: Uncaught (in promise) TypeError: Invalid URL: '' -[WILDCARD] diff --git a/tests/testdata/run/078_unload_on_exit.ts b/tests/testdata/run/078_unload_on_exit.ts deleted file mode 100644 index aaa80c578..000000000 --- a/tests/testdata/run/078_unload_on_exit.ts +++ /dev/null @@ -1,9 +0,0 @@ -globalThis.onunload = () => { - console.log("onunload is called"); - // This second exit call doesn't trigger unload event, - // and therefore actually stops the process. - Deno.exit(1); - console.log("This doesn't show up in console"); -}; -// This exit call triggers the above unload event handler. -Deno.exit(0); diff --git a/tests/testdata/run/078_unload_on_exit.ts.out b/tests/testdata/run/078_unload_on_exit.ts.out deleted file mode 100644 index e213f9632..000000000 --- a/tests/testdata/run/078_unload_on_exit.ts.out +++ /dev/null @@ -1 +0,0 @@ -[WILDCARD]onunload is called diff --git a/tests/testdata/run/079_location_authentication.ts b/tests/testdata/run/079_location_authentication.ts deleted file mode 100644 index 4989312ac..000000000 --- a/tests/testdata/run/079_location_authentication.ts +++ /dev/null @@ -1 +0,0 @@ -console.log(location.href); diff --git a/tests/testdata/run/079_location_authentication.ts.out b/tests/testdata/run/079_location_authentication.ts.out deleted file mode 100644 index 0dd73f999..000000000 --- a/tests/testdata/run/079_location_authentication.ts.out +++ /dev/null @@ -1 +0,0 @@ -https://baz/qux diff --git a/tests/testdata/run/081_location_relative_fetch_redirect.ts b/tests/testdata/run/081_location_relative_fetch_redirect.ts deleted file mode 100644 index 742ef0afb..000000000 --- a/tests/testdata/run/081_location_relative_fetch_redirect.ts +++ /dev/null @@ -1,2 +0,0 @@ -const response = await fetch("/"); -console.log(response.url); diff --git a/tests/testdata/run/081_location_relative_fetch_redirect.ts.out b/tests/testdata/run/081_location_relative_fetch_redirect.ts.out deleted file mode 100644 index f62b93195..000000000 --- a/tests/testdata/run/081_location_relative_fetch_redirect.ts.out +++ /dev/null @@ -1 +0,0 @@ -[WILDCARD]http://localhost:4545/ diff --git a/tests/testdata/run/082_prepare_stack_trace_throw.js b/tests/testdata/run/082_prepare_stack_trace_throw.js deleted file mode 100644 index 8137bfdc8..000000000 --- a/tests/testdata/run/082_prepare_stack_trace_throw.js +++ /dev/null @@ -1,6 +0,0 @@ -Error.prepareStackTrace = () => { - console.trace(); - throw new Error("foo"); -}; - -new Error("bar").stack; diff --git a/tests/testdata/run/082_prepare_stack_trace_throw.js.out b/tests/testdata/run/082_prepare_stack_trace_throw.js.out deleted file mode 100644 index b6715c749..000000000 --- a/tests/testdata/run/082_prepare_stack_trace_throw.js.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD]error: Uncaught (in promise) Error: foo -[WILDCARD] diff --git a/tests/testdata/run/088_dynamic_import_already_evaluating.ts b/tests/testdata/run/088_dynamic_import_already_evaluating.ts deleted file mode 100644 index 272163a5d..000000000 --- a/tests/testdata/run/088_dynamic_import_already_evaluating.ts +++ /dev/null @@ -1,2 +0,0 @@ -import("./088_dynamic_import_target.ts").then(() => console.log(3)); -import("./088_dynamic_import_target.ts").then(() => console.log(3)); diff --git a/tests/testdata/run/088_dynamic_import_already_evaluating.ts.out b/tests/testdata/run/088_dynamic_import_already_evaluating.ts.out deleted file mode 100644 index a36dd11e7..000000000 --- a/tests/testdata/run/088_dynamic_import_already_evaluating.ts.out +++ /dev/null @@ -1,4 +0,0 @@ -[WILDCARD]1 -2 -3 -3 diff --git a/tests/testdata/run/091_use_define_for_class_fields.ts b/tests/testdata/run/091_use_define_for_class_fields.ts deleted file mode 100644 index 46be3ac0b..000000000 --- a/tests/testdata/run/091_use_define_for_class_fields.ts +++ /dev/null @@ -1,4 +0,0 @@ -class _A { - b = this.a; - constructor(public a: unknown) {} -} diff --git a/tests/testdata/run/091_use_define_for_class_fields.ts.out b/tests/testdata/run/091_use_define_for_class_fields.ts.out deleted file mode 100644 index 08f94a967..000000000 --- a/tests/testdata/run/091_use_define_for_class_fields.ts.out +++ /dev/null @@ -1,4 +0,0 @@ -[WILDCARD]error: TS2729 [ERROR]: Property 'a' is used before its initialization. - b = this.a; - ^ -[WILDCARD] diff --git a/tests/testdata/run/aggregate_error.out b/tests/testdata/run/aggregate_error.out deleted file mode 100644 index 59c0fb2a5..000000000 --- a/tests/testdata/run/aggregate_error.out +++ /dev/null @@ -1,18 +0,0 @@ -AggregateError: Multiple errors. - at [WILDCARD]/aggregate_error.ts:1:24 - -AggregateError: Multiple errors. - Error: Error message 1. - at [WILDCARD]/aggregate_error.ts:2:3 - Error: Error message 2. - at [WILDCARD]/aggregate_error.ts:3:3 - at [WILDCARD]/aggregate_error.ts:1:24 - -error: Uncaught (in promise) AggregateError: Multiple errors. - Error: Error message 1. - at [WILDCARD]/aggregate_error.ts:2:3 - Error: Error message 2. - at [WILDCARD]/aggregate_error.ts:3:3 -const aggregateError = new AggregateError([ - ^ - at [WILDCARD]/aggregate_error.ts:1:24 diff --git a/tests/testdata/run/aggregate_error.ts b/tests/testdata/run/aggregate_error.ts deleted file mode 100644 index ce4b54376..000000000 --- a/tests/testdata/run/aggregate_error.ts +++ /dev/null @@ -1,9 +0,0 @@ -const aggregateError = new AggregateError([ - new Error("Error message 1."), - new Error("Error message 2."), -], "Multiple errors."); -console.log(aggregateError.stack); -console.log(); -console.log(aggregateError); -console.log(); -throw aggregateError; diff --git a/tests/testdata/run/async_error.ts b/tests/testdata/run/async_error.ts deleted file mode 100644 index b55c73aeb..000000000 --- a/tests/testdata/run/async_error.ts +++ /dev/null @@ -1,9 +0,0 @@ -console.log("hello"); -// deno-lint-ignore require-await -const foo = async (): Promise => { - console.log("before error"); - throw Error("error"); -}; - -foo(); -console.log("world"); diff --git a/tests/testdata/run/async_error.ts.out b/tests/testdata/run/async_error.ts.out deleted file mode 100644 index b424f9072..000000000 --- a/tests/testdata/run/async_error.ts.out +++ /dev/null @@ -1,8 +0,0 @@ -[WILDCARD]hello -before error -world -error: Uncaught (in promise) Error: error - throw Error("error"); - ^ - at foo ([WILDCARD]/async_error.ts:5:9) - at [WILDCARD]/async_error.ts:8:1 diff --git a/tests/testdata/run/before_unload.js b/tests/testdata/run/before_unload.js deleted file mode 100644 index 2572e512b..000000000 --- a/tests/testdata/run/before_unload.js +++ /dev/null @@ -1,21 +0,0 @@ -let count = 0; - -console.log("0"); - -globalThis.addEventListener("beforeunload", (e) => { - console.log("GOT EVENT"); - if (count === 0 || count === 1) { - e.preventDefault(); - setTimeout(() => { - console.log("3"); - }, 100); - } - - count++; -}); - -console.log("1"); - -setTimeout(() => { - console.log("2"); -}, 100); diff --git a/tests/testdata/run/before_unload.js.out b/tests/testdata/run/before_unload.js.out deleted file mode 100644 index f1f2ab49a..000000000 --- a/tests/testdata/run/before_unload.js.out +++ /dev/null @@ -1,8 +0,0 @@ -0 -1 -2 -GOT EVENT -3 -GOT EVENT -3 -GOT EVENT diff --git a/tests/testdata/run/blob_gc_finalization.js b/tests/testdata/run/blob_gc_finalization.js deleted file mode 100644 index c721e6b45..000000000 --- a/tests/testdata/run/blob_gc_finalization.js +++ /dev/null @@ -1,11 +0,0 @@ -// This test creates 128 blobs of 128 MB each. This will only work if the blobs -// and their backing data is GCed as expected. -for (let i = 0; i < 128; i++) { - // Create a 128MB byte array, and then a blob from it. - const buf = new Uint8Array(128 * 1024 * 1024); - new Blob([buf]); - // It is very important that there is a yield here, otherwise the finalizer - // for the blob is not called and the memory is not freed. - await new Promise((resolve) => setTimeout(resolve, 0)); -} -console.log("GCed all blobs"); diff --git a/tests/testdata/run/blob_gc_finalization.js.out b/tests/testdata/run/blob_gc_finalization.js.out deleted file mode 100644 index dcc4500f8..000000000 --- a/tests/testdata/run/blob_gc_finalization.js.out +++ /dev/null @@ -1 +0,0 @@ -GCed all blobs diff --git a/tests/testdata/run/byte_order_mark.out b/tests/testdata/run/byte_order_mark.out deleted file mode 100644 index 557db03de..000000000 --- a/tests/testdata/run/byte_order_mark.out +++ /dev/null @@ -1 +0,0 @@ -Hello World diff --git a/tests/testdata/run/byte_order_mark.ts b/tests/testdata/run/byte_order_mark.ts deleted file mode 100644 index 40eb23c1d..000000000 --- a/tests/testdata/run/byte_order_mark.ts +++ /dev/null @@ -1,4 +0,0 @@ -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/testdata/run/check_js_points_to_ts/bar.ts b/tests/testdata/run/check_js_points_to_ts/bar.ts deleted file mode 100644 index 026cd2f1e..000000000 --- a/tests/testdata/run/check_js_points_to_ts/bar.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function bar(): string { - return 42; -} diff --git a/tests/testdata/run/check_js_points_to_ts/foo.d.ts b/tests/testdata/run/check_js_points_to_ts/foo.d.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/testdata/run/check_js_points_to_ts/foo.js b/tests/testdata/run/check_js_points_to_ts/foo.js deleted file mode 100644 index 9ac1a14ff..000000000 --- a/tests/testdata/run/check_js_points_to_ts/foo.js +++ /dev/null @@ -1,4 +0,0 @@ -import { bar } from "./bar.ts"; -export function foo() { - bar(); -} diff --git a/tests/testdata/run/check_js_points_to_ts/test.js b/tests/testdata/run/check_js_points_to_ts/test.js deleted file mode 100644 index 00d894451..000000000 --- a/tests/testdata/run/check_js_points_to_ts/test.js +++ /dev/null @@ -1,3 +0,0 @@ -// @deno-types="./foo.d.ts" -import { foo } from "./foo.js"; -foo(); diff --git a/tests/testdata/run/check_js_points_to_ts/test.js.out b/tests/testdata/run/check_js_points_to_ts/test.js.out deleted file mode 100644 index 67cda9a65..000000000 --- a/tests/testdata/run/check_js_points_to_ts/test.js.out +++ /dev/null @@ -1,4 +0,0 @@ -error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. - return 42; - ~~~~~~ - at [WILDCARD] diff --git a/tests/testdata/run/classic_workers_event_loop.js b/tests/testdata/run/classic_workers_event_loop.js deleted file mode 100644 index 810a6df7f..000000000 --- a/tests/testdata/run/classic_workers_event_loop.js +++ /dev/null @@ -1,4 +0,0 @@ -new Worker( - "data:application/javascript,setTimeout(() => {console.log('done'); self.close()}, 1000)", - { type: "classic" }, -); diff --git a/tests/testdata/run/classic_workers_event_loop.js.out b/tests/testdata/run/classic_workers_event_loop.js.out deleted file mode 100644 index 19f86f493..000000000 --- a/tests/testdata/run/classic_workers_event_loop.js.out +++ /dev/null @@ -1 +0,0 @@ -done diff --git a/tests/testdata/run/colors_without_globalThis.js b/tests/testdata/run/colors_without_globalThis.js deleted file mode 100644 index f9d4b68fc..000000000 --- a/tests/testdata/run/colors_without_globalThis.js +++ /dev/null @@ -1 +0,0 @@ -console.log(delete globalThis.globalThis); diff --git a/tests/testdata/run/complex_error.ts b/tests/testdata/run/complex_error.ts deleted file mode 100644 index b462992ac..000000000 --- a/tests/testdata/run/complex_error.ts +++ /dev/null @@ -1,18 +0,0 @@ -const error = new AggregateError( - [ - new AggregateError([new Error("qux1"), new Error("quux1")]), - new Error("bar1", { cause: new Error("baz1") }), - ], - "foo1", - { - cause: new AggregateError([ - new AggregateError([new Error("qux2"), new Error("quux2")]), - new Error("bar2", { cause: new Error("baz2") }), - ], "foo2"), - }, -); -console.log(error.stack); -console.log(); -console.log(error); -console.log(); -throw error; diff --git a/tests/testdata/run/complex_error.ts.out b/tests/testdata/run/complex_error.ts.out deleted file mode 100644 index 3c3c26eaf..000000000 --- a/tests/testdata/run/complex_error.ts.out +++ /dev/null @@ -1,44 +0,0 @@ -AggregateError: foo1 - at [WILDCARD]/complex_error.ts:1:15 - -AggregateError: foo1 - AggregateError - Error: qux1 - at [WILDCARD]/complex_error.ts:3:25 - Error: quux1 - at [WILDCARD]/complex_error.ts:3:44 - at [WILDCARD]/complex_error.ts:3:5 - Error: bar1 - at [WILDCARD]/complex_error.ts:4:5 - Caused by Error: baz1 - at [WILDCARD]/complex_error.ts:4:32 - at [WILDCARD]/complex_error.ts:1:15 -Caused by AggregateError: foo2 - at [WILDCARD]/complex_error.ts:8:12 - -error: Uncaught (in promise) AggregateError: foo1 - AggregateError - Error: qux1 - at [WILDCARD]/complex_error.ts:3:25 - Error: quux1 - at [WILDCARD]/complex_error.ts:3:44 - at [WILDCARD]/complex_error.ts:3:5 - Error: bar1 - at [WILDCARD]/complex_error.ts:4:5 - Caused by: Error: baz1 - at [WILDCARD]/complex_error.ts:4:32 -const error = new AggregateError( - ^ - at [WILDCARD]/complex_error.ts:1:15 -Caused by: AggregateError: foo2 - AggregateError - Error: qux2 - at [WILDCARD]/complex_error.ts:9:27 - Error: quux2 - at [WILDCARD]/complex_error.ts:9:46 - at [WILDCARD]/complex_error.ts:9:7 - Error: bar2 - at [WILDCARD]/complex_error.ts:10:7 - Caused by: Error: baz2 - at [WILDCARD]/complex_error.ts:10:34 - at [WILDCARD]/complex_error.ts:8:12 diff --git a/tests/testdata/run/config/main.out b/tests/testdata/run/config/main.out deleted file mode 100644 index 277314807..000000000 --- a/tests/testdata/run/config/main.out +++ /dev/null @@ -1,4 +0,0 @@ -[WILDCARD]Unsupported compiler options in "[WILDCARD]tsconfig.json". - The following options were ignored: - module, target -Check [WILDCARD]/main.ts diff --git a/tests/testdata/run/config/main.ts b/tests/testdata/run/config/main.ts deleted file mode 100644 index 51a61e447..000000000 --- a/tests/testdata/run/config/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -function foo(bar) { - return bar; -} - -foo(1); diff --git a/tests/testdata/run/config/tsconfig.json b/tests/testdata/run/config/tsconfig.json deleted file mode 100644 index 0f0881920..000000000 --- a/tests/testdata/run/config/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "module": "amd", - "strict": false, - "target": "es5" - } -} diff --git a/tests/testdata/run/config_json_import.ts b/tests/testdata/run/config_json_import.ts deleted file mode 100644 index 7141f1495..000000000 --- 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/config_json_import.ts.out b/tests/testdata/run/config_json_import.ts.out deleted file mode 100644 index aa55be7d5..000000000 --- a/tests/testdata/run/config_json_import.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -{ - compilerOptions: { jsx: "react-jsx", jsxImportSource: "http://localhost:4545/jsx" } -} diff --git a/tests/testdata/run/config_types/main.out b/tests/testdata/run/config_types/main.out deleted file mode 100644 index 417b7b537..000000000 --- a/tests/testdata/run/config_types/main.out +++ /dev/null @@ -1 +0,0 @@ -undefined diff --git a/tests/testdata/run/config_types/main.ts b/tests/testdata/run/config_types/main.ts deleted file mode 100644 index f1a8d6583..000000000 --- a/tests/testdata/run/config_types/main.ts +++ /dev/null @@ -1 +0,0 @@ -console.log(globalThis.a); diff --git a/tests/testdata/run/config_types/remote.tsconfig.json b/tests/testdata/run/config_types/remote.tsconfig.json deleted file mode 100644 index 255ff5def..000000000 --- a/tests/testdata/run/config_types/remote.tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "types": [ - "http://localhost:4545/run/config_types/types.d.ts" - ] - } -} diff --git a/tests/testdata/run/config_types/tsconfig.json b/tests/testdata/run/config_types/tsconfig.json deleted file mode 100644 index 85f1549e0..000000000 --- a/tests/testdata/run/config_types/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "types": [ - "./types.d.ts" - ] - } -} diff --git a/tests/testdata/run/custom_inspect_url.js b/tests/testdata/run/custom_inspect_url.js deleted file mode 100644 index 69aa2dc49..000000000 --- a/tests/testdata/run/custom_inspect_url.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log([new URL("https://example.com/path")]); -console.log({ url: new URL("https://example.com/path") }); -console.log({ url: [new URL("https://example.com/path")] }); diff --git a/tests/testdata/run/custom_inspect_url.js.out b/tests/testdata/run/custom_inspect_url.js.out deleted file mode 100644 index 1c714e34e..000000000 --- a/tests/testdata/run/custom_inspect_url.js.out +++ /dev/null @@ -1,47 +0,0 @@ -[ - URL { - href: "https://example.com/path", - origin: "https://example.com", - protocol: "https:", - username: "", - password: "", - host: "example.com", - hostname: "example.com", - port: "", - pathname: "/path", - hash: "", - search: "" - } -] -{ - url: URL { - href: "https://example.com/path", - origin: "https://example.com", - protocol: "https:", - username: "", - password: "", - host: "example.com", - hostname: "example.com", - port: "", - pathname: "/path", - hash: "", - search: "" - } -} -{ - url: [ - URL { - href: "https://example.com/path", - origin: "https://example.com", - protocol: "https:", - username: "", - password: "", - host: "example.com", - hostname: "example.com", - port: "", - pathname: "/path", - hash: "", - search: "" - } - ] -} diff --git a/tests/testdata/run/decorators/experimental/deno.json b/tests/testdata/run/decorators/experimental/deno.json deleted file mode 100644 index 504cd646e..000000000 --- a/tests/testdata/run/decorators/experimental/deno.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "experimentalDecorators": true - } -} diff --git a/tests/testdata/run/decorators/experimental/no_check/main.out b/tests/testdata/run/decorators/experimental/no_check/main.out deleted file mode 100644 index 015f7076e..000000000 --- a/tests/testdata/run/decorators/experimental/no_check/main.out +++ /dev/null @@ -1,3 +0,0 @@ -a(): evaluated -a(): called -method diff --git a/tests/testdata/run/decorators/experimental/no_check/main.ts b/tests/testdata/run/decorators/experimental/no_check/main.ts deleted file mode 100644 index 9f7ec550d..000000000 --- a/tests/testdata/run/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/testdata/run/decorators/experimental/runtime/main.out b/tests/testdata/run/decorators/experimental/runtime/main.out deleted file mode 100644 index 0fc1d4590..000000000 --- a/tests/testdata/run/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/testdata/run/decorators/experimental/runtime/main.ts b/tests/testdata/run/decorators/experimental/runtime/main.ts deleted file mode 100644 index 40a26bbd4..000000000 --- a/tests/testdata/run/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/testdata/run/decorators/experimental/ts/main.out b/tests/testdata/run/decorators/experimental/ts/main.out deleted file mode 100644 index ea64fbaa6..000000000 --- a/tests/testdata/run/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/testdata/run/decorators/experimental/ts/main.ts b/tests/testdata/run/decorators/experimental/ts/main.ts deleted file mode 100644 index 95fba6cd4..000000000 --- a/tests/testdata/run/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/testdata/run/decorators/tc39_proposal/main.out b/tests/testdata/run/decorators/tc39_proposal/main.out deleted file mode 100644 index 39394952e..000000000 --- a/tests/testdata/run/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/testdata/run/decorators/tc39_proposal/main.ts b/tests/testdata/run/decorators/tc39_proposal/main.ts deleted file mode 100644 index 00c8a8502..000000000 --- a/tests/testdata/run/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/testdata/run/deno_exit_tampering.ts b/tests/testdata/run/deno_exit_tampering.ts deleted file mode 100644 index 3b24261e2..000000000 --- a/tests/testdata/run/deno_exit_tampering.ts +++ /dev/null @@ -1,3 +0,0 @@ -delete globalThis.dispatchEvent; -delete EventTarget.prototype.dispatchEvent; -Deno.exit(42); diff --git a/tests/testdata/run/deny_all_permission_args.js b/tests/testdata/run/deny_all_permission_args.js deleted file mode 100644 index c63d2c362..000000000 --- a/tests/testdata/run/deny_all_permission_args.js +++ /dev/null @@ -1,7 +0,0 @@ -console.log(Deno.permissions.querySync({ name: "env" })); -console.log(Deno.permissions.querySync({ name: "read" })); -console.log(Deno.permissions.querySync({ name: "write" })); -console.log(Deno.permissions.querySync({ name: "ffi" })); -console.log(Deno.permissions.querySync({ name: "run" })); -console.log(Deno.permissions.querySync({ name: "sys" })); -console.log(Deno.permissions.querySync({ name: "net" })); diff --git a/tests/testdata/run/deny_all_permission_args.out b/tests/testdata/run/deny_all_permission_args.out deleted file mode 100644 index de6f687f4..000000000 --- a/tests/testdata/run/deny_all_permission_args.out +++ /dev/null @@ -1,7 +0,0 @@ -PermissionStatus { state: "denied", onchange: null } -PermissionStatus { state: "denied", onchange: null } -PermissionStatus { state: "denied", onchange: null } -PermissionStatus { state: "denied", onchange: null } -PermissionStatus { state: "denied", onchange: null } -PermissionStatus { state: "denied", onchange: null } -PermissionStatus { state: "denied", onchange: null } diff --git a/tests/testdata/run/deny_some_permission_args.js b/tests/testdata/run/deny_some_permission_args.js deleted file mode 100644 index 357dda238..000000000 --- a/tests/testdata/run/deny_some_permission_args.js +++ /dev/null @@ -1,21 +0,0 @@ -console.log(Deno.permissions.querySync({ name: "env" })); -console.log(Deno.permissions.querySync({ name: "env", variable: "FOO" })); -console.log(Deno.permissions.querySync({ name: "env", variable: "BAR" })); -console.log(Deno.permissions.querySync({ name: "read" })); -console.log(Deno.permissions.querySync({ name: "read", path: "/foo" })); -console.log(Deno.permissions.querySync({ name: "read", path: "/bar" })); -console.log(Deno.permissions.querySync({ name: "write" })); -console.log(Deno.permissions.querySync({ name: "write", path: "/foo" })); -console.log(Deno.permissions.querySync({ name: "write", path: "/bar" })); -console.log(Deno.permissions.querySync({ name: "ffi" })); -console.log(Deno.permissions.querySync({ name: "ffi", path: "/foo" })); -console.log(Deno.permissions.querySync({ name: "ffi", path: "/bar" })); -console.log(Deno.permissions.querySync({ name: "run" })); -console.log(Deno.permissions.querySync({ name: "run", command: "foo" })); -console.log(Deno.permissions.querySync({ name: "run", command: "bar" })); -console.log(Deno.permissions.querySync({ name: "sys" })); -console.log(Deno.permissions.querySync({ name: "sys", kind: "hostname" })); -console.log(Deno.permissions.querySync({ name: "sys", kind: "loadavg" })); -console.log(Deno.permissions.querySync({ name: "net" })); -console.log(Deno.permissions.querySync({ name: "net", host: "127.0.0.1" })); -console.log(Deno.permissions.querySync({ name: "net", host: "192.168.0.1" })); diff --git a/tests/testdata/run/deny_some_permission_args.out b/tests/testdata/run/deny_some_permission_args.out deleted file mode 100644 index abb5274ee..000000000 --- a/tests/testdata/run/deny_some_permission_args.out +++ /dev/null @@ -1,21 +0,0 @@ -PermissionStatus { state: "granted", onchange: null, partial: true } -PermissionStatus { state: "denied", onchange: null } -PermissionStatus { state: "granted", onchange: null } -PermissionStatus { state: "granted", onchange: null, partial: true } -PermissionStatus { state: "denied", onchange: null } -PermissionStatus { state: "granted", onchange: null } -PermissionStatus { state: "granted", onchange: null, partial: true } -PermissionStatus { state: "denied", onchange: null } -PermissionStatus { state: "granted", onchange: null } -PermissionStatus { state: "granted", onchange: null, partial: true } -PermissionStatus { state: "denied", onchange: null } -PermissionStatus { state: "granted", onchange: null } -PermissionStatus { state: "granted", onchange: null, partial: true } -PermissionStatus { state: "denied", onchange: null } -PermissionStatus { state: "granted", onchange: null } -PermissionStatus { state: "granted", onchange: null, partial: true } -PermissionStatus { state: "denied", onchange: null } -PermissionStatus { state: "granted", onchange: null } -PermissionStatus { state: "granted", onchange: null, partial: true } -PermissionStatus { state: "denied", onchange: null } -PermissionStatus { state: "granted", onchange: null } diff --git a/tests/testdata/run/dom_exception_formatting.ts b/tests/testdata/run/dom_exception_formatting.ts deleted file mode 100644 index 0209ec81e..000000000 --- a/tests/testdata/run/dom_exception_formatting.ts +++ /dev/null @@ -1 +0,0 @@ -throw new DOMException("foo", "SyntaxError"); diff --git a/tests/testdata/run/dom_exception_formatting.ts.out b/tests/testdata/run/dom_exception_formatting.ts.out deleted file mode 100644 index 75615d0a8..000000000 --- a/tests/testdata/run/dom_exception_formatting.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -[WILDCARD]error: Uncaught (in promise) SyntaxError: foo -[WILDCARD] - at file:///[WILDCARD]/dom_exception_formatting.ts:[WILDCARD] diff --git a/tests/testdata/run/dynamic_import_already_rejected/error_001.ts b/tests/testdata/run/dynamic_import_already_rejected/error_001.ts deleted file mode 100644 index b01068bc0..000000000 --- a/tests/testdata/run/dynamic_import_already_rejected/error_001.ts +++ /dev/null @@ -1,9 +0,0 @@ -function foo(): never { - throw Error("bad"); -} - -function bar() { - foo(); -} - -bar(); diff --git a/tests/testdata/run/dynamic_import_already_rejected/main.out b/tests/testdata/run/dynamic_import_already_rejected/main.out deleted file mode 100644 index c3eb66f9e..000000000 --- a/tests/testdata/run/dynamic_import_already_rejected/main.out +++ /dev/null @@ -1,4 +0,0 @@ -[WILDCARD]Caught: Error: bad - at [WILDCARD]/error_001.ts:[WILDCARD] -Caught: Error: bad - at [WILDCARD]/error_001.ts:[WILDCARD] diff --git a/tests/testdata/run/dynamic_import_already_rejected/main.ts b/tests/testdata/run/dynamic_import_already_rejected/main.ts deleted file mode 100644 index 249de8d8b..000000000 --- a/tests/testdata/run/dynamic_import_already_rejected/main.ts +++ /dev/null @@ -1,15 +0,0 @@ -try { - await import("./error_001.ts"); -} catch (error) { - if (error instanceof Error) { - console.log(`Caught: ${error.stack}`); - } -} - -try { - await import("./error_001.ts"); -} catch (error) { - if (error instanceof Error) { - console.log(`Caught: ${error.stack}`); - } -} diff --git a/tests/testdata/run/dynamic_import_async_error/delayed_error.ts b/tests/testdata/run/dynamic_import_async_error/delayed_error.ts deleted file mode 100644 index 76057e627..000000000 --- a/tests/testdata/run/dynamic_import_async_error/delayed_error.ts +++ /dev/null @@ -1,2 +0,0 @@ -await new Promise((r) => setTimeout(r, 100)); -throw new Error("foo"); diff --git a/tests/testdata/run/dynamic_import_async_error/main.out b/tests/testdata/run/dynamic_import_async_error/main.out deleted file mode 100644 index 974c2e426..000000000 --- a/tests/testdata/run/dynamic_import_async_error/main.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD]Caught: Error: foo - at [WILDCARD]/delayed_error.ts:[WILDCARD] diff --git a/tests/testdata/run/dynamic_import_async_error/main.ts b/tests/testdata/run/dynamic_import_async_error/main.ts deleted file mode 100644 index 998e7ed3e..000000000 --- a/tests/testdata/run/dynamic_import_async_error/main.ts +++ /dev/null @@ -1,7 +0,0 @@ -try { - await import("./delayed_error.ts"); -} catch (error) { - if (error instanceof Error) { - console.log(`Caught: ${error.stack}`); - } -} diff --git a/tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/main.out b/tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/main.out deleted file mode 100644 index c344d0aae..000000000 --- a/tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/main.out +++ /dev/null @@ -1,100 +0,0 @@ -0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 diff --git a/tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/main.ts b/tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/main.ts deleted file mode 100644 index 0832e40be..000000000 --- a/tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/main.ts +++ /dev/null @@ -1,16 +0,0 @@ -import * as path from "http://localhost:4545/deno_std/path/mod.ts"; - -const currentDir = path.dirname(path.fromFileUrl(import.meta.url)); -const url = path.toFileUrl(path.join(currentDir, "./mod.ts")); -const urls = []; - -// this is hard to reproduce, but doing this will help -for (let i = 0; i < 100; i++) { - urls.push(url.toString() + "#" + i); -} - -const results = await Promise.all(urls.map((url) => import(url))); - -for (const result of results) { - result.outputValue(); -} diff --git a/tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/mod.ts b/tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/mod.ts deleted file mode 100644 index 56f2002ed..000000000 --- a/tests/testdata/run/dynamic_import_concurrent_non_statically_analyzable/mod.ts +++ /dev/null @@ -1,7 +0,0 @@ -// sleep a bit so many concurrent tasks end up -// attempting to build the graph at the same time -import "http://localhost:4545/sleep/10"; - -export function outputValue() { - console.log(parseInt(new URL(import.meta.url).hash.slice(1), 10)); -} diff --git a/tests/testdata/run/dynamic_import_conditional.js b/tests/testdata/run/dynamic_import_conditional.js deleted file mode 100644 index 1b4193e3e..000000000 --- a/tests/testdata/run/dynamic_import_conditional.js +++ /dev/null @@ -1,3 +0,0 @@ -const Worker = globalThis.Worker ?? (await import("worker_threads")).Worker; - -console.log(!!Worker); diff --git a/tests/testdata/run/dynamic_import_conditional.js.out b/tests/testdata/run/dynamic_import_conditional.js.out deleted file mode 100644 index 27ba77dda..000000000 --- a/tests/testdata/run/dynamic_import_conditional.js.out +++ /dev/null @@ -1 +0,0 @@ -true diff --git a/tests/testdata/run/dynamic_import_syntax_error.js b/tests/testdata/run/dynamic_import_syntax_error.js deleted file mode 100644 index be8ec132f..000000000 --- a/tests/testdata/run/dynamic_import_syntax_error.js +++ /dev/null @@ -1 +0,0 @@ -await import("./dynamic_import_syntax_error_import.js"); diff --git a/tests/testdata/run/dynamic_import_syntax_error.js.out b/tests/testdata/run/dynamic_import_syntax_error.js.out deleted file mode 100644 index 91e69eac7..000000000 --- a/tests/testdata/run/dynamic_import_syntax_error.js.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Uncaught (in promise) SyntaxError: Unexpected reserved word at [WILDCARD]/dynamic_import_syntax_error_import.js:3:3 -await import("./dynamic_import_syntax_error_import.js"); -^ - at async [WILDCARD]/dynamic_import_syntax_error.js:1:1 diff --git a/tests/testdata/run/empty.ts b/tests/testdata/run/empty.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/testdata/run/error_001.ts.out b/tests/testdata/run/error_001.ts.out deleted file mode 100644 index 9d8559917..000000000 --- a/tests/testdata/run/error_001.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -[WILDCARD]error: Uncaught (in promise) Error: bad - throw Error("bad"); - ^ - at foo ([WILDCARD]/error_001.ts:2:9) - at bar ([WILDCARD]/error_001.ts:6:3) - at [WILDCARD]/error_001.ts:9:1 diff --git a/tests/testdata/run/error_002.ts b/tests/testdata/run/error_002.ts deleted file mode 100644 index 5f8179bbe..000000000 --- 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_002.ts.out b/tests/testdata/run/error_002.ts.out deleted file mode 100644 index 9fec5d968..000000000 --- a/tests/testdata/run/error_002.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -[WILDCARD]error: Uncaught (in promise) Error: exception from mod1 - throw Error("exception from mod1"); - ^ - at throwsError ([WILDCARD]/subdir/mod1.ts:16:9) - at foo ([WILDCARD]/error_002.ts:4:3) - at [WILDCARD]/error_002.ts:7:1 diff --git a/tests/testdata/run/error_003_typescript.ts b/tests/testdata/run/error_003_typescript.ts deleted file mode 100644 index e1f882123..000000000 --- a/tests/testdata/run/error_003_typescript.ts +++ /dev/null @@ -1,20 +0,0 @@ -// 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/testdata/run/error_003_typescript.ts.out b/tests/testdata/run/error_003_typescript.ts.out deleted file mode 100644 index bbb2ec470..000000000 --- a/tests/testdata/run/error_003_typescript.ts.out +++ /dev/null @@ -1,7 +0,0 @@ -[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/testdata/run/error_004_missing_module.ts b/tests/testdata/run/error_004_missing_module.ts deleted file mode 100644 index 82b281181..000000000 --- a/tests/testdata/run/error_004_missing_module.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as badModule from "./bad-module.ts"; - -console.log(badModule); diff --git a/tests/testdata/run/error_004_missing_module.ts.out b/tests/testdata/run/error_004_missing_module.ts.out deleted file mode 100644 index 9a2cfb8a8..000000000 --- a/tests/testdata/run/error_004_missing_module.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD]error: Module not found "file:///[WILDCARD]/bad-module.ts". - at file:///[WILDCARD]/error_004_missing_module.ts:1:28 diff --git a/tests/testdata/run/error_005_missing_dynamic_import.ts b/tests/testdata/run/error_005_missing_dynamic_import.ts deleted file mode 100644 index 8ea8ff94e..000000000 --- a/tests/testdata/run/error_005_missing_dynamic_import.ts +++ /dev/null @@ -1,3 +0,0 @@ -(async () => { - const _badModule = await import("./bad-module.ts"); -})(); diff --git a/tests/testdata/run/error_005_missing_dynamic_import.ts.out b/tests/testdata/run/error_005_missing_dynamic_import.ts.out deleted file mode 100644 index 55e4a8524..000000000 --- a/tests/testdata/run/error_005_missing_dynamic_import.ts.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Uncaught (in promise) TypeError: Module not found "[WILDCARD]/bad-module.ts". - const _badModule = await import("./bad-module.ts"); - ^ - at async file://[WILDCARD]/error_005_missing_dynamic_import.ts:2:22 diff --git a/tests/testdata/run/error_006_import_ext_failure.ts b/tests/testdata/run/error_006_import_ext_failure.ts deleted file mode 100644 index 3c32303a3..000000000 --- a/tests/testdata/run/error_006_import_ext_failure.ts +++ /dev/null @@ -1 +0,0 @@ -import "./non-existent"; diff --git a/tests/testdata/run/error_006_import_ext_failure.ts.out b/tests/testdata/run/error_006_import_ext_failure.ts.out deleted file mode 100644 index 667579bd8..000000000 --- a/tests/testdata/run/error_006_import_ext_failure.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD]error: Module not found "[WILDCARD]/non-existent". - at file:///[WILDCARD]/error_006_import_ext_failure.ts:1:8 diff --git a/tests/testdata/run/error_007_any.ts b/tests/testdata/run/error_007_any.ts deleted file mode 100644 index bfef1289b..000000000 --- a/tests/testdata/run/error_007_any.ts +++ /dev/null @@ -1 +0,0 @@ -throw { foo: "bar" }; diff --git a/tests/testdata/run/error_007_any.ts.out b/tests/testdata/run/error_007_any.ts.out deleted file mode 100644 index 8d13dadb9..000000000 --- a/tests/testdata/run/error_007_any.ts.out +++ /dev/null @@ -1 +0,0 @@ -[WILDCARD]error: Uncaught (in promise) { foo: "bar" } diff --git a/tests/testdata/run/error_008_checkjs.js b/tests/testdata/run/error_008_checkjs.js deleted file mode 100644 index f0856d94c..000000000 --- a/tests/testdata/run/error_008_checkjs.js +++ /dev/null @@ -1,5 +0,0 @@ -// console.log intentionally misspelled to trigger a type error -consol.log("hello world!"); - -// the following error should be ignored and not output to the console -const foo = new Foo(); diff --git a/tests/testdata/run/error_008_checkjs.js.out b/tests/testdata/run/error_008_checkjs.js.out deleted file mode 100644 index bab481422..000000000 --- a/tests/testdata/run/error_008_checkjs.js.out +++ /dev/null @@ -1,4 +0,0 @@ -[WILDCARD]error: Uncaught (in promise) ReferenceError: consol is not defined -consol.log("hello world!"); -^ - at [WILDCARD]/error_008_checkjs.js:2:1 diff --git a/tests/testdata/run/error_009_extensions_error.js b/tests/testdata/run/error_009_extensions_error.js deleted file mode 100644 index 01b97ea38..000000000 --- a/tests/testdata/run/error_009_extensions_error.js +++ /dev/null @@ -1,2 +0,0 @@ -// Missing arg. -new Event(); diff --git a/tests/testdata/run/error_009_extensions_error.js.out b/tests/testdata/run/error_009_extensions_error.js.out deleted file mode 100644 index 2ed936643..000000000 --- a/tests/testdata/run/error_009_extensions_error.js.out +++ /dev/null @@ -1,6 +0,0 @@ -[WILDCARD]error: Uncaught (in promise) TypeError: Failed to construct 'Event': 1 argument required, but only 0 present -new Event(); -^ - at [WILDCARD] - at new Event (ext:deno_web/[WILDCARD]) - at [WILDCARD] diff --git a/tests/testdata/run/error_011_bad_module_specifier.ts b/tests/testdata/run/error_011_bad_module_specifier.ts deleted file mode 100644 index 1c57e37a5..000000000 --- a/tests/testdata/run/error_011_bad_module_specifier.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as badModule from "bad-module.ts"; - -console.log(badModule); diff --git a/tests/testdata/run/error_011_bad_module_specifier.ts.out b/tests/testdata/run/error_011_bad_module_specifier.ts.out deleted file mode 100644 index 81be915d1..000000000 --- a/tests/testdata/run/error_011_bad_module_specifier.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD]error: Relative import path "bad-module.ts" not prefixed with / or ./ or ../ - at [WILDCARD]/error_011_bad_module_specifier.ts:1:28 diff --git a/tests/testdata/run/error_012_bad_dynamic_import_specifier.ts b/tests/testdata/run/error_012_bad_dynamic_import_specifier.ts deleted file mode 100644 index 5f39f407c..000000000 --- a/tests/testdata/run/error_012_bad_dynamic_import_specifier.ts +++ /dev/null @@ -1,3 +0,0 @@ -(async () => { - const _badModule = await import("bad-module.ts"); -})(); diff --git a/tests/testdata/run/error_012_bad_dynamic_import_specifier.ts.out b/tests/testdata/run/error_012_bad_dynamic_import_specifier.ts.out deleted file mode 100644 index 7acd66713..000000000 --- a/tests/testdata/run/error_012_bad_dynamic_import_specifier.ts.out +++ /dev/null @@ -1,7 +0,0 @@ -Check [WILDCARD]error_012_bad_dynamic_import_specifier.ts -error: Uncaught (in promise) TypeError: Relative import path "bad-module.ts" not prefixed with / or ./ or ../ - at [WILDCARD]/error_012_bad_dynamic_import_specifier.ts:2:35 - - const _badModule = await import("bad-module.ts"); - ^ - at async [WILDCARD]/error_012_bad_dynamic_import_specifier.ts:2:22 diff --git a/tests/testdata/run/error_014_catch_dynamic_import_error.js b/tests/testdata/run/error_014_catch_dynamic_import_error.js deleted file mode 100644 index c58e54dcb..000000000 --- a/tests/testdata/run/error_014_catch_dynamic_import_error.js +++ /dev/null @@ -1,31 +0,0 @@ -(async () => { - try { - await import("does not exist"); - } catch (err) { - console.log("Caught direct dynamic import error."); - console.log(err); - } - - try { - await import("../subdir/indirect_import_error.js"); - } catch (err) { - console.log("Caught indirect direct dynamic import error."); - console.log(err); - } - - try { - await import("../subdir/throws.js"); - } catch (err) { - console.log("Caught error thrown by dynamically imported module."); - console.log(err); - } - - try { - await import("../subdir/indirect_throws.js"); - } catch (err) { - console.log( - "Caught error thrown indirectly by dynamically imported module.", - ); - console.log(err); - } -})(); diff --git a/tests/testdata/run/error_014_catch_dynamic_import_error.js.out b/tests/testdata/run/error_014_catch_dynamic_import_error.js.out deleted file mode 100644 index 868c97194..000000000 --- a/tests/testdata/run/error_014_catch_dynamic_import_error.js.out +++ /dev/null @@ -1,19 +0,0 @@ -Caught direct dynamic import error. -TypeError: Relative import path "does not exist" not prefixed with / or ./ or ../ - at [WILDCARD]/error_014_catch_dynamic_import_error.js:3:18 - - at [WILDCARD]/error_014_catch_dynamic_import_error.js:3:5 { - code: "ERR_MODULE_NOT_FOUND" -} -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 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 -Caught error thrown indirectly by dynamically imported module. -Error: An error - at [WILDCARD]/subdir/throws.js:6:7 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 bdf423b59..000000000 --- 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_015_dynamic_import_permissions.out b/tests/testdata/run/error_015_dynamic_import_permissions.out deleted file mode 100644 index 15c26b425..000000000 --- a/tests/testdata/run/error_015_dynamic_import_permissions.out +++ /dev/null @@ -1,4 +0,0 @@ -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"); - ^ - at async file://[WILDCARD]/error_015_dynamic_import_permissions.js:2:3 diff --git a/tests/testdata/run/error_017_hide_long_source_ts.ts b/tests/testdata/run/error_017_hide_long_source_ts.ts deleted file mode 100644 index d61cb1277..000000000 --- a/tests/testdata/run/error_017_hide_long_source_ts.ts +++ /dev/null @@ -1,3 +0,0 @@ -// deno-fmt-ignore-file -const LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG = undefined; -LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG.a; diff --git a/tests/testdata/run/error_017_hide_long_source_ts.ts.out b/tests/testdata/run/error_017_hide_long_source_ts.ts.out deleted file mode 100644 index 917061ab9..000000000 --- a/tests/testdata/run/error_017_hide_long_source_ts.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -[WILDCARD] -error: TS2532 [ERROR]: Object is possibly 'undefined'. - at [WILDCARD]/error_017_hide_long_source_ts.ts:3:1 diff --git a/tests/testdata/run/error_018_hide_long_source_js.js b/tests/testdata/run/error_018_hide_long_source_js.js deleted file mode 100644 index d61cb1277..000000000 --- a/tests/testdata/run/error_018_hide_long_source_js.js +++ /dev/null @@ -1,3 +0,0 @@ -// deno-fmt-ignore-file -const LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG = undefined; -LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG.a; diff --git a/tests/testdata/run/error_018_hide_long_source_js.js.out b/tests/testdata/run/error_018_hide_long_source_js.js.out deleted file mode 100644 index 0897a100c..000000000 --- a/tests/testdata/run/error_018_hide_long_source_js.js.out +++ /dev/null @@ -1,2 +0,0 @@ -error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'a') - at file:///[WILDCARD]/error_018_hide_long_source_js.js:3:206 diff --git a/tests/testdata/run/error_019_stack_function.ts b/tests/testdata/run/error_019_stack_function.ts deleted file mode 100644 index a6a69d146..000000000 --- a/tests/testdata/run/error_019_stack_function.ts +++ /dev/null @@ -1,12 +0,0 @@ -function foo(): never { - throw new Error("function"); -} - -try { - foo(); -} catch (error) { - if (error instanceof Error) { - console.log(error.stack); - } - throw error; -} diff --git a/tests/testdata/run/error_019_stack_function.ts.out b/tests/testdata/run/error_019_stack_function.ts.out deleted file mode 100644 index edaff27c0..000000000 --- a/tests/testdata/run/error_019_stack_function.ts.out +++ /dev/null @@ -1,8 +0,0 @@ -[WILDCARD]Error: function - at foo ([WILDCARD]/error_019_stack_function.ts:[WILDCARD]) - at [WILDCARD]/error_019_stack_function.ts:[WILDCARD] -error: Uncaught (in promise) Error: function - throw new Error("function"); - ^ - at foo ([WILDCARD]/error_019_stack_function.ts:[WILDCARD]) - at [WILDCARD]/error_019_stack_function.ts:[WILDCARD] diff --git a/tests/testdata/run/error_020_stack_constructor.ts b/tests/testdata/run/error_020_stack_constructor.ts deleted file mode 100644 index 526d1a661..000000000 --- a/tests/testdata/run/error_020_stack_constructor.ts +++ /dev/null @@ -1,14 +0,0 @@ -class A { - constructor() { - throw new Error("constructor"); - } -} - -try { - new A(); -} catch (error) { - if (error instanceof Error) { - console.log(error.stack); - } - throw error; -} diff --git a/tests/testdata/run/error_020_stack_constructor.ts.out b/tests/testdata/run/error_020_stack_constructor.ts.out deleted file mode 100644 index 9e48b8f98..000000000 --- a/tests/testdata/run/error_020_stack_constructor.ts.out +++ /dev/null @@ -1,8 +0,0 @@ -[WILDCARD]Error: constructor - at new A ([WILDCARD]/error_020_stack_constructor.ts:[WILDCARD]) - at [WILDCARD]/error_020_stack_constructor.ts:[WILDCARD] -error: Uncaught (in promise) Error: constructor - throw new Error("constructor"); - ^ - at new A ([WILDCARD]/error_020_stack_constructor.ts:[WILDCARD]) - at [WILDCARD]/error_020_stack_constructor.ts:[WILDCARD] diff --git a/tests/testdata/run/error_021_stack_method.ts b/tests/testdata/run/error_021_stack_method.ts deleted file mode 100644 index b6ebe1f5e..000000000 --- a/tests/testdata/run/error_021_stack_method.ts +++ /dev/null @@ -1,14 +0,0 @@ -class A { - m(): never { - throw new Error("method"); - } -} - -try { - new A().m(); -} catch (error) { - if (error instanceof Error) { - console.log(error.stack); - } - throw error; -} diff --git a/tests/testdata/run/error_021_stack_method.ts.out b/tests/testdata/run/error_021_stack_method.ts.out deleted file mode 100644 index 9df9b1b7c..000000000 --- a/tests/testdata/run/error_021_stack_method.ts.out +++ /dev/null @@ -1,8 +0,0 @@ -[WILDCARD]Error: method - at A.m ([WILDCARD]/error_021_stack_method.ts:[WILDCARD]) - at [WILDCARD]/error_021_stack_method.ts:[WILDCARD] -error: Uncaught (in promise) Error: method - throw new Error("method"); - ^ - at A.m ([WILDCARD]/error_021_stack_method.ts:[WILDCARD]) - at [WILDCARD]/error_021_stack_method.ts:[WILDCARD] diff --git a/tests/testdata/run/error_022_stack_custom_error.ts b/tests/testdata/run/error_022_stack_custom_error.ts deleted file mode 100644 index b95743503..000000000 --- a/tests/testdata/run/error_022_stack_custom_error.ts +++ /dev/null @@ -1,14 +0,0 @@ -class CustomError extends Error { - constructor() { - super(); - this.name = "CustomError"; - } - - get message(): string { - return "custom error"; - } -} - -const error = new CustomError(); -console.log(error.stack); -throw error; diff --git a/tests/testdata/run/error_022_stack_custom_error.ts.out b/tests/testdata/run/error_022_stack_custom_error.ts.out deleted file mode 100644 index 73e033e52..000000000 --- a/tests/testdata/run/error_022_stack_custom_error.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -[WILDCARD]CustomError: custom error - at [WILDCARD]/error_022_stack_custom_error.ts:[WILDCARD] -error: Uncaught (in promise) CustomError: custom error -const error = new CustomError(); - ^ - at [WILDCARD]/error_022_stack_custom_error.ts:[WILDCARD] diff --git a/tests/testdata/run/error_023_stack_async.ts b/tests/testdata/run/error_023_stack_async.ts deleted file mode 100644 index fdabaa5df..000000000 --- a/tests/testdata/run/error_023_stack_async.ts +++ /dev/null @@ -1,14 +0,0 @@ -const p = (async () => { - await Promise.resolve().then((): never => { - throw new Error("async"); - }); -})(); - -try { - await p; -} catch (error) { - if (error instanceof Error) { - console.log(error.stack); - } - throw error; -} diff --git a/tests/testdata/run/error_023_stack_async.ts.out b/tests/testdata/run/error_023_stack_async.ts.out deleted file mode 100644 index 2d122d986..000000000 --- a/tests/testdata/run/error_023_stack_async.ts.out +++ /dev/null @@ -1,10 +0,0 @@ -[WILDCARD]Error: async - at [WILDCARD]/error_023_stack_async.ts:[WILDCARD] - at async [WILDCARD]/error_023_stack_async.ts:[WILDCARD] - at async [WILDCARD]/error_023_stack_async.ts:[WILDCARD] -error: Uncaught (in promise) Error: async - throw new Error("async"); - ^ - at [WILDCARD]/error_023_stack_async.ts:[WILDCARD] - at async [WILDCARD]/error_023_stack_async.ts:[WILDCARD] - at async [WILDCARD]/error_023_stack_async.ts:[WILDCARD] diff --git a/tests/testdata/run/error_024_stack_promise_all.ts b/tests/testdata/run/error_024_stack_promise_all.ts deleted file mode 100644 index 8ca7b203c..000000000 --- a/tests/testdata/run/error_024_stack_promise_all.ts +++ /dev/null @@ -1,16 +0,0 @@ -const p = Promise.all([ - Promise.resolve(), - (async (): Promise => { - await Promise.resolve(); - throw new Error("Promise.all()"); - })(), -]); - -try { - await p; -} catch (error) { - if (error instanceof Error) { - console.log(error.stack); - } - throw error; -} diff --git a/tests/testdata/run/error_024_stack_promise_all.ts.out b/tests/testdata/run/error_024_stack_promise_all.ts.out deleted file mode 100644 index c7d10a649..000000000 --- a/tests/testdata/run/error_024_stack_promise_all.ts.out +++ /dev/null @@ -1,10 +0,0 @@ -[WILDCARD]Error: Promise.all() - at [WILDCARD]/error_024_stack_promise_all.ts:[WILDCARD] - at async Promise.all (index 1) - at async [WILDCARD]/error_024_stack_promise_all.ts:[WILDCARD] -error: Uncaught (in promise) Error: Promise.all() - throw new Error("Promise.all()"); - ^ - at [WILDCARD]/error_024_stack_promise_all.ts:[WILDCARD] - at async Promise.all (index 1) - at async [WILDCARD]/error_024_stack_promise_all.ts:[WILDCARD] diff --git a/tests/testdata/run/error_025_tab_indent b/tests/testdata/run/error_025_tab_indent deleted file mode 100644 index 35a25bcea..000000000 --- a/tests/testdata/run/error_025_tab_indent +++ /dev/null @@ -1,9 +0,0 @@ -function foo() { - throw Error("bad"); -} - -function bar() { - foo(); -} - -bar(); diff --git a/tests/testdata/run/error_025_tab_indent.out b/tests/testdata/run/error_025_tab_indent.out deleted file mode 100644 index edf525c90..000000000 --- a/tests/testdata/run/error_025_tab_indent.out +++ /dev/null @@ -1,6 +0,0 @@ -[WILDCARD]error: Uncaught (in promise) Error: bad - throw Error("bad"); - ^ - at foo ([WILDCARD]/error_025_tab_indent:2:8) - at bar ([WILDCARD]/error_025_tab_indent:6:2) - at [WILDCARD]/error_025_tab_indent:9:1 diff --git a/tests/testdata/run/error_cause.ts b/tests/testdata/run/error_cause.ts deleted file mode 100644 index 385ce2a03..000000000 --- a/tests/testdata/run/error_cause.ts +++ /dev/null @@ -1,14 +0,0 @@ -function a() { - // deno-lint-ignore no-explicit-any - throw new Error("foo", { cause: new Error("bar", { cause: "deno" as any }) }); -} - -function b() { - a(); -} - -function c() { - b(); -} - -c(); diff --git a/tests/testdata/run/error_cause.ts.out b/tests/testdata/run/error_cause.ts.out deleted file mode 100644 index 4dc439ac9..000000000 --- a/tests/testdata/run/error_cause.ts.out +++ /dev/null @@ -1,13 +0,0 @@ -error: Uncaught (in promise) Error: foo - throw new Error("foo", { cause: new Error("bar", { cause: "deno" as any }) }); - ^ - at a (file:///[WILDCARD]/error_cause.ts:3:9) - at b (file:///[WILDCARD]/error_cause.ts:7:3) - at c (file:///[WILDCARD]/error_cause.ts:11:3) - at file:///[WILDCARD]/error_cause.ts:14:1 -Caused by: Error: bar - at a (file:///[WILDCARD]/error_cause.ts:3:35) - at b (file:///[WILDCARD]/error_cause.ts:7:3) - at c (file:///[WILDCARD]/error_cause.ts:11:3) - at file:///[WILDCARD]/error_cause.ts:14:1 -Caused by: "deno" diff --git a/tests/testdata/run/error_cause_recursive.ts b/tests/testdata/run/error_cause_recursive.ts deleted file mode 100644 index a6999b1ff..000000000 --- a/tests/testdata/run/error_cause_recursive.ts +++ /dev/null @@ -1,4 +0,0 @@ -const x = new Error("foo"); -const y = new Error("bar", { cause: x }); -x.cause = y; -throw y; diff --git a/tests/testdata/run/error_cause_recursive.ts.out b/tests/testdata/run/error_cause_recursive.ts.out deleted file mode 100644 index 52d5a03a1..000000000 --- a/tests/testdata/run/error_cause_recursive.ts.out +++ /dev/null @@ -1,7 +0,0 @@ -error: Uncaught (in promise) Error: bar -const y = new Error("bar", { cause: x }); - ^ - at file:///[WILDCARD]/error_cause_recursive.ts:2:11 -Caused by: Error: foo - at file:///[WILDCARD]/error_cause_recursive.ts:1:11 -Caused by: [Circular *1] diff --git a/tests/testdata/run/error_for_await.ts b/tests/testdata/run/error_for_await.ts deleted file mode 100644 index ce8571df1..000000000 --- a/tests/testdata/run/error_for_await.ts +++ /dev/null @@ -1,12 +0,0 @@ -const listener = Deno.listen({ port: 8080 }); - -for await (const conn of listener) { - handleConn(conn); -} - -function handleConn(conn: Deno.Conn) { - const httpConn = (Deno as any).serveHttp(conn); - for await (const event of httpConn) { - event.respondWith(new Response("html", { status: 200 })); - } -} diff --git a/tests/testdata/run/error_for_await.ts.out b/tests/testdata/run/error_for_await.ts.out deleted file mode 100644 index db3cdecb4..000000000 --- a/tests/testdata/run/error_for_await.ts.out +++ /dev/null @@ -1,10 +0,0 @@ -[WILDCARD] -error: TS1103 [ERROR]: 'for await' loops are only allowed within async functions and at the top levels of modules. - for await (const event of httpConn) { - ~~~~~ - at [WILDCARD]error_for_await.ts:9:7 - -TS1356 [ERROR]: Did you mean to mark this function as 'async'? - function handleConn(conn: Deno.Conn) { - ~~~~~~~~~~ - at [WILDCARD]error_for_await.ts:7:10 diff --git a/tests/testdata/run/error_import_map_unable_to_load.out b/tests/testdata/run/error_import_map_unable_to_load.out deleted file mode 100644 index 50760e438..000000000 --- a/tests/testdata/run/error_import_map_unable_to_load.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Unable to load '[WILDCARD]' import map - -Caused by: - [WILDCARD] \ No newline at end of file diff --git a/tests/testdata/run/error_missing_module_named_import.ts b/tests/testdata/run/error_missing_module_named_import.ts deleted file mode 100644 index 9eb5239ff..000000000 --- a/tests/testdata/run/error_missing_module_named_import.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { a } from "./does_not_exist.js"; - -console.log(a); diff --git a/tests/testdata/run/error_missing_module_named_import.ts.out b/tests/testdata/run/error_missing_module_named_import.ts.out deleted file mode 100644 index 700377d65..000000000 --- a/tests/testdata/run/error_missing_module_named_import.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -error: Module not found "file://[WILDCARD]/does_not_exist.js". - at file:///[WILDCARD]/error_missing_module_named_import.ts:[WILDCARD] diff --git a/tests/testdata/run/error_name_non_string.js b/tests/testdata/run/error_name_non_string.js deleted file mode 100644 index ae9609927..000000000 --- a/tests/testdata/run/error_name_non_string.js +++ /dev/null @@ -1,8 +0,0 @@ -class ErrorNameNonString extends Error { - constructor() { - super(); - this.name = 42; - } -} - -throw new ErrorNameNonString(); diff --git a/tests/testdata/run/error_name_non_string.js.out b/tests/testdata/run/error_name_non_string.js.out deleted file mode 100644 index 14fa56c62..000000000 --- a/tests/testdata/run/error_name_non_string.js.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Uncaught (in promise) Error -throw new ErrorNameNonString(); - ^ - at file:///[WILDCARD]/error_name_non_string.js:[WILDCARD] diff --git a/tests/testdata/run/error_no_check.ts b/tests/testdata/run/error_no_check.ts deleted file mode 100644 index 2da01e639..000000000 --- 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 78f478045..000000000 --- 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_syntax.js b/tests/testdata/run/error_syntax.js deleted file mode 100644 index c0414c356..000000000 --- a/tests/testdata/run/error_syntax.js +++ /dev/null @@ -1,3 +0,0 @@ - -// deno-fmt-ignore-file -(the following is a syntax error ^^ ! ) diff --git a/tests/testdata/run/error_syntax.js.out b/tests/testdata/run/error_syntax.js.out deleted file mode 100644 index fa4d51686..000000000 --- a/tests/testdata/run/error_syntax.js.out +++ /dev/null @@ -1,4 +0,0 @@ -error: The module's source code could not be parsed: Expected ',', got 'following' at [WILDCARD]/error_syntax.js:3:6 - - (the following is a syntax error ^^ ! ) - ~~~~~~~~~ diff --git a/tests/testdata/run/error_syntax_empty_trailing_line.mjs b/tests/testdata/run/error_syntax_empty_trailing_line.mjs deleted file mode 100644 index 864dfb0c7..000000000 --- a/tests/testdata/run/error_syntax_empty_trailing_line.mjs +++ /dev/null @@ -1,2 +0,0 @@ -// Deliberately using .mjs to avoid triggering dprint -setTimeout(() => {}), diff --git a/tests/testdata/run/error_syntax_empty_trailing_line.mjs.out b/tests/testdata/run/error_syntax_empty_trailing_line.mjs.out deleted file mode 100644 index 2c9b97aa4..000000000 --- a/tests/testdata/run/error_syntax_empty_trailing_line.mjs.out +++ /dev/null @@ -1,6 +0,0 @@ -error: The module's source code could not be parsed: Unexpected eof at [WILDCARD]/error_syntax_empty_trailing_line.mjs:3:1 - - setTimeout(() => {}), - ~~~~~~~~~~~~~~~~~~~~~ - - ~ diff --git a/tests/testdata/run/error_type_definitions.ts b/tests/testdata/run/error_type_definitions.ts deleted file mode 100644 index 86675cbaa..000000000 --- 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/error_type_definitions.ts.out b/tests/testdata/run/error_type_definitions.ts.out deleted file mode 100644 index 057c21df5..000000000 --- a/tests/testdata/run/error_type_definitions.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -[WILDCARD]error: Failed resolving types. Relative import path "baz" not prefixed with / or ./ or ../ - hint: If you want to use a JSR or npm package, try running `deno add jsr:baz` or `deno add npm:baz` - at [WILDCARD]/type_definitions/bar.d.ts:[WILDCARD] diff --git a/tests/testdata/run/error_with_errors_prop.js b/tests/testdata/run/error_with_errors_prop.js deleted file mode 100644 index d1c6bbfaa..000000000 --- a/tests/testdata/run/error_with_errors_prop.js +++ /dev/null @@ -1,10 +0,0 @@ -const error = new Error("Error with errors prop."); -error.errors = [ - new Error("Error message 1."), - new Error("Error message 2."), -]; -console.log(error.stack); -console.log(); -console.log(error); -console.log(); -throw error; diff --git a/tests/testdata/run/error_with_errors_prop.js.out b/tests/testdata/run/error_with_errors_prop.js.out deleted file mode 100644 index d958996af..000000000 --- a/tests/testdata/run/error_with_errors_prop.js.out +++ /dev/null @@ -1,17 +0,0 @@ -Error: Error with errors prop. - at [WILDCARD]/error_with_errors_prop.js:1:15 - -Error: Error with errors prop. - at [WILDCARD]/error_with_errors_prop.js:1:15 { - errors: [ - Error: Error message 1. - at [WILDCARD]/error_with_errors_prop.js:3:3, - Error: Error message 2. - at [WILDCARD]/error_with_errors_prop.js:4:3 - ] -} - -error: Uncaught (in promise) Error: Error with errors prop. -const error = new Error("Error with errors prop."); - ^ - at [WILDCARD]/error_with_errors_prop.js:1:15 diff --git a/tests/testdata/run/es_private_fields.js b/tests/testdata/run/es_private_fields.js deleted file mode 100644 index b5f83e39c..000000000 --- a/tests/testdata/run/es_private_fields.js +++ /dev/null @@ -1,15 +0,0 @@ -class Foo { - #field = "field"; - - setValue(val) { - this.#field = val; - } - - getValue() { - return this.#field; - } -} - -const bar = new Foo(); -bar.setValue("PRIVATE"); -console.log(bar.getValue()); diff --git a/tests/testdata/run/es_private_fields.js.out b/tests/testdata/run/es_private_fields.js.out deleted file mode 100644 index be1970b05..000000000 --- a/tests/testdata/run/es_private_fields.js.out +++ /dev/null @@ -1 +0,0 @@ -PRIVATE diff --git a/tests/testdata/run/eval_context_throw_dom_exception.js b/tests/testdata/run/eval_context_throw_dom_exception.js deleted file mode 100644 index 99eaa0f4a..000000000 --- a/tests/testdata/run/eval_context_throw_dom_exception.js +++ /dev/null @@ -1,5 +0,0 @@ -const [, errorInfo] = Deno[Deno.internal].core.evalContext( - 'throw new DOMException("foo")', - new URL("..", import.meta.url).href, -); -console.log(errorInfo); diff --git a/tests/testdata/run/eval_context_throw_dom_exception.js.out b/tests/testdata/run/eval_context_throw_dom_exception.js.out deleted file mode 100644 index 24ea0cffc..000000000 --- a/tests/testdata/run/eval_context_throw_dom_exception.js.out +++ /dev/null @@ -1,8 +0,0 @@ -{ - thrown: Error: foo - at [WILDCARD] - at Object.evalContext (ext:core/01_core.js:[WILDCARD]) - at file:///[WILDCARD]/eval_context_throw_dom_exception.js:1:48, - isNativeError: true, - isCompileError: false -} diff --git a/tests/testdata/run/event_listener_error.ts b/tests/testdata/run/event_listener_error.ts deleted file mode 100644 index 1cbdf7bc2..000000000 --- a/tests/testdata/run/event_listener_error.ts +++ /dev/null @@ -1,6 +0,0 @@ -addEventListener("foo", () => { - throw new Error("bar"); -}); -console.log(1); -dispatchEvent(new CustomEvent("foo")); -console.log(2); diff --git a/tests/testdata/run/event_listener_error.ts.out b/tests/testdata/run/event_listener_error.ts.out deleted file mode 100644 index a20a91dfd..000000000 --- a/tests/testdata/run/event_listener_error.ts.out +++ /dev/null @@ -1,7 +0,0 @@ -1 -error: Uncaught Error: bar - throw new Error("bar"); - ^ - at [WILDCARD]/event_listener_error.ts:2:9 - at [WILDCARD] - at [WILDCARD]/event_listener_error.ts:5:1 diff --git a/tests/testdata/run/event_listener_error_handled.ts b/tests/testdata/run/event_listener_error_handled.ts deleted file mode 100644 index c4c8fd1cd..000000000 --- a/tests/testdata/run/event_listener_error_handled.ts +++ /dev/null @@ -1,23 +0,0 @@ -addEventListener("error", (event) => { - console.log({ - cancelable: event.cancelable, - message: event.message, - filename: event.filename?.slice?.(-100), - lineno: event.lineno, - colno: event.colno, - error: event.error, - }); - event.preventDefault(); -}); - -onerror = (event) => { - console.log("onerror() called", event.error); -}; - -addEventListener("foo", () => { - throw new Error("bar"); -}); - -console.log(1); -dispatchEvent(new CustomEvent("foo")); -console.log(2); diff --git a/tests/testdata/run/event_listener_error_handled.ts.out b/tests/testdata/run/event_listener_error_handled.ts.out deleted file mode 100644 index d3cf525c3..000000000 --- a/tests/testdata/run/event_listener_error_handled.ts.out +++ /dev/null @@ -1,17 +0,0 @@ -1 -{ - cancelable: true, - message: "Uncaught Error: bar", - filename: "[WILDCARD]/event_listener_error_handled.ts", - lineno: 18, - colno: 9, - error: Error: bar - at [WILDCARD]/event_listener_error_handled.ts:18:9 - at [WILDCARD] - at [WILDCARD]/event_listener_error_handled.ts:22:1 -} -onerror() called Error: bar - at [WILDCARD]/event_listener_error_handled.ts:18:9 - at [WILDCARD] - at [WILDCARD]/event_listener_error_handled.ts:22:1 -2 diff --git a/tests/testdata/run/event_listener_error_immediate_exit.ts b/tests/testdata/run/event_listener_error_immediate_exit.ts deleted file mode 100644 index 292a0df00..000000000 --- a/tests/testdata/run/event_listener_error_immediate_exit.ts +++ /dev/null @@ -1,12 +0,0 @@ -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.ts.out b/tests/testdata/run/event_listener_error_immediate_exit.ts.out deleted file mode 100644 index 8f03f71b8..000000000 --- a/tests/testdata/run/event_listener_error_immediate_exit.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -1 -error: Uncaught Error: bar - throw new Error("bar"); - ^ - at [WILDCARD]/event_listener_error_immediate_exit.ts:4:9[WILDCARD] - at [WILDCARD]/event_listener_error_immediate_exit.ts:11:1 diff --git a/tests/testdata/run/event_listener_error_immediate_exit_worker.ts b/tests/testdata/run/event_listener_error_immediate_exit_worker.ts deleted file mode 100644 index 58c45d1bb..000000000 --- a/tests/testdata/run/event_listener_error_immediate_exit_worker.ts +++ /dev/null @@ -1,4 +0,0 @@ -new Worker( - import.meta.resolve("./event_listener_error_immediate_exit.ts"), - { type: "module" }, -); diff --git a/tests/testdata/run/event_listener_error_immediate_exit_worker.ts.out b/tests/testdata/run/event_listener_error_immediate_exit_worker.ts.out deleted file mode 100644 index 85b52190b..000000000 --- a/tests/testdata/run/event_listener_error_immediate_exit_worker.ts.out +++ /dev/null @@ -1,8 +0,0 @@ -1 -error: Uncaught (in worker "") Error: bar - throw new Error("bar"); - ^ - at [WILDCARD]/event_listener_error_immediate_exit.ts:4:9[WILDCARD] - at [WILDCARD]/event_listener_error_immediate_exit.ts:11:1 -error: Uncaught (in promise) Error: Unhandled error in child worker. - at [WILDCARD] diff --git a/tests/testdata/run/exit_error42.ts b/tests/testdata/run/exit_error42.ts deleted file mode 100644 index e4db41f3a..000000000 --- a/tests/testdata/run/exit_error42.ts +++ /dev/null @@ -1,3 +0,0 @@ -console.log("before"); -Deno.exit(42); -console.log("after"); diff --git a/tests/testdata/run/exit_error42.ts.out b/tests/testdata/run/exit_error42.ts.out deleted file mode 100644 index 90be1f305..000000000 --- a/tests/testdata/run/exit_error42.ts.out +++ /dev/null @@ -1 +0,0 @@ -before diff --git a/tests/testdata/run/explicit_resource_management/main.out b/tests/testdata/run/explicit_resource_management/main.out deleted file mode 100644 index ff5ac4b59..000000000 --- a/tests/testdata/run/explicit_resource_management/main.out +++ /dev/null @@ -1,5 +0,0 @@ -A -Disposed -B -Async disposed -C diff --git a/tests/testdata/run/explicit_resource_management/main.ts b/tests/testdata/run/explicit_resource_management/main.ts deleted file mode 100644 index 0201a51f9..000000000 --- a/tests/testdata/run/explicit_resource_management/main.ts +++ /dev/null @@ -1,21 +0,0 @@ -class Resource { - [Symbol.dispose]() { - console.log("Disposed"); - } -} -class AsyncResource { - async [Symbol.asyncDispose]() { - await new Promise((resolve) => setTimeout(resolve, 10)); - console.log("Async disposed"); - } -} - -{ - using resource = new Resource(); - console.log("A"); -} -{ - await using resource = new AsyncResource(); - console.log("B"); -} -console.log("C"); diff --git a/tests/testdata/run/fetch_async_error_stack.ts b/tests/testdata/run/fetch_async_error_stack.ts deleted file mode 100644 index f583192c2..000000000 --- a/tests/testdata/run/fetch_async_error_stack.ts +++ /dev/null @@ -1 +0,0 @@ -await fetch("https://nonexistent.deno.land/"); diff --git a/tests/testdata/run/fetch_async_error_stack.ts.out b/tests/testdata/run/fetch_async_error_stack.ts.out deleted file mode 100644 index 2722cc8a7..000000000 --- a/tests/testdata/run/fetch_async_error_stack.ts.out +++ /dev/null @@ -1,5 +0,0 @@ -error: Uncaught (in promise) TypeError: error sending request for url (https://nonexistent.deno.land/): client error[WILDCARD] -await fetch("https://nonexistent.deno.land/"); -^[WILDCARD] - at async fetch (ext:[WILDCARD]) - at async file:///[WILDCARD]/fetch_async_error_stack.ts:1:1 diff --git a/tests/testdata/run/fetch_response_finalization.js b/tests/testdata/run/fetch_response_finalization.js deleted file mode 100644 index 85fc6afa3..000000000 --- a/tests/testdata/run/fetch_response_finalization.js +++ /dev/null @@ -1,16 +0,0 @@ -async function doAFetch() { - const resp = await fetch("http://localhost:4545/README.md"); - console.log(Deno[Deno.internal].core.resources()); // print the current resources - const _resp = resp; - // at this point resp can be GC'ed -} - -await doAFetch(); // create a resource - -globalThis.gc(); // force GC - -// It is very important that there is a yield here, otherwise the finalizer for -// the response body is not called and the resource is not closed. -await new Promise((resolve) => setTimeout(resolve, 0)); - -console.log(Deno[Deno.internal].core.resources()); // print the current resources diff --git a/tests/testdata/run/fetch_response_finalization.js.out b/tests/testdata/run/fetch_response_finalization.js.out deleted file mode 100644 index 645842a5b..000000000 --- a/tests/testdata/run/fetch_response_finalization.js.out +++ /dev/null @@ -1,2 +0,0 @@ -{ "0": "stdin", "1": "stdout", "2": "stderr", "5": "fetchResponse" } -{ "0": "stdin", "1": "stdout", "2": "stderr" } diff --git a/tests/testdata/run/finalization_registry.js b/tests/testdata/run/finalization_registry.js deleted file mode 100644 index ee9dc384f..000000000 --- a/tests/testdata/run/finalization_registry.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -"use strict"; - -function assertEquals(a, b) { - if (a === b) return; - throw a + " does not equal " + b; -} - -const registry = new FinalizationRegistry((value) => { - assertEquals(value, "called!"); - Deno[Deno.internal].core.print("FinalizationRegistry called!\n"); -}); - -(function () { - let x = {}; - registry.register(x, "called!"); - x = null; -})(); - -gc(); diff --git a/tests/testdata/run/finalization_registry.js.out b/tests/testdata/run/finalization_registry.js.out deleted file mode 100644 index fee61413a..000000000 --- a/tests/testdata/run/finalization_registry.js.out +++ /dev/null @@ -1 +0,0 @@ -FinalizationRegistry called! diff --git a/tests/testdata/run/fix_dynamic_import_errors.js b/tests/testdata/run/fix_dynamic_import_errors.js deleted file mode 100644 index 1d7be37e0..000000000 --- a/tests/testdata/run/fix_dynamic_import_errors.js +++ /dev/null @@ -1,7 +0,0 @@ -import("../dynamic_import/b.js").catch(() => { - console.log("caught import error from b.js"); -}); - -import("../dynamic_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/testdata/run/fix_dynamic_import_errors.js.out deleted file mode 100644 index e7856fb9c..000000000 --- a/tests/testdata/run/fix_dynamic_import_errors.js.out +++ /dev/null @@ -1,2 +0,0 @@ -caught import error from [WILDCARD].js -caught import error from [WILDCARD].js diff --git a/tests/testdata/run/fix_emittable_skipped.js b/tests/testdata/run/fix_emittable_skipped.js deleted file mode 100644 index a4ccc9efd..000000000 --- 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_emittable_skipped.ts.out b/tests/testdata/run/fix_emittable_skipped.ts.out deleted file mode 100644 index 865759299..000000000 --- a/tests/testdata/run/fix_emittable_skipped.ts.out +++ /dev/null @@ -1 +0,0 @@ -[Function (anonymous)] 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 0f01877cd..000000000 --- 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_import_js.ts.out b/tests/testdata/run/fix_js_import_js.ts.out deleted file mode 100644 index 27ba77dda..000000000 --- a/tests/testdata/run/fix_js_import_js.ts.out +++ /dev/null @@ -1 +0,0 @@ -true diff --git a/tests/testdata/run/fix_js_imports.ts b/tests/testdata/run/fix_js_imports.ts deleted file mode 100644 index 6ed13bae3..000000000 --- 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/fix_js_imports.ts.out b/tests/testdata/run/fix_js_imports.ts.out deleted file mode 100644 index c427932a4..000000000 --- a/tests/testdata/run/fix_js_imports.ts.out +++ /dev/null @@ -1 +0,0 @@ -[Module: null prototype] { } diff --git a/tests/testdata/run/fix_tsc_file_exists.out b/tests/testdata/run/fix_tsc_file_exists.out deleted file mode 100644 index ce0136250..000000000 --- a/tests/testdata/run/fix_tsc_file_exists.out +++ /dev/null @@ -1 +0,0 @@ -hello diff --git a/tests/testdata/run/fix_worker_dispatchevent.ts b/tests/testdata/run/fix_worker_dispatchevent.ts deleted file mode 100644 index 1b73b52dc..000000000 --- a/tests/testdata/run/fix_worker_dispatchevent.ts +++ /dev/null @@ -1,43 +0,0 @@ -const code = ` -addEventListener("message", () => { - postMessage("pong"); -}); - -const context = new EventTarget(); - -Object.defineProperty(globalThis, "dispatchEvent", { - value: context.dispatchEvent.bind(context), - writable: true, - enumerable: true, - configurable: true, -}); - -postMessage("start"); -`; - -const blob = new Blob([code], { type: "application/javascript" }); - -const url = URL.createObjectURL(blob); - -const worker = new Worker(url, { type: "module" }); - -let terminated = false; - -worker.addEventListener("message", (evt) => { - if (evt.data === "start") { - worker.postMessage("ping"); - } else if (evt.data === "pong") { - worker.terminate(); - terminated = true; - console.log("success"); - } else { - throw new Error("unexpected message from worker"); - } -}); - -setTimeout(() => { - if (!terminated) { - worker.terminate(); - throw new Error("did not receive message from worker in time"); - } -}, 2000); diff --git a/tests/testdata/run/fix_worker_dispatchevent.ts.out b/tests/testdata/run/fix_worker_dispatchevent.ts.out deleted file mode 100644 index 2e9ba477f..000000000 --- a/tests/testdata/run/fix_worker_dispatchevent.ts.out +++ /dev/null @@ -1 +0,0 @@ -success diff --git a/tests/testdata/run/followup_dyn_import_resolves/main.ts b/tests/testdata/run/followup_dyn_import_resolves/main.ts deleted file mode 100644 index a8508f942..000000000 --- a/tests/testdata/run/followup_dyn_import_resolves/main.ts +++ /dev/null @@ -1,14 +0,0 @@ -// https://github.com/denoland/deno/issues/14726 - -// Any dynamic modules that are only pending on a TLA import should be resolved -// in the same event loop iteration as the imported module. - -// Long-running timer so the event loop doesn't have a next iteration for a -// while. -setTimeout(() => {}, 24 * 60 * 60 * 1000); - -await import("./sub1.ts"); - -// If we reach here, the test is passed. -console.log("Done."); -Deno.exit(); diff --git a/tests/testdata/run/followup_dyn_import_resolves/main.ts.out b/tests/testdata/run/followup_dyn_import_resolves/main.ts.out deleted file mode 100644 index a19976d4a..000000000 --- a/tests/testdata/run/followup_dyn_import_resolves/main.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -sub2 -sub1 -Done. diff --git a/tests/testdata/run/heapstats.js b/tests/testdata/run/heapstats.js deleted file mode 100644 index b93c9c120..000000000 --- a/tests/testdata/run/heapstats.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -"use strict"; - -function allocTest(alloc, allocAssert, deallocAssert) { - // Helper func that GCs then returns memory usage - const sample = () => { - // deno-lint-ignore no-undef - gc(); - return Deno.memoryUsage(); - }; - const delta = (t1, t2) => t2.heapUsed - t1.heapUsed; - - // Sample "clean" heap usage - const t1 = sample(); - - // Alloc - // deno-lint-ignore no-unused-vars - let x = alloc(); - const t2 = sample(); - allocAssert(delta(t1, t2)); - - // Free - x = null; - const t3 = sample(); - deallocAssert(delta(t2, t3)); -} - -function main() { - // Large-array test, 1M slot array consumes ~4MB (4B per slot) - allocTest( - () => new Array(1e6), - (delta) => console.log("Allocated:", Math.round(delta / 1e6) + "MB"), - (delta) => console.log("Freed:", Math.round(delta / 1e6) + "MB"), - ); -} - -main(); diff --git a/tests/testdata/run/heapstats.js.out b/tests/testdata/run/heapstats.js.out deleted file mode 100644 index 954266333..000000000 --- a/tests/testdata/run/heapstats.js.out +++ /dev/null @@ -1,2 +0,0 @@ -Allocated: 8MB -Freed: -8MB diff --git a/tests/testdata/run/https_import.ts.out b/tests/testdata/run/https_import.ts.out deleted file mode 100644 index e965047ad..000000000 --- a/tests/testdata/run/https_import.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/tests/testdata/run/if_main.ts b/tests/testdata/run/if_main.ts deleted file mode 100644 index 4dcfecea0..000000000 --- a/tests/testdata/run/if_main.ts +++ /dev/null @@ -1,6 +0,0 @@ -if (import.meta.main) { - console.log("main"); -} else { - console.log("import.meta.url", import.meta.url); - throw Error("not main"); -} diff --git a/tests/testdata/run/import_blob_url.ts b/tests/testdata/run/import_blob_url.ts deleted file mode 100644 index 86bb634e1..000000000 --- a/tests/testdata/run/import_blob_url.ts +++ /dev/null @@ -1,13 +0,0 @@ -const blob = new Blob( - ['export const a = "a";\n\nexport enum A {\n A,\n B,\n C,\n}\n'], - { - type: "application/typescript", - }, -); -const url = URL.createObjectURL(blob); - -const a = await import(url); - -console.log(a.a); -console.log(a.A); -console.log(a.A.A); diff --git a/tests/testdata/run/import_blob_url.ts.out b/tests/testdata/run/import_blob_url.ts.out deleted file mode 100644 index bfa0b9d94..000000000 --- a/tests/testdata/run/import_blob_url.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -a -{ "0": "A", "1": "B", "2": "C", A: 0, B: 1, C: 2 } -0 diff --git a/tests/testdata/run/import_blob_url_error_stack.ts b/tests/testdata/run/import_blob_url_error_stack.ts deleted file mode 100644 index f9c4f2e9d..000000000 --- a/tests/testdata/run/import_blob_url_error_stack.ts +++ /dev/null @@ -1,13 +0,0 @@ -const blob = new Blob( - [ - "enum A {\n A,\n B,\n C,\n }\n \n export function a() {\n throw new Error(`Hello ${A.C}`);\n }\n ", - ], - { - type: "application/typescript", - }, -); -const url = URL.createObjectURL(blob); - -const { a } = await import(url); - -a(); diff --git a/tests/testdata/run/import_blob_url_error_stack.ts.out b/tests/testdata/run/import_blob_url_error_stack.ts.out deleted file mode 100644 index 201556b8a..000000000 --- a/tests/testdata/run/import_blob_url_error_stack.ts.out +++ /dev/null @@ -1,5 +0,0 @@ -error: Uncaught (in promise) Error: Hello 2 - throw new Error(`Hello ${A.C}`); - ^ - at a (blob:null/[WILDCARD]:8:10) - at file:///[WILDCARD]/import_blob_url_error_stack.ts:13:1 diff --git a/tests/testdata/run/import_blob_url_import_relative.ts b/tests/testdata/run/import_blob_url_import_relative.ts deleted file mode 100644 index ad130bdac..000000000 --- a/tests/testdata/run/import_blob_url_import_relative.ts +++ /dev/null @@ -1,8 +0,0 @@ -const blob = new Blob(['export { a } from "./a.ts";'], { - type: "application/javascript", -}); -const url = URL.createObjectURL(blob); - -const a = await import(url); - -console.log(a); diff --git a/tests/testdata/run/import_blob_url_import_relative.ts.out b/tests/testdata/run/import_blob_url_import_relative.ts.out deleted file mode 100644 index 59a6f07fb..000000000 --- a/tests/testdata/run/import_blob_url_import_relative.ts.out +++ /dev/null @@ -1,5 +0,0 @@ -error: Uncaught (in promise) TypeError: invalid URL: relative URL with a cannot-be-a-base base - at blob:null/[WILDCARD]:1:19 -const a = await import(url); - ^ - at async file://[WILDCARD]/import_blob_url_import_relative.ts:6:11 diff --git a/tests/testdata/run/import_blob_url_imports.ts b/tests/testdata/run/import_blob_url_imports.ts deleted file mode 100644 index a7c639152..000000000 --- a/tests/testdata/run/import_blob_url_imports.ts +++ /dev/null @@ -1,11 +0,0 @@ -const blob = new Blob( - [ - 'export { printHello } from "http://localhost:4545/subdir/mod2.ts"', - ], - { type: "application/javascript" }, -); -const url = URL.createObjectURL(blob); - -const { printHello } = await import(url); - -printHello(); diff --git a/tests/testdata/run/import_blob_url_imports.ts.out b/tests/testdata/run/import_blob_url_imports.ts.out deleted file mode 100644 index e965047ad..000000000 --- a/tests/testdata/run/import_blob_url_imports.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/tests/testdata/run/import_blob_url_jsx.ts b/tests/testdata/run/import_blob_url_jsx.ts deleted file mode 100644 index 8d645796a..000000000 --- a/tests/testdata/run/import_blob_url_jsx.ts +++ /dev/null @@ -1,16 +0,0 @@ -const blob = new Blob( - ["export default function() {\n return
Hello Deno!
\n}\n"], - { type: "text/jsx" }, -); -const url = URL.createObjectURL(blob); - -const { default: render } = await import(url); - -// deno-lint-ignore no-explicit-any -(globalThis as any).React = { - createElement(...args: unknown[]) { - console.log(...args); - }, -}; - -render(); diff --git a/tests/testdata/run/import_blob_url_jsx.ts.out b/tests/testdata/run/import_blob_url_jsx.ts.out deleted file mode 100644 index c1c85f250..000000000 --- a/tests/testdata/run/import_blob_url_jsx.ts.out +++ /dev/null @@ -1 +0,0 @@ -div null Hello Deno! diff --git a/tests/testdata/run/import_compression/main.out b/tests/testdata/run/import_compression/main.out deleted file mode 100644 index 371994979..000000000 --- a/tests/testdata/run/import_compression/main.out +++ /dev/null @@ -1,4 +0,0 @@ -gzip -brotli -console.log('gzip') -console.log('brotli'); diff --git a/tests/testdata/run/import_compression/main.ts b/tests/testdata/run/import_compression/main.ts deleted file mode 100644 index 3dcd6fa24..000000000 --- a/tests/testdata/run/import_compression/main.ts +++ /dev/null @@ -1,13 +0,0 @@ -import "http://127.0.0.1:4545/run/import_compression/gziped"; -import "http://127.0.0.1:4545/run/import_compression/brotli"; - -console.log( - await fetch( - "http://127.0.0.1:4545/run/import_compression/gziped", - ).then((res) => res.text()), -); -console.log( - await fetch( - "http://127.0.0.1:4545/run/import_compression/brotli", - ).then((res) => res.text()), -); diff --git a/tests/testdata/run/import_data_url.ts b/tests/testdata/run/import_data_url.ts deleted file mode 100644 index 258514a5e..000000000 --- a/tests/testdata/run/import_data_url.ts +++ /dev/null @@ -1,12 +0,0 @@ -// export const a = "a"; - -// export enum A { -// A, -// B, -// C, -// } -import * as a from "data:application/typescript;base64,ZXhwb3J0IGNvbnN0IGEgPSAiYSI7CgpleHBvcnQgZW51bSBBIHsKICBBLAogIEIsCiAgQywKfQo="; - -console.log(a.a); -console.log(a.A); -console.log(a.A.A); diff --git a/tests/testdata/run/import_data_url.ts.out b/tests/testdata/run/import_data_url.ts.out deleted file mode 100644 index bfa0b9d94..000000000 --- a/tests/testdata/run/import_data_url.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -a -{ "0": "A", "1": "B", "2": "C", A: 0, B: 1, C: 2 } -0 diff --git a/tests/testdata/run/import_data_url_error_stack.ts b/tests/testdata/run/import_data_url_error_stack.ts deleted file mode 100644 index 022e49fe1..000000000 --- a/tests/testdata/run/import_data_url_error_stack.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { a } from "data:application/typescript;base64,ZW51bSBBIHsKICBBLAogIEIsCiAgQywKIH0KIAogZXhwb3J0IGZ1bmN0aW9uIGEoKSB7CiAgIHRocm93IG5ldyBFcnJvcihgSGVsbG8gJHtBLkN9YCk7CiB9CiA="; - -a(); diff --git a/tests/testdata/run/import_data_url_error_stack.ts.out b/tests/testdata/run/import_data_url_error_stack.ts.out deleted file mode 100644 index 83eed611d..000000000 --- a/tests/testdata/run/import_data_url_error_stack.ts.out +++ /dev/null @@ -1,5 +0,0 @@ -error: Uncaught (in promise) Error: Hello 2 - throw new Error(`Hello ${A.C}`); - ^ - at a (data:application/typescript;base64,ZW51bSBBIHsKICBBLAog......JHtBLkN9YCk7CiB9CiA=:8:10) - at file:///[WILDCARD]/import_data_url_error_stack.ts:3:1 diff --git a/tests/testdata/run/import_data_url_import_relative.ts b/tests/testdata/run/import_data_url_import_relative.ts deleted file mode 100644 index 23947fe60..000000000 --- a/tests/testdata/run/import_data_url_import_relative.ts +++ /dev/null @@ -1,4 +0,0 @@ -// export { a } from "./a.ts"; -import * as a from "data:application/javascript;base64,ZXhwb3J0IHsgYSB9IGZyb20gIi4vYS50cyI7Cg=="; - -console.log(a); diff --git a/tests/testdata/run/import_data_url_import_relative.ts.out b/tests/testdata/run/import_data_url_import_relative.ts.out deleted file mode 100644 index 821c3e4df..000000000 --- a/tests/testdata/run/import_data_url_import_relative.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -error: invalid URL: relative URL with a cannot-be-a-base base - at data:application/javascript;base64,ZXhwb3J0IHsgYSB9IGZyb20gIi4vYS50cyI7Cg==:1:19 diff --git a/tests/testdata/run/import_data_url_imports.ts b/tests/testdata/run/import_data_url_imports.ts deleted file mode 100644 index df7dae727..000000000 --- a/tests/testdata/run/import_data_url_imports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// export { printHello } from "http://localhost:4545/subdir/mod2.ts"; -import { printHello } from "data:application/typescript;base64,ZXhwb3J0IHsgcHJpbnRIZWxsbyB9IGZyb20gImh0dHA6Ly9sb2NhbGhvc3Q6NDU0NS9zdWJkaXIvbW9kMi50cyI7"; - -printHello(); diff --git a/tests/testdata/run/import_data_url_imports.ts.out b/tests/testdata/run/import_data_url_imports.ts.out deleted file mode 100644 index e965047ad..000000000 --- a/tests/testdata/run/import_data_url_imports.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/tests/testdata/run/import_data_url_jsx.ts b/tests/testdata/run/import_data_url_jsx.ts deleted file mode 100644 index 1881211f9..000000000 --- a/tests/testdata/run/import_data_url_jsx.ts +++ /dev/null @@ -1,10 +0,0 @@ -import render from "data:text/jsx;base64,ZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oKSB7CiAgcmV0dXJuIDxkaXY+SGVsbG8gRGVubyE8L2Rpdj4KfQo="; - -// deno-lint-ignore no-explicit-any -(globalThis as any).React = { - createElement(...args: unknown[]) { - console.log(...args); - }, -}; - -render(); diff --git a/tests/testdata/run/import_data_url_jsx.ts.out b/tests/testdata/run/import_data_url_jsx.ts.out deleted file mode 100644 index c1c85f250..000000000 --- a/tests/testdata/run/import_data_url_jsx.ts.out +++ /dev/null @@ -1 +0,0 @@ -div null Hello Deno! diff --git a/tests/testdata/run/import_dynamic_data_url.ts b/tests/testdata/run/import_dynamic_data_url.ts deleted file mode 100644 index 53a0fbcd3..000000000 --- a/tests/testdata/run/import_dynamic_data_url.ts +++ /dev/null @@ -1,14 +0,0 @@ -// export const a = "a"; - -// export enum A { -// A, -// B, -// C, -// } -const a = await import( - "data:application/typescript;base64,ZXhwb3J0IGNvbnN0IGEgPSAiYSI7CgpleHBvcnQgZW51bSBBIHsKICBBLAogIEIsCiAgQywKfQo=" -); - -console.log(a.a); -console.log(a.A); -console.log(a.A.A); diff --git a/tests/testdata/run/import_dynamic_data_url.ts.out b/tests/testdata/run/import_dynamic_data_url.ts.out deleted file mode 100644 index bfa0b9d94..000000000 --- a/tests/testdata/run/import_dynamic_data_url.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -a -{ "0": "A", "1": "B", "2": "C", A: 0, B: 1, C: 2 } -0 diff --git a/tests/testdata/run/import_extensionless.ts b/tests/testdata/run/import_extensionless.ts deleted file mode 100644 index 689d553ff..000000000 --- a/tests/testdata/run/import_extensionless.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { printHello3 } from "http://localhost:4545/v1/extensionless"; - -printHello3(); diff --git a/tests/testdata/run/import_extensionless.ts.out b/tests/testdata/run/import_extensionless.ts.out deleted file mode 100644 index e965047ad..000000000 --- a/tests/testdata/run/import_extensionless.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/tests/testdata/run/import_file_with_colon.ts b/tests/testdata/run/import_file_with_colon.ts deleted file mode 100644 index 619bdd66d..000000000 --- a/tests/testdata/run/import_file_with_colon.ts +++ /dev/null @@ -1 +0,0 @@ -import "http://localhost:4545/subdir/file_with_:_in_name.ts"; diff --git a/tests/testdata/run/import_file_with_colon.ts.out b/tests/testdata/run/import_file_with_colon.ts.out deleted file mode 100644 index f60bbf4b1..000000000 --- a/tests/testdata/run/import_file_with_colon.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello from file_with_:_in_name.ts diff --git a/tests/testdata/run/import_maps/test_data.ts b/tests/testdata/run/import_maps/test_data.ts deleted file mode 100644 index 5e8efea69..000000000 --- a/tests/testdata/run/import_maps/test_data.ts +++ /dev/null @@ -1 +0,0 @@ -import "test_server/import_maps/lodash/lodash.ts"; diff --git a/tests/testdata/run/import_maps/test_data.ts.out b/tests/testdata/run/import_maps/test_data.ts.out deleted file mode 100644 index da996dc0d..000000000 --- a/tests/testdata/run/import_maps/test_data.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello from remapped lodash! diff --git a/tests/testdata/run/import_type.ts b/tests/testdata/run/import_type.ts deleted file mode 100644 index 22c639cbc..000000000 --- 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/import_type.ts.out b/tests/testdata/run/import_type.ts.out deleted file mode 100644 index e35539e35..000000000 --- a/tests/testdata/run/import_type.ts.out +++ /dev/null @@ -1 +0,0 @@ -B { a: "a" } diff --git a/tests/testdata/run/inline_js_source_map_2.js b/tests/testdata/run/inline_js_source_map_2.js deleted file mode 100644 index d14d906b8..000000000 --- a/tests/testdata/run/inline_js_source_map_2.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; -1 + 1; -throw new Error("Hello world!"); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L3J1bi9pbmxpbmVfanNfc291cmNlX21hcF8yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxDQUFDLEdBQUMsQ0FBQyxDQUFDO0FBS0osTUFBTSxJQUFJLEtBQUssQ0FBQyxjQUErQixDQUFDLENBQUMifQ== \ No newline at end of file diff --git a/tests/testdata/run/inline_js_source_map_2.js.out b/tests/testdata/run/inline_js_source_map_2.js.out deleted file mode 100644 index ba3053eba..000000000 --- a/tests/testdata/run/inline_js_source_map_2.js.out +++ /dev/null @@ -1,2 +0,0 @@ -error: Uncaught (in promise) Error: Hello world! - at http://localhost:4545/run/inline_js_source_map_2.ts:6:7 diff --git a/tests/testdata/run/inline_js_source_map_2_with_inline_contents.js b/tests/testdata/run/inline_js_source_map_2_with_inline_contents.js deleted file mode 100644 index 7660cc229..000000000 --- a/tests/testdata/run/inline_js_source_map_2_with_inline_contents.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; - -throw new Error("Hello world!"); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L3J1bi9pbmxpbmVfanNfc291cmNlX21hcF8yLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIjErMTtcbmludGVyZmFjZSBUZXN0IHtcbiAgaGVsbG86IHN0cmluZztcbn1cblxudGhyb3cgbmV3IEVycm9yKFwiSGVsbG8gd29ybGQhXCIgYXMgdW5rbm93biBhcyBzdHJpbmcpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxDQUFDLEdBQUMsQ0FBQyxDQUFDO0FBS0osTUFBTSxJQUFJLEtBQUssQ0FBQyxjQUErQixDQUFDLENBQUMifQ== \ No newline at end of file diff --git a/tests/testdata/run/inline_js_source_map_2_with_inline_contents.js.out b/tests/testdata/run/inline_js_source_map_2_with_inline_contents.js.out deleted file mode 100644 index ba3053eba..000000000 --- a/tests/testdata/run/inline_js_source_map_2_with_inline_contents.js.out +++ /dev/null @@ -1,2 +0,0 @@ -error: Uncaught (in promise) Error: Hello world! - at http://localhost:4545/run/inline_js_source_map_2.ts:6:7 diff --git a/tests/testdata/run/inline_js_source_map_with_contents_from_graph.js b/tests/testdata/run/inline_js_source_map_with_contents_from_graph.js deleted file mode 100644 index 887f02320..000000000 --- a/tests/testdata/run/inline_js_source_map_with_contents_from_graph.js +++ /dev/null @@ -1,4 +0,0 @@ -"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 diff --git a/tests/testdata/run/inline_js_source_map_with_contents_from_graph.js.out b/tests/testdata/run/inline_js_source_map_with_contents_from_graph.js.out deleted file mode 100644 index d80a1c7bb..000000000 --- a/tests/testdata/run/inline_js_source_map_with_contents_from_graph.js.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Uncaught (in promise) Error: Hello world! -// throw new Error("Hello world!" as string); - ^ - at http://localhost:4545/run/inline_js_source_map.ts:6:7 diff --git a/tests/testdata/run/issue13562.ts b/tests/testdata/run/issue13562.ts deleted file mode 100644 index afbf69f99..000000000 --- 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/issue13562.ts.out b/tests/testdata/run/issue13562.ts.out deleted file mode 100644 index e965047ad..000000000 --- a/tests/testdata/run/issue13562.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/tests/testdata/run/js_import_detect.ts b/tests/testdata/run/js_import_detect.ts deleted file mode 100644 index 751741996..000000000 --- a/tests/testdata/run/js_import_detect.ts +++ /dev/null @@ -1,3 +0,0 @@ -function define(_foo: string[]) {} -define(["long"]); -console.log("ok"); diff --git a/tests/testdata/run/js_import_detect.ts.out b/tests/testdata/run/js_import_detect.ts.out deleted file mode 100644 index 9766475a4..000000000 --- a/tests/testdata/run/js_import_detect.ts.out +++ /dev/null @@ -1 +0,0 @@ -ok diff --git a/tests/testdata/run/js_root_with_ts_check.js b/tests/testdata/run/js_root_with_ts_check.js deleted file mode 100644 index adca847ee..000000000 --- a/tests/testdata/run/js_root_with_ts_check.js +++ /dev/null @@ -1,5 +0,0 @@ -// @ts-check - -/** @type {number} */ -const a = ""; -console.log(a); diff --git a/tests/testdata/run/js_root_with_ts_check.js.out b/tests/testdata/run/js_root_with_ts_check.js.out deleted file mode 100644 index 34e2fa61e..000000000 --- a/tests/testdata/run/js_root_with_ts_check.js.out +++ /dev/null @@ -1,4 +0,0 @@ -error: TS2322 [ERROR]: Type 'string' is not assignable to type 'number'. -const a = ""; - ^ - at [WILDCARD] diff --git a/tests/testdata/run/jsx_import_from_ts.ts b/tests/testdata/run/jsx_import_from_ts.ts deleted file mode 100644 index 3cc916698..000000000 --- a/tests/testdata/run/jsx_import_from_ts.ts +++ /dev/null @@ -1,3 +0,0 @@ -import app from "./jsx_import_from_ts.App.jsx"; - -console.log(app); diff --git a/tests/testdata/run/jsx_import_from_ts.ts.out b/tests/testdata/run/jsx_import_from_ts.ts.out deleted file mode 100644 index d449b8c9a..000000000 --- a/tests/testdata/run/jsx_import_from_ts.ts.out +++ /dev/null @@ -1 +0,0 @@ -[Function: app] diff --git a/tests/testdata/run/jsx_import_source.out b/tests/testdata/run/jsx_import_source.out deleted file mode 100644 index b9555987a..000000000 --- a/tests/testdata/run/jsx_import_source.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -imported http://localhost:4545/jsx/jsx-runtime diff --git a/tests/testdata/run/jsx_import_source_dev.out b/tests/testdata/run/jsx_import_source_dev.out deleted file mode 100644 index 38d7a12f0..000000000 --- a/tests/testdata/run/jsx_import_source_dev.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -imported http://localhost:4545/jsx/jsx-dev-runtime diff --git a/tests/testdata/run/jsx_import_source_error.out b/tests/testdata/run/jsx_import_source_error.out deleted file mode 100644 index 634a5b09b..000000000 --- a/tests/testdata/run/jsx_import_source_error.out +++ /dev/null @@ -1,2 +0,0 @@ -error: Module not found "file:///[WILDCARD]/nonexistent/jsx-runtime". - at file:///[WILDCARD]/jsx_import_source_no_pragma.tsx:1:1 diff --git a/tests/testdata/run/jsx_import_source_pragma.tsx b/tests/testdata/run/jsx_import_source_pragma.tsx deleted file mode 100644 index c19e53d4f..000000000 --- a/tests/testdata/run/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/testdata/run/jsx_import_source_pragma_import_map.tsx b/tests/testdata/run/jsx_import_source_pragma_import_map.tsx deleted file mode 100644 index 548365f18..000000000 --- a/tests/testdata/run/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/testdata/run/jsx_precompile/no_pragma.out b/tests/testdata/run/jsx_precompile/no_pragma.out deleted file mode 100644 index 437995923..000000000 --- a/tests/testdata/run/jsx_precompile/no_pragma.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4545/jsx/jsx-precompile/index.ts -Check file:///[WILDCARD]/run/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/testdata/run/jsx_precompile/no_pragma.tsx deleted file mode 100644 index 7ba21d80d..000000000 --- a/tests/testdata/run/jsx_precompile/no_pragma.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export function A() { - return

hello

; -} diff --git a/tests/testdata/run/jsx_precompile/skip.out b/tests/testdata/run/jsx_precompile/skip.out deleted file mode 100644 index a32b616f0..000000000 --- a/tests/testdata/run/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/testdata/run/jsx_precompile/skip.tsx b/tests/testdata/run/jsx_precompile/skip.tsx deleted file mode 100644 index 49bc4e2b7..000000000 --- a/tests/testdata/run/jsx_precompile/skip.tsx +++ /dev/null @@ -1,9 +0,0 @@ -export function A() { - return ( -
- foo -

hello

- -
- ); -} diff --git a/tests/testdata/run/lock_check_ok.json b/tests/testdata/run/lock_check_ok.json deleted file mode 100644 index 94de0f630..000000000 --- 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_check_ok2.json b/tests/testdata/run/lock_check_ok2.json deleted file mode 100644 index 55a6f9892..000000000 --- a/tests/testdata/run/lock_check_ok2.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": "4", - "remote": { - "http://localhost:4545/subdir/mt_application_ecmascript.j2.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/subdir/mt_application_x_javascript.j4.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/subdir/mt_text_ecmascript.j3.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/subdir/mt_text_javascript.j1.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/subdir/mt_text_typescript.t1.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/subdir/mt_video_mp2t.t3.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/subdir/mt_video_vdn.t2.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18" - } -} 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 63bec862a..000000000 --- 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/lock_v2_check_ok2.json b/tests/testdata/run/lock_v2_check_ok2.json deleted file mode 100644 index 4356c9421..000000000 --- a/tests/testdata/run/lock_v2_check_ok2.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/subdir/mt_application_ecmascript.j2.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/subdir/mt_application_x_javascript.j4.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/subdir/mt_text_ecmascript.j3.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/subdir/mt_text_javascript.j1.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/subdir/mt_text_typescript.t1.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/subdir/mt_video_mp2t.t3.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/subdir/mt_video_vdn.t2.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18" - } -} diff --git a/tests/testdata/run/long_data_url_formatting.ts b/tests/testdata/run/long_data_url_formatting.ts deleted file mode 100644 index 2ed2d5a03..000000000 --- a/tests/testdata/run/long_data_url_formatting.ts +++ /dev/null @@ -1,3 +0,0 @@ -await import( - 'data:application/typescript,console.trace("foo"); const error = new Error("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); console.log(error.stack); throw error;' -); diff --git a/tests/testdata/run/long_data_url_formatting.ts.out b/tests/testdata/run/long_data_url_formatting.ts.out deleted file mode 100644 index ea78c2591..000000000 --- a/tests/testdata/run/long_data_url_formatting.ts.out +++ /dev/null @@ -1,8 +0,0 @@ -[WILDCARD]Trace: foo - at data:application/typescript,console.trace("foo")......stack); throw error;:1:9 -Error: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - at data:application/typescript,console.trace("foo")......stack); throw error;:1:37 -error: Uncaught (in promise) Error: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -console.trace("foo"); const error = new Error("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); console.log(error.stack); throw error; - ^ - at data:application/typescript,console.trace("foo")......stack); throw error;:1:37 diff --git a/tests/testdata/run/main_module/main.out b/tests/testdata/run/main_module/main.out deleted file mode 100644 index 29f592c2a..000000000 --- a/tests/testdata/run/main_module/main.out +++ /dev/null @@ -1,2 +0,0 @@ -other [WILDCARD]/main.ts -main [WILDCARD]/main.ts diff --git a/tests/testdata/run/main_module/main.ts b/tests/testdata/run/main_module/main.ts deleted file mode 100644 index d2f2c66ee..000000000 --- a/tests/testdata/run/main_module/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -console.log("main", Deno.mainModule); - -import "./other.ts"; diff --git a/tests/testdata/run/main_module/other.ts b/tests/testdata/run/main_module/other.ts deleted file mode 100644 index b3e524b0a..000000000 --- a/tests/testdata/run/main_module/other.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("other", Deno.mainModule); diff --git a/tests/testdata/run/mts_dmts_mjs.out b/tests/testdata/run/mts_dmts_mjs.out deleted file mode 100644 index 789819226..000000000 --- a/tests/testdata/run/mts_dmts_mjs.out +++ /dev/null @@ -1 +0,0 @@ -a diff --git a/tests/testdata/run/nested_error/main.ts b/tests/testdata/run/nested_error/main.ts deleted file mode 100644 index 69828e1ca..000000000 --- a/tests/testdata/run/nested_error/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -throw { - foo: new Error(), -}; diff --git a/tests/testdata/run/nested_error/main.ts.out b/tests/testdata/run/nested_error/main.ts.out deleted file mode 100644 index 05780bc6a..000000000 --- a/tests/testdata/run/nested_error/main.ts.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Uncaught (in promise) { - foo: Error - at file:///[WILDCARD]/main.ts:2:8 -} diff --git a/tests/testdata/run/no_check_remote.ts.disabled.out b/tests/testdata/run/no_check_remote.ts.disabled.out deleted file mode 100644 index 344264634..000000000 --- a/tests/testdata/run/no_check_remote.ts.disabled.out +++ /dev/null @@ -1,4 +0,0 @@ -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 diff --git a/tests/testdata/run/no_lock_flag/deno.json b/tests/testdata/run/no_lock_flag/deno.json deleted file mode 100644 index 90faa728a..000000000 --- a/tests/testdata/run/no_lock_flag/deno.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tasks": {} -} diff --git a/tests/testdata/run/no_lock_flag/deno.lock b/tests/testdata/run/no_lock_flag/deno.lock deleted file mode 100644 index 059f66789..000000000 --- a/tests/testdata/run/no_lock_flag/deno.lock +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": "2", - "remote": { - "http://localhost:4545/subdir/mod2.ts": "cae1d3e9f3c38cd415ff52dff854be8f3d17d35f8d7b3d285e813fb0f6393a2f", - "http://localhost:4545/subdir/print_hello.ts": "foobar" - } -} diff --git a/tests/testdata/run/no_lock_flag/main.out b/tests/testdata/run/no_lock_flag/main.out deleted file mode 100644 index 0d8f0a237..000000000 --- a/tests/testdata/run/no_lock_flag/main.out +++ /dev/null @@ -1,2 +0,0 @@ -Download http://localhost:4545/subdir/mod2.ts -Download http://localhost:4545/subdir/print_hello.ts diff --git a/tests/testdata/run/no_lock_flag/main.ts b/tests/testdata/run/no_lock_flag/main.ts deleted file mode 100644 index baa52775d..000000000 --- a/tests/testdata/run/no_lock_flag/main.ts +++ /dev/null @@ -1 +0,0 @@ -import "http://localhost:4545/subdir/mod2.ts"; diff --git a/tests/testdata/run/node_env_var_allowlist.ts b/tests/testdata/run/node_env_var_allowlist.ts deleted file mode 100644 index 95da38c24..000000000 --- a/tests/testdata/run/node_env_var_allowlist.ts +++ /dev/null @@ -1,2 +0,0 @@ -console.log(Deno.env.get("NODE_DEBUG") ?? "ok"); -Deno.env.get("NOT_NODE_DEBUG"); diff --git a/tests/testdata/run/node_env_var_allowlist.ts.out b/tests/testdata/run/node_env_var_allowlist.ts.out deleted file mode 100644 index 2dcffd67b..000000000 --- a/tests/testdata/run/node_env_var_allowlist.ts.out +++ /dev/null @@ -1,5 +0,0 @@ -ok -[WILDCARD]error: Uncaught (in promise) NotCapable: Requires env access to "NOT_NODE_DEBUG", run again with the --allow-env flag -Deno.env.get("NOT_NODE_DEBUG"); - ^ - at [WILDCARD] diff --git a/tests/testdata/run/onload/imported.ts b/tests/testdata/run/onload/imported.ts deleted file mode 100644 index 643e2fc78..000000000 --- a/tests/testdata/run/onload/imported.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { assert } from "@std/assert"; -import "./nest_imported.ts"; - -const handler = (e: Event) => { - assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable); - console.log(`got ${e.type} event in event handler (imported)`); -}; - -globalThis.addEventListener("load", handler); -globalThis.addEventListener("beforeunload", handler); -globalThis.addEventListener("unload", handler); -console.log("log from imported script"); diff --git a/tests/testdata/run/onload/main.out b/tests/testdata/run/onload/main.out deleted file mode 100644 index b25d33fa8..000000000 --- a/tests/testdata/run/onload/main.out +++ /dev/null @@ -1,15 +0,0 @@ -log from nest_imported script -log from imported script -log from main -got load event in event handler (nest_imported) -got load event in event handler (imported) -got load event in event handler (main) -got load event in onload function -got beforeunload event in event handler (nest_imported) -got beforeunload event in event handler (imported) -got beforeunload event in event handler (main) -got beforeunload event in onbeforeunload function -got unload event in event handler (nest_imported) -got unload event in event handler (imported) -got unload event in event handler (main) -got unload event in onunload function diff --git a/tests/testdata/run/onload/main.ts b/tests/testdata/run/onload/main.ts deleted file mode 100644 index c4b8424fb..000000000 --- a/tests/testdata/run/onload/main.ts +++ /dev/null @@ -1,34 +0,0 @@ -// deno-lint-ignore-file no-prototype-builtins -import { assert } from "@std/assert"; -import "./imported.ts"; - -assert(globalThis.hasOwnProperty("onload")); -assert(globalThis.onload === null); - -const eventHandler = (e: Event) => { - assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable); - console.log(`got ${e.type} event in event handler (main)`); -}; - -globalThis.addEventListener("load", eventHandler); - -globalThis.addEventListener("beforeunload", eventHandler); - -globalThis.addEventListener("unload", eventHandler); - -globalThis.onload = (e: Event) => { - assert(!e.cancelable); - console.log(`got ${e.type} event in onload function`); -}; - -globalThis.onbeforeunload = (e: BeforeUnloadEvent) => { - assert(e.cancelable); - console.log(`got ${e.type} event in onbeforeunload function`); -}; - -globalThis.onunload = (e: Event) => { - assert(!e.cancelable); - console.log(`got ${e.type} event in onunload function`); -}; - -console.log("log from main"); diff --git a/tests/testdata/run/onload/nest_imported.ts b/tests/testdata/run/onload/nest_imported.ts deleted file mode 100644 index f1d28e8dc..000000000 --- a/tests/testdata/run/onload/nest_imported.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { assert } from "@std/assert"; - -const handler = (e: Event) => { - assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable); - console.log(`got ${e.type} event in event handler (nest_imported)`); -}; - -globalThis.addEventListener("load", handler); -globalThis.addEventListener("beforeunload", handler); -globalThis.addEventListener("unload", handler); -console.log("log from nest_imported script"); diff --git a/tests/testdata/run/op_exit_op_set_exit_code_in_worker.ts b/tests/testdata/run/op_exit_op_set_exit_code_in_worker.ts deleted file mode 100644 index b6a776439..000000000 --- a/tests/testdata/run/op_exit_op_set_exit_code_in_worker.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Set exit code to some value, we'll ensure that `Deno.exit()` and -// setting exit code in worker context is a no-op and is an alias for -// `self.close()`. - -// @ts-ignore Deno[Deno.internal].core doesn't have type-defs -Deno[Deno.internal].core.ops.op_set_exit_code(21); - -const worker = new Worker( - import.meta.resolve("./op_exit_op_set_exit_code_worker.js"), - { type: "module" }, -); - -worker.postMessage("go"); diff --git a/tests/testdata/run/permission_args.out b/tests/testdata/run/permission_args.out deleted file mode 100644 index 6a1e1787c..000000000 --- a/tests/testdata/run/permission_args.out +++ /dev/null @@ -1,4 +0,0 @@ -Permission flags have likely been incorrectly set after the script argument. -To grant permissions, set them before the script argument. For example: - deno run --allow-read=. main.js -Hello World diff --git a/tests/testdata/run/private_field_presence.ts b/tests/testdata/run/private_field_presence.ts deleted file mode 100644 index 7ce2840d8..000000000 --- a/tests/testdata/run/private_field_presence.ts +++ /dev/null @@ -1,20 +0,0 @@ -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/testdata/run/private_field_presence.ts.out b/tests/testdata/run/private_field_presence.ts.out deleted file mode 100644 index 1d474d525..000000000 --- a/tests/testdata/run/private_field_presence.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -false -true diff --git a/tests/testdata/run/proto_exploit.js b/tests/testdata/run/proto_exploit.js deleted file mode 100644 index 8bd22cfe5..000000000 --- a/tests/testdata/run/proto_exploit.js +++ /dev/null @@ -1,5 +0,0 @@ -const payload = `{ "__proto__": null }`; -const obj = {}; -console.log("Before: " + obj); -Object.assign(obj, JSON.parse(payload)); -console.log("After: " + obj); diff --git a/tests/testdata/run/proto_exploit.js.out b/tests/testdata/run/proto_exploit.js.out deleted file mode 100644 index fde881dc5..000000000 --- a/tests/testdata/run/proto_exploit.js.out +++ /dev/null @@ -1,2 +0,0 @@ -Before: [object Object] -After: [object Object] diff --git a/tests/testdata/run/queue_microtask_error.ts b/tests/testdata/run/queue_microtask_error.ts deleted file mode 100644 index b2e9642c5..000000000 --- a/tests/testdata/run/queue_microtask_error.ts +++ /dev/null @@ -1,5 +0,0 @@ -queueMicrotask(() => { - throw new Error("foo"); -}); -console.log(1); -Promise.resolve().then(() => console.log(2)); diff --git a/tests/testdata/run/queue_microtask_error.ts.out b/tests/testdata/run/queue_microtask_error.ts.out deleted file mode 100644 index a8ce13170..000000000 --- a/tests/testdata/run/queue_microtask_error.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -1 -error: Uncaught Error: foo - throw new Error("foo"); - ^ - at [WILDCARD]/queue_microtask_error.ts:2:9 - at ext:core/[WILDCARD] diff --git a/tests/testdata/run/queue_microtask_error_handled.ts b/tests/testdata/run/queue_microtask_error_handled.ts deleted file mode 100644 index 47ea2d32e..000000000 --- a/tests/testdata/run/queue_microtask_error_handled.ts +++ /dev/null @@ -1,21 +0,0 @@ -addEventListener("error", (event) => { - console.log({ - cancelable: event.cancelable, - message: event.message, - filename: event.filename?.slice?.(-100), - lineno: event.lineno, - colno: event.colno, - error: event.error, - }); - event.preventDefault(); -}); - -onerror = (event) => { - console.log("onerror() called", event.error); -}; - -queueMicrotask(() => { - throw new Error("foo"); -}); -console.log(1); -Promise.resolve().then(() => console.log(2)); diff --git a/tests/testdata/run/queue_microtask_error_handled.ts.out b/tests/testdata/run/queue_microtask_error_handled.ts.out deleted file mode 100644 index bdc8eafa1..000000000 --- a/tests/testdata/run/queue_microtask_error_handled.ts.out +++ /dev/null @@ -1,15 +0,0 @@ -1 -{ - cancelable: true, - message: "Uncaught Error: foo", - filename: "[WILDCARD]/queue_microtask_error_handled.ts", - lineno: 18, - colno: 9, - error: Error: foo - at [WILDCARD]/queue_microtask_error_handled.ts:18:9 - at ext:core/[WILDCARD] -} -onerror() called Error: foo - at [WILDCARD]/queue_microtask_error_handled.ts:18:9 - at ext:core/[WILDCARD] -2 diff --git a/tests/testdata/run/reference_types.ts b/tests/testdata/run/reference_types.ts deleted file mode 100644 index 105e23b37..000000000 --- a/tests/testdata/run/reference_types.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// - -console.log(globalThis.a); diff --git a/tests/testdata/run/reference_types.ts.out b/tests/testdata/run/reference_types.ts.out deleted file mode 100644 index 417b7b537..000000000 --- a/tests/testdata/run/reference_types.ts.out +++ /dev/null @@ -1 +0,0 @@ -undefined diff --git a/tests/testdata/run/reference_types_error.js b/tests/testdata/run/reference_types_error.js deleted file mode 100644 index 68b6c2136..000000000 --- a/tests/testdata/run/reference_types_error.js +++ /dev/null @@ -1,2 +0,0 @@ -/// -export const a = 1; diff --git a/tests/testdata/run/reference_types_error.js.out b/tests/testdata/run/reference_types_error.js.out deleted file mode 100644 index 86055f3ac..000000000 --- a/tests/testdata/run/reference_types_error.js.out +++ /dev/null @@ -1,2 +0,0 @@ -error: Module not found "file:///[WILDCARD]/nonexistent.d.ts". - at file:///[WILDCARD]/reference_types_error.js:1:22 diff --git a/tests/testdata/run/reference_types_remote.ts b/tests/testdata/run/reference_types_remote.ts deleted file mode 100644 index e7fa81b2c..000000000 --- a/tests/testdata/run/reference_types_remote.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// - -console.log(globalThis.a); diff --git a/tests/testdata/run/reference_types_remote.ts.out b/tests/testdata/run/reference_types_remote.ts.out deleted file mode 100644 index 417b7b537..000000000 --- a/tests/testdata/run/reference_types_remote.ts.out +++ /dev/null @@ -1 +0,0 @@ -undefined diff --git a/tests/testdata/run/rejection_handled.out b/tests/testdata/run/rejection_handled.out deleted file mode 100644 index 5c06fcd2b..000000000 --- a/tests/testdata/run/rejection_handled.out +++ /dev/null @@ -1,5 +0,0 @@ -[WILDCARD] -unhandledrejection 1 Promise { 1 } -Added catch handler to the promise -rejectionhandled 1 Promise { 1 } -Success diff --git a/tests/testdata/run/rejection_handled.ts b/tests/testdata/run/rejection_handled.ts deleted file mode 100644 index 8822203f1..000000000 --- a/tests/testdata/run/rejection_handled.ts +++ /dev/null @@ -1,17 +0,0 @@ -globalThis.addEventListener("unhandledrejection", (event) => { - console.log("unhandledrejection", event.reason, event.promise); - event.preventDefault(); -}); - -globalThis.addEventListener("rejectionhandled", (event) => { - console.log("rejectionhandled", event.reason, event.promise); -}); - -const a = Promise.reject(1); -setTimeout(async () => { - a.catch(() => console.log("Added catch handler to the promise")); -}, 10); - -setTimeout(() => { - console.log("Success"); -}, 1000); diff --git a/tests/testdata/run/replace_self.js b/tests/testdata/run/replace_self.js deleted file mode 100644 index cfd473cd3..000000000 --- a/tests/testdata/run/replace_self.js +++ /dev/null @@ -1,21 +0,0 @@ -// Test that setting `self` in the main thread to some other value doesn't break -// the world, in particular for events fired on the global scope. - -// deno-lint-ignore no-global-assign -self = null; - -addEventListener("load", () => { - console.log("load event (event listener)"); -}); - -addEventListener("unload", () => { - console.log("unload event (event listener)"); -}); - -globalThis.onload = () => { - console.log("load event (event handler)"); -}; - -globalThis.onunload = () => { - console.log("unload event (event handler)"); -}; diff --git a/tests/testdata/run/replace_self.js.out b/tests/testdata/run/replace_self.js.out deleted file mode 100644 index aaffb5a62..000000000 --- a/tests/testdata/run/replace_self.js.out +++ /dev/null @@ -1,4 +0,0 @@ -load event (event listener) -load event (event handler) -unload event (event listener) -unload event (event handler) diff --git a/tests/testdata/run/report_error.ts b/tests/testdata/run/report_error.ts deleted file mode 100644 index a6d4af1fd..000000000 --- a/tests/testdata/run/report_error.ts +++ /dev/null @@ -1,3 +0,0 @@ -console.log(1); -reportError(new Error("foo")); -console.log(2); diff --git a/tests/testdata/run/report_error.ts.out b/tests/testdata/run/report_error.ts.out deleted file mode 100644 index 185db62a5..000000000 --- a/tests/testdata/run/report_error.ts.out +++ /dev/null @@ -1,5 +0,0 @@ -1 -error: Uncaught Error: foo -reportError(new Error("foo")); - ^ - at [WILDCARD]/report_error.ts:2:13 diff --git a/tests/testdata/run/report_error_end_of_program.ts b/tests/testdata/run/report_error_end_of_program.ts deleted file mode 100644 index cd7ce7f9c..000000000 --- a/tests/testdata/run/report_error_end_of_program.ts +++ /dev/null @@ -1 +0,0 @@ -reportError(new Error("foo")); diff --git a/tests/testdata/run/report_error_end_of_program.ts.out b/tests/testdata/run/report_error_end_of_program.ts.out deleted file mode 100644 index ecca63389..000000000 --- a/tests/testdata/run/report_error_end_of_program.ts.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Uncaught Error: foo -reportError(new Error("foo")); - ^ - at [WILDCARD]/report_error_end_of_program.ts:1:13 diff --git a/tests/testdata/run/report_error_handled.ts b/tests/testdata/run/report_error_handled.ts deleted file mode 100644 index d18996c13..000000000 --- a/tests/testdata/run/report_error_handled.ts +++ /dev/null @@ -1,19 +0,0 @@ -addEventListener("error", (event) => { - console.log({ - cancelable: event.cancelable, - message: event.message, - filename: event.filename?.slice?.(-100), - lineno: event.lineno, - colno: event.colno, - error: event.error, - }); - event.preventDefault(); -}); - -onerror = (event) => { - console.log("onerror() called", event.error); -}; - -console.log(1); -reportError(new Error("foo")); -console.log(2); diff --git a/tests/testdata/run/report_error_handled.ts.out b/tests/testdata/run/report_error_handled.ts.out deleted file mode 100644 index 89fa30314..000000000 --- a/tests/testdata/run/report_error_handled.ts.out +++ /dev/null @@ -1,13 +0,0 @@ -1 -{ - cancelable: true, - message: "Uncaught Error: foo", - filename: "[WILDCARD]/report_error_handled.ts", - lineno: 18, - colno: 13, - error: Error: foo - at [WILDCARD]/report_error_handled.ts:18:13 -} -onerror() called Error: foo - at [WILDCARD]/report_error_handled.ts:18:13 -2 diff --git a/tests/testdata/run/seed_random.js b/tests/testdata/run/seed_random.js deleted file mode 100644 index 7f6e336df..000000000 --- a/tests/testdata/run/seed_random.js +++ /dev/null @@ -1,11 +0,0 @@ -for (let i = 0; i < 10; ++i) { - console.log(Math.random()); -} - -const arr = new Uint8Array(32); - -crypto.getRandomValues(arr); -console.log(arr); - -crypto.getRandomValues(arr); -console.log(arr); diff --git a/tests/testdata/run/seed_random.js.out b/tests/testdata/run/seed_random.js.out deleted file mode 100644 index 4d1ebd081..000000000 --- a/tests/testdata/run/seed_random.js.out +++ /dev/null @@ -1,22 +0,0 @@ -0.858562739044346 -0.8973397944553141 -0.15335012655691727 -0.36867387434349963 -0.3591039342838782 -0.7044499748617652 -0.7461423057751548 -0.3824611207183364 -0.5950178237266042 -0.22440633214343908 -Uint8Array(32) [ - 153, 221, 127, 193, 173, 88, 77, 155, - 23, 66, 117, 239, 157, 231, 189, 160, - 79, 198, 30, 56, 137, 159, 220, 226, - 47, 211, 26, 73, 243, 252, 71, 214 -] -Uint8Array(32) [ - 18, 98, 66, 131, 76, 87, 93, 76, - 205, 81, 250, 112, 129, 119, 92, 9, - 116, 99, 5, 171, 8, 137, 132, 79, - 255, 9, 194, 1, 138, 85, 72, 189 -] diff --git a/tests/testdata/run/set_exit_code_0.ts b/tests/testdata/run/set_exit_code_0.ts deleted file mode 100644 index 8a0103c8f..000000000 --- a/tests/testdata/run/set_exit_code_0.ts +++ /dev/null @@ -1,2 +0,0 @@ -Deno[Deno.internal].core.ops.op_set_exit_code(42); -Deno.exit(0); // Takes precedence. diff --git a/tests/testdata/run/set_exit_code_1.ts b/tests/testdata/run/set_exit_code_1.ts deleted file mode 100644 index 45027ccf7..000000000 --- a/tests/testdata/run/set_exit_code_1.ts +++ /dev/null @@ -1,2 +0,0 @@ -Deno[Deno.internal].core.ops.op_set_exit_code(42); -Deno.exit(); diff --git a/tests/testdata/run/set_exit_code_2.ts b/tests/testdata/run/set_exit_code_2.ts deleted file mode 100644 index 48469c17d..000000000 --- a/tests/testdata/run/set_exit_code_2.ts +++ /dev/null @@ -1,2 +0,0 @@ -Deno[Deno.internal].core.ops.op_set_exit_code(42); -// Exits naturally. diff --git a/tests/testdata/run/set_timeout_error.ts b/tests/testdata/run/set_timeout_error.ts deleted file mode 100644 index 2864574e7..000000000 --- a/tests/testdata/run/set_timeout_error.ts +++ /dev/null @@ -1,3 +0,0 @@ -setTimeout(() => { - throw new Error("foo"); -}, 0); diff --git a/tests/testdata/run/set_timeout_error.ts.out b/tests/testdata/run/set_timeout_error.ts.out deleted file mode 100644 index 9db053f6c..000000000 --- a/tests/testdata/run/set_timeout_error.ts.out +++ /dev/null @@ -1,5 +0,0 @@ -error: Uncaught Error: foo - throw new Error("foo"); - ^ - at [WILDCARD]/set_timeout_error.ts:2:9 - at [WILDCARD] diff --git a/tests/testdata/run/set_timeout_error_handled.ts b/tests/testdata/run/set_timeout_error_handled.ts deleted file mode 100644 index aee2d97d2..000000000 --- a/tests/testdata/run/set_timeout_error_handled.ts +++ /dev/null @@ -1,19 +0,0 @@ -addEventListener("error", (event) => { - console.log({ - cancelable: event.cancelable, - message: event.message, - filename: event.filename?.slice?.(-100), - lineno: event.lineno, - colno: event.colno, - error: event.error, - }); - event.preventDefault(); -}); - -onerror = (event) => { - console.log("onerror() called", event.error); -}; - -setTimeout(() => { - throw new Error("foo"); -}, 0); diff --git a/tests/testdata/run/set_timeout_error_handled.ts.out b/tests/testdata/run/set_timeout_error_handled.ts.out deleted file mode 100644 index 054dd9b6b..000000000 --- a/tests/testdata/run/set_timeout_error_handled.ts.out +++ /dev/null @@ -1,13 +0,0 @@ -{ - cancelable: true, - message: "Uncaught Error: foo", - filename: "[WILDCARD]/set_timeout_error_handled.ts", - lineno: 18, - colno: 9, - error: Error: foo - at [WILDCARD]/set_timeout_error_handled.ts:18:9 - at [WILDCARD] -} -onerror() called Error: foo - at [WILDCARD]/set_timeout_error_handled.ts:18:9 - at [WILDCARD] diff --git a/tests/testdata/run/shebang.ts b/tests/testdata/run/shebang.ts deleted file mode 100644 index 00feb2da0..000000000 --- a/tests/testdata/run/shebang.ts +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env -S deno run - -import test from "./shebang2.ts"; - -console.log(test as number); diff --git a/tests/testdata/run/shebang.ts.out b/tests/testdata/run/shebang.ts.out deleted file mode 100644 index d81cc0710..000000000 --- a/tests/testdata/run/shebang.ts.out +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/testdata/run/single_compile_with_reload.ts b/tests/testdata/run/single_compile_with_reload.ts deleted file mode 100644 index 9478ad523..000000000 --- a/tests/testdata/run/single_compile_with_reload.ts +++ /dev/null @@ -1,18 +0,0 @@ -await import("./single_compile_with_reload_dyn.ts"); -console.log("1"); -await import("./single_compile_with_reload_dyn.ts"); -console.log("2"); -await new Promise((r) => - new Worker( - import.meta.resolve("./single_compile_with_reload_worker.ts"), - { type: "module" }, - ).onmessage = r -); -console.log("3"); -await new Promise((r) => - new Worker( - import.meta.resolve("./single_compile_with_reload_worker.ts"), - { type: "module" }, - ).onmessage = r -); -console.log("4"); diff --git a/tests/testdata/run/single_compile_with_reload.ts.out b/tests/testdata/run/single_compile_with_reload.ts.out deleted file mode 100644 index a3986e3af..000000000 --- a/tests/testdata/run/single_compile_with_reload.ts.out +++ /dev/null @@ -1,7 +0,0 @@ -Hello -1 -2 -Hello from worker -3 -Hello from worker -4 diff --git a/tests/testdata/run/spawn_stdout_inherit.ts b/tests/testdata/run/spawn_stdout_inherit.ts deleted file mode 100644 index 04f635cea..000000000 --- a/tests/testdata/run/spawn_stdout_inherit.ts +++ /dev/null @@ -1,8 +0,0 @@ -await new Deno.Command(Deno.execPath(), { - args: ["eval", "--quiet", "console.log('Hello, world! 1')"], - stdout: "inherit", -}).output(); -new Deno.Command(Deno.execPath(), { - args: ["eval", "--quiet", "console.log('Hello, world! 2')"], - stdout: "inherit", -}).outputSync(); diff --git a/tests/testdata/run/spawn_stdout_inherit.ts.out b/tests/testdata/run/spawn_stdout_inherit.ts.out deleted file mode 100644 index 474891cf2..000000000 --- a/tests/testdata/run/spawn_stdout_inherit.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -Hello, world! 1 -Hello, world! 2 diff --git a/tests/testdata/run/stdin_read_all.out b/tests/testdata/run/stdin_read_all.out deleted file mode 100644 index 2f0dfb71a..000000000 --- a/tests/testdata/run/stdin_read_all.out +++ /dev/null @@ -1 +0,0 @@ -01234567890123456789012345678901234567890123456789 diff --git a/tests/testdata/run/stdin_read_all.ts b/tests/testdata/run/stdin_read_all.ts deleted file mode 100644 index d683a2bf6..000000000 --- a/tests/testdata/run/stdin_read_all.ts +++ /dev/null @@ -1,17 +0,0 @@ -const encoder = new TextEncoder(); - -const pending = []; - -// do this a bunch of times to ensure it doesn't race -// and everything happens in order -for (let i = 0; i < 50; i++) { - const buf = new Uint8Array(1); - pending.push( - Deno.stdin.read(buf).then(() => { - return Deno.stdout.write(buf); - }), - ); -} - -await Promise.all(pending); -await Deno.stdout.write(encoder.encode("\n")); diff --git a/tests/testdata/run/stdout_write_all.out b/tests/testdata/run/stdout_write_all.out deleted file mode 100644 index d0e667fd4..000000000 --- a/tests/testdata/run/stdout_write_all.out +++ /dev/null @@ -1,100 +0,0 @@ -Hello, world! 0 -Hello, world! 1 -Hello, world! 2 -Hello, world! 3 -Hello, world! 4 -Hello, world! 5 -Hello, world! 6 -Hello, world! 7 -Hello, world! 8 -Hello, world! 9 -Hello, world! 10 -Hello, world! 11 -Hello, world! 12 -Hello, world! 13 -Hello, world! 14 -Hello, world! 15 -Hello, world! 16 -Hello, world! 17 -Hello, world! 18 -Hello, world! 19 -Hello, world! 20 -Hello, world! 21 -Hello, world! 22 -Hello, world! 23 -Hello, world! 24 -Hello, world! 25 -Hello, world! 26 -Hello, world! 27 -Hello, world! 28 -Hello, world! 29 -Hello, world! 30 -Hello, world! 31 -Hello, world! 32 -Hello, world! 33 -Hello, world! 34 -Hello, world! 35 -Hello, world! 36 -Hello, world! 37 -Hello, world! 38 -Hello, world! 39 -Hello, world! 40 -Hello, world! 41 -Hello, world! 42 -Hello, world! 43 -Hello, world! 44 -Hello, world! 45 -Hello, world! 46 -Hello, world! 47 -Hello, world! 48 -Hello, world! 49 -Hello, world! 50 -Hello, world! 51 -Hello, world! 52 -Hello, world! 53 -Hello, world! 54 -Hello, world! 55 -Hello, world! 56 -Hello, world! 57 -Hello, world! 58 -Hello, world! 59 -Hello, world! 60 -Hello, world! 61 -Hello, world! 62 -Hello, world! 63 -Hello, world! 64 -Hello, world! 65 -Hello, world! 66 -Hello, world! 67 -Hello, world! 68 -Hello, world! 69 -Hello, world! 70 -Hello, world! 71 -Hello, world! 72 -Hello, world! 73 -Hello, world! 74 -Hello, world! 75 -Hello, world! 76 -Hello, world! 77 -Hello, world! 78 -Hello, world! 79 -Hello, world! 80 -Hello, world! 81 -Hello, world! 82 -Hello, world! 83 -Hello, world! 84 -Hello, world! 85 -Hello, world! 86 -Hello, world! 87 -Hello, world! 88 -Hello, world! 89 -Hello, world! 90 -Hello, world! 91 -Hello, world! 92 -Hello, world! 93 -Hello, world! 94 -Hello, world! 95 -Hello, world! 96 -Hello, world! 97 -Hello, world! 98 -Hello, world! 99 diff --git a/tests/testdata/run/stdout_write_all.ts b/tests/testdata/run/stdout_write_all.ts deleted file mode 100644 index cfb2981e4..000000000 --- a/tests/testdata/run/stdout_write_all.ts +++ /dev/null @@ -1,13 +0,0 @@ -const encoder = new TextEncoder(); - -const pending = []; - -// do this a bunch of times to ensure it doesn't race -// and everything happens in order -for (let i = 0; i < 100; i++) { - pending.push(Deno.stdout.write(encoder.encode("Hello, "))); - pending.push(Deno.stdout.write(encoder.encode(`world! ${i}`))); - pending.push(Deno.stdout.write(encoder.encode("\n"))); -} - -await Promise.all(pending); diff --git a/tests/testdata/run/stdout_write_sync_async.out b/tests/testdata/run/stdout_write_sync_async.out deleted file mode 100644 index 91ebda1ca..000000000 --- a/tests/testdata/run/stdout_write_sync_async.out +++ /dev/null @@ -1,200 +0,0 @@ -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello -Hello diff --git a/tests/testdata/run/stdout_write_sync_async.ts b/tests/testdata/run/stdout_write_sync_async.ts deleted file mode 100644 index 648999d8a..000000000 --- a/tests/testdata/run/stdout_write_sync_async.ts +++ /dev/null @@ -1,14 +0,0 @@ -const encoder = new TextEncoder(); -const pending = []; - -for (let i = 0; i < 100; i++) { - // some code that will cause stdout to be written - // synchronously while the async write might be occurring - console.log("Hello"); - pending.push(Deno.stdout.write(encoder.encode("Hello\n"))); - if (i % 10) { - await new Promise((resolve) => setTimeout(resolve, 0)); - } -} - -await Promise.all(pending); diff --git a/tests/testdata/run/swc_syntax_error.ts b/tests/testdata/run/swc_syntax_error.ts deleted file mode 100644 index 991ca9214..000000000 --- a/tests/testdata/run/swc_syntax_error.ts +++ /dev/null @@ -1,4 +0,0 @@ -// deno-fmt-ignore-file -for await (const req of s) { - let something: -} diff --git a/tests/testdata/run/swc_syntax_error.ts.out b/tests/testdata/run/swc_syntax_error.ts.out deleted file mode 100644 index 81b0c1949..000000000 --- a/tests/testdata/run/swc_syntax_error.ts.out +++ /dev/null @@ -1,4 +0,0 @@ -error: The module's source code could not be parsed: Unexpected token `}`. Expected an identifier, void, yield, null, await, break, a string literal, a numeric literal, true, false, `, -, import, this, typeof, {, [, ( at [WILDCARD]syntax_error.ts:4:1 - - } - ~ diff --git a/tests/testdata/run/test_and_bench_in_run.js b/tests/testdata/run/test_and_bench_in_run.js deleted file mode 100644 index 108ae937a..000000000 --- a/tests/testdata/run/test_and_bench_in_run.js +++ /dev/null @@ -1,5 +0,0 @@ -Deno.test(function foo() { -}); - -Deno.bench(function bar() { -}); diff --git a/tests/testdata/run/tls.out b/tests/testdata/run/tls.out deleted file mode 100644 index c8e8a135c..000000000 --- a/tests/testdata/run/tls.out +++ /dev/null @@ -1 +0,0 @@ -DONE diff --git a/tests/testdata/run/tls_connecttls.js b/tests/testdata/run/tls_connecttls.js deleted file mode 100644 index 07b361f9c..000000000 --- a/tests/testdata/run/tls_connecttls.js +++ /dev/null @@ -1,65 +0,0 @@ -import { assert, assertEquals } from "@std/assert"; -import { BufReader, BufWriter } from "@std/io"; -import { TextProtoReader } from "./textproto.ts"; - -const encoder = new TextEncoder(); -const decoder = new TextDecoder(); - -const { promise, resolve } = Promise.withResolvers(); -const hostname = "localhost"; -const port = 3505; - -const listener = Deno.listenTls({ - hostname, - port, - cert: Deno.readTextFileSync("./tls/localhost.crt"), - key: Deno.readTextFileSync("./tls/localhost.key"), -}); - -const response = encoder.encode( - "HTTP/1.1 200 OK\r\nContent-Length: 12\r\n\r\nHello World\n", -); - -listener.accept().then( - async (conn) => { - assert(conn.remoteAddr != null); - assert(conn.localAddr != null); - await conn.write(response); - // TODO(bartlomieju): this might be a bug - setTimeout(() => { - conn.close(); - resolve(); - }, 0); - }, -); - -const conn = await Deno.connectTls({ - hostname, - port, -}); -const w = new BufWriter(conn); -const r = new BufReader(conn); -const body = `GET / HTTP/1.1\r\nHost: ${hostname}:${port}\r\n\r\n`; -const writeResult = await w.write(encoder.encode(body)); -assertEquals(body.length, writeResult); -await w.flush(); -const tpr = new TextProtoReader(r); -const statusLine = await tpr.readLine(); -assert(statusLine !== null, `line must be read: ${String(statusLine)}`); -const m = statusLine.match(/^(.+?) (.+?) (.+?)$/); -assert(m !== null, "must be matched"); -const [_, proto, status, ok] = m; -assertEquals(proto, "HTTP/1.1"); -assertEquals(status, "200"); -assertEquals(ok, "OK"); -const headers = await tpr.readMimeHeader(); -assert(headers !== null); -const contentLength = parseInt(headers.get("content-length")); -const bodyBuf = new Uint8Array(contentLength); -await r.readFull(bodyBuf); -assertEquals(decoder.decode(bodyBuf), "Hello World\n"); -conn.close(); -listener.close(); -await promise; - -console.log("DONE"); diff --git a/tests/testdata/run/tls_starttls.js b/tests/testdata/run/tls_starttls.js deleted file mode 100644 index 8e7ac03ee..000000000 --- a/tests/testdata/run/tls_starttls.js +++ /dev/null @@ -1,64 +0,0 @@ -import { assert, assertEquals } from "@std/assert"; -import { BufReader } from "@std/io/buf-reader"; -import { BufWriter } from "@std/io/buf-writer"; -import { TextProtoReader } from "./textproto.ts"; - -const encoder = new TextEncoder(); -const decoder = new TextDecoder(); - -const { promise, resolve } = Promise.withResolvers(); -const hostname = "localhost"; -const port = 3504; - -const listener = Deno.listenTls({ - hostname, - port, - cert: Deno.readTextFileSync("./tls/localhost.crt"), - key: Deno.readTextFileSync("./tls/localhost.key"), -}); - -const response = encoder.encode( - "HTTP/1.1 200 OK\r\nContent-Length: 12\r\n\r\nHello World\n", -); - -listener.accept().then( - async (conn) => { - assert(conn.remoteAddr != null); - assert(conn.localAddr != null); - await conn.write(response); - // TODO(bartlomieju): this might be a bug - setTimeout(() => { - conn.close(); - resolve(); - }, 0); - }, -); - -let conn = await Deno.connect({ hostname, port }); -conn = await Deno.startTls(conn, { hostname }); -const w = new BufWriter(conn); -const r = new BufReader(conn); -const body = `GET / HTTP/1.1\r\nHost: ${hostname}:${port}\r\n\r\n`; -const writeResult = await w.write(encoder.encode(body)); -assertEquals(body.length, writeResult); -await w.flush(); -const tpr = new TextProtoReader(r); -const statusLine = await tpr.readLine(); -assert(statusLine !== null, `line must be read: ${String(statusLine)}`); -const m = statusLine.match(/^(.+?) (.+?) (.+?)$/); -assert(m !== null, "must be matched"); -const [_, proto, status, ok] = m; -assertEquals(proto, "HTTP/1.1"); -assertEquals(status, "200"); -assertEquals(ok, "OK"); -const headers = await tpr.readMimeHeader(); -assert(headers !== null); -const contentLength = parseInt(headers.get("content-length")); -const bodyBuf = new Uint8Array(contentLength); -await r.readFull(bodyBuf); -assertEquals(decoder.decode(bodyBuf), "Hello World\n"); -conn.close(); -listener.close(); -await promise; - -console.log("DONE"); diff --git a/tests/testdata/run/top_level_await/circular.js b/tests/testdata/run/top_level_await/circular.js deleted file mode 100644 index ff2964b6a..000000000 --- a/tests/testdata/run/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/testdata/run/top_level_await/circular.out b/tests/testdata/run/top_level_await/circular.out deleted file mode 100644 index c88978961..000000000 --- a/tests/testdata/run/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/testdata/run/top_level_await/loop.js b/tests/testdata/run/top_level_await/loop.js deleted file mode 100644 index 415db5ec7..000000000 --- a/tests/testdata/run/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/testdata/run/top_level_await/loop.out b/tests/testdata/run/top_level_await/loop.out deleted file mode 100644 index 1bdffbf66..000000000 --- a/tests/testdata/run/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/testdata/run/top_level_await/nested.out b/tests/testdata/run/top_level_await/nested.out deleted file mode 100644 index 8a1218a10..000000000 --- a/tests/testdata/run/top_level_await/nested.out +++ /dev/null @@ -1,5 +0,0 @@ -1 -2 -3 -4 -5 diff --git a/tests/testdata/run/top_level_await/nested/a.js b/tests/testdata/run/top_level_await/nested/a.js deleted file mode 100644 index 74837d4ba..000000000 --- a/tests/testdata/run/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/testdata/run/top_level_await/nested/b.js b/tests/testdata/run/top_level_await/nested/b.js deleted file mode 100644 index 3bd241b50..000000000 --- a/tests/testdata/run/top_level_await/nested/b.js +++ /dev/null @@ -1 +0,0 @@ -console.log(3); diff --git a/tests/testdata/run/top_level_await/nested/main.js b/tests/testdata/run/top_level_await/nested/main.js deleted file mode 100644 index ed46a4717..000000000 --- a/tests/testdata/run/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/testdata/run/top_level_await/order.js b/tests/testdata/run/top_level_await/order.js deleted file mode 100644 index 30659cdfb..000000000 --- a/tests/testdata/run/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/testdata/run/top_level_await/order.out b/tests/testdata/run/top_level_await/order.out deleted file mode 100644 index 4cc27858c..000000000 --- a/tests/testdata/run/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/testdata/run/top_level_await/top_level_await.js b/tests/testdata/run/top_level_await/top_level_await.js deleted file mode 100644 index ea319ea12..000000000 --- a/tests/testdata/run/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/testdata/run/top_level_await/top_level_await.out b/tests/testdata/run/top_level_await/top_level_await.out deleted file mode 100644 index 4b65d15fe..000000000 --- a/tests/testdata/run/top_level_await/top_level_await.out +++ /dev/null @@ -1,3 +0,0 @@ -Hello world! - -write 12 diff --git a/tests/testdata/run/top_level_await/top_level_await.ts b/tests/testdata/run/top_level_await/top_level_await.ts deleted file mode 100644 index 8d47ceb21..000000000 --- a/tests/testdata/run/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/testdata/run/top_level_await/top_level_for_await.js b/tests/testdata/run/top_level_await/top_level_for_await.js deleted file mode 100644 index a330f6c71..000000000 --- a/tests/testdata/run/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/testdata/run/top_level_await/top_level_for_await.out b/tests/testdata/run/top_level_await/top_level_for_await.out deleted file mode 100644 index 4539bbf2d..000000000 --- a/tests/testdata/run/top_level_await/top_level_for_await.out +++ /dev/null @@ -1,3 +0,0 @@ -0 -1 -2 diff --git a/tests/testdata/run/top_level_await/top_level_for_await.ts b/tests/testdata/run/top_level_await/top_level_for_await.ts deleted file mode 100644 index 9179322d7..000000000 --- a/tests/testdata/run/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/testdata/run/top_level_await/unresolved.js b/tests/testdata/run/top_level_await/unresolved.js deleted file mode 100644 index 231a8cd63..000000000 --- a/tests/testdata/run/top_level_await/unresolved.js +++ /dev/null @@ -1 +0,0 @@ -await new Promise(() => {}); diff --git a/tests/testdata/run/top_level_await/unresolved.out b/tests/testdata/run/top_level_await/unresolved.out deleted file mode 100644 index 1f4ea5d38..000000000 --- a/tests/testdata/run/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/testdata/run/ts_import_from_js/deps.js b/tests/testdata/run/ts_import_from_js/deps.js deleted file mode 100644 index 746b5cf6b..000000000 --- a/tests/testdata/run/ts_import_from_js/deps.js +++ /dev/null @@ -1,2 +0,0 @@ -import "../005_more_imports.ts"; -export { printHello } from "http://localhost:4545/subdir/mod2.ts"; diff --git a/tests/testdata/run/ts_import_from_js/main.js b/tests/testdata/run/ts_import_from_js/main.js deleted file mode 100644 index 32d6c29a1..000000000 --- a/tests/testdata/run/ts_import_from_js/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { printHello } from "./deps.js"; -printHello(); -console.log("success"); diff --git a/tests/testdata/run/ts_import_from_js/main.out b/tests/testdata/run/ts_import_from_js/main.out deleted file mode 100644 index e1d7a869f..000000000 --- a/tests/testdata/run/ts_import_from_js/main.out +++ /dev/null @@ -1,3 +0,0 @@ -Hello -Hello -success diff --git a/tests/testdata/run/ts_type_imports.ts b/tests/testdata/run/ts_type_imports.ts deleted file mode 100644 index 73c779156..000000000 --- a/tests/testdata/run/ts_type_imports.ts +++ /dev/null @@ -1,5 +0,0 @@ -// deno-lint-ignore-file - -type Foo = import("./ts_type_imports_foo.ts").Foo; - -const foo: Foo = new Map(); diff --git a/tests/testdata/run/ts_type_imports.ts.out b/tests/testdata/run/ts_type_imports.ts.out deleted file mode 100644 index 3972d6a97..000000000 --- a/tests/testdata/run/ts_type_imports.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -Check [WILDCARD]ts_type_imports.ts -error: TS2322 [ERROR]: Type 'Map' is not assignable to type 'Foo'. - Type 'string' is not assignable to type 'number'. -const foo: Foo = new Map(); - ~~~ - at [WILDCARD]ts_type_imports.ts:5:7 diff --git a/tests/testdata/run/ts_type_only_import.ts b/tests/testdata/run/ts_type_only_import.ts deleted file mode 100644 index 53e114373..000000000 --- a/tests/testdata/run/ts_type_only_import.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./ts_type_only_import.d.ts"; diff --git a/tests/testdata/run/ts_type_only_import.ts.out b/tests/testdata/run/ts_type_only_import.ts.out deleted file mode 100644 index 42852cd26..000000000 --- a/tests/testdata/run/ts_type_only_import.ts.out +++ /dev/null @@ -1 +0,0 @@ -Check file://[WILDCARD]/ts_type_only_import.ts diff --git a/tests/testdata/run/tsx_imports/Component.tsx b/tests/testdata/run/tsx_imports/Component.tsx deleted file mode 100644 index c466a28ca..000000000 --- a/tests/testdata/run/tsx_imports/Component.tsx +++ /dev/null @@ -1 +0,0 @@ -import "../046_jsx_test.tsx"; diff --git a/tests/testdata/run/tsx_imports/tsx_imports.ts b/tests/testdata/run/tsx_imports/tsx_imports.ts deleted file mode 100644 index 44ba10b7a..000000000 --- a/tests/testdata/run/tsx_imports/tsx_imports.ts +++ /dev/null @@ -1 +0,0 @@ -import "./Component.tsx"; diff --git a/tests/testdata/run/tsx_imports/tsx_imports.ts.out b/tests/testdata/run/tsx_imports/tsx_imports.ts.out deleted file mode 100644 index 1f8b10d32..000000000 --- a/tests/testdata/run/tsx_imports/tsx_imports.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -Check [WILDCARD]tsx_imports.ts -{ factory: [Function: View], props: null, children: [] } diff --git a/tests/testdata/run/type_definitions.ts b/tests/testdata/run/type_definitions.ts deleted file mode 100644 index 594842721..000000000 --- a/tests/testdata/run/type_definitions.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file - -// @deno-types="../type_definitions/foo.d.ts" -import { foo } from "../type_definitions/foo.js"; -// @deno-types="../type_definitions/fizz.d.ts" -import "../type_definitions/fizz.js"; - -import * as qat from "../type_definitions/qat.ts"; - -console.log(foo); -console.log(fizz); -console.log(qat.qat); diff --git a/tests/testdata/run/type_definitions.ts.out b/tests/testdata/run/type_definitions.ts.out deleted file mode 100644 index b4fa88c50..000000000 --- a/tests/testdata/run/type_definitions.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -[WILDCARD]foo -fizz -qat diff --git a/tests/testdata/run/type_definitions_for_export.ts b/tests/testdata/run/type_definitions_for_export.ts deleted file mode 100644 index 1f17b4962..000000000 --- a/tests/testdata/run/type_definitions_for_export.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { foo } from "./export_type_def.ts"; - -function bar(a: number) { - console.log(a); -} - -bar(foo); diff --git a/tests/testdata/run/type_definitions_for_export.ts.out b/tests/testdata/run/type_definitions_for_export.ts.out deleted file mode 100644 index 8f1240bc7..000000000 --- a/tests/testdata/run/type_definitions_for_export.ts.out +++ /dev/null @@ -1,5 +0,0 @@ -Check [WILDCARD]type_definitions_for_export.ts -error: TS2345 [ERROR]: Argument of type 'string' is not assignable to parameter of type 'number'. -bar(foo); - ~~~ - at [WILDCARD]type_definitions_for_export.ts:7:5 diff --git a/tests/testdata/run/type_directives_01.ts b/tests/testdata/run/type_directives_01.ts deleted file mode 100644 index 2129d90b4..000000000 --- a/tests/testdata/run/type_directives_01.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as foo from "http://localhost:4545/xTypeScriptTypes.js"; - -console.log(foo.foo); diff --git a/tests/testdata/run/type_directives_01.ts.out b/tests/testdata/run/type_directives_01.ts.out deleted file mode 100644 index 466218a96..000000000 --- a/tests/testdata/run/type_directives_01.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -[WILDCARD] -DEBUG TS - host.getSourceFile("http://localhost:4545/xTypeScriptTypes.d.ts", Latest) -[WILDCARD] \ No newline at end of file diff --git a/tests/testdata/run/type_directives_02.ts b/tests/testdata/run/type_directives_02.ts deleted file mode 100644 index 0c59346e2..000000000 --- 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 b064483b4..000000000 --- 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/type_headers_deno_types.ts b/tests/testdata/run/type_headers_deno_types.ts deleted file mode 100644 index 197ac1801..000000000 --- a/tests/testdata/run/type_headers_deno_types.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Following import uses two distinct ways to provide types: - * - X-TypeScript-Types headers - * - @deno-types directive - * - * Because "@deno-types" directive must be placed by user explicitly it - * should have higher precedence than type header. - * - * This is verified by providing conflicting type declaration - * depending on a way. There should be no TS error, otherwise - * it means that wrong type declarations are used (from X-TypeScript-Types) - * header. - */ - -// @deno-types="http://localhost:4545/run/type_headers_deno_types.foo.d.ts" -import { foo } from "http://localhost:4545/run/type_headers_deno_types.foo.js"; - -foo("hello"); diff --git a/tests/testdata/run/type_headers_deno_types.ts.out b/tests/testdata/run/type_headers_deno_types.ts.out deleted file mode 100644 index 798f98311..000000000 --- a/tests/testdata/run/type_headers_deno_types.ts.out +++ /dev/null @@ -1,5 +0,0 @@ -Download http://[WILDCARD]:4545/run/type_headers_deno_types.foo.js -Download http://[WILDCARD]:4545/run/type_headers_deno_types.foo.d.ts -Download http://[WILDCARD]:4545/run/type_headers_deno_types.d.ts -Check [WILDCARD]/type_headers_deno_types.ts -hello diff --git a/tests/testdata/run/unbuffered_stderr.ts b/tests/testdata/run/unbuffered_stderr.ts deleted file mode 100644 index 0f1d2a999..000000000 --- a/tests/testdata/run/unbuffered_stderr.ts +++ /dev/null @@ -1 +0,0 @@ -Deno.stderr.write(new TextEncoder().encode("x")); diff --git a/tests/testdata/run/unbuffered_stderr.ts.out b/tests/testdata/run/unbuffered_stderr.ts.out deleted file mode 100644 index c1b0730e0..000000000 --- a/tests/testdata/run/unbuffered_stderr.ts.out +++ /dev/null @@ -1 +0,0 @@ -x \ No newline at end of file diff --git a/tests/testdata/run/unbuffered_stdout.ts b/tests/testdata/run/unbuffered_stdout.ts deleted file mode 100644 index 9f1e07a97..000000000 --- a/tests/testdata/run/unbuffered_stdout.ts +++ /dev/null @@ -1 +0,0 @@ -Deno.stdout.write(new TextEncoder().encode("a")); diff --git a/tests/testdata/run/unbuffered_stdout.ts.out b/tests/testdata/run/unbuffered_stdout.ts.out deleted file mode 100644 index 2e65efe2a..000000000 --- a/tests/testdata/run/unbuffered_stdout.ts.out +++ /dev/null @@ -1 +0,0 @@ -a \ No newline at end of file diff --git a/tests/testdata/run/unhandled_rejection.ts b/tests/testdata/run/unhandled_rejection.ts deleted file mode 100644 index 388583434..000000000 --- a/tests/testdata/run/unhandled_rejection.ts +++ /dev/null @@ -1,13 +0,0 @@ -globalThis.addEventListener("unhandledrejection", (e) => { - console.log("unhandled rejection at:", e.promise, "reason:", e.reason); - e.preventDefault(); -}); - -class Foo { - constructor() { - Promise.reject(new Error("bar not available")); - } -} - -new Foo(); -Promise.reject(); diff --git a/tests/testdata/run/unhandled_rejection.ts.out b/tests/testdata/run/unhandled_rejection.ts.out deleted file mode 100644 index 6ab1667dc..000000000 --- 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_dynamic_import/import.ts b/tests/testdata/run/unhandled_rejection_dynamic_import/import.ts deleted file mode 100644 index b490f2c20..000000000 --- a/tests/testdata/run/unhandled_rejection_dynamic_import/import.ts +++ /dev/null @@ -1,5 +0,0 @@ -globalThis.addEventListener("unhandledrejection", () => { - console.log("hey"); -}); -console.log("---"); -Promise.reject(); diff --git a/tests/testdata/run/unhandled_rejection_dynamic_import/main.ts b/tests/testdata/run/unhandled_rejection_dynamic_import/main.ts deleted file mode 100644 index 244d84467..000000000 --- a/tests/testdata/run/unhandled_rejection_dynamic_import/main.ts +++ /dev/null @@ -1 +0,0 @@ -await import("./import.ts"); diff --git a/tests/testdata/run/unhandled_rejection_dynamic_import/main.ts.out b/tests/testdata/run/unhandled_rejection_dynamic_import/main.ts.out deleted file mode 100644 index f44c6d2ff..000000000 --- a/tests/testdata/run/unhandled_rejection_dynamic_import/main.ts.out +++ /dev/null @@ -1,3 +0,0 @@ ---- -hey -error: Uncaught (in promise) undefined diff --git a/tests/testdata/run/unhandled_rejection_dynamic_import2/import.ts b/tests/testdata/run/unhandled_rejection_dynamic_import2/import.ts deleted file mode 100644 index f84297afd..000000000 --- a/tests/testdata/run/unhandled_rejection_dynamic_import2/import.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - a: "a", -}; diff --git a/tests/testdata/run/unhandled_rejection_dynamic_import2/main.ts b/tests/testdata/run/unhandled_rejection_dynamic_import2/main.ts deleted file mode 100644 index 3da2e1d19..000000000 --- a/tests/testdata/run/unhandled_rejection_dynamic_import2/main.ts +++ /dev/null @@ -1,21 +0,0 @@ -globalThis.addEventListener("unhandledrejection", (e) => { - console.log("unhandled rejection", e.reason); - e.preventDefault(); -}); - -const dummyImport = (await import("./import.ts")).default; - -let a = new Promise((resolve, reject) => { - throw "errA"; -}); - -let i = 0; -while (true) { - await new Promise((resolve) => setTimeout(resolve, 100)); - i++; - console.log("running..."); - - if (i > 3) { - break; - } -} diff --git a/tests/testdata/run/unhandled_rejection_dynamic_import2/main.ts.out b/tests/testdata/run/unhandled_rejection_dynamic_import2/main.ts.out deleted file mode 100644 index 0a913a4b5..000000000 --- a/tests/testdata/run/unhandled_rejection_dynamic_import2/main.ts.out +++ /dev/null @@ -1,5 +0,0 @@ -unhandled rejection errA -running... -running... -running... -running... diff --git a/tests/testdata/run/unhandled_rejection_sync_error.ts b/tests/testdata/run/unhandled_rejection_sync_error.ts deleted file mode 100644 index 0dabb1cb7..000000000 --- a/tests/testdata/run/unhandled_rejection_sync_error.ts +++ /dev/null @@ -1,6 +0,0 @@ -globalThis.addEventListener("unhandledrejection", (e) => { - console.log("unhandled rejection at:", e.promise, "reason:", e.reason); - e.preventDefault(); -}); - -throw new Error("boom!"); 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 e178373f0..000000000 --- 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/unsafe_proto/main.js b/tests/testdata/run/unsafe_proto/main.js deleted file mode 100644 index eb95c55a0..000000000 --- a/tests/testdata/run/unsafe_proto/main.js +++ /dev/null @@ -1,5 +0,0 @@ -console.log(Object.hasOwn(Object.prototype, "__proto__")); - -new Worker(import.meta.resolve("./worker.js"), { - type: "module", -}); diff --git a/tests/testdata/run/unsafe_proto/main.out b/tests/testdata/run/unsafe_proto/main.out deleted file mode 100644 index 4b095fd0f..000000000 --- a/tests/testdata/run/unsafe_proto/main.out +++ /dev/null @@ -1,2 +0,0 @@ -false -false diff --git a/tests/testdata/run/unsafe_proto/main_with_unsafe_proto_flag.out b/tests/testdata/run/unsafe_proto/main_with_unsafe_proto_flag.out deleted file mode 100644 index bb101b641..000000000 --- a/tests/testdata/run/unsafe_proto/main_with_unsafe_proto_flag.out +++ /dev/null @@ -1,2 +0,0 @@ -true -true diff --git a/tests/testdata/run/unsafe_proto/worker.js b/tests/testdata/run/unsafe_proto/worker.js deleted file mode 100644 index b22bc8713..000000000 --- a/tests/testdata/run/unsafe_proto/worker.js +++ /dev/null @@ -1,2 +0,0 @@ -console.log(Object.hasOwn(Object.prototype, "__proto__")); -close(); diff --git a/tests/testdata/run/unstable_broadcast_channel.disabled.out b/tests/testdata/run/unstable_broadcast_channel.disabled.out deleted file mode 100644 index 775866352..000000000 --- a/tests/testdata/run/unstable_broadcast_channel.disabled.out +++ /dev/null @@ -1,2 +0,0 @@ -main undefined -worker undefined diff --git a/tests/testdata/run/unstable_broadcast_channel.enabled.out b/tests/testdata/run/unstable_broadcast_channel.enabled.out deleted file mode 100644 index b3701ce44..000000000 --- a/tests/testdata/run/unstable_broadcast_channel.enabled.out +++ /dev/null @@ -1,2 +0,0 @@ -main [class BroadcastChannel extends EventTarget] -worker [class BroadcastChannel extends EventTarget] diff --git a/tests/testdata/run/unstable_broadcast_channel.js b/tests/testdata/run/unstable_broadcast_channel.js deleted file mode 100644 index b8576aa22..000000000 --- a/tests/testdata/run/unstable_broadcast_channel.js +++ /dev/null @@ -1,10 +0,0 @@ -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/testdata/run/unstable_cron.disabled.out b/tests/testdata/run/unstable_cron.disabled.out deleted file mode 100644 index 775866352..000000000 --- a/tests/testdata/run/unstable_cron.disabled.out +++ /dev/null @@ -1,2 +0,0 @@ -main undefined -worker undefined diff --git a/tests/testdata/run/unstable_cron.enabled.out b/tests/testdata/run/unstable_cron.enabled.out deleted file mode 100644 index d18304f1f..000000000 --- a/tests/testdata/run/unstable_cron.enabled.out +++ /dev/null @@ -1,2 +0,0 @@ -main [Function: cron] -worker [Function: cron] diff --git a/tests/testdata/run/unstable_cron.js b/tests/testdata/run/unstable_cron.js deleted file mode 100644 index 3114f6e55..000000000 --- a/tests/testdata/run/unstable_cron.js +++ /dev/null @@ -1,10 +0,0 @@ -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/testdata/run/unstable_kv.disabled.out b/tests/testdata/run/unstable_kv.disabled.out deleted file mode 100644 index 0d8ac4410..000000000 --- a/tests/testdata/run/unstable_kv.disabled.out +++ /dev/null @@ -1,10 +0,0 @@ -main undefined -main undefined -main undefined -main undefined -main undefined -worker undefined -worker undefined -worker undefined -worker undefined -worker undefined diff --git a/tests/testdata/run/unstable_kv.enabled.out b/tests/testdata/run/unstable_kv.enabled.out deleted file mode 100644 index a1356cefc..000000000 --- a/tests/testdata/run/unstable_kv.enabled.out +++ /dev/null @@ -1,10 +0,0 @@ -main [class AtomicOperation] -main [class Kv] -main [class KvListIterator extends Object] -main [class KvU64] -main [AsyncFunction: openKv] -worker [class AtomicOperation] -worker [class Kv] -worker [class KvListIterator extends Object] -worker [class KvU64] -worker [AsyncFunction: openKv] diff --git a/tests/testdata/run/unstable_kv.js b/tests/testdata/run/unstable_kv.js deleted file mode 100644 index 17c0e05aa..000000000 --- a/tests/testdata/run/unstable_kv.js +++ /dev/null @@ -1,14 +0,0 @@ -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/testdata/run/unstable_net.disabled.out b/tests/testdata/run/unstable_net.disabled.out deleted file mode 100644 index 3562f72fd..000000000 --- a/tests/testdata/run/unstable_net.disabled.out +++ /dev/null @@ -1,4 +0,0 @@ -main undefined -main undefined -worker undefined -worker undefined diff --git a/tests/testdata/run/unstable_net.enabled.out b/tests/testdata/run/unstable_net.enabled.out deleted file mode 100644 index 8b86637f3..000000000 --- a/tests/testdata/run/unstable_net.enabled.out +++ /dev/null @@ -1,4 +0,0 @@ -main [Function: listenDatagram] -main [class WebSocketStream] -worker [Function: listenDatagram] -worker [class WebSocketStream] diff --git a/tests/testdata/run/unstable_net.js b/tests/testdata/run/unstable_net.js deleted file mode 100644 index 4492b202b..000000000 --- a/tests/testdata/run/unstable_net.js +++ /dev/null @@ -1,11 +0,0 @@ -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/testdata/run/unstable_worker.ts b/tests/testdata/run/unstable_worker.ts deleted file mode 100644 index d111d2c7e..000000000 --- a/tests/testdata/run/unstable_worker.ts +++ /dev/null @@ -1,6 +0,0 @@ -const w = new Worker( - import.meta.resolve("../workers/worker_unstable.ts"), - { type: "module", name: "Unstable Worker" }, -); - -w.postMessage({}); diff --git a/tests/testdata/run/unstable_worker.ts.out b/tests/testdata/run/unstable_worker.ts.out deleted file mode 100644 index 182dc58a4..000000000 --- a/tests/testdata/run/unstable_worker.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -[Function: query] -[Function: consoleSize] diff --git a/tests/testdata/run/unstable_worker_options.disabled.out b/tests/testdata/run/unstable_worker_options.disabled.out deleted file mode 100644 index ba50ca539..000000000 --- a/tests/testdata/run/unstable_worker_options.disabled.out +++ /dev/null @@ -1 +0,0 @@ -Unstable API 'Worker.deno.permissions'. The `--unstable-worker-options` flag must be provided. diff --git a/tests/testdata/run/unstable_worker_options.enabled.out b/tests/testdata/run/unstable_worker_options.enabled.out deleted file mode 100644 index 57a52b019..000000000 --- a/tests/testdata/run/unstable_worker_options.enabled.out +++ /dev/null @@ -1,2 +0,0 @@ -main ok -worker ok diff --git a/tests/testdata/run/unstable_worker_options.js b/tests/testdata/run/unstable_worker_options.js deleted file mode 100644 index 213eb3ee6..000000000 --- a/tests/testdata/run/unstable_worker_options.js +++ /dev/null @@ -1,19 +0,0 @@ -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/testdata/run/unsupported_dynamic_import_scheme.out b/tests/testdata/run/unsupported_dynamic_import_scheme.out deleted file mode 100644 index c708fced4..000000000 --- a/tests/testdata/run/unsupported_dynamic_import_scheme.out +++ /dev/null @@ -1,7 +0,0 @@ -error: Uncaught (in promise) TypeError: Unsupported scheme "xxx" for module "xxx:". Supported schemes: [ - "data", - "blob", - "file", - "http", - "https", -] diff --git a/tests/testdata/run/v8_flags.js b/tests/testdata/run/v8_flags.js deleted file mode 100644 index f7999c4af..000000000 --- a/tests/testdata/run/v8_flags.js +++ /dev/null @@ -1 +0,0 @@ -console.log(typeof gc); diff --git a/tests/testdata/run/v8_flags.js.out b/tests/testdata/run/v8_flags.js.out deleted file mode 100644 index e2dbde096..000000000 --- a/tests/testdata/run/v8_flags.js.out +++ /dev/null @@ -1 +0,0 @@ -function diff --git a/tests/testdata/run/v8_flags_unrecognized.out b/tests/testdata/run/v8_flags_unrecognized.out deleted file mode 100644 index 56e70f830..000000000 --- a/tests/testdata/run/v8_flags_unrecognized.out +++ /dev/null @@ -1,5 +0,0 @@ -error: V8 did not recognize flag '--foo' -error: V8 did not recognize flag 'bar' -error: V8 did not recognize flag '-baz' - -For a list of V8 flags, use '--v8-flags=--help' diff --git a/tests/testdata/run/v8_help.out b/tests/testdata/run/v8_help.out deleted file mode 100644 index 006d73557..000000000 --- a/tests/testdata/run/v8_help.out +++ /dev/null @@ -1,4 +0,0 @@ -[WILDCARD] -Options: -[WILDCARD] - --trace-gc [WILDCARD] diff --git a/tests/testdata/run/wasm.ts b/tests/testdata/run/wasm.ts deleted file mode 100644 index 96b5fdffc..000000000 --- a/tests/testdata/run/wasm.ts +++ /dev/null @@ -1,16 +0,0 @@ -// deno-fmt-ignore -const wasmCode = new Uint8Array([ - 0, 97, 115, 109, 1, 0, 0, 0, 1, 133, 128, 128, 128, 0, 1, 96, 0, 1, 127, - 3, 130, 128, 128, 128, 0, 1, 0, 4, 132, 128, 128, 128, 0, 1, 112, 0, 0, - 5, 131, 128, 128, 128, 0, 1, 0, 1, 6, 129, 128, 128, 128, 0, 0, 7, 145, - 128, 128, 128, 0, 2, 6, 109, 101, 109, 111, 114, 121, 2, 0, 4, 109, 97, - 105, 110, 0, 0, 10, 138, 128, 128, 128, 0, 1, 132, 128, 128, 128, 0, 0, - 65, 42, 11 - ]); - -const wasmModule = new WebAssembly.Module(wasmCode); - -const wasmInstance = new WebAssembly.Instance(wasmModule); - -const main = wasmInstance.exports.main as CallableFunction; -console.log(main().toString()); diff --git a/tests/testdata/run/wasm.ts.out b/tests/testdata/run/wasm.ts.out deleted file mode 100644 index d81cc0710..000000000 --- a/tests/testdata/run/wasm.ts.out +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/testdata/run/wasm_async.js b/tests/testdata/run/wasm_async.js deleted file mode 100644 index 837460ae9..000000000 --- a/tests/testdata/run/wasm_async.js +++ /dev/null @@ -1,27 +0,0 @@ -// The following blob can be created by taking the following s-expr and pass -// it through wat2wasm. -// (module -// (func $add (param $a i32) (param $b i32) (result i32) -// local.get $a -// local.get $b -// i32.add) -// (export "add" (func $add)) -// ) -// deno-fmt-ignore -const bytes = new Uint8Array([ - 0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x07, 0x01, 0x60, - 0x02, 0x7f, 0x7f, 0x01, 0x7f, 0x03, 0x02, 0x01, 0x00, 0x07, 0x07, 0x01, - 0x03, 0x61, 0x64, 0x64, 0x00, 0x00, 0x0a, 0x09, 0x01, 0x07, 0x00, 0x20, - 0x00, 0x20, 0x01, 0x6a, 0x0b -]); - -async function main() { - const wasm = await WebAssembly.instantiate(bytes); - const result = wasm.instance.exports.add(1, 3); - console.log("1 + 3 =", result); - if (result != 4) { - throw Error("bad"); - } -} - -main(); diff --git a/tests/testdata/run/wasm_async.out b/tests/testdata/run/wasm_async.out deleted file mode 100644 index 5cdf17de7..000000000 --- a/tests/testdata/run/wasm_async.out +++ /dev/null @@ -1 +0,0 @@ -1 + 3 = 4 diff --git a/tests/testdata/run/wasm_shared.out b/tests/testdata/run/wasm_shared.out deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/testdata/run/wasm_shared.ts b/tests/testdata/run/wasm_shared.ts deleted file mode 100644 index b713385d5..000000000 --- a/tests/testdata/run/wasm_shared.ts +++ /dev/null @@ -1,6 +0,0 @@ -const memory = new WebAssembly.Memory({ - initial: 1, - maximum: 10, - shared: true, -}); -console.assert(memory.buffer instanceof SharedArrayBuffer); diff --git a/tests/testdata/run/wasm_streaming_panic_test.js b/tests/testdata/run/wasm_streaming_panic_test.js deleted file mode 100644 index ec017592f..000000000 --- a/tests/testdata/run/wasm_streaming_panic_test.js +++ /dev/null @@ -1,3 +0,0 @@ -// https://github.com/denoland/deno/issues/13917 - -WebAssembly.instantiateStreaming(Response.error()); diff --git a/tests/testdata/run/wasm_streaming_panic_test.js.out b/tests/testdata/run/wasm_streaming_panic_test.js.out deleted file mode 100644 index 4ec523f1d..000000000 --- a/tests/testdata/run/wasm_streaming_panic_test.js.out +++ /dev/null @@ -1,2 +0,0 @@ -error: Uncaught (in promise) TypeError: Invalid WebAssembly content type - at handleWasmStreaming (ext:deno_fetch/26_fetch.js:[WILDCARD]) diff --git a/tests/testdata/run/wasm_unreachable.js b/tests/testdata/run/wasm_unreachable.js deleted file mode 100644 index d6a4f59db..000000000 --- a/tests/testdata/run/wasm_unreachable.js +++ /dev/null @@ -1,9 +0,0 @@ -// WebAssembly module containing a single function with an unreachable instruction -const binary = await Deno.readFile("./assets/unreachable.wasm"); - -const module = new WebAssembly.Module(binary); -const instance = new WebAssembly.Instance(module); - -// Compare the stack trace with wasm_url.js, which compiles the WASM module with -// streaming APIs. -instance.exports.unreachable(); diff --git a/tests/testdata/run/wasm_unreachable.out b/tests/testdata/run/wasm_unreachable.out deleted file mode 100644 index c213097ab..000000000 --- a/tests/testdata/run/wasm_unreachable.out +++ /dev/null @@ -1,3 +0,0 @@ -error: Uncaught[WILDCARD] RuntimeError: unreachable - at (wasm://wasm/d1c677ea:1:41) - at [WILDCARD]/wasm_unreachable.js:[WILDCARD] diff --git a/tests/testdata/run/wasm_url.js b/tests/testdata/run/wasm_url.js deleted file mode 100644 index 71686ef7e..000000000 --- a/tests/testdata/run/wasm_url.js +++ /dev/null @@ -1,8 +0,0 @@ -const module = await WebAssembly.compileStreaming( - fetch("http://localhost:4545/assets/unreachable.wasm"), -); -const instance = new WebAssembly.Instance(module); - -// Compare the stack trace with wasm_unreachable.js, which compiles the WASM -// module with synchronous APIs. -instance.exports.unreachable(); diff --git a/tests/testdata/run/wasm_url.out b/tests/testdata/run/wasm_url.out deleted file mode 100644 index ae3bf491a..000000000 --- a/tests/testdata/run/wasm_url.out +++ /dev/null @@ -1,3 +0,0 @@ -error: Uncaught (in promise) RuntimeError: unreachable - at (http://localhost:4545/assets/unreachable.wasm:1:41) - at [WILDCARD]/wasm_url.js:[WILDCARD] diff --git a/tests/testdata/run/weakref.ts b/tests/testdata/run/weakref.ts deleted file mode 100644 index 47c3985fe..000000000 --- a/tests/testdata/run/weakref.ts +++ /dev/null @@ -1 +0,0 @@ -console.log(WeakRef, FinalizationRegistry); diff --git a/tests/testdata/run/weakref.ts.out b/tests/testdata/run/weakref.ts.out deleted file mode 100644 index 32bafcf2d..000000000 --- a/tests/testdata/run/weakref.ts.out +++ /dev/null @@ -1 +0,0 @@ -[Function: WeakRef] [Function: FinalizationRegistry] diff --git a/tests/testdata/run/webstorage/serialization.ts b/tests/testdata/run/webstorage/serialization.ts deleted file mode 100644 index f125331bb..000000000 --- a/tests/testdata/run/webstorage/serialization.ts +++ /dev/null @@ -1,4 +0,0 @@ -globalThis.sessionStorage.setItem("hello", "deno"); - -console.log(globalThis.localStorage); -console.log(globalThis.sessionStorage); diff --git a/tests/testdata/run/webstorage/serialization.ts.out b/tests/testdata/run/webstorage/serialization.ts.out deleted file mode 100644 index 4d80032f0..000000000 --- a/tests/testdata/run/webstorage/serialization.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -Storage {[WILDCARD] -Storage { hello: "deno", length: 1 } diff --git a/tests/testdata/run/with_config/auto_discovery_log.out b/tests/testdata/run/with_config/auto_discovery_log.out deleted file mode 100644 index 1a25eb9a7..000000000 --- a/tests/testdata/run/with_config/auto_discovery_log.out +++ /dev/null @@ -1,4 +0,0 @@ -DEBUG RS - [WILDCARD] - Config file found at '[WILDCARD]deno.jsonc' -[WILDCARD] -ok -[WILDCARD] diff --git a/tests/testdata/run/with_config/deno.jsonc b/tests/testdata/run/with_config/deno.jsonc deleted file mode 100644 index 9017fac30..000000000 --- a/tests/testdata/run/with_config/deno.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - // type settings for frontend dev - "compilerOptions": { - "lib": ["esnext", "dom"] - } -} diff --git a/tests/testdata/run/with_config/frontend_work.ts b/tests/testdata/run/with_config/frontend_work.ts deleted file mode 100644 index 783af44e4..000000000 --- a/tests/testdata/run/with_config/frontend_work.ts +++ /dev/null @@ -1,4 +0,0 @@ -function _main() { - console.log(document); -} -console.log("ok"); diff --git a/tests/testdata/run/with_config/no_auto_discovery.out b/tests/testdata/run/with_config/no_auto_discovery.out deleted file mode 100644 index 59339ebe5..000000000 --- a/tests/testdata/run/with_config/no_auto_discovery.out +++ /dev/null @@ -1,4 +0,0 @@ -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 diff --git a/tests/testdata/run/with_config/server_side_work.ts b/tests/testdata/run/with_config/server_side_work.ts deleted file mode 100644 index 12db2ab05..000000000 --- a/tests/testdata/run/with_config/server_side_work.ts +++ /dev/null @@ -1,2 +0,0 @@ -const _ = Deno.build.os; -console.log("ok"); 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 44098a2d8..000000000 --- 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/tests/testdata/run/worker_close_in_wasm_reactions.js b/tests/testdata/run/worker_close_in_wasm_reactions.js deleted file mode 100644 index 95f34e944..000000000 --- a/tests/testdata/run/worker_close_in_wasm_reactions.js +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -// 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. - -new Worker( - import.meta.resolve("../workers/close_in_wasm_reactions.js"), - { type: "module" }, -); diff --git a/tests/testdata/run/worker_close_in_wasm_reactions.js.out b/tests/testdata/run/worker_close_in_wasm_reactions.js.out deleted file mode 100644 index 904613dae..000000000 --- a/tests/testdata/run/worker_close_in_wasm_reactions.js.out +++ /dev/null @@ -1,2 +0,0 @@ -Error: CompileError: WebAssembly.compile(): reached end while decoding length @+10 - at file:///[WILDCARD]/close_in_wasm_reactions.js:18:13 diff --git a/tests/testdata/run/worker_close_nested.js b/tests/testdata/run/worker_close_nested.js deleted file mode 100644 index 37b6ed9c9..000000000 --- a/tests/testdata/run/worker_close_nested.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -// Test that closing a worker which has living child workers will automatically -// close the children. - -console.log("Starting the main thread"); - -const worker = new Worker( - import.meta.resolve("../workers/close_nested_parent.js"), - { type: "module" }, -); - -setTimeout(() => { - console.log("About to close"); - worker.postMessage({}); - - // Keep the process running for another two seconds, to make sure there's no - // output from the child worker. - setTimeout(() => {}, 2000); -}, 1000); diff --git a/tests/testdata/run/worker_close_nested.js.out b/tests/testdata/run/worker_close_nested.js.out deleted file mode 100644 index 496bc6251..000000000 --- a/tests/testdata/run/worker_close_nested.js.out +++ /dev/null @@ -1,5 +0,0 @@ -Starting the main thread -Starting the parent worker -Starting the child worker -About to close -Closing diff --git a/tests/testdata/run/worker_close_race.js b/tests/testdata/run/worker_close_race.js deleted file mode 100644 index 1da832425..000000000 --- a/tests/testdata/run/worker_close_race.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -// https://github.com/denoland/deno/issues/11416 -// Test for a race condition between a worker's `close()` and the main thread's -// `Worker.prototype.terminate()`. - -const worker = new Worker( - import.meta.resolve("../workers/close_race_worker.js"), - { type: "module" }, -); - -worker.onmessage = () => { - worker.terminate(); -}; diff --git a/tests/testdata/run/worker_close_race.js.out b/tests/testdata/run/worker_close_race.js.out deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/testdata/run/worker_drop_handle_race.js b/tests/testdata/run/worker_drop_handle_race.js deleted file mode 100644 index 731a36964..000000000 --- a/tests/testdata/run/worker_drop_handle_race.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -// https://github.com/denoland/deno/issues/11342 -// Test for a panic that happens when the main thread's event loop finishes -// running while the worker's event loop is still spinning. - -// 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"), - { type: "module" }, -); diff --git a/tests/testdata/run/worker_drop_handle_race.js.out b/tests/testdata/run/worker_drop_handle_race.js.out deleted file mode 100644 index 0820f164e..000000000 --- a/tests/testdata/run/worker_drop_handle_race.js.out +++ /dev/null @@ -1,7 +0,0 @@ -error: Uncaught (in worker "") Error - throw new Error(); - ^ - at [WILDCARD]/workers/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/testdata/run/worker_drop_handle_race_terminate.js b/tests/testdata/run/worker_drop_handle_race_terminate.js deleted file mode 100644 index 7c4e0b109..000000000 --- a/tests/testdata/run/worker_drop_handle_race_terminate.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -// Test that the panic in https://github.com/denoland/deno/issues/11342 does not -// happen when calling worker.terminate() after fixing -// https://github.com/denoland/deno/issues/13705 - -function getCodeBlobUrl(code) { - const blob = new Blob([code], { type: "text/javascript" }); - return URL.createObjectURL(blob); -} - -const WORKER2 = getCodeBlobUrl(` - console.log("Worker 2"); - self.postMessage(undefined); - - // We sleep synchronously for slightly under 2 seconds in order to make sure - // that worker 1 has closed, and that this worker's thread finishes normally - // rather than being killed (which happens 2 seconds after calling terminate). - Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 1800); - console.log("Finished sleeping in worker 2"); -`); - -const WORKER1 = getCodeBlobUrl(` - console.log("Worker 1"); - const worker = new Worker(${JSON.stringify(WORKER2)}, { type: "module" }); - - worker.addEventListener("message", () => { - console.log("Terminating"); - worker.terminate(); - self.close(); - }); -`); - -new Worker(WORKER1, { type: "module" }); - -// Don't kill the process before worker 2 is finished. -setTimeout(() => {}, 3000); diff --git a/tests/testdata/run/worker_drop_handle_race_terminate.js.out b/tests/testdata/run/worker_drop_handle_race_terminate.js.out deleted file mode 100644 index 5ec1e7ff8..000000000 --- a/tests/testdata/run/worker_drop_handle_race_terminate.js.out +++ /dev/null @@ -1,4 +0,0 @@ -Worker 1 -Worker 2 -Terminating -Finished sleeping in worker 2 diff --git a/tests/testdata/run/worker_event_handler_test.js b/tests/testdata/run/worker_event_handler_test.js deleted file mode 100644 index a91b0ec0b..000000000 --- a/tests/testdata/run/worker_event_handler_test.js +++ /dev/null @@ -1,5 +0,0 @@ -const w = new Worker( - import.meta.resolve("../workers/worker_event_handlers.js"), - { type: "module" }, -); -w.postMessage({}); diff --git a/tests/testdata/run/worker_event_handler_test.js.out b/tests/testdata/run/worker_event_handler_test.js.out deleted file mode 100644 index b3eed7f6c..000000000 --- a/tests/testdata/run/worker_event_handler_test.js.out +++ /dev/null @@ -1,11 +0,0 @@ -Target from self.onmessage: [object DedicatedWorkerGlobalScope] -Target from message event listener: [object DedicatedWorkerGlobalScope] -Arguments from self.onerror: [ - "Uncaught Error: Some error message", - "[WILDCARD]/worker_event_handlers.js", - 9, - 9, - Error: Some error message - at [WILDCARD] -] -Is event canceled?: true diff --git a/tests/testdata/run/worker_message_before_close.js b/tests/testdata/run/worker_message_before_close.js deleted file mode 100644 index 569388b9b..000000000 --- a/tests/testdata/run/worker_message_before_close.js +++ /dev/null @@ -1,26 +0,0 @@ -const messagesReceived = new Set(); - -for (let i = 0; i < 4; i++) { - const worker = new Worker( - import.meta.resolve("../workers/message_before_close.js"), - { type: "module", name: String(i) }, - ); - - worker.addEventListener("message", () => { - messagesReceived.add(i); - if (messagesReceived.size == 4) { - console.log("received all 4 responses from the workers"); - } - }); - - worker.postMessage({}); -} - -globalThis.addEventListener("unload", () => { - if (messagesReceived.size !== 4) { - console.log( - "received only %d responses from the workers", - messagesReceived.size, - ); - } -}); diff --git a/tests/testdata/run/worker_message_before_close.js.out b/tests/testdata/run/worker_message_before_close.js.out deleted file mode 100644 index f91b7b4cb..000000000 --- a/tests/testdata/run/worker_message_before_close.js.out +++ /dev/null @@ -1 +0,0 @@ -received all 4 responses from the workers -- cgit v1.2.3 From 5088b25f2315fa45e912377356a89ba2a44dbcda Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Wed, 6 Nov 2024 06:26:46 +0000 Subject: feat(lsp): auto-import completions from byonm dependencies (#26680) --- tests/integration/lsp_tests.rs | 185 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 165 insertions(+), 20 deletions(-) (limited to 'tests') diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 56221a026..af5f9de23 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", }, ], }, -- cgit v1.2.3 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: fix(fmt): don't use self-closing tags in HTML (#26754) Closes https://github.com/denoland/deno/issues/26748 --- tests/specs/fmt/html/well_formatted.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/specs/fmt/html/well_formatted.html b/tests/specs/fmt/html/well_formatted.html index c0c06cd9b..7af705c04 100644 --- a/tests/specs/fmt/html/well_formatted.html +++ b/tests/specs/fmt/html/well_formatted.html @@ -1,4 +1,4 @@ -
content
+
content