Fix backup retention tests
This commit is contained in:
@@ -121,13 +121,15 @@ describe('retention policy', function () {
|
||||
{ id: '1', creationTime: moment().toDate() },
|
||||
{ id: '2', creationTime: moment().subtract(3, 'h').toDate() },
|
||||
{ id: '3', creationTime: moment().subtract(26, 'h').toDate() },
|
||||
{ id: '4', creationTime: moment().subtract(5, 'd').toDate() }
|
||||
{ id: '4', creationTime: moment().subtract(5, 'd').toDate() },
|
||||
{ id: '5', creationTime: moment().subtract(10, 'd').toDate() }
|
||||
];
|
||||
backups._applyBackupRetentionPolicy(b, { keepDaily: 2, keepMonthly: 6, keepYearly: 1 });
|
||||
expect(b[0].keepReason).to.be('keepDaily'); // today
|
||||
expect(b[1].keepReason).to.be('keepMonthly');
|
||||
expect(b[2].keepReason).to.be('keepDaily'); // yesterday
|
||||
expect(b[3].keepReason).to.be('keepYearly');
|
||||
expect(b[3].keepReason).to.be('keepMonthly');
|
||||
expect(b[4].keepReason).to.be('keepYearly');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user