Fixed integration test

This commit is contained in:
diamondburned (Forefront) 2020-01-17 23:20:05 -08:00
parent a3a914ac4a
commit 7f5a470024
1 changed files with 8 additions and 0 deletions

View File

@ -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{} {