Skip to content

Commit

Permalink
JWT AUTH
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishaandham19 committed Jul 31, 2022
1 parent 17bd13f commit f3d4741
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions tests/main_test.go
Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
package tests

import (
"io/ioutil"
"net/http"
"net/http/httptest"
"strings"
"testing"
)

func TestBaseURL(t *testing.T) {
resp := httptest.NewRecorder()

req, err := http.NewRequest("GET", "http://localhost:8080", nil)
if err != nil {
t.Fatal(err)
}

http.DefaultServeMux.ServeHTTP(resp, req)
if p, err := ioutil.ReadAll(resp.Body); err != nil {
t.Fail()
} else {
if strings.Contains(string(p), "Error") {
t.Errorf("header response shouldn't return error: %s", p)
} else if !strings.Contains(string(p), `API live and kicking`) {
t.Errorf("header response doesn't match:\n%s", p)
}
}
return
}

0 comments on commit f3d4741

Please # to comment.