-
Notifications
You must be signed in to change notification settings - Fork 141
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
add dispatch unit tests and minor refactoring #602
Conversation
🦋 Changeset detectedLatest commit: 31ccfd7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
862dd37
to
36fff04
Compare
36fff04
to
d8c716c
Compare
210cbeb
to
522e62c
Compare
522e62c
to
e1da2c3
Compare
a1a33fa
to
9976fab
Compare
22ecabd
to
8ddc550
Compare
}) | ||
|
||
// TODO: Inconsistent behavior? This seems like a bug. | ||
it('should have inconsistent timeout behavior where the delay is different based on whether timeout is explicitly set to 1000 or not', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @pooyaj
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is intentional, 300ms default, but it is configurable.
Math.max((timeoutInMs ?? 300) - elapsedTime, 0), | ||
timeoutInMs | ||
getDelay(startTime, options.timeout), // TODO: I have no idea why this delay is based on the timeout -- so if you set a timeout of 5seconds, it will (in addition) actually delay ~5seconds before invoking. | ||
options.timeout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that makes sense. So normally 300ms timeout, but let user configure the value to whatever they want?
}) | ||
|
||
// TODO: Inconsistent behavior? This seems like a bug. | ||
it('should have inconsistent timeout behavior where the delay is different based on whether timeout is explicitly set to 1000 or not', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is intentional, 300ms default, but it is configurable.
There were no unit tests covering dispatch, so I needed to add some to sleep at night, (and also because it seems a fairly importanish part of core). In doing so, uncovered weird behavior -- would like clarity on it.