Skip to content

Commit

Permalink
fix: unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ubogdan committed Oct 14, 2021
1 parent bca6b49 commit 43abcc2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package fiberSwagger

import (
"html/template"
"log"
"net/http"
"path/filepath"
"regexp"
Expand Down Expand Up @@ -80,7 +79,7 @@ func FiberWrapHandler(configFns ...func(c *Config)) fiber.Handler {
return func(c *fiber.Ctx) error {
matches := re.FindStringSubmatch(string(c.Request().URI().Path()))
path := matches[2]
log.Printf("path %s", c.Request().URI().Path())

once.Do(func() {
h.Prefix = matches[1]
})
Expand All @@ -92,7 +91,6 @@ func FiberWrapHandler(configFns ...func(c *Config)) fiber.Handler {
case ".png", ".js":
c.Type(fileExt[0:])
}
log.Printf("fileExt %s", fileExt)

switch path {
case "":
Expand Down
2 changes: 1 addition & 1 deletion swagger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func TestWrapHandler(t *testing.T) {
func performRequest(method, target string, e *fiber.App) *http.Response {
r := httptest.NewRequest(method, target, nil)

res, _ := e.Test(r, 100)
res, _ := e.Test(r)

return res
}
Expand Down

0 comments on commit 43abcc2

Please sign in to comment.