MCPcopy
hub / github.com/larksuite/cli / TestNewRuntimeContext

Function TestNewRuntimeContext

shortcuts/common/testing.go:18–20  ·  view source on GitHub ↗

TestNewRuntimeContext creates a RuntimeContext for testing purposes. Only Cmd and Config are set; other fields (Factory, larkSDK, etc.) are nil.

(cmd *cobra.Command, cfg *core.CliConfig)

Source from the content-addressed store, hash-verified

16// TestNewRuntimeContext creates a RuntimeContext for testing purposes.
17// Only Cmd and Config are set; other fields (Factory, larkSDK, etc.) are nil.
18func TestNewRuntimeContext(cmd *cobra.Command, cfg *core.CliConfig) *RuntimeContext {
19 return &RuntimeContext{Cmd: cmd, Config: cfg}
20}
21
22// TestNewRuntimeContextWithCtx creates a RuntimeContext with an explicit context
23// for tests that invoke functions which call Ctx() (e.g. HTTP request helpers).

Calls

no outgoing calls

Tested by

no test coverage detected