mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
fix: Rename NewMemoryCoderd
to NewWithServer
(#1571)
This name felt invalid, because `New` was also in memory.
This commit is contained in:
@ -67,7 +67,14 @@ type Options struct {
|
||||
|
||||
// New constructs an in-memory coderd instance and returns
|
||||
// the connected client.
|
||||
func NewMemoryCoderd(t *testing.T, options *Options) (*httptest.Server, *codersdk.Client) {
|
||||
func New(t *testing.T, options *Options) *codersdk.Client {
|
||||
_, cli := NewWithServer(t, options)
|
||||
return cli
|
||||
}
|
||||
|
||||
// NewWithServer returns an in-memory coderd instance and
|
||||
// the HTTP server it started with.
|
||||
func NewWithServer(t *testing.T, options *Options) (*httptest.Server, *codersdk.Client) {
|
||||
if options == nil {
|
||||
options = &Options{}
|
||||
}
|
||||
@ -160,13 +167,6 @@ func NewMemoryCoderd(t *testing.T, options *Options) (*httptest.Server, *codersd
|
||||
return srv, codersdk.New(serverURL)
|
||||
}
|
||||
|
||||
// New constructs an in-memory coderd instance and returns
|
||||
// the connected client.
|
||||
func New(t *testing.T, options *Options) *codersdk.Client {
|
||||
_, cli := NewMemoryCoderd(t, options)
|
||||
return cli
|
||||
}
|
||||
|
||||
// NewProvisionerDaemon launches a provisionerd instance configured to work
|
||||
// well with coderd testing. It registers the "echo" provisioner for
|
||||
// quick testing.
|
||||
|
Reference in New Issue
Block a user