MCPcopy
hub / github.com/cli/cli / TestApp_VSCode

Function TestApp_VSCode

pkg/cmd/codespace/code_test.go:12–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestApp_VSCode(t *testing.T) {
13 type args struct {
14 codespaceName string
15 useInsiders bool
16 useWeb bool
17 }
18 tests := []struct {
19 name string
20 args args
21 wantErr bool
22 wantURL string
23 }{
24 {
25 name: "open VS Code",
26 args: args{
27 codespaceName: "monalisa-cli-cli-abcdef",
28 useInsiders: false,
29 },
30 wantErr: false,
31 wantURL: "vscode://github.codespaces/connect?name=monalisa-cli-cli-abcdef&windowId=_blank",
32 },
33 {
34 name: "open VS Code Insiders",
35 args: args{
36 codespaceName: "monalisa-cli-cli-abcdef",
37 useInsiders: true,
38 },
39 wantErr: false,
40 wantURL: "vscode-insiders://github.codespaces/connect?name=monalisa-cli-cli-abcdef&windowId=_blank",
41 },
42 {
43 name: "open VS Code web",
44 args: args{
45 codespaceName: "monalisa-cli-cli-abcdef",
46 useInsiders: false,
47 useWeb: true,
48 },
49 wantErr: false,
50 wantURL: "https://monalisa-cli-cli-abcdef.github.dev",
51 },
52 {
53 name: "open VS Code web with Insiders",
54 args: args{
55 codespaceName: "monalisa-cli-cli-abcdef",
56 useInsiders: true,
57 useWeb: true,
58 },
59 wantErr: false,
60 wantURL: "https://monalisa-cli-cli-abcdef.github.dev?vscodeChannel=insiders",
61 },
62 }
63 for _, tt := range tests {
64 t.Run(tt.name, func(t *testing.T) {
65 b := &browser.Stub{}
66 ios, _, stdout, stderr := iostreams.Test()
67 a := &App{
68 browser: b,
69 apiClient: testCodeApiMock(),

Callers

nothing calls this directly

Calls 7

VSCodeMethod · 0.95
VerifyMethod · 0.95
TestFunction · 0.92
testCodeApiMockFunction · 0.85
RunMethod · 0.65
ErrorfMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected