Implement basic API acceptance test
This commit is contained in:
parent
f21ac8f68e
commit
06c20f3a8b
3 changed files with 15 additions and 0 deletions
|
|
@ -55,6 +55,15 @@ func TestWorkflows(t *testing.T) {
|
|||
testscript.Run(t, testScriptParamsFor(tsEnv, "workflow"))
|
||||
}
|
||||
|
||||
func TestAPI(t *testing.T) {
|
||||
var tsEnv testScriptEnv
|
||||
if err := tsEnv.fromEnv(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
testscript.Run(t, testScriptParamsFor(tsEnv, "api"))
|
||||
}
|
||||
|
||||
func testScriptParamsFor(tsEnv testScriptEnv, command string) testscript.Params {
|
||||
var files []string
|
||||
if tsEnv.script != "" {
|
||||
|
|
|
|||
3
acceptance/testdata/api/basic-graphql.txtar
vendored
Normal file
3
acceptance/testdata/api/basic-graphql.txtar
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Basic graphql request
|
||||
exec gh api graphql -f query='query { viewer { login } }'
|
||||
stdout '"login":'
|
||||
3
acceptance/testdata/api/basic-rest.txtar
vendored
Normal file
3
acceptance/testdata/api/basic-rest.txtar
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Basic REST request
|
||||
exec gh api /user
|
||||
stdout '"login":'
|
||||
Loading…
Add table
Add a link
Reference in a new issue