@@ -421,27 +421,20 @@ describe('Schedule Utilities', () => {
421421 } )
422422
423423 describe ( 'parseCronToHumanReadable' , ( ) => {
424- it . concurrent ( 'should parse common cron patterns using cronstrue' , ( ) => {
425- // cronstrue produces "Every minute" for '* * * * *'
424+ it . concurrent ( 'should describe the schedules the builder generates' , ( ) => {
426425 expect ( parseCronToHumanReadable ( '* * * * *' ) ) . toBe ( 'Every minute' )
427-
428- // cronstrue produces "Every 15 minutes" for '*/15 * * * *'
429426 expect ( parseCronToHumanReadable ( '*/15 * * * *' ) ) . toBe ( 'Every 15 minutes' )
427+ expect ( parseCronToHumanReadable ( '1 * * * *' ) ) . toBe ( 'At 1 minute past the hour' )
428+ expect ( parseCronToHumanReadable ( '30 * * * *' ) ) . toBe ( 'At 30 minutes past the hour' )
429+ expect ( parseCronToHumanReadable ( '0 9 * * *' ) ) . toBe ( 'At 9:00 AM' )
430+ expect ( parseCronToHumanReadable ( '30 14 * * *' ) ) . toBe ( 'At 2:30 PM' )
431+ expect ( parseCronToHumanReadable ( '0 9 * * 1' ) ) . toBe ( 'At 9:00 AM, only on Monday' )
432+ expect ( parseCronToHumanReadable ( '30 14 15 * *' ) ) . toBe ( 'At 2:30 PM, on day 15 of the month' )
433+ } )
430434
431- // cronstrue produces "At 30 minutes past the hour" for '30 * * * *'
432- expect ( parseCronToHumanReadable ( '30 * * * *' ) ) . toContain ( '30 minutes past the hour' )
433-
434- // cronstrue produces "At 9:00 AM" for '0 9 * * *' (no leading zero on hour)
435- expect ( parseCronToHumanReadable ( '0 9 * * *' ) ) . toContain ( '9:00 AM' )
436-
437- // cronstrue produces "At 2:30 PM" for '30 14 * * *' (no leading zero on hour)
438- expect ( parseCronToHumanReadable ( '30 14 * * *' ) ) . toContain ( '2:30 PM' )
439-
440- // cronstrue produces "At 09:00 AM, only on Monday" for '0 9 * * 1'
441- expect ( parseCronToHumanReadable ( '0 9 * * 1' ) ) . toContain ( 'Monday' )
442-
443- // cronstrue produces "At 02:30 PM, on day 15 of the month" for '30 14 15 * *'
444- expect ( parseCronToHumanReadable ( '30 14 15 * *' ) ) . toContain ( '15' )
435+ it . concurrent ( 'should describe step schedules in custom cron expressions' , ( ) => {
436+ expect ( parseCronToHumanReadable ( '0 */2 * * *' ) ) . toBe ( 'On the hour, every 2 hours' )
437+ expect ( parseCronToHumanReadable ( '0 0 */2 * *' ) ) . toBe ( 'At 12:00 AM, every 2 days in a month' )
445438 } )
446439
447440 it . concurrent ( 'should describe the nth weekday of the month' , ( ) => {
0 commit comments