tests

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestAccount

func CreateTestAccount(userID string, password *string) *account.Account

func CreateTestConfig

func CreateTestConfig() *domain.Config

func CreateTestConfigWithDatabase

func CreateTestConfigWithDatabase() *domain.Config

CreateTestConfigWithDatabase creates a test config with an in-memory SQLite database

func CreateTestSession

func CreateTestSession() *session.Session

func CreateTestUser

func CreateTestUser() *user.User

func RunTestMigrations

func RunTestMigrations(t *testing.T, repos *gorm.Repositories) error

RunTestMigrations runs migrations for testing using golang-migrate

func SetupTestAuth

func SetupTestAuth(t *testing.T) (interface{}, func())

SetupTestAuth creates an auth instance with proper database setup and migrations

func SetupTestSecondaryStorage

func SetupTestSecondaryStorage(t *testing.T) (interface{}, func())

SetupTestSecondaryStorage creates a secondary storage instance with proper migrations for testing

Types

type TestRepositories

type TestRepositories struct {
	UserRepo         user.Repository
	SessionRepo      session.Repository
	AccountRepo      account.Repository
	VerificationRepo verification.Repository
}

func SetupTestRepositories

func SetupTestRepositories(t *testing.T) (*TestRepositories, func())

Jump to

Keyboard shortcuts

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