MCPcopy Index your code
hub / github.com/larksuite/cli / TestUpdateInvalidVersion_JSON

Function TestUpdateInvalidVersion_JSON

cmd/update/update_test.go:422–436  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

420}
421
422func TestUpdateInvalidVersion_JSON(t *testing.T) {
423 f, stdout, _ := newTestFactory(t)
424 cmd := NewCmdUpdate(f)
425 cmd.SetArgs([]string{"--json"})
426
427 origFetch := fetchLatest
428 fetchLatest = func() (string, error) { return "not-a-version", nil }
429 defer func() { fetchLatest = origFetch }()
430
431 _ = cmd.Execute()
432 out := stdout.String()
433 if !strings.Contains(out, "invalid version") {
434 t.Errorf("expected 'invalid version' in JSON output, got: %s", out)
435 }
436}
437
438func TestUpdateDevVersion_JSON(t *testing.T) {
439 // Same state-isolation rationale as TestUpdateNpm_JSON.

Callers

nothing calls this directly

Calls 4

NewCmdUpdateFunction · 0.85
newTestFactoryFunction · 0.70
StringMethod · 0.45
ContainsMethod · 0.45

Tested by

no test coverage detected