Rally Unit Test Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL

70 Views Asked by At

I'm writing a unit test on a mixin and I'm getting a Jasmine timeout error. I added:

jasmine.DEFAULT_TIMEOUT_INTERVAL = 9999999;

This timeouts on PhantomJS. Everything runs fine and it fails on expect. Here is my code:

var Ext;

Ext = window.Ext4 || window.Ext;
Ext.require('lib.miniDataIntegrityGrid');
//jasmine.DEFAULT_TIMEOUT_INTERVAL = 9999999;

describe('Test suite for Team Report MiniDataIntegrityGrid', function () {
    var app;
beforeEach(function () {
    app = Ext.create('lib.MiniDataIntegrityGrid', Ext.merge({
        context: Ext.create('Rally.app.Context', {
            initialValues: {
                project: Rally.environment.getContext().getProject(),
                workspace: Rally.environment.getContext().getWorkspace(),
                user: Rally.environment.getContext().getUser(),
                subscription: Rally.environment.getContext().getSubscription()
            }
        }),
        renderTo: 'testDiv',
        height: 500
    }));

});

it('should GET Mini Data Integrity Store Data', function (done) {
    var UserStoryRecords = Rally.test.Mock.dataFactory.getRecords('hierarchicalrequirement', { count: 10 });
    app.PortfolioItemTypes = ['Feature', 'Epic', 'BusinessObjective'];
    app.ReleaseRecord = Rally.test.Mock.dataFactory.getRecord('Release');
    var data = _.map(UserStoryRecords, function (item) {
        return item.data;

    });
    app.UserStoryStore = Ext.create('Rally.data.Store', {
        fields: ['Name', 'DirectChildrenCount', 'ObjectID', 'Release', 'PlanEstimate', 'Iteration', 'Feature', 'ScheduleState'],
        data: data
    });
    app.ExtraDataIntegrityUserStoriesStore = Ext.create('Rally.data.Store', {
        fields: ['Name', 'DirectChildrenCount', 'ObjectID', 'Release', 'PlanEstimate', 'Iteration', 'Feature', 'ScheduleState'],
        data: [data[0]]
    });
    var miniDataIntegrityRecord = app.getMiniDataIntegrityStoreData();
    expect(miniDataIntegrityRecord[0]).toEqual(jasmine.objectContaining({ title: "Unsized Stories", userStories: 0 }))
        .toThrowError(TypeError, 'Rally.example.test.Calculator.add: Expected numeric value');
    done();
});
   });

Thanks a lot.

0

There are 0 best solutions below