module.rs 485 B

12345678910111213141516171819202122
  1. use crate::helper::*;
  2. use flowy_sys::prelude::*;
  3. pub async fn hello() -> String { "say hello".to_string() }
  4. #[tokio::test]
  5. async fn test_init() {
  6. setup_env();
  7. let event = "1";
  8. init_dispatch(|| vec![Module::new().event(event, hello)]);
  9. let request = DispatchRequest::new(event);
  10. let _ = EventDispatch::async_send(
  11. request,
  12. Some(|resp| {
  13. Box::pin(async move {
  14. dbg!(&resp);
  15. })
  16. }),
  17. )
  18. .await;
  19. }