12/31/2012

Using Jasmine-Node to Test Your Node Server

I've been working with Jasmine to test my client side code, however, my code extends beyond the client. I am working on server side JavaScript using Node.js. It would be great to apply my test driven process to my node server as well. Luckily, the Node community is large, helpful, and talented. Jasmine has been ported to the server with the jasmine-node project by Miško Hevery (https://github.com/mhevery/jasmine-node). The github readme summarizes the process of setting up jasmine-node, so this post will expound on those points.

12/17/2012

Building a Unit Test in Jasmine, Part 4

The last part in this series is going to involve some time travel.  Physics aside, let's assume six months have passed since our original JasmineTester object was created.  The object was a great success and has been embedded all throughout the organization.  We have forgotten the details of our earlier work as multiple other projects have come and gone.  While still basking in the glow of our earlier success, a new requirement comes down the line: make a new object exactly like the JasmineTester but with multiplication.  Thanks goodness we used Jasmine!

12/03/2012

Building a Unit Test in Jasmine, Part 3

We created a Jasmine unit test example in the first two parts of this series that started with a statement and then abstracted out to an object.  This time we will expand the object to be more robust.  Most importantly, we are not changing the tests currently in place.  

The JasmineTester is going to be updated to accept a random number of values.  The first step is to create a unit test to describe this.  The number of properties being added is upped to 4.  The new test will check to make sure the new object constructor still returns an object by using the toBeDefined matcher.