Remove AbortController test mock#3506
Merged
mfazekas merged 1 commit intornmapbox:mainfrom Jun 5, 2024
Merged
Conversation
This library includes an `AbortController` test mock, which doesn't work in places that expect a real one. For example, I was writing an unrelated test that tried to cancel a `fetch()` which failed because the `AbortController`'s `signal` property was invalid. Because [`AbortController` is in all supported Node versions][0], we can safely remove this mock and rely on the real thing. This should only affect tests. [0]: https://developer.mozilla.org/en-US/docs/Web/API/AbortController#browser_compatibility
EvanHahn
added a commit
to digidem/comapeo-mobile
that referenced
this pull request
Jun 4, 2024
Once a day, a metrics report will be generated and sent to our metrics server. These are governed by two new environment variables, documented in the README. Most of the magic happens in the `useSendMetrics` hook. There were a few parts of this work that were kinda unrelated: - I added several small helper functions (`assert`, `sleep`, and `throwIfAborted`). - `@rnmapbox/maps` has a bug where its Jest helper breaks `AbortController`, which we use here. I had to patch the module, and I [submitted the patch upstream][0]. Closes [#332]. [0]: rnmapbox/maps#3506 [#332]: #332
Contributor
Author
|
Thanks! Any estimate on when this will be released? No rush, just curious. |
EvanHahn
added a commit
to digidem/comapeo-mobile
that referenced
this pull request
Jun 11, 2024
Once a day, a metrics report will be generated and sent to our metrics server. These are governed by two new environment variables, documented in the README. Most of the magic happens in the `useSendMetrics` hook. There were a few parts of this work that were kinda unrelated: - I added several small helper functions (`assert`, `sleep`, and `throwIfAborted`). - `@rnmapbox/maps` has a bug where its Jest helper breaks `AbortController`, which we use here. I had to patch the module, and I [submitted the patch upstream][0]. Closes [#332]. [0]: rnmapbox/maps#3506 [#332]: #332
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This library includes an
AbortControllertest mock, which doesn't work in places that expect a real one. For example, I was writing an unrelated test that tried to cancel afetch()which failed because theAbortController'ssignalproperty was invalid.Because
AbortControlleris in all supported Node versions, we can safely remove this mock and rely on the real thing.This should only affect tests.
Checklist
CONTRIBUTING.mdI updated the doc/other generated code with runningyarn generatein the root folderI have tested the new feature on/exampleapp.I added/updated a sample - if a new feature was implemented (/example)Reproduction
This test fails before this change: