testutils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2025 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type E2ETestSuite

type E2ETestSuite struct {
	suite.Suite
	// contains filtered or unexported fields
}

E2ETestSuite provides a test suite with a real Postgres database using Testcontainers

func (*E2ETestSuite) BeforeEachTest

func (s *E2ETestSuite) BeforeEachTest()

BeforeEachTest runs before each test in the E2ETestSuite. It enables parallel test execution.

func (*E2ETestSuite) CreateTestUser

func (s *E2ETestSuite) CreateTestUser() *domain.User

CreateTestUser creates a unique test user via the POST /user/ endpoint

func (*E2ETestSuite) LoginUser

func (s *E2ETestSuite) LoginUser(testUser *domain.User) string

LoginUser makes an actual HTTP request to login and returns the JWT token

func (*E2ETestSuite) MakeRequest

func (s *E2ETestSuite) MakeRequest(
	method, path, body, token string,
) *http.Response

MakeRequest is a helper for making HTTP requests in tests

func (*E2ETestSuite) SetupSuite

func (s *E2ETestSuite) SetupSuite()

SetupSuite initializes the test suite with a real Postgres database

func (*E2ETestSuite) TearDownSuite

func (s *E2ETestSuite) TearDownSuite()

TearDownSuite cleans up the test suite resources

Jump to

Keyboard shortcuts

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