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

Function TestIssue_ExportData

api/export_pr_test.go:14–426  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestIssue_ExportData(t *testing.T) {
15 tests := []struct {
16 name string
17 fields []string
18 inputJSON string
19 outputJSON string
20 }{
21 {
22 name: "simple",
23 fields: []string{"number", "title"},
24 inputJSON: heredoc.Doc(`
25 { "title": "Bugs hugs", "number": 2345 }
26 `),
27 outputJSON: heredoc.Doc(`
28 {
29 "number": 2345,
30 "title": "Bugs hugs"
31 }
32 `),
33 },
34 {
35 name: "milestone",
36 fields: []string{"number", "milestone"},
37 inputJSON: heredoc.Doc(`
38 { "number": 2345, "milestone": {"title": "The next big thing"} }
39 `),
40 outputJSON: heredoc.Doc(`
41 {
42 "milestone": {
43 "number": 0,
44 "title": "The next big thing",
45 "description": "",
46 "dueOn": null
47 },
48 "number": 2345
49 }
50 `),
51 },
52 {
53 name: "project cards",
54 fields: []string{"projectCards"},
55 inputJSON: heredoc.Doc(`
56 { "projectCards": { "nodes": [
57 {
58 "project": { "name": "Rewrite" },
59 "column": { "name": "TO DO" }
60 }
61 ] } }
62 `),
63 outputJSON: heredoc.Doc(`
64 {
65 "projectCards": [
66 {
67 "project": {
68 "name": "Rewrite"
69 },
70 "column": {
71 "name": "TO DO"

Callers

nothing calls this directly

Calls 3

ExportDataMethod · 0.95
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected