-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Testing Frameworks #464
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
Comments
In brief, I like Jasmine's ability to cover both front and back end cases. I like to write tests with one framework to keep the test suites consistent and (IMO) more readable as a result. Doubtless you've been through the docs and obviously there are a lot of examples there.
|
@JaKXz thanks so much for your answer! I can totally see the advantage of using the same framework for both server and client. As for mocha + chai, the server test are actually using mocha + should.js ATM. Would a switch to mocha + chai be possible? In my (inexperienced) opinion; chai would seem a better candidate since it provide Also, on the point of a unified testing framework; karma currently uses Jasmine, while the server test are written in mocha. Should we look at unifying them or perhaps use a prompt in the future to allow users to choose? Btw; thanks for suggesting Istanbul, I'll definitely check it out. |
Let me get some clarity: are we talking about test coverage for the generator? OR, for a newly generated project? I misspoke earlier and I apologize, |
I was referring to a newly generated project when I spoke earlier. The client side test, ran by karma, use Jasmine. The server side use Mocha + should.js. So my question was, should we look at unifying those tests? Potentially using Mocha + Chai for both server and client test on a generated project. Sorry for the confusion. |
I would like to unify them. I prefer mocha and chai for both front and backend, but I think we should support jasmine as well. |
@DaftMonk, by support would you mean a prompt? Or merely making the test in a way that would allow for Jasmine to be easily switched out? |
I was thinking a prompt. |
Sounds good. Have you heard of or used Sinon before? More specifically the Sinon-Chai plugin. Would you have any objection to using it in conjunction with Mocha + Chai? My thought was that since Jasmine has some form of spy assertions built in, it would be nice to carry that feature over to the mocha/chai setup. |
@JaKXz thanks again for your input on this. |
@kingcody no worries, it didn't turn out to be that much. I also meant to mention the mocha + chai + sinon combination. Have fun! |
@DaftMonk I've got a branch based on In implementing a prompt based testing framework selection, we would need to be able to maintain the choice with |
nice job @kingcody! 👍 |
If anyone would like to take a look at the work I've done, you can find it here. I also started to extend some of the existing tests. If anyone has time, I'd like some feedback on what I've done there. |
@JaKXz just wondering, since you seem to have experience with testing, If you might have time to checkout the work I've done on the tests I mention above. If not, it's all good :) |
@kingcody I've got more experience with Jasmine tbh, but I can give it a shot; no promises, but in any case thanks for your work on it! Just a thought, maybe there could be a choice to use Jasmine on its own, OR, mocha + sinon + chai? I'm contemplating having to rip out all your good work in future projects ...lol |
That's my plan 😄 |
@JaKXz would you be interested in helping with the Jasmine test coverage? |
@kingcody I would definitely be interested, and will try to make time for it somehow... but if others in the community can start making PRs then I'd encourage that 😄 |
Sounds great @JaKXz. Here are some of the things that I see need to be implemented:
Do you think that it would be a good idea to open an issue to invite PR's and track updates to the list of things needed? |
I'm relatively new to unit testing, but I've been working with the specs that come with the generator; trying to learn more and see if I can help with the test coverage. I've found that Jasmine is a little heavy when setting up asynchronous tests. Perhaps I haven't given it enough of a chance.
Mocha on the other hand seems to be a good bit easier when it comes to async. I setup Mocha + Chai + Sinon for the server tests I was working on and really enjoyed the combo. Kinda got me thinking: why not use mocha with karma instead?
I installed
karma-mocha
and everything seems to work great. So I'm wondering if anyone could outline Jasmine's advantages? Or would it possibly be more advantageous to use Mocha for server and client testing?The text was updated successfully, but these errors were encountered: