eleven / ocho Public

Clone
git clone https://amadan.net/eleven/ocho

Plain git — no account needed to clone.

Download

Download this file

1package bot
2
3import "testing"
4
5func TestConnectBrokerURLDefault(t *testing.T) {
6 // Unset → the shared broker default (matches the Node runtime, which
7 // defaults it inline; an instance sets only its per-instance token).
8 t.Setenv("LCHAT_CONNECT_BROKER_URL", "")
9 if got := loadConnectConfig().brokerURL; got != defaultBrokerURL {
10 t.Errorf("default broker URL: got %q, want %q", got, defaultBrokerURL)
11 }
12 // A self-hosted broker overrides.
13 t.Setenv("LCHAT_CONNECT_BROKER_URL", "https://connect.example.com")
14 if got := loadConnectConfig().brokerURL; got != "https://connect.example.com" {
15 t.Errorf("override broker URL: got %q", got)
16 }
17}
18