core: use isolated storage for each test for more reliability

This commit is contained in:
Abdullah Atta
2023-08-13 13:09:28 +05:00
committed by Abdullah Atta
parent 1190da7c91
commit d384aa9dcf
24 changed files with 852 additions and 351 deletions

View File

@@ -49,6 +49,8 @@ export default class Backup {
async export(type, encrypt = false) {
if (!validTypes.some((t) => t === type))
throw new Error("Invalid type. It must be one of 'mobile' or 'web'.");
if (encrypt && !(await this._db.user.getUser()))
throw new Error("Please login to create encrypted backups.");
let keys = await this._db.storage.getAllKeys();
let data = filterData(