diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-03-15 13:27:52 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-15 17:27:52 +0000 |
commit | 392579b5a673964752e38e1e0d9c2c9ae223a382 (patch) | |
tree | 895345b9ace697d687bad2519896c39e97ce9f4d | |
parent | ce768bac834c1efebf2663b01f6e46db99329631 (diff) |
chore(specs): use jsonc for metadata file (#22946)
Avoids the comment diagnostic that vscode gives. Also, automatically
renames .json to .jsonc for the time being.
-rw-r--r-- | tests/specs/check/types_resolved_relative_config/__test__.jsonc (renamed from tests/specs/check/types_resolved_relative_config/__test__.json) | 0 | ||||
-rw-r--r-- | tests/specs/import_map/import_map_config/__test__.jsonc (renamed from tests/specs/import_map/import_map_config/__test__.json) | 0 | ||||
-rw-r--r-- | tests/specs/info/ts_error/__test__.jsonc (renamed from tests/specs/info/ts_error/__test__.json) | 0 | ||||
-rw-r--r-- | tests/specs/mod.rs | 10 | ||||
-rw-r--r-- | tests/specs/npm/check_pkg_json_import/__test__.jsonc (renamed from tests/specs/npm/check_pkg_json_import/__test__.json) | 0 | ||||
-rw-r--r-- | tests/specs/npm/conditional_exports/__test__.jsonc (renamed from tests/specs/npm/conditional_exports/__test__.json) | 0 | ||||
-rw-r--r-- | tests/specs/npm/conditional_exports_node_modules_dir/__test__.jsonc (renamed from tests/specs/npm/conditional_exports_node_modules_dir/__test__.json) | 0 | ||||
-rw-r--r-- | tests/specs/npm/es_module/__test__.jsonc (renamed from tests/specs/npm/es_module/__test__.json) | 0 | ||||
-rw-r--r-- | tests/specs/run/redirect_javascript/__test__.jsonc (renamed from tests/specs/run/redirect_javascript/__test__.json) | 0 | ||||
-rw-r--r-- | tests/specs/test/sanitizer_with_error/__test__.jsonc (renamed from tests/specs/test/sanitizer_with_error/__test__.json) | 0 | ||||
-rw-r--r-- | tests/specs/test/sanitizer_with_top_level_ops/__test__.jsonc (renamed from tests/specs/test/sanitizer_with_top_level_ops/__test__.json) | 0 |
11 files changed, 9 insertions, 1 deletions
diff --git a/tests/specs/check/types_resolved_relative_config/__test__.json b/tests/specs/check/types_resolved_relative_config/__test__.jsonc index 6f4937209..6f4937209 100644 --- a/tests/specs/check/types_resolved_relative_config/__test__.json +++ b/tests/specs/check/types_resolved_relative_config/__test__.jsonc diff --git a/tests/specs/import_map/import_map_config/__test__.json b/tests/specs/import_map/import_map_config/__test__.jsonc index b0463a231..b0463a231 100644 --- a/tests/specs/import_map/import_map_config/__test__.json +++ b/tests/specs/import_map/import_map_config/__test__.jsonc diff --git a/tests/specs/info/ts_error/__test__.json b/tests/specs/info/ts_error/__test__.jsonc index 9ec9b6044..9ec9b6044 100644 --- a/tests/specs/info/ts_error/__test__.json +++ b/tests/specs/info/ts_error/__test__.jsonc diff --git a/tests/specs/mod.rs b/tests/specs/mod.rs index 7795f47de..d010de43d 100644 --- a/tests/specs/mod.rs +++ b/tests/specs/mod.rs @@ -282,7 +282,15 @@ fn collect_tests() -> Vec<TestCategory> { } let test_dir = PathRef::new(entry.path()); - let metadata_path = test_dir.join("__test__.json"); + 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/specs/npm/check_pkg_json_import/__test__.json b/tests/specs/npm/check_pkg_json_import/__test__.jsonc index ce8e53280..ce8e53280 100644 --- a/tests/specs/npm/check_pkg_json_import/__test__.json +++ b/tests/specs/npm/check_pkg_json_import/__test__.jsonc diff --git a/tests/specs/npm/conditional_exports/__test__.json b/tests/specs/npm/conditional_exports/__test__.jsonc index 72b058cbf..72b058cbf 100644 --- a/tests/specs/npm/conditional_exports/__test__.json +++ b/tests/specs/npm/conditional_exports/__test__.jsonc diff --git a/tests/specs/npm/conditional_exports_node_modules_dir/__test__.json b/tests/specs/npm/conditional_exports_node_modules_dir/__test__.jsonc index 09ea8b23b..09ea8b23b 100644 --- a/tests/specs/npm/conditional_exports_node_modules_dir/__test__.json +++ b/tests/specs/npm/conditional_exports_node_modules_dir/__test__.jsonc diff --git a/tests/specs/npm/es_module/__test__.json b/tests/specs/npm/es_module/__test__.jsonc index f720a2bc0..f720a2bc0 100644 --- a/tests/specs/npm/es_module/__test__.json +++ b/tests/specs/npm/es_module/__test__.jsonc diff --git a/tests/specs/run/redirect_javascript/__test__.json b/tests/specs/run/redirect_javascript/__test__.jsonc index 1fd0b4cb1..1fd0b4cb1 100644 --- a/tests/specs/run/redirect_javascript/__test__.json +++ b/tests/specs/run/redirect_javascript/__test__.jsonc diff --git a/tests/specs/test/sanitizer_with_error/__test__.json b/tests/specs/test/sanitizer_with_error/__test__.jsonc index 67b65184f..67b65184f 100644 --- a/tests/specs/test/sanitizer_with_error/__test__.json +++ b/tests/specs/test/sanitizer_with_error/__test__.jsonc diff --git a/tests/specs/test/sanitizer_with_top_level_ops/__test__.json b/tests/specs/test/sanitizer_with_top_level_ops/__test__.jsonc index f3862a7ab..f3862a7ab 100644 --- a/tests/specs/test/sanitizer_with_top_level_ops/__test__.json +++ b/tests/specs/test/sanitizer_with_top_level_ops/__test__.jsonc |