testing-library / pptr-testing-library

puppeteer + dom-testing-library = 💖
MIT License
287 stars 29 forks source link

Support global timeout #72

Open IdanGoor opened 2 years ago

IdanGoor commented 2 years ago

Added support for a global timeout configuration, follows the specification of asyncUtilTimeout. In order to achieve this goal, we had to manipulate the "dom-testing-library.js" file (similar to how it's being done today to support testIdAttribute configuration), and replace all occurrences of asyncUtilTimeout with our config. We used a regex to match floating-point numbers with an optional exponent, because esbuild formats "1000" to "1e3".

Moreover, we add & change tests so we can verify the global timeout works with this library waitFor method, and also with the findBy* query from the "dom-testing-library".

Relates to ticket #71