Skip to content

Commit

Permalink
Add unit test for getExistingBackups
Browse files Browse the repository at this point in the history
  • Loading branch information
tkleinke committed Mar 4, 2025
1 parent 14dac19 commit 0e34c62
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { getExistingBackups } from '../../../../../src/app/services/backup/auto-backup/get-existing-backups';
import { BackupsMap } from '../../../../../src/app/services/backup/model/backups-map';


/**
* @author Thomas Kleinke
*/
describe('get existing backups', () => {

test('build backups map', () => {

const backups: BackupsMap = getExistingBackups(process.cwd() + '/test/test-data/backups');

expect(backups).toEqual({
'project': [
{
fileName: 'project.2025-01-02.10-30-20.jsonl',
creationDate: new Date('2025-01-02T10:30:20+01:00')
},
{
fileName: 'project.2025-02-03.01-02-03.jsonl',
creationDate: new Date('2025-02-03T01:02:03+01:00')
}
],
'project-with-special_characters': [
{
fileName: 'project-with-special_characters.2025-01-02.10-30-20.jsonl',
creationDate: new Date('2025-01-02T10:30:20+01:00')
}
]
});
});
});

0 comments on commit 0e34c62

Please sign in to comment.