MCPcopy Index your code
hub / github.com/jetify-com/devbox / getTestscriptParams

Function getTestscriptParams

testscripts/testrunner/testrunner.go:176–203  ·  view source on GitHub ↗
(dir string)

Source from the content-addressed store, hash-verified

174}
175
176func getTestscriptParams(dir string) testscript.Params {
177 return testscript.Params{
178 Dir: dir,
179 RequireExplicitExec: true,
180 TestWork: false, // Set to true if you're trying to debug a test.
181 Setup: func(env *testscript.Env) error { return setupTestEnv(env) },
182 Cmds: map[string]func(ts *testscript.TestScript, neg bool, args []string){
183 "cp": copyFileCmd,
184 "devboxjson.packages.contains": assertDevboxJSONPackagesContains,
185 "devboxlock.packages.contains": assertDevboxLockPackagesContains,
186 "env.path.len": assertPathLength,
187 "glob": globCmd,
188 "json.superset": assertJSONSuperset,
189 "path.order": assertPathOrder,
190 "source.path": sourcePath,
191 },
192 Condition: func(cond string) (bool, error) {
193 before, key, found := strings.Cut(cond, ":")
194 if found && before == "env" {
195 if v, ok := os.LookupEnv(key); ok {
196 return strconv.ParseBool(v)
197 }
198 return false, nil
199 }
200 return false, fmt.Errorf("unknown condition: %v", cond)
201 },
202 }
203}

Callers 2

RunTestscriptsFunction · 0.85

Calls 1

setupTestEnvFunction · 0.85

Tested by

no test coverage detected