Conversation
Paul-Hebert
left a comment
There was a problem hiding this comment.
Looks great! Left a few comments/questions inline.
| const error3 = await waitFor(() => new Promise<never>(() => {}), { | ||
| timeout: 10, | ||
| onTimeout: (err) => { | ||
| err.message += '\nCaleb wuz here'; |
| * The maximum amount of time (milliseconds) that will pass between each run of the callback. | ||
| * If the MutationObserver notices a DOM change before this interval triggers, | ||
| * the callback will run again immediately. | ||
| * Default: 50ms |
There was a problem hiding this comment.
Are we actually setting these defaults somewhere or are these just the defaults from testing library?
If they're from testing library are we worried at all that are docs could be wrong if they change those defaults? Maybe we should set these defaults to make sure the docs and implementation stay in sync?
There was a problem hiding this comment.
These are the defaults from testing library.
Whenever there are DTL updates, I check through their changes to see if there is anything on our end we need to update. I agree that I don't want our docs to diverge from the functionality, but I also don't want our functionality to diverge from DTL's functionality. Whether we set the defaults in code here or not, we'd still have to keep an eye out to prevent it from diverging
Co-authored-by: Paul Hebert <paul@cloudfour.com>
This is something in dom testing library that I had skipped but it seems like there are a fair number of use cases where it is useful
https://testing-library.com/docs/dom-testing-library/api-async/#waitfor