2021-06-29 16:52:29 +08:00
|
|
|
use crate::helper::*;
|
|
|
|
|
use flowy_sys::prelude::*;
|
|
|
|
|
|
|
|
|
|
pub async fn hello() -> String { "say hello".to_string() }
|
|
|
|
|
|
2021-07-02 20:45:51 +08:00
|
|
|
#[tokio::test]
|
|
|
|
|
async fn test_init() {
|
|
|
|
|
setup_env();
|
2021-06-29 16:52:29 +08:00
|
|
|
let event = "1";
|
2021-07-03 14:14:10 +08:00
|
|
|
init_dispatch(|| vec![Module::new().event(event, hello)]);
|
2021-06-29 16:52:29 +08:00
|
|
|
|
2021-07-03 22:24:02 +08:00
|
|
|
let request = DispatchRequest::new(event, Payload::None);
|
2021-07-03 14:14:10 +08:00
|
|
|
let resp = async_send(request).await;
|
|
|
|
|
dbg!(&resp);
|
2021-06-29 16:52:29 +08:00
|
|
|
}
|