I have a test setup using Jasmine to write my tests. I use Ext.Loader so I do not need to include all my class files into the test index page. However, using this setup I run into problems when I load models with associations. Normally, when an instance of a model is created, a method is created for each association. This does not happen when using Ext.Loader to load the required association models synchronously.

For example when I run the below sampel code for a very simple LoginModel with one hasMany association of ValidationRuleModel the following happens:
- The first 3 tests pass, the 'LoginModel should have a validationRules method' fails, however,
- The last test, checking the existence of the validationRules method passes, because now I created an instance of ValidationRuleModel first, forcing Ext.Loader to load the model.

I believe this is a bug in the Ext.Loader.

Code:
describe('Ext.Loader', function () {
    var createLoginModel, createValidationRuleModel;

    createLoginModel = function () {
        return Ext.create('GenForm.model.user.LoginModel');
    };

    createValidationRuleModel = function () {
        return Ext.create('GenForm.model.validation.ValidationRuleModel');
    };

    it('should be enabled', function () {
        expect(Ext.Loader.config.enabled).toBe(true);
    });

    it('should have a GenForm path', function () {
        expect(Ext.Loader.config.paths.GenForm).toBeDefined();
    });

    it('GenForm.model.user.LoginModel can be created', function () {
        expect(createLoginModel()).toBeDefined();
    });

    it('LoginModel should have validationRules method', function () {
        expect(createLoginModel().validationRules).toBeDefined();
    });

    it('LoginModel should have validationRules after creating ValidationRuleModel', function () {
        createValidationRuleModel();
        expect(createLoginModel().validationRules).toBeDefined();
    });
});