-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test for getExistingBackups
- Loading branch information
Showing
4 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
33 changes: 33 additions & 0 deletions
33
desktop/test/unit/services/backup/auto-backup/get-existing-backups.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | ||
} | ||
] | ||
}); | ||
}); | ||
}); |