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

Add ability to set mocha's --timeout #34

Closed
workflow opened this issue May 26, 2017 · 12 comments
Closed

Add ability to set mocha's --timeout #34

workflow opened this issue May 26, 2017 · 12 comments

Comments

@workflow
Copy link

workflow commented May 26, 2017

Related: practicalmeteor/meteor-mocha-core#9

I attempted to fix this here: #33, but it looks like the option isn't doing anything when arriving at meteor-mocha-cores mochaInstance. Any hints for me?

Thanks again for this package! Very useful addition to the Meteor testing landscape 🙇‍♂️

@hexsprite
Copy link
Contributor

i wonder if this is now possible with the latest updates ? @SimonSimCity any thoughts on this? I keep running into timeouts in my tests on the CI server ;(

@SimonSimCity
Copy link
Member

SimonSimCity commented Aug 17, 2018

@hexsprite would you have the time to create a PR and prove it working on the client and server? This would help me tons ... I'll be happy to merge it in if I see it working.

Please start by forking https://github.com/meteortesting/meteor-mocha-core and checking it out into the packages folder in your meteor application.

@hexsprite
Copy link
Contributor

hexsprite commented Aug 17, 2018

for server, from what I can see you need to set the timeout within meteor-mocha-core since the global timeout must be set at Mocha instance creation. I'll send a PR to meteor-mocha-core for that. Just tested it and it works well.

@hexsprite
Copy link
Contributor

giving it a bit more thought, it might make more sense to change the calling pattern exporting an already instantiated Mocha instance to having something like getMochaInstance([options]) that would let the caller provide those options dynamically.

@hexsprite
Copy link
Contributor

here's what is working right now for server: hexsprite/meteor-mocha-core@d623f47

but for client we need to pass those options as they are not known at import time so a getMochaInstance method would work best

@aldeed
Copy link
Contributor

aldeed commented Aug 19, 2018

@hexsprite I believe you can set client options just prior to running as is currently done here: https://github.com/meteortesting/meteor-mocha/blob/master/package/client.js#L44-L46

Mocha instance has a timeout method you can call to change it after instantiation.

@aldeed
Copy link
Contributor

aldeed commented Aug 19, 2018

Note that there's a PR attempting this, which I think would work fine if just changed to use the timeout method rather than trying to set options.timeout. #33

@mitar
Copy link
Member

mitar commented Sep 2, 2018

So I just realized you can also do this.timeout(5000); inside describe to raise timeout for a particular test suite. I think this is also useful as a workaround.

I tested the #33 by changing it to call mochaInstance.timeout(timeout) but it didn't work.

@hexsprite
Copy link
Contributor

I haven't had time to look into the client side yet so if anyone feels called then by all means! :) For server tests my PR to meteor-mocha-core solves it and my CI tests are happy again.

@mitar
Copy link
Member

mitar commented Sep 2, 2018

This one #9?

@hexsprite
Copy link
Contributor

@SimonSimCity
Copy link
Member

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

No branches or pull requests

5 participants