Mocking search params in tests for React components
Anyone who has needed to ensure that a React component behaves correctly based on parameters passed in the URL has likely faced some level of difficulty with testing. One of the initial strategies used to simulate this use case is attempting to set search params in the URL before the component mounts. Something like: However, by applyi...