From 92555854bd77bcb61ee567b78d9b8dfd0cbdc37a Mon Sep 17 00:00:00 2001 From: conneroisu Date: Thu, 19 Sep 2024 22:17:34 -0400 Subject: [PATCH] create a client test with options --- client_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/client_test.go b/client_test.go index 07a7708..71f5d26 100644 --- a/client_test.go +++ b/client_test.go @@ -2,3 +2,26 @@ // +build !test package groq + +import ( + "net/http" + "os" + "testing" + + "github.com/rs/zerolog" +) + +func TestClient(t *testing.T) { + client, err := NewClient( + "test", + WithBaseURL("http://localhost/v1"), + WithClient(http.DefaultClient), + WithLogger(zerolog.New(os.Stderr).Level(zerolog.DebugLevel).With().Timestamp().Logger()), + ) + if err != nil { + t.Fatal(err) + } + if client == nil { + t.Fatal("client is nil") + } +}