Skip to content

Instantly share code, notes, and snippets.

@jcreamer898
Created October 25, 2013 03:50
Show Gist options
  • Save jcreamer898/7149206 to your computer and use it in GitHub Desktop.
Save jcreamer898/7149206 to your computer and use it in GitHub Desktop.
Example of unit test issues in AMD
define([
'app/viewModels/user'
], function(User) {
var SomeViewModel = function() {
this.users = [];
this.addUser();
};
SomeViewModel.prototype.addUser = function() {
// Sometimes I wan't to fake this `User` or whatever. It's hard to do w/ AMD.
this.users.push(new User());
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment