Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@bvaughn I found the test slightly confusing because the timing didn't appear in the test i.e. I could change the delay of
flushPendingErrorsAndWarningsAfterDelay
to 10s or 5s and it still passed.I copied the approach of
asyncAct
to not flush recursively so that we can visualize the timing in the test.In the end we traded one implementation detail (advance timers by 1 to flush commit) for another (advance timers by 1000 to flush pending warnings). I'd argue we're more interested in the 1000ms delay here and it isn't just an implementation detail.
Feel free to close this if you don't think this improves readability of the test.
Ideally we'd have a dedicated method to flush bridge operations so that we don't run unrelated timers. Running timers implicitly is, to me, more confusing then having to advance it explicitly.