(t *testing.T)
| 261 | } |
| 262 | |
| 263 | func TestScheduleCodemod_PreservesMarkdown(t *testing.T) { |
| 264 | codemod := getScheduleAtToAroundCodemod() |
| 265 | |
| 266 | content := `--- |
| 267 | on: |
| 268 | schedule: |
| 269 | - cron: daily at 09:00 |
| 270 | --- |
| 271 | |
| 272 | # Test Workflow |
| 273 | |
| 274 | Runs on a schedule.` |
| 275 | |
| 276 | frontmatter := map[string]any{ |
| 277 | "on": map[string]any{ |
| 278 | "schedule": []any{ |
| 279 | map[string]any{"cron": "daily at 09:00"}, |
| 280 | }, |
| 281 | }, |
| 282 | } |
| 283 | |
| 284 | result, applied, err := codemod.Apply(content, frontmatter) |
| 285 | |
| 286 | require.NoError(t, err) |
| 287 | assert.True(t, applied) |
| 288 | assert.Contains(t, result, "# Test Workflow") |
| 289 | assert.Contains(t, result, "Runs on a schedule.") |
| 290 | } |
nothing calls this directly
no test coverage detected