morning-builds-core
Version:
Core functionality for Morning Builds
38 lines • 1.53 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
jest.mock('firebase-crud');
jest.mock('../src/store');
jest.mock('../src/clients');
jest.mock('../src/managers');
var firebase_crud_1 = require("firebase-crud");
var object_helper_1 = require("./object-helper");
var report_1 = require("../src/actions/report");
var store_1 = require("../src/store");
var clients_1 = require("../src/clients");
var managers_1 = require("../src/managers");
describe('report', function () {
var firebaseCrud = new firebase_crud_1.default({ apiKey: '', projectId: '' });
var store = new store_1.Store(firebaseCrud);
var clients = new clients_1.Clients(object_helper_1.config);
var managers = new managers_1.Managers(clients);
var reportAction = new report_1.Report(store, clients, managers);
describe('#summary()', function () {
it('correctly builds the summary with different reasons', function () {
var failReasons = reportAction.summary([
'Infrastructure error',
'Infrastructure error',
'Infrastructure error',
'Infrastructure error',
'Merge conflict',
]);
expect(failReasons).toEqual({
total: 5,
reasonsCount: [
{ reason: 'Infrastructure error', count: 4 },
{ reason: 'Merge conflict', count: 1 }
]
});
});
});
});
//# sourceMappingURL=report-action-test.js.map