Function mitosis::init_test[][src]

pub fn init_test()
Expand description

Initialize mitosis within a #[test]. You need to also have

#[test]
fn mitosis() {
    init_test()
}

in your crate root, because spawn calls the test binary with --exact mitosis

Note that using mitosis within tests is slow. Whenever you call spawn the entire test harness is executed before actually running your closure.

Note that if you use init instead of init_test inside the mitosis test, then you can’t do nested calls to mitosis::spawn inside tests

Safety

It is not unsafe to omit this function, however mitosis::spawn may lead to unexpected behavior.