(t *testing.T)
| 511 | } |
| 512 | |
| 513 | func connect(t *testing.T) *nats.Conn { |
| 514 | t.Helper() |
| 515 | natsURL := os.Getenv("NATS_URL") |
| 516 | if natsURL == "" { |
| 517 | natsURL = nats.DefaultURL |
| 518 | } |
| 519 | nc, err := nats.Connect(natsURL, nats.Timeout(1*time.Hour)) |
| 520 | if err != nil { |
| 521 | t.Fatalf("Error connecting to NATS: %v", err) |
| 522 | } |
| 523 | return nc |
| 524 | } |
| 525 | |
| 526 | func connectJS(t *testing.T) (*nats.Conn, nats.JetStreamContext) { |
| 527 | nc := connect(t) |
no test coverage detected