fix(app): pretty-print JSON on a terminal and reconcile the foundation streams

writeJSON uses the indented, colored JSON writer when stdout is a
terminal. Help and JSON tests now expect the -L shorthand column and
compare terminal JSON without color sequences.

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-11 22:57:38 +02:00
1 parent 04d5f2aed0
commit 48a188ceac
4 files changed
+17 -8

No files matched your search

+2 -2
View File
@@ -250,7 +250,7 @@ func TestCommandHelpShowsRelevantFlagsOnly(t *testing.T) {
for _, want := range []string{
"\nUSAGE\n tea issue list [flags]\n",
"\nALIASES\n tea issue ls\n",
"\nFLAGS\n --assignee string ",
"\nFLAGS\n --assignee string ",
"\nINHERITED FLAGS\n -R, --repo OWNER/REPO ",
"\n --json fields ",
"\n -q, --jq expression ",
@@ -264,7 +264,7 @@ func TestCommandHelpShowsRelevantFlagsOnly(t *testing.T) {
}
out.Reset()
require.NoError(t, Execute(context.Background(), deps, []string{"label", "list", "--help"}))
require.Contains(t, out.String(), "\nFLAGS\n --limit int Maximum results (1..100) (default 30)\n --org string ")
require.Contains(t, out.String(), "\nFLAGS\n -L, --limit int Maximum number of results (1..1000) (default 30)\n --org string ")
for _, args := range [][]string{{"version", "--help"}, {"alias", "list", "--help"}, {"auth", "status", "--help"}} {
out.Reset()
require.NoError(t, Execute(context.Background(), deps, args))