diff --git a/pkg/cmd/repo/autolink/list/list_test.go b/pkg/cmd/repo/autolink/list/list_test.go index 5db767032..0d9562d6d 100644 --- a/pkg/cmd/repo/autolink/list/list_test.go +++ b/pkg/cmd/repo/autolink/list/list_test.go @@ -11,11 +11,21 @@ import ( "github.com/cli/cli/v2/internal/ghrepo" "github.com/cli/cli/v2/pkg/cmdutil" "github.com/cli/cli/v2/pkg/iostreams" + "github.com/cli/cli/v2/pkg/jsonfieldstest" "github.com/google/shlex" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) +func TestJSONFields(t *testing.T) { + jsonfieldstest.ExpectCommandToSupportJSONFields(t, NewCmdList, []string{ + "id", + "isAlphanumeric", + "keyPrefix", + "urlTemplate", + }) +} + func TestNewCmdList(t *testing.T) { tests := []struct { name string @@ -41,18 +51,6 @@ func TestNewCmdList(t *testing.T) { output: listOptions{}, wantExporter: true, }, - { - name: "invalid json flag", - input: "--json invalid", - wantErr: true, - errMsg: heredoc.Doc(` - Unknown JSON field: "invalid" - Available fields: - id - isAlphanumeric - keyPrefix - urlTemplate`), - }, } for _, tt := range tests {