MCPcopy
hub / github.com/pocketbase/pocketbase / NewTestApp

Function NewTestApp

tests/app.go:74–84  ·  view source on GitHub ↗

NewTestApp creates and initializes a test application instance. It is the caller's responsibility to call app.Cleanup() when the app is no longer needed.

(optTestDataDir ...string)

Source from the content-addressed store, hash-verified

72//
73// It is the caller's responsibility to call app.Cleanup() when the app is no longer needed.
74func NewTestApp(optTestDataDir ...string) (*TestApp, error) {
75 var testDataDir string
76 if len(optTestDataDir) > 0 {
77 testDataDir = optTestDataDir[0]
78 }
79
80 return NewTestAppWithConfig(core.BaseAppConfig{
81 DataDir: testDataDir,
82 EncryptionEnv: "pb_test_env",
83 })
84}
85
86// NewTestAppWithConfig creates and initializes a test application instance
87// from the provided config.

Callers 15

TestSendRecordAuthAlertFunction · 0.92
TestSendRecordOTPFunction · 0.92
TestNewExternalAuthFunction · 0.92
TestExternalAuthProviderFunction · 0.92
TestExternalAuthCreatedFunction · 0.92
TestExternalAuthUpdatedFunction · 0.92

Calls 1

NewTestAppWithConfigFunction · 0.85

Tested by 15

TestSendRecordAuthAlertFunction · 0.74
TestSendRecordOTPFunction · 0.74
TestNewExternalAuthFunction · 0.74
TestExternalAuthProviderFunction · 0.74
TestExternalAuthCreatedFunction · 0.74
TestExternalAuthUpdatedFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…