-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from hofstadter-io/cli-cover-tests
CLI test setup
- Loading branch information
Showing
508 changed files
with
6,121 additions
and
2,832 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package cmd_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hofstadter-io/hof/lib/yagu" | ||
"github.com/rogpeppe/go-internal/testscript" | ||
|
||
"github.com/hofstadter-io/hof/cmd/hof/cmd" | ||
) | ||
|
||
func TestScriptAddCliTests(t *testing.T) { | ||
// setup some directories | ||
|
||
dir := "add" | ||
|
||
workdir := ".workdir/cli/" + dir | ||
yagu.Mkdir(workdir) | ||
|
||
testscript.Run(t, testscript.Params{ | ||
Setup: func(env *testscript.Env) error { | ||
// add any environment variables for your tests here | ||
|
||
env.Vars = append(env.Vars, "HOF_TELEMETRY_DISABLED=1") | ||
|
||
return nil | ||
}, | ||
Funcs: map[string]func(ts *testscript.TestScript, args []string) error{ | ||
"__hof": cmd.CallTS, | ||
}, | ||
Dir: "testscripts/cli/add", | ||
WorkdirRoot: workdir, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package cmd_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hofstadter-io/hof/lib/yagu" | ||
"github.com/rogpeppe/go-internal/testscript" | ||
|
||
"github.com/hofstadter-io/hof/cmd/hof/cmd" | ||
) | ||
|
||
func TestScriptAuthCliTests(t *testing.T) { | ||
// setup some directories | ||
|
||
dir := "auth" | ||
|
||
workdir := ".workdir/cli/" + dir | ||
yagu.Mkdir(workdir) | ||
|
||
testscript.Run(t, testscript.Params{ | ||
Setup: func(env *testscript.Env) error { | ||
// add any environment variables for your tests here | ||
|
||
env.Vars = append(env.Vars, "HOF_TELEMETRY_DISABLED=1") | ||
|
||
return nil | ||
}, | ||
Funcs: map[string]func(ts *testscript.TestScript, args []string) error{ | ||
"__hof": cmd.CallTS, | ||
}, | ||
Dir: "testscripts/cli/auth", | ||
WorkdirRoot: workdir, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package cmd_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hofstadter-io/hof/lib/yagu" | ||
"github.com/rogpeppe/go-internal/testscript" | ||
|
||
"github.com/hofstadter-io/hof/cmd/hof/cmd" | ||
) | ||
|
||
func TestScriptBisectCliTests(t *testing.T) { | ||
// setup some directories | ||
|
||
dir := "bisect" | ||
|
||
workdir := ".workdir/cli/" + dir | ||
yagu.Mkdir(workdir) | ||
|
||
testscript.Run(t, testscript.Params{ | ||
Setup: func(env *testscript.Env) error { | ||
// add any environment variables for your tests here | ||
|
||
env.Vars = append(env.Vars, "HOF_TELEMETRY_DISABLED=1") | ||
|
||
return nil | ||
}, | ||
Funcs: map[string]func(ts *testscript.TestScript, args []string) error{ | ||
"__hof": cmd.CallTS, | ||
}, | ||
Dir: "testscripts/cli/bisect", | ||
WorkdirRoot: workdir, | ||
}) | ||
} |
Oops, something went wrong.