The reply I got was that I should stop using jsUnit from jsunit.net and start using the one on berlios.de instead as it was a more faithful port of JUnit, was more Object Oriented, and it was possible to run the tests from Rhino (which led me to asking what rhino is, and then a 2 hour longer conversation ensued).
Anyway, jsunit is just that… it’s a faithful port of JUnit 3.8.1 and is designed in a more object oriented way than it’s counterpart. In fact, the syntax looks similar to the current built in test runner in js-test-driver. With that out of the way, let’s take a quick look at the dirty details.
Tonight I’ve decided to bounce back and try out another testing framework that’s been on my list for awhile, YUI Test. From the site:
Fair enough… lets look at the dirty details and then get started.
The Dirty Details
Basically another xUnit framework, but the syntax is radically different from any framework I’ve seen, xUnit or BDD. instead of your usual “assertXXXX” or spec syntaxes, it simply uses yep and okay . Most importantly, this is the framework used by jQuery to test itself.
Today I’m going to take a look at visionmedia’s jspec. I came across jspec randomly on github when someone else I followed forked it, definitely a testament to the importance of the social media aspect of github.
The Dirty Details
JSSpec, as the name implies, is a Behavior Driven Development framework based on the popular rspec ruby framework… as such it borrows heavily from rspec’s structure and functionality, using a function named “describe” to start a spec and values are evaluated by passing them to a function named value_of which returns an object containing methods for performing assertions on the value. For example:
Now for the other details: