testing-library / pptr-testing-library

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

instanceOf RegExp doesn't work in jest #63

Closed georgehb closed 3 years ago

georgehb commented 3 years ago

There is an instanceof RegExp check used in convertRegExpToProxy. This doesn't work in jest which runs each test in a separate execution context.

Changing this check to Object.prototype.toString.call(o) !== "[object RegExp]" should fix the issue.