Skip to content

Commit

Permalink
Add Connect test to ensure err instead of hanging for missing/invalid…
Browse files Browse the repository at this point in the history
… token

Refs: ngrok#175
  • Loading branch information
swalx committed Jul 24, 2024
1 parent 2928705 commit 368dd44
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions session_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ngrok

import (
"context"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -20,3 +21,9 @@ func TestUserAgent(t *testing.T) {
}).ToUserAgent()
require.Equal(t, "agent-official-go/3.2.1 ({\"ProxyType\": \"socks5\", \"ConfigVersion\": \"2\"})", s)
}

func TestConnect(t *testing.T) {
// ensure err if token is invalid or is missing
_, err := Connect(context.Background())
require.Error(t, err)
}

0 comments on commit 368dd44

Please sign in to comment.