mirror of
https://github.com/hanzo-fi/auth.git
synced 2026-10-30 20:33:21 +00:00
16 lines
359 B
Go
16 lines
359 B
Go
package testserver
|
|
|
|
import (
|
|
"github.com/hanzo-fi/go-libs/v3/testing/deferred"
|
|
ginkgo "github.com/onsi/ginkgo/v2"
|
|
)
|
|
|
|
func NewTestServer(configurationProvider func() Configuration) *deferred.Deferred[*Server] {
|
|
d := deferred.New[*Server]()
|
|
ginkgo.BeforeEach(func() {
|
|
d.Reset()
|
|
d.SetValue(New(ginkgo.GinkgoT(), configurationProvider()))
|
|
})
|
|
return d
|
|
}
|