jsUnit testing a method of a class with a boring constructor
Friday, August 29th, 2008Today I wanted to introduce some jsUnit testing in an old class. In particular I wanted to test a single method in isolation but I could not instantiate the object itself since the constructor had dependency on other files.
The trick is to replace the object with a new one which has the same prototype but an empty constructor:
Tags: javascript jsunit testing constructor|
Posted in Javascript
October 22nd, 2008 at 11:02 am
Good post.