Skip to main content

momus_diff/
lib.rs

1//! Regression/diff testing — compare API responses between environments.
2//!
3//! Runs the same test plan against two environments (e.g. staging vs production)
4//! and reports differences in responses: body changes, new/missing fields,
5//! status code changes, header differences.
6//!
7//! # Example
8//!
9//! ```rust,ignore
10//! use momus_diff::{DiffConfig, run_diff};
11//! use momus_core::ast::TestPlan;
12//!
13//! let plan: TestPlan = serde_json::from_str(r#"{"name":"test","base_url":"http://localhost","steps":[]}"#).unwrap();
14//! let config = DiffConfig {
15//!     baseline_url: "https://api-v1.example.com".into(),
16//!     target_url: "https://api-v2.example.com".into(),
17//!     ..Default::default()
18//! };
19//! let report = run_diff(&plan, &config).await.unwrap();
20//! println!("Changes: {} added, {} removed, {} modified", report.fields_added, report.fields_removed, report.fields_modified);
21//! ```
22
23pub mod config;
24pub mod report;
25pub mod runner;
26
27pub use config::*;
28pub use report::*;
29pub use runner::*;