{"modulePath":"github.com/spellshape/cli","version":"v0.0.0-20230215151014-d298eb8394ad","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package envtest\n\n## Constants\n\n```go\nconst (\n\tConfigYML = \"config.yml\"\n)\n```\n\n```go\nconst ServeTimeout = time.Minute * 15\n```\n\n## Variables\n\n```go\nvar (\n\t// SpellshapeApp hold the location of the spellshape binary used in the integration\n\t// tests. The binary is compiled the first time the env.New() function is\n\t// invoked.\n\tSpellshapeApp = path.Join(os.TempDir(), \"spellshape-tests\", \"spellshape\")\n)\n```\n\n## Functions\n\n```go\nfunc Contains(s, partial string) bool\n```\n\n```go\nfunc HasTestVerboseFlag() bool\n```\n\n## Types\n\n```go\ntype App struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (a App) Binary() string\n```\nBinary returns the binary name of the app. Can be executed directly w/o any path after app.Serve is called, since it should be in the $PATH.\n\n```go\nfunc (a App) Config() chainconfig.Config\n```\n\n```go\nfunc (a App) EditConfig(apply func(*chainconfig.Config))\n```\n\n```go\nfunc (a App) EnableFaucet(coins, coinsMax []string) (faucetAddr string)\n```\nEnableFaucet enables faucet by finding a random port for the app faucet and update config.yml with this port and provided coins options.\n\n```go\nfunc (a App) EnsureSteady()\n```\nEnsureSteady ensures that app living at the path can compile and its tests are passing.\n\n```go\nfunc (a App) GenerateTSClient() bool\n```\nGenerateTSClient runs the command to generate the Typescript client code.\n\n```go\nfunc (a App) RandomizeServerPorts() Hosts\n```\nRandomizeServerPorts randomizes server ports for the app at path, updates its config.yml and returns new values.\n\n```go\nfunc (a App) RunClientTests(options ...ClientOption) bool\n```\nRunClientTests runs the Typescript client tests.\n\n```go\nfunc (a App) Serve(msg string, options ...ExecOption) (ok bool)\n```\nServe serves an application lives under path with options where msg describes the execution from the serving action. unless calling with Must(), Serve() will not exit test runtime on failure.\n\n```go\nfunc (a *App) SetConfigPath(path string)\n```\n\n```go\nfunc (a App) Simulate(numBlocks, blockSize int)\n```\nSimulate runs the simulation test for the app.\n\n```go\nfunc (a App) SourcePath() string\n```\n\n```go\nfunc (a App) UseRandomHomeDir() (homeDirPath string)\n```\nUseRandomHomeDir sets in the blockchain config files generated temporary directories for home directories. Returns the random home directory.\n\n```go\ntype AppOption func(*App)\n```\n\n```go\nfunc AppConfigPath(path string) AppOption\n```\n\n```go\nfunc AppHomePath(path string) AppOption\n```\n\n```go\ntype ClientOption func(*clientOptions)\n```\nClientOption defines options for the TS client test runner.\n\n```go\nfunc ClientEnv(env map[string]string) ClientOption\n```\nClientEnv option defines environment values for the tests.\n\n```go\nfunc ClientTestFile(filePath string) ClientOption\n```\nClientTestFile option defines the name of the file where to look for tests.\n\n```go\nfunc ClientTestName(pattern string) ClientOption\n```\nClientTestName option defines a pattern to match the test names that should be run.\n\n```go\ntype Env struct {\n\t// contains filtered or unexported fields\n}\n```\nEnv provides an isolated testing environment and what's needed to make it possible.\n\n```go\nfunc New(t *testing.T) Env\n```\nNew creates a new testing environment.\n\n```go\nfunc (e Env) App(path string, options ...AppOption) App\n```\n\n```go\nfunc (e Env) AppHome(name string) string\n```\nAppHome returns app's root home/data dir path.\n\n```go\nfunc (e Env) Ctx() context.Context\n```\nCtx returns parent context for the test suite to use for cancelations.\n\n```go\nfunc (e Env) Exec(msg string, steps step.Steps, options ...ExecOption) (ok bool)\n```\nExec executes a command step with options where msg describes the expectation from the test. unless calling with Must(), Exec() will not exit test runtime on failure.\n\n```go\nfunc (e Env) HasFailed() bool\n```\n\n```go\nfunc (e Env) Home() string\n```\nHome returns user's home dir.\n\n```go\nfunc (e Env) IsAppServed(ctx context.Context, apiAddr string) error\n```\nIsAppServed checks that app is served properly and servers are started to listening before ctx canceled.\n\n```go\nfunc (e Env) IsFaucetServed(ctx context.Context, faucetClient cosmosfaucet.HTTPClient) error\n```\nIsFaucetServed checks that faucet of the app is served properly.\n\n```go\nfunc (e Env) Must(ok bool)\n```\nMust fails the immediately if not ok. t.Fail() needs to be called for the failing tests before running Must().\n\n```go\nfunc (e Env) RequireExpectations()\n```\n\n```go\nfunc (e Env) Scaffold(name string, flags ...string) App\n```\nScaffold scaffolds an app to a unique appPath and returns it.\n\n```go\nfunc (e Env) SetCleanup(f func())\n```\nSetCleanup registers a function to be called when the test (or subtest) and all its subtests complete.\n\n```go\nfunc (e Env) T() *testing.T\n```\n\n```go\nfunc (e Env) TmpDir() (path string)\n```\nTmpDir creates a new temporary directory.\n\n```go\ntype ExecOption func(*execOptions)\n```\n\n```go\nfunc ExecCtx(ctx context.Context) ExecOption\n```\nExecCtx sets cancelation context for the execution.\n\n```go\nfunc ExecRetry() ExecOption\n```\nExecRetry retries command until it is successful before context is canceled.\n\n```go\nfunc ExecShouldError() ExecOption\n```\nExecShouldError sets the expectations of a command's execution to end with a failure.\n\n```go\nfunc ExecStderr(w io.Writer) ExecOption\n```\nExecStderr captures stderr of an execution.\n\n```go\nfunc ExecStdout(w io.Writer) ExecOption\n```\nExecStdout captures stdout of an execution.\n\n```go\ntype Hosts struct {\n\tRPC     string\n\tP2P     string\n\tProf    string\n\tGRPC    string\n\tGRPCWeb string\n\tAPI     string\n}\n```\nHosts contains the \"hostname:port\" addresses for different service hosts.\n\n","path":"github.com/spellshape/cli/integration","name":"envtest","synopsis":"","isRedistributable":true}
