New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand function fails on weird GET query params #2541
Comments
The fix as a patch for pnpm:
The first part is a fix for something else (Clickhouse Node JS library doesn't work with nock without this fix as it's uses The second part is fix to always make sure the value is an object. |
Thanks @bartoszhernas! |
Two bug fixes with two corresponding tests added to PR. I realised while writing test, that my original fix was really bad and was hiding the issue and braking URL comparison 🥶 |
Please avoid duplicates
Reproducible test case
Use url: include=record-labels,artists&include[music-videos]=artists
Nock Version
13.3.6
Node Version
v20.9.0
TypeScript Version
No response
What happened?
The
expand
function that is used to compare if the GET parameters are the same to match the interceptor will fail on input coming from Apple Music API.Take this URL and try to call it with nock:
it will fail with:
The culprit is that one of the params, specifically
include
is specifying the value as a string, and then as a objects.this part of the URL will make code error out:
include=record-labels,artists&include[music-videos]=artists
I am now looking into the proper fix for it
Would you be interested in contributing a fix?
The text was updated successfully, but these errors were encountered: