-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Client unit tests not working on Meteor3 with beta #151
Comments
Thank you for submitting this issue! We, the Members of Meteor Community Packages take every issue seriously. However, we contribute to these packages mostly in our free time. If you think this issue is trivial to solve, don't hesitate to submit Please also consider sponsoring the maintainers of the package. |
Oh I think it was some weird setup I have. In order to use other tools I have a .mocharc.js
I believe in previous versions this was completely ignored by this use case, but it existing causes problems in this beta |
Which puppeteer version do you have installed? |
|
Can you please run one test for me without puppeteer but actually in the browser (the default without any browser driver) and paste the console output here, please? The problem is that the puppeteer process does not pipe the errors back so we can't see the root cause of this. In browser it will show up |
This is the only error I get. I don't know what this error is, but I have been getting it forever without issue before. SO I guess it could be related to error handling of this
|
Some further investigation definitely shows that its the .mocharc.js file that causes that erorr and that causes the tests not to load. This leads to two things.
But can't get all the options I had back in even trying to mimic this format https://github.com/mochajs/mocha/blob/master/example/config/.mocharc.js
|
Thanks for getting closer to the root cause. I will check on the RC file but I assume there is some config issue since we updated mocha from V8 to V10 and maybe this included breaking changes. |
Yeah wouldn't be surprised if it was related to a mocha update. But I will reiterate, that I always got that error on Meteor2, so its more about how it reacts to that error. I'm guessing its an unhandled promise error vs an error that was just caught and ignored at some level. |
Can you narrow it down, to which property of the rc file this actually roots? By looking at the Mocha changelog the closest candidates are My first assumption here is, something is not imported right internally, causing it to be |
It seems that programmatic spawn of mocha has a limited set of options: https://mochajs.org/api/mocha Furthermore: do your tests still work in general, once these options are corrected? |
That resource helped. "require" also broke it even though that list says it whould work but I am able to get it to run with these options:
Being limited to these options though does make it more annoying to run tests in vscode which is what we had originally created this file to accomplish, it would be nice if this got back to the state it was before, but understand if this is minor enough to not warrant it. |
@ToyboxZach can you give me some resources on how you integrate it with vscode? I use IntelliJ so I have not so much knowledge on it. Maybe it's easy to integrate on package level before passing it to mocha |
It has actually been a while since I have tried it because we figured out some other command line flows that just worked better for me so I don't have the full integration going but if I remember correctly we used this extension https://github.com/compulim/vscode-mocha And then the key was actually including these values in the mocharc So that it knew correctly to babel compile it, and where to find the specs. Essentially it just ran a mocha instance in vscode and we just had to figure out how to make sure it compiled and loaded stuff correctly, so it was pretty much copying what this package was doing, but with a third part tool. Thats why this change makes it a bit more annoying, as we can't share the mocharc between the two use cases, and if I remember correctly it was either not possible, or cumbersome to actually pass these options via the command line that vscode worked off of. But we don't use it anymore, so at the moment its not an issue for me. |
Let me see if we can use Meteor to make the require option somehow. From my end this may be important as well as it's a part of integration of Meteor into the broader JS ecosystem. For many devs VScode integration is a must so we should look for being compatible, too |
Just an update about this. I seem to be running into a similar problem if I update puppeteer to the latest version. I'm going to dive a bit deeper, but there is definitely some lack of error being propagated that is making it hard to figure out. |
Yes puppeteer had breaking changes which is why we stick to 18 something in our test projects. That will work for sure but is no long term solution. |
On the beta
#150
Describe the bug
The client tests never run
I get this log and then it just stops:
To Reproduce
in client.test.ts
Run the command:
TEST_SERVER=0 CLIENT_TEST_REPORTER='min' TEST_BROWSER_DRIVER=puppeteer meteor test --driver-package meteortesting:mocha --port 3050 --once
Expected behavior
It runs my test
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
My tests were working just fine in 2.0 but the move to 3.0 fails. My app roughly works when not testing, but unit tests fail like this, and functional tests have other issues, that I am not confident are related or not
This is my package list if it helps (on Meteor 3.beta)
The text was updated successfully, but these errors were encountered: