PDA

View Full Version : Unit Testing - JsMock



tgreiser
28 May 2007, 5:13 PM
I've been doing some unit testing with Test.Unit (http://wiki.script.aculo.us/scriptaculous/show/UnitTesting) and JsMock (http://jsmock.sourceforge.net/). It's been working well, but I did get an error when I tried to mock Ext.BorderLayout.


var mockBorderLayout = mock.createMock(Ext.BorderLayout);

I have been able to mock other Ext classes without issue. Here is the firebug stack with Ext 1.0.1:



this.el has no properties
LayoutManager(undefined, Object)ext-all-debug.js (line 22362)
BorderLayout(undefined, Object)ext-all-debug.js (line 22454)
createMock(function())jsmock.js (line 58)

if(this.el.dom == document.body && Ext.isIE && !config.allowScroll){

It's not a show stopper for me. The layout stuff probably belongs in functional tests anyway. Just thought I'd mention it. Thanks for the great library!

Tim Greiser