TheBrainFamily / wait-for-expect

Wait for expectation to be true, useful for integration and end to end testing. Integral part of react-testing-library.
MIT License
293 stars 31 forks source link

Fix handle jest v27 fake timers (issue #30) #38

Open wilsonpage opened 1 year ago

wilsonpage commented 1 year ago

The existing check for jest fake timers no longer works as jest v27 mutates the setTimeout global differently. This patch checks for both the old and new formats.

lgandecki commented 1 year ago

Thanks, do you think this works too? https://github.com/TheBrainFamily/wait-for-expect/pull/37

I like that it also upgrades the jest so the tests verify the change

wilsonpage commented 1 year ago

Thanks, do you think this works too? #37

I like that it also upgrades the jest so the tests verify the change

👍 Looks like a better PR. You should merge that one.