-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
addEventListener
instead of onmessage
in WebWorkerPostMessage…
…Stream (#83) * Use addEventListener instead of onmessage in WebWorkerPostMessageStream constructor The use of addEventListener allows proper handling of multiple event listeners. onmesssage also does not work with LavaMoat. * Remove test for throwing error when not run in a WebWorker This test is now unnecessary. * Refactor WebWorkerPostMessageStream test using mocked self The test was trying to use globalThis.self variable, but it is not always defined in the test environment. To fix the issue, the variable can be created as a mock object before each test, and restored to the original value after it finishes.
- Loading branch information
Showing
2 changed files
with
17 additions
and
13 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