Skip to main content

published

Function published 

Source
pub fn published<T, E: Encoding<T>, O>(
    topic: &Topic<T, E, O>,
) -> Result<Vec<Message<T>>, Error>
Expand description

What the current test has published to topic, in the order it was published: by the test itself, and by the code it called.

Under encore test nothing handles what a test publishes. This is how the test sees it, to assert on — and, when it wants a handler run, to hand to it.

ⓘ
signed_up("ada").await?;
let published = encore::testing::published(&SIGNUPS)?;
assert_eq!(published.len(), 1);
assert_eq!(published[0].data.user_id, "ada");
send_welcome(published[0].clone()).await?;