diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-04-01 21:58:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-01 21:58:05 -0400 |
commit | ca5e5c7e9c8bb68beb751c25f2f08f18a59cd76e (patch) | |
tree | e37c6a4ad7957e3c5703b2af02c7acabfd925ede | |
parent | 858abbe745aa8188654120d4999ab983b014c197 (diff) |
chore(specs): add jsr and npm env vars to tests by default (#23171)
-rw-r--r-- | tests/specs/bench/filter_group_header/main.out | 4 | ||||
-rw-r--r-- | tests/specs/check/cjs_default_export/__test__.jsonc | 1 | ||||
-rw-r--r-- | tests/specs/jsr/deps/__test__.jsonc | 1 | ||||
-rw-r--r-- | tests/specs/jsr/import_https_url/__test__.jsonc | 1 | ||||
-rw-r--r-- | tests/specs/jsr/jsx_with_no_pragmas/__test__.jsonc | 1 | ||||
-rw-r--r-- | tests/specs/jsr/jsx_with_pragmas/__test__.jsonc | 1 | ||||
-rw-r--r-- | tests/specs/jsr/module_graph/__test__.jsonc | 1 | ||||
-rw-r--r-- | tests/specs/jsr/no_module_graph/__test__.jsonc | 1 | ||||
-rw-r--r-- | tests/specs/jsr/no_unused_params/__test__.jsonc | 1 | ||||
-rw-r--r-- | tests/specs/jsr/subset_type_graph/__test__.jsonc | 1 | ||||
-rw-r--r-- | tests/specs/jsr/version_not_found/__test__.jsonc | 1 | ||||
-rw-r--r-- | tests/specs/mod.rs | 15 | ||||
-rw-r--r-- | tests/specs/npm/check_pkg_json_import/__test__.jsonc | 1 | ||||
-rw-r--r-- | tests/specs/npm/conditional_exports/__test__.jsonc | 1 | ||||
-rw-r--r-- | tests/specs/npm/conditional_exports_node_modules_dir/__test__.jsonc | 1 | ||||
-rw-r--r-- | tests/specs/npm/es_module/__test__.jsonc | 1 |
16 files changed, 8 insertions, 25 deletions
diff --git a/tests/specs/bench/filter_group_header/main.out b/tests/specs/bench/filter_group_header/main.out index e8b11299c..efe157f6c 100644 --- a/tests/specs/bench/filter_group_header/main.out +++ b/tests/specs/bench/filter_group_header/main.out @@ -7,7 +7,7 @@ benchmark time (avg) iter/s (min … max) p75 --------------------------------------------------------------- ----------------------------- group G1 -G1-B [WILDCARD] +G1-B [WILDCARD] group G2 -G2-B [WILDCARD]
\ No newline at end of file +G2-B [WILDCARD]
\ No newline at end of file diff --git a/tests/specs/check/cjs_default_export/__test__.jsonc b/tests/specs/check/cjs_default_export/__test__.jsonc index 852942826..a991c6eed 100644 --- a/tests/specs/check/cjs_default_export/__test__.jsonc +++ b/tests/specs/check/cjs_default_export/__test__.jsonc @@ -1,5 +1,4 @@ { - "base": "npm", "args": "check main.ts", "output": "main.out", "exitCode": 1 diff --git a/tests/specs/jsr/deps/__test__.jsonc b/tests/specs/jsr/deps/__test__.jsonc index 2528003b5..a8837a8b5 100644 --- a/tests/specs/jsr/deps/__test__.jsonc +++ b/tests/specs/jsr/deps/__test__.jsonc @@ -1,5 +1,4 @@ { - "base": "jsr", "steps": [{ "args": "run main.ts", "output": "main.out" diff --git a/tests/specs/jsr/import_https_url/__test__.jsonc b/tests/specs/jsr/import_https_url/__test__.jsonc index 597b8e009..8ba999d8a 100644 --- a/tests/specs/jsr/import_https_url/__test__.jsonc +++ b/tests/specs/jsr/import_https_url/__test__.jsonc @@ -1,5 +1,4 @@ { - "base": "jsr", "steps": [{ "args": "run -A analyzable.ts", "output": "analyzable.out", diff --git a/tests/specs/jsr/jsx_with_no_pragmas/__test__.jsonc b/tests/specs/jsr/jsx_with_no_pragmas/__test__.jsonc index c2a269ea6..7b5c5e1b6 100644 --- a/tests/specs/jsr/jsx_with_no_pragmas/__test__.jsonc +++ b/tests/specs/jsr/jsx_with_no_pragmas/__test__.jsonc @@ -1,5 +1,4 @@ { - "base": "jsr", "args": "run main.ts", "output": "main.out", "exitCode": 1 diff --git a/tests/specs/jsr/jsx_with_pragmas/__test__.jsonc b/tests/specs/jsr/jsx_with_pragmas/__test__.jsonc index a6fa5c7c3..5517e693d 100644 --- a/tests/specs/jsr/jsx_with_pragmas/__test__.jsonc +++ b/tests/specs/jsr/jsx_with_pragmas/__test__.jsonc @@ -1,5 +1,4 @@ { - "base": "jsr", "args": "run main.ts", "output": "main.out" } diff --git a/tests/specs/jsr/module_graph/__test__.jsonc b/tests/specs/jsr/module_graph/__test__.jsonc index 2528003b5..a8837a8b5 100644 --- a/tests/specs/jsr/module_graph/__test__.jsonc +++ b/tests/specs/jsr/module_graph/__test__.jsonc @@ -1,5 +1,4 @@ { - "base": "jsr", "steps": [{ "args": "run main.ts", "output": "main.out" diff --git a/tests/specs/jsr/no_module_graph/__test__.jsonc b/tests/specs/jsr/no_module_graph/__test__.jsonc index b3915ecef..6c89ccb54 100644 --- a/tests/specs/jsr/no_module_graph/__test__.jsonc +++ b/tests/specs/jsr/no_module_graph/__test__.jsonc @@ -1,5 +1,4 @@ { - "base": "jsr", "steps": [{ "args": "run main.ts", "output": "main.out" diff --git a/tests/specs/jsr/no_unused_params/__test__.jsonc b/tests/specs/jsr/no_unused_params/__test__.jsonc index 4192ad5dd..981d99fba 100644 --- a/tests/specs/jsr/no_unused_params/__test__.jsonc +++ b/tests/specs/jsr/no_unused_params/__test__.jsonc @@ -1,5 +1,4 @@ { - "base": "jsr", "steps": [{ "args": "check --all main.ts", "output": "main.out" diff --git a/tests/specs/jsr/subset_type_graph/__test__.jsonc b/tests/specs/jsr/subset_type_graph/__test__.jsonc index 85d04ed54..d62e2283f 100644 --- a/tests/specs/jsr/subset_type_graph/__test__.jsonc +++ b/tests/specs/jsr/subset_type_graph/__test__.jsonc @@ -1,5 +1,4 @@ { - "base": "jsr", "args": "check --all main.ts", "output": "main.check.out", "exitCode": 1 diff --git a/tests/specs/jsr/version_not_found/__test__.jsonc b/tests/specs/jsr/version_not_found/__test__.jsonc index 36335985f..91d7523af 100644 --- a/tests/specs/jsr/version_not_found/__test__.jsonc +++ b/tests/specs/jsr/version_not_found/__test__.jsonc @@ -1,5 +1,4 @@ { - "base": "jsr", "args": "run -A main.ts", "output": "main.out", "exitCode": 1 diff --git a/tests/specs/mod.rs b/tests/specs/mod.rs index 17263b8b9..a8c13f99a 100644 --- a/tests/specs/mod.rs +++ b/tests/specs/mod.rs @@ -101,15 +101,12 @@ fn run_test(test: &Test, diagnostic_logger: Rc<RefCell<Vec<u8>>>) { builder = builder.cwd(cwd.to_string_lossy()); } - if let Some(base) = &metadata.base { - match base.as_str() { - "npm" => { - builder = builder.add_npm_env_vars(); - } - "jsr" => { - builder = builder.add_jsr_env_vars().add_npm_env_vars(); - } - _ => panic!("Unknown test base: {}", base), + match &metadata.base { + // todo(dsherret): add bases in the future as needed + Some(base) => panic!("Unknown test base: {}", base), + None => { + // by default add npm and jsr env vars + builder = builder.add_jsr_env_vars().add_npm_env_vars(); } } diff --git a/tests/specs/npm/check_pkg_json_import/__test__.jsonc b/tests/specs/npm/check_pkg_json_import/__test__.jsonc index ce8e53280..77487e6b4 100644 --- a/tests/specs/npm/check_pkg_json_import/__test__.jsonc +++ b/tests/specs/npm/check_pkg_json_import/__test__.jsonc @@ -1,5 +1,4 @@ { - "base": "npm", "args": "check --all main.ts", "output": "main.out" } diff --git a/tests/specs/npm/conditional_exports/__test__.jsonc b/tests/specs/npm/conditional_exports/__test__.jsonc index 72b058cbf..57a8d89e4 100644 --- a/tests/specs/npm/conditional_exports/__test__.jsonc +++ b/tests/specs/npm/conditional_exports/__test__.jsonc @@ -1,5 +1,4 @@ { - "base": "npm", "args": "run --allow-read main.js", "output": "main.out" } diff --git a/tests/specs/npm/conditional_exports_node_modules_dir/__test__.jsonc b/tests/specs/npm/conditional_exports_node_modules_dir/__test__.jsonc index 09ea8b23b..757e1c4e0 100644 --- a/tests/specs/npm/conditional_exports_node_modules_dir/__test__.jsonc +++ b/tests/specs/npm/conditional_exports_node_modules_dir/__test__.jsonc @@ -1,5 +1,4 @@ { - "base": "npm", "tempDir": true, "args": "run --allow-read --node-modules-dir main.js", "output": "main.out" diff --git a/tests/specs/npm/es_module/__test__.jsonc b/tests/specs/npm/es_module/__test__.jsonc index f720a2bc0..7fd8c95e0 100644 --- a/tests/specs/npm/es_module/__test__.jsonc +++ b/tests/specs/npm/es_module/__test__.jsonc @@ -1,5 +1,4 @@ { - "base": "npm", "steps": [{ "args": "run --allow-read --allow-env main.js", "output": "main.out" |