MCPcopy Index your code
hub / github.com/supabase/auth / setupAPIForTestWithCallback

Function setupAPIForTestWithCallback

internal/api/api_test.go:46–67  ·  view source on GitHub ↗
(cb func(*conf.GlobalConfiguration, *storage.Connection))

Source from the content-addressed store, hash-verified

44}
45
46func setupAPIForTestWithCallback(cb func(*conf.GlobalConfiguration, *storage.Connection)) (*API, *conf.GlobalConfiguration, error) {
47 config, err := confload.LoadGlobal(apiTestConfig)
48 if err != nil {
49 return nil, nil, err
50 }
51
52 if cb != nil {
53 cb(config, nil)
54 }
55
56 conn, err := test.SetupDBConnection(config)
57 if err != nil {
58 return nil, nil, err
59 }
60
61 if cb != nil {
62 cb(nil, conn)
63 }
64
65 limiterOpts := apilimiter.New(config)
66 return NewAPIWithVersion(config, conn, apiTestVersion, WithLimiter(limiterOpts)), config, nil
67}
68
69func TestEmailEnabledByDefault(t *testing.T) {
70 api, _, err := setupAPIForTest()

Callers 5

TestCustomOAuthAdminFunction · 0.85
TestAnonymousFunction · 0.85
TestOpenTelemetryTracerFunction · 0.85

Calls 5

LoadGlobalFunction · 0.92
SetupDBConnectionFunction · 0.92
NewFunction · 0.92
NewAPIWithVersionFunction · 0.85
WithLimiterFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…