Created
July 20, 2011 10:24
-
-
Save philipjrose/1094726 to your computer and use it in GitHub Desktop.
Possible issue with Sinon.JS with child properties of stubbed functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MyClass = function(myVar) | |
{ | |
// example constructor | |
this.myVar = myVar; | |
} | |
MyClass.MyNamespacedClass = function() | |
{ | |
// could be any property, not necessarily a function | |
} | |
console.log(typeof MyClass.MyNamespacedClass); // "function" | |
var myClassStub = sinon.stub(window, "MyClass"); | |
console.log(typeof MyClass.MyNamespacedClass); // "undefined" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment