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

Function NewWithClock

cli/clitest/clitest.go:46–54  ·  view source on GitHub ↗

NewWithClock is like New, but injects the given clock for tests that are time-dependent.

(t testing.TB, clk quartz.Clock, args ...string)

Source from the content-addressed store, hash-verified

44// NewWithClock is like New, but injects the given clock for
45// tests that are time-dependent.
46func NewWithClock(t testing.TB, clk quartz.Clock, args ...string) (*serpent.Invocation, config.Root) {
47 var root cli.RootCmd
48 root.SetClock(clk)
49
50 cmd, err := root.Command(root.AGPL())
51 require.NoError(t, err)
52
53 return NewWithCommand(t, cmd, args...)
54}
55
56type logWriter struct {
57 prefix string

Callers 2

Test_TaskStatusFunction · 0.92
Test_TaskSendFunction · 0.92

Calls 4

SetClockMethod · 0.95
CommandMethod · 0.95
AGPLMethod · 0.95
NewWithCommandFunction · 0.85

Tested by 2

Test_TaskStatusFunction · 0.74
Test_TaskSendFunction · 0.74