-
Notifications
You must be signed in to change notification settings - Fork 158
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
Mocking route with query params #316
Comments
https://github.com/pretenderjs/pretender/tree/54ea79ede7bbbf5bcebaac507f2ec9db6875f4a5#query-parameters
Does this suffice the need? |
For a simple query param yes, but when using the RSQL format it does not. From my example As a simple approach even if it returned |
Looks like |
I am using MirageJS which uses pretender but the issue I think lies in pretender.
Trying to mock an API that uses RSQL as a query language. Requests look like the following
/api/films?filter=genres=in=(comedy);actor=="Ryan Reynolds"
with fairly complex query params. Is there any way to mock this exact URL?I would have thought I could have done
this.get('/films?filter=genres=in=(comedy);actor=="Ryan Reynolds"', () => {...})
but looks like the only route the will catch is mocking/films
though currently using the request.queryParams it returns {filter: "genres"} and omits the rest of the query.How might I, if at all mock API endpoints with specific queries appended to return different responses.
The text was updated successfully, but these errors were encountered: