Fix tests
This commit is contained in:
@@ -39,10 +39,6 @@ describe('backuptask', function () {
|
||||
await settings.setBackupConfig(backupConfig);
|
||||
});
|
||||
|
||||
after(function () {
|
||||
fs.rmSync(backupConfig.backupFolder, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
async function createBackup() {
|
||||
const taskId = await backups.startBackupTask({ username: 'test' });
|
||||
|
||||
@@ -76,7 +72,7 @@ describe('backuptask', function () {
|
||||
|
||||
const result = await createBackup();
|
||||
expect(fs.statSync(path.join(backupConfig.backupFolder, 'snapshot/box.tar.gz')).nlink).to.be(2); // hard linked to a rotated backup
|
||||
expect(fs.statSync(path.join(backupConfig.backupFolder, `${result.id}.tar.gz`)).nlink).to.be(2);
|
||||
expect(fs.statSync(path.join(backupConfig.backupFolder, `${result.remotePath}.tar.gz`)).nlink).to.be(2);
|
||||
|
||||
backupInfo1 = result;
|
||||
});
|
||||
@@ -90,8 +86,12 @@ describe('backuptask', function () {
|
||||
|
||||
const result = await createBackup();
|
||||
expect(fs.statSync(path.join(backupConfig.backupFolder, 'snapshot/box.tar.gz')).nlink).to.be(2); // hard linked to a rotated backup
|
||||
expect(fs.statSync(path.join(backupConfig.backupFolder, `${result.id}.tar.gz`)).nlink).to.be(2); // hard linked to new backup
|
||||
expect(fs.statSync(path.join(backupConfig.backupFolder, `${backupInfo1.id}.tar.gz`)).nlink).to.be(1); // not hard linked anymore
|
||||
expect(fs.statSync(path.join(backupConfig.backupFolder, `${result.remotePath}.tar.gz`)).nlink).to.be(2); // hard linked to new backup
|
||||
expect(fs.statSync(path.join(backupConfig.backupFolder, `${backupInfo1.remotePath}.tar.gz`)).nlink).to.be(1); // not hard linked anymore
|
||||
});
|
||||
|
||||
it('cleanup', function () {
|
||||
fs.rmSync(backupConfig.backupFolder, { recursive: true, force: true });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user