MCPcopy
hub / github.com/pocketbase/pocketbase / TestNewWithConfig

Function TestNewWithConfig

pocketbase_test.go:52–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

50}
51
52func TestNewWithConfig(t *testing.T) {
53 app := NewWithConfig(Config{
54 DefaultDataDir: "test_dir",
55 DefaultEncryptionEnv: "test_encryption_env",
56 HideStartBanner: true,
57 })
58
59 if app == nil {
60 t.Fatal("Expected initialized PocketBase instance, got nil")
61 }
62
63 if app.RootCmd == nil {
64 t.Fatal("Expected RootCmd to be initialized, got nil")
65 }
66
67 if app.App == nil {
68 t.Fatal("Expected App to be initialized, got nil")
69 }
70
71 if app.hideStartBanner != true {
72 t.Fatal("Expected app.hideStartBanner to be true, got false")
73 }
74
75 if app.DataDir() != "test_dir" {
76 t.Fatalf("Expected app.DataDir() %q, got %q", "test_dir", app.DataDir())
77 }
78
79 if app.EncryptionEnv() != "test_encryption_env" {
80 t.Fatalf("Expected app.EncryptionEnv() %q, got %q", "test_encryption_env", app.EncryptionEnv())
81 }
82}
83
84func TestNewWithConfigAndFlags(t *testing.T) {
85 // copy os.Args

Callers

nothing calls this directly

Calls 3

NewWithConfigFunction · 0.85
DataDirMethod · 0.65
EncryptionEnvMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…