firefox-devtools / firefox-devtools/profiler
The testing methed "triggerResponse" in the mock WebChannel should probably be asynchronous
Open
tests
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 491
- Avg merge
- 3d 46m
- Merged PRs (30d)
- 27
Description
This `triggerResponse` function is synchronous:
https://github.com/firefox-devtools/profiler/blob/45f7c6f0f2a0909cb622d698bb73800953bbeea3/src/test/fixtures/mocks/web-channel.js#L38-L49
For more realistic testing of the WebChannel code paths, it would be better if the responses were sent asynchronously, for example with a `setTimeout(..., 0)`.
However, this will require some changes to the tests that use it, because most of them currently assume the response to be processed synchronously.
┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-428)
Contributor guide
Assessment
This issue has not been assessed yet.