module.rs 438 B

12345678910111213141516171819
  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 = ModuleRequest::new(event);
  10. let _ = EventDispatch::async_send(request, |resp| {
  11. Box::pin(async move {
  12. dbg!(&resp);
  13. })
  14. })
  15. .await;
  16. }