(t *testing.T)
| 101 | } |
| 102 | |
| 103 | func TestScheduleCodemod_MonthlyOnAt(t *testing.T) { |
| 104 | codemod := getScheduleAtToAroundCodemod() |
| 105 | |
| 106 | content := `--- |
| 107 | on: |
| 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 | |
| 130 | func TestScheduleCodemod_DailyAround_NoChange(t *testing.T) { |
| 131 | codemod := getScheduleAtToAroundCodemod() |
nothing calls this directly
no test coverage detected