(t *testing.T)
| 84 | } |
| 85 | |
| 86 | func 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 |
| 97 | A repository contains the content for a project. |
| 98 | Implements: Node |
| 99 | Fields (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 |
| 114 | Implements: Node |
| 115 | Fields (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 |
| 131 | Implemented by: Bot, User |
| 132 | Fields (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"}, |
nothing calls this directly
no test coverage detected