How to match against array query params using intercept
?
#26404
Unanswered
chipit24
asked this question in
Questions and Help
Replies: 1 comment
-
as it turns, man, the only way for now is using reg exp, hope your params stay always in same order |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a request going out that looks like this:
I set up my interceptor in Cypress like so:
I tried
"ids[1]": "1"
and"ids": "1"
but nothing seems to work to match against "array" query strings. Anyone else run into this before?Cypress seems to just ignore the
"ids"
query param; I have no problem matching on the "single string" query params.FYI: This request is being sent by
axios
, which unwraps array-like param objects as separate fields with the same key, hence why it's passing the query along asids[]=1&ids[]=2
. Not sure how Cypress supports matching against this even if only one item is sent?Beta Was this translation helpful? Give feedback.
All reactions