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

Function New

cli/clitest/clitest.go:35–42  ·  view source on GitHub ↗

New creates a CLI instance with a configuration pointed to a temporary testing directory. The invocation is set up to use a global config directory for the given testing.TB, and keyring usage disabled.

(t testing.TB, args ...string)

Source from the content-addressed store, hash-verified

33// global config directory for the given testing.TB, and keyring
34// usage disabled.
35func New(t testing.TB, args ...string) (*serpent.Invocation, config.Root) {
36 var root cli.RootCmd
37
38 cmd, err := root.Command(root.AGPL())
39 require.NoError(t, err)
40
41 return NewWithCommand(t, cmd, args...)
42}
43
44// NewWithClock is like New, but injects the given clock for
45// tests that are time-dependent.

Callers 15

TestCliTemplateCreateFunction · 0.92
TestUserDeleteFunction · 0.92
TestTemplateDeleteFunction · 0.92
TestGitAskpassFunction · 0.92
TestExpTaskListFunction · 0.92
TestExternalAuthFunction · 0.92
TestTemplatePull_NoNameFunction · 0.92
TestTemplatePull_StdoutFunction · 0.92

Calls 3

CommandMethod · 0.95
AGPLMethod · 0.95
NewWithCommandFunction · 0.85

Tested by 15

TestCliTemplateCreateFunction · 0.74
TestUserDeleteFunction · 0.74
TestTemplateDeleteFunction · 0.74
TestGitAskpassFunction · 0.74
TestExpTaskListFunction · 0.74
TestExternalAuthFunction · 0.74
TestTemplatePull_NoNameFunction · 0.74
TestTemplatePull_StdoutFunction · 0.74