-
Notifications
You must be signed in to change notification settings - Fork 247
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
Missleading regex example #54
Comments
got into this bug, but @Sshnyari workaround not worked for me typeof handler[0] is object, but } else if (handler[0] instanceof RegExp) { returns false } else if ({}.toString.call(handler[0])==='[object RegExp]') { everything works any thoughts? |
@wateryoma I don't think your problem is related to this issue. Can you post a complete code example so that it's easier to see what's going on? |
sure, i use webpack-everything as a starter in this project, just clone repo, install dependencies and run yarn && yarn dev open localhost:3000 and navigate to localhost:3000/test then watch console |
2020-08-17 The problem remains unsolved |
Backing up this issue. Could regex not be working at all ? I do const res = await this.$axios.$get('/api/foobar/123') ⭕ This works (with url as string): 200 mock.onGet('/api/foobar/123').reply(function (options) {
return [200, { msg: 'hello' }]
}); ❌ This does not (with url as regex) : 404 mock.onGet(/\/api\/foobar\/123/).reply(function (options) {
return [200, { msg: 'hello' }]
}); And i haven't introduce a I tried with both of these base url : axios: {
baseURL: 'http://localhost:3000/' // either one
baseURL: 'http://localhost:3000' // same result
} Looks like regex they're just actually not supported or not working at the time of writing this. |
When using a regex expression, requests don't get caught by the adapter in some cases
This works :
This doesn't :
It is due to the trailing slash in the baseURL.
Is there a way to fix that (in handleRequest function for example) or at least change the documentation ?
The text was updated successfully, but these errors were encountered: