MCPcopy Create free account
hub / github.com/nhost/nhost / TestConsole

Function TestConsole

cli/dockercompose/graphql_test.go:282–322  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

280}
281
282func TestConsole(t *testing.T) {
283 t.Parallel()
284
285 cases := []struct {
286 name string
287 cfg func() *model.ConfigConfig
288 useTlS bool
289 expected func() *Service
290 }{
291 {
292 name: "success",
293 cfg: func() *model.ConfigConfig {
294 cfg := getConfig()
295 cfg.Hasura.Version = new("v2.25.0")
296
297 return cfg
298 },
299 useTlS: false,
300 expected: expectedConsole,
301 },
302 // {
303 // name: "fail",
304 // cfg: getConfig,
305 // },
306 }
307
308 for _, tc := range cases {
309 t.Run(tc.name, func(t *testing.T) {
310 t.Parallel()
311
312 got, err := console(tc.cfg(), "dev", 1337, tc.useTlS, "/path/to/nhost", 0)
313 if err != nil {
314 t.Fatalf("got error: %v", err)
315 }
316
317 if diff := cmp.Diff(tc.expected(), got); diff != "" {
318 t.Error(diff)
319 }
320 })
321 }
322}

Callers

nothing calls this directly

Calls 5

consoleFunction · 0.85
FatalfMethod · 0.80
getConfigFunction · 0.70
RunMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected