我正在对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();
});
});
非常感谢。