mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-17 12:31:52 +03:00
a398d3b190
GITHUB_PR_NUMBER: 6111 GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6111 Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com> GitOrigin-RevId: 1f6517acfacb58c566bb5e48f74ea0dfa5c6f063
36 lines
792 B
Go
36 lines
792 B
Go
package v3
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/hasura/graphql-engine/cli"
|
|
"github.com/hasura/graphql-engine/cli/commands"
|
|
)
|
|
|
|
func TestInitCmd(t *testing.T, ec *cli.ExecutionContext, initDir string) {
|
|
tt := []struct {
|
|
name string
|
|
opts *commands.InitOptions
|
|
err error
|
|
}{
|
|
{"only-init-dir", &commands.InitOptions{
|
|
EC: ec,
|
|
Version: cli.V3,
|
|
Endpoint: os.Getenv("HASURA_GRAPHQL_TEST_ENDPOINT"),
|
|
AdminSecret: os.Getenv("HASURA_GRAPHQL_TEST_ADMIN_SECRET"),
|
|
InitDir: initDir,
|
|
}, nil},
|
|
}
|
|
|
|
for _, tc := range tt {
|
|
t.Run(tc.name, func(t *testing.T) {
|
|
err := tc.opts.Run()
|
|
if err != tc.err {
|
|
t.Fatalf("%s: expected %v, got %v", tc.name, tc.err, err)
|
|
}
|
|
// TODO: (shahidhk) need to verify the contents of the spec generated
|
|
})
|
|
}
|
|
}
|