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

Function TestMCPScriptsModeCodemod_RemovesMode

pkg/cli/codemod_mcp_scripts_test.go:22–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20}
21
22func TestMCPScriptsModeCodemod_RemovesMode(t *testing.T) {
23 codemod := getMCPScriptsModeCodemod()
24
25 content := `---
26on: workflow_dispatch
27mcp-scripts:
28 mode: http
29 max-size: 100KB
30---
31
32# Test`
33
34 frontmatter := map[string]any{
35 "on": "workflow_dispatch",
36 "mcp-scripts": map[string]any{
37 "mode": "http",
38 "max-size": "100KB",
39 },
40 }
41
42 result, applied, err := codemod.Apply(content, frontmatter)
43
44 require.NoError(t, err)
45 assert.True(t, applied)
46 assert.NotContains(t, result, "mode:")
47 assert.Contains(t, result, "max-size: 100KB")
48}
49
50func TestMCPScriptsModeCodemod_NoMCPScriptsField(t *testing.T) {
51 codemod := getMCPScriptsModeCodemod()

Callers

nothing calls this directly

Calls 1

getMCPScriptsModeCodemodFunction · 0.85

Tested by

no test coverage detected