| Crates.io | wireframe_testing |
| lib.rs | wireframe_testing |
| version | 0.1.0 |
| created_at | 2025-11-29 19:08:31.755132+00 |
| updated_at | 2025-11-29 19:08:31.755132+00 |
| description | Helper utilities for exercising Wireframe applications in tests |
| homepage | |
| repository | https://github.com/leynos/wireframe |
| max_upload_size | |
| id | 1957281 |
| size | 74,504 |
Helper utilities for exercising wireframe
applications in tests without opening real sockets. The crate runs a
WireframeApp against in-memory duplex streams, captures every frame the app
emits, and provides small helpers for encoding or decoding frames so assertions
stay focused on behaviour rather than plumbing.
use wireframe::app::WireframeApp;
use wireframe_testing::{decode_frames, drive_with_bincode, logger};
#[tokio::test]
async fn drives_app() -> std::io::Result<()> {
let _log_guard = logger();
let app = WireframeApp::new().expect("failed to initialise app");
let raw = drive_with_bincode(app, 42u8).await?;
let frames = decode_frames(raw);
assert_eq!(frames.len(), 1);
Ok(())
}
cargo test -p wireframe_testingThe command exercises the helpers in isolation. Run it before publishing
changes to ensure the test fixtures continue to match the main wireframe
crate's expectations.