Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2921,7 +2921,7 @@ fn is_unevaluated_node_compat_reason(reason: &str) -> bool {
r == "newly discovered, not yet evaluated" || r.starts_with("inherited: newly discovered")
}

fn node_compat_category_from_entry(
pub fn node_compat_category_from_entry(
path: &str,
entry: &serde_json::Value,
inherited: Option<NodeCompatCategory>,
Expand Down Expand Up @@ -2991,6 +2991,20 @@ pub fn load_node_compat_config_with_suite_root(
.and_then(|v| v.as_object())
.ok_or_else(|| anyhow::anyhow!("config.jsonc missing 'tests' object"))?;

// Every configured entry counts in the inventory, so its source must exist; otherwise the
// runner and report would silently disagree about the denominator.
let missing: Vec<&String> = tests_obj
.keys()
.filter(|path| !suite_root.join(path).is_file())
.collect();
if !missing.is_empty() {
return Err(anyhow!(
"{} node_compat config entries have no vendored source under {}: {missing:?}; map each one to its replacement or remove it with a recorded reason",
missing.len(),
suite_root.display()
));
}

let mut tests = Vec::new();
for (path, opts) in tests_obj {
let category = node_compat_category_from_entry(path, opts, None, suite_root)?;
Expand Down
Loading