mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-03-27 20:40:10 +00:00
Fixed integration test
This commit is contained in:
parent
a3a914ac4a
commit
7f5a470024
|
@ -28,6 +28,10 @@ func TestIntegration(t *testing.T) {
|
||||||
}
|
}
|
||||||
gateway = g
|
gateway = g
|
||||||
|
|
||||||
|
if err := g.Open(); err != nil {
|
||||||
|
t.Fatal("Failed to authenticate with Discord:", err)
|
||||||
|
}
|
||||||
|
|
||||||
ready, ok := wait(t, gateway.Events).(*ReadyEvent)
|
ready, ok := wait(t, gateway.Events).(*ReadyEvent)
|
||||||
if !ok {
|
if !ok {
|
||||||
t.Fatal("Event received is not of type Ready:", ready)
|
t.Fatal("Event received is not of type Ready:", ready)
|
||||||
|
@ -55,6 +59,10 @@ func TestIntegration(t *testing.T) {
|
||||||
if !ok {
|
if !ok {
|
||||||
t.Fatal("Event received is not of type Ready:", ready)
|
t.Fatal("Event received is not of type Ready:", ready)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := g.Close(); err != nil {
|
||||||
|
t.Fatal("Failed to close Gateway:", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func wait(t *testing.T, evCh chan interface{}) interface{} {
|
func wait(t *testing.T, evCh chan interface{}) interface{} {
|
||||||
|
|
Loading…
Reference in a new issue