-
Notifications
You must be signed in to change notification settings - Fork 674
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] fetch call with mock is blocking test #2534
Comments
I'm working on it |
Hello, @davidcunha. .respond({
id: 1,
name: "John Doe"
- }, 200, {'Access-Control-Allow-Origin': '*'});
+ }, 200, {'access-control-allow-origin': '*'}); |
@Farfurix Thanks, the workaround really worked. 😎 |
Hi @davidcunha, I've just published |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow. |
…Express#2588) * update hammerhead * fix tests after hammerhead update
I'm testing to mock a remote API endpoint (http://remote-api.com/api/customers/1) that is being called with "fetch" when opening a page http://localhost:3000/account.
I'm using Next.js 6.0.3 with React 16.2.0 and isomorphic-fetch 2.2.1:
pages/login.js
Tested page URL: http://localhost:3000/account
Test code
When I run this test the function call "getCustomer" in "Account" class, which in turn calls a simple fetch and return the promise with the json content from a remote API (CORS), blocks the test at that specific line and no request is made and intercepted. However if I remove the mock, the test is "green".
I suppose this must be related with RequestMock + server-side rendering as in Next.js documentation the following description is mentioned:
"For the initial page load, getInitialProps will execute on the server only. getInitialProps will only be executed on the client when navigating to a different route via the Link component or using the routing APIs."
operating system: Mac OS X 10.13.4
testcafe version: 0.20.0
node.js version: 8.11.1
The text was updated successfully, but these errors were encountered: