By bloid
via nearinfinity.com
Published: Oct 14 2007 / 23:26
This is a short tip that I found useful for testing complex JavaScript objects using crosscheck. For more information on crosscheck see my article on JavaScript Unit Testing with Crosscheck.
Testing instance methods can be a pain if the functions use instance variables and the object is heavyweight. In my case the constructor did a lot with the DOM that I didn't want to mock. Instead of invoking the function through an instance of an object, I called it statically.
Tweet
SaveShareSend
Tags: frameworks, javascript



Add your comment