MCPcopy Index your code
hub / github.com/cli/cli / TestNewConfigProvidesFallback

Function TestNewConfigProvidesFallback

internal/config/config_test.go:19–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17}
18
19func TestNewConfigProvidesFallback(t *testing.T) {
20 var spiedCfg *ghConfig.Config
21 ghConfig.Read = func(fallback *ghConfig.Config) (*ghConfig.Config, error) {
22 spiedCfg = fallback
23 return fallback, nil
24 }
25 _, err := NewConfig()
26 require.NoError(t, err)
27 requireKeyWithValue(t, spiedCfg, []string{versionKey}, "1")
28 requireKeyWithValue(t, spiedCfg, []string{gitProtocolKey}, "https")
29 requireKeyWithValue(t, spiedCfg, []string{editorKey}, "")
30 requireKeyWithValue(t, spiedCfg, []string{promptKey}, "enabled")
31 requireKeyWithValue(t, spiedCfg, []string{pagerKey}, "")
32 requireKeyWithValue(t, spiedCfg, []string{aliasesKey, "co"}, "pr checkout")
33 requireKeyWithValue(t, spiedCfg, []string{httpUnixSocketKey}, "")
34 requireKeyWithValue(t, spiedCfg, []string{browserKey}, "")
35 requireKeyWithValue(t, spiedCfg, []string{colorLabelsKey}, "disabled")
36}
37
38func TestGetOrDefaultApplicationDefaults(t *testing.T) {
39 tests := []struct {

Callers

nothing calls this directly

Calls 2

NewConfigFunction · 0.85
requireKeyWithValueFunction · 0.70

Tested by

no test coverage detected