To expand even further on @Melchia's example:
global.URLSearchParams = jest.fn((x) => ({
get: jest.fn((y) => (x.includes(y) ? x.split("=")[1] : null)),
}));
This will actually mimic the URLSearchParams 'get' function, returning the parameter value.