integration

package
v0.3.20 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 10 Imported by: 0

README

Integration Tests

End-to-end tests for Jeff.

Running Tests

# All integration tests
go test ./test/integration/...

# Skip API tests (faster)
go test -short ./test/integration/...

# With coverage
go test -cover ./test/integration/...

Test Files

  • storage_test.go - Database operations
  • tools_test.go - Tool execution
  • api_test.go - API client (requires ANTHROPIC_API_KEY)
  • ui_test.go - UI model tests
  • scenarios_test.go - End-to-end workflows

Notes

  • Tests use temporary databases via t.TempDir()
  • API tests are skipped in -short mode

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertFileContains

func AssertFileContains(t *testing.T, path, expectedContent string)

AssertFileContains checks that a file contains expected content

func AssertFileExists

func AssertFileExists(t *testing.T, path string)

AssertFileExists checks that a file exists and has expected content

func CreateTestConversation

func CreateTestConversation(t *testing.T, db *sql.DB, model string) string

CreateTestConversation creates a conversation with test data

func CreateTestDir

func CreateTestDir(t *testing.T) string

CreateTestDir creates a temporary test directory

func CreateTestFile

func CreateTestFile(t *testing.T, content string) string

CreateTestFile creates a temporary test file with content

func CreateTestMessage

func CreateTestMessage(t *testing.T, db *sql.DB, conversationID, role, content string) string

CreateTestMessage creates a message in the database

func MockAPIClient

func MockAPIClient(t *testing.T, _ []core.MessageResponse) *core.Client

MockAPIClient returns a mock API client for testing This is a placeholder - actual implementation depends on whether you have mocking infrastructure

func SetupTestDB

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

SetupTestDB creates a temporary test database

func WaitForCondition

func WaitForCondition(t *testing.T, timeout time.Duration, interval time.Duration, condition func() bool, message string)

WaitForCondition polls a condition function until it returns true or timeout

Types

This section is empty.

Jump to

Keyboard shortcuts

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