Basic tests
This commit is contained in:
parent
cae038af8f
commit
e6af81d694
|
@ -1820,11 +1820,4 @@ mod example {
|
||||||
|
|
||||||
event.subscribe(arc_mut_second_consumer.clone()).unwrap();
|
event.subscribe(arc_mut_second_consumer.clone()).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
|
||||||
async fn test_gateway_establish() {
|
|
||||||
let _gateway = Gateway::new("ws://localhost:3001/".to_string())
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
mod common;
|
||||||
|
use chorus::gateway::*;
|
||||||
|
use chorus::types;
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
/// Tests establishing a connection (hello and heartbeats) on the local gateway;
|
||||||
|
async fn test_gateway_establish() {
|
||||||
|
let bundle = common::setup().await;
|
||||||
|
|
||||||
|
Gateway::new(bundle.urls.wss).await.unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
/// Tests establishing a connection and authenticating
|
||||||
|
async fn test_gateway_authenticate() {
|
||||||
|
let bundle = common::setup().await;
|
||||||
|
|
||||||
|
let gateway = Gateway::new(bundle.urls.wss).await.unwrap();
|
||||||
|
|
||||||
|
let mut identify = types::GatewayIdentifyPayload::common();
|
||||||
|
identify.token = bundle.user.token;
|
||||||
|
|
||||||
|
gateway.send_identify(identify).await;
|
||||||
|
}
|
Loading…
Reference in New Issue