(t *testing.T)
| 180 | } |
| 181 | |
| 182 | func TestScheduleCodemod_PreservesIndentation(t *testing.T) { |
| 183 | codemod := getScheduleAtToAroundCodemod() |
| 184 | |
| 185 | content := `--- |
| 186 | on: |
| 187 | schedule: |
| 188 | - cron: daily at 09:00 |
| 189 | --- |
| 190 | |
| 191 | # Test` |
| 192 | |
| 193 | frontmatter := map[string]any{ |
| 194 | "on": map[string]any{ |
| 195 | "schedule": []any{ |
| 196 | map[string]any{"cron": "daily at 09:00"}, |
| 197 | }, |
| 198 | }, |
| 199 | } |
| 200 | |
| 201 | result, applied, err := codemod.Apply(content, frontmatter) |
| 202 | |
| 203 | require.NoError(t, err) |
| 204 | assert.True(t, applied) |
| 205 | assert.Contains(t, result, " - cron: daily around 09:00") |
| 206 | } |
| 207 | |
| 208 | func TestScheduleCodemod_MultipleSchedules(t *testing.T) { |
| 209 | codemod := getScheduleAtToAroundCodemod() |
nothing calls this directly
no test coverage detected