MCPcopy Index your code
hub / github.com/go-task/task / TestGetConfig_All

Function TestGetConfig_All

taskrc/taskrc_test.go:149–172  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

147}
148
149func TestGetConfig_All(t *testing.T) { //nolint:paralleltest // cannot run in parallel
150 xdgConfigDir, homeDir, localDir := setupDirs(t)
151
152 // Write local config
153 writeFile(t, localDir, ".taskrc.yml", localConfigYAML)
154
155 // Write home config
156 writeFile(t, homeDir, ".taskrc.yml", homeConfigYAML)
157
158 // Write XDG config
159 writeFile(t, xdgConfigDir, "taskrc.yml", xdgConfigYAML)
160
161 cfg, err := GetConfig(localDir)
162 assert.NoError(t, err)
163 assert.NotNil(t, cfg)
164 assert.Equal(t, &ast.TaskRC{
165 Version: nil,
166 Experiments: map[string]int{
167 "FOO": 3,
168 "BAR": 2,
169 "BAZ": 1,
170 },
171 }, cfg)
172}
173
174func TestGetConfig_RemoteTrustedHosts(t *testing.T) { //nolint:paralleltest // cannot run in parallel
175 _, _, localDir := setupDirs(t)

Callers

nothing calls this directly

Calls 3

setupDirsFunction · 0.85
GetConfigFunction · 0.85
writeFileFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…