(t *testing.T)
| 206 | } |
| 207 | |
| 208 | func TestScheduleCodemod_MultipleSchedules(t *testing.T) { |
| 209 | codemod := getScheduleAtToAroundCodemod() |
| 210 | |
| 211 | content := `--- |
| 212 | on: |
| 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 | |
| 237 | func TestScheduleCodemod_ScheduleField(t *testing.T) { |
| 238 | codemod := getScheduleAtToAroundCodemod() |
nothing calls this directly
no test coverage detected