Files
zeekay 7844a60aff refactor(pack): modernize to github.com/hanzoai/pack and remove upstream branding
- Migrate module path to github.com/hanzoai/pack across all Go packages
- Remove legacy upstream docs and competitor brand references
- Modernize LLM.md and mise.toml for pristine Hanzo Pack builder
2026-09-04 00:40:42 -07:00

33 lines
796 B
Go

// testing utilities
package testing
import (
"testing"
"github.com/hanzoai/pack/core/app"
"github.com/hanzoai/pack/core/config"
"github.com/hanzoai/pack/core/generate"
"github.com/hanzoai/pack/core/logger"
)
// CreateGenerateContext creates a new GenerateContext for testing purposes
func CreateGenerateContext(t *testing.T, path string) *generate.GenerateContext {
t.Helper() // This marks the function as a test helper, which improves test output
userApp, err := app.NewApp(path)
if err != nil {
t.Fatalf("error creating app: %v", err)
}
env := app.NewEnvironment(nil)
config := config.EmptyConfig()
ctx, err := generate.NewGenerateContext(userApp, env, config, logger.NewLogger())
if err != nil {
t.Fatalf("error creating generate context: %v", err)
}
return ctx
}