After a long discussion in https://github.com/testing-library/dom-testing-library/pull/342, we ended up getting to the conclusion that it's better to have a util runWithRealTimers function that ensures that the passed callback is always run with real timers.
This function can also be extended to support other test runners as I mention in the comment that I left in the code.
TL;DR With this addition, developers won't have to worry about using real or fake timers because wait-for-expect will always use the real ones :smiley:
After a long discussion in https://github.com/testing-library/dom-testing-library/pull/342, we ended up getting to the conclusion that it's better to have a util
runWithRealTimers
function that ensures that the passed callback is always run with real timers. This function can also be extended to support other test runners as I mention in the comment that I left in the code.TL;DR With this addition, developers won't have to worry about using real or fake timers because
wait-for-expect
will always use the real ones :smiley: