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

Function TestScheduleCodemod_MonthlyOnAt

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

Source from the content-addressed store, hash-verified

101}
102
103func TestScheduleCodemod_MonthlyOnAt(t *testing.T) {
104 codemod := getScheduleAtToAroundCodemod()
105
106 content := `---
107on:
108 schedule:
109 - cron: monthly on 15 at 14:00
110---
111
112# Test`
113
114 frontmatter := map[string]any{
115 "on": map[string]any{
116 "schedule": []any{
117 map[string]any{"cron": "monthly on 15 at 14:00"},
118 },
119 },
120 }
121
122 result, applied, err := codemod.Apply(content, frontmatter)
123
124 require.NoError(t, err)
125 assert.True(t, applied)
126 assert.Contains(t, result, "0 9 15 * *")
127 assert.Contains(t, result, "# Converted from 'monthly on 15 at 14:00'")
128}
129
130func TestScheduleCodemod_DailyAround_NoChange(t *testing.T) {
131 codemod := getScheduleAtToAroundCodemod()

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected