Files
sablier/pkg/sabliercmd/testing.go
Alexis Couvreur 0f4a3a2e93 refactor: add sabliercmd pkg (#727)
This will enable doc generation
2025-11-13 20:18:57 -05:00

30 lines
722 B
Go

package sabliercmd
import (
"github.com/sablierapp/sablier/pkg/config"
"github.com/spf13/cobra"
)
// NewStartCommand is a variable that allows mocking the start command for testing
var NewStartCommand = newStartCommand
// SetStartCommand allows tests to override the start command
func SetStartCommand(cmd func() *cobra.Command) {
newStartCommand = cmd
}
// ResetStartCommand resets the start command to the default
func ResetStartCommand() {
newStartCommand = NewStartCommand
}
// GetConfig returns the current configuration (for testing)
func GetConfig() *config.Config {
return &conf
}
// ResetConfig resets the configuration to a new instance (for testing)
func ResetConfig() {
conf = config.NewConfig()
}