MCPcopy Create free account
hub / github.com/github/gh-aw / TestScheduleCodemod_MonthlyOn

Function TestScheduleCodemod_MonthlyOn

pkg/cli/codemod_schedule_test.go:76–101  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

74}
75
76func TestScheduleCodemod_MonthlyOn(t *testing.T) {
77 codemod := getScheduleAtToAroundCodemod()
78
79 content := `---
80on:
81 schedule:
82 - cron: monthly on 1
83---
84
85# Test`
86
87 frontmatter := map[string]any{
88 "on": map[string]any{
89 "schedule": []any{
90 map[string]any{"cron": "monthly on 1"},
91 },
92 },
93 }
94
95 result, applied, err := codemod.Apply(content, frontmatter)
96
97 require.NoError(t, err)
98 assert.True(t, applied)
99 assert.Contains(t, result, "0 0 1 * *")
100 assert.Contains(t, result, "# Converted from 'monthly on 1'")
101}
102
103func TestScheduleCodemod_MonthlyOnAt(t *testing.T) {
104 codemod := getScheduleAtToAroundCodemod()

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected