Skip to content

Instantly share code, notes, and snippets.

Created September 7, 2011 12:59
Show Gist options
  • Save anonymous/1200489 to your computer and use it in GitHub Desktop.
Save anonymous/1200489 to your computer and use it in GitHub Desktop.
A way to mock Backbone.sync in unit tests
Backbone._sync = {};
Backbone.sync = function(method, model, options) {
Backbone._sync["last_" + method] = model;
options.success(model);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment