MCPcopy
hub / github.com/pocketbase/pocketbase / TestNewBaseApp

Function TestNewBaseApp

core/base_test.go:21–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19)
20
21func TestNewBaseApp(t *testing.T) {
22 const testDataDir = "./pb_base_app_test_data_dir/"
23 defer os.RemoveAll(testDataDir)
24
25 app := core.NewBaseApp(core.BaseAppConfig{
26 DataDir: testDataDir,
27 EncryptionEnv: "test_env",
28 IsDev: true,
29 })
30
31 if app.DataDir() != testDataDir {
32 t.Fatalf("expected DataDir %q, got %q", testDataDir, app.DataDir())
33 }
34
35 if app.EncryptionEnv() != "test_env" {
36 t.Fatalf("expected EncryptionEnv test_env, got %q", app.EncryptionEnv())
37 }
38
39 if !app.IsDev() {
40 t.Fatalf("expected IsDev true, got %v", app.IsDev())
41 }
42
43 if app.Store() == nil {
44 t.Fatal("expected Store to be set, got nil")
45 }
46
47 if app.Settings() == nil {
48 t.Fatal("expected Settings to be set, got nil")
49 }
50
51 if app.SubscriptionsBroker() == nil {
52 t.Fatal("expected SubscriptionsBroker to be set, got nil")
53 }
54
55 if app.Cron() == nil {
56 t.Fatal("expected Cron to be set, got nil")
57 }
58}
59
60func TestBaseAppBootstrap(t *testing.T) {
61 const testDataDir = "./pb_base_app_test_data_dir/"

Callers

nothing calls this directly

Calls 9

DataDirMethod · 0.95
EncryptionEnvMethod · 0.95
IsDevMethod · 0.95
StoreMethod · 0.95
SettingsMethod · 0.95
SubscriptionsBrokerMethod · 0.95
CronMethod · 0.95
NewBaseAppFunction · 0.92
RemoveAllMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…