Skip to content
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

How can I run a specific test from the Meteor shell? #91

Open
graemian opened this issue Jul 7, 2019 · 5 comments
Open

How can I run a specific test from the Meteor shell? #91

graemian opened this issue Jul 7, 2019 · 5 comments

Comments

@graemian
Copy link

graemian commented Jul 7, 2019

During debugging, I find I often have to restart Meteor just to run a specific test again in order to follow along with it in the debugger.

I tried

var testDriverPackage = Package["meteortesting:mocha"]
testDriverPackage.start()

which is what Meteor itself appears to do in

https://github.com/meteor/meteor/blob/24865b28a0689de8b4949fb69ea1f95da647cd7a/packages/meteor/test_environment.js

But I get this error on every test:

TypeError: Cannot read property 'call' of undefined

@SimonSimCity
Copy link
Member

I can't quite follow you ... what exactly are you trying to do? Is it about client-side or server-side tests - or maybe both? Where did you try the code you posted?

Do you e.g. have a repo which shows and let me reproduce what you're doing?

@graemian
Copy link
Author

graemian commented Jul 8, 2019

I'm specifically interested in server-side tests. I ran that code in the Meteor shell, the error appears in the Meteor console (where test results are normally reported).

In order to figure out why a test is failing, I often connect with a debugger. I step through the code, but if want to restart the debugging from the beginning, I'm forced to make a code change or restart Meteor in order to get the test to run again.

@graemian
Copy link
Author

I just discovered the ".reload" command from the Meteor shell. This effectively reruns all the tests. It would be nice to be able to rerun just a specific test, but this is still very useful.

@SimonSimCity
Copy link
Member

Would be nice to hear if you get the opportunity and time to work on it. #76 might be very much related to this ...

@hexsprite
Copy link
Contributor

@graemian you can use it.only(etc) to run a single test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants