Sunday, 15 July 2012

javascript - Collection Testing with Vows.js -



javascript - Collection Testing with Vows.js -

i trying run unit tests against every item in collection using vows.js , i'm having heck of time getting work. here have @ moment.

'the variations objects': { topic: function() { var promise = new(events.eventemitter), variations = json.parse(body).variations; for(var = variations.length - 1; >= 0; i--) { promise.emit("success", variations[i]); }; homecoming promise; }, 'should have x': function(topic) { should.exist(topic.x); }, 'should have action on add_to_cart object if product in_stock': function(topic) { if(topic.x.id === 'test'){ should.exist(topic.x.action) } } }

this seems working. however, when run tests, 34 passed , 1 error. vows not indicate test erroring. don't sense using eventemitter right selection this, i'm not sure how else have new topic each object in given collection.

javascript node.js vows

No comments:

Post a Comment