Get help with testing, discuss unit testing strategies etc.


Post by mfearby »

I've found some more time to try to get some testing going for my Ext JS applications, so I downloaded the latest version (4.2.1-lite) and followed the Getting Started guide (https://www.bryntum.com/docs/siesta/#!/g ... ng_started).

My harness preload is as follows:
    preload     : [
        // version of ExtJS used by your application 
        // (not needed if you use Sencha Cmd which builds a complete 'all-file' including Ext JS itself)
        //'ext-all.css',
        //'ext-all-debug.js',

        // Your application files
        '../build/testing/App/resources/App-all.css',
        '../build/testing/App/app.js'
    ]
But the sanity test is failing with the following error:
TypeError: Cannot set property 'classic' of undefined
    at https://localhost/MySite/build/testing/App/app.js:987:54
Line 987 looks like this:
Ext.platformTags.modern = !(Ext.platformTags.classic = Ext.isClassic = true);
Could this be because of the microloader guff that Sencha Cmd stuffs inside a script tag in my index.html? I'm guessing we can't simply add the app.js and app-all.css to our harness and have to do something else as well? Since I'm building my app with Cmd, I've commented out the other two lines in the preload setting because I'm not including them when I deploy my Cmd-built apps anyway. My testing App.js is 7,567 KB and I'm using Ext JS 6.2 classic toolkit.

Thanks.

Post by nickolay »

Yes, this is something related to microloader. The best way to test the app as a whole is to use "pageUrl": https://bryntum.com/docs/siesta/#!/api/S ... fg-pageUrl

Plus, you may need to disable the start of the app (so that only required classes will be loaded), as described here: https://bryntum.com/docs/siesta/#!/guide ... pplication

Post by mfearby »

Thanks Nickolay, pageUrl works. I'm setting up a global singleton in my application launch method so I don't think I'll disable that, since I refer to some of its properties throughout my system.

Post Reply