1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-19 21:32:49 +00:00

Gateway: Add URL test

This commit is contained in:
diamondburned 2021-04-02 20:03:25 -07:00 committed by diamondburned
parent 2dadb0701d
commit c9a7ec8122

View file

@ -21,6 +21,21 @@ func init() {
}
}
func TestURL(t *testing.T) {
u, err := URL()
if err != nil {
t.Fatal("failed to get gateway URL:", err)
}
if u == "" {
t.Fatal("gateway URL is empty")
}
if !strings.HasPrefix(u, "wss://") {
t.Fatal("gatewayURL is invalid:", u)
}
}
func TestInvalidToken(t *testing.T) {
g, err := NewGateway("bad token")
if err != nil {