MCPcopy Create free account
hub / github.com/github/gh-aw / TestGetEffectiveSafeOutputGitHubToken

Function TestGetEffectiveSafeOutputGitHubToken

pkg/workflow/github_token_test.go:37–63  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35}
36
37func TestGetEffectiveSafeOutputGitHubToken(t *testing.T) {
38 tests := []struct {
39 name string
40 customToken string
41 expected string
42 }{
43 {
44 name: "custom token has highest precedence",
45 customToken: "${{ secrets.CUSTOM_TOKEN }}",
46 expected: "${{ secrets.CUSTOM_TOKEN }}",
47 },
48 {
49 name: "default fallback includes GH_AW_GITHUB_TOKEN (safe outputs chain)",
50 customToken: "",
51 expected: "${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}",
52 },
53 }
54
55 for _, tt := range tests {
56 t.Run(tt.name, func(t *testing.T) {
57 result := getEffectiveSafeOutputGitHubToken(tt.customToken)
58 if result != tt.expected {
59 t.Errorf("getEffectiveSafeOutputGitHubToken() = %q, want %q", result, tt.expected)
60 }
61 })
62 }
63}
64
65func TestGetEffectiveCopilotGitHubToken(t *testing.T) {
66 tests := []struct {

Callers

nothing calls this directly

Calls 3

RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected