Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecCmd ¶
ExecCmd executes a Bubble Tea command synchronously, running it until all messages have been processed. This is essential for testing TEA applications where commands are normally async.
Usage:
m := NewModel() ExecCmd(m, m.Init()) assert.Equal(t, expectedState, m.state)
func SetEnv ¶
SetEnv sets an environment variable for the duration of a test. Returns a cleanup function that should be called with defer.
Usage:
cleanup := testutil.SetEnv(t, "HOME", tempDir) defer cleanup()
func TempConfigDir ¶
TempConfigDir creates a temporary directory for config testing. It returns the temp directory path and a cleanup function. The cleanup function should be called with defer.
Usage:
tempDir, cleanup := testutil.TempConfigDir(t) defer cleanup()
func WriteTestConfig ¶
WriteTestConfig writes a test config file to a temporary location. Returns the path to the config file and a cleanup function.
Usage:
configPath, cleanup := testutil.WriteTestConfig(t, "user_token: xoxb-test") defer cleanup()
Types ¶
This section is empty.