use super::common::{create_config, fixture_path};
#[cfg_attr(miri, ignore)]
#[test]
fn node_modules_bin_path_credits_the_package_of_the_binary() {
let root = fixture_path("node-modules-bin-path");
let config = create_config(root);
let results = fallow_core::analyze(&config).expect("analysis should succeed");
let unused: Vec<&str> = results
.unused_dependencies
.iter()
.map(|finding| finding.dep.package_name.as_str())
.collect();
assert_eq!(
unused,
["idle-dep"],
"a node_modules/.bin path credits the package that declares the binary"
);
assert!(
results.unlisted_dependencies.is_empty(),
"a binary name without a declared package reports no unlisted dependency"
);
}