Skip to content
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

implement ignoreQueryString as a boolean parameter #164

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

implement ignoreQueryString as a boolean parameter #164

wants to merge 1 commit into from

Conversation

ikhnaton
Copy link

This submission allows the user to specify whether or not to ignore query parms when matching handlers. The new parameter can be specified as follows:

const mock = new MockAdapter(axios, {ignoreQueryString: true});

All tests pass.

@riquito
Copy link

riquito commented Oct 18, 2018

I'd like to have this kind of functionality, but on a per-request basis.

Not sure about the API though

// 1. ignore parameters if missing (breaking change)
onGet(someUrl) // ignore parameters
onGet(someUrl, {}) // require empty parameters
onGet(someUrl, { params: { x: 2 } }) // require some parameters

// 2. use a third parameter during requests to handle additional options
//    (less ergonomic but extensible with future options and not breaking change)
onGet(someUrl, null, { ignoreQueryString: true })
onGet(someUrl, { ... my params ... })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants