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

Would you be open to adding sinon.js to the project? #220

Closed
adomokos opened this issue Jan 18, 2012 · 11 comments
Closed

Would you be open to adding sinon.js to the project? #220

adomokos opened this issue Jan 18, 2012 · 11 comments

Comments

@adomokos
Copy link
Contributor

I need to spy or stub on some of the functions I am trying to test. Can I add sinon.js as a dependent project to mocha?

@tj
Copy link
Contributor

tj commented Jan 18, 2012

nope, much like the assertion libs there's little reason to include them directly

@tj tj closed this as completed Jan 18, 2012
@tj
Copy link
Contributor

tj commented Jan 18, 2012

plus stubs/mocks/spies are incredibly easy just by swapping out functions no need for libs :D

@tj
Copy link
Contributor

tj commented Jan 18, 2012

it would be nice to add more to the wiki though I started this page https://github.com/visionmedia/mocha/wiki/Spies

@adomokos
Copy link
Contributor Author

Yup, I did see that. I was thinking something that we could use in development, but you don't need to package with mocha when you release it.

I started with swapping the functions, but I am too spoiled with a good spy framework like sinon.

@tj
Copy link
Contributor

tj commented Jan 18, 2012

I really really really rarely "spy", IMO at that point you're not really testing APIs

@adomokos
Copy link
Contributor Author

What if it's an external dependency, like console.error?

@tj
Copy link
Contributor

tj commented Jan 18, 2012

I dont think we need it really

@adomokos
Copy link
Contributor Author

ok, thanks!

@tj
Copy link
Contributor

tj commented Jan 18, 2012

open to it but I still think that most cases people use spies are really not testing much other than the spy logic itself haha which isn't so useful

@tj
Copy link
Contributor

tj commented Jan 18, 2012

haha once again im terrible at reading. I thought you were initially asking to add sinon to mocha in general. I still dont think we need it but yeah my bad!!

@adomokos
Copy link
Contributor Author

no worries, thanks!

jonnyreeves added a commit to jonnyreeves/mocha that referenced this issue Dec 14, 2015
Fixes mochajs#1674; provides support *much* needed for [mocha-phantomjs](https://github.com/nathanboktae/mocha-phantomjs) (see [mochajs#133](nathanboktae/mocha-phantomjs#133), [mochajs#220](nathanboktae/mocha-phantomjs#220), etc).  Maintains support for running the XUnit reporter in a browser (unlike the previously reverted PR mochajs#1068).

ping @alemangui, @nathanboktae

Thanks all.
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

2 participants