Documentation ¶
Index ¶
- func CreateTemplateVersionSource(t *testing.T, responses *echo.Responses) string
- func New(t *testing.T, args ...string) (*clibase.Invocation, config.Root)
- func NewWithCommand(t *testing.T, cmd *clibase.Cmd, args ...string) (*clibase.Invocation, config.Root)
- func Run(t *testing.T, inv *clibase.Invocation)
- func SetupConfig(t *testing.T, client *codersdk.Client, root config.Root)
- func Start(t *testing.T, inv *clibase.Invocation)
- type ErrorWaiter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTemplateVersionSource ¶ added in v0.4.0
CreateTemplateVersionSource writes the echo provisioner responses into a new temporary testing directory.
func New ¶
New creates a CLI instance with a configuration pointed to a temporary testing directory.
func NewWithCommand ¶ added in v0.21.0
func Run ¶ added in v0.21.0
func Run(t *testing.T, inv *clibase.Invocation)
Run runs the command and asserts that there is no error.
func SetupConfig ¶
SetupConfig applies the URL and SessionToken of the client to the config.
Types ¶
type ErrorWaiter ¶ added in v0.21.0
type ErrorWaiter struct {
// contains filtered or unexported fields
}
func StartWithWaiter ¶ added in v0.21.0
func StartWithWaiter(t *testing.T, inv *clibase.Invocation) *ErrorWaiter
StartWithWaiter runs the command in a goroutine but returns the error instead of asserting it. This is useful for testing error cases.
func (*ErrorWaiter) RequireAs ¶ added in v0.21.0
func (w *ErrorWaiter) RequireAs(want interface{})
func (*ErrorWaiter) RequireContains ¶ added in v0.21.0
func (w *ErrorWaiter) RequireContains(s string)
func (*ErrorWaiter) RequireError ¶ added in v0.21.0
func (w *ErrorWaiter) RequireError()
func (*ErrorWaiter) RequireIs ¶ added in v0.21.0
func (w *ErrorWaiter) RequireIs(want error)
func (*ErrorWaiter) RequireSuccess ¶ added in v0.21.0
func (w *ErrorWaiter) RequireSuccess()
func (*ErrorWaiter) Wait ¶ added in v0.21.0
func (w *ErrorWaiter) Wait() error
Click to show internal directories.
Click to hide internal directories.