You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I checked all open bugs and none of them matched my problem.
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.
TypeError: Cannot create property 'music-videos' on string 'record-labels,artists'
at expand (/Users/bartoszhernas/Developer/FYM/app/node_modules/.pnpm/nock@13.3.6_patch_hash=im4utkxp22iqg6dq2hrzjgeg4u/node_modules/nock/lib/common.js:723:27)
at Object.dataEqual (/Users/bartoszhernas/Developer/FYM/app/node_modules/.pnpm/nock@13.3.6_patch_hash=im4utkxp22iqg6dq2hrzjgeg4u/node_modules/nock/lib/common.js:561:16)
at Interceptor.matchQuery (/Users/bartoszhernas/Developer/FYM/app/node_modules/.pnpm/nock@13.3.6_patch_hash=im4utkxp22iqg6dq2hrzjgeg4u/node_modules/nock/lib/interceptor.js:442:19)
at Interceptor.match (/Users/bartoszhernas/Developer/FYM/app/node_modules/.pnpm/nock@13.3.6_patch_hash=im4utkxp22iqg6dq2hrzjgeg4u/node_modules/nock/lib/interceptor.js:322:33)
at /Users/bartoszhernas/Developer/FYM/app/node_modules/.pnpm/nock@13.3.6_patch_hash=im4utkxp22iqg6dq2hrzjgeg4u/node_modules/nock/lib/intercepted_request_router.js:304:9
at Array.find (<anonymous>)
at InterceptedRequestRouter.startPlayback (/Users/bartoszhernas/Developer/FYM/app/node_modules/.pnpm/nock@13.3.6_patch_hash=im4utkxp22iqg6dq2hrzjgeg4u/node_modules/nock/lib/intercepted_request_router.js:303:45)
at InterceptedRequestRouter.maybeStartPlayback (/Users/bartoszhernas/Developer/FYM/app/node_modules/.pnpm/nock@13.3.6_patch_hash=im4utkxp22iqg6dq2hrzjgeg4u/node_modules/nock/lib/intercepted_request_router.js:268:12)
at InterceptedRequestRouter.connectSocket (/Users/bartoszhernas/Developer/FYM/app/node_modules/.pnpm/nock@13.3.6_patch_hash=im4utkxp22iqg6dq2hrzjgeg4u/node_modules/nock/lib/intercepted_request_router.js:140:12)
at /Users/bartoszhernas/Developer/FYM/app/node_modules/.pnpm/nock@13.3.6_patch_hash=im4utkxp22iqg6dq2hrzjgeg4u/node_modules/nock/lib/intercepted_request_router.js:78:33
at processTicksAndRejections (node:internal/process/task_queues:77:11)
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?
yes
The text was updated successfully, but these errors were encountered:
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 URLImpl class for URLs. Checking constructor name worked better in this case).
The second part is fix to always make sure the value is an object.
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: