testcli

package
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI added in v0.1.9

type CLI struct {
	Env   envs.Map
	Stdin io.Reader
	// contains filtered or unexported fields
}

func New

func New(dir string) *CLI

func (*CLI) Run added in v0.1.9

func (c *CLI) Run(ctx context.Context, args ...string) (*Result, error)

func (*CLI) Start added in v0.1.9

func (c *CLI) Start(ctx context.Context, args ...string) (*Client, error)

type Client added in v0.1.9

type Client struct {
	// contains filtered or unexported fields
}

Client for interacting with the running app

func (*Client) Close added in v0.1.9

func (c *Client) Close() error

Close the app down

func (*Client) Delete added in v0.1.9

func (c *Client) Delete(path string, body io.Reader) (*Response, error)

func (*Client) DeleteJSON added in v0.1.9

func (c *Client) DeleteJSON(path string, body io.Reader) (*Response, error)

func (*Client) DeleteRequest added in v0.2.0

func (c *Client) DeleteRequest(path string, body io.Reader) (*http.Request, error)

func (*Client) Do added in v0.2.0

func (c *Client) Do(req *http.Request) (*Response, error)

func (*Client) Get added in v0.1.9

func (c *Client) Get(path string) (*Response, error)

func (*Client) GetJSON added in v0.1.9

func (c *Client) GetJSON(path string) (*Response, error)

func (*Client) GetRequest added in v0.2.0

func (c *Client) GetRequest(path string) (*http.Request, error)

func (*Client) Hot added in v0.1.9

func (c *Client) Hot(path string) (*hot.Stream, error)

Hot connects to the event stream

func (*Client) Patch added in v0.1.9

func (c *Client) Patch(path string, body io.Reader) (*Response, error)

func (*Client) PatchJSON added in v0.1.9

func (c *Client) PatchJSON(path string, body io.Reader) (*Response, error)

func (*Client) PatchRequest added in v0.2.0

func (c *Client) PatchRequest(path string, body io.Reader) (*http.Request, error)

func (*Client) Post added in v0.1.9

func (c *Client) Post(path string, body io.Reader) (*Response, error)

func (*Client) PostJSON added in v0.1.9

func (c *Client) PostJSON(path string, body io.Reader) (*Response, error)

func (*Client) PostRequest added in v0.2.0

func (c *Client) PostRequest(path string, body io.Reader) (*http.Request, error)

func (*Client) Ready added in v0.1.9

func (c *Client) Ready(ctx context.Context) error

Wait for the application to be ready

func (*Client) Stderr added in v0.1.9

func (c *Client) Stderr() string

Stderr at a point in time

func (*Client) Stdout added in v0.1.9

func (c *Client) Stdout() string

Stdout at a point in time

type Response

type Response struct {
	// contains filtered or unexported fields
}

func (*Response) Body

func (r *Response) Body() *bytes.Buffer

func (*Response) Diff added in v0.1.9

func (r *Response) Diff(expected string) error

func (*Response) DiffHeaders added in v0.1.9

func (r *Response) DiffHeaders(expected string) error

func (*Response) Dump

func (r *Response) Dump() *bytes.Buffer

Diff the response the expected HTTP response

func (*Response) Header

func (r *Response) Header(key string) string

Header gets a value from a key

func (*Response) Headers

func (r *Response) Headers() *bytes.Buffer

func (*Response) Query

func (r *Response) Query(selector string) (*goquery.Selection, error)

Query a selector on the page using goquery

func (*Response) Status

func (r *Response) Status() int

Status returns the response status

type Result added in v0.1.9

type Result struct {
	// contains filtered or unexported fields
}

func (*Result) Stderr added in v0.1.9

func (r *Result) Stderr() string

func (*Result) Stdout added in v0.1.9

func (r *Result) Stdout() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL