MCPcopy Create free account
hub / github.com/algolia/cli / TestRunOpenCmd_UnsupportedWithJSONOutput

Function TestRunOpenCmd_UnsupportedWithJSONOutput

pkg/cmd/open/open_test.go:362–373  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

360}
361
362func TestRunOpenCmd_UnsupportedWithJSONOutput(t *testing.T) {
363 io, _, _, _ := iostreams.Test()
364
365 opts, _, _ := newTestOptions(io, test.NewDefaultConfigStub())
366 opts.Shortcut = "bogus"
367 withOutputFormat(opts, "json")
368
369 err := runOpenCmd(opts)
370 require.Error(t, err)
371 assert.Contains(t, err.Error(), "unsupported open command, given: bogus")
372 assert.Contains(t, err.Error(), "Available shortcuts:")
373}
374
375func TestRunOpenCmd_InvalidOutputFormat(t *testing.T) {
376 io, _, _, _ := iostreams.Test()

Callers

nothing calls this directly

Calls 6

TestFunction · 0.92
NewDefaultConfigStubFunction · 0.92
newTestOptionsFunction · 0.85
withOutputFormatFunction · 0.85
runOpenCmdFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected