Skip to content

Commit 8ccd05a

Browse files
committed
add codecov
1 parent 09dc51f commit 8ccd05a

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

casbin_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,3 +377,23 @@ func TestJWTWithConfig_Functions(t *testing.T) {
377377
})
378378
}
379379
}
380+
381+
func TestJWTWithConfig_Skipper(t *testing.T) {
382+
e := echo.New()
383+
384+
e.GET("/", func(c echo.Context) error {
385+
return c.JSON(http.StatusOK, "ok")
386+
})
387+
388+
e.Use(CasbinWithConfig(Config{
389+
Enforcer: enforcer,
390+
Skipper: func(c echo.Context) bool { return true },
391+
}))
392+
393+
req := httptest.NewRequest(http.MethodGet, "/", nil)
394+
resp := httptest.NewRecorder()
395+
396+
e.ServeHTTP(resp, req)
397+
398+
assert.Equal(t, http.StatusOK, resp.Code)
399+
}

codecov.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
coverage:
2+
range: 50..75
3+
round: down
4+
precision: 2

0 commit comments

Comments
 (0)