Support for ExtJS5 MVVM and more matchers

Dec 18, 2014 at 12:00 PM

Now that the release of ExtJS 5 is few months old and ExtJS 5.1 has been released last week, are there any plans to support testing of the MVVM paradigm on things like data bindings?
In addition, what are the plans on adding Component custom matchers such as the one you would see in libraries such as jasmine-jquery ?
Let me know if you find it desirable and how we can get the community to help.

Dec 19, 2014 at 10:05 PM
Good question. Ext Spec's value has been centered around the fact that the old MVC patterns are so tightly coupled and hard to detangle; global, singleton controllers concretely bound to an application with hard references to models, stores and views. From a testing point of view it is a pretty awful design. Ext Spec takes a brute force approach to that problem that still helps greatly in detangling and isolating singleton controller business logic.

But the newer MV* patterns in Ext JS 5 are easier to decouple. A view still knows way too much about its ViewController, but that's a subject for a different day :)

So if you're using the new ViewController and ViewModel patterns, I would instead recommend using Deft JS for dependency injection and then unit test with the real Ext JS in play. I seriously can't recommend Deft enough for making Ext apps (both 4 and 5) more cohesive and naturally testable. Do it right, and there is no brute force required.

To sum up.
  • Use Ext Spec to unit test old style MVC apps with singleton controllers (they're still available in Ext JS 5).
  • Unit test the newer MV* patterns directly with the real Ext JS.
  • Add Deft JS for dependency injection (and ViewControllers in Ext JS 4).
  • Profit!