Skip to main content

Module testing

Module testing 

Source
Expand description

Driving a screen in unit tests — no game, no graphics.

ⓘ
let mut h = TestHost::<View>::new(CounterVm::default());
h.open();
h.click_id("add");
assert_eq!(h.vm().count, 1);
assert_eq!(h.text("label").as_deref(), Some("Clicked 1 times"));

Every input is followed by a frame, like in the game.

Structs§

TestHost
A screen hosted for tests.