From 9d924341b310a23ae8c028c27be7b79bf00c2c88 Mon Sep 17 00:00:00 2001 From: Dwi Siswanto Date: Tue, 3 Oct 2023 14:55:12 +0700 Subject: [PATCH] test: add Verbose case --- teler_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/teler_test.go b/teler_test.go index 2bd38e1..d1befd8 100644 --- a/teler_test.go +++ b/teler_test.go @@ -288,6 +288,27 @@ func TestNewWithFalcoSidekickURL(t *testing.T) { } } +func TestNewWithVerbose(t *testing.T) { + // Initialize teler + telerMiddleware := New(Options{NoStderr: true, Verbose: true}) + wrappedHandler := telerMiddleware.Handler(handler) + + // Create a test server with the wrapped handler + ts := httptest.NewServer(wrappedHandler) + defer ts.Close() + + // Create a request to send to the test server + req, err := http.NewRequest("GET", ts.URL, nil) + if err != nil { + t.Fatal(err) + } + + _, err = client.Do(req) + if err != nil { + t.Fatal(err) + } +} + func TestNewCustomsFromFile(t *testing.T) { // Initialize teler telerMiddleware := New(Options{