summaryrefslogtreecommitdiff
path: root/tests/specs/mod.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-03-15 13:27:52 -0400
committerGitHub <noreply@github.com>2024-03-15 17:27:52 +0000
commit392579b5a673964752e38e1e0d9c2c9ae223a382 (patch)
tree895345b9ace697d687bad2519896c39e97ce9f4d /tests/specs/mod.rs
parentce768bac834c1efebf2663b01f6e46db99329631 (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.
Diffstat (limited to 'tests/specs/mod.rs')
-rw-r--r--tests/specs/mod.rs10
1 files changed, 9 insertions, 1 deletions
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