(t *testing.T)
| 333 | } |
| 334 | |
| 335 | func TestInitDbxRejectsUnsupportedStructuredOutputBeforeAuth(t *testing.T) { |
| 336 | t.Setenv(envAccessToken, "") |
| 337 | t.Setenv(envAuthFile, filepath.Join(t.TempDir(), "missing-auth.json")) |
| 338 | |
| 339 | cmd := newAuthTestCommand() |
| 340 | if err := cmd.Root().PersistentFlags().Set(outputFlag, "json"); err != nil { |
| 341 | t.Fatal(err) |
| 342 | } |
| 343 | |
| 344 | err := initDbx(cmd, nil) |
| 345 | if err == nil { |
| 346 | t.Fatal("expected unsupported structured output to fail") |
| 347 | } |
| 348 | if !strings.Contains(err.Error(), "structured output is not supported") { |
| 349 | t.Fatalf("error = %q, want structured output error", err.Error()) |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | func TestCompletionJSONUnsupportedOutputReturnsError(t *testing.T) { |
| 354 | t.Setenv(envAccessToken, "") |
nothing calls this directly
no test coverage detected