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

Function TestScheduleCodemod_PreservesIndentation

pkg/cli/codemod_schedule_test.go:182–206  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

180}
181
182func TestScheduleCodemod_PreservesIndentation(t *testing.T) {
183 codemod := getScheduleAtToAroundCodemod()
184
185 content := `---
186on:
187 schedule:
188 - cron: daily at 09:00
189---
190
191# Test`
192
193 frontmatter := map[string]any{
194 "on": map[string]any{
195 "schedule": []any{
196 map[string]any{"cron": "daily at 09:00"},
197 },
198 },
199 }
200
201 result, applied, err := codemod.Apply(content, frontmatter)
202
203 require.NoError(t, err)
204 assert.True(t, applied)
205 assert.Contains(t, result, " - cron: daily around 09:00")
206}
207
208func TestScheduleCodemod_MultipleSchedules(t *testing.T) {
209 codemod := getScheduleAtToAroundCodemod()

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected