-
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
Running sample test thrown an UnhandledPromiseRejectionWarning: this.moment.duration(...).format is not a function #1750
Comments
Hello @LasaleFamine! Do you use |
Hi @AndreyBelym and thank you for your fast response. Actually I have Do you think EDIT:I have tried using |
Yes, it seems it relates to a package manager issue |
So I must assume that |
I've investigated the issue in more details and found the exact reason why does it fail. For example your project has the following dependencies: "dependencies": {
"moment": "2.17.1",
"testcafe": "^0.17.2"
} TestCafe has the following deps: "moment": "^2.10.3",
"moment-duration-format": "^1.3.0",
But
Then So to make it workable with yarn it necessary to update the Meanwhile, we'll see how we can avoid this collision |
It's definitely yarn's bug and should be reported there. |
Hey, I resolved this issue by providing It make sense to me what yarn is doing, but personally I believe that |
Hi @damianbaar, Thanks for the workaround with |
Yeah if it's just for formatting dates, https://github.com/date-fns/date-fns might be a better option. |
@damianbaar, the |
@andreyluiz, It possible you need to remove the |
confirmed this works for me now |
I just ran into this issue as well, even though my project had a newer version of moment as a dependency. I ended up having to delete an entry for the older version of moment from my After having looked at the documentation for
In
If it looks like this would work, and is an acceptable solution, I'd be happy to open a PR. |
Hi @s-robertson! Thanks for pointing on it. It's a very important issue, I'll try your solution and provide a fix for TestCafe ASAP. |
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. |
Are you requesting a feature or reporting a bug?
What is the current behavior?
After a fresh installation within my project directory I followed the main example of the Getting Started doc's paragraph.
The test example runs correctly, but at the end of the test the browser hangs on a Testcafe page that said Connected with a loading spinner and an error is shown on the terminal:
What is the expected behavior?
Finished tests and close the browser without errors (?).
How would you reproduce the current behavior (if this is a bug)?
Installed within my Ubuntu:
Inside a project with the command:
Running with a yarn script
yarn test:testcafe
that runs testcafe:Within the
testcafe
folder I have amain.js
file for my test.Provide the test code and the tested page URL (if applicable)
main.js
Specify your
The text was updated successfully, but these errors were encountered: