MCPcopy Index your code
hub / github.com/coder/coder / newWithCloser

Function newWithCloser

coderd/coderdtest/coderdtest.go:237–240  ·  view source on GitHub ↗

newWithCloser constructs a codersdk client connected to an in-memory API instance. The returned closer closes a provisioner if it was provided The API is intentionally not returned here because coderd tests should not require a handle to the API. Do not expose the API or wrath shall descend upon the

(t testing.TB, options *Options)

Source from the content-addressed store, hash-verified

235// and is a temporary measure while the API to register provisioners is ironed
236// out.
237func newWithCloser(t testing.TB, options *Options) (*codersdk.Client, io.Closer) {
238 client, closer, _ := NewWithAPI(t, options)
239 return client, closer
240}
241
242func NewOptions(t testing.TB, options *Options) (func(http.Handler), context.CancelFunc, *url.URL, *coderd.Options) {
243 t.Helper()

Callers 2

NewFunction · 0.85
NewWithProvisionerCloserFunction · 0.85

Calls 1

NewWithAPIFunction · 0.70

Tested by

no test coverage detected