(t *testing.T)
| 47 | } |
| 48 | |
| 49 | func TestScheduleCodemod_WeeklyOnAt(t *testing.T) { |
| 50 | codemod := getScheduleAtToAroundCodemod() |
| 51 | |
| 52 | content := `--- |
| 53 | on: |
| 54 | schedule: |
| 55 | - cron: weekly on Monday at 10:00 |
| 56 | --- |
| 57 | |
| 58 | # Test` |
| 59 | |
| 60 | frontmatter := map[string]any{ |
| 61 | "on": map[string]any{ |
| 62 | "schedule": []any{ |
| 63 | map[string]any{"cron": "weekly on Monday at 10:00"}, |
| 64 | }, |
| 65 | }, |
| 66 | } |
| 67 | |
| 68 | result, applied, err := codemod.Apply(content, frontmatter) |
| 69 | |
| 70 | require.NoError(t, err) |
| 71 | assert.True(t, applied) |
| 72 | assert.Contains(t, result, "weekly on Monday around 10:00") |
| 73 | assert.NotContains(t, result, "weekly on Monday at 10:00") |
| 74 | } |
| 75 | |
| 76 | func TestScheduleCodemod_MonthlyOn(t *testing.T) { |
| 77 | codemod := getScheduleAtToAroundCodemod() |
nothing calls this directly
no test coverage detected