-
-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There is a common pattern in the tests which is, when we want to mock a /sync, to flush it, and then, in the next tick of the promise loop, to wait for the syncing event. However, this is racy: there is no guarantee that the syncing event will not happen before the next tick of the promise loop. Instead, we should set the expectation of the syncing event, then do the flush. (Technically we only need to wait for the syncing event, but by waiting for both we'll catch any errors thrown by the flush, and make sure we don't have any outstanding flushes before proceeding). Add a utility method to TestClient to do the above, and use it where we have a TestClient. (Also fixes a couple of other minor buglets in the tests).
- Loading branch information
Showing
6 changed files
with
116 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.