Rally Unit Test Timeout - 在jasmine.DEFAULT_TIMEOUT_INTERVAL指定的超时时间内未调用异步回调

时间:2018-03-12 23:02:26

标签: sdk rally appsdk2

我正在对mixin编写单元测试,我收到了Jasmine超时错误。我补充说:

jasmine.DEFAULT_TIMEOUT_INTERVAL = 9999999;

PhantomJS上的超时。一切都运行良好,它没有预期。这是我的代码:

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();
});
   });

非常感谢。

0 个答案:

没有答案