1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-10-02 07:18: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 {