aboutsummaryrefslogtreecommitdiff
path: root/test/base.go
blob: 32fc8dc53df9553923ed937f559ce19eeb73a676 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package test

import (
	"github.com/matrix-org/dendrite/setup/base"
	"github.com/matrix-org/dendrite/setup/config"
	"github.com/nats-io/nats.go"
)

func Base(cfg *config.Dendrite) (*base.BaseDendrite, nats.JetStreamContext, *nats.Conn) {
	if cfg == nil {
		cfg = &config.Dendrite{}
		cfg.Defaults(true)
	}
	cfg.Global.JetStream.InMemory = true
	base := base.NewBaseDendrite(cfg, "Tests")
	js, jc := base.NATS.Prepare(base.ProcessContext, &cfg.Global.JetStream)
	return base, js, jc
}