How can I use URLSearchParams when running tests using Jest?
When I do this, I get
ReferenceError: URLSearchParams is not defined
You just need to update the version react-scriptsthat uses the latest version of Jest, which contains the ability to use URLSearchParams.
react-scripts
You can read more about this here: https://facebook.imtqy.com/jest/blog/2017/12/18/jest-22.html#good-bye-node-4-welcome-jsdom-11 .
jest - ? jest- jsdom, JavaScript
jsdom
jest --env=jsdom
. Jest
Source: https://habr.com/ru/post/1690817/More articles:Использование точечного оператора в dplyr:: bind_cols - rPython sockets steal each other's packages - pythonHow to use virtualenv with python3.6 on ubuntu 16.04? - pythonSet local: true to default for form_with in Rails 5 - ruby-on-rails-5It can read / write the EEPROM address, however it can only read / write the first page of memory - c ++Mocking clickHeight and scrollHeight in React + Enzyme for testing - unit-testingGet tables / schemas from access database 97 - c #automatic assignment in if condition - c ++skip whole line if specific cell value contains zero in datatable c # - c #Creating a new Microsoft application password causes an error - azureAll Articles