-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make mock WebChannel less invasive and add a cleanup function.
The WebChannel mocking now calls the original functions for addEventListener, removeEventListener, and dispatchEvent. This means that it won't interfere with other uses of these APIs. On example of another use is the popstate event: UrlManager.test.js has a test which makes sure that the URL state is restored when going backwards in history. Using a mocked WebChannel in that test broke it because the popstate event was no longer being dispatched. Furthermore, this patch adds "restoreOriginals()" calls to all users of the mock WebChannel. I haven't seen any problems from not restoring the un-mocked functions, but it seems like the right thing to do.
- Loading branch information
Showing
5 changed files
with
111 additions
and
45 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
Oops, something went wrong.