Siesta allows us to create unit test suites which allow us to exercise non-UI logic. We will write some simple tests for our BizDash.config.Config
class to test its methods. A slightly cut down version of this class is shown here:
Ext.define('BizDash.config.Config', { extend: 'Ext.util.Observable', singleton: true, config: { version: '0.0.1-0' ... }, ... getBuildNumber: function() { var versionSplit = this.getVersion().split('-'); return versionSplit[1]; }, applyVersion: function(newVersion, oldVersion){ return newVersion; }, updateVersion: function(newVersion, oldVersion){ if(this.hasListeners) { this.fireEvent('versionchanged', newVersion, oldVersion); } } });
We will start by adding the Siesta framework files to our project folder; these can be downloaded from the Siesta website (http://www.bryntum.com/products/siesta/).