79118177

Date: 2024-10-23 13:43:16
Score: 2
Natty:
Report link

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.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Melchia's
  • Low reputation (1):
Posted by: James Parker