Skip to content

Instantly share code, notes, and snippets.

@JoeChapman
Created September 25, 2012 19:26
Show Gist options
  • Select an option

  • Save JoeChapman/3783909 to your computer and use it in GitHub Desktop.

Select an option

Save JoeChapman/3783909 to your computer and use it in GitHub Desktop.
Mocking a constructor function
var mockObject = spyOn(object, Constructor).andCallFake(function () {
return {
method1: function () {},
method2: function () {}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment