go build . or go run .task test or go test ./... (run single test: go test ./internal/llm/prompt -run TestGetContextFromPaths)task lint-fixtask fmt (gofumpt -w .)task dev (runs with profiling enabled)type AgentName string)fmt.Errorf for wrappingrequire package, parallel tests with t.Parallel(),
t.SetEnv() to set environment variables.When writing tests that involve provider configurations, use the mock providers to avoid API calls:
func TestYourFunction(t *testing.T) {
// Enable mock providers for testing
originalUseMock := config.UseMockProviders
config.UseMockProviders = true
defer func() {
config.UseMockProviders = originalUseMock
config.ResetProviders()
}()
// Reset providers to ensure fresh mock data
config.ResetProviders()
// Your test code here - providers will now return mock data
providers := config.Providers()
// ... test logic
}
goftumpt -w ..gofumpt is not available, use goimports.goimports is not available, use gofmt.task fmt to run gofumpt -w . on the entire project,
as long as gofumpt is on the PATH.