diff options
Diffstat (limited to 'tests/testdata/run')
499 files changed, 11 insertions, 3822 deletions
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<never> { - 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 = () => <div class="deno">land</div>; -console.log(<View />); 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 = () => <div class="deno">land</div>; -console.log(<View />); 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/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; +}; 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<never> => { - 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 <U+FEFF> -// 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 --- a/tests/testdata/run/check_js_points_to_ts/foo.d.ts +++ /dev/null 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 --- a/tests/testdata/run/empty.ts +++ /dev/null diff --git a/tests/testdata/run/env_file.out b/tests/testdata/run/env_file.out deleted file mode 100644 index 54a0bf25d..000000000 --- a/tests/testdata/run/env_file.out +++ /dev/null @@ -1,4 +0,0 @@ -BAR -ANOTHER_BAR -First Line -Second Line diff --git a/tests/testdata/run/env_file.ts b/tests/testdata/run/env_file.ts deleted file mode 100644 index 48488ce72..000000000 --- a/tests/testdata/run/env_file.ts +++ /dev/null @@ -1,3 +0,0 @@ -console.log(Deno.env.get("FOO")); -console.log(Deno.env.get("ANOTHER_FOO")); -console.log(Deno.env.get("MULTILINE")); diff --git a/tests/testdata/run/env_file_missing.out b/tests/testdata/run/env_file_missing.out deleted file mode 100644 index f50c1789e..000000000 --- a/tests/testdata/run/env_file_missing.out +++ /dev/null @@ -1,4 +0,0 @@ -Warning The `--env-file` flag was used, but the environment file specified 'missing' was not found. -undefined -undefined -undefined 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<never> => { - 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 <ref *1> -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/extension_import.ts.out b/tests/testdata/run/extension_import.ts.out index 88039a9ce..0ff656a9c 100644 --- a/tests/testdata/run/extension_import.ts.out +++ b/tests/testdata/run/extension_import.ts.out @@ -1,8 +1,9 @@ -error: Unsupported scheme "ext" for module "ext:runtime/01_errors.js". Supported schemes: [ - "data", - "blob", - "file", - "http", - "https", -] +error: Unsupported scheme "ext" for module "ext:runtime/01_errors.js". Supported schemes: + - "blob" + - "data" + - "file" + - "http" + - "https" + - "jsr" + - "npm" at [WILDCARD]/extension_import.ts:1:8 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 @@ -/// <reference types="../subdir/emittable.d.ts" /> - -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 <div>Hello Deno!</div>\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 <A></A>; -} 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 <A></A>; -} 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 <h1>hello</h1>; -} 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 ( - <div> - <a href="#">foo</a> - <p>hello</p> - <img src="#" alt="" /> - </div> - ); -} 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 @@ -/// <reference types="./subdir/types.d.ts" /> - -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 @@ -/// <reference types="./nonexistent.d.ts" /> -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 @@ -/// <reference types="http://localhost:4545/subdir/types.d.ts" /> - -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 { <rejected> 1 } -Added catch handler to the promise -rejectionhandled 1 Promise { <rejected> 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 <anonymous> ([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<number> { - 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 <anonymous> ([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<string, string>(); 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<string, string>' is not assignable to type 'Foo'. - Type 'string' is not assignable to type 'number'. -const foo: Foo = new Map<string, string>(); - ~~~ - 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 { - <rejected> 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 { <rejected> 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 { - <rejected> 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/warn_on_deprecated_api/main.js b/tests/testdata/run/warn_on_deprecated_api/main.js deleted file mode 100644 index 8811df78d..000000000 --- a/tests/testdata/run/warn_on_deprecated_api/main.js +++ /dev/null @@ -1,34 +0,0 @@ -import { runEcho as runEcho2 } from "http://localhost:4545/run/warn_on_deprecated_api/mod.ts"; - -// @ts-ignore `Deno.run()` was soft-removed in Deno 2. -const p = Deno.run({ - cmd: [ - Deno.execPath(), - "eval", - "console.log('hello world')", - ], -}); -await p.status(); -p.close(); - -async function runEcho() { - // @ts-ignore `Deno.run()` was soft-removed in Deno 2. - const p = Deno.run({ - cmd: [ - Deno.execPath(), - "eval", - "console.log('hello world')", - ], - }); - await p.status(); - p.close(); -} - -await runEcho(); -await runEcho(); - -for (let i = 0; i < 10; i++) { - await runEcho(); -} - -await runEcho2(); diff --git a/tests/testdata/run/warn_on_deprecated_api/main.out b/tests/testdata/run/warn_on_deprecated_api/main.out deleted file mode 100644 index ef85a6f99..000000000 --- a/tests/testdata/run/warn_on_deprecated_api/main.out +++ /dev/null @@ -1,15 +0,0 @@ -Download http://localhost:4545/run/warn_on_deprecated_api/mod.ts -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world diff --git a/tests/testdata/run/warn_on_deprecated_api/main.verbose.out b/tests/testdata/run/warn_on_deprecated_api/main.verbose.out deleted file mode 100644 index e17562eef..000000000 --- a/tests/testdata/run/warn_on_deprecated_api/main.verbose.out +++ /dev/null @@ -1,60 +0,0 @@ -Download http://localhost:4545/run/warn_on_deprecated_api/mod.ts - -See the Deno 1 to 2 Migration Guide for more information at https://docs.deno.com/runtime/manual/advanced/migrate_deprecations - -Stack trace: - at [WILDCARD]warn_on_deprecated_api/main.js:3:16 - -hint: Use "Deno.Command()" API instead. - -hello world - -See the Deno 1 to 2 Migration Guide for more information at https://docs.deno.com/runtime/manual/advanced/migrate_deprecations - -Stack trace: - at runEcho ([WILDCARD]warn_on_deprecated_api/main.js:14:18) - at [WILDCARD]warn_on_deprecated_api/main.js:25:7 - -hint: Use "Deno.Command()" API instead. - -hello world - -See the Deno 1 to 2 Migration Guide for more information at https://docs.deno.com/runtime/manual/advanced/migrate_deprecations - -Stack trace: - at runEcho ([WILDCARD]warn_on_deprecated_api/main.js:14:18) - at [WILDCARD]warn_on_deprecated_api/main.js:26:7 - -hint: Use "Deno.Command()" API instead. - -hello world - -See the Deno 1 to 2 Migration Guide for more information at https://docs.deno.com/runtime/manual/advanced/migrate_deprecations - -Stack trace: - at runEcho ([WILDCARD]warn_on_deprecated_api/main.js:14:18) - at [WILDCARD]warn_on_deprecated_api/main.js:29:9 - -hint: Use "Deno.Command()" API instead. - -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world - -See the Deno 1 to 2 Migration Guide for more information at https://docs.deno.com/runtime/manual/advanced/migrate_deprecations - -Stack trace: - at runEcho (http://localhost:4545/run/warn_on_deprecated_api/mod.ts:2:18) - at [WILDCARD]warn_on_deprecated_api/main.js:32:7 - -hint: Use "Deno.Command()" API instead. -hint: It appears this API is used by a remote dependency. Try upgrading to the latest version of that dependency. - -hello world diff --git a/tests/testdata/run/warn_on_deprecated_api/main_disabled_env.out b/tests/testdata/run/warn_on_deprecated_api/main_disabled_env.out deleted file mode 100644 index ef85a6f99..000000000 --- a/tests/testdata/run/warn_on_deprecated_api/main_disabled_env.out +++ /dev/null @@ -1,15 +0,0 @@ -Download http://localhost:4545/run/warn_on_deprecated_api/mod.ts -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world diff --git a/tests/testdata/run/warn_on_deprecated_api/main_disabled_flag.out b/tests/testdata/run/warn_on_deprecated_api/main_disabled_flag.out deleted file mode 100644 index ce3755d16..000000000 --- a/tests/testdata/run/warn_on_deprecated_api/main_disabled_flag.out +++ /dev/null @@ -1,14 +0,0 @@ -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world -hello world diff --git a/tests/testdata/run/warn_on_deprecated_api/mod.ts b/tests/testdata/run/warn_on_deprecated_api/mod.ts deleted file mode 100644 index f74632b2c..000000000 --- a/tests/testdata/run/warn_on_deprecated_api/mod.ts +++ /dev/null @@ -1,11 +0,0 @@ -export async function runEcho() { - const p = Deno.run({ - cmd: [ - Deno.execPath(), - "eval", - "console.log('hello world')", - ], - }); - await p.status(); - p.close(); -} 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 --- a/tests/testdata/run/wasm_shared.out +++ /dev/null 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 <anonymous> (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 <anonymous> (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 --- a/tests/testdata/run/worker_close_race.js.out +++ /dev/null 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 |