setupPushTest creates a common test setup for webpush notification tests. The test HTTP client bypasses SSRF protection so that httptest.Server (bound to 127.0.0.1) can be reached.
(ctx context.Context, t *testing.T, handlerFunc func(w http.ResponseWriter, r *http.Request))
| 524 | // The test HTTP client bypasses SSRF protection so that httptest.Server |
| 525 | // (bound to 127.0.0.1) can be reached. |
| 526 | func setupPushTest(ctx context.Context, t *testing.T, handlerFunc func(w http.ResponseWriter, r *http.Request)) (webpush.Dispatcher, database.Store, string) { |
| 527 | t.Helper() |
| 528 | db, _ := dbtestutil.NewDB(t) |
| 529 | return setupPushTestWithOptions(ctx, t, db, handlerFunc) |
| 530 | } |
| 531 | |
| 532 | func setupPushTestWithOptions(ctx context.Context, t *testing.T, db database.Store, handlerFunc func(w http.ResponseWriter, r *http.Request), opts ...webpush.Option) (webpush.Dispatcher, database.Store, string) { |
| 533 | t.Helper() |
no test coverage detected