MCPcopy Create free account
hub / github.com/cli/cli / TestCmdSchema

Function TestCmdSchema

script/ghmock/schemacmd_test.go:86–381  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func TestCmdSchema(t *testing.T) {
87 tests := []struct {
88 name string
89 args []string
90 want string
91 wantErr string
92 }{
93 {
94 name: "object",
95 args: []string{"Repository"},
96 want: `Repository: an object
97A repository contains the content for a project.
98Implements: Node
99Fields (a type ending in ! is never null):
100 id: ID!
101 name: String!
102 nameWithOwner: String!
103 url: URI!
104 hasIssuesEnabled: Boolean!
105 issue: Issue
106 issueOrPullRequest: IssueOrPullRequest
107 labels: LabelConnection
108`,
109 },
110 {
111 name: "object with a deprecated field",
112 args: []string{"Issue"},
113 want: `Issue: an object
114Implements: Node
115Fields (a type ending in ! is never null):
116 id: ID!
117 number: Int!
118 title: String!
119 body: String
120 state: IssueState!
121 createdAt: DateTime!
122 author: Actor
123 assignees: [User!]!
124 databaseId: Int (deprecated)
125`,
126 },
127 {
128 name: "interface",
129 args: []string{"Actor"},
130 want: `Actor: an interface
131Implemented by: Bot, User
132Fields (a type ending in ! is never null):
133 login: String!
134`,
135 },
136 {
137 name: "union",
138 args: []string{"IssueOrPullRequest"},
139 want: "IssueOrPullRequest: a union\nCan be: Issue, PullRequest\n",
140 },
141 {
142 name: "enum",
143 args: []string{"IssueState"},

Callers

nothing calls this directly

Calls 5

useTestSchemasFunction · 0.85
cmdSchemaFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected