How to test Backbone Model and Collections webapp using nodeJs and vows.
I used the Todos exemple of Backbone + RequireJS : https://github.com/addyosmani/todomvc/tree/master/todo-example/backbone+require
I added on each requireJs module an amdefine definition : https://github.com/jrburke/amdefine
In fact it's just one line to add before define([...], function(){...});
if (typeof define !== 'function') { var define = (require('amdefine'))(module); }
On Backbone Model and Collection I mock the sync method : model.sync = function(){}
And because the Collection use the localStorage, I had to mock it, via a global definition :
global.localStorage = {
getItem: function(){},
setItem: function(){}
};