Skip to content

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