How can I use URLSearchParams when running tests with Jest ?
When I do so I get
ReferenceError: URLSearchParams is not defined
You just need to upgrade your version of react-scripts
which uses the newest version of Jest that contains the ability to use URLSearchParams.
You can read more about it here: https://facebook.github.io/jest/blog/2017/12/18/jest-22.html#good-bye-node-4-welcome-jsdom-11.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With