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

Function TestScheduleCodemod_MultipleSchedules

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

Source from the content-addressed store, hash-verified

206}
207
208func TestScheduleCodemod_MultipleSchedules(t *testing.T) {
209 codemod := getScheduleAtToAroundCodemod()
210
211 content := `---
212on:
213 schedule:
214 - cron: daily at 09:00
215 - cron: weekly on Monday at 10:00
216---
217
218# Test`
219
220 frontmatter := map[string]any{
221 "on": map[string]any{
222 "schedule": []any{
223 map[string]any{"cron": "daily at 09:00"},
224 map[string]any{"cron": "weekly on Monday at 10:00"},
225 },
226 },
227 }
228
229 result, applied, err := codemod.Apply(content, frontmatter)
230
231 require.NoError(t, err)
232 assert.True(t, applied)
233 assert.Contains(t, result, "daily around 09:00")
234 assert.Contains(t, result, "weekly on Monday around 10:00")
235}
236
237func TestScheduleCodemod_ScheduleField(t *testing.T) {
238 codemod := getScheduleAtToAroundCodemod()

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected