-
Notifications
You must be signed in to change notification settings - Fork 672
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
[RequestMock] Add a warning with a clear message when CORS validation is failed #2482
Comments
By adding nock as dependency, removing RequestMock code, and adding nock standard interceptor with |
Hi @davidcunha Yes, your are right. It's a CORS issue. You need to change your code as follows: const mock = RequestMock()
.onRequestTo('http://remote-api.com/api/auth?user_type=customer')
.respond({
result: null,
errors: [
{
message: 'Incorrect username or password.',
},
],
}, 200, {'Access-Control-Allow-Origin': '*'}); From our side we will add a warning with a clear message for this case. |
I am working on it |
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow. |
…vExpress#2482) (DevExpress#2613) * add clear message about failed CORS validation requests (close DevExpress#2482) * tmp * formatting * rename * add condition * fix lint
I'm testing to mock a remote API endpoint (http://remote-api.com/api/auth?user_type=customer) that is being called with "isomorphic-fetch" when filling a form and clicking in a simple submit button. It seems that the mock is returning HTTP status 222. Does this means it can be a CORS issue? Or a bug of the RequestMock?
Tested page URL: http://localhost:3000/
Test code
The text was updated successfully, but these errors were encountered: