From c9a7ec8122bbfb4926316d432123e9180084417d Mon Sep 17 00:00:00 2001 From: diamondburned Date: Fri, 2 Apr 2021 20:03:25 -0700 Subject: [PATCH] Gateway: Add URL test --- gateway/integration_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gateway/integration_test.go b/gateway/integration_test.go index 4daefdc..05d8066 100644 --- a/gateway/integration_test.go +++ b/gateway/integration_test.go @@ -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 {