From e40f9a5c14c51b6d05812e48fa072148fe79c74d Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 15 Mar 2024 15:46:51 -0400 Subject: chore: move more tests away from itest (#22909) Part of #22907 --- tests/integration/coverage_tests.rs | 7 -- tests/integration/flags_tests.rs | 42 --------- tests/integration/jsr_tests.rs | 100 --------------------- tests/integration/jupyter_tests.rs | 10 --- tests/integration/mod.rs | 2 - tests/specs/coverage/no_files_found/__test__.jsonc | 5 ++ .../coverage/no_files_found/does_not_exist.out | 1 + tests/specs/flags/help_flag/__test__.jsonc | 4 + tests/specs/flags/types/__test__.jsonc | 4 + tests/specs/flags/types/types.out | 3 + tests/specs/flags/version_flag/__test__.jsonc | 9 ++ tests/specs/jsr/deps/__test__.jsonc | 11 +++ tests/specs/jsr/deps/main.out | 13 +++ tests/specs/jsr/deps/main.ts | 3 + tests/specs/jsr/deps/main_info.out | 22 +++++ tests/specs/jsr/import_https_url/__test__.jsonc | 13 +++ tests/specs/jsr/import_https_url/analyzable.out | 8 ++ tests/specs/jsr/import_https_url/analyzable.ts | 1 + tests/specs/jsr/import_https_url/nonanalyzable.out | 7 ++ tests/specs/jsr/import_https_url/nonanalyzable.ts | 1 + tests/specs/jsr/jsx_with_no_pragmas/__test__.jsonc | 6 ++ tests/specs/jsr/jsx_with_no_pragmas/main.out | 7 ++ tests/specs/jsr/jsx_with_no_pragmas/main.ts | 3 + tests/specs/jsr/jsx_with_pragmas/__test__.jsonc | 5 ++ tests/specs/jsr/jsx_with_pragmas/main.out | 3 + tests/specs/jsr/jsx_with_pragmas/main.ts | 3 + tests/specs/jsr/module_graph/__test__.jsonc | 11 +++ tests/specs/jsr/module_graph/main.out | 7 ++ tests/specs/jsr/module_graph/main.ts | 3 + tests/specs/jsr/module_graph/main_info.out | 14 +++ tests/specs/jsr/no_module_graph/__test__.jsonc | 14 +++ tests/specs/jsr/no_module_graph/main.out | 6 ++ tests/specs/jsr/no_module_graph/main.ts | 4 + tests/specs/jsr/no_module_graph/main_info.out | 12 +++ tests/specs/jsr/no_module_graph/multiple.out | 2 + tests/specs/jsr/no_module_graph/multiple.ts | 5 ++ tests/specs/jsr/subset_type_graph/__test__.jsonc | 6 ++ tests/specs/jsr/subset_type_graph/main.check.out | 45 ++++++++++ tests/specs/jsr/subset_type_graph/main.ts | 13 +++ tests/specs/jsr/version_not_found/__test__.jsonc | 6 ++ tests/specs/jsr/version_not_found/main.out | 5 ++ tests/specs/jsr/version_not_found/main.ts | 2 + .../install_command_not_exists/__test__.jsonc | 8 ++ .../install_command_not_exists.out | 5 ++ tests/specs/mod.rs | 27 +++--- tests/testdata/coverage/doesnt_exist.out | 1 - tests/testdata/jsr/deps/main.out | 13 --- tests/testdata/jsr/deps/main.ts | 3 - tests/testdata/jsr/deps/main_info.out | 22 ----- tests/testdata/jsr/import_https_url/analyzable.out | 8 -- tests/testdata/jsr/import_https_url/analyzable.ts | 1 - .../testdata/jsr/import_https_url/unanalyzable.out | 7 -- .../testdata/jsr/import_https_url/unanalyzable.ts | 1 - tests/testdata/jsr/jsx_with_no_pragmas/main.out | 7 -- tests/testdata/jsr/jsx_with_no_pragmas/main.ts | 3 - tests/testdata/jsr/jsx_with_pragmas/main.out | 3 - tests/testdata/jsr/jsx_with_pragmas/main.ts | 3 - tests/testdata/jsr/module_graph/main.out | 7 -- tests/testdata/jsr/module_graph/main.ts | 3 - tests/testdata/jsr/module_graph/main_info.out | 14 --- tests/testdata/jsr/no_module_graph/main.out | 6 -- tests/testdata/jsr/no_module_graph/main.ts | 4 - tests/testdata/jsr/no_module_graph/main_info.out | 12 --- tests/testdata/jsr/no_module_graph/multiple.out | 2 - tests/testdata/jsr/no_module_graph/multiple.ts | 5 -- .../testdata/jsr/subset_type_graph/main.check.out | 45 ---------- tests/testdata/jsr/subset_type_graph/main.ts | 13 --- tests/testdata/jsr/version_not_found/main.out | 5 -- tests/testdata/jsr/version_not_found/main.ts | 2 - .../jupyter/install_command_not_exists.out | 5 -- tests/testdata/types/types.out | 3 - 71 files changed, 310 insertions(+), 376 deletions(-) delete mode 100644 tests/integration/jupyter_tests.rs create mode 100644 tests/specs/coverage/no_files_found/__test__.jsonc create mode 100644 tests/specs/coverage/no_files_found/does_not_exist.out create mode 100644 tests/specs/flags/help_flag/__test__.jsonc create mode 100644 tests/specs/flags/types/__test__.jsonc create mode 100644 tests/specs/flags/types/types.out create mode 100644 tests/specs/flags/version_flag/__test__.jsonc create mode 100644 tests/specs/jsr/deps/__test__.jsonc create mode 100644 tests/specs/jsr/deps/main.out create mode 100644 tests/specs/jsr/deps/main.ts create mode 100644 tests/specs/jsr/deps/main_info.out create mode 100644 tests/specs/jsr/import_https_url/__test__.jsonc create mode 100644 tests/specs/jsr/import_https_url/analyzable.out create mode 100644 tests/specs/jsr/import_https_url/analyzable.ts create mode 100644 tests/specs/jsr/import_https_url/nonanalyzable.out create mode 100644 tests/specs/jsr/import_https_url/nonanalyzable.ts create mode 100644 tests/specs/jsr/jsx_with_no_pragmas/__test__.jsonc create mode 100644 tests/specs/jsr/jsx_with_no_pragmas/main.out create mode 100644 tests/specs/jsr/jsx_with_no_pragmas/main.ts create mode 100644 tests/specs/jsr/jsx_with_pragmas/__test__.jsonc create mode 100644 tests/specs/jsr/jsx_with_pragmas/main.out create mode 100644 tests/specs/jsr/jsx_with_pragmas/main.ts create mode 100644 tests/specs/jsr/module_graph/__test__.jsonc create mode 100644 tests/specs/jsr/module_graph/main.out create mode 100644 tests/specs/jsr/module_graph/main.ts create mode 100644 tests/specs/jsr/module_graph/main_info.out create mode 100644 tests/specs/jsr/no_module_graph/__test__.jsonc create mode 100644 tests/specs/jsr/no_module_graph/main.out create mode 100644 tests/specs/jsr/no_module_graph/main.ts create mode 100644 tests/specs/jsr/no_module_graph/main_info.out create mode 100644 tests/specs/jsr/no_module_graph/multiple.out create mode 100644 tests/specs/jsr/no_module_graph/multiple.ts create mode 100644 tests/specs/jsr/subset_type_graph/__test__.jsonc create mode 100644 tests/specs/jsr/subset_type_graph/main.check.out create mode 100644 tests/specs/jsr/subset_type_graph/main.ts create mode 100644 tests/specs/jsr/version_not_found/__test__.jsonc create mode 100644 tests/specs/jsr/version_not_found/main.out create mode 100644 tests/specs/jsr/version_not_found/main.ts create mode 100644 tests/specs/jupyter/install_command_not_exists/__test__.jsonc create mode 100644 tests/specs/jupyter/install_command_not_exists/install_command_not_exists.out delete mode 100644 tests/testdata/coverage/doesnt_exist.out delete mode 100644 tests/testdata/jsr/deps/main.out delete mode 100644 tests/testdata/jsr/deps/main.ts delete mode 100644 tests/testdata/jsr/deps/main_info.out delete mode 100644 tests/testdata/jsr/import_https_url/analyzable.out delete mode 100644 tests/testdata/jsr/import_https_url/analyzable.ts delete mode 100644 tests/testdata/jsr/import_https_url/unanalyzable.out delete mode 100644 tests/testdata/jsr/import_https_url/unanalyzable.ts delete mode 100644 tests/testdata/jsr/jsx_with_no_pragmas/main.out delete mode 100644 tests/testdata/jsr/jsx_with_no_pragmas/main.ts delete mode 100644 tests/testdata/jsr/jsx_with_pragmas/main.out delete mode 100644 tests/testdata/jsr/jsx_with_pragmas/main.ts delete mode 100644 tests/testdata/jsr/module_graph/main.out delete mode 100644 tests/testdata/jsr/module_graph/main.ts delete mode 100644 tests/testdata/jsr/module_graph/main_info.out delete mode 100644 tests/testdata/jsr/no_module_graph/main.out delete mode 100644 tests/testdata/jsr/no_module_graph/main.ts delete mode 100644 tests/testdata/jsr/no_module_graph/main_info.out delete mode 100644 tests/testdata/jsr/no_module_graph/multiple.out delete mode 100644 tests/testdata/jsr/no_module_graph/multiple.ts delete mode 100644 tests/testdata/jsr/subset_type_graph/main.check.out delete mode 100644 tests/testdata/jsr/subset_type_graph/main.ts delete mode 100644 tests/testdata/jsr/version_not_found/main.out delete mode 100644 tests/testdata/jsr/version_not_found/main.ts delete mode 100644 tests/testdata/jupyter/install_command_not_exists.out delete mode 100644 tests/testdata/types/types.out (limited to 'tests') diff --git a/tests/integration/coverage_tests.rs b/tests/integration/coverage_tests.rs index 5353996a0..1bc3e887a 100644 --- a/tests/integration/coverage_tests.rs +++ b/tests/integration/coverage_tests.rs @@ -3,7 +3,6 @@ use deno_core::serde_json; use std::fs; use test_util as util; -use test_util::itest; use test_util::TempDir; use util::assert_starts_with; use util::env_vars_for_npm_tests; @@ -631,9 +630,3 @@ File | Branch % | Line % | ", ); } - -itest!(no_files_found { - args: "coverage doesnt_exist.js", - exit_code: 1, - output: "coverage/doesnt_exist.out", -}); diff --git a/tests/integration/flags_tests.rs b/tests/integration/flags_tests.rs index c898c199c..751f4aafe 100644 --- a/tests/integration/flags_tests.rs +++ b/tests/integration/flags_tests.rs @@ -1,21 +1,8 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. use test_util as util; -use test_util::itest; use util::assert_contains; -#[test] -fn help_flag() { - let status = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("--help") - .spawn() - .unwrap() - .wait() - .unwrap(); - assert!(status.success()); -} - #[test] fn help_output() { let output = util::deno_cmd() @@ -56,32 +43,3 @@ fn help_output() { assert_contains!(stdout, description); } } - -#[test] -fn version_short_flag() { - let status = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("-V") - .spawn() - .unwrap() - .wait() - .unwrap(); - assert!(status.success()); -} - -#[test] -fn version_long_flag() { - let status = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("--version") - .spawn() - .unwrap() - .wait() - .unwrap(); - assert!(status.success()); -} - -itest!(types { - args: "types", - output: "types/types.out", -}); diff --git a/tests/integration/jsr_tests.rs b/tests/integration/jsr_tests.rs index f78bea92d..307398fc5 100644 --- a/tests/integration/jsr_tests.rs +++ b/tests/integration/jsr_tests.rs @@ -4,87 +4,11 @@ use deno_core::serde_json::json; use deno_core::serde_json::Value; use deno_lockfile::Lockfile; use test_util as util; -use test_util::itest; use url::Url; use util::assert_contains; use util::assert_not_contains; -use util::env_vars_for_jsr_npm_tests; -use util::env_vars_for_jsr_tests; use util::TestContextBuilder; -itest!(no_module_graph_run { - args: "run jsr/no_module_graph/main.ts", - output: "jsr/no_module_graph/main.out", - envs: env_vars_for_jsr_tests(), - http_server: true, -}); - -itest!(no_module_graph_info { - args: "info jsr/no_module_graph/main.ts", - output: "jsr/no_module_graph/main_info.out", - envs: env_vars_for_jsr_tests(), - http_server: true, -}); - -itest!(same_package_multiple_versions { - args: "run --quiet jsr/no_module_graph/multiple.ts", - output: "jsr/no_module_graph/multiple.out", - envs: env_vars_for_jsr_tests(), - http_server: true, -}); - -itest!(module_graph_run { - args: "run jsr/module_graph/main.ts", - output: "jsr/module_graph/main.out", - envs: env_vars_for_jsr_tests(), - http_server: true, -}); - -itest!(module_graph_info { - args: "info jsr/module_graph/main.ts", - output: "jsr/module_graph/main_info.out", - envs: env_vars_for_jsr_tests(), - http_server: true, -}); - -itest!(deps_run { - args: "run jsr/deps/main.ts", - output: "jsr/deps/main.out", - envs: env_vars_for_jsr_tests(), - http_server: true, -}); - -itest!(deps_info { - args: "info jsr/deps/main.ts", - output: "jsr/deps/main_info.out", - envs: env_vars_for_jsr_tests(), - http_server: true, -}); - -itest!(import_https_url_analyzable { - args: "run -A jsr/import_https_url/analyzable.ts", - output: "jsr/import_https_url/analyzable.out", - envs: env_vars_for_jsr_tests(), - http_server: true, - exit_code: 1, -}); - -itest!(import_https_url_unanalyzable { - args: "run -A jsr/import_https_url/unanalyzable.ts", - output: "jsr/import_https_url/unanalyzable.out", - envs: env_vars_for_jsr_tests(), - http_server: true, - exit_code: 1, -}); - -itest!(subset_type_graph { - args: "check --all jsr/subset_type_graph/main.ts", - output: "jsr/subset_type_graph/main.check.out", - envs: env_vars_for_jsr_tests(), - http_server: true, - exit_code: 1, -}); - #[test] fn fast_check_cache() { let test_context = TestContextBuilder::for_jsr().use_temp_cwd().build(); @@ -197,14 +121,6 @@ export function asdf(a: number) { let err: number = ''; return Math.random(); } ); } -itest!(version_not_found { - args: "run jsr/version_not_found/main.ts", - output: "jsr/version_not_found/main.out", - envs: env_vars_for_jsr_tests(), - http_server: true, - exit_code: 1, -}); - #[test] fn specifiers_in_lockfile() { let test_context = TestContextBuilder::for_jsr().use_temp_cwd().build(); @@ -478,19 +394,3 @@ fn set_lockfile_pkg_integrity( .unwrap() .integrity = integrity.to_string(); } - -itest!(jsx_with_no_pragmas { - args: "run jsr/jsx_with_no_pragmas/main.ts", - output: "jsr/jsx_with_no_pragmas/main.out", - envs: env_vars_for_jsr_npm_tests(), - http_server: true, - exit_code: 1, -}); - -itest!(jsx_with_pragmas { - args: "run jsr/jsx_with_pragmas/main.ts", - output: "jsr/jsx_with_pragmas/main.out", - envs: env_vars_for_jsr_npm_tests(), - http_server: true, - exit_code: 0, -}); diff --git a/tests/integration/jupyter_tests.rs b/tests/integration/jupyter_tests.rs deleted file mode 100644 index 547861258..000000000 --- a/tests/integration/jupyter_tests.rs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -use test_util::itest; - -itest!(jupyter_install_command_not_exists { - args: "jupyter --install", - output: "jupyter/install_command_not_exists.out", - envs: vec![("PATH".to_string(), "".to_string())], - exit_code: 1, -}); diff --git a/tests/integration/mod.rs b/tests/integration/mod.rs index 9253cae32..40dd880b5 100644 --- a/tests/integration/mod.rs +++ b/tests/integration/mod.rs @@ -38,8 +38,6 @@ mod install; mod js_unit_tests; #[path = "jsr_tests.rs"] mod jsr; -#[path = "jupyter_tests.rs"] -mod jupyter; #[path = "lint_tests.rs"] mod lint; #[path = "lsp_tests.rs"] diff --git a/tests/specs/coverage/no_files_found/__test__.jsonc b/tests/specs/coverage/no_files_found/__test__.jsonc new file mode 100644 index 000000000..3637b41fe --- /dev/null +++ b/tests/specs/coverage/no_files_found/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "coverage does_not_exit.js", + "output": "does_not_exist.out", + "exitCode": 1 +} diff --git a/tests/specs/coverage/no_files_found/does_not_exist.out b/tests/specs/coverage/no_files_found/does_not_exist.out new file mode 100644 index 000000000..0b679bcb4 --- /dev/null +++ b/tests/specs/coverage/no_files_found/does_not_exist.out @@ -0,0 +1 @@ +error: No coverage files found diff --git a/tests/specs/flags/help_flag/__test__.jsonc b/tests/specs/flags/help_flag/__test__.jsonc new file mode 100644 index 000000000..4cf04538b --- /dev/null +++ b/tests/specs/flags/help_flag/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "--help", + "output": "[WILDCARD]" +} diff --git a/tests/specs/flags/types/__test__.jsonc b/tests/specs/flags/types/__test__.jsonc new file mode 100644 index 000000000..ce0d61d34 --- /dev/null +++ b/tests/specs/flags/types/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "types", + "output": "types.out" +} diff --git a/tests/specs/flags/types/types.out b/tests/specs/flags/types/types.out new file mode 100644 index 000000000..089a9381f --- /dev/null +++ b/tests/specs/flags/types/types.out @@ -0,0 +1,3 @@ +[WILDCARD] +declare namespace Deno [WILDCARD] +declare var window: Window [WILDCARD] diff --git a/tests/specs/flags/version_flag/__test__.jsonc b/tests/specs/flags/version_flag/__test__.jsonc new file mode 100644 index 000000000..e8c3c1646 --- /dev/null +++ b/tests/specs/flags/version_flag/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "steps": [{ + "args": "-V", + "output": "[WILDCARD]" + }, { + "args": "--version", + "output": "[WILDCARD]" + }] +} diff --git a/tests/specs/jsr/deps/__test__.jsonc b/tests/specs/jsr/deps/__test__.jsonc new file mode 100644 index 000000000..2528003b5 --- /dev/null +++ b/tests/specs/jsr/deps/__test__.jsonc @@ -0,0 +1,11 @@ +{ + "base": "jsr", + "steps": [{ + "args": "run main.ts", + "output": "main.out" + }, { + "cleanDenoDir": true, + "args": "info main.ts", + "output": "main_info.out" + }] +} diff --git a/tests/specs/jsr/deps/main.out b/tests/specs/jsr/deps/main.out new file mode 100644 index 000000000..621703c4b --- /dev/null +++ b/tests/specs/jsr/deps/main.out @@ -0,0 +1,13 @@ +Download http://127.0.0.1:4250/@denotest/deps/meta.json +Download http://127.0.0.1:4250/@denotest/deps/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/module_graph/meta.json +Download http://127.0.0.1:4250/@denotest/no_module_graph/meta.json +Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0_meta.json +Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.1_meta.json +[UNORDERED_START] +Download http://127.0.0.1:4250/@denotest/deps/1.0.0/mod.ts +Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0/other.ts +Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.1/mod.ts +Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.1/TestClass.ts +[UNORDERED_END] +{ version: "0.1.1", other: Other {} } diff --git a/tests/specs/jsr/deps/main.ts b/tests/specs/jsr/deps/main.ts new file mode 100644 index 000000000..f48255299 --- /dev/null +++ b/tests/specs/jsr/deps/main.ts @@ -0,0 +1,3 @@ +import value from "jsr:@denotest/deps"; + +console.log(value); diff --git a/tests/specs/jsr/deps/main_info.out b/tests/specs/jsr/deps/main_info.out new file mode 100644 index 000000000..c4d412707 --- /dev/null +++ b/tests/specs/jsr/deps/main_info.out @@ -0,0 +1,22 @@ +Download http://127.0.0.1:4250/@denotest/deps/meta.json +Download http://127.0.0.1:4250/@denotest/deps/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/module_graph/meta.json +Download http://127.0.0.1:4250/@denotest/no_module_graph/meta.json +Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0_meta.json +Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.1_meta.json +[UNORDERED_START] +Download http://127.0.0.1:4250/@denotest/deps/1.0.0/mod.ts +Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0/other.ts +Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.1/mod.ts +Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.1/TestClass.ts +[UNORDERED_END] +local: [WILDCARD]main.ts +type: TypeScript +dependencies: 4 unique +size: [WILDCARD] + +file:///[WILDCARD]main.ts ([WILDCARD]) +└─┬ http://127.0.0.1:4250/@denotest/deps/1.0.0/mod.ts ([WILDCARD]) + ├── http://127.0.0.1:4250/@denotest/module_graph/1.4.0/other.ts ([WILDCARD]) + └─┬ http://127.0.0.1:4250/@denotest/no_module_graph/0.1.1/mod.ts ([WILDCARD]) + └── http://127.0.0.1:4250/@denotest/no_module_graph/0.1.1/TestClass.ts ([WILDCARD]) diff --git a/tests/specs/jsr/import_https_url/__test__.jsonc b/tests/specs/jsr/import_https_url/__test__.jsonc new file mode 100644 index 000000000..597b8e009 --- /dev/null +++ b/tests/specs/jsr/import_https_url/__test__.jsonc @@ -0,0 +1,13 @@ +{ + "base": "jsr", + "steps": [{ + "args": "run -A analyzable.ts", + "output": "analyzable.out", + "exitCode": 1 + }, { + "cleanDenoDir": true, + "args": "run -A nonanalyzable.ts", + "output": "nonanalyzable.out", + "exitCode": 1 + }] +} diff --git a/tests/specs/jsr/import_https_url/analyzable.out b/tests/specs/jsr/import_https_url/analyzable.out new file mode 100644 index 000000000..dd1ca58b4 --- /dev/null +++ b/tests/specs/jsr/import_https_url/analyzable.out @@ -0,0 +1,8 @@ +Download http://127.0.0.1:4250/@denotest/import-https-url/meta.json +Download http://127.0.0.1:4250/@denotest/import-https-url/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/import-https-url/1.0.0/analyzable.ts +Download http://localhost:4545/welcome.ts +error: Uncaught (in promise) TypeError: Importing http://localhost:4545/welcome.ts blocked. JSR packages cannot import non-JSR remote modules for security reasons. +await import("http://localhost:4545/welcome.ts"); +^ + at async http://127.0.0.1:4250/@denotest/import-https-url/1.0.0/analyzable.ts:1:1 diff --git a/tests/specs/jsr/import_https_url/analyzable.ts b/tests/specs/jsr/import_https_url/analyzable.ts new file mode 100644 index 000000000..44382867f --- /dev/null +++ b/tests/specs/jsr/import_https_url/analyzable.ts @@ -0,0 +1 @@ +import "jsr:@denotest/import-https-url/analyzable"; diff --git a/tests/specs/jsr/import_https_url/nonanalyzable.out b/tests/specs/jsr/import_https_url/nonanalyzable.out new file mode 100644 index 000000000..4ae04996c --- /dev/null +++ b/tests/specs/jsr/import_https_url/nonanalyzable.out @@ -0,0 +1,7 @@ +Download http://127.0.0.1:4250/@denotest/import-https-url/meta.json +Download http://127.0.0.1:4250/@denotest/import-https-url/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/import-https-url/1.0.0/unanalyzable.ts +error: Uncaught (in promise) TypeError: Importing http://localhost:4545/welcome.ts blocked. JSR packages cannot import non-JSR remote modules for security reasons. +await import(nonAnalyzableUrl()); +^ + at async http://127.0.0.1:4250/@denotest/import-https-url/1.0.0/unanalyzable.ts:5:1 diff --git a/tests/specs/jsr/import_https_url/nonanalyzable.ts b/tests/specs/jsr/import_https_url/nonanalyzable.ts new file mode 100644 index 000000000..87ccdcfdc --- /dev/null +++ b/tests/specs/jsr/import_https_url/nonanalyzable.ts @@ -0,0 +1 @@ +import "jsr:@denotest/import-https-url/unanalyzable"; diff --git a/tests/specs/jsr/jsx_with_no_pragmas/__test__.jsonc b/tests/specs/jsr/jsx_with_no_pragmas/__test__.jsonc new file mode 100644 index 000000000..c2a269ea6 --- /dev/null +++ b/tests/specs/jsr/jsx_with_no_pragmas/__test__.jsonc @@ -0,0 +1,6 @@ +{ + "base": "jsr", + "args": "run main.ts", + "output": "main.out", + "exitCode": 1 +} diff --git a/tests/specs/jsr/jsx_with_no_pragmas/main.out b/tests/specs/jsr/jsx_with_no_pragmas/main.out new file mode 100644 index 000000000..c3977fe22 --- /dev/null +++ b/tests/specs/jsr/jsx_with_no_pragmas/main.out @@ -0,0 +1,7 @@ +Download [WILDCARD] +error: Uncaught (in promise) ReferenceError: React is not defined + return renderToString(
foo.jsx
); + ^ + at render (http://127.0.0.1:4250/@denotest/jsx-with-no-pragmas/1.0.0/foo.jsx:4:25) + at render (http://127.0.0.1:4250/@denotest/jsx-with-no-pragmas/1.0.0/mod.ts:5:15) + at file:///[WILDCARD]/jsr/jsx_with_no_pragmas/main.ts:3:1 diff --git a/tests/specs/jsr/jsx_with_no_pragmas/main.ts b/tests/specs/jsr/jsx_with_no_pragmas/main.ts new file mode 100644 index 000000000..9d6e5a41e --- /dev/null +++ b/tests/specs/jsr/jsx_with_no_pragmas/main.ts @@ -0,0 +1,3 @@ +import { render } from "jsr:@denotest/jsx-with-no-pragmas@1.0.0"; + +render(); diff --git a/tests/specs/jsr/jsx_with_pragmas/__test__.jsonc b/tests/specs/jsr/jsx_with_pragmas/__test__.jsonc new file mode 100644 index 000000000..a6fa5c7c3 --- /dev/null +++ b/tests/specs/jsr/jsx_with_pragmas/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "base": "jsr", + "args": "run main.ts", + "output": "main.out" +} diff --git a/tests/specs/jsr/jsx_with_pragmas/main.out b/tests/specs/jsr/jsx_with_pragmas/main.out new file mode 100644 index 000000000..c149ba010 --- /dev/null +++ b/tests/specs/jsr/jsx_with_pragmas/main.out @@ -0,0 +1,3 @@ +Download [WILDCARD] +
foo.jsx
+
foo.tsx
diff --git a/tests/specs/jsr/jsx_with_pragmas/main.ts b/tests/specs/jsr/jsx_with_pragmas/main.ts new file mode 100644 index 000000000..4a38c56ad --- /dev/null +++ b/tests/specs/jsr/jsx_with_pragmas/main.ts @@ -0,0 +1,3 @@ +import { render } from "jsr:@denotest/jsx-with-pragmas@1.0.0"; + +render(); diff --git a/tests/specs/jsr/module_graph/__test__.jsonc b/tests/specs/jsr/module_graph/__test__.jsonc new file mode 100644 index 000000000..2528003b5 --- /dev/null +++ b/tests/specs/jsr/module_graph/__test__.jsonc @@ -0,0 +1,11 @@ +{ + "base": "jsr", + "steps": [{ + "args": "run main.ts", + "output": "main.out" + }, { + "cleanDenoDir": true, + "args": "info main.ts", + "output": "main_info.out" + }] +} diff --git a/tests/specs/jsr/module_graph/main.out b/tests/specs/jsr/module_graph/main.out new file mode 100644 index 000000000..1cd0115b9 --- /dev/null +++ b/tests/specs/jsr/module_graph/main.out @@ -0,0 +1,7 @@ +Download http://127.0.0.1:4250/@denotest/module_graph/meta.json +Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0_meta.json +[UNORDERED_START] +Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0/other.ts +Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0/mod.ts +[UNORDERED_END] +Test { other: Other {} } diff --git a/tests/specs/jsr/module_graph/main.ts b/tests/specs/jsr/module_graph/main.ts new file mode 100644 index 000000000..c92823cc2 --- /dev/null +++ b/tests/specs/jsr/module_graph/main.ts @@ -0,0 +1,3 @@ +import { Test } from "jsr:@denotest/module_graph"; + +console.log(new Test()); diff --git a/tests/specs/jsr/module_graph/main_info.out b/tests/specs/jsr/module_graph/main_info.out new file mode 100644 index 000000000..c35cca5b4 --- /dev/null +++ b/tests/specs/jsr/module_graph/main_info.out @@ -0,0 +1,14 @@ +Download http://127.0.0.1:4250/@denotest/module_graph/meta.json +Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0_meta.json +[UNORDERED_START] +Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0/mod.ts +Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0/other.ts +[UNORDERED_END] +local: [WILDCARD]main.ts +type: TypeScript +dependencies: 2 unique +size: [WILDCARD] + +file:///[WILDCARD]/module_graph/main.ts ([WILDCARD]) +└─┬ http://127.0.0.1:4250/@denotest/module_graph/1.4.0/mod.ts ([WILDCARD]) + └── http://127.0.0.1:4250/@denotest/module_graph/1.4.0/other.ts ([WILDCARD]) diff --git a/tests/specs/jsr/no_module_graph/__test__.jsonc b/tests/specs/jsr/no_module_graph/__test__.jsonc new file mode 100644 index 000000000..b3915ecef --- /dev/null +++ b/tests/specs/jsr/no_module_graph/__test__.jsonc @@ -0,0 +1,14 @@ +{ + "base": "jsr", + "steps": [{ + "args": "run main.ts", + "output": "main.out" + }, { + "cleanDenoDir": true, + "args": "info main.ts", + "output": "main_info.out" + }, { + "args": "run --quiet multiple.ts", + "output": "multiple.out" + }] +} diff --git a/tests/specs/jsr/no_module_graph/main.out b/tests/specs/jsr/no_module_graph/main.out new file mode 100644 index 000000000..da9b67e11 --- /dev/null +++ b/tests/specs/jsr/no_module_graph/main.out @@ -0,0 +1,6 @@ +Download http://127.0.0.1:4250/@denotest/no_module_graph/meta.json +Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.0_meta.json +Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.0/mod.ts +Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.0/TestClass.ts +0.1.0 +TestClass {} diff --git a/tests/specs/jsr/no_module_graph/main.ts b/tests/specs/jsr/no_module_graph/main.ts new file mode 100644 index 000000000..6ea030c59 --- /dev/null +++ b/tests/specs/jsr/no_module_graph/main.ts @@ -0,0 +1,4 @@ +import version, { TestClass } from "jsr:@denotest/no_module_graph@0.1.0"; + +console.log(version); +console.log(new TestClass()); diff --git a/tests/specs/jsr/no_module_graph/main_info.out b/tests/specs/jsr/no_module_graph/main_info.out new file mode 100644 index 000000000..0293e4120 --- /dev/null +++ b/tests/specs/jsr/no_module_graph/main_info.out @@ -0,0 +1,12 @@ +Download http://127.0.0.1:4250/@denotest/no_module_graph/meta.json +Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.0_meta.json +Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.0/mod.ts +Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.0/TestClass.ts +local: [WILDCARD]main.ts +type: TypeScript +dependencies: 2 unique +size: [WILDCARD] + +file:///[WILDCARD]/jsr/no_module_graph/main.ts ([WILDCARD]) +└─┬ http://127.0.0.1:4250/@denotest/no_module_graph/0.1.0/mod.ts ([WILDCARD]) + └── http://127.0.0.1:4250/@denotest/no_module_graph/0.1.0/TestClass.ts ([WILDCARD]) diff --git a/tests/specs/jsr/no_module_graph/multiple.out b/tests/specs/jsr/no_module_graph/multiple.out new file mode 100644 index 000000000..8146276d0 --- /dev/null +++ b/tests/specs/jsr/no_module_graph/multiple.out @@ -0,0 +1,2 @@ +0.1.0 +0.2.0 diff --git a/tests/specs/jsr/no_module_graph/multiple.ts b/tests/specs/jsr/no_module_graph/multiple.ts new file mode 100644 index 000000000..660ed8be6 --- /dev/null +++ b/tests/specs/jsr/no_module_graph/multiple.ts @@ -0,0 +1,5 @@ +import version1 from "jsr:@denotest/no_module_graph@0.1.0"; +import version2 from "jsr:@denotest/no_module_graph@^0.2"; + +console.log(version1); +console.log(version2); diff --git a/tests/specs/jsr/subset_type_graph/__test__.jsonc b/tests/specs/jsr/subset_type_graph/__test__.jsonc new file mode 100644 index 000000000..85d04ed54 --- /dev/null +++ b/tests/specs/jsr/subset_type_graph/__test__.jsonc @@ -0,0 +1,6 @@ +{ + "base": "jsr", + "args": "check --all main.ts", + "output": "main.check.out", + "exitCode": 1 +} diff --git a/tests/specs/jsr/subset_type_graph/main.check.out b/tests/specs/jsr/subset_type_graph/main.check.out new file mode 100644 index 000000000..f46610c0a --- /dev/null +++ b/tests/specs/jsr/subset_type_graph/main.check.out @@ -0,0 +1,45 @@ +Download http://127.0.0.1:4250/@denotest/subset-type-graph/meta.json +Download http://127.0.0.1:4250/@denotest/subset-type-graph-invalid/meta.json +Download http://127.0.0.1:4250/@denotest/subset-type-graph/0.1.0_meta.json +Download http://127.0.0.1:4250/@denotest/subset-type-graph-invalid/0.1.0_meta.json +[UNORDERED_START] +Download http://127.0.0.1:4250/@denotest/subset-type-graph/0.1.0/mod.ts +Download http://127.0.0.1:4250/@denotest/subset-type-graph-invalid/0.1.0/mod.ts +[UNORDERED_END] +Check file:///[WILDCARD]/subset_type_graph/main.ts +error: TS2322 [ERROR]: Type 'string' is not assignable to type 'number'. +const invalidTypeCheck: number = ""; + ~~~~~~~~~~~~~~~~ + at http://127.0.0.1:4250/@denotest/subset-type-graph-invalid/0.1.0/mod.ts:11:7 + +TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. +const error1: string = new Foo1().method(); + ~~~~~~ + at file:///[WILDCARD]/subset_type_graph/main.ts:5:7 + +TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. +const error2: string = new Foo2().method(); + ~~~~~~ + at file:///[WILDCARD]/subset_type_graph/main.ts:6:7 + +TS2551 [ERROR]: Property 'method2' does not exist on type 'Foo'. Did you mean 'method'? +new Foo1().method2(); + ~~~~~~~ + at file:///[WILDCARD]/subset_type_graph/main.ts:12:12 + + 'method' is declared here. + method(): number { + ~~~~~~ + at http://127.0.0.1:4250/@denotest/subset-type-graph/0.1.0/mod.ts:8:3 + +TS2551 [ERROR]: Property 'method2' does not exist on type 'Foo'. Did you mean 'method'? +new Foo2().method2(); + ~~~~~~~ + at file:///[WILDCARD]/subset_type_graph/main.ts:13:12 + + 'method' is declared here. + method() { + ~~~~~~ + at http://127.0.0.1:4250/@denotest/subset-type-graph-invalid/0.1.0/mod.ts:2:3 + +Found 5 errors. diff --git a/tests/specs/jsr/subset_type_graph/main.ts b/tests/specs/jsr/subset_type_graph/main.ts new file mode 100644 index 000000000..2fff966a7 --- /dev/null +++ b/tests/specs/jsr/subset_type_graph/main.ts @@ -0,0 +1,13 @@ +import { Foo as Foo1 } from "jsr:@denotest/subset-type-graph@0.1.0"; +import { Foo as Foo2 } from "jsr:@denotest/subset-type-graph-invalid@0.1.0"; + +// these will both raise type checking errors +const error1: string = new Foo1().method(); +const error2: string = new Foo2().method(); +console.log(error1); +console.log(error2); + +// now raise some errors that will show the original code and +// these should source map to the original +new Foo1().method2(); +new Foo2().method2(); diff --git a/tests/specs/jsr/version_not_found/__test__.jsonc b/tests/specs/jsr/version_not_found/__test__.jsonc new file mode 100644 index 000000000..36335985f --- /dev/null +++ b/tests/specs/jsr/version_not_found/__test__.jsonc @@ -0,0 +1,6 @@ +{ + "base": "jsr", + "args": "run -A main.ts", + "output": "main.out", + "exitCode": 1 +} diff --git a/tests/specs/jsr/version_not_found/main.out b/tests/specs/jsr/version_not_found/main.out new file mode 100644 index 000000000..6a32b5d81 --- /dev/null +++ b/tests/specs/jsr/version_not_found/main.out @@ -0,0 +1,5 @@ +Download http://127.0.0.1:4250/@denotest/deps/meta.json +Download http://127.0.0.1:4250/@denotest/deps/meta.json +error: Could not find constraint in the list of versions: @denotest/deps@0.1.4 + Specifier: jsr:@denotest/deps@0.1.4/mod.ts + at file:///[WILDCARD]/version_not_found/main.ts:1:19 diff --git a/tests/specs/jsr/version_not_found/main.ts b/tests/specs/jsr/version_not_found/main.ts new file mode 100644 index 000000000..a7673b744 --- /dev/null +++ b/tests/specs/jsr/version_not_found/main.ts @@ -0,0 +1,2 @@ +import value from "jsr:@denotest/deps@0.1.4/mod.ts"; +console.log(value); diff --git a/tests/specs/jupyter/install_command_not_exists/__test__.jsonc b/tests/specs/jupyter/install_command_not_exists/__test__.jsonc new file mode 100644 index 000000000..9552157bd --- /dev/null +++ b/tests/specs/jupyter/install_command_not_exists/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "jupyter --install", + "output": "install_command_not_exists.out", + "envs": { + "PATH": "" + }, + "exitCode": 1 +} diff --git a/tests/specs/jupyter/install_command_not_exists/install_command_not_exists.out b/tests/specs/jupyter/install_command_not_exists/install_command_not_exists.out new file mode 100644 index 000000000..1bb176e20 --- /dev/null +++ b/tests/specs/jupyter/install_command_not_exists/install_command_not_exists.out @@ -0,0 +1,5 @@ +Warning "deno jupyter" is unstable and might change in the future. +error: Failed to spawn 'jupyter' command. Is JupyterLab installed (https://jupyter.org/install) and available on the PATH? + +Caused by: +[WILDCARD] diff --git a/tests/specs/mod.rs b/tests/specs/mod.rs index d010de43d..feed09871 100644 --- a/tests/specs/mod.rs +++ b/tests/specs/mod.rs @@ -1,6 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. use std::cell::RefCell; +use std::collections::HashMap; use std::collections::HashSet; use std::panic::AssertUnwindSafe; use std::rc::Rc; @@ -127,15 +128,13 @@ fn run_test(test: &Test, diagnostic_logger: Rc>>) { context.deno_dir().path().remove_dir_all(); } - let test_output_path = cwd.join(&step.output); - if !test_output_path.to_string_lossy().ends_with(".out") { - panic!( - "Use the .out extension for output files (invalid: {})", - test_output_path - ); - } - let expected_output = test_output_path.read_to_string(); - let command = context.new_command(); + let expected_output = if step.output.ends_with(".out") { + let test_output_path = cwd.join(&step.output); + test_output_path.read_to_string() + } else { + step.output.clone() + }; + let command = context.new_command().envs(&step.envs); let command = match &step.args { VecOrString::Vec(args) => command.args_vec(args), VecOrString::String(text) => command.args(text), @@ -195,6 +194,8 @@ struct StepMetaData { #[serde(default)] pub clean_deno_dir: bool, pub args: VecOrString, + #[serde(default)] + pub envs: HashMap, pub output: String, #[serde(default)] pub exit_code: i32, @@ -283,14 +284,6 @@ fn collect_tests() -> Vec { let test_dir = PathRef::new(entry.path()); let metadata_path = test_dir.join("__test__.jsonc"); - if !metadata_path.is_file() { - let json_path = test_dir.join("__test__.json"); - if json_path.is_file() { - // automatically rename to jsonc - json_path.rename(&metadata_path); - } - } - let metadata_value = metadata_path.read_jsonc_value(); // checking for "steps" leads to a more targeted error message // instead of when deserializing an untagged enum diff --git a/tests/testdata/coverage/doesnt_exist.out b/tests/testdata/coverage/doesnt_exist.out deleted file mode 100644 index 0b679bcb4..000000000 --- a/tests/testdata/coverage/doesnt_exist.out +++ /dev/null @@ -1 +0,0 @@ -error: No coverage files found diff --git a/tests/testdata/jsr/deps/main.out b/tests/testdata/jsr/deps/main.out deleted file mode 100644 index 621703c4b..000000000 --- a/tests/testdata/jsr/deps/main.out +++ /dev/null @@ -1,13 +0,0 @@ -Download http://127.0.0.1:4250/@denotest/deps/meta.json -Download http://127.0.0.1:4250/@denotest/deps/1.0.0_meta.json -Download http://127.0.0.1:4250/@denotest/module_graph/meta.json -Download http://127.0.0.1:4250/@denotest/no_module_graph/meta.json -Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0_meta.json -Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.1_meta.json -[UNORDERED_START] -Download http://127.0.0.1:4250/@denotest/deps/1.0.0/mod.ts -Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0/other.ts -Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.1/mod.ts -Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.1/TestClass.ts -[UNORDERED_END] -{ version: "0.1.1", other: Other {} } diff --git a/tests/testdata/jsr/deps/main.ts b/tests/testdata/jsr/deps/main.ts deleted file mode 100644 index f48255299..000000000 --- a/tests/testdata/jsr/deps/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import value from "jsr:@denotest/deps"; - -console.log(value); diff --git a/tests/testdata/jsr/deps/main_info.out b/tests/testdata/jsr/deps/main_info.out deleted file mode 100644 index c4d412707..000000000 --- a/tests/testdata/jsr/deps/main_info.out +++ /dev/null @@ -1,22 +0,0 @@ -Download http://127.0.0.1:4250/@denotest/deps/meta.json -Download http://127.0.0.1:4250/@denotest/deps/1.0.0_meta.json -Download http://127.0.0.1:4250/@denotest/module_graph/meta.json -Download http://127.0.0.1:4250/@denotest/no_module_graph/meta.json -Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0_meta.json -Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.1_meta.json -[UNORDERED_START] -Download http://127.0.0.1:4250/@denotest/deps/1.0.0/mod.ts -Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0/other.ts -Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.1/mod.ts -Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.1/TestClass.ts -[UNORDERED_END] -local: [WILDCARD]main.ts -type: TypeScript -dependencies: 4 unique -size: [WILDCARD] - -file:///[WILDCARD]main.ts ([WILDCARD]) -└─┬ http://127.0.0.1:4250/@denotest/deps/1.0.0/mod.ts ([WILDCARD]) - ├── http://127.0.0.1:4250/@denotest/module_graph/1.4.0/other.ts ([WILDCARD]) - └─┬ http://127.0.0.1:4250/@denotest/no_module_graph/0.1.1/mod.ts ([WILDCARD]) - └── http://127.0.0.1:4250/@denotest/no_module_graph/0.1.1/TestClass.ts ([WILDCARD]) diff --git a/tests/testdata/jsr/import_https_url/analyzable.out b/tests/testdata/jsr/import_https_url/analyzable.out deleted file mode 100644 index dd1ca58b4..000000000 --- a/tests/testdata/jsr/import_https_url/analyzable.out +++ /dev/null @@ -1,8 +0,0 @@ -Download http://127.0.0.1:4250/@denotest/import-https-url/meta.json -Download http://127.0.0.1:4250/@denotest/import-https-url/1.0.0_meta.json -Download http://127.0.0.1:4250/@denotest/import-https-url/1.0.0/analyzable.ts -Download http://localhost:4545/welcome.ts -error: Uncaught (in promise) TypeError: Importing http://localhost:4545/welcome.ts blocked. JSR packages cannot import non-JSR remote modules for security reasons. -await import("http://localhost:4545/welcome.ts"); -^ - at async http://127.0.0.1:4250/@denotest/import-https-url/1.0.0/analyzable.ts:1:1 diff --git a/tests/testdata/jsr/import_https_url/analyzable.ts b/tests/testdata/jsr/import_https_url/analyzable.ts deleted file mode 100644 index 44382867f..000000000 --- a/tests/testdata/jsr/import_https_url/analyzable.ts +++ /dev/null @@ -1 +0,0 @@ -import "jsr:@denotest/import-https-url/analyzable"; diff --git a/tests/testdata/jsr/import_https_url/unanalyzable.out b/tests/testdata/jsr/import_https_url/unanalyzable.out deleted file mode 100644 index 4ae04996c..000000000 --- a/tests/testdata/jsr/import_https_url/unanalyzable.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://127.0.0.1:4250/@denotest/import-https-url/meta.json -Download http://127.0.0.1:4250/@denotest/import-https-url/1.0.0_meta.json -Download http://127.0.0.1:4250/@denotest/import-https-url/1.0.0/unanalyzable.ts -error: Uncaught (in promise) TypeError: Importing http://localhost:4545/welcome.ts blocked. JSR packages cannot import non-JSR remote modules for security reasons. -await import(nonAnalyzableUrl()); -^ - at async http://127.0.0.1:4250/@denotest/import-https-url/1.0.0/unanalyzable.ts:5:1 diff --git a/tests/testdata/jsr/import_https_url/unanalyzable.ts b/tests/testdata/jsr/import_https_url/unanalyzable.ts deleted file mode 100644 index 87ccdcfdc..000000000 --- a/tests/testdata/jsr/import_https_url/unanalyzable.ts +++ /dev/null @@ -1 +0,0 @@ -import "jsr:@denotest/import-https-url/unanalyzable"; diff --git a/tests/testdata/jsr/jsx_with_no_pragmas/main.out b/tests/testdata/jsr/jsx_with_no_pragmas/main.out deleted file mode 100644 index c3977fe22..000000000 --- a/tests/testdata/jsr/jsx_with_no_pragmas/main.out +++ /dev/null @@ -1,7 +0,0 @@ -Download [WILDCARD] -error: Uncaught (in promise) ReferenceError: React is not defined - return renderToString(
foo.jsx
); - ^ - at render (http://127.0.0.1:4250/@denotest/jsx-with-no-pragmas/1.0.0/foo.jsx:4:25) - at render (http://127.0.0.1:4250/@denotest/jsx-with-no-pragmas/1.0.0/mod.ts:5:15) - at file:///[WILDCARD]/jsr/jsx_with_no_pragmas/main.ts:3:1 diff --git a/tests/testdata/jsr/jsx_with_no_pragmas/main.ts b/tests/testdata/jsr/jsx_with_no_pragmas/main.ts deleted file mode 100644 index 9d6e5a41e..000000000 --- a/tests/testdata/jsr/jsx_with_no_pragmas/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { render } from "jsr:@denotest/jsx-with-no-pragmas@1.0.0"; - -render(); diff --git a/tests/testdata/jsr/jsx_with_pragmas/main.out b/tests/testdata/jsr/jsx_with_pragmas/main.out deleted file mode 100644 index c149ba010..000000000 --- a/tests/testdata/jsr/jsx_with_pragmas/main.out +++ /dev/null @@ -1,3 +0,0 @@ -Download [WILDCARD] -
foo.jsx
-
foo.tsx
diff --git a/tests/testdata/jsr/jsx_with_pragmas/main.ts b/tests/testdata/jsr/jsx_with_pragmas/main.ts deleted file mode 100644 index 4a38c56ad..000000000 --- a/tests/testdata/jsr/jsx_with_pragmas/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { render } from "jsr:@denotest/jsx-with-pragmas@1.0.0"; - -render(); diff --git a/tests/testdata/jsr/module_graph/main.out b/tests/testdata/jsr/module_graph/main.out deleted file mode 100644 index 1cd0115b9..000000000 --- a/tests/testdata/jsr/module_graph/main.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://127.0.0.1:4250/@denotest/module_graph/meta.json -Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0_meta.json -[UNORDERED_START] -Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0/other.ts -Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0/mod.ts -[UNORDERED_END] -Test { other: Other {} } diff --git a/tests/testdata/jsr/module_graph/main.ts b/tests/testdata/jsr/module_graph/main.ts deleted file mode 100644 index c92823cc2..000000000 --- a/tests/testdata/jsr/module_graph/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Test } from "jsr:@denotest/module_graph"; - -console.log(new Test()); diff --git a/tests/testdata/jsr/module_graph/main_info.out b/tests/testdata/jsr/module_graph/main_info.out deleted file mode 100644 index c35cca5b4..000000000 --- a/tests/testdata/jsr/module_graph/main_info.out +++ /dev/null @@ -1,14 +0,0 @@ -Download http://127.0.0.1:4250/@denotest/module_graph/meta.json -Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0_meta.json -[UNORDERED_START] -Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0/mod.ts -Download http://127.0.0.1:4250/@denotest/module_graph/1.4.0/other.ts -[UNORDERED_END] -local: [WILDCARD]main.ts -type: TypeScript -dependencies: 2 unique -size: [WILDCARD] - -file:///[WILDCARD]/module_graph/main.ts ([WILDCARD]) -└─┬ http://127.0.0.1:4250/@denotest/module_graph/1.4.0/mod.ts ([WILDCARD]) - └── http://127.0.0.1:4250/@denotest/module_graph/1.4.0/other.ts ([WILDCARD]) diff --git a/tests/testdata/jsr/no_module_graph/main.out b/tests/testdata/jsr/no_module_graph/main.out deleted file mode 100644 index da9b67e11..000000000 --- a/tests/testdata/jsr/no_module_graph/main.out +++ /dev/null @@ -1,6 +0,0 @@ -Download http://127.0.0.1:4250/@denotest/no_module_graph/meta.json -Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.0_meta.json -Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.0/mod.ts -Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.0/TestClass.ts -0.1.0 -TestClass {} diff --git a/tests/testdata/jsr/no_module_graph/main.ts b/tests/testdata/jsr/no_module_graph/main.ts deleted file mode 100644 index 6ea030c59..000000000 --- a/tests/testdata/jsr/no_module_graph/main.ts +++ /dev/null @@ -1,4 +0,0 @@ -import version, { TestClass } from "jsr:@denotest/no_module_graph@0.1.0"; - -console.log(version); -console.log(new TestClass()); diff --git a/tests/testdata/jsr/no_module_graph/main_info.out b/tests/testdata/jsr/no_module_graph/main_info.out deleted file mode 100644 index 0293e4120..000000000 --- a/tests/testdata/jsr/no_module_graph/main_info.out +++ /dev/null @@ -1,12 +0,0 @@ -Download http://127.0.0.1:4250/@denotest/no_module_graph/meta.json -Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.0_meta.json -Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.0/mod.ts -Download http://127.0.0.1:4250/@denotest/no_module_graph/0.1.0/TestClass.ts -local: [WILDCARD]main.ts -type: TypeScript -dependencies: 2 unique -size: [WILDCARD] - -file:///[WILDCARD]/jsr/no_module_graph/main.ts ([WILDCARD]) -└─┬ http://127.0.0.1:4250/@denotest/no_module_graph/0.1.0/mod.ts ([WILDCARD]) - └── http://127.0.0.1:4250/@denotest/no_module_graph/0.1.0/TestClass.ts ([WILDCARD]) diff --git a/tests/testdata/jsr/no_module_graph/multiple.out b/tests/testdata/jsr/no_module_graph/multiple.out deleted file mode 100644 index 8146276d0..000000000 --- a/tests/testdata/jsr/no_module_graph/multiple.out +++ /dev/null @@ -1,2 +0,0 @@ -0.1.0 -0.2.0 diff --git a/tests/testdata/jsr/no_module_graph/multiple.ts b/tests/testdata/jsr/no_module_graph/multiple.ts deleted file mode 100644 index 660ed8be6..000000000 --- a/tests/testdata/jsr/no_module_graph/multiple.ts +++ /dev/null @@ -1,5 +0,0 @@ -import version1 from "jsr:@denotest/no_module_graph@0.1.0"; -import version2 from "jsr:@denotest/no_module_graph@^0.2"; - -console.log(version1); -console.log(version2); diff --git a/tests/testdata/jsr/subset_type_graph/main.check.out b/tests/testdata/jsr/subset_type_graph/main.check.out deleted file mode 100644 index f46610c0a..000000000 --- a/tests/testdata/jsr/subset_type_graph/main.check.out +++ /dev/null @@ -1,45 +0,0 @@ -Download http://127.0.0.1:4250/@denotest/subset-type-graph/meta.json -Download http://127.0.0.1:4250/@denotest/subset-type-graph-invalid/meta.json -Download http://127.0.0.1:4250/@denotest/subset-type-graph/0.1.0_meta.json -Download http://127.0.0.1:4250/@denotest/subset-type-graph-invalid/0.1.0_meta.json -[UNORDERED_START] -Download http://127.0.0.1:4250/@denotest/subset-type-graph/0.1.0/mod.ts -Download http://127.0.0.1:4250/@denotest/subset-type-graph-invalid/0.1.0/mod.ts -[UNORDERED_END] -Check file:///[WILDCARD]/subset_type_graph/main.ts -error: TS2322 [ERROR]: Type 'string' is not assignable to type 'number'. -const invalidTypeCheck: number = ""; - ~~~~~~~~~~~~~~~~ - at http://127.0.0.1:4250/@denotest/subset-type-graph-invalid/0.1.0/mod.ts:11:7 - -TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. -const error1: string = new Foo1().method(); - ~~~~~~ - at file:///[WILDCARD]/subset_type_graph/main.ts:5:7 - -TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. -const error2: string = new Foo2().method(); - ~~~~~~ - at file:///[WILDCARD]/subset_type_graph/main.ts:6:7 - -TS2551 [ERROR]: Property 'method2' does not exist on type 'Foo'. Did you mean 'method'? -new Foo1().method2(); - ~~~~~~~ - at file:///[WILDCARD]/subset_type_graph/main.ts:12:12 - - 'method' is declared here. - method(): number { - ~~~~~~ - at http://127.0.0.1:4250/@denotest/subset-type-graph/0.1.0/mod.ts:8:3 - -TS2551 [ERROR]: Property 'method2' does not exist on type 'Foo'. Did you mean 'method'? -new Foo2().method2(); - ~~~~~~~ - at file:///[WILDCARD]/subset_type_graph/main.ts:13:12 - - 'method' is declared here. - method() { - ~~~~~~ - at http://127.0.0.1:4250/@denotest/subset-type-graph-invalid/0.1.0/mod.ts:2:3 - -Found 5 errors. diff --git a/tests/testdata/jsr/subset_type_graph/main.ts b/tests/testdata/jsr/subset_type_graph/main.ts deleted file mode 100644 index 2fff966a7..000000000 --- a/tests/testdata/jsr/subset_type_graph/main.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Foo as Foo1 } from "jsr:@denotest/subset-type-graph@0.1.0"; -import { Foo as Foo2 } from "jsr:@denotest/subset-type-graph-invalid@0.1.0"; - -// these will both raise type checking errors -const error1: string = new Foo1().method(); -const error2: string = new Foo2().method(); -console.log(error1); -console.log(error2); - -// now raise some errors that will show the original code and -// these should source map to the original -new Foo1().method2(); -new Foo2().method2(); diff --git a/tests/testdata/jsr/version_not_found/main.out b/tests/testdata/jsr/version_not_found/main.out deleted file mode 100644 index 6a32b5d81..000000000 --- a/tests/testdata/jsr/version_not_found/main.out +++ /dev/null @@ -1,5 +0,0 @@ -Download http://127.0.0.1:4250/@denotest/deps/meta.json -Download http://127.0.0.1:4250/@denotest/deps/meta.json -error: Could not find constraint in the list of versions: @denotest/deps@0.1.4 - Specifier: jsr:@denotest/deps@0.1.4/mod.ts - at file:///[WILDCARD]/version_not_found/main.ts:1:19 diff --git a/tests/testdata/jsr/version_not_found/main.ts b/tests/testdata/jsr/version_not_found/main.ts deleted file mode 100644 index a7673b744..000000000 --- a/tests/testdata/jsr/version_not_found/main.ts +++ /dev/null @@ -1,2 +0,0 @@ -import value from "jsr:@denotest/deps@0.1.4/mod.ts"; -console.log(value); diff --git a/tests/testdata/jupyter/install_command_not_exists.out b/tests/testdata/jupyter/install_command_not_exists.out deleted file mode 100644 index 1bb176e20..000000000 --- a/tests/testdata/jupyter/install_command_not_exists.out +++ /dev/null @@ -1,5 +0,0 @@ -Warning "deno jupyter" is unstable and might change in the future. -error: Failed to spawn 'jupyter' command. Is JupyterLab installed (https://jupyter.org/install) and available on the PATH? - -Caused by: -[WILDCARD] diff --git a/tests/testdata/types/types.out b/tests/testdata/types/types.out deleted file mode 100644 index 089a9381f..000000000 --- a/tests/testdata/types/types.out +++ /dev/null @@ -1,3 +0,0 @@ -[WILDCARD] -declare namespace Deno [WILDCARD] -declare var window: Window [WILDCARD] -- cgit v1.2.3