testutils

package
v0.2.11 Latest Latest
Warning

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

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

Documentation

Overview

Package testutils provides utilities for testing the application

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestUser

func CreateTestUser(t *testing.T, database *db.DB, email string, isAdmin bool) *db.User

CreateTestUser creates a test user in the database

func GenerateTestToken

func GenerateTestToken(userID uint, isAdmin bool, jwtSecret string) (string, error)

GenerateTestToken generates a JWT token for testing

func SetupTestConfig

func SetupTestConfig(t *testing.T) *config.Config

SetupTestConfig creates a test configuration

func SetupTestDB

func SetupTestDB(t *testing.T) *db.DB

SetupTestDB creates an in-memory SQLite database for testing

func SetupTestEmailService

func SetupTestEmailService(t *testing.T) *email.Service

SetupTestEmailService creates a mock email service for testing

func SetupTestScheduler

func SetupTestScheduler(t *testing.T) *scheduler.Scheduler

SetupTestScheduler creates a mock scheduler for testing

Types

This section is empty.

Jump to

Keyboard shortcuts

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