diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-09-16 21:05:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-16 21:05:14 -0400 |
commit | 9cfdc60a23e6418d4780dc3ebd6266248555bb03 (patch) | |
tree | 19ca25fa733318024d1f36724a2c20741e649012 /tests | |
parent | 02cb34d8ad320360c800b9af7b941990c48b9742 (diff) |
Move integration tests to //cli/tests/ (#2964)
This ensures the deno executable is properly created before running the integration tests.
Also allows deno_cli to be used as a lib. Docs are now properly generated: https://docs.rs/deno_cli/0.18.4/deno_cli/
Towards #2933
Prep for #2955
Diffstat (limited to 'tests')
217 files changed, 1 insertions, 1169 deletions
@@ -0,0 +1 @@ +cli/tests
\ No newline at end of file diff --git a/tests/001_hello.js b/tests/001_hello.js deleted file mode 100644 index accefceba..000000000 --- a/tests/001_hello.js +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello World"); diff --git a/tests/001_hello.js.out b/tests/001_hello.js.out deleted file mode 100644 index 557db03de..000000000 --- a/tests/001_hello.js.out +++ /dev/null @@ -1 +0,0 @@ -Hello World diff --git a/tests/002_hello.ts b/tests/002_hello.ts deleted file mode 100644 index accefceba..000000000 --- a/tests/002_hello.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello World"); diff --git a/tests/002_hello.ts.out b/tests/002_hello.ts.out deleted file mode 100644 index 557db03de..000000000 --- a/tests/002_hello.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello World diff --git a/tests/003_relative_import.ts b/tests/003_relative_import.ts deleted file mode 100644 index 01d5d7faa..000000000 --- a/tests/003_relative_import.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { printHello } from "./subdir/print_hello.ts"; - -printHello(); diff --git a/tests/003_relative_import.ts.out b/tests/003_relative_import.ts.out deleted file mode 100644 index e965047ad..000000000 --- a/tests/003_relative_import.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/tests/004_set_timeout.ts b/tests/004_set_timeout.ts deleted file mode 100644 index 58f899ee3..000000000 --- a/tests/004_set_timeout.ts +++ /dev/null @@ -1,11 +0,0 @@ -setTimeout((): void => { - console.log("World"); -}, 10); - -console.log("Hello"); - -const id = setTimeout((): void => { - console.log("Not printed"); -}, 10000); - -clearTimeout(id); diff --git a/tests/004_set_timeout.ts.out b/tests/004_set_timeout.ts.out deleted file mode 100644 index f9264f7fb..000000000 --- a/tests/004_set_timeout.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -Hello -World diff --git a/tests/005_more_imports.ts b/tests/005_more_imports.ts deleted file mode 100644 index 52dd1df7b..000000000 --- a/tests/005_more_imports.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { returnsHi, returnsFoo2, printHello3 } from "./subdir/mod1.ts"; - -printHello3(); - -if (returnsHi() !== "Hi") { - throw Error("Unexpected"); -} - -if (returnsFoo2() !== "Foo") { - throw Error("Unexpected"); -} diff --git a/tests/005_more_imports.ts.out b/tests/005_more_imports.ts.out deleted file mode 100644 index e965047ad..000000000 --- a/tests/005_more_imports.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/tests/006_url_imports.ts b/tests/006_url_imports.ts deleted file mode 100644 index b2c7db270..000000000 --- a/tests/006_url_imports.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { printHello } from "http://localhost:4545/tests/subdir/mod2.ts"; -printHello(); -console.log("success"); diff --git a/tests/006_url_imports.ts.out b/tests/006_url_imports.ts.out deleted file mode 100644 index 989ce33e9..000000000 --- a/tests/006_url_imports.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -Hello -success diff --git a/tests/012_async.ts b/tests/012_async.ts deleted file mode 100644 index 1f1822c04..000000000 --- a/tests/012_async.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Check that we can use the async keyword. -async function main(): Promise<void> { - await new Promise( - (resolve): void => { - console.log("2"); - setTimeout(resolve, 100); - } - ); - console.log("3"); -} - -console.log("1"); -main(); diff --git a/tests/012_async.ts.out b/tests/012_async.ts.out deleted file mode 100644 index 01e79c32a..000000000 --- a/tests/012_async.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -1 -2 -3 diff --git a/tests/013_dynamic_import.ts b/tests/013_dynamic_import.ts deleted file mode 100644 index 6bbce3132..000000000 --- a/tests/013_dynamic_import.ts +++ /dev/null @@ -1,15 +0,0 @@ -(async (): Promise<void> => { - const { returnsHi, returnsFoo2, printHello3 } = await import( - "./subdir/mod1.ts" - ); - - printHello3(); - - if (returnsHi() !== "Hi") { - throw Error("Unexpected"); - } - - if (returnsFoo2() !== "Foo") { - throw Error("Unexpected"); - } -})(); diff --git a/tests/013_dynamic_import.ts.out b/tests/013_dynamic_import.ts.out deleted file mode 100644 index e965047ad..000000000 --- a/tests/013_dynamic_import.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/tests/014_duplicate_import.ts b/tests/014_duplicate_import.ts deleted file mode 100644 index 97864fea7..000000000 --- a/tests/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 (): Promise<void> => { - await import("./subdir/auto_print_hello.ts"); -})(); diff --git a/tests/014_duplicate_import.ts.out b/tests/014_duplicate_import.ts.out deleted file mode 100644 index 4effa19f4..000000000 --- a/tests/014_duplicate_import.ts.out +++ /dev/null @@ -1 +0,0 @@ -hello! diff --git a/tests/015_duplicate_parallel_import.js b/tests/015_duplicate_parallel_import.js deleted file mode 100644 index 37033cfa2..000000000 --- a/tests/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/015_duplicate_parallel_import.js.out b/tests/015_duplicate_parallel_import.js.out deleted file mode 100644 index e965047ad..000000000 --- a/tests/015_duplicate_parallel_import.js.out +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/tests/016_double_await.ts b/tests/016_double_await.ts deleted file mode 100644 index 9b4801567..000000000 --- a/tests/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 (): Promise<void> => { - const currDirInfo = await Deno.stat("."); - const parentDirInfo = await Deno.stat(".."); - console.log(currDirInfo.isDirectory()); - console.log(parentDirInfo.isFile()); -})(); diff --git a/tests/016_double_await.ts.out b/tests/016_double_await.ts.out deleted file mode 100644 index da29283aa..000000000 --- a/tests/016_double_await.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -true -false diff --git a/tests/017_import_redirect.ts b/tests/017_import_redirect.ts deleted file mode 100644 index 1265dd4ed..000000000 --- a/tests/017_import_redirect.ts +++ /dev/null @@ -1,4 +0,0 @@ -// http -> https redirect would happen: -import { printHello } from "http://gist.githubusercontent.com/ry/f12b2aa3409e6b52645bc346a9e22929/raw/79318f239f51d764384a8bded8d7c6a833610dde/print_hello.ts"; - -printHello(); diff --git a/tests/017_import_redirect.ts.out b/tests/017_import_redirect.ts.out deleted file mode 100644 index e965047ad..000000000 --- a/tests/017_import_redirect.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/tests/018_async_catch.ts b/tests/018_async_catch.ts deleted file mode 100644 index 0d034d798..000000000 --- a/tests/018_async_catch.ts +++ /dev/null @@ -1,14 +0,0 @@ -async function fn(): Promise<never> { - throw new Error("message"); -} -async function call(): Promise<void> { - 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((): void => console.log("outer catch")); diff --git a/tests/018_async_catch.ts.out b/tests/018_async_catch.ts.out deleted file mode 100644 index 4fc219973..000000000 --- a/tests/018_async_catch.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -before await fn() -catch -after try-catch diff --git a/tests/019_media_types.ts b/tests/019_media_types.ts deleted file mode 100644 index 5f1f862a0..000000000 --- a/tests/019_media_types.ts +++ /dev/null @@ -1,24 +0,0 @@ -// When run against the test HTTP server, it will serve different media types -// based on the URL containing `.t#.` strings, which exercises the different -// mapping of media types end to end. - -import { loaded as loadedTs1 } from "http://localhost:4545/tests/subdir/mt_text_typescript.t1.ts"; -import { loaded as loadedTs2 } from "http://localhost:4545/tests/subdir/mt_video_vdn.t2.ts"; -import { loaded as loadedTs3 } from "http://localhost:4545/tests/subdir/mt_video_mp2t.t3.ts"; -import { loaded as loadedTs4 } from "http://localhost:4545/tests/subdir/mt_application_x_typescript.t4.ts"; -import { loaded as loadedJs1 } from "http://localhost:4545/tests/subdir/mt_text_javascript.j1.js"; -import { loaded as loadedJs2 } from "http://localhost:4545/tests/subdir/mt_application_ecmascript.j2.js"; -import { loaded as loadedJs3 } from "http://localhost:4545/tests/subdir/mt_text_ecmascript.j3.js"; -import { loaded as loadedJs4 } from "http://localhost:4545/tests/subdir/mt_application_x_javascript.j4.js"; - -console.log( - "success", - loadedTs1, - loadedTs2, - loadedTs3, - loadedTs4, - loadedJs1, - loadedJs2, - loadedJs3, - loadedJs4 -); diff --git a/tests/019_media_types.ts.out b/tests/019_media_types.ts.out deleted file mode 100644 index 7b5fdd44f..000000000 --- a/tests/019_media_types.ts.out +++ /dev/null @@ -1 +0,0 @@ -success true true true true true true true true diff --git a/tests/020_json_modules.ts b/tests/020_json_modules.ts deleted file mode 100644 index fdc85c440..000000000 --- a/tests/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/020_json_modules.ts.out b/tests/020_json_modules.ts.out deleted file mode 100644 index 5d1623e6b..000000000 --- a/tests/020_json_modules.ts.out +++ /dev/null @@ -1 +0,0 @@ -{"foo":{"bar":true,"baz":["qat",1]}} diff --git a/tests/021_mjs_modules.ts b/tests/021_mjs_modules.ts deleted file mode 100644 index 6052b9081..000000000 --- a/tests/021_mjs_modules.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { isMod5 } from "./subdir/mod5.mjs"; -console.log(isMod5); diff --git a/tests/021_mjs_modules.ts.out b/tests/021_mjs_modules.ts.out deleted file mode 100644 index 27ba77dda..000000000 --- a/tests/021_mjs_modules.ts.out +++ /dev/null @@ -1 +0,0 @@ -true diff --git a/tests/022_info_flag_script.out b/tests/022_info_flag_script.out deleted file mode 100644 index 519e7cf6b..000000000 --- a/tests/022_info_flag_script.out +++ /dev/null @@ -1,14 +0,0 @@ -local: [WILDCARD]019_media_types.ts -type: TypeScript -compiled: [WILDCARD].js -map: [WILDCARD].js.map -deps: -http://127.0.0.1:4545/tests/019_media_types.ts - ├── http://localhost:4545/tests/subdir/mt_text_typescript.t1.ts - ├── http://localhost:4545/tests/subdir/mt_video_vdn.t2.ts - ├── http://localhost:4545/tests/subdir/mt_video_mp2t.t3.ts - ├── http://localhost:4545/tests/subdir/mt_application_x_typescript.t4.ts - ├── http://localhost:4545/tests/subdir/mt_text_javascript.j1.js - ├── http://localhost:4545/tests/subdir/mt_application_ecmascript.j2.js - ├── http://localhost:4545/tests/subdir/mt_text_ecmascript.j3.js - └── http://localhost:4545/tests/subdir/mt_application_x_javascript.j4.js diff --git a/tests/023_no_ext_with_headers b/tests/023_no_ext_with_headers deleted file mode 100644 index 87951d835..000000000 --- a/tests/023_no_ext_with_headers +++ /dev/null @@ -1 +0,0 @@ -console.log("HELLO"); diff --git a/tests/023_no_ext_with_headers.headers.json b/tests/023_no_ext_with_headers.headers.json deleted file mode 100644 index 5b6f09aeb..000000000 --- a/tests/023_no_ext_with_headers.headers.json +++ /dev/null @@ -1 +0,0 @@ -{ "mime_type": "application/javascript" } diff --git a/tests/023_no_ext_with_headers.out b/tests/023_no_ext_with_headers.out deleted file mode 100644 index e427984d4..000000000 --- a/tests/023_no_ext_with_headers.out +++ /dev/null @@ -1 +0,0 @@ -HELLO diff --git a/tests/024_import_no_ext_with_headers.ts b/tests/024_import_no_ext_with_headers.ts deleted file mode 100644 index c8621d0e6..000000000 --- a/tests/024_import_no_ext_with_headers.ts +++ /dev/null @@ -1 +0,0 @@ -import "./023_no_ext_with_headers"; diff --git a/tests/024_import_no_ext_with_headers.ts.out b/tests/024_import_no_ext_with_headers.ts.out deleted file mode 100644 index e427984d4..000000000 --- a/tests/024_import_no_ext_with_headers.ts.out +++ /dev/null @@ -1 +0,0 @@ -HELLO diff --git a/tests/025_hrtime.ts b/tests/025_hrtime.ts deleted file mode 100644 index 417ca6982..000000000 --- a/tests/025_hrtime.ts +++ /dev/null @@ -1,3 +0,0 @@ -console.log(performance.now() % 2 !== 0); -Deno.revokePermission("hrtime"); -console.log(performance.now() % 2 === 0); diff --git a/tests/025_hrtime.ts.out b/tests/025_hrtime.ts.out deleted file mode 100644 index bb101b641..000000000 --- a/tests/025_hrtime.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -true -true diff --git a/tests/025_reload_js_type_error.js b/tests/025_reload_js_type_error.js deleted file mode 100644 index 8d6e4b415..000000000 --- a/tests/025_reload_js_type_error.js +++ /dev/null @@ -1,5 +0,0 @@ -// There was a bug where if this was executed with --reload it would throw a -// type error. -window.test = null; -test = console; -test.log("hello"); diff --git a/tests/025_reload_js_type_error.js.out b/tests/025_reload_js_type_error.js.out deleted file mode 100644 index ce0136250..000000000 --- a/tests/025_reload_js_type_error.js.out +++ /dev/null @@ -1 +0,0 @@ -hello diff --git a/tests/026_redirect_javascript.js b/tests/026_redirect_javascript.js deleted file mode 100644 index 226a6b622..000000000 --- a/tests/026_redirect_javascript.js +++ /dev/null @@ -1,2 +0,0 @@ -import { value } from "http://localhost:4547/redirects/redirect3.js"; -console.log(value); diff --git a/tests/026_redirect_javascript.js.out b/tests/026_redirect_javascript.js.out deleted file mode 100644 index 290864299..000000000 --- a/tests/026_redirect_javascript.js.out +++ /dev/null @@ -1 +0,0 @@ -3 imports 1 diff --git a/tests/026_workers.ts b/tests/026_workers.ts deleted file mode 100644 index f45fc4b77..000000000 --- a/tests/026_workers.ts +++ /dev/null @@ -1,14 +0,0 @@ -const jsWorker = new Worker("./subdir/test_worker.js"); -const tsWorker = new Worker("./subdir/test_worker.ts"); - -tsWorker.onmessage = (e): void => { - console.log("Received ts: " + e.data); -}; - -jsWorker.onmessage = (e): void => { - console.log("Received js: " + e.data); - - tsWorker.postMessage("Hello World"); -}; - -jsWorker.postMessage("Hello World"); diff --git a/tests/026_workers.ts.out b/tests/026_workers.ts.out deleted file mode 100644 index 7538cc867..000000000 --- a/tests/026_workers.ts.out +++ /dev/null @@ -1,4 +0,0 @@ -Hello World -Received js: Hello World -Hello World -Received ts: Hello World diff --git a/tests/027_redirect_typescript.ts b/tests/027_redirect_typescript.ts deleted file mode 100644 index 584341975..000000000 --- a/tests/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/027_redirect_typescript.ts.out b/tests/027_redirect_typescript.ts.out deleted file mode 100644 index 480d4e8ca..000000000 --- a/tests/027_redirect_typescript.ts.out +++ /dev/null @@ -1 +0,0 @@ -4 imports 1 diff --git a/tests/028_args.ts b/tests/028_args.ts deleted file mode 100644 index 51c5cb14b..000000000 --- a/tests/028_args.ts +++ /dev/null @@ -1,5 +0,0 @@ -Deno.args.forEach( - (arg): void => { - console.log(arg); - } -); diff --git a/tests/028_args.ts.out b/tests/028_args.ts.out deleted file mode 100644 index fa36f6e4c..000000000 --- a/tests/028_args.ts.out +++ /dev/null @@ -1,7 +0,0 @@ -028_args.ts ---arg1 -val1 ---arg2=val2 --- -arg3 -arg4 diff --git a/tests/029_eval.out b/tests/029_eval.out deleted file mode 100644 index ce0136250..000000000 --- a/tests/029_eval.out +++ /dev/null @@ -1 +0,0 @@ -hello diff --git a/tests/030_xeval.out b/tests/030_xeval.out deleted file mode 100644 index b1e67221a..000000000 --- a/tests/030_xeval.out +++ /dev/null @@ -1,3 +0,0 @@ -A -B -C diff --git a/tests/031_xeval_replvar.out b/tests/031_xeval_replvar.out deleted file mode 100644 index b1e67221a..000000000 --- a/tests/031_xeval_replvar.out +++ /dev/null @@ -1,3 +0,0 @@ -A -B -C diff --git a/tests/032_xeval_delim.out b/tests/032_xeval_delim.out deleted file mode 100644 index b1e67221a..000000000 --- a/tests/032_xeval_delim.out +++ /dev/null @@ -1,3 +0,0 @@ -A -B -C diff --git a/tests/033_import_map.out b/tests/033_import_map.out deleted file mode 100644 index e9b9160e9..000000000 --- a/tests/033_import_map.out +++ /dev/null @@ -1,7 +0,0 @@ -Hello from remapped moment! -Hello from remapped moment dir! -Hello from remapped lodash! -Hello from remapped lodash dir! -Hello from remapped Vue! -Hello from scoped moment! -Hello from scoped! diff --git a/tests/034_onload.out b/tests/034_onload.out deleted file mode 100644 index 0939be8cd..000000000 --- a/tests/034_onload.out +++ /dev/null @@ -1,7 +0,0 @@ -log from nest_imported script -log from imported script -log from main -got load event in onload function -got load event in event handler (nest_imported) -got load event in event handler (imported) -got load event in event handler (main) diff --git a/tests/034_onload/imported.ts b/tests/034_onload/imported.ts deleted file mode 100644 index 5cf2d7b4c..000000000 --- a/tests/034_onload/imported.ts +++ /dev/null @@ -1,8 +0,0 @@ -import "./nest_imported.ts"; -window.addEventListener( - "load", - (e: Event): void => { - console.log(`got ${e.type} event in event handler (imported)`); - } -); -console.log("log from imported script"); diff --git a/tests/034_onload/main.ts b/tests/034_onload/main.ts deleted file mode 100644 index 68851950a..000000000 --- a/tests/034_onload/main.ts +++ /dev/null @@ -1,14 +0,0 @@ -import "./imported.ts"; - -window.addEventListener( - "load", - (e: Event): void => { - console.log(`got ${e.type} event in event handler (main)`); - } -); - -window.onload = (e: Event): void => { - console.log(`got ${e.type} event in onload function`); -}; - -console.log("log from main"); diff --git a/tests/034_onload/nest_imported.ts b/tests/034_onload/nest_imported.ts deleted file mode 100644 index 2e2bee1d5..000000000 --- a/tests/034_onload/nest_imported.ts +++ /dev/null @@ -1,7 +0,0 @@ -window.addEventListener( - "load", - (e: Event): void => { - console.log(`got ${e.type} event in event handler (nest_imported)`); - } -); -console.log("log from nest_imported script"); diff --git a/tests/034_onload_imported.ts b/tests/034_onload_imported.ts deleted file mode 100644 index d97aabeca..000000000 --- a/tests/034_onload_imported.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("from imported script"); diff --git a/tests/035_no_fetch_flag.out b/tests/035_no_fetch_flag.out deleted file mode 100644 index 0c835830c..000000000 --- a/tests/035_no_fetch_flag.out +++ /dev/null @@ -1 +0,0 @@ -Cannot resolve module "http://127.0.0.1:4545/tests/019_media_types.ts" diff --git a/tests/036_import_map_fetch.out b/tests/036_import_map_fetch.out deleted file mode 100644 index e69de29bb..000000000 --- a/tests/036_import_map_fetch.out +++ /dev/null diff --git a/tests/038_checkjs.js b/tests/038_checkjs.js deleted file mode 100644 index 628d3e376..000000000 --- a/tests/038_checkjs.js +++ /dev/null @@ -1,6 +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 -// eslint-disable-next-line -const foo = new Foo(); diff --git a/tests/038_checkjs.js.out b/tests/038_checkjs.js.out deleted file mode 100644 index deaf77211..000000000 --- a/tests/038_checkjs.js.out +++ /dev/null @@ -1,15 +0,0 @@ -[WILDCARD] -error TS2552: Cannot find name 'consol'. Did you mean 'console'? - -[WILDCARD]tests/038_checkjs.js:2:1 - -2 consol.log("hello world!"); -[WILDCARD] -error TS2552: Cannot find name 'Foo'. Did you mean 'foo'? - -[WILDCARD]tests/038_checkjs.js:6:17 - -6 const foo = new Foo(); -[WILDCARD] -Found 2 errors. -[WILDCARD]
\ No newline at end of file diff --git a/tests/038_checkjs.tsconfig.json b/tests/038_checkjs.tsconfig.json deleted file mode 100644 index 08ac60b6c..000000000 --- a/tests/038_checkjs.tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "checkJs": true - } -} diff --git a/tests/039_worker_deno_ns.ts b/tests/039_worker_deno_ns.ts deleted file mode 100644 index 80ada4343..000000000 --- a/tests/039_worker_deno_ns.ts +++ /dev/null @@ -1,25 +0,0 @@ -const w1 = new Worker("./039_worker_deno_ns/has_ns.ts"); -const w2 = new Worker("./039_worker_deno_ns/no_ns.ts", { - noDenoNamespace: true -}); -let w1MsgCount = 0; -let w2MsgCount = 0; -w1.onmessage = (msg): void => { - console.log(msg.data); - w1MsgCount++; - if (w1MsgCount === 1) { - w1.postMessage("CONTINUE"); - } else { - w2.postMessage("START"); - } -}; -w2.onmessage = (msg): void => { - console.log(msg.data); - w2MsgCount++; - if (w2MsgCount === 1) { - w2.postMessage("CONTINUE"); - } else { - Deno.exit(0); - } -}; -w1.postMessage("START"); diff --git a/tests/039_worker_deno_ns.ts.out b/tests/039_worker_deno_ns.ts.out deleted file mode 100644 index 9b2f90099..000000000 --- a/tests/039_worker_deno_ns.ts.out +++ /dev/null @@ -1,4 +0,0 @@ -has_ns.ts: is window.Deno available: true -[SPAWNED BY has_ns.ts] maybe_ns.ts: is window.Deno available: true -no_ns.ts: is window.Deno available: false -[SPAWNED BY no_ns.ts] maybe_ns.ts: is window.Deno available: false diff --git a/tests/039_worker_deno_ns/has_ns.ts b/tests/039_worker_deno_ns/has_ns.ts deleted file mode 100644 index 8d2507122..000000000 --- a/tests/039_worker_deno_ns/has_ns.ts +++ /dev/null @@ -1,10 +0,0 @@ -onmessage = (msg): void => { - if (msg.data === "START") { - postMessage("has_ns.ts: is window.Deno available: " + !!window.Deno); - } else { - const worker = new Worker("./maybe_ns.ts"); - worker.onmessage = (msg): void => { - postMessage("[SPAWNED BY has_ns.ts] " + msg.data); - }; - } -}; diff --git a/tests/039_worker_deno_ns/maybe_ns.ts b/tests/039_worker_deno_ns/maybe_ns.ts deleted file mode 100644 index 0bcbd1f97..000000000 --- a/tests/039_worker_deno_ns/maybe_ns.ts +++ /dev/null @@ -1 +0,0 @@ -postMessage("maybe_ns.ts: is window.Deno available: " + !!window.Deno); diff --git a/tests/039_worker_deno_ns/no_ns.ts b/tests/039_worker_deno_ns/no_ns.ts deleted file mode 100644 index 0489a00a3..000000000 --- a/tests/039_worker_deno_ns/no_ns.ts +++ /dev/null @@ -1,10 +0,0 @@ -onmessage = (msg): void => { - if (msg.data === "START") { - postMessage("no_ns.ts: is window.Deno available: " + !!window.Deno); - } else { - const worker = new Worker("./maybe_ns.ts"); - worker.onmessage = (msg): void => { - postMessage("[SPAWNED BY no_ns.ts] " + msg.data); - }; - } -}; diff --git a/tests/040_worker_blob.ts b/tests/040_worker_blob.ts deleted file mode 100644 index 1ba4528cf..000000000 --- a/tests/040_worker_blob.ts +++ /dev/null @@ -1,6 +0,0 @@ -const b = new Blob(["console.log('code from Blob'); postMessage('DONE')"]); -const blobURL = URL.createObjectURL(b); -const worker = new Worker(blobURL); -worker.onmessage = (): void => { - Deno.exit(0); -}; diff --git a/tests/040_worker_blob.ts.out b/tests/040_worker_blob.ts.out deleted file mode 100644 index f49b8f3d6..000000000 --- a/tests/040_worker_blob.ts.out +++ /dev/null @@ -1 +0,0 @@ -code from Blob diff --git a/tests/041_dyn_import_eval.out b/tests/041_dyn_import_eval.out deleted file mode 100644 index 1dfef2e98..000000000 --- a/tests/041_dyn_import_eval.out +++ /dev/null @@ -1 +0,0 @@ -{ isMod4: true } diff --git a/tests/041_info_flag.out b/tests/041_info_flag.out deleted file mode 100644 index c384fa892..000000000 --- a/tests/041_info_flag.out +++ /dev/null @@ -1,3 +0,0 @@ -DENO_DIR location: "[WILDCARD]" -Remote modules cache: "[WILDCARD]deps" -TypeScript compiler cache: "[WILDCARD]gen" diff --git a/tests/042_dyn_import_evalcontext.ts b/tests/042_dyn_import_evalcontext.ts deleted file mode 100644 index 124a406d2..000000000 --- a/tests/042_dyn_import_evalcontext.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-ignore -Deno.core.evalContext( - "(async () => console.log(await import('./subdir/mod4.js')))()" -); diff --git a/tests/042_dyn_import_evalcontext.ts.out b/tests/042_dyn_import_evalcontext.ts.out deleted file mode 100644 index 1dfef2e98..000000000 --- a/tests/042_dyn_import_evalcontext.ts.out +++ /dev/null @@ -1 +0,0 @@ -{ isMod4: true } diff --git a/tests/043_xeval_delim2.out b/tests/043_xeval_delim2.out deleted file mode 100644 index 312bdb964..000000000 --- a/tests/043_xeval_delim2.out +++ /dev/null @@ -1,2 +0,0 @@ -!MAD -ADAM! diff --git a/tests/043_xeval_delim2.test b/tests/043_xeval_delim2.test deleted file mode 100644 index 1f009b3a7..000000000 --- a/tests/043_xeval_delim2.test +++ /dev/null @@ -1,3 +0,0 @@ -args: xeval -d MADAM console.log($); -input: !MADMADAMADAM! -output: tests/043_xeval_delim2.out diff --git a/tests/044_bad_resource.test b/tests/044_bad_resource.test deleted file mode 100644 index 8804fde1b..000000000 --- a/tests/044_bad_resource.test +++ /dev/null @@ -1,4 +0,0 @@ -args: run --reload --allow-read tests/044_bad_resource.ts -output: tests/044_bad_resource.ts.out -check_stderr: true -exit_code: 1 diff --git a/tests/044_bad_resource.ts b/tests/044_bad_resource.ts deleted file mode 100644 index d2fc828f0..000000000 --- a/tests/044_bad_resource.ts +++ /dev/null @@ -1,7 +0,0 @@ -async function main(): Promise<void> { - const file = await Deno.open("Cargo.toml", "r"); - file.close(); - await file.seek(10, 0); -} - -main(); diff --git a/tests/044_bad_resource.ts.out b/tests/044_bad_resource.ts.out deleted file mode 100644 index 155e4396f..000000000 --- a/tests/044_bad_resource.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -[WILDCARD] -error: Uncaught BadResource: bad resource id -[WILDCARD]dispatch_json.ts:[WILDCARD] - at DenoError ([WILDCARD]errors.ts:[WILDCARD]) - at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD]) - at sendAsync ([WILDCARD]dispatch_json.ts:[WILDCARD]) diff --git a/tests/README.md b/tests/README.md deleted file mode 100644 index 2bd294932..000000000 --- a/tests/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Integration Tests - -This path contains integration tests. See cli/integration_tests.rs for the -index. - -TODO(ry): Move integration_tests.rs to this directory as described in -https://doc.rust-lang.org/rust-by-example/testing/integration_testing.html diff --git a/tests/async_error.ts b/tests/async_error.ts deleted file mode 100644 index 81c983a50..000000000 --- a/tests/async_error.ts +++ /dev/null @@ -1,8 +0,0 @@ -console.log("hello"); -const foo = async (): Promise<never> => { - console.log("before error"); - throw Error("error"); -}; - -foo(); -console.log("world"); diff --git a/tests/async_error.ts.out b/tests/async_error.ts.out deleted file mode 100644 index d07ba8cfe..000000000 --- a/tests/async_error.ts.out +++ /dev/null @@ -1,11 +0,0 @@ -[WILDCARD]hello -before error -world -error: Uncaught Error: error -[WILDCARD]tests/async_error.ts:4:9 - -4 throw Error("error"); - ^ - - at foo ([WILDCARD]tests/async_error.ts:4:9) - at [WILDCARD]tests/async_error.ts:7:1 diff --git a/tests/badly_formatted.js b/tests/badly_formatted.js deleted file mode 100644 index 17e3e6be0..000000000 --- a/tests/badly_formatted.js +++ /dev/null @@ -1,4 +0,0 @@ - -console.log( - "Hello World" -) diff --git a/tests/badly_formatted_fixed.js b/tests/badly_formatted_fixed.js deleted file mode 100644 index accefceba..000000000 --- a/tests/badly_formatted_fixed.js +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello World"); diff --git a/tests/cat.ts b/tests/cat.ts deleted file mode 100644 index 756238be6..000000000 --- a/tests/cat.ts +++ /dev/null @@ -1,11 +0,0 @@ -const { stdout, open, copy, args } = Deno; - -async function main(): Promise<void> { - for (let i = 1; i < args.length; i++) { - const filename = args[i]; - const file = await open(filename); - await copy(stdout, file); - } -} - -main(); diff --git a/tests/circular1.js b/tests/circular1.js deleted file mode 100644 index 8b2cc4960..000000000 --- a/tests/circular1.js +++ /dev/null @@ -1,2 +0,0 @@ -import "./circular2.js"; -console.log("circular1"); diff --git a/tests/circular1.js.out b/tests/circular1.js.out deleted file mode 100644 index 21f7fd585..000000000 --- a/tests/circular1.js.out +++ /dev/null @@ -1,2 +0,0 @@ -circular2 -circular1 diff --git a/tests/circular2.js b/tests/circular2.js deleted file mode 100644 index 62127e04d..000000000 --- a/tests/circular2.js +++ /dev/null @@ -1,2 +0,0 @@ -import "./circular1.js"; -console.log("circular2"); diff --git a/tests/config.ts b/tests/config.ts deleted file mode 100644 index e08061e77..000000000 --- a/tests/config.ts +++ /dev/null @@ -1,5 +0,0 @@ -const map = new Map<string, { foo: string }>(); - -if (map.get("bar").foo) { - console.log("here"); -} diff --git a/tests/config.ts.out b/tests/config.ts.out deleted file mode 100644 index db5a8340e..000000000 --- a/tests/config.ts.out +++ /dev/null @@ -1,10 +0,0 @@ -[WILDCARD]Unsupported compiler options in "[WILDCARD]config.tsconfig.json" - The following options were ignored: - module, target -[WILDCARD]error TS2532: Object is possibly 'undefined'. - -[WILDCARD]tests/config.ts:3:5 - -3 if (map.get("bar").foo) { - ~~~~~~~~~~~~~~ - diff --git a/tests/config.tsconfig.json b/tests/config.tsconfig.json deleted file mode 100644 index 074d7ac0b..000000000 --- a/tests/config.tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "module": "amd", - "strict": true, - "target": "es5" - } -} diff --git a/tests/echo_server.ts b/tests/echo_server.ts deleted file mode 100644 index 73995eab5..000000000 --- a/tests/echo_server.ts +++ /dev/null @@ -1,11 +0,0 @@ -const { args, listen, copy } = Deno; -const addr = args[1] || "127.0.0.1:4544"; -const listener = listen("tcp", addr); -console.log("listening on", addr); -listener.accept().then( - async (conn): Promise<void> => { - await copy(conn, conn); - conn.close(); - listener.close(); - } -); diff --git a/tests/error_001.ts b/tests/error_001.ts deleted file mode 100644 index f06f80cb4..000000000 --- a/tests/error_001.ts +++ /dev/null @@ -1,9 +0,0 @@ -function foo(): never { - throw Error("bad"); -} - -function bar(): void { - foo(); -} - -bar(); diff --git a/tests/error_001.ts.out b/tests/error_001.ts.out deleted file mode 100644 index 3c7e2828e..000000000 --- a/tests/error_001.ts.out +++ /dev/null @@ -1,9 +0,0 @@ -[WILDCARD]error: Uncaught Error: bad -[WILDCARD]tests/error_001.ts:2:9 - -2 throw Error("bad"); - ^ - - at foo ([WILDCARD]tests/error_001.ts:2:9) - at bar ([WILDCARD]tests/error_001.ts:6:3) - at [WILDCARD]tests/error_001.ts:9:1 diff --git a/tests/error_002.ts b/tests/error_002.ts deleted file mode 100644 index eb66764b7..000000000 --- a/tests/error_002.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { throwsError } from "./subdir/mod1.ts"; - -function foo(): void { - throwsError(); -} - -foo(); diff --git a/tests/error_002.ts.out b/tests/error_002.ts.out deleted file mode 100644 index 292544a33..000000000 --- a/tests/error_002.ts.out +++ /dev/null @@ -1,9 +0,0 @@ -[WILDCARD]error: Uncaught Error: exception from mod1 -[WILDCARD]tests/subdir/mod1.ts:16:9 - -16 throw Error("exception from mod1"); - ^ - - at throwsError ([WILDCARD]tests/subdir/mod1.ts:16:9) - at foo ([WILDCARD]tests/error_002.ts:4:3) - at [WILDCARD]tests/error_002.ts:7:1 diff --git a/tests/error_003_typescript.ts b/tests/error_003_typescript.ts deleted file mode 100644 index 6fb077ea0..000000000 --- a/tests/error_003_typescript.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* eslint-disable */ -interface Value<T> { - f?: (r: T) => any; - v?: string; -} - -interface C<T> { - values?: (r: T) => Array<Value<T>>; -} - -class A<T> { - constructor(private e?: T, public s?: C<T>) {} -} - -class B { - t = "foo"; -} - -var a = new A(new B(), { - values: o => [ - { - v: o.t, - f: x => "bar" - } - ] -}); diff --git a/tests/error_003_typescript.ts.out b/tests/error_003_typescript.ts.out deleted file mode 100644 index f00a935e4..000000000 --- a/tests/error_003_typescript.ts.out +++ /dev/null @@ -1,28 +0,0 @@ -[WILDCARD]error TS2322: Type '(o: T) => { v: any; f: (x: B) => string; }[]' is not assignable to type '(r: B) => Value<B>[]'. - Types of parameters 'o' and 'r' are incompatible. - Type 'B' is not assignable to type 'T'. - 'B' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'. - -[WILDCARD]tests/error_003_typescript.ts:20:3 - -20 values: o => [ - ~~~~~~ - - The expected type comes from property 'values' which is declared here on type 'C<B>' - - [WILDCARD]tests/error_003_typescript.ts:8:3 - - 8 values?: (r: T) => Array<Value<T>>; - ~~~~~~ - - -error TS2339: Property 't' does not exist on type 'T'. - -[WILDCARD]tests/error_003_typescript.ts:22:12 - -22 v: o.t, - ^ - - -Found 2 errors. - diff --git a/tests/error_004_missing_module.ts b/tests/error_004_missing_module.ts deleted file mode 100644 index 24ae52cf7..000000000 --- a/tests/error_004_missing_module.ts +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line -import * as badModule from "./bad-module.ts"; diff --git a/tests/error_004_missing_module.ts.out b/tests/error_004_missing_module.ts.out deleted file mode 100644 index c2a0d0208..000000000 --- a/tests/error_004_missing_module.ts.out +++ /dev/null @@ -1,12 +0,0 @@ -[WILDCARD]error: Uncaught NotFound: Cannot resolve module "[WILDCARD]/bad-module.ts" -[WILDCARD]dispatch_json.ts:[WILDCARD] - at DenoError ([WILDCARD]errors.ts:[WILDCARD]) - at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD]) - at sendSync[WILDCARD] ([WILDCARD]dispatch_json.ts:[WILDCARD]) - at fetchSourceFiles ([WILDCARD]compiler.ts:[WILDCARD]) - at _resolveModules ([WILDCARD]compiler.ts:[WILDCARD]) - at resolveModuleNames ([WILDCARD]compiler.ts:[WILDCARD]) - at resolveModuleNamesWorker ([WILDCARD]typescript.js:[WILDCARD]) - at resolveModuleNamesReusingOldState ([WILDCARD]typescript.js:[WILDCARD]) - at processImportedModules ([WILDCARD]typescript.js:[WILDCARD]) - at findSourceFile ([WILDCARD]typescript.js:[WILDCARD]) diff --git a/tests/error_005_missing_dynamic_import.ts b/tests/error_005_missing_dynamic_import.ts deleted file mode 100644 index 4c09feb5f..000000000 --- a/tests/error_005_missing_dynamic_import.ts +++ /dev/null @@ -1,4 +0,0 @@ -(async (): Promise<void> => { - // eslint-disable-next-line - const badModule = await import("./bad-module.ts"); -})(); diff --git a/tests/error_005_missing_dynamic_import.ts.out b/tests/error_005_missing_dynamic_import.ts.out deleted file mode 100644 index ec1468b09..000000000 --- a/tests/error_005_missing_dynamic_import.ts.out +++ /dev/null @@ -1,12 +0,0 @@ -[WILDCARD]error: Uncaught NotFound: Cannot resolve module "[WILDCARD]/bad-module.ts" -[WILDCARD]dispatch_json.ts:[WILDCARD] - at DenoError ([WILDCARD]errors.ts:[WILDCARD]) - at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD]) - at sendSync[WILDCARD] ([WILDCARD]dispatch_json.ts:[WILDCARD]) - at fetchSourceFiles ([WILDCARD]compiler.ts:[WILDCARD]) - at _resolveModules ([WILDCARD]compiler.ts:[WILDCARD]) - at [WILDCARD]compiler.ts:[WILDCARD] - at resolveModuleNamesWorker ([WILDCARD]) - at resolveModuleNamesReusingOldState ([WILDCARD]typescript.js:[WILDCARD]) - at processImportedModules ([WILDCARD]typescript.js:[WILDCARD]) - at findSourceFile ([WILDCARD]typescript.js:[WILDCARD]) diff --git a/tests/error_006_import_ext_failure.ts b/tests/error_006_import_ext_failure.ts deleted file mode 100644 index 3c32303a3..000000000 --- a/tests/error_006_import_ext_failure.ts +++ /dev/null @@ -1 +0,0 @@ -import "./non-existent"; diff --git a/tests/error_006_import_ext_failure.ts.out b/tests/error_006_import_ext_failure.ts.out deleted file mode 100644 index aa82c10aa..000000000 --- a/tests/error_006_import_ext_failure.ts.out +++ /dev/null @@ -1,12 +0,0 @@ -[WILDCARD]error: Uncaught NotFound: Cannot resolve module "[WILDCARD]/non-existent" -[WILDCARD]dispatch_json.ts:[WILDCARD] - at DenoError ([WILDCARD]errors.ts:[WILDCARD]) - at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD]) - at sendSync[WILDCARD] ([WILDCARD]dispatch_json.ts:[WILDCARD]) - at fetchSourceFiles ([WILDCARD]compiler.ts:[WILDCARD]) - at _resolveModules ([WILDCARD]compiler.ts:[WILDCARD]) - at [WILDCARD]compiler.ts:[WILDCARD] - at resolveModuleNamesWorker ([WILDCARD]) - at resolveModuleNamesReusingOldState ([WILDCARD]typescript.js:[WILDCARD]) - at processImportedModules ([WILDCARD]typescript.js:[WILDCARD]) - at findSourceFile ([WILDCARD]typescript.js:[WILDCARD]) diff --git a/tests/error_007_any.ts b/tests/error_007_any.ts deleted file mode 100644 index 778886fcb..000000000 --- a/tests/error_007_any.ts +++ /dev/null @@ -1 +0,0 @@ -throw {}; diff --git a/tests/error_007_any.ts.out b/tests/error_007_any.ts.out deleted file mode 100644 index 45dbffd04..000000000 --- a/tests/error_007_any.ts.out +++ /dev/null @@ -1 +0,0 @@ -[WILDCARD]error: Uncaught #<Object> diff --git a/tests/error_008_checkjs.js b/tests/error_008_checkjs.js deleted file mode 100644 index 628d3e376..000000000 --- a/tests/error_008_checkjs.js +++ /dev/null @@ -1,6 +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 -// eslint-disable-next-line -const foo = new Foo(); diff --git a/tests/error_008_checkjs.js.out b/tests/error_008_checkjs.js.out deleted file mode 100644 index 5c50e8513..000000000 --- a/tests/error_008_checkjs.js.out +++ /dev/null @@ -1,7 +0,0 @@ -[WILDCARD]error: Uncaught ReferenceError: consol is not defined -[WILDCARD]tests/error_008_checkjs.js:2:1 - -2 consol.log("hello world!"); - ^ - - at [WILDCARD]tests/error_008_checkjs.js:2:1 diff --git a/tests/error_009_missing_js_module.disabled b/tests/error_009_missing_js_module.disabled deleted file mode 100644 index b16bb232b..000000000 --- a/tests/error_009_missing_js_module.disabled +++ /dev/null @@ -1,4 +0,0 @@ -args: tests/error_009_missing_js_module.js -check_stderr: true -exit_code: 1 -output: tests/error_009_missing_js_module.js.out
\ No newline at end of file diff --git a/tests/error_009_missing_js_module.js b/tests/error_009_missing_js_module.js deleted file mode 100644 index e6ca88934..000000000 --- a/tests/error_009_missing_js_module.js +++ /dev/null @@ -1 +0,0 @@ -import "./bad-module.js"; diff --git a/tests/error_009_missing_js_module.js.out b/tests/error_009_missing_js_module.js.out deleted file mode 100644 index edb08da1c..000000000 --- a/tests/error_009_missing_js_module.js.out +++ /dev/null @@ -1 +0,0 @@ -Cannot resolve module "./bad-module.js" from "[WILDCARD]error_009_missing_js_module.js" diff --git a/tests/error_010_nonexistent_arg.disabled b/tests/error_010_nonexistent_arg.disabled deleted file mode 100644 index 9d183107c..000000000 --- a/tests/error_010_nonexistent_arg.disabled +++ /dev/null @@ -1,4 +0,0 @@ -args: not-a-valid-filename.ts -output: tests/error_010_nonexistent_arg.out -exit_code: 1 -check_stderr: true diff --git a/tests/error_010_nonexistent_arg.out b/tests/error_010_nonexistent_arg.out deleted file mode 100644 index ef4f7b041..000000000 --- a/tests/error_010_nonexistent_arg.out +++ /dev/null @@ -1 +0,0 @@ -[WILDCARD]Cannot resolve module "file:[WILDCARD]not-a-valid-filename.ts" from "." diff --git a/tests/error_011_bad_module_specifier.ts b/tests/error_011_bad_module_specifier.ts deleted file mode 100644 index e74d6b821..000000000 --- a/tests/error_011_bad_module_specifier.ts +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line -import * as badModule from "bad-module.ts"; diff --git a/tests/error_011_bad_module_specifier.ts.out b/tests/error_011_bad_module_specifier.ts.out deleted file mode 100644 index 97f59f2ca..000000000 --- a/tests/error_011_bad_module_specifier.ts.out +++ /dev/null @@ -1,12 +0,0 @@ -[WILDCARD]error: Uncaught ImportPrefixMissing: relative import path "bad-module.ts" not prefixed with / or ./ or ../ -[WILDCARD]dispatch_json.ts:[WILDCARD] - at DenoError ([WILDCARD]errors.ts:[WILDCARD]) - at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD]) - at sendSync[WILDCARD] ([WILDCARD]dispatch_json.ts:[WILDCARD]) - at fetchSourceFiles ([WILDCARD]compiler.ts:[WILDCARD]) - at _resolveModules ([WILDCARD]compiler.ts:[WILDCARD]) - at [WILDCARD]compiler.ts:[WILDCARD] - at resolveModuleNamesWorker ([WILDCARD]) - at resolveModuleNamesReusingOldState ([WILDCARD]typescript.js:[WILDCARD]) - at processImportedModules ([WILDCARD]typescript.js:[WILDCARD]) - at findSourceFile ([WILDCARD]typescript.js:[WILDCARD]) diff --git a/tests/error_012_bad_dynamic_import_specifier.ts b/tests/error_012_bad_dynamic_import_specifier.ts deleted file mode 100644 index 0420a80bf..000000000 --- a/tests/error_012_bad_dynamic_import_specifier.ts +++ /dev/null @@ -1,4 +0,0 @@ -(async (): Promise<void> => { - // eslint-disable-next-line - const badModule = await import("bad-module.ts"); -})(); diff --git a/tests/error_012_bad_dynamic_import_specifier.ts.out b/tests/error_012_bad_dynamic_import_specifier.ts.out deleted file mode 100644 index 97f59f2ca..000000000 --- a/tests/error_012_bad_dynamic_import_specifier.ts.out +++ /dev/null @@ -1,12 +0,0 @@ -[WILDCARD]error: Uncaught ImportPrefixMissing: relative import path "bad-module.ts" not prefixed with / or ./ or ../ -[WILDCARD]dispatch_json.ts:[WILDCARD] - at DenoError ([WILDCARD]errors.ts:[WILDCARD]) - at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD]) - at sendSync[WILDCARD] ([WILDCARD]dispatch_json.ts:[WILDCARD]) - at fetchSourceFiles ([WILDCARD]compiler.ts:[WILDCARD]) - at _resolveModules ([WILDCARD]compiler.ts:[WILDCARD]) - at [WILDCARD]compiler.ts:[WILDCARD] - at resolveModuleNamesWorker ([WILDCARD]) - at resolveModuleNamesReusingOldState ([WILDCARD]typescript.js:[WILDCARD]) - at processImportedModules ([WILDCARD]typescript.js:[WILDCARD]) - at findSourceFile ([WILDCARD]typescript.js:[WILDCARD]) diff --git a/tests/error_013_missing_script.out b/tests/error_013_missing_script.out deleted file mode 100644 index 9836c361f..000000000 --- a/tests/error_013_missing_script.out +++ /dev/null @@ -1 +0,0 @@ -Cannot resolve module "[WILDCARD]missing_file_name" diff --git a/tests/error_014_catch_dynamic_import_error.js b/tests/error_014_catch_dynamic_import_error.js deleted file mode 100644 index ad3735fc3..000000000 --- a/tests/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/error_014_catch_dynamic_import_error.js.out b/tests/error_014_catch_dynamic_import_error.js.out deleted file mode 100644 index c18b680a1..000000000 --- a/tests/error_014_catch_dynamic_import_error.js.out +++ /dev/null @@ -1,12 +0,0 @@ -Caught direct dynamic import error. -TypeError: relative import path "does not exist" not prefixed with / or ./ or ../ - -Caught indirect direct dynamic import error. -TypeError: relative import path "does not exist either" not prefixed with / or ./ or ../ - -Caught error thrown by dynamically imported module. -Error: An error - at file:///[WILDCARD]tests/subdir/throws.js:5:7 -Caught error thrown indirectly by dynamically imported module. -Error: An error - at file:///[WILDCARD]tests/subdir/throws.js:5:7 diff --git a/tests/error_015_dynamic_import_permissions.js b/tests/error_015_dynamic_import_permissions.js deleted file mode 100644 index 3460ca787..000000000 --- a/tests/error_015_dynamic_import_permissions.js +++ /dev/null @@ -1,3 +0,0 @@ -(async () => { - await import("http://localhost:4545/tests/subdir/mod4.js"); -})(); diff --git a/tests/error_015_dynamic_import_permissions.out b/tests/error_015_dynamic_import_permissions.out deleted file mode 100644 index 90ccd0d1a..000000000 --- a/tests/error_015_dynamic_import_permissions.out +++ /dev/null @@ -1 +0,0 @@ -error: Uncaught TypeError: permission denied diff --git a/tests/error_016_dynamic_import_permissions2.js b/tests/error_016_dynamic_import_permissions2.js deleted file mode 100644 index 71c70815c..000000000 --- a/tests/error_016_dynamic_import_permissions2.js +++ /dev/null @@ -1,5 +0,0 @@ -// If this is executed with --allow-net but not --allow-read the following -// import should cause a permission denied error. -(async () => { - await import("http://localhost:4545/tests/subdir/evil_remote_import.js"); -})(); diff --git a/tests/error_016_dynamic_import_permissions2.out b/tests/error_016_dynamic_import_permissions2.out deleted file mode 100644 index f52186481..000000000 --- a/tests/error_016_dynamic_import_permissions2.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -error: Uncaught TypeError: permission denied diff --git a/tests/error_stack.ts b/tests/error_stack.ts deleted file mode 100644 index f2125d662..000000000 --- a/tests/error_stack.ts +++ /dev/null @@ -1,10 +0,0 @@ -function foo(): never { - throw new Error("foo"); -} - -try { - foo(); -} catch (e) { - console.log(e); - throw e; -} diff --git a/tests/error_stack.ts.out b/tests/error_stack.ts.out deleted file mode 100644 index 2bb629e2d..000000000 --- a/tests/error_stack.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -[WILDCARD]Error: foo - at foo ([WILDCARD]tests/error_stack.ts:2:9) - at [WILDCARD]tests/error_stack.ts:6:3 -error: Uncaught Error: foo - at foo ([WILDCARD]tests/error_stack.ts:2:9) - at [WILDCARD]tests/error_stack.ts:6:3 diff --git a/tests/error_syntax.js b/tests/error_syntax.js deleted file mode 100644 index 0c0c09855..000000000 --- a/tests/error_syntax.js +++ /dev/null @@ -1,3 +0,0 @@ - -// prettier-ignore -(the following is a syntax error ^^ ! ) diff --git a/tests/error_syntax.js.out b/tests/error_syntax.js.out deleted file mode 100644 index 6253f3dd5..000000000 --- a/tests/error_syntax.js.out +++ /dev/null @@ -1,6 +0,0 @@ -error: Uncaught SyntaxError: Unexpected identifier -[WILDCARD]tests/error_syntax.js:3:6 - -3 (the following is a syntax error ^^ ! ) - ~~~~~~~~~ - diff --git a/tests/error_type_definitions.ts b/tests/error_type_definitions.ts deleted file mode 100644 index ceb11787e..000000000 --- a/tests/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/error_type_definitions.ts.out b/tests/error_type_definitions.ts.out deleted file mode 100644 index cc09c149d..000000000 --- a/tests/error_type_definitions.ts.out +++ /dev/null @@ -1,4 +0,0 @@ -[WILDCARD]error: Uncaught TypeError: Automatic type resolution not supported -[WILDCARD]compiler.ts:[WILDCARD] - at fileExists ([WILDCARD]compiler.ts:[WILDCARD]) -[WILDCARD]
\ No newline at end of file diff --git a/tests/esm_imports_a.js b/tests/esm_imports_a.js deleted file mode 100644 index 673cd9aa3..000000000 --- a/tests/esm_imports_a.js +++ /dev/null @@ -1,3 +0,0 @@ -import { retb } from "./esm_imports_b.js"; - -if (retb() != "b") throw Error(); diff --git a/tests/esm_imports_b.js b/tests/esm_imports_b.js deleted file mode 100644 index 321dfc05a..000000000 --- a/tests/esm_imports_b.js +++ /dev/null @@ -1,3 +0,0 @@ -export function retb() { - return "b"; -} diff --git a/tests/exec_path.ts b/tests/exec_path.ts deleted file mode 100644 index b70b23237..000000000 --- a/tests/exec_path.ts +++ /dev/null @@ -1 +0,0 @@ -console.log(Deno.execPath()); diff --git a/tests/exit_error42.ts b/tests/exit_error42.ts deleted file mode 100644 index e4db41f3a..000000000 --- a/tests/exit_error42.ts +++ /dev/null @@ -1,3 +0,0 @@ -console.log("before"); -Deno.exit(42); -console.log("after"); diff --git a/tests/exit_error42.ts.out b/tests/exit_error42.ts.out deleted file mode 100644 index 90be1f305..000000000 --- a/tests/exit_error42.ts.out +++ /dev/null @@ -1 +0,0 @@ -before diff --git a/tests/fetch_deps.ts b/tests/fetch_deps.ts deleted file mode 100644 index 370a8c561..000000000 --- a/tests/fetch_deps.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Run ./tools/http_server.py too in order for this test to run. -import { assert } from "../js/deps/https/deno.land/std/testing/asserts.ts"; - -// TODO Top level await https://github.com/denoland/deno/issues/471 -async function main(): Promise<void> { - const response = await fetch("http://localhost:4545/package.json"); - const json = await response.json(); - const deps = Object.keys(json.devDependencies); - console.log("Deno JS Deps"); - console.log(deps.map((d): string => `* ${d}`).join("\n")); - assert(deps.includes("typescript")); -} - -main(); diff --git a/tests/hello.txt b/tests/hello.txt deleted file mode 100644 index 6769dd60b..000000000 --- a/tests/hello.txt +++ /dev/null @@ -1 +0,0 @@ -Hello world!
\ No newline at end of file diff --git a/tests/https_import.ts b/tests/https_import.ts deleted file mode 100644 index faaf2175f..000000000 --- a/tests/https_import.ts +++ /dev/null @@ -1,5 +0,0 @@ -// TODO Use https://localhost:4555/ but we need more infrastructure to -// support verifying self-signed certificates. -import { printHello } from "https://gist.githubusercontent.com/ry/f12b2aa3409e6b52645bc346a9e22929/raw/79318f239f51d764384a8bded8d7c6a833610dde/print_hello.ts"; - -printHello(); diff --git a/tests/https_import.ts.out b/tests/https_import.ts.out deleted file mode 100644 index e965047ad..000000000 --- a/tests/https_import.ts.out +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/tests/if_main.ts b/tests/if_main.ts deleted file mode 100644 index b47066b2d..000000000 --- a/tests/if_main.ts +++ /dev/null @@ -1,7 +0,0 @@ -if (window.location.toString() == import.meta.url) { - console.log("main"); -} else { - console.log("import.meta.url", import.meta.url); - console.log("window.location", window.location.toString()); - throw Error("not main"); -} diff --git a/tests/if_main.ts.out b/tests/if_main.ts.out deleted file mode 100644 index ba2906d06..000000000 --- a/tests/if_main.ts.out +++ /dev/null @@ -1 +0,0 @@ -main diff --git a/tests/import_meta.ts b/tests/import_meta.ts deleted file mode 100644 index d111059ea..000000000 --- a/tests/import_meta.ts +++ /dev/null @@ -1,3 +0,0 @@ -console.log("import_meta", import.meta.url, import.meta.main); - -import "./import_meta2.ts"; diff --git a/tests/import_meta.ts.out b/tests/import_meta.ts.out deleted file mode 100644 index f38aa98ea..000000000 --- a/tests/import_meta.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -import_meta2 [WILDCARD]import_meta2.ts false -import_meta [WILDCARD]import_meta.ts true diff --git a/tests/import_meta2.ts b/tests/import_meta2.ts deleted file mode 100644 index 7f59a5a46..000000000 --- a/tests/import_meta2.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("import_meta2", import.meta.url, import.meta.main); diff --git a/tests/importmaps/import_map.json b/tests/importmaps/import_map.json deleted file mode 100644 index 601874aab..000000000 --- a/tests/importmaps/import_map.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "imports": { - "moment": "./moment/moment.ts", - "moment/": "./moment/", - "lodash": "./lodash/lodash.ts", - "lodash/": "./lodash/", - "https://www.unpkg.com/vue/dist/vue.runtime.esm.js": "./vue.ts" - }, - "scopes": { - "scope/": { - "moment": "./scoped_moment.ts" - } - } -} diff --git a/tests/importmaps/lodash/lodash.ts b/tests/importmaps/lodash/lodash.ts deleted file mode 100644 index 2ec04ed3c..000000000 --- a/tests/importmaps/lodash/lodash.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello from remapped lodash!"); diff --git a/tests/importmaps/lodash/other_file.ts b/tests/importmaps/lodash/other_file.ts deleted file mode 100644 index 714adae3f..000000000 --- a/tests/importmaps/lodash/other_file.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello from remapped lodash dir!"); diff --git a/tests/importmaps/moment/moment.ts b/tests/importmaps/moment/moment.ts deleted file mode 100644 index 2b54a431e..000000000 --- a/tests/importmaps/moment/moment.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello from remapped moment!"); diff --git a/tests/importmaps/moment/other_file.ts b/tests/importmaps/moment/other_file.ts deleted file mode 100644 index 24f3a0226..000000000 --- a/tests/importmaps/moment/other_file.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello from remapped moment dir!"); diff --git a/tests/importmaps/scope/scoped.ts b/tests/importmaps/scope/scoped.ts deleted file mode 100644 index 9a0b5d8e3..000000000 --- a/tests/importmaps/scope/scoped.ts +++ /dev/null @@ -1,2 +0,0 @@ -import "moment"; -console.log("Hello from scoped!"); diff --git a/tests/importmaps/scoped_moment.ts b/tests/importmaps/scoped_moment.ts deleted file mode 100644 index 9f67f88d4..000000000 --- a/tests/importmaps/scoped_moment.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello from scoped moment!"); diff --git a/tests/importmaps/test.ts b/tests/importmaps/test.ts deleted file mode 100644 index 9b09e9953..000000000 --- a/tests/importmaps/test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import "moment"; -import "moment/other_file.ts"; -import "lodash"; -import "lodash/other_file.ts"; -import "https://www.unpkg.com/vue/dist/vue.runtime.esm.js"; -import "./scope/scoped.ts"; diff --git a/tests/importmaps/vue.ts b/tests/importmaps/vue.ts deleted file mode 100644 index 76dbe1917..000000000 --- a/tests/importmaps/vue.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello from remapped Vue!"); diff --git a/tests/is_tty.ts b/tests/is_tty.ts deleted file mode 100644 index 2e3fdb49f..000000000 --- a/tests/is_tty.ts +++ /dev/null @@ -1 +0,0 @@ -console.log(Deno.isTTY().stdin); diff --git a/tests/no_color.js b/tests/no_color.js deleted file mode 100644 index cea11a52f..000000000 --- a/tests/no_color.js +++ /dev/null @@ -1 +0,0 @@ -console.log("noColor", Deno.noColor); diff --git a/tests/seed_random.js b/tests/seed_random.js deleted file mode 100644 index 7f6e336df..000000000 --- a/tests/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/seed_random.js.out b/tests/seed_random.js.out deleted file mode 100644 index c65e40f97..000000000 --- a/tests/seed_random.js.out +++ /dev/null @@ -1,12 +0,0 @@ -0.858562739044346 -0.8973397944553141 -0.15335012655691727 -0.36867387434349963 -0.3591039342838782 -0.7044499748617652 -0.7461423057751548 -0.3824611207183364 -0.5950178237266042 -0.22440633214343908 -Uint8Array [ 116, 125, 169, 69, 106, 231, 99, 39, 148, 188, 211, 41, 46, 211, 236, 141, 55, 10, 214, 63, 118, 230, 218, 249, 125, 161, 137, 110, 214, 36, 159, 154 ] -Uint8Array [ 248, 21, 21, 9, 41, 0, 71, 124, 244, 209, 252, 151, 7, 10, 168, 250, 84, 170, 243, 140, 53, 47, 99, 212, 18, 146, 68, 48, 66, 222, 67, 112 ] diff --git a/tests/subdir/auto_print_hello.ts b/tests/subdir/auto_print_hello.ts deleted file mode 100644 index 5efa72e03..000000000 --- a/tests/subdir/auto_print_hello.ts +++ /dev/null @@ -1,2 +0,0 @@ -console.log("hello!"); -export default {}; diff --git a/tests/subdir/bench_worker.ts b/tests/subdir/bench_worker.ts deleted file mode 100644 index 094cefb80..000000000 --- a/tests/subdir/bench_worker.ts +++ /dev/null @@ -1,20 +0,0 @@ -onmessage = function(e): void { - const { cmdId, action, data } = e.data; - switch (action) { - case 0: // Static response - postMessage({ - cmdId, - data: "HTTP/1.1 200 OK\r\nContent-Length: 12\r\n\r\nHello World\n" - }); - break; - case 1: // Respond with request data - postMessage({ cmdId, data }); - break; - case 2: // Ping - postMessage({ cmdId }); - break; - case 3: // Close - workerClose(); - break; - } -}; diff --git a/tests/subdir/config.json b/tests/subdir/config.json deleted file mode 100644 index 01c3b5e79..000000000 --- a/tests/subdir/config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "foo": { - "bar": true, - "baz": ["qat", 1] - } -} diff --git a/tests/subdir/evil_remote_import.js b/tests/subdir/evil_remote_import.js deleted file mode 100644 index 4ff7d1b97..000000000 --- a/tests/subdir/evil_remote_import.js +++ /dev/null @@ -1,4 +0,0 @@ -// We expect to get a permission denied error if we dynamically -// import this module without --allow-read. -export * from "file:///c:/etc/passwd"; -console.log("Hello from evil_remote_import.js"); diff --git a/tests/subdir/form_urlencoded.txt b/tests/subdir/form_urlencoded.txt deleted file mode 100644 index 70e087c20..000000000 --- a/tests/subdir/form_urlencoded.txt +++ /dev/null @@ -1 +0,0 @@ -field_1=Hi&field_2=%3CDeno%3E
\ No newline at end of file diff --git a/tests/subdir/indirect_import_error.js b/tests/subdir/indirect_import_error.js deleted file mode 100644 index 84011d291..000000000 --- a/tests/subdir/indirect_import_error.js +++ /dev/null @@ -1 +0,0 @@ -export * from "does not exist either"; diff --git a/tests/subdir/indirect_throws.js b/tests/subdir/indirect_throws.js deleted file mode 100644 index e1810a66c..000000000 --- a/tests/subdir/indirect_throws.js +++ /dev/null @@ -1 +0,0 @@ -export * from "./throws.js"; diff --git a/tests/subdir/mismatch_ext.ts b/tests/subdir/mismatch_ext.ts deleted file mode 100644 index e67d2a017..000000000 --- a/tests/subdir/mismatch_ext.ts +++ /dev/null @@ -1 +0,0 @@ -export const loaded = true; diff --git a/tests/subdir/mod1.ts b/tests/subdir/mod1.ts deleted file mode 100644 index 393535588..000000000 --- a/tests/subdir/mod1.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { returnsFoo, printHello2 } from "./subdir2/mod2.ts"; - -export function returnsHi(): string { - return "Hi"; -} - -export function returnsFoo2(): string { - return returnsFoo(); -} - -export function printHello3(): void { - printHello2(); -} - -export function throwsError(): void { - throw Error("exception from mod1"); -} diff --git a/tests/subdir/mod2.ts b/tests/subdir/mod2.ts deleted file mode 100644 index ce1adc0e8..000000000 --- a/tests/subdir/mod2.ts +++ /dev/null @@ -1 +0,0 @@ -export { printHello } from "./print_hello.ts"; diff --git a/tests/subdir/mod3.js b/tests/subdir/mod3.js deleted file mode 100644 index ce534f570..000000000 --- a/tests/subdir/mod3.js +++ /dev/null @@ -1 +0,0 @@ -export const isTSFile = false; diff --git a/tests/subdir/mod4.js b/tests/subdir/mod4.js deleted file mode 100644 index 71332dbc4..000000000 --- a/tests/subdir/mod4.js +++ /dev/null @@ -1 +0,0 @@ -export const isMod4 = true; diff --git a/tests/subdir/mod5.mjs b/tests/subdir/mod5.mjs deleted file mode 100644 index f21d8862b..000000000 --- a/tests/subdir/mod5.mjs +++ /dev/null @@ -1 +0,0 @@ -export const isMod5 = true; diff --git a/tests/subdir/mt_application_ecmascript.j2.js b/tests/subdir/mt_application_ecmascript.j2.js deleted file mode 100644 index e67d2a017..000000000 --- a/tests/subdir/mt_application_ecmascript.j2.js +++ /dev/null @@ -1 +0,0 @@ -export const loaded = true; diff --git a/tests/subdir/mt_application_x_javascript.j4.js b/tests/subdir/mt_application_x_javascript.j4.js deleted file mode 100644 index e67d2a017..000000000 --- a/tests/subdir/mt_application_x_javascript.j4.js +++ /dev/null @@ -1 +0,0 @@ -export const loaded = true; diff --git a/tests/subdir/mt_application_x_typescript.t4.ts b/tests/subdir/mt_application_x_typescript.t4.ts deleted file mode 100644 index e67d2a017..000000000 --- a/tests/subdir/mt_application_x_typescript.t4.ts +++ /dev/null @@ -1 +0,0 @@ -export const loaded = true; diff --git a/tests/subdir/mt_javascript.js b/tests/subdir/mt_javascript.js deleted file mode 100644 index e67d2a017..000000000 --- a/tests/subdir/mt_javascript.js +++ /dev/null @@ -1 +0,0 @@ -export const loaded = true; diff --git a/tests/subdir/mt_text_ecmascript.j3.js b/tests/subdir/mt_text_ecmascript.j3.js deleted file mode 100644 index e67d2a017..000000000 --- a/tests/subdir/mt_text_ecmascript.j3.js +++ /dev/null @@ -1 +0,0 @@ -export const loaded = true; diff --git a/tests/subdir/mt_text_javascript.j1.js b/tests/subdir/mt_text_javascript.j1.js deleted file mode 100644 index e67d2a017..000000000 --- a/tests/subdir/mt_text_javascript.j1.js +++ /dev/null @@ -1 +0,0 @@ -export const loaded = true; diff --git a/tests/subdir/mt_text_typescript.t1.ts b/tests/subdir/mt_text_typescript.t1.ts deleted file mode 100644 index e67d2a017..000000000 --- a/tests/subdir/mt_text_typescript.t1.ts +++ /dev/null @@ -1 +0,0 @@ -export const loaded = true; diff --git a/tests/subdir/mt_video_mp2t.t3.ts b/tests/subdir/mt_video_mp2t.t3.ts deleted file mode 100644 index e67d2a017..000000000 --- a/tests/subdir/mt_video_mp2t.t3.ts +++ /dev/null @@ -1 +0,0 @@ -export const loaded = true; diff --git a/tests/subdir/mt_video_vdn.t2.ts b/tests/subdir/mt_video_vdn.t2.ts deleted file mode 100644 index e67d2a017..000000000 --- a/tests/subdir/mt_video_vdn.t2.ts +++ /dev/null @@ -1 +0,0 @@ -export const loaded = true; diff --git a/tests/subdir/no_ext b/tests/subdir/no_ext deleted file mode 100644 index e67d2a017..000000000 --- a/tests/subdir/no_ext +++ /dev/null @@ -1 +0,0 @@ -export const loaded = true; diff --git a/tests/subdir/print_hello.ts b/tests/subdir/print_hello.ts deleted file mode 100644 index 7ecce5040..000000000 --- a/tests/subdir/print_hello.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function printHello(): void { - console.log("Hello"); -} diff --git a/tests/subdir/redirects/redirect1.js b/tests/subdir/redirects/redirect1.js deleted file mode 100644 index d674be88c..000000000 --- a/tests/subdir/redirects/redirect1.js +++ /dev/null @@ -1 +0,0 @@ -export const redirect = 1; diff --git a/tests/subdir/redirects/redirect1.ts b/tests/subdir/redirects/redirect1.ts deleted file mode 100644 index d674be88c..000000000 --- a/tests/subdir/redirects/redirect1.ts +++ /dev/null @@ -1 +0,0 @@ -export const redirect = 1; diff --git a/tests/subdir/redirects/redirect2.js b/tests/subdir/redirects/redirect2.js deleted file mode 100644 index e4244f638..000000000 --- a/tests/subdir/redirects/redirect2.js +++ /dev/null @@ -1 +0,0 @@ -import "./redirect1.js"; diff --git a/tests/subdir/redirects/redirect3.js b/tests/subdir/redirects/redirect3.js deleted file mode 100644 index e24f2af32..000000000 --- a/tests/subdir/redirects/redirect3.js +++ /dev/null @@ -1,2 +0,0 @@ -import { redirect } from "./redirect1.js"; -export const value = `3 imports ${redirect}`; diff --git a/tests/subdir/redirects/redirect4.ts b/tests/subdir/redirects/redirect4.ts deleted file mode 100644 index 45c65c5eb..000000000 --- a/tests/subdir/redirects/redirect4.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { redirect } from "./redirect1.ts"; -export const value = `4 imports ${redirect}`; diff --git a/tests/subdir/subdir2/mod2.ts b/tests/subdir/subdir2/mod2.ts deleted file mode 100644 index c88d4708c..000000000 --- a/tests/subdir/subdir2/mod2.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { printHello } from "../print_hello.ts"; - -export function returnsFoo(): string { - return "Foo"; -} - -export function printHello2(): void { - printHello(); -} diff --git a/tests/subdir/test_worker.js b/tests/subdir/test_worker.js deleted file mode 100644 index 53d38ba96..000000000 --- a/tests/subdir/test_worker.js +++ /dev/null @@ -1,7 +0,0 @@ -onmessage = function(e) { - console.log(e.data); - - postMessage(e.data); - - workerClose(); -}; diff --git a/tests/subdir/test_worker.ts b/tests/subdir/test_worker.ts deleted file mode 100644 index c8109d131..000000000 --- a/tests/subdir/test_worker.ts +++ /dev/null @@ -1,7 +0,0 @@ -onmessage = function(e): void { - console.log(e.data); - - postMessage(e.data); - - workerClose(); -}; diff --git a/tests/subdir/throws.js b/tests/subdir/throws.js deleted file mode 100644 index b77e7104f..000000000 --- a/tests/subdir/throws.js +++ /dev/null @@ -1,5 +0,0 @@ -export function boo() { - console.log("Boo!"); -} - -throw new Error("An error"); diff --git a/tests/subdir/unknown_ext.deno b/tests/subdir/unknown_ext.deno deleted file mode 100644 index e67d2a017..000000000 --- a/tests/subdir/unknown_ext.deno +++ /dev/null @@ -1 +0,0 @@ -export const loaded = true; diff --git a/tests/type_definitions.ts b/tests/type_definitions.ts deleted file mode 100644 index ecf3ae0b2..000000000 --- a/tests/type_definitions.ts +++ /dev/null @@ -1,10 +0,0 @@ -// @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/type_definitions.ts.out b/tests/type_definitions.ts.out deleted file mode 100644 index b4fa88c50..000000000 --- a/tests/type_definitions.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -[WILDCARD]foo -fizz -qat diff --git a/tests/type_definitions/bar.d.ts b/tests/type_definitions/bar.d.ts deleted file mode 100644 index d43335dbb..000000000 --- a/tests/type_definitions/bar.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// <reference types="baz" /> - -declare namespace bar { - export class Bar { - baz: string; - } -} diff --git a/tests/type_definitions/fizz.d.ts b/tests/type_definitions/fizz.d.ts deleted file mode 100644 index 34eb41b96..000000000 --- a/tests/type_definitions/fizz.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** A global value. */ -declare const fizz: string; diff --git a/tests/type_definitions/fizz.js b/tests/type_definitions/fizz.js deleted file mode 100644 index 852162c94..000000000 --- a/tests/type_definitions/fizz.js +++ /dev/null @@ -1 +0,0 @@ -globalThis.fizz = "fizz"; diff --git a/tests/type_definitions/foo.d.ts b/tests/type_definitions/foo.d.ts deleted file mode 100644 index ce39201e1..000000000 --- a/tests/type_definitions/foo.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** An exported value. */ -export const foo: string; diff --git a/tests/type_definitions/foo.js b/tests/type_definitions/foo.js deleted file mode 100644 index 61d366eb2..000000000 --- a/tests/type_definitions/foo.js +++ /dev/null @@ -1 +0,0 @@ -export const foo = "foo"; diff --git a/tests/type_definitions/qat.ts b/tests/type_definitions/qat.ts deleted file mode 100644 index 6196c9d38..000000000 --- a/tests/type_definitions/qat.ts +++ /dev/null @@ -1 +0,0 @@ -export const qat = "qat"; diff --git a/tests/types.out b/tests/types.out deleted file mode 100644 index 2d5a39e64..000000000 --- a/tests/types.out +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -[WILDCARD] - -declare namespace Deno { -[WILDCARD] -} -[WILDCARD] -declare interface Window { -[WILDCARD] - Deno: typeof Deno; -} - -declare const window: Window; -[WILDCARD] diff --git a/tests/unbuffered_stderr.ts b/tests/unbuffered_stderr.ts deleted file mode 100644 index f4bceb1fc..000000000 --- a/tests/unbuffered_stderr.ts +++ /dev/null @@ -1,3 +0,0 @@ -const { stderr } = Deno; - -stderr.write(new TextEncoder().encode("x")); diff --git a/tests/unbuffered_stderr.ts.out b/tests/unbuffered_stderr.ts.out deleted file mode 100644 index 500019738..000000000 --- a/tests/unbuffered_stderr.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -x
\ No newline at end of file diff --git a/tests/unbuffered_stdout.ts b/tests/unbuffered_stdout.ts deleted file mode 100644 index fdb1a0e23..000000000 --- a/tests/unbuffered_stdout.ts +++ /dev/null @@ -1,3 +0,0 @@ -const { stdout } = Deno; - -stdout.write(new TextEncoder().encode("a")); diff --git a/tests/unbuffered_stdout.ts.out b/tests/unbuffered_stdout.ts.out deleted file mode 100644 index 2e65efe2a..000000000 --- a/tests/unbuffered_stdout.ts.out +++ /dev/null @@ -1 +0,0 @@ -a
\ No newline at end of file diff --git a/tests/v8_flags.js b/tests/v8_flags.js deleted file mode 100644 index f7999c4af..000000000 --- a/tests/v8_flags.js +++ /dev/null @@ -1 +0,0 @@ -console.log(typeof gc); diff --git a/tests/v8_flags.js.out b/tests/v8_flags.js.out deleted file mode 100644 index e2dbde096..000000000 --- a/tests/v8_flags.js.out +++ /dev/null @@ -1 +0,0 @@ -function diff --git a/tests/v8_help.out b/tests/v8_help.out deleted file mode 100644 index 3d7aac28d..000000000 --- a/tests/v8_help.out +++ /dev/null @@ -1,3 +0,0 @@ -[WILDCARD] -Synopsis: -[WILDCARD]d8[WILDCARD]
\ No newline at end of file diff --git a/tests/version.out b/tests/version.out deleted file mode 100644 index de13d769f..000000000 --- a/tests/version.out +++ /dev/null @@ -1,3 +0,0 @@ -deno:[WILDCARD] -v8:[WILDCARD] -typescript:[WILDCARD]
\ No newline at end of file diff --git a/tests/wasm.ts b/tests/wasm.ts deleted file mode 100644 index 26ad7ba28..000000000 --- a/tests/wasm.ts +++ /dev/null @@ -1,15 +0,0 @@ -// prettier-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); - -console.log(wasmInstance.exports.main().toString()); diff --git a/tests/wasm.ts.out b/tests/wasm.ts.out deleted file mode 100644 index d81cc0710..000000000 --- a/tests/wasm.ts.out +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/wasm_async.js b/tests/wasm_async.js deleted file mode 100644 index 98a178aad..000000000 --- a/tests/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)) -// ) -// prettier-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/wasm_async.out b/tests/wasm_async.out deleted file mode 100644 index 5cdf17de7..000000000 --- a/tests/wasm_async.out +++ /dev/null @@ -1 +0,0 @@ -1 + 3 = 4 diff --git a/tests/workers_round_robin_bench.ts b/tests/workers_round_robin_bench.ts deleted file mode 100644 index 7c34e75e5..000000000 --- a/tests/workers_round_robin_bench.ts +++ /dev/null @@ -1,79 +0,0 @@ -// Benchmark measures time it takes to send a message to a group of workers one -// at a time and wait for a response from all of them. Just a general -// throughput and consistency benchmark. -const data = "HTTP/1.1 200 OK\r\nContent-Length: 12\r\n\r\nHello World\n"; -const workerCount = 4; -const cmdsPerWorker = 400; - -export interface ResolvableMethods<T> { - resolve: (value?: T | PromiseLike<T>) => void; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - reject: (reason?: any) => void; -} - -export type Resolvable<T> = Promise<T> & ResolvableMethods<T>; - -export function createResolvable<T>(): Resolvable<T> { - let methods: ResolvableMethods<T>; - const promise = new Promise<T>( - (resolve, reject): void => { - methods = { resolve, reject }; - } - ); - // TypeScript doesn't know that the Promise callback occurs synchronously - // therefore use of not null assertion (`!`) - return Object.assign(promise, methods!) as Resolvable<T>; -} - -function handleAsyncMsgFromWorker( - promiseTable: Map<number, Resolvable<string>>, - msg: { cmdId: number; data: string } -): void { - const promise = promiseTable.get(msg.cmdId); - if (promise === null) { - throw new Error(`Failed to find promise: cmdId: ${msg.cmdId}, msg: ${msg}`); - } - promise.resolve(data); -} - -async function main(): Promise<void> { - const workers: Array<[Map<number, Resolvable<string>>, Worker]> = []; - for (let i = 1; i <= workerCount; ++i) { - const worker = new Worker("./subdir/bench_worker.ts"); - const promise = new Promise( - (resolve): void => { - worker.onmessage = (e): void => { - if (e.data.cmdId === 0) resolve(); - }; - } - ); - worker.postMessage({ cmdId: 0, action: 2 }); - await promise; - workers.push([new Map(), worker]); - } - // assign callback function - for (const [promiseTable, worker] of workers) { - worker.onmessage = (e): void => { - handleAsyncMsgFromWorker(promiseTable, e.data); - }; - } - for (const cmdId of Array(cmdsPerWorker).keys()) { - const promises: Array<Promise<string>> = []; - for (const [promiseTable, worker] of workers) { - const promise = createResolvable<string>(); - promiseTable.set(cmdId, promise); - worker.postMessage({ cmdId: cmdId, action: 1, data }); - promises.push(promise); - } - for (const promise of promises) { - await promise; - } - } - for (const [, worker] of workers) { - worker.postMessage({ action: 3 }); - await worker.closed; // Required to avoid a cmdId not in table error. - } - console.log("Finished!"); -} - -main(); diff --git a/tests/workers_startup_bench.ts b/tests/workers_startup_bench.ts deleted file mode 100644 index fbea4dc40..000000000 --- a/tests/workers_startup_bench.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Benchmark measures time it takes to start and stop a number of workers. -const workerCount = 50; - -async function bench(): Promise<void> { - const workers: Worker[] = []; - for (let i = 1; i <= workerCount; ++i) { - const worker = new Worker("./subdir/bench_worker.ts"); - const promise = new Promise( - (resolve): void => { - worker.onmessage = (e): void => { - if (e.data.cmdId === 0) resolve(); - }; - } - ); - worker.postMessage({ cmdId: 0, action: 2 }); - await promise; - workers.push(worker); - } - console.log("Done creating workers closing workers!"); - for (const worker of workers) { - worker.postMessage({ action: 3 }); - await worker.closed; // Required to avoid a cmdId not in table error. - } - console.log("Finished!"); -} - -bench(); |