suspect

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: MIT Imports: 12 Imported by: 0

README

gopher

Suspect

Supabase integration testing toolset

Features

Requirements

You need to have Supabase CLI installed and configured for your project.

Usage

func Test(t *testing.T) {
    suspect.NewSuspect(t).
        Db(func(db *pgx.Conn) {
            // prepare data
        }).
        Api(func(api *httpexpect.Expect) *httpexpect.Expect {
            // call endpoint
            return api
        }).
        Mail(func(mail *client.Client) {
            // check emails
        })
}

See example

Credits

Gopher mascot is based on original artwork by Renee French.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertSignIn added in v0.3.0

func AssertSignIn(credentials UserCredentials) func(api *httpexpect.Expect) *httpexpect.Expect

func AssertSignOut

func AssertSignOut(api *httpexpect.Expect) *httpexpect.Expect

func AssertSignUp

func AssertSignUp(credentials UserCredentials) func(api *httpexpect.Expect) *httpexpect.Expect

func AssertUser

func AssertUser(api *httpexpect.Expect) *httpexpect.Expect

Types

type Suspect

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

func NewSuspect

func NewSuspect(t *testing.T) *Suspect

func (*Suspect) Api

func (s *Suspect) Api(a func(*httpexpect.Expect) *httpexpect.Expect) *Suspect

func (*Suspect) Db

func (s *Suspect) Db(a func(conn *pgx.Conn)) *Suspect

func (*Suspect) Mail

func (s *Suspect) Mail(a func(*client.Client)) *Suspect

func (*Suspect) Slice added in v0.4.0

func (s *Suspect) Slice() *Suspect

func (*Suspect) Wait

func (s *Suspect) Wait(seconds int) *Suspect

type UserCredentials

type UserCredentials struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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