MCPcopy Create free account
hub / github.com/cli/cli / testScriptParamsFor

Function testScriptParamsFor

acceptance/acceptance_test.go:259–282  ·  view source on GitHub ↗
(t *testing.T, tsEnv testScriptEnv, command string)

Source from the content-addressed store, hash-verified

257}
258
259func testScriptParamsFor(t *testing.T, tsEnv testScriptEnv, command string) testscript.Params {
260 t.Helper()
261 files, filtered := selectScripts(command, tsEnv.scripts)
262
263 var dir string
264 if !filtered {
265 // No filter was set - run everything in the directory.
266 dir = path.Join("testdata", command)
267 } else if len(files) == 0 {
268 // A filter was set but none of the selected scripts belong to this
269 // command directory, so skip rather than running the whole directory.
270 t.Skipf("testdata/%s: no selected script belongs to this command directory", command)
271 }
272
273 return testscript.Params{
274 Dir: dir,
275 Files: files,
276 Setup: sharedSetup(tsEnv),
277 Cmds: sharedCmds(tsEnv),
278 RequireExplicitExec: true,
279 RequireUniqueNames: true,
280 TestWork: tsEnv.preserveWorkDir,
281 }
282}
283
284var keyT struct{}
285

Callers 15

TestAPIFunction · 0.85
TestAuthFunction · 0.85
TestGistsFunction · 0.85
TestGPGKeysFunction · 0.85
TestExtensionsFunction · 0.85
TestIssuesFunction · 0.85
TestDiscussionsFunction · 0.85
TestIssues2_0Function · 0.85
TestLabelsFunction · 0.85
TestOrgFunction · 0.85
TestProjectFunction · 0.85
TestPullRequestsFunction · 0.85

Calls 5

selectScriptsFunction · 0.85
sharedSetupFunction · 0.85
sharedCmdsFunction · 0.85
JoinMethod · 0.80
HelperMethod · 0.65

Tested by

no test coverage detected