Easy automated unit testing


#1

Hi, I’ve got a class assignment to create a continuous integration environment. I’ve just few knowledge of programming, and none of testing (I don’t even know what are stubs, mocks, etc, I’ve just heard about them). But I’ve figured it out, and connected an out-of-box meteor protect with my github account, and I use travis-ci as the continuous integration server, heroku as the PaaS server (using heroku-buildpack-meteor provided by kevinseguin). Now I just need to code some unit tests for my project to be complete.
I’ve been looking around and I found chimp, and chimp could be used with cucumber, jazmine and mocha. I wanted to know why cannot I just use cucumber without chimp (provided cucumber is an automated testing framework, or that is what it’s webpage says).
Or is it there any other easier solution? Please I need some help here, I’m a complete noob. Here it is a picture I made with every component I’m using (or at least want to use), sorry it is in spanish but the images are pretty straight forward https://camo.githubusercontent.com/70b467329400f04ad2a550522e1a3f5ad5757a04/687474703a2f2f692e696d6775722e636f6d2f384b35434e56632e706e67


#2

Great job so far in working out everything else!

Re testing, did you see http://guide.meteor.com/v1.3/testing.html ? It’s simply written and very comprehensive.

For reference, there’s also https://github.com/xolvio/automated-testing-best-practices, but it goes way beyond what you’ll need for your project.

Note, chimp is for acceptance and end-to-end testing, you won’t need it for this (you said the requirement is just unit tests). The recommended library for unit testing in the guide is mocha, which is great. Jasmine is an alternative to mocha, you wouldn’t use them both; although whereas Jasmine includes everything you need, Mocha works with the chai assertion library and sinon for spies/stubs/mocks. Cucumber is another alternative that let’s you write your tests in plain language. My suggestion is to stick with just mocha/sinon/chai (the Meteor package for mocha includes all 3 together).

The above is quite a loaded paragraph, but I think slowly work your way through the guide (the 1st link) and everything will become clear.