MCPcopy
hub / github.com/pocketbase/pocketbase / TestSubscribe

Function TestSubscribe

tools/subscriptions/client_test.go:97–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

95}
96
97func TestSubscribe(t *testing.T) {
98 c := subscriptions.NewDefaultClient()
99
100 subs := []string{"", "sub1", "sub2", "sub3"}
101 expected := []string{"sub1", "sub2", "sub3"}
102
103 c.Subscribe(subs...) // empty string should be skipped
104
105 if len(c.Subscriptions()) != 3 {
106 t.Fatalf("Expected 3 subscriptions, got %v", c.Subscriptions())
107 }
108
109 for i, s := range expected {
110 if !c.HasSubscription(s) {
111 t.Errorf("(%d) Expected sub %s", i, s)
112 }
113 }
114}
115
116func TestSubscribeOptions(t *testing.T) {
117 c := subscriptions.NewDefaultClient()

Callers

nothing calls this directly

Calls 4

SubscribeMethod · 0.95
SubscriptionsMethod · 0.95
HasSubscriptionMethod · 0.95
NewDefaultClientFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…