-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test helper to await Durable Object's alarms #322
Labels
enhancement
New feature or request
Milestone
Comments
Hey! I wanted to work on this for myself too. I've been thinking more along the lines of: global.flushDurableObjectAlarms(ids?: DurableObjectId[]) Where no ids specified means to call all existing alarms. I'll try to find time this week to add this. |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We would like to test the side effects in our alarms, but the best way to do it now seems to be sleeping in tests for MAX_ALARM_TIMEOUT (which can slow tests down significantly), or mocking an internal function used in alarm via jest.
Would it be a good idea to expose a similar API to
res.waitUntil()
(e.g.,await res.waitForAlarms()
), which optionally accepts an argument to change the alarm interval, so they can be tested instantly?The text was updated successfully, but these errors were encountered: