(t *testing.T)
| 20 | } |
| 21 | |
| 22 | func TestMCPScriptsModeCodemod_RemovesMode(t *testing.T) { |
| 23 | codemod := getMCPScriptsModeCodemod() |
| 24 | |
| 25 | content := `--- |
| 26 | on: workflow_dispatch |
| 27 | mcp-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 | |
| 50 | func TestMCPScriptsModeCodemod_NoMCPScriptsField(t *testing.T) { |
| 51 | codemod := getMCPScriptsModeCodemod() |
nothing calls this directly
no test coverage detected