mercredi 5 juillet 2017

How can I test the validations of a model if I use backbone validation

I have a backbone model

var MyModel= Backbone.Model.extend({
   validation: function () 
      var validate= { 
           name: {
               required: true,
           },
      };

      return validate;

   },
});

I use sinon, mocha and chai for test. When I call model.validate() in the test it tells me that the function does not exist, how can I check that the validation works?

Aucun commentaire:

Enregistrer un commentaire