Skip to content

test(cron): add focused tests for parseCronExpression#5

Merged
Zzhplayer merged 1 commit into
Zzhplayer:mainfrom
Jah-yee:main
Jun 1, 2026
Merged

test(cron): add focused tests for parseCronExpression#5
Zzhplayer merged 1 commit into
Zzhplayer:mainfrom
Jah-yee:main

Conversation

@Jah-yee
Copy link
Copy Markdown
Contributor

@Jah-yee Jah-yee commented May 31, 2026

Summary

Adds focused unit tests for src/utils/cron.ts covering the cases suggested in issue #2:

  • exact minute matching — verifies 30 9 * * 1-5 parses correctly
  • wildcard fields — verifies * * * * * expands to full ranges
  • step expressions — verifies */15 yields [0, 15, 30, 45]
  • range expressions — verifies 9-17 and 1-5 ranges
  • list expressions — verifies 8,12,18 hour list
  • invalid field count — verifies error on 4-field expression
  • empty expression — verifies error on empty string

All 7 tests pass with bun test.

Closes #2

Covers:
- exact minute matching
- wildcard fields (*)
- step expressions (*/15)
- range expressions (9-17)
- list expressions (8,12,18)
- invalid field count
- empty expression

Closes Zzhplayer#2
@Zzhplayer Zzhplayer merged commit 4b76b4c into Zzhplayer:main Jun 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Good first issue: add cron parser tests

2 participants